*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #ffffff;
  color: #1a1a2e;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ── App header ────────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header {
  background: #f27f18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 54px;
}

.app-header-left,
.app-header-right {
  display: flex;
  align-items: center;
}

.app-header-brand {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.9);
  font-weight: 400;
}

.app-header-brand strong {
  font-weight: 700;
  color: #fff;
}

.app-header-by {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  margin-left: 6px;
}

.user-badge-wrap {
  position: relative;
}

.user-badge {
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.user-badge:hover { background: rgba(255,255,255,0.3); }

.dash-topbar .user-badge {
  background: #fde8cc;
  border-color: #f27f18;
  color: #f27f18;
}
.dash-topbar .user-badge:hover { background: #fbd5a8; }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 160px;
  overflow: hidden;
  z-index: 300;
}

.user-menu-item {
  padding: 11px 16px;
  font-size: 0.85rem;
  color: #1a1a2e;
  cursor: pointer;
  transition: background 0.1s;
}

.user-menu-item:hover { background: #f5f5f5; }

.user-menu-sep {
  height: 1px;
  background: #f0f0f0;
}

.user-menu-logout { color: #f27f18; }

.btn-admin-header {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-right: 8px;
}

.btn-admin-header:hover { background: rgba(255,255,255,0.25); }

.btn-logout {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.25);
}

/* ── Login page ────────────────────────────────────────────── */
.login-wrapper {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 8px;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-title-accent {
  color: #f27f18;
}

.login-divider {
  width: 33%;
  border: none;
  border-top: 2px solid #f27f18;
  margin: 8px 0 16px;
}

.login-subtitle {
  font-size: 0.88rem;
  color: #777;
  margin-bottom: 20px;
  text-align: center;
}

.login-title { color: #f0f0f0; }

.login-card .form-group {
  width: 100%;
}

.login-card .form-control {
  background: #0d0d0d;
  border-color: #2e2e2e;
  color: #f0f0f0;
}

.login-card .form-control:focus { background: #0d0d0d; }
.login-card .form-control option { background: #1a1a1a; }

.login-error {
  color: #f27f18;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
}

.login-card .btn-block {
  margin-top: 8px;
}

.login-footer {
  font-size: 0.75rem;
  color: #555;
  text-align: center;
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
}

.login-footer-accent {
  color: #f27f18;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding: 24px 16px;
  }

  h1 {
    font-size: 1.5rem;
    margin-bottom: 28px;
  }

  .empty-state {
    padding: 40px 16px;
    gap: 20px;
  }

  .actions {
    gap: 16px;
  }

  .action-card {
    width: 140px;
    padding: 20px 20px;
  }

  .action-card img {
    width: 80px;
    height: 80px;
  }

  .card-body {
    padding: 20px 16px;
  }

  .wear-group {
    flex-direction: column;
  }

  .wear-unit {
    width: 100%;
  }

  .moto-grid {
    gap: 12px;
  }

  .moto-card {
    width: calc(50% - 6px);
  }
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 80px 24px;
  text-align: center;
}

.empty-state > p {
  font-size: 1.1rem;
  color: #888;
  margin-bottom: 0;
}

.completer {
  font-size: 1rem;
  color: #1a1a2e;
  font-weight: 600;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 40px 0 12px;
}

.section-hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin-bottom: 28px;
}

/* ── Action cards ──────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.actions-compact {
  justify-content: flex-start;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 16px;
  padding: 32px 40px;
  width: 180px;
  cursor: pointer;
  box-shadow: rgba(43, 43, 43, 0.5) 0px 4px 16px -6px;
  transition: border-color 0.15s;
}

.action-card:hover {
  border-color: #f27f18;
}

.action-card img {
  width: 140px;
  height: 100px;
  object-fit: contain;
}

/* ── Moto cards (garage) ───────────────────────────────────── */
.moto-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
}

.moto-card {
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  width: 180px;
  cursor: pointer;
  box-shadow: rgba(43, 43, 43, 0.5) 0px 4px 16px -6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.moto-card:hover { border-color: #f27f18; box-shadow: rgba(242, 127, 24, 0.3) 0px 4px 16px -6px; }

.moto-card-img {
  background: #eef0f3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  height: auto;
  position: relative;
}

.card-anom-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 12px;
  padding: 2px 8px;
  min-width: 22px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  line-height: 1.6;
}

.moto-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.moto-card-body {
  padding: 10px 12px;
}

.moto-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a2e;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.97); }

.btn-primary { background: #f27f18; color: #fff; }
.btn-primary:hover { background: #d96e10; }

.btn-secondary { background: #f0f0f0; color: #1a1a2e; border: 1px solid #d0d0d0; }
.btn-secondary:hover { background: #e4e4e4; }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}

.btn-back {
  background: none;
  border: none;
  color: #888;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-back:hover { color: #1a1a2e; }

/* ── Add form / Card ───────────────────────────────────────── */
.container-view {
  max-width: 1024px;
  width: 100%;
}

.card {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-body {
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.motoplanete-tip {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 20px;
}

.motoplanete-tip a {
  color: #f27f18;
  text-decoration: none;
}

.motoplanete-tip a:hover { text-decoration: underline; }

.box-info {
  font-size: 0.88rem;
  color: #ccc;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 24px 0 16px;
}

.category-title img {
  width: 1.3rem;
  height: 1.3rem;
  object-fit: contain;
}

.field-label {
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 14px;
}

.form-control {
  width: 100%;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 11px 14px;
  color: #1a1a2e;
  font-size: 0.95rem;
  appearance: none;
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus { border-color: #f27f18; background: #fff; }

.form-control option { background: #fff; }

.first-registration {
  margin-bottom: 14px;
}

.first-registration p {
  font-size: 0.88rem;
  color: #ccc;
  margin-bottom: 8px;
}

.field-hint {
  color: #777;
  font-weight: 400;
}

.preview-img {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 20px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.input-row .form-control:first-child {
  flex: 1;
}

.input-row .form-control:last-child {
  flex: 1.5;
}

.wear-group {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.wear-input {
  flex: 1;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 11px 14px;
  color: #1a1a2e;
  font-size: 0.95rem;
  outline: none;
}

.wear-input:focus { border-color: #f27f18; background: #fff; }

.wear-unit {
  flex: 2;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 11px 14px;
  color: #1a1a2e;
  font-size: 0.88rem;
  appearance: none;
  outline: none;
  cursor: pointer;
}

.wear-unit:focus { border-color: #f27f18; }
.wear-unit option { background: #fff; }

.text-center { text-align: center; }

.file-upload {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  gap: 10px;
  transition: border-color 0.15s;
}

.file-upload:hover { border-color: #f27f18; }

.file-upload input[type="file"] {
  display: none;
}

.file-upload span:first-of-type {
  flex: 1;
  font-size: 0.9rem;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-upload-btn {
  font-size: 1.1rem;
}

.hint-bottom {
  font-size: 0.88rem;
  color: #777;
  margin-top: 12px;
  margin-bottom: 0;
}

/* ── Admin view ────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-th {
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
  background: #f8f9fb;
}

.admin-td {
  padding: 12px 20px;
  font-size: 0.88rem;
  color: #1a1a2e;
  border-bottom: 1px solid #f0f0f0;
}

.admin-user-row:last-child .admin-td { border-bottom: none; }

.admin-td-action { text-align: right; }

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-admin { background: #3a1a00; color: #f27f18; }
.role-user  { background: #1a2a1a; color: #4ade80; }

.user-blocked td { opacity: 0.5; }

.blocked-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #3a0000;
  color: #f87171;
  vertical-align: middle;
}

.btn-edit-user, .btn-block-user, .btn-del-user {
  background: none;
  border: 1px solid #333;
  color: #888;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  margin-left: 4px;
}

.btn-edit-user:hover  { border-color: #f27f18; color: #f27f18; }
.btn-block-user:hover { border-color: #f59e0b; color: #f59e0b; }
.btn-unblock:hover    { border-color: #22c55e; color: #22c55e; }
.btn-del-user:hover   { border-color: #ef4444; color: #ef4444; }

/* ═══════════════════════════════════════════════════════════════
   MOTO DASHBOARD — full-page overlay
   ═══════════════════════════════════════════════════════════════ */

.moto-dashboard {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f2f4f7;
  color: #1a1a2e;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.dash-sidebar {
  width: 220px;
  min-width: 220px;
  background: #0d0d10;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.dash-sidebar-bottom { margin-top: auto; }
.dash-nav-sep { border-top: 1px solid #1c1c22; margin: 8px 0; }

.dash-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 18px 18px;
  border-bottom: 1px solid #1c1c22;
}

.dash-logo-badge {
  background: #f27f18;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.96rem;
  color: #fff;
  padding: 6px 10px;
  white-space: nowrap;
}

.dash-logo-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f0f0f0;
  line-height: 1.2;
}

.dash-nav {
  padding: 14px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #888;
  transition: background 0.12s, color 0.12s;
  user-select: none;
}

.dash-nav-item:hover { background: #18181e; color: #ddd; }

.dash-nav-item.active {
  background: #1e1e2e;
  color: #fff;
  font-weight: 600;
}

.dash-nav-item.active svg { color: #f27f18; }

.dash-nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }

.dash-nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  padding: 8px 16px 2px;
}

.dash-nav-item-sub {
  padding: 7px 16px 7px 28px;
  font-size: 0.82rem;
}

.history-view { padding: 8px 0; }

.history-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  border-bottom: 1px solid #23232f;
}

.history-row:last-child { border-bottom: none; }

.history-row-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-date {
  font-size: 0.8rem;
  color: #888;
}

.history-km {
  font-size: 0.8rem;
  color: #f27f18;
  font-weight: 600;
}

.history-desc {
  font-size: 0.88rem;
  color: #ccc;
  white-space: pre-wrap;
}

.history-doc {
  margin-top: 4px;
}

.history-doc a {
  font-size: 0.82rem;
  color: #f27f18;
  text-decoration: none;
}

.history-doc a:hover { text-decoration: underline; }

.history-empty {
  padding: 32px 20px;
  text-align: center;
  color: #555;
  font-size: 0.9rem;
}

.doc-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.doc-mode-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
  background: #222;
  color: #888;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.doc-mode-btn.active {
  background: #1a3050;
  border-color: #4a7faa;
  color: #8ab4f8;
}

.doc-mode-btn:hover:not(.active) {
  background: #2e2e2e;
  color: #bbb;
}

.doc-selected-label {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #8ab4f8;
}

.history-edit {
  margin-left: auto;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.history-edit:hover { color: #8ab4f8; background: #1a2030; }

.history-delete {
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.history-delete:hover { color: #e55; background: #2a1a1a; }

.dash-upgrade {
  margin: 10px;
  padding: 16px;
  background: linear-gradient(135deg, #f27f18 0%, #c96a00 100%);
  border-radius: 12px;
  text-align: center;
}

.dash-upgrade-title {
  font-size: 0.8rem;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.5;
}

.btn-upgrade {
  background: none;
  border: none;
  color: #fff;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.12s;
}

.btn-upgrade:hover { color: #f27f18; }

/* ── Main area ───────────────────────────────────────────────── */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.dash-topbar {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dash-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back-dash {
  background: none;
  border: 1px solid #e0e0e0;
  color: #666;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
  transition: background 0.12s;
}

.btn-back-dash:hover { background: #f4f4f4; color: #333; }

.dash-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
}

.dash-bc-parent { color: #9ca3af; cursor: pointer; }
.dash-bc-parent:hover { color: #f27f18; }
.dash-bc-sep { color: #d1d5db; }
.dash-bc-current { font-weight: 700; color: #1a1a2e; }

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-user-pill {
  background: #f3f4f6;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: #555;
  font-weight: 600;
}

.dash-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.dash-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  overflow: hidden;
}

.dash-grid-top,
.dash-grid-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ── Info card ───────────────────────────────────────────────── */
.info-card-inner {
  display: flex;
  height: 100%;
  min-height: 280px;
}

.moto-photo-wrap {
  width: 42%;
  background: #f8f9fb;
  border-right: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  flex-shrink: 0;
}

.dash-moto-photo {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 12px;
}

.info-fields {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.info-section-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #b0b0b8;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.info-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-icon-blue   { background: #eff6ff; color: #2563eb; }
.info-icon-grey   { background: #f3f4f6; color: #6b7280; }
.info-icon-purple { background: #f5f3ff; color: #7c3aed; }
.info-icon-orange { background: #fff7ed; color: #f27f18; }
.info-icon-green  { background: #f0fdf4; color: #16a34a; }

.info-row-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.info-row-label {
  font-size: 0.68rem;
  color: #9ca3af;
  font-weight: 500;
  white-space: nowrap;
}

.info-row-value {
  font-size: 0.85rem;
  color: #1a1a2e;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-edit-km {
  margin-top: auto;
  padding-top: 12px;
  background: none;
  border: 1px solid #f27f18;
  color: #f27f18;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
  align-self: flex-start;
  transition: background 0.12s;
}

.btn-edit-km:hover { background: #fff7ed; }

/* ── Chart card ──────────────────────────────────────────────── */
.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 4px;
}

.chart-card-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #b0b0b8;
  text-transform: uppercase;
}

.chart-tabs {
  display: flex;
  gap: 4px;
}

.chart-tab {
  background: none;
  border: 1px solid #3a3a4a;
  border-radius: 6px;
  color: #b0b0b8;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chart-tab:hover {
  border-color: #f27f18;
  color: #f27f18;
}

.chart-tab.active {
  background: #f27f18;
  border-color: #f27f18;
  color: #fff;
}

.btn-add-km {
  background: none;
  border: none;
  color: #f27f18;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-add-km:hover { text-decoration: underline; }

.chart-wrap {
  flex: 1;
  padding: 8px 16px 16px;
  position: relative;
}

.chart-wrap canvas { display: block; touch-action: pan-y; }

.km-chart-reset {
  position: absolute;
  top: 12px;
  right: 20px;
  background: #1a1a24;
  color: #e5e7eb;
  border: 1px solid #3a3a50;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 11;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.km-chart-reset:hover { border-color: #f27f18; color: #f27f18; }

.km-chart-tip {
  position: absolute;
  background: #1a1a24;
  border: 1px solid #3a3a50;
  border-radius: 8px;
  padding: 6px 12px;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  z-index: 10;
}
.km-chart-tip-date { font-size: 0.75rem; color: #9ca3af; margin-bottom: 2px; }
.km-chart-tip-km   { font-size: 0.95rem; font-weight: 700; color: #f27f18; }

/* ── Stats row ───────────────────────────────────────────────── */
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.stat-number {
  font-size: 1.9rem;
  font-weight: 800;
  color: #1a1a2e;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.72rem;
  color: #9ca3af;
  font-weight: 500;
}

.stat-ok    { color: #16a34a !important; font-size: 1.6rem !important; }
.stat-alert { color: #dc2626 !important; }

.catalogue-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-custom-block {
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.cat-search-bar {
  position: relative;
  display: flex;
  align-items: center;
}

.cat-search-input {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #f9fafb;
}

.cat-search-input:focus {
  outline: none;
  border-color: #f27f18;
  background: #fff;
}

.cat-search-clear {
  position: absolute;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-search-clear:hover { background: #f3f4f6; color: #374151; }

.catalogue-iframe {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #f9fafb;
}

.cat-section-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-section-tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-section-tab:hover {
  border-color: #4a6fa5;
  color: #4a6fa5;
}

.cat-section-tab.active {
  background: #4a6fa5;
  border-color: #4a6fa5;
  color: #fff;
}

.cat-section-thumb {
  border-radius: 10px;
  overflow: hidden;
  max-height: 160px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

.cat-thumb-img {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  transition: opacity 0.15s;
}

.cat-section-thumb:hover .cat-thumb-img {
  opacity: 0.7;
}

.cat-thumb-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.cat-section-thumb:hover .cat-thumb-hint {
  opacity: 1;
}

/* Lightbox */

.cat-groups {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-group {
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid #e5e7eb;
}

.cat-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}

.cat-group-header:hover {
  background: #f0f4fa;
}

.cat-group-header.open {
  background: #e8eef7;
  border-bottom: 1.5px solid #c7d5eb;
}

.cat-group-id {
  font-size: 0.7rem;
  font-weight: 700;
  color: #4a6fa5;
  background: #dce8f7;
  border-radius: 6px;
  padding: 2px 7px;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.cat-group-name {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1e293b;
}

.cat-group-chevron {
  font-size: 0.65rem;
  color: #9ca3af;
}

.cat-group-items {
  background: #fff;
  border-top: 1px solid #f0f0f0;
  padding: 4px 0;
}

.cat-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 8px 20px;
  text-decoration: none;
  color: #374151;
  font-size: 0.82rem;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.1s;
}

.cat-item-row:last-child {
  border-bottom: none;
}

.cat-item-row:hover {
  background: #f0f7ff;
  color: #1d4ed8;
}

.cat-item-name {
  flex: 1;
}

.cat-item-arrow {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-left: 8px;
}

.stat-sublabel {
  font-size: 0.68rem;
  color: #b0b7c3;
  margin-top: 3px;
}

/* ── Maintenance & activity cards ────────────────────────────── */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f5f5f7;
}

.card-section-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #b0b0b8;
  text-transform: uppercase;
}

.btn-add-item {
  background: none;
  border: none;
  color: #f27f18;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-add-item:hover { text-decoration: underline; }

.maint-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  border-bottom: 1px solid #f8f8fa;
  transition: background 0.1s;
}

.maint-row:last-child { border-bottom: none; }
.maint-row:hover { background: #fafafa; }

.urgency-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-red    { background: #ef4444; }
.dot-orange { background: #f27f18; }
.dot-green  { background: #22c55e; }
.dot-grey   { background: #d1d5db; }

.maint-info {
  flex: 1;
  min-width: 0;
}

.maint-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: #1a1a2e;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.maint-cat {
  font-size: 0.72rem;
  color: #9ca3af;
  display: block;
}

.km-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-orange { background: #fff7ed; color: #f27f18; }
.badge-green  { background: #f0fdf4; color: #16a34a; }

.btn-maint-done {
  background: none;
  border: none;
  color: #22c55e;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background 0.1s;
}

.btn-maint-done:hover { background: #f0fdf4; }

.btn-maint-del {
  background: none;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 3px 6px;
  border-radius: 5px;
  transition: color 0.1s;
}

.btn-maint-del:hover { color: #ef4444; }

.activity-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 20px;
  border-bottom: 1px solid #f8f8fa;
}

.activity-row:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f27f18;
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-info {
  flex: 1;
  min-width: 0;
}

.activity-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #1a1a2e;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-km {
  font-size: 0.72rem;
  color: #9ca3af;
  display: block;
}

.activity-date {
  font-size: 0.72rem;
  color: #9ca3af;
  flex-shrink: 0;
  margin-top: 3px;
}

.empty-section {
  padding: 28px 20px;
  color: #9ca3af;
  font-size: 0.85rem;
  text-align: center;
}

.link-action { color: #f27f18; cursor: pointer; }
.link-action:hover { text-decoration: underline; }

.show-all-link {
  text-align: center;
  padding: 10px;
  color: #f27f18;
  font-size: 0.78rem;
  cursor: pointer;
  border-top: 1px solid #f5f5f7;
}

.show-all-link:hover { text-decoration: underline; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ── Document viewer ───────────────────────────────────────── */
.doc-viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.doc-viewer-box {
  background: #1a1a24;
  border-radius: 14px;
  width: 96vw;
  height: 94vh;
  max-width: 98vw;
  max-height: 98vh;
  min-width: 340px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  resize: both;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #2a2a3a;
  gap: 10px;
  flex-shrink: 0;
}

.doc-viewer-name {
  font-size: 0.9rem;
  color: #ccc;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-viewer-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: #111;
}
.doc-viewer-body.zoomed {
  align-items: flex-start;
  justify-content: flex-start;
}

.doc-viewer-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.doc-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
}

.doc-viewer-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.doc-zoom-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: #2a2a3a;
  color: #ddd;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-zoom-btn:hover { background: #383850; }
.doc-zoom-label {
  font-size: 0.78rem;
  color: #9ca3af;
  min-width: 38px;
  text-align: center;
}

.doc-viewer-unsupported {
  color: #888;
  text-align: center;
  padding: 40px;
  line-height: 2;
}

.doc-viewer-unsupported a { color: #f27f18; }

.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #9ca3af;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: #1a1a2e; }

.modal-body {
  padding: 20px 24px 0;
}

.modal-body .form-group { margin-bottom: 14px; }

.modal-body .form-control {
  background: #f9fafb;
  border-color: #e5e7eb;
  color: #1a1a2e;
}

.modal-body .form-control:focus { border-color: #f27f18; background: #fff; }

.modal-body textarea.form-control { resize: vertical; min-height: 80px; }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
}

/* ── Fiche moto tab ──────────────────────────────────────────── */
.fiche-view { max-width: 900px; }

.fiche-header {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  margin-bottom: 18px;
}
.fiche-edit-btn { margin-left: auto; flex-shrink: 0; }

.fiche-moto-photo {
  width: 150px;
  height: 90px;
  object-fit: contain;
  background: #f8f9fb;
  border-radius: 10px;
  flex-shrink: 0;
}

.fiche-moto-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px;
}

.fiche-moto-year { color: #9ca3af; font-size: 0.9rem; margin: 0; }

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.spec-group {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.spec-group-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #b0b0b8;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid #f5f5f7;
  gap: 10px;
}

.fiche-notes {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  margin-top: 14px;
}

.fiche-notes-text {
  white-space: pre-wrap;
  color: #3a3a42;
  font-size: 0.92rem;
  line-height: 1.5;
}

.spec-row:last-child { border-bottom: none; }

.spec-label { font-size: 0.8rem; color: #9ca3af; flex-shrink: 0; }

.spec-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1a1a2e;
  text-align: right;
  word-break: break-word;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dash-sidebar { width: 56px; min-width: 56px; }
  .dash-logo-name, .dash-nav-item span, .dash-upgrade-title, .btn-upgrade { display: none; }
  .dash-logo { justify-content: center; padding: 18px 0; }
  .dash-nav-item { justify-content: center; padding: 12px; }
  .dash-upgrade { padding: 10px; }
  .dash-grid-top, .dash-grid-bottom, .spec-grid { grid-template-columns: 1fr; }
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); }
  .info-card-inner { flex-direction: column; }
  .moto-photo-wrap { width: 100%; border-right: none; border-bottom: 1px solid #f0f0f0; height: 160px; }
}

/* ── Contrôles tab ───────────────────────────────────────────── */
.ctrl-view { max-width: 800px; }
.ctrl-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ctrl-title { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; margin: 0 0 2px; }
.ctrl-subtitle { font-size: 0.82rem; color: #888; margin: 0; }
.ctrl-progress { height: 4px; background: #e8e8e8; border-radius: 2px; margin-bottom: 16px; }
.ctrl-progress-bar { height: 100%; background: #f27f18; border-radius: 2px; transition: width 0.3s; }

.ctrl-diagram-wrap { display: flex; flex-direction: column; gap: 12px; }
.ctrl-diagram {
  position: relative;
  width: 100%;
  background: #f8f9fb;
  border-radius: 12px;
  overflow: hidden;
}
.ctrl-moto-img { width: 100%; display: block; }
.ctrl-dot {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 0;
}
.ctrl-dot:hover, .ctrl-dot.active {
  transform: translate(-50%, -50%) scale(1.4);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.8), 0 4px 12px rgba(0,0,0,0.3);
}
.ctrl-dot::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.2;
  animation: ctrl-pulse 2s infinite;
}
@keyframes ctrl-pulse {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.5); opacity: 0; }
}

.ctrl-panel {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 16px;
  box-shadow: rgba(43,43,43,0.5) 0px 4px 16px -6px;
}
.ctrl-panel-title { font-weight: 700; color: #1a1a2e; margin-bottom: 6px; }
.ctrl-panel-desc { font-size: 0.85rem; color: #555; margin-bottom: 12px; line-height: 1.5; }
.ctrl-panel-radios { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ctrl-radio {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.ctrl-radio input { display: none; }
.ctrl-radio:hover { border-color: #f27f18; }
.ctrl-radio.selected-ok { background: #f0fdf4; border-color: #16a34a; color: #16a34a; }
.ctrl-radio.selected-anomalie { background: #fef2f2; border-color: #dc2626; color: #dc2626; }
.ctrl-comment { margin-top: 4px; font-size: 0.85rem; }

.ctrl-legend { display: flex; gap: 16px; margin-top: 12px; }
.ctrl-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #666; }
.ctrl-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination-info { font-size: 0.78rem; color: #999; }
.pagination-row { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 0 2px; }
.btn-page {
  background: #f3f4f6; border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 4px 12px; cursor: pointer; font-size: 0.85rem; color: #333;
}
.btn-page:hover:not(:disabled) { border-color: #f27f18; color: #f27f18; }
.btn-page:disabled { opacity: 0.35; cursor: default; }

/* ── Workshop type picker ────────────────────────────────────── */
.workshop-type-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
}
.workshop-type-btn {
  background: #f8f9fb;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1a1a2e;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.workshop-type-btn:hover {
  border-color: #f27f18;
  background: #fff7ed;
  color: #f27f18;
}

/* ── Settings tab ───────────────────────────────────────────── */
.settings-view { max-width: 700px; display: flex; flex-direction: column; gap: 16px; }
.settings-card-body { padding: 14px 20px 18px; }
.settings-maint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f5f5f7;
}
.settings-maint-row:last-child { border-bottom: none; }
.settings-maint-info { display: flex; flex-direction: column; gap: 4px; }
.settings-maint-name { font-size: 0.9rem; font-weight: 600; color: #1a1a2e; }
.settings-maint-name.has-tooltip { cursor: help; position: relative; }
.settings-maint-name.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0; top: calc(100% + 6px);
  background: #1a1a2e;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: pre-wrap;
  width: max-content;
  min-width: 200px;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}
.settings-maint-name.has-tooltip:hover::after { opacity: 1; }
.settings-maint-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-maint-actions { display: flex; gap: 6px; }
.btn-maint-edit {
  background: none; border: 1px solid #d0d0d0; border-radius: 6px;
  padding: 4px 8px; cursor: pointer; font-size: 0.8rem; color: #555;
}
.btn-maint-edit:hover { border-color: #f27f18; color: #f27f18; }

/* ── Profile page ───────────────────────────────────────────── */
.profile-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 48px;
}
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}
.profile-username {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 4px;
}
.profile-email {
  font-size: 0.9rem;
  color: #666;
}
.profile-no-email { color: #aaa; font-style: italic; }

.profile-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 14px 0;
}
.profile-card {
  background: #fdfdfd;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  padding: 20px;
  box-shadow: rgba(43,43,43,0.5) 0px 4px 16px -6px;
}
.reminders-box { font-size: 0.9rem; }
.reminders-status { font-weight: 600; margin-bottom: 6px; }
.reminders-hint { color: #6b7280; font-size: 0.82rem; margin-bottom: 12px; line-height: 1.4; }
.reminders-lead { margin-bottom: 12px; }
.reminders-lead label { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #374151; }
.reminders-lead-sel { width: auto; display: inline-block; padding: 4px 8px; }
.reminders-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-card-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 14px;
}
.profile-pwd-form { display: flex; flex-direction: column; gap: 10px; }
.profile-pwd-form .btn { align-self: flex-start; margin-top: 4px; }
.prof-msg { font-size: 0.85rem; margin: 0; }
.prof-msg-error   { color: #f27f18; }
.prof-msg-success { color: #16a34a; }

/* ── Catalogue parts panel ───────────────────────────────── */
.cat-item-wrap { border-bottom: 1px solid #f0f0f0; }
.cat-item-wrap:last-child { border-bottom: none; }

.cat-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 20px;
  cursor: pointer;
  color: #374151;
  font-size: 0.82rem;
  transition: background 0.1s;
  user-select: none;
}
.cat-item-row:hover { background: #f0f7ff; }
.cat-item-row:hover .cat-item-arrow { color: #f27f18; transform: translateX(2px); }

.cat-item-count {
  font-size: 0.7rem;
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: auto;
  flex-shrink: 0;
}

.cat-item-arrow {
  font-size: 1rem;
  color: #d1d5db;
  flex-shrink: 0;
  transition: color .15s, transform .15s;
}

.cat-parts-panel {
  background: #f8faff;
  border-top: 1px solid #e0e8f7;
  padding: 12px 16px;
}

.cat-parts-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cat-parts-count {
  font-size: 0.75rem;
  color: #6b7280;
}

.cat-diag-btn {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #c7d5eb;
  background: #fff;
  color: #4a6fa5;
  cursor: pointer;
  transition: background 0.12s;
}
.cat-diag-btn:hover { background: #e8eef7; }

.cat-parts-extlink {
  font-size: 0.72rem;
  color: #9ca3af;
  text-decoration: none;
  margin-left: auto;
}
.cat-parts-extlink:hover { color: #4a6fa5; text-decoration: underline; }

.cat-parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.cat-parts-table thead tr {
  background: #e8eef7;
}
.cat-parts-table th {
  padding: 5px 8px;
  text-align: left;
  font-weight: 600;
  color: #4a6fa5;
  font-size: 0.72rem;
  white-space: nowrap;
}
.cat-part-row:nth-child(even) { background: #f0f4fb; }
.cat-part-row td { padding: 5px 8px; vertical-align: top; }

.cat-part-code {
  font-weight: 700;
  color: #4a6fa5;
  text-align: center;
  white-space: nowrap;
  width: 36px;
}
.cat-part-ref {
  font-family: monospace;
  font-size: 0.8rem;
  white-space: nowrap;
  color: #111;
}
.cat-part-repl {
  font-size: 0.72rem;
  color: #f27f18;
}
.cat-part-qty {
  font-size: 0.72rem;
  color: #6366f1;
  font-weight: 600;
}
.cat-part-name { color: #1e293b; }
.cat-part-note { color: #6b7280; font-size: 0.72rem; }

.cat-parts-empty {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
  padding: 8px 0;
}

.catalogue-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  text-align: center;
}
.catalogue-unavailable-icon { font-size: 2.5rem; opacity: 0.4; }
.catalogue-unavailable-title { font-size: 1.1rem; font-weight: 600; color: #374151; }
.catalogue-unavailable-sub { font-size: 0.85rem; color: #9ca3af; }

/* ── Catalogue: loading, search, admin ─────────────────── */
.cat-loading {
  padding: 40px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
}
.cat-empty {
  color: #9ca3af;
  text-align: center;
  font-size: 0.85rem;
}
.cat-toolbar-row {
  display: flex;
  justify-content: flex-end;
  padding: 4px 8px;
}
.cat-add-btn {
  background: none;
  border: 1px dashed #6b7280;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  color: #6b7280;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cat-add-btn:hover { border-color: #f27f18; color: #f27f18; }

.cat-edit-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  color: #374151;
  transition: background .15s;
}
.cat-edit-btn:hover { background: #f1f5f9; }
.cat-del-btn { color: #dc2626 !important; border-color: #fecaca; }
.cat-del-btn:hover { background: #fef2f2 !important; }

.cat-edit-inline-btn {
  background: none;
  border: none;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.5;
  transition: opacity .15s;
}
.cat-edit-inline-btn:hover { opacity: 1; }
.cat-group-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}
.cat-tab-edit-btn {
  background: none;
  border: none;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.5;
  vertical-align: middle;
}
.cat-tab-edit-btn:hover { opacity: 1; }

.cat-copy-btn {
  background: none;
  border: none;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0 3px;
  opacity: 0.4;
  transition: opacity .15s;
  vertical-align: middle;
}
.cat-copy-btn:hover { opacity: 1; }

.cat-part-actions { white-space: nowrap; text-align: right; }
.cat-part-edit-btn, .cat-cart-btn {
  background: none;
  border: none;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0 3px;
  opacity: 0.5;
  transition: opacity .15s;
}
.cat-part-edit-btn:hover, .cat-cart-btn:hover { opacity: 1; }

/* ── Liste d'achat ───────────────────────────────────────────── */
.shop-badge {
  display: inline-block;
  background: #f27f18;
  color: #fff;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0 6px;
  margin-left: 2px;
}
.shop-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.shop-section-title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #9ca3af; margin: 14px 0 8px;
}
.shop-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; background: #fff;
}
.shop-row.shop-bought { opacity: 0.6; }
.shop-row.shop-bought .shop-name { text-decoration: line-through; }
.shop-check { background: none; border: none; font-size: 1.2rem; cursor: pointer; line-height: 1; padding: 0; color: #f27f18; }
.shop-main { flex: 1; min-width: 0; }
.shop-name { font-size: 0.9rem; font-weight: 600; color: #1e293b; }
.shop-qty { color: #f27f18; font-weight: 700; }
.shop-ref { font-size: 0.78rem; color: #6b7280; font-family: monospace; margin-top: 2px; }
.shop-note { font-size: 0.78rem; color: #6b7280; font-style: italic; margin-top: 2px; }
.shop-actions { display: flex; gap: 4px; flex-shrink: 0; }
.conso-actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.conso-actions-row .manuel-doc-add-btn { margin-bottom: 0; }
.conso-shop-link {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #374151;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.conso-shop-link:hover { border-color: #f27f18; color: #f27f18; }
.settings-sections-hint { font-size: 0.8rem; color: #6b7280; margin-bottom: 10px; }
.settings-section-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; cursor: pointer; font-size: 0.9rem; color: #374151;
  border-bottom: 1px solid #f3f4f6;
}
.settings-section-toggle:last-child { border-bottom: none; }
.settings-section-toggle input { width: 18px; height: 18px; cursor: pointer; accent-color: #f27f18; }
.cat-add-part-btn {
  margin: 10px 4px 4px;
  background: none;
  border: 1px dashed #f4a95a;
  color: #f27f18;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}
.cat-add-part-btn:hover { background: #fff7ed; }
.cat-part-form-row { display: flex; gap: 12px; }
.cat-part-form-row .form-group { flex: 1; }

/* ── Catalogue: split panel (diagram + parts) ───────────── */
.cat-split-panel {
  display: flex;
  gap: 0;
  align-items: flex-start;
  min-height: 300px;
}
.cat-diagram-wrap {
  position: relative;
  flex: 0 0 min(55%, 520px);
  background: #fff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}
.cat-diagram-inner {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
/* Boîte qui épouse exactement l'image affichée : l'overlay des points (inset:0)
   couvre donc précisément l'image, comme dans l'éditeur de points. */
.cat-diagram-imgbox {
  position: relative;
  display: block;
  width: 100%;
}
.cat-diagram-img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}
.cat-diagram-points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cat-point {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #2563eb;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 1em;
  min-width: 22px; height: 22px;
  padding: 0 3px;
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  transition: transform .12s, background .12s, box-shadow .12s;
  z-index: 2;
  white-space: nowrap;
}
.cat-point:hover {
  background: #f27f18;
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 2px 8px rgba(242,127,24,0.5);
  z-index: 3;
}
.cat-point-highlight {
  background: #dc2626 !important;
  transform: translate(-50%, -50%) scale(1.35) !important;
  box-shadow: 0 2px 10px rgba(220,38,38,0.55) !important;
  z-index: 4 !important;
}
.cat-diag-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  border-top: 1px solid #e5e7eb;
  background: #f8f9fc;
  flex-wrap: wrap;
}
.cat-diag-tool-btn {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  color: #374151;
  text-decoration: none;
  transition: background .15s;
}
.cat-diag-tool-btn:hover { background: #f3f4f6; }
.cat-diag-tool-btn.active { background: #fef3e2; border-color: #f27f18; color: #f27f18; }

/* ── Catalogue: popup item (schéma + liste) ─────────────── */
.cat-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.cat-modal-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.cat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #f8f9fc;
}
.cat-modal-title {
  font-weight: 700;
  font-size: 1rem;
  color: #1a1a2e;
}
.cat-modal-pts-toggle {
  background: #e8f0fd;
  border: 1px solid #c7d5f7;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  margin-left: auto;
  margin-right: 8px;
  white-space: nowrap;
}
.cat-modal-pts-toggle:hover { background: #c7d5f7; }
.cat-modal-pts-toggle.off { background: #f3f4f6; border-color: #d1d5db; color: #9ca3af; }
.cat-modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}
.cat-modal-close:hover { background: #f3f4f6; color: #111; }
.cat-pts-hidden .cat-diagram-points { display: none; }
.cat-modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  min-height: 0;
}
.cat-modal-body .cat-split-panel {
  flex: 1;
  min-height: 0;
  height: 100%;
  align-items: stretch;
}
.cat-modal-body .cat-diagram-wrap {
  flex: 0 0 auto;
  width: auto;
  max-width: 50%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}
.cat-modal-body .cat-diagram-inner {
  flex: 1;
  min-height: 0;
  align-items: flex-start;
  justify-content: center;
}
.cat-modal-body .cat-diagram-imgbox {
  display: inline-block;
  width: auto;
}
/* Taille intrinsèque (pas d'object-fit) → la boîte colle à l'image, donc les
   repères restent alignés, y compris pendant le zoom. */
.cat-modal-body .cat-diagram-img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: initial;
  object-position: initial;
}
.cat-modal-body .cat-parts-right {
  flex: 1 1 0;
  height: 100%;
  max-height: none;
}
@media (max-width: 700px) {
  .cat-modal-body .cat-diagram-wrap   { max-width: 100%; width: 100%; height: auto; }
  .cat-modal-body .cat-diagram-imgbox { display: block; width: 100%; }
  .cat-modal-body .cat-diagram-img    { width: 100%; height: auto; max-height: none; }
}

/* ── Catalogue: éditeur de points plein écran ────────────── */
.cat-pe-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}
.cat-pe-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  color: #fff;
}
.cat-pe-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.12);
  flex-shrink: 0;
}
.cat-pe-title {
  font-weight: 600;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-pe-hint {
  font-size: .78rem;
  color: #bbb;
  flex: 1;
  text-align: center;
}
.cat-pe-close {
  flex-shrink: 0;
  background: #f27f18;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: .85rem;
  cursor: pointer;
  font-weight: 600;
}
.cat-pe-close:hover { background: #d96a10; }
.cat-pe-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
}
.cat-pe-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.cat-pe-img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
}
.cat-pe-points {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cat-pe-point {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #f27f18;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 1em;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  font-size: .7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  pointer-events: all;
  box-shadow: 0 1px 4px rgba(0,0,0,.6);
  white-space: nowrap;
  user-select: none;
}
.cat-pe-point:hover {
  background: #e03535;
  border-color: #ff8080;
  transform: translate(-50%, -50%) scale(1.15);
}

.cat-parts-right {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: 600px;
}
.cat-parts-scroll {
  flex: 1 1 0;
  overflow-y: auto;
}
.cat-part-row { cursor: default; transition: background .1s; }
.cat-part-row:hover td { background: #f0f4ff; }
.cat-part-highlight td { background: #fef3e2 !important; outline: 2px solid #f27f18; outline-offset: -2px; }

/* ── Catalogue: search results ──────────────────────────── */
.cat-search-results {
  padding: 8px 16px 4px;
  border-bottom: 1px solid #e5e7eb;
}
.cat-result-count {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}
.cat-search-section {
  border-bottom: 1px solid #e5e7eb;
}
.cat-search-section-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f27f18;
  padding: 6px 14px 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cat-item-section-tag {
  font-size: 0.7rem;
  background: #f1f5f9;
  color: #6b7280;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Mobile / tablette : catalogue split panel stacks ───── */
@media (max-width: 700px) {
  .cat-split-panel { flex-direction: column; }
  .cat-diagram-wrap { flex: none; width: 100%; max-height: 50vh; border-right: none; border-bottom: 1px solid #e5e7eb; }
  /* Image limitée en hauteur : la boîte épouse sa largeur réelle pour garder les repères alignés. */
  .cat-diagram-imgbox { display: inline-block; width: auto; margin: 0 auto; }
  .cat-diagram-img { max-height: 50vh; width: auto; height: auto; margin: 0; }
  .cat-parts-right { max-height: none; }
}

/* ── Manuel ──────────────────────────────────────────────── */
.manuel-wrap { padding: 0 0 32px; }

.manuel-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 16px 0;
}

.manuel-vehicle-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0369a1;
  width: fit-content;
}

.manuel-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.manuel-toggle-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}
.manuel-toggle-btn:hover { border-color: #f27f18; color: #f27f18; }
.manuel-toggle-btn.active {
  background: #f27f18;
  border-color: #f27f18;
  color: #fff;
}

.manuel-content { padding: 12px 16px 0; }

.export-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.export-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: #374151;
  cursor: pointer;
}
.export-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f27f18;
  cursor: pointer;
}

.doc-cat-tag {
  font-size: 0.72rem;
  font-weight: 500;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
  align-self: center;
  flex-shrink: 0;
}

.doc-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.doc-filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}
.doc-filter-chip:hover { border-color: #f27f18; color: #f27f18; }
.doc-filter-chip.active {
  background: #f27f18;
  border-color: #f27f18;
  color: #fff;
}
.doc-cat-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.7rem;
  line-height: 1;
  background: rgba(0,0,0,0.15);
  vertical-align: middle;
  cursor: pointer;
}
.doc-filter-chip.active .doc-cat-del { background: rgba(255,255,255,0.3); }
.doc-cat-del:hover { background: #dc2626 !important; color: #fff; }
.doc-cat-add-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px dashed #d1d5db;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.15s;
}
.doc-cat-add-btn:hover { border-color: #f27f18; color: #f27f18; }

/* ── Doc sub-tabs (Documents / Factures) ─────────────────────────────────── */
.doc-sub-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-sub-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid #d1d5db;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
}

.doc-sub-tab:hover { border-color: #f27f18; color: #f27f18; }

.doc-sub-tab.active {
  background: #f27f18;
  border-color: #f27f18;
  color: #fff;
}


.notice-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #b0b0b8;
  padding: 4px 0 10px;
}

/* Engine selector */
.manuel-engine-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: fit-content;
}
.manuel-engine-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}
.manuel-engine-select {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  padding: 0 2px;
}

/* Operation cards */
.manuel-op-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s;
}
.manuel-op-card.open { box-shadow: 0 2px 12px rgba(0,0,0,0.08); border-color: #f27f18; }

.manuel-op-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
  background: #fff;
  transition: background 0.1s;
}
.manuel-op-header:hover { background: #fafafa; }
.manuel-op-card.open .manuel-op-header { background: #fff8f0; }

.manuel-op-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }

.manuel-op-info { flex: 1; min-width: 0; }
.manuel-op-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 4px;
}
.manuel-op-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.manuel-meta-item {
  font-size: 0.72rem;
  color: #6b7280;
  white-space: nowrap;
}

.manuel-op-arrow {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: #9ca3af;
  padding: 0 4px;
}

/* Op body */
.manuel-op-body {
  padding: 0 14px 14px;
  border-top: 1px solid #f3f4f6;
}
.manuel-op-intro {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.55;
  margin: 12px 0 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #94a3b8;
}

.manuel-section-block { margin-top: 14px; }
.manuel-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 8px;
}

/* Specs table */
.manuel-specs-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.manuel-specs-table tr:not(:last-child) td { border-bottom: 1px solid #f3f4f6; }
.mst-key {
  padding: 5px 8px 5px 0;
  color: #6b7280;
  width: 45%;
  vertical-align: top;
  font-weight: 500;
}
.mst-val {
  padding: 5px 0;
  color: #1e293b;
  font-weight: 600;
}

/* Tools list */
.manuel-tools-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.8;
}

/* Steps */
.manuel-steps { display: flex; flex-direction: column; gap: 10px; }
.manuel-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.manuel-step-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f27f18;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.manuel-step-content { flex: 1; min-width: 0; }
.manuel-step-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 3px;
}
.manuel-step-detail {
  font-size: 0.82rem;
  color: #374151;
  line-height: 1.5;
}

/* Callouts */
.manuel-callout {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  font-size: 0.79rem;
  line-height: 1.45;
  padding: 7px 10px;
  border-radius: 6px;
  margin-top: 7px;
}
.callout-icon { flex-shrink: 0; }
.manuel-callout.warning {
  background: #fff7ed;
  border-left: 3px solid #f59e0b;
  color: #92400e;
}
.manuel-callout.tip {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  color: #166534;
}
.manuel-global-callouts { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }

/* Docs grid */
.manuel-docs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.manuel-doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
}
.manuel-doc-card:hover {
  border-color: #f27f18;
  box-shadow: 0 2px 8px rgba(242,127,24,0.12);
  transform: translateY(-1px);
}
.manuel-doc-icon { font-size: 1.4rem; flex-shrink: 0; }
.manuel-doc-body { flex: 1; min-width: 0; }
.manuel-doc-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 2px;
}
.manuel-doc-desc {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.4;
}
.tool-cat-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}
.tool-doc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
.tool-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 6px;
  padding: 2px 4px 2px 8px;
  max-width: 100%;
}
.tool-doc-chip a {
  color: #4338ca;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.tool-doc-chip a:hover { text-decoration: underline; }
.tool-doc-chip-del, .tool-doc-chip-edit {
  border: none;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
  padding: 2px;
}
.tool-doc-chip-del:hover { color: #dc2626; }
.tool-doc-chip-edit:hover { color: #4338ca; }
.tool-doc-add {
  font-size: 0.72rem;
  color: #f27f18;
  border: 1px dashed #f4a95a;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.tool-doc-add:hover { background: #fff7ed; }
.tool-doc-chip-cover {
  border: none;
  background: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 2px;
}
.tool-doc-chip-cover:hover { color: #f59e0b; }
.tool-doc-chip-cover.active { color: #f59e0b; }
.cat-diag-preview {
  margin-bottom: 8px;
}
.cat-diag-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  display: block;
}
.cat-diag-empty {
  margin-bottom: 8px;
  padding: 16px;
  text-align: center;
  color: #9ca3af;
  font-size: 0.82rem;
  background: #f8f9fa;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
}
.cat-diag-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-diag-actions label { cursor: pointer; margin: 0; }
.tool-thumb-wrap { margin-top: 8px; }
.tool-thumb {
  max-width: 140px;
  max-height: 100px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.manuel-doc-arrow {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f27f18;
  white-space: nowrap;
}

.manuel-doc-card-wrap { position: relative; }
.manuel-doc-card-wrap.has-actions .manuel-doc-card { padding-right: 88px; }
.manuel-doc-actions {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 10px;
  display: flex;
  gap: 4px;
}
.manuel-doc-edit,
.manuel-doc-delete,
.manuel-doc-info {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.manuel-doc-edit:hover { background: #fff0e0; }
.manuel-doc-delete:hover { background: #fee2e2; }
.manuel-doc-info:hover { background: #e0f2fe; }

.info-table-body {
  align-items: flex-start !important;
  justify-content: flex-start !important;
  display: block !important;
  padding: 0;
}
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: #ddd;
}
.info-table th {
  text-align: left;
  padding: 10px 14px;
  background: #1a1a24;
  color: #9ca3af;
  font-weight: 600;
  position: sticky;
  top: 0;
}
.info-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #2a2a3a;
}
.info-table tr:hover td { background: #1f1f2b; }
.info-table-code { color: #f27f18; font-weight: 600; white-space: nowrap; }
.info-table-ref { color: #9ca3af; white-space: nowrap; }

.doc-tab-body { padding: 16px 20px 18px; }

.manuel-doc-add-btn {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 14px;
  border: 1px dashed #f27f18;
  border-radius: 8px;
  background: #fff8f1;
  color: #f27f18;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.manuel-doc-add-btn:hover { background: #fff0e0; }

/* ── Manuel edit button & custom badge ─────────────────────── */
.manuel-edit-btn {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.15s;
  flex-shrink: 0;
}
.manuel-edit-btn:hover {
  background: #fff7ed;
  border-color: #f27f18;
  color: #f27f18;
}

.btn-op-fullscreen {
  width: 28px;
  height: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: none;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
}
.btn-op-fullscreen:hover {
  background: #fff7ed;
  border-color: #f27f18;
  color: #f27f18;
}

/* ── Entretien guidé — popup plein écran ────────────────────── */
.op-fs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.op-fs-box {
  background: #f5f6f8;
  width: 100%;
  height: 96vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

@media (min-width: 640px) {
  .op-fs-overlay { align-items: center; padding: 24px; }
  .op-fs-box {
    height: auto;
    max-height: 90vh;
    border-radius: 18px;
  }
}

.op-fs-header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.op-fs-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.op-fs-icon { font-size: 1.6rem; flex-shrink: 0; }

.op-fs-info { min-width: 0; }

.op-fs-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-fs-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: #666;
  flex-wrap: wrap;
}

.op-fs-close {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.op-fs-close:hover { background: #f5f5f5; color: #1a1a2e; }

.op-fs-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.manuel-custom-badge {
  display: inline-block;
  margin-left: 7px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #fff7ed;
  color: #f27f18;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  padding: 1px 6px;
  vertical-align: middle;
}

/* ── Markdown rendered body ────────────────────────────────── */
.manuel-md-body {
  font-size: 0.83rem;
  color: #374151;
  line-height: 1.6;
}
.manuel-md-body h1, .manuel-md-body h2, .manuel-md-body h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin: 14px 0 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid #f0f0f0;
}
.manuel-md-body h2:first-child { margin-top: 0; }
.manuel-md-body p { margin: 5px 0; }
.manuel-md-body ul, .manuel-md-body ol {
  padding-left: 18px;
  margin: 5px 0;
}
.manuel-md-body li { margin: 3px 0; }
.manuel-md-body strong { font-weight: 700; color: #1e293b; }
.manuel-md-body em { font-style: italic; }
.manuel-md-body blockquote {
  border-left: 3px solid #f27f18;
  margin: 8px 0;
  padding: 5px 10px;
  background: #fff7ed;
  color: #92400e;
  border-radius: 0 6px 6px 0;
  font-size: 0.8rem;
}
.manuel-md-body hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 12px 0;
}
.manuel-md-body code {
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.8rem;
  font-family: 'Consolas', monospace;
}
.manuel-md-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

/* ── Manuel editor header form ─────────────────────────────── */
.med-hdr-form {
  padding: 12px 18px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.med-hdr-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.med-hdr-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.med-hdr-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.med-hdr-input {
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 0.83rem;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}
.med-hdr-input:focus { border-color: #f27f18; }
.med-hdr-icon-input {
  width: 52px;
  text-align: center;
  font-size: 1.2rem;
  padding: 4px 6px;
}
.med-hdr-select { cursor: pointer; }

/* ── Manuel editor modal ───────────────────────────────────── */
#manuel-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.med-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.med-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: min(760px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.med-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.med-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}
.med-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #6b7280;
  padding: 2px 6px;
  border-radius: 4px;
}
.med-close:hover { background: #f3f4f6; color: #1e293b; }
.med-tabs {
  display: flex;
  gap: 0;
  background: #f3f4f6;
  padding: 6px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.med-tab {
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.12s;
}
.med-tab.active {
  background: #fff;
  color: #f27f18;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.med-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.med-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 14px 6px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  flex-wrap: wrap;
}
.med-tb-btn {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 3px 9px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #374151;
  min-width: 30px;
  transition: all 0.12s;
}
.med-tb-btn:hover { border-color: #f27f18; color: #f27f18; background: #fff7ed; }
.med-tb-sep { width: 1px; background: #e5e7eb; margin: 2px 4px; flex-shrink: 0; }

/* Image size picker */
.med-img-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
  flex-wrap: wrap;
}
.med-img-picker-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #92400e;
  flex-shrink: 0;
}
.med-img-size-btn {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #92400e;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  transition: all 0.12s;
}
.med-img-size-btn:hover { background: #f27f18; color: #fff; border-color: #f27f18; }
.med-img-px-input {
  width: 60px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.78rem;
  color: #1e293b;
}
.med-img-cancel-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 4px;
}
.med-img-cancel-btn:hover { color: #374151; }
.med-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #1e293b;
  resize: none;
  min-height: 300px;
  max-height: 55vh;
}
.med-hint {
  padding: 5px 14px 6px;
  font-size: 0.7rem;
  color: #9ca3af;
  background: #fafafa;
  border-top: 1px solid #f0f0f0;
  font-family: monospace;
}
.med-preview {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  min-height: 300px;
  max-height: 55vh;
}
.med-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  gap: 10px;
}
.med-footer-right { display: flex; gap: 8px; }
.med-btn {
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.med-btn-reset { background: #f3f4f6; color: #6b7280; }
.med-btn-reset:hover { background: #fee2e2; color: #dc2626; }
.med-btn-cancel { background: #f3f4f6; color: #374151; }
.med-btn-cancel:hover { background: #e5e7eb; }
.med-btn-save { background: #f27f18; color: #fff; }
.med-btn-save:hover { background: #d97706; }

/* ── Archive / danger zone ─────────────────────────────────── */
.danger-zone-card { border-color: #fecaca; }
.danger-zone-info {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 12px;
  line-height: 1.5;
}
.danger-zone-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-archive {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-archive:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.btn-unarchive {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-unarchive:hover { background: #dcfce7; }
.btn-delete-vehicle {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-delete-vehicle:hover { background: #b91c1c; }

/* Archives list on home */
.archived-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.archived-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  flex-wrap: wrap;
}
.archived-row-info { display: flex; align-items: center; gap: 8px; }
.archived-row-icon { font-size: 1.1rem; }
.archived-row-name { font-size: 0.88rem; font-weight: 600; color: #374151; }
.archived-row-actions { display: flex; gap: 8px; }

/* ── Diagnostic follow-up checkboxes ───────────────────────── */
.wk-followup-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.wk-followup-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
}
.wk-followup-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f27f18;
  cursor: pointer;
}

/* ── Follow-up rows in carnet ──────────────────────────────── */
.followup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f27f18;
  border-radius: 8px;
}
.followup-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.followup-icon { font-size: 1.2rem; flex-shrink: 0; }
.followup-info { min-width: 0; }
.followup-type {
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400e;
}
.followup-origin {
  font-size: 0.75rem;
  color: #b45309;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.followup-btn {
  flex-shrink: 0;
  background: #f27f18;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.followup-btn:hover { background: #d97706; }

/* ── Modal de confirmation ────────────────────────────────────── */
.mc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: mc-fadein .15s ease;
}
@keyframes mc-fadein { from { opacity: 0 } to { opacity: 1 } }
.mc-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 20px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  animation: mc-slidein .15s ease;
}
@keyframes mc-slidein { from { transform: translateY(-12px); opacity: 0 } to { transform: none; opacity: 1 } }
.mc-msg {
  margin: 0 0 22px;
  font-size: 1rem;
  color: #1a1a2e;
  line-height: 1.55;
}
.mc-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.mc-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.mc-btn-primary  { background: #f27f18; color: #fff; }
.mc-btn-primary:hover  { background: #d97706; }
.mc-btn-cancel   { background: #f3f4f6; color: #374151; }
.mc-btn-cancel:hover   { background: #e5e7eb; }
.mc-btn-confirm  { background: #f27f18; color: #fff; }
.mc-btn-confirm:hover  { background: #d97706; }
.mc-btn-danger   { background: #dc2626; color: #fff; }
.mc-btn-danger:hover   { background: #b91c1c; }

/* ── Spinner de chargement ────────────────────────────────────── */
.app-loading {
  position: fixed;
  inset: 0;
  background: rgba(248,249,250,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.app-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e5e7eb;
  border-top-color: #f27f18;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ── Avatar profil (remplacement image externe) ───────────────── */
.profile-avatar-icon {
  font-size: 5rem;
  line-height: 1;
  margin-bottom: 8px;
}

/* ── Paramètres généraux ──────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 18px;
}
.settings-row { display: flex; flex-direction: column; gap: 6px; }
.settings-row-full { grid-column: 1 / -1; }
.settings-input { max-width: 100%; }
.settings-textarea {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: .8rem;
  min-height: 120px;
  resize: vertical;
  white-space: pre;
}
.settings-hint {
  font-size: .8rem;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.4;
}
.settings-hint code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .78rem;
}
.settings-key-badge {
  background: #d1fae5;
  color: #065f46;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.settings-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.settings-msg { font-size: .875rem; margin: 8px 0; }
.settings-msg-error { color: #dc2626; }
.settings-msg-ok    { color: #16a34a; }
.settings-status {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .82rem;
  margin-top: 10px;
}
.settings-status-ok  { color: #16a34a; margin-bottom: 4px; }
.settings-status-err { color: #dc2626; }
.rsync-output {
  background: #1a1a2e;
  color: #d1d5db;
  font-size: .75rem;
  padding: 14px;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 14px;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-wrap input { display: none; }
.toggle-slider {
  width: 44px; height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
  transition: background .2s;
}
.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-wrap input:checked + .toggle-slider { background: #f27f18; }
.toggle-wrap input:checked + .toggle-slider::after { left: 23px; }
.toggle-label { font-size: .875rem; color: #374151; font-weight: 500; }
/* ── Mobile (≤ 600px) ─────────────────────────────────────────────────────── */
@media (max-width: 600px) {

  /* App header */
  .app-header { padding: 0 14px; gap: 8px; }
  .app-header-by { display: none; }
  .app-header-brand { font-size: 0.95rem; }
  .btn-admin-header { padding: 5px 10px; font-size: 0.78rem; }

  /* Home / garage */
  .container { padding: 18px 14px; }
  .actions { gap: 14px; }
  .action-card { width: 140px; padding: 20px 18px; gap: 12px; }
  .action-card img { width: 90px; height: 65px; }
  .moto-card { width: calc(50% - 6px); }

  /* Add/edit forms */
  .card-body { padding: 18px 14px; }
  .input-row { flex-direction: column; gap: 8px; }
  .input-row .form-control { flex: none; width: 100%; }

  /* Settings */
  .settings-grid { grid-template-columns: 1fr; }
  .settings-maint-row { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* ── Dashboard : sidebar → bottom navigation bar ── */
  .moto-dashboard { flex-direction: column-reverse; }

  .dash-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    height: 68px;
    flex-direction: row;
    overflow: hidden;
    border-top: 2px solid #1c1c22;
    flex-shrink: 0;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.35);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .dash-logo,
  .dash-nav-sep,
  .dash-nav-section-title { display: none; }

  /* Rendre les conteneurs transparents → items directement dans le flex du sidebar */
  .dash-sidebar > .dash-nav,
  .dash-sidebar-bottom {
    display: contents;
  }

  .dash-nav-item {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px 4px;
    border-radius: 0;
    gap: 3px;
    font-size: 0.62rem;
    letter-spacing: 0;
    color: #6b6b80;
    transition: background 0.15s, color 0.15s;
  }

  .dash-nav-item:hover { background: #18181e; color: #ccc; }

  /* Show labels in bottom nav */
  .dash-nav-item span { display: block !important; font-size: 0.62rem; line-height: 1.2; text-align: center; }
  .dash-nav-item svg { width: 22px; height: 22px; }

  .dash-nav-item.active {
    background: transparent;
    color: #f27f18;
    position: relative;
  }
  .dash-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #f27f18;
    border-radius: 0 0 3px 3px;
  }
  .dash-nav-item.active svg { color: #f27f18; }

  /* Hide deep sub-items from bottom bar */
  .dash-nav-item-sub { display: none !important; }

  /* Dashboard topbar */
  .dash-topbar { padding: 10px 12px; }
  .dash-user-pill { display: none; }
  .dash-bc-parent, .dash-bc-sep { display: none; }
  .dash-bc-current { font-size: 0.88rem; }

  /* Dashboard content */
  .dash-content { padding: 12px 10px 80px; gap: 10px; }

  /* Fiche header : stack photo + info */
  .fiche-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .fiche-moto-photo { width: 100%; height: 110px; object-fit: contain; }
  .fiche-edit-btn { margin-left: 0; align-self: flex-start; }

  /* Info card photo */
  .info-card-inner { flex-direction: column; }
  .moto-photo-wrap { width: 100%; border-right: none; border-bottom: 1px solid #f0f0f0; height: 140px; }

  /* Stats : keep 2 columns on mobile */
  .dash-stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-number { font-size: 1.5rem; }

  /* Modals → bottom sheet */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 92vh;
    width: 100%;
  }

  /* Modal footer buttons */
  .modal-footer { gap: 8px; }
  .modal-footer .btn { flex: 1; justify-content: center; }

  /* Workshop type picker */
  .workshop-type-btn { padding: 11px 14px; font-size: 0.88rem; }

  /* Document cards (vue documents uniquement) */
  .doc-view .doc-cat-tag { display: none; }
  .doc-view .manuel-doc-desc { display: none; }
  .manuel-doc-card-wrap.has-actions .manuel-doc-card { padding-right: 72px; }
  .manuel-doc-actions { right: 6px; gap: 2px; }
  .manuel-doc-edit, .manuel-doc-delete, .manuel-doc-info { width: 28px; height: 28px; font-size: 0.85rem; }
  .doc-filter-bar { gap: 6px; }
  .doc-filter-chip { padding: 5px 10px; font-size: 0.78rem; }
}

/* ── Very small phones (≤ 420px) ─────────────────────────────────────────── */
@media (max-width: 420px) {
  .moto-card { width: 100%; }
  .action-card { width: 130px; padding: 16px 14px; }
  .action-card img { width: 75px; height: 55px; }
  .dash-stats-row { grid-template-columns: 1fr 1fr; }
  .dash-nav-item span { display: none !important; }
  .dash-nav-item { min-width: 0; }
}

/* ── Stat card tooltip ────────────────────────────────────────────────────── */
.stat-card-tooltip {
  cursor: help;
  position: relative;
}

.stat-card-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e2435;
  color: #e2e8f0;
  border: 1px solid #2d3748;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  white-space: pre;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  text-align: left;
  line-height: 1.6;
}

.stat-card-tooltip:hover::after { opacity: 1; }

/* ── Toast notifications ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1e2435;
  color: #e2e8f0;
  border: 1px solid #2d3748;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s, transform 0.22s;
  white-space: nowrap;
}

.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-success { border-left: 3px solid #16a34a; }
.toast.toast-error   { border-left: 3px solid #dc2626; }

/* ── Nav urgency badge ────────────────────────────────────────────────────── */
.nav-badge {
  background: #dc2626;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 6px;
  margin-left: 6px;
  line-height: 1.4;
  display: inline-block;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .nav-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    margin-left: 0;
    font-size: 0.6rem;
    padding: 1px 4px;
  }
  .dash-nav-item { position: relative; }
}

/* ── Chart avg km/month ───────────────────────────────────────────────────── */
.chart-avg-km {
  font-size: 0.78rem;
  color: #7b8bb2;
  font-weight: 400;
}

/* ── History cost ─────────────────────────────────────────────────────────── */
.history-cost {
  font-size: 0.82rem;
  color: #4b5563;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: auto;
  margin-right: 4px;
}

.history-cost-summary {
  display: flex;
  gap: 20px;
  font-size: 0.83rem;
  color: #6b7280;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.history-cost-summary b { color: #111827; }

/* ── Multi-docs atelier ───────────────────────────────────────────────────── */
.wk-docs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.wk-doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.85rem;
}

.wk-doc-item a { color: #374151; text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-doc-item a:hover { color: #4f46e5; }
.wk-doc-item span { flex: 1; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-doc-pending { border-style: dashed; }

.wk-doc-remove {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 0.8rem;
  border-radius: 4px;
  flex-shrink: 0;
}
.wk-doc-remove:hover { background: #dc26261a; color: #dc2626; }

.wk-doc-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wk-add-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: #f9fafb;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.83rem;
  color: #6b7280;
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
}
.wk-add-doc-btn:hover { border-color: #4f46e5; color: #4f46e5; }

/* ── History multi-docs ───────────────────────────────────────────────────── */
.history-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.history-doc-link {
  font-size: 0.8rem;
  color: #374151;
  text-decoration: none;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 3px 9px;
}
.history-doc-link:hover { color: #4f46e5; border-color: #a5b4fc; }
