/* ============================================================
   Teixeira AO Pilot — Design System v2.0
   Source de vérité pour les couleurs, typographies, espacements.
   Toutes les pages doivent passer par ces variables.
   ============================================================ */

:root {
  /* ---- Palette violet (couleur signature) ---- */
  --violet-50:  #F5F3FF;
  --violet-100: #EDE9FE;
  --violet-200: #DDD6FE;
  --violet-500: #8B5CF6;
  --violet-600: #7C3AED;
  --violet-700: #6D28D9;
  --violet-800: #5B21B6;
  --violet-900: #4C1D95;

  /* ---- Backgrounds ---- */
  --bg:         #FAFAFA;
  --bg-card:    #FFFFFF;
  --bg-subtle:  #F4F4F5;
  --bg-hover:   #F4F4F5;

  /* ---- Texte ---- */
  --text-1: #09090B;  /* primaire */
  --text-2: #52525B;  /* secondaire */
  --text-3: #A1A1AA;  /* tertiaire / placeholder */

  /* ---- Bordures ---- */
  --border:        #E4E4E7;
  --border-strong: #D4D4D8;

  /* ---- Sidebar (toujours sombre) ---- */
  --sidebar-bg:         #0E0D14;
  --sidebar-text:       #E4E4E7;
  --sidebar-text-muted: #9CA3AF;
  --sidebar-border:     #27272A;
  --sidebar-hover:      #1C1B26;

  /* ---- Sémantique ---- */
  --success-bg:   #ECFDF5;
  --success-text: #065F46;
  --success:      #10B981;

  --warning-bg:   #FFFBEB;
  --warning-text: #92400E;
  --warning:      #F59E0B;

  --danger-bg:    #FEF2F2;
  --danger-text:  #991B1B;
  --danger:       #EF4444;

  --info-bg:      #EFF6FF;
  --info-text:    #1E40AF;
  --info:         #3B82F6;

  /* ---- Couleur signature (alias) ---- */
  --primary:              var(--violet-600);
  --primary-hover:        var(--violet-700);
  --primary-subtle-bg:    var(--violet-50);
  --primary-subtle-text:  var(--violet-800);

  /* ---- Rayons ---- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ---- Typographies ---- */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* ---- Motion ---- */
  --t: 150ms cubic-bezier(.4, 0, .2, 1);
}

/* ---- Dark mode ---- */
[data-theme="dark"] {
  --bg:        #09090B;
  --bg-card:   #16151E;
  --bg-subtle: #1C1B26;
  --bg-hover:  #27272A;

  --text-1: #FAFAFA;
  --text-2: #A1A1AA;
  --text-3: #71717A;

  --border:        #27272A;
  --border-strong: #3F3F46;

  --sidebar-bg: #050507;

  --success-bg:   rgba(16, 185, 129, .12);
  --success-text: #34D399;
  --warning-bg:   rgba(245, 158, 11, .12);
  --warning-text: #FBBF24;
  --danger-bg:    rgba(239, 68, 68, .12);
  --danger-text:  #F87171;
  --info-bg:      rgba(59, 130, 246, .12);
  --info-text:    #60A5FA;

  --primary-subtle-bg:   rgba(124, 58, 237, .18);
  --primary-subtle-text: #C4B5FD;
}

/* ============================================================
   Reset & base
   ============================================================ */

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

html,
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  transition: background var(--t), color var(--t);
}

body { display: flex; min-height: 100vh; }

a { color: inherit; text-decoration: none; }

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  width: 244px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}

.brand {
  padding: 18px 16px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--violet-500) 0%, var(--violet-700) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.02em;
  box-shadow: 0 2px 8px rgba(124, 58, 237, .35);
}

.brand-text { line-height: 1.15; }
.brand-name { font-size: 13.5px; font-weight: 600; color: white; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--sidebar-text-muted); margin-top: 2px; font-weight: 450; }

.nav-section { padding: 14px 8px 6px; }

.nav-section + .nav-section {
  border-top: 1px solid var(--sidebar-border);
  margin-top: 6px;
  padding-top: 12px;
}

.nav-label {
  padding: 0 12px 8px;
  font-size: 10.5px;
  color: var(--sidebar-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 500;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 0;
  border-radius: 6px;
  color: #C7C7CC;
  font-size: 13.5px;
  font-weight: 450;
  transition: background var(--t), color var(--t);
  position: relative;
}

.nav-link:hover { background: var(--sidebar-hover); color: white; }

.nav-link.active {
  background: var(--sidebar-hover);
  color: white;
  font-weight: 500;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--violet-500);
  border-radius: 0 3px 3px 0;
}

.nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717A;
  transition: color var(--t);
  flex-shrink: 0;
}

.nav-link:hover .nav-icon { color: #A1A1AA; }
.nav-link.active .nav-icon { color: var(--violet-500); }

.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--violet-600);
  color: white;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

.nav-badge.muted { background: #27272A; color: #A1A1AA; }

.sidebar-spacer { flex: 1; }

.sidebar-footer { padding: 10px; border-top: 1px solid var(--sidebar-border); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t);
}
.user-chip:hover { background: var(--sidebar-hover); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F472B6 0%, #7C3AED 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info { flex: 1; line-height: 1.3; overflow: hidden; min-width: 0; }
.user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role { font-size: 11px; color: var(--sidebar-text-muted); }

.logout-link {
  display: block;
  padding: 6px 8px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--sidebar-text-muted);
  border-radius: 6px;
  transition: background var(--t), color var(--t);
  text-align: center;
}
.logout-link:hover { background: var(--sidebar-hover); color: #C7C7CC; }

/* ============================================================
   Main area
   ============================================================ */

.main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.crumb { font-size: 13px; color: var(--text-2); }
.crumb strong { color: var(--text-1); font-weight: 500; }

.topbar-spacer { flex: 1; }

/* ============================================================
   Search
   ============================================================ */

.search-box {
  position: relative;
  min-width: 260px;
  max-width: 380px;
  flex: 1;
}

.search-box input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 0 12px 0 34px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-1);
  transition: border var(--t), box-shadow var(--t);
  font-family: var(--font-sans);
}

.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.search-box::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>") center / contain no-repeat;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  transition: background var(--t), border-color var(--t), color var(--t), transform var(--t);
  text-decoration: none;
}

.btn:hover { background: var(--bg-hover); }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 1px 2px rgba(124, 58, 237, .25);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }

.btn-voir {
  padding: 0 12px;
  height: 30px;
  font-size: 12.5px;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-voir:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

/* ============================================================
   Theme toggle
   ============================================================ */

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  padding: 3px;
  border-radius: 999px;
  display: flex;
  gap: 1px;
}

.theme-toggle button {
  border: none;
  background: transparent;
  color: var(--text-3);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--t);
}
.theme-toggle button.active { background: var(--bg-subtle); color: var(--text-1); }

/* ============================================================
   Page layout
   ============================================================ */

.page { padding: 28px 32px 64px; max-width: 1320px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--text-1);
}

.page-sub { font-size: 13.5px; color: var(--text-2); margin-top: 5px; }
.page-sub strong { color: var(--text-1); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ============================================================
   Stats row
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color var(--t);
  position: relative;
  overflow: hidden;
}
.stat:hover { border-color: var(--border-strong); }

.stat-label {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.stat-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 4px;
  letter-spacing: 0;
}

.stat-delta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-delta.positive { color: var(--success); }
.stat-delta strong { font-weight: 500; }

/* ============================================================
   Toolbar (filter chips)
   ============================================================ */

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
}
.chip:hover { background: var(--bg-hover); color: var(--text-1); }
.chip.active {
  background: var(--primary-subtle-bg);
  color: var(--primary-subtle-text);
  border-color: transparent;
}

.chip-count {
  font-size: 10.5px;
  background: rgba(0, 0, 0, .05);
  padding: 1px 6px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.chip.active .chip-count { background: rgba(124, 58, 237, .18); }
[data-theme="dark"] .chip-count { background: rgba(255, 255, 255, .08); }

/* ============================================================
   AO card
   ============================================================ */

.ao-list { display: flex; flex-direction: column; gap: 8px; }

.ao-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  transition: border-color var(--t), box-shadow var(--t);
  position: relative;
}
.ao-card:hover {
  border-color: var(--violet-500);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .06);
}

.ao-card.hidden { display: none; }

.ao-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-subtle);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.ao-icon.auto {
  background: linear-gradient(135deg, var(--violet-50), var(--violet-100));
  color: var(--violet-700);
}
[data-theme="dark"] .ao-icon.auto {
  background: rgba(124, 58, 237, .15);
  color: #C4B5FD;
}

.ao-body { min-width: 0; }

.ao-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1.6;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.badge-auto { background: var(--info-bg); color: var(--info-text); }
.badge-plat {
  background: var(--bg-subtle);
  color: var(--text-2);
  border: 1px solid var(--border);
  text-transform: none;
}
.badge-status { background: var(--success-bg); color: var(--success-text); }
.badge-status.warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-status.draft { background: var(--warning-bg); color: var(--warning-text); }

.ao-ref {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: -.01em;
  margin-left: 2px;
}

.ao-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 6px;
  letter-spacing: -.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ao-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-2);
  align-items: center;
  flex-wrap: wrap;
}

.ao-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ao-meta-item svg { stroke: var(--text-3); flex-shrink: 0; }

.ao-trajet { font-weight: 500; color: var(--text-2); }
.ao-trajet-arrow { color: var(--text-3); margin: 0 2px; font-family: var(--font-mono); }

.ao-right { display: flex; align-items: center; gap: 14px; }

.cdr-block { text-align: right; line-height: 1.1; }
.cdr-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  margin-bottom: 5px;
}
.cdr-value {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
}
.cdr-unit { font-size: 12px; color: var(--text-2); font-weight: 500; margin-left: 2px; letter-spacing: 0; }

.ao-actions { display: flex; align-items: center; gap: 4px; }

.ao-action {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t);
}
.ao-action:hover { background: var(--bg-hover); color: var(--text-1); }
.ao-action.danger:hover { background: var(--danger-bg); color: var(--danger); }

.ao-card:hover .ao-arrow { transform: translateX(3px); }
.ao-arrow { color: white; transition: transform var(--t); }

/* ============================================================
   Empty state
   ============================================================ */

.ao-empty {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-2);
}
.ao-empty p { margin-bottom: 12px; }
.ao-empty .btn { margin-top: 8px; }

/* ============================================================
   Vigilance card
   ============================================================ */

.vigilance {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.vigilance-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.vigilance-title { display: flex; align-items: center; gap: 12px; }

.vigilance-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
  flex-shrink: 0;
}
.vigilance-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--success);
  opacity: .35;
  animation: pulse 2.2s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(.6); opacity: .45; }
  100% { transform: scale(2.4); opacity: 0; }
}

.vigilance-h { font-size: 14px; font-weight: 600; color: var(--text-1); }
.vigilance-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.vigilance-table { width: 100%; border-collapse: collapse; }
.vigilance-table th {
  padding: 10px 20px;
  text-align: left;
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.vigilance-table td {
  padding: 11px 20px;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.vigilance-table tr:last-child td { border-bottom: none; }
.vigilance-table tr { transition: background var(--t); }
.vigilance-table tbody tr:hover { background: var(--bg-subtle); }
.vigilance-table .num { color: var(--text-1); font-weight: 500; }
.vigilance-table .num-success { color: var(--success); font-weight: 600; }
.vigilance-table .num-muted { color: var(--text-3); }

/* ============================================================
   Scan modal (popup progression vigilance)
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  width: 520px;
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.modal-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.modal-subtitle { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

.modal-progress {
  background: var(--bg-subtle);
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
  margin-bottom: 12px;
}
.modal-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.modal-log {
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
}
.modal-log > div { padding: 1px 0; }

.modal-summary {
  font-size: 12.5px;
  color: var(--text-2);
  text-align: center;
  padding: 8px 0;
}

/* ============================================================
   Flash messages
   ============================================================ */

.flash-error,
.flash-success {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  border: 1px solid;
}
.flash-error   { background: var(--danger-bg);  color: var(--danger-text);  border-color: rgba(239, 68, 68, .2); }
.flash-success { background: var(--success-bg); color: var(--success-text); border-color: rgba(16, 185, 129, .2); }

/* ============================================================
   Compatibilité templates legacy (chiffrage, nouvel_ao, etc.)
   Ces classes assurent que les autres pages ne soient pas cassées
   tant qu'elles ne sont pas refactorées.
   ============================================================ */

.container { max-width: 1280px; margin: 0 auto; padding: 28px 32px; }

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 12px;
}

h1, h2, h3 { color: var(--text-1); letter-spacing: -.015em; }
h1 { font-size: 22px; font-weight: 600; margin-bottom: 16px; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 13px;
  margin-bottom: 12px;
  transition: border var(--t), box-shadow var(--t);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

.btn-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-bg);
}
.btn-success:hover {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-bg);
}
.btn-warning:hover {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}
.btn-sm { padding: 4px 10px; height: 28px; font-size: 12px; }

.badge-draft { background: var(--warning-bg); color: var(--warning-text); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-ready { background: var(--success-bg); color: var(--success-text); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ============================================================
   Fade-in animations (légères, respectent prefers-reduced-motion)
   ============================================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ao-card,
.stat { animation: fadeUp .35s ease-out backwards; }
.ao-card:nth-child(1) { animation-delay: 0ms; }
.ao-card:nth-child(2) { animation-delay: 30ms; }
.ao-card:nth-child(3) { animation-delay: 60ms; }
.ao-card:nth-child(4) { animation-delay: 90ms; }
.ao-card:nth-child(5) { animation-delay: 110ms; }
.ao-card:nth-child(n+6) { animation-delay: 130ms; }

.stat:nth-child(1) { animation-delay: 0ms; }
.stat:nth-child(2) { animation-delay: 50ms; }
.stat:nth-child(3) { animation-delay: 100ms; }
.stat:nth-child(4) { animation-delay: 150ms; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================
   Responsive (basique pour cette session — refonte mobile plus tard)
   ============================================================ */

@media (max-width: 900px) {
  .sidebar { display: none; }
  .page { padding: 20px 16px 48px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; }
  .search-box { width: 160px; }
}

/* ============================================================
   Page chiffrage — sections, header, tables, marges, modal
   ============================================================ */

/* ---- AO header (titre + meta + actions) ---- */

.ao-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ao-page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: 6px;
}

.ao-page-sub {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ao-page-sub .sep { color: var(--text-3); }

.ao-page-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---- Badge type CDR (mensuel / journalier / voyage / trinome) ---- */

.badge-typecdr {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-typecdr.mensuel    { background: var(--primary-subtle-bg); color: var(--primary-subtle-text); }
.badge-typecdr.journalier { background: var(--info-bg);           color: var(--info-text); }
.badge-typecdr.voyage     { background: var(--warning-bg);        color: var(--warning-text); }
.badge-typecdr.trinome    { background: var(--success-bg);        color: var(--success-text); }

/* ---- Section card (réutilisable pour toutes les cards) ---- */

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 12px;
  transition: border-color var(--t);
}

.section-card h2 {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 12px;
  letter-spacing: -.005em;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 14px;
  flex-wrap: wrap;
}

.section-head h2 { margin-bottom: 0; }

.section-sub {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 14px;
  margin-top: -6px;
}

.section-sub strong { color: var(--text-1); font-weight: 500; font-variant-numeric: tabular-nums; }

.dirty-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--warning-text);
  background: var(--warning-bg);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.dirty-indicator svg { stroke: var(--warning-text); }

/* ---- Paramètres grid (3 colonnes) ---- */

.params-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 18px;
  margin-bottom: 12px;
}

.field { display: flex; flex-direction: column; }

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}

.field input,
.field select {
  margin-bottom: 0;
  height: 36px;
}

.input-warn-msg {
  font-size: 11.5px;
  color: var(--warning-text);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field input.warn {
  border-color: var(--warning);
  background: var(--warning-bg);
}

/* Actions inline d'une section card (ex: Recalculer le CDR) */
.section-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* ---- CDR table ---- */

.cdr-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.cdr-table thead th {
  text-align: left;
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.cdr-table thead th.num { text-align: right; }

.cdr-table tbody td,
.cdr-table tfoot td {
  padding: 9px 10px;
  font-size: 13px;
  color: var(--text-1);
  border-bottom: 1px solid var(--border);
}

.cdr-table tbody tr:last-child td { border-bottom: none; }

.cdr-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cdr-table td.detail {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}

.cdr-table td.poste-faded { color: var(--text-3); }
.cdr-table td.num-faded   { color: var(--text-3); }

/* Lignes de sous-total */
.cdr-table .row-subtotal td {
  font-weight: 600;
  font-size: 13px;
  padding: 10px;
  border-bottom: none;
}

.cdr-table .row-subtotal-fixe td      { background: var(--primary-subtle-bg); color: var(--primary-subtle-text); }
.cdr-table .row-subtotal-humain td    { background: var(--success-bg);        color: var(--success-text); }
.cdr-table .row-subtotal-variable td  { background: var(--warning-bg);        color: var(--warning-text); }

.cdr-table .row-subtotal td.num { color: inherit; }

/* Ligne total CDR */
.cdr-table .row-total td {
  font-weight: 700;
  font-size: 14.5px;
  padding: 14px 10px;
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
  color: var(--text-1);
}

.cdr-table .row-total td.num { color: var(--primary); font-size: 16px; }

/* Note clause kilométrique */
.cdr-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--success-bg);
  color: var(--success-text);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

/* ---- Comparateur de marges (4 colonnes) ---- */

.marges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.marge-col {
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  cursor: pointer;
  transition: all var(--t);
  text-align: center;
  position: relative;
}

.marge-col:hover {
  border-color: var(--border-strong);
}

.marge-col.active {
  border-color: var(--primary);
  background: var(--primary-subtle-bg);
}

.marge-col[data-marge="custom"] {
  cursor: default;
  background: var(--bg-subtle);
}

.marge-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}

.marge-pct {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.marge-col.active .marge-pct { color: var(--primary); }

.marge-value {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--text-1);
  line-height: 1.1;
}

.marge-secondary {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.marge-reelle {
  font-size: 10.5px;
  color: var(--text-2);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* Input "marge personnalisée" */
.marge-custom-input {
  width: 64px;
  height: 28px !important;
  padding: 4px 6px !important;
  margin: 0 auto 6px !important;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  display: block !important;
}

/* Forfait retenu en bas du comparateur */
.forfait-retenu-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

.forfait-retenu-label {
  font-size: 13px;
  color: var(--text-2);
}

.forfait-retenu-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.forfait-retenu-pct {
  font-size: 12.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---- Variable point (3 colonnes, pour les AOs type Chronopost) ---- */

.vp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.vp-col {
  background: var(--bg-subtle);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
}

.vp-col.recommended {
  border-color: var(--primary);
  background: var(--primary-subtle-bg);
}

.vp-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.vp-col.recommended .vp-pct { color: var(--primary); }

.vp-value {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  color: var(--text-1);
  line-height: 1.1;
}

.vp-ca {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.vp-note {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--info-bg);
  color: var(--info-text);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

.vp-actions {
  text-align: center;
  margin-top: 14px;
}

/* ---- Fichiers joints ---- */

.fichier-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

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

.fichier-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  flex-shrink: 0;
}

.fichier-nom {
  flex: 1;
  font-size: 13px;
  color: var(--text-1);
  word-break: break-word;
}

.fichier-badge-form {
  background: var(--info-bg);
  color: var(--info-text);
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ---- Form ANDCO (descriptif / commentaire / actions) ---- */

.andco-form .field { margin-bottom: 14px; }
.andco-form textarea { resize: vertical; min-height: 60px; }

.descriptif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.descriptif-head label { margin-bottom: 0; }

.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 4px 6px;
  border-radius: 4px;
  transition: background var(--t);
}

.btn-link:hover { background: var(--primary-subtle-bg); }

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ---- Bouton outline (pour brouillon) ---- */

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-1);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-2);
}

/* ---- Modal recalcul IA (overlay) ---- */

.modal-recalcul {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-recalcul.show { display: flex; }

.modal-recalcul .modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  width: 440px;
  max-width: 92vw;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.modal-recalcul .modal-spinner {
  margin: 0 auto 16px;
}

.modal-recalcul .modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}

.modal-recalcul .modal-step {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 14px;
}

.modal-recalcul .modal-bar-track {
  background: var(--bg-subtle);
  border-radius: 999px;
  height: 5px;
  overflow: hidden;
}

.modal-recalcul .modal-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  width: 10%;
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.modal-recalcul .modal-hint {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* Responsive — params grid passe en 2 colonnes sur tablette */
@media (max-width: 1100px) {
  .params-grid     { grid-template-columns: repeat(2, 1fr); }
  .marges-grid     { grid-template-columns: repeat(2, 1fr); }
  .vp-grid         { grid-template-columns: 1fr; }
  .ao-page-head    { flex-direction: column; }
}

@media (max-width: 600px) {
  .params-grid     { grid-template-columns: 1fr; }
  .marges-grid     { grid-template-columns: 1fr; }
  .cdr-table td.detail { display: none; }
}

.badge-mutual {
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: none;
  letter-spacing: 0;
}

/* ============================================================
   Pages d'authentification (non connecté) — login, setup
   Layout autonome (pas de sidebar/topbar), carte centrée.
   ============================================================ */

.auth-body {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-subtle) 100%);
  padding: 24px;
}

.auth-container { width: 100%; max-width: 420px; }

.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet-500) 0%, var(--violet-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(124, 58, 237, .35);
}
.auth-brand-name { font-size: 18px; font-weight: 600; color: var(--text-1); letter-spacing: -.01em; }

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .05);
}
.auth-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px 0; color: var(--text-1); }
.auth-card .auth-subtitle { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 6px;
  margin-top: 16px;
}
.auth-card label:first-of-type { margin-top: 0; }
.auth-card input,
.auth-card select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  font-family: var(--font-sans);
  margin-bottom: 0;
}
.auth-card input:focus,
.auth-card select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}
.auth-card button[type="submit"] { width: 100%; margin-top: 24px; height: 40px; }

.auth-flash { margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 8px;
}
.flash:last-child { margin-bottom: 0; }
.flash-error   { background: var(--danger-bg);  color: var(--danger-text); }
.flash-success { background: var(--success-bg); color: var(--success-text); }

.auth-footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-3); }

/* ============================================================
   Admin — config table (paramètres flotte) + sticky footer
   ============================================================ */

.config-table { width: 100%; border-collapse: collapse; }
.config-table th {
  text-align: left;
  padding: 8px 12px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 1px solid var(--border);
}
.config-table th.num { text-align: right; }
.config-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-1);
}
.config-table tbody tr:last-child td { border-bottom: none; }
.config-table td:nth-child(1) { width: 45%; font-weight: 500; }
.config-table td:nth-child(2) { width: 30%; }
.config-table td:nth-child(3) { width: 25%; color: var(--text-2); font-size: 13px; }
.config-table input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
  margin-bottom: 0;
}
.config-table input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .12);
}

/* Sticky footer (barre d'action collée en bas) */
.sticky-footer {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
  padding: 14px 4px;
  display: flex;
  justify-content: flex-end;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  z-index: 5;
}

/* ============================================================
   Admin — users table (gestion utilisateurs)
   ============================================================ */

.users-table { width: 100%; border-collapse: collapse; }
.users-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.users-table th.right { text-align: right; }
.users-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-1);
  vertical-align: middle;
}
.users-table tbody tr:last-child td { border-bottom: none; }
.users-table tr.inactive { opacity: .55; }
.users-table .u-name { font-weight: 600; color: var(--text-1); }
.users-table .u-self { color: var(--text-3); font-weight: 400; font-size: 11.5px; margin-left: 4px; }
.users-table .u-email { color: var(--text-2); font-size: 12.5px; }
.users-table .u-date { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.users-table td.right { text-align: right; }

/* Select de rôle inline */
.role-select {
  width: auto;
  height: 30px;
  padding: 2px 26px 2px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-bottom: 0;
  cursor: pointer;
}

/* Badges de rôle (couleurs distinctes : violet / bleu / gris) */
.badge-role-admin {
  background: var(--primary-subtle-bg);
  color: var(--primary-subtle-text);
}
.badge-role-exploitant {
  background: var(--info-bg);
  color: var(--info-text);
}
.badge-role-readonly {
  background: var(--bg-subtle);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ============================================================
   Nouvel AO — drop-zone PDF + séparateur + overlay analyse
   ============================================================ */

.nao-card { max-width: 720px; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--t), background var(--t);
}
.dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-subtle-bg);
}
.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.dropzone-main { font-size: 13.5px; font-weight: 500; color: var(--text-1); }
.dropzone-main strong { color: var(--primary); font-weight: 600; }
.dropzone-hint { font-size: 12px; color: var(--text-3); }
.dropzone-file {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--success-text);
  font-family: var(--font-mono);
  word-break: break-all;
}

/* Séparateur "OU" */
.form-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.form-sep::before,
.form-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Liste d'étapes dans l'overlay d'analyse */
.overlay-steps {
  text-align: left;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-2);
}
.overlay-steps > div { padding: 3px 0; }

/* ============================================================
   Décomposition — en-têtes de catégorie dans la cdr-table
   ============================================================ */

.cdr-table .row-cat td {
  padding: 10px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: none;
}
.cdr-table .row-cat.cat-fixe td   { color: var(--primary-subtle-text); }
.cdr-table .row-cat.cat-humain td { color: var(--success-text); }
.cdr-table .row-cat.cat-var td    { color: var(--warning-text); }

.cdr-table tfoot .row-marge td {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-2);
  padding: 8px 10px;
  border-top: none;
}

/* ============================================================
   Impression (fiche décomposition) — masque le chrome de l'app
   ============================================================ */

@media print {
  .sidebar,
  .topbar,
  .btn,
  .ao-page-meta button,
  .ao-page-meta a { display: none !important; }

  body { background: white !important; color: black !important; }
  .main { background: white !important; }
  .page { margin: 0 !important; padding: 0 !important; max-width: 100% !important; }

  .section-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
}
