/* ============================================================
   SUIVI ERP — Les Nids · Design System v7 · Glass Dark
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Tokens ── */
:root {
  /* Accent violet + gold */
  --violet:          #8064A2;
  --violet-dark:     #6048A0;
  --violet-light:    rgba(128,100,162,.65);
  --violet-glow:     rgba(128, 100, 162, .4);
  --gold:            #F0A050;
  --gold-glow:       rgba(240, 160, 80, .35);

  /* Text hierarchy — 3 levels */
  --text:            #FFFFFF;
  --text-secondary:  rgba(255, 255, 255, .72);
  --text-muted:      rgba(255, 255, 255, .55);

  /* Surfaces — neutral glass */
  --bg:              #07080F;
  --bg-mid:          #0D0B1A;
  --surface:         rgba(255, 255, 255, .055);
  --surface-hover:   rgba(255, 255, 255, .09);
  --surface-active:  rgba(255, 255, 255, .13);

  /* Borders — very subtle glass */
  --border:          rgba(255, 255, 255, .09);
  --border-light:    rgba(255, 255, 255, .05);
  --border-input:    rgba(255, 255, 255, .14);

  /* Sidebar */
  --sidebar-width:   230px;
  --sidebar-bg:      rgba(255, 255, 255, .03);
  --sidebar-border:  rgba(255, 255, 255, .08);
  --sidebar-text:    rgba(255, 255, 255, .42);
  --sidebar-active:  #FFFFFF;
  --sidebar-label:   rgba(255, 255, 255, .22);

  /* Glass */
  --glass-bg:        rgba(255, 255, 255, .06);
  --glass-border:    rgba(255, 255, 255, .10);
  --glass-blur:      blur(22px) saturate(1.3);

  /* Orbs */
  --orb-violet:      rgba(128, 100, 162, .22);
  --orb-orange:      rgba(240, 160, 80,  .12);

  /* Semantic */
  --success:         #34D399;
  --success-bg:      rgba(52, 211, 153, .1);
  --success-border:  rgba(52, 211, 153, .25);

  --warning:         #F0B429;
  --warning-bg:      rgba(240, 180, 41, .1);
  --warning-border:  rgba(240, 180, 41, .25);

  --danger:          #FB7185;
  --danger-bg:       rgba(251, 113, 133, .1);
  --danger-border:   rgba(251, 113, 133, .25);

  --info:            #60A5FA;
  --info-bg:         rgba(96, 165, 250, .1);
  --info-border:     rgba(96, 165, 250, .25);

  /* Legacy aliases */
  --primary:         #8064A2;
  --primary-dark:    #6048A0;
  --primary-light:   rgba(128, 100, 162, .14);
  --primary-muted:   rgba(128, 100, 162, .07);
  --rouge:           #FB7185;
  --orange:          #F79646;
  --vert:            #34D399;
  --gris:            rgba(255, 255, 255, .55);

  /* Radius */
  --radius-sm:       4px;
  --radius:          8px;
  --radius-lg:       12px;
  --radius-xl:       16px;

  /* Shadows */
  --shadow-sm:       0 1px 4px rgba(0,0,0,.4);
  --shadow:          0 2px 12px rgba(0,0,0,.5), 0 0 0 1px var(--border);
  --shadow-md:       0 4px 20px rgba(0,0,0,.55), 0 0 0 1px var(--border);
  --shadow-lg:       0 8px 36px rgba(0,0,0,.6), 0 0 24px var(--violet-glow);

  /* Transitions */
  --transition:      150ms ease;
  --transition-md:   250ms ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text-secondary);
  min-height: 100vh;
}

/* Fond photo */
body::before {
  content: '';
  position: fixed;
  inset: -8px;
  background: url('bg-enfants.jpg') center/cover no-repeat;
  filter: blur(4px) brightness(.38) saturate(1.25);
  transform: scale(1.06);
  pointer-events: none;
  z-index: 0;
}
/* Overlay dégradé */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 10% 15%, rgba(128,100,162,.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 85%, rgba(240,180,41,.10) 0%, transparent 60%),
    linear-gradient(180deg, rgba(7,8,15,.45) 0%, rgba(7,8,15,.55) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ── Layout shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════
   SIDEBAR / NAVBAR
═══════════════════════════════════════ */
.navbar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
  backdrop-filter: blur(20px);
}
.navbar::-webkit-scrollbar { display: none; }

/* Brand */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border-light);
}
.navbar-brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: contain;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  padding: 5px;
  box-shadow: 0 4px 14px var(--violet-glow);
  flex-shrink: 0;
}
.brand-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .03em;
}
.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Nav list */
.navbar-links {
  list-style: none;
  padding: 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sidebar-label);
  padding: 10px 8px 4px;
  margin-top: 4px;
  list-style: none;
}
.navbar-links li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  position: relative;
}
.navbar-links li a:hover {
  background: var(--surface);
  color: var(--text-secondary);
}
.navbar-links li a.active {
  background: linear-gradient(135deg, var(--surface-active), rgba(96,72,160,.18));
  border: 1px solid rgba(128,100,162,.35);
  color: var(--sidebar-active);
  font-weight: 600;
}
.navbar-links li a.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--violet);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--violet-glow);
}
.nav-icon {
  width: 15px; height: 15px;
  flex-shrink: 0;
  opacity: .75;
}
.navbar-links li a.active .nav-icon { opacity: 1; }

/* Navbar footer */
.navbar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.btn-logout:hover {
  background: var(--surface);
  color: var(--text-secondary);
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.theme-toggle:hover {
  background: var(--surface);
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════ */
.main-content {
  flex: 1;
  padding: 24px 28px;
  min-width: 0;
  overflow-x: hidden;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.page-total {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.page-total strong {
  color: var(--text);
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
}

/* ═══════════════════════════════════════
   CARDS
═══════════════════════════════════════ */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }
.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover {
  border-color: rgba(128,100,162,.45);
  transform: translateY(-1px);
}
.stat-number {
  font-family: 'DM Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.stat-card.danger  { border-left: 3px solid var(--danger);  }
.stat-card.warning { border-left: 3px solid var(--warning); }
.stat-card.success { border-left: 3px solid var(--success); }
.stat-card.info    { border-left: 3px solid var(--info);    }
.stat-card.danger  .stat-number { color: var(--danger);  }
.stat-card.warning .stat-number { color: var(--warning); }
.stat-card.success .stat-number { color: var(--success); }
.stat-card.info    .stat-number { color: var(--info);    }

/* ── Dashboard layout ── */
.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.dashboard-card-scroll {
  max-height: 380px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dashboard-card-scroll .table-wrap {
  flex: 1;
  overflow-y: auto;
}

/* ═══════════════════════════════════════
   TABLES
═══════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(128,100,162,.06);
}
tbody td {
  padding: 11px 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--surface-hover); }
tbody td strong { color: var(--text); font-weight: 600; }
tbody td a {
  color: var(--violet-light);
  text-decoration: none;
  transition: color var(--transition);
}
tbody td a:hover { color: var(--text); }

/* ═══════════════════════════════════════
   BADGES
═══════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success   { background: var(--success-bg);  border: 1px solid var(--success-border);  color: var(--success);  }
.badge-warning   { background: var(--warning-bg);  border: 1px solid var(--warning-border);  color: var(--warning);  }
.badge-danger    { background: var(--danger-bg);   border: 1px solid var(--danger-border);   color: var(--danger);   }
.badge-info      { background: var(--info-bg);     border: 1px solid var(--info-border);     color: var(--info);     }
.badge-violet    { background: var(--surface-active); border: 1px solid var(--border); color: var(--text-secondary); }
.badge-secondary { background: rgba(196,181,232,.08); border: 1px solid var(--border-light); color: var(--text-muted); }

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--violet-light); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  color: #FFFFFF;
  box-shadow: 0 4px 14px var(--violet-glow);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #9070B2, var(--violet));
  box-shadow: 0 6px 20px var(--violet-glow);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: rgba(128,100,162,.45);
}
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.btn-danger:hover { background: rgba(251,113,133,.18); }
.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}
.btn-sm  { padding: 6px 13px; font-size: 12px; border-radius: 6px; }
.btn-lg  { padding: 12px 24px; font-size: 14px; }

/* ═══════════════════════════════════════
   FORMS
═══════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  background: rgba(128,100,162,.08);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--violet);
  background: rgba(128,100,162,.12);
  box-shadow: 0 0 0 3px rgba(128,100,162,.2);
}
.form-control:hover:not(:focus) { border-color: rgba(196,181,232,.4); }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23C4B5E8' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input[type="text"] {
  padding: 8px 12px;
  background: rgba(128,100,162,.08);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.filter-bar select:focus,
.filter-bar input[type="text"]:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(128,100,162,.2);
  color: var(--text);
}
.filter-bar input[type="text"]::placeholder { color: var(--text-muted); }

/* ═══════════════════════════════════════
   ALERTS
═══════════════════════════════════════ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert-danger  { background: var(--danger-bg);  border: 1px solid var(--danger-border);  color: var(--danger);  }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.alert-info    { background: var(--info-bg);    border: 1px solid var(--info-border);    color: var(--info);    }

/* ── Card header ── */
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Toggle row (clés) ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
}
.toggle-row label {
  font-size: 13px;
  color: var(--text-secondary);
}
.toggle-row select { width: auto; min-width: 80px; }

/* ── Form 3-col ── */
.form-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { opacity: .35; margin-bottom: 12px; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ═══════════════════════════════════════
   TOAST
═══════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  background: rgba(18, 10, 40, .95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  max-width: 360px;
  animation: toast-in .25s ease;
}
.toast.success { border-color: var(--success-border); }
.toast.success::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--success);
}
.toast.error { border-color: var(--danger-border); }
.toast.error::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--danger);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════ */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: 0 32px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.12);
  position: relative;
  z-index: 1;
}
[data-theme="light"] .login-card {
  background: rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.6);
  backdrop-filter: blur(32px) saturate(1.8);
  -webkit-backdrop-filter: blur(32px) saturate(1.8);
  box-shadow: 0 32px 80px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.8);
}
.login-card h1 {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 400;
}
.login-card .logo {
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  padding: 8px;
  box-shadow: 0 6px 20px var(--violet-glow);
}

/* ═══════════════════════════════════════
   UPLOAD ZONE
═══════════════════════════════════════ */
.upload-zone {
  background: rgba(128,100,162,.06);
  border: 1.5px dashed rgba(128,100,162,.4);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}
.upload-zone:hover {
  border-color: var(--violet);
  background: rgba(128,100,162,.1);
}
.upload-zone.dragover {
  border-color: var(--violet);
  background: var(--surface-active);
}
.upload-zone p { color: var(--text-secondary); font-size: 13px; margin-top: 8px; }
.upload-zone small { color: var(--text-muted); font-size: 11px; }

/* ═══════════════════════════════════════
   MODALS
═══════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: rgba(10, 10, 18, .88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 540px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  color: var(--text-secondary);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 20px;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
/* Modal form helpers (used inline in pages) */
.modal .form-row { margin-bottom: 14px; }
.modal .form-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 5px;
}
.modal .form-row input,
.modal .form-row select,
.modal .form-row textarea { width: 100%; box-sizing: border-box; }
.modal .form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Select options dark */
select option {
  background: #1A0E35;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   MISC
═══════════════════════════════════════ */
hr { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }
a { color: var(--text-secondary); text-decoration: none; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128,100,162,.45); }

[data-editable] { cursor: pointer; border-radius: 4px; }
[data-editable]:hover { background: var(--surface-hover); }
[data-editable] input {
  background: rgba(128,100,162,.12);
  border: 1px solid var(--violet);
  border-radius: 4px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 2px 6px;
  outline: none;
}

/* ═══════════════════════════════════════
   ORBES ANIMÉS
═══════════════════════════════════════ */
.yam-orb-bg {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  animation: yam-orb-float linear infinite;
}
.yam-orb-bg-1 {
  width: 480px; height: 480px;
  top: -100px; right: -80px;
  background: radial-gradient(circle, var(--orb-violet) 0%, transparent 70%);
  animation-duration: 20s;
}
.yam-orb-bg-2 {
  width: 360px; height: 360px;
  bottom: -80px; left: -60px;
  background: radial-gradient(circle, var(--orb-orange) 0%, transparent 70%);
  animation-duration: 15s;
  animation-delay: -7s;
}
@keyframes yam-orb-float {
  0%,100% { transform: translateY(0) rotate(0deg) scale(1); }
  33% { transform: translateY(-28px) rotate(5deg) scale(1.03); }
  66% { transform: translateY(14px) rotate(-3deg) scale(.97); }
}

/* ═══════════════════════════════════════
   MODE CLAIR
═══════════════════════════════════════ */
[data-theme="light"] {
  --text:            #18112B;
  --text-secondary:  #2E2148;
  --text-muted:      #534669;
  --bg:              #F5F3FB;
  --bg-mid:          #EDE9F7;
  --surface:         rgba(255,255,255,.72);
  --surface-hover:   rgba(255,255,255,.88);
  --surface-active:  rgba(128,100,162,.12);
  --border:          rgba(128,100,162,.18);
  --border-light:    rgba(128,100,162,.10);
  --border-input:    rgba(128,100,162,.28);
  --sidebar-bg:      rgba(255,255,255,.82);
  --sidebar-border:  rgba(128,100,162,.15);
  --sidebar-text:    #534669;
  --sidebar-active:  #18112B;
  --sidebar-label:   rgba(83,70,105,.5);
  --glass-bg:        rgba(255,255,255,.72);
  --glass-border:    rgba(255,255,255,.9);
  --shadow-sm:       0 1px 4px rgba(128,100,162,.15);
  --shadow:          0 2px 12px rgba(128,100,162,.15), 0 0 0 1px var(--border);
  --shadow-md:       0 4px 20px rgba(128,100,162,.18), 0 0 0 1px var(--border);
  --shadow-lg:       0 8px 36px rgba(128,100,162,.22), 0 0 24px rgba(128,100,162,.08);
}
[data-theme="light"] body::before {
  filter: blur(6px) brightness(.55) saturate(1.1);
}
[data-theme="light"] body::after {
  background:
    radial-gradient(ellipse 70% 55% at 10% 15%, rgba(255,255,255,.45) 0%, transparent 60%),
    linear-gradient(180deg, rgba(245,243,251,.72) 0%, rgba(245,243,251,.80) 100%);
}
[data-theme="light"] select option { background: #F5F3FB; color: #18112B; }
[data-theme="light"] .toast { background: rgba(255,255,255,.92); color: #2E2148; }
[data-theme="light"] thead th { background: rgba(128,100,162,.06); }

/* ══════════════════════════════════════════
   MODE CLAIR — PALETTE VIVE
   Fond blanc/clair → couleurs foncées saturées
   Texte noir → lisible partout
══════════════════════════════════════════ */
[data-theme="light"] {
  --success:        #16a34a;
  --success-bg:     #dcfce7;
  --success-border: #86efac;
  --warning:        #d97706;
  --warning-bg:     #fef3c7;
  --warning-border: #fcd34d;
  --danger:         #dc2626;
  --danger-bg:      #fee2e2;
  --danger-border:  #fca5a5;
  --info:           #2563eb;
  --info-bg:        #dbeafe;
  --info-border:    #93c5fd;
  --primary:        #7c3aed;
}

/* ── Badges — fond coloré vif, texte blanc ou très sombre ── */
[data-theme="light"] .badge-success   { background: #16a34a; border-color: #15803d; color: #fff; font-weight: 700; }
[data-theme="light"] .badge-warning   { background: #d97706; border-color: #b45309; color: #fff; font-weight: 700; }
[data-theme="light"] .badge-danger    { background: #dc2626; border-color: #b91c1c; color: #fff; font-weight: 700; }
[data-theme="light"] .badge-info      { background: #2563eb; border-color: #1d4ed8; color: #fff; font-weight: 700; }
[data-theme="light"] .badge-violet    { background: #7c3aed; border-color: #6d28d9; color: #fff; font-weight: 700; }
[data-theme="light"] .badge-secondary { background: #e5e7eb; border-color: #d1d5db; color: #374151; font-weight: 600; }

/* ── Alertes ── */
[data-theme="light"] .alert-success { background: #dcfce7; border-color: #86efac; color: #14532d; }
[data-theme="light"] .alert-danger  { background: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }
[data-theme="light"] .alert-warning { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
[data-theme="light"] .alert-info    { background: #dbeafe; border-color: #93c5fd; color: #1e3a8a; }

/* ── Stat cards — chiffres vifs ── */
[data-theme="light"] .stat-card.danger  .stat-number { color: #dc2626; }
[data-theme="light"] .stat-card.warning .stat-number { color: #d97706; }
[data-theme="light"] .stat-card.success .stat-number { color: #16a34a; }
[data-theme="light"] .stat-card.info    .stat-number { color: #2563eb; }

/* ── Chips type contrat/apave — fond blanc, bordure vive, texte vif ── */
[data-theme="light"] .contrat-type-chip {
  filter: none;
  background: #fff !important;
  border: 2px solid var(--chip-color) !important;
}
[data-theme="light"] .contrat-type-chip-name {
  color: color-mix(in srgb, var(--chip-color) 55%, #000 45%) !important;
  font-weight: 800 !important;
}
[data-theme="light"] .contrat-type-chip-count {
  color: #fff !important;
  background: color-mix(in srgb, var(--chip-color) 60%, #000 40%) !important;
  font-weight: 800 !important;
}
[data-theme="light"] .contrat-type-badge {
  filter: none;
  background: var(--chip-color, #7c3aed) !important;
  border-color: var(--chip-color, #7c3aed) !important;
  color: #fff !important;
  font-weight: 700;
}

/* ── Chiffres colorés dans les cartes ── */
[data-theme="light"] .contrat-figure-val { filter: none; font-weight: 800; }
[data-theme="light"] .contrat-stat-num--money { color: #7c3aed; }

/* ── Chips extincteurs totaux (ext-total-chip) ── */
[data-theme="light"] .ext-total-chip {
  background: #fff !important;
  border: 2px solid var(--chip-color) !important;
}
[data-theme="light"] .ext-total-num   { color: #1e293b !important; }
[data-theme="light"] .ext-total-label { color: #374151 !important; opacity: 1 !important; }
[data-theme="light"] .ext-total-chip [style*="color:var(--chip-color)"] { filter: brightness(.45) saturate(1.6); }

/* ── Variables sémantiques light ── */
[data-theme="light"] {
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --warning-border: #fbbf24;
}

/* ── Overrides couleurs inline — contraste ≥ 4.5:1 sur fond blanc ── */
/* Orange/ambre/jaune → brun foncé #92400e (ratio ~10:1) */
[data-theme="light"] [style*="color:#f0a500"],[data-theme="light"] [style*="color: #f0a500"] { color: #92400e !important; }
[data-theme="light"] [style*="color:#fbbf24"],[data-theme="light"] [style*="color: #fbbf24"] { color: #92400e !important; }
[data-theme="light"] [style*="color:#F0B429"],[data-theme="light"] [style*="color: #F0B429"] { color: #92400e !important; }
[data-theme="light"] [style*="color:#f97316"],[data-theme="light"] [style*="color: #f97316"] { color: #7c2d12 !important; }

/* Vert → vert foncé #14532d (ratio ~12:1) */
[data-theme="light"] [style*="color:#3ecc82"],[data-theme="light"] [style*="color: #3ecc82"] { color: #14532d !important; }
[data-theme="light"] [style*="color:#34d399"],[data-theme="light"] [style*="color: #34d399"] { color: #14532d !important; }
[data-theme="light"] [style*="color:#6EE7B7"] { color: #065f46 !important; }

/* Rouge → rouge foncé #991b1b (ratio ~9:1) */
[data-theme="light"] [style*="color:#e05252"],[data-theme="light"] [style*="color: #e05252"] { color: #991b1b !important; }
[data-theme="light"] [style*="color:#ef4444"],[data-theme="light"] [style*="color: #ef4444"] { color: #991b1b !important; }
[data-theme="light"] [style*="color:#f87171"],[data-theme="light"] [style*="color: #f87171"] { color: #991b1b !important; }
[data-theme="light"] [style*="color:#fb7185"],[data-theme="light"] [style*="color: #fb7185"] { color: #991b1b !important; }
[data-theme="light"] [style*="color:#e53e3e"],[data-theme="light"] [style*="color: #e53e3e"] { color: #991b1b !important; }
[data-theme="light"] [style*="color:#FCA5A5"] { color: #991b1b !important; }
[data-theme="light"] [style*="color:#991B1B"] { color: #7f1d1d !important; }

/* Violet/mauve → violet foncé #4c1d95 (ratio ~14:1) */
[data-theme="light"] [style*="color:#a78bfa"],[data-theme="light"] [style*="color: #a78bfa"] { color: #5b21b6 !important; }
[data-theme="light"] [style*="color:#8064A2"],[data-theme="light"] [style*="color: #8064A2"] { color: #4c1d95 !important; }
[data-theme="light"] [style*="color:#7C3AED"] { color: #4c1d95 !important; }
[data-theme="light"] [style*="color:#C4B5E8"] { color: #4c1d95 !important; }
[data-theme="light"] [style*="color:#9A8AB4"],[data-theme="light"] [style*="color: #9A8AB4"] { color: #4c1d95 !important; }
[data-theme="light"] [style*="color:#6048A0"],[data-theme="light"] [style*="color: #6048A0"] { color: #4c1d95 !important; }

/* Bleu → bleu foncé #1e3a8a (ratio ~14:1) */
[data-theme="light"] [style*="color:#60a5fa"],[data-theme="light"] [style*="color: #60a5fa"] { color: #1e3a8a !important; }
[data-theme="light"] [style*="color:#3b82f6"],[data-theme="light"] [style*="color: #3b82f6"] { color: #1e3a8a !important; }
[data-theme="light"] [style*="color:#6366F1"] { color: #1e3a8a !important; }

/* Cyan/teal → teal foncé #134e4a (ratio ~13:1) */
[data-theme="light"] [style*="color:#22d3ee"],[data-theme="light"] [style*="color: #22d3ee"] { color: #134e4a !important; }
[data-theme="light"] [style*="color:#14b8a6"],[data-theme="light"] [style*="color: #14b8a6"] { color: #134e4a !important; }

/* Gris clairs → gris foncés lisibles */
[data-theme="light"] [style*="color:#94a3b8"],[data-theme="light"] [style*="color: #94a3b8"] { color: #374151 !important; }
[data-theme="light"] [style*="color:#aaa"] { color: #4b5563 !important; }
[data-theme="light"] [style*="color:#888"] { color: #374151 !important; }
[data-theme="light"] [style*="color:#666"] { color: #1f2937 !important; }
[data-theme="light"] [style*="color:#eee"] { color: #374151 !important; }

/* Blanc → rendre visible sur fond clair */
[data-theme="light"] [style*="color:#fff"]:not(button):not(.btn):not(.badge) { color: #18112B !important; }
[data-theme="light"] [style*="color: #fff"]:not(button):not(.btn):not(.badge) { color: #18112B !important; }

/* ── Exp badges ── */
[data-theme="light"] .erp-exp-expired { background: #fee2e2; border-color: #fca5a5; color: #7f1d1d; }
[data-theme="light"] .erp-exp-soon    { background: #fef3c7; border-color: #fcd34d; color: #78350f; }
[data-theme="light"] .erp-exp-ok      { background: #dcfce7; border-color: #86efac; color: #14532d; }

/* ── Barre dashboard (barres colorées) ── */
[data-theme="light"] [style*="background:#e05252"],[data-theme="light"] [style*="background: #e05252"] { background: #dc2626 !important; }
[data-theme="light"] [style*="background:#f0a500"],[data-theme="light"] [style*="background: #f0a500"] { background: #d97706 !important; }
[data-theme="light"] [style*="background:#3ecc82"],[data-theme="light"] [style*="background: #3ecc82"] { background: #16a34a !important; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .navbar { display: none; }
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════
   ERP-UX — COUCHE TRANSVERSALE
═══════════════════════════════════════ */

/* Spinner bouton loader */
@keyframes erp-spin { to { transform: rotate(360deg); } }
.erp-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: erp-spin .65s linear infinite;
  vertical-align: middle;
}

/* Hint inline-edit */
.ie-hint {
  display: none; font-size: 10px; color: var(--text-muted);
  margin-left: 5px; opacity: .6; pointer-events: none;
}
.ie-hint::before { content: '✎'; }
td.ie:hover .ie-hint { display: inline; }
td.ie { cursor: text; }
td.ie:hover { background: rgba(128,100,162,.08) !important; outline: 1px solid rgba(128,100,162,.25); outline-offset: -1px; border-radius: 4px; }

/* Badges expiration */
.erp-exp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 20px; font-size: 10.5px; font-weight: 600;
  white-space: nowrap; margin-left: 4px;
}
.erp-exp-expired { background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger); }
.erp-exp-soon    { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.erp-exp-ok      { background: rgba(62,204,130,.08); border: 1px solid rgba(62,204,130,.18); color: var(--success); }

/* Modal confirmation icon */
.erp-confirm-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--danger-bg); border: 1px solid var(--danger-border);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.erp-confirm-icon::before {
  content: '';
  display: block; width: 18px; height: 18px;
  background: var(--danger);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z' clip-rule='evenodd'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Stat-card cliquable */
a.stat-card { text-decoration: none; display: block; cursor: pointer; }
a.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.stat-arrow { font-size: 11px; color: var(--text-muted); margin-top: 8px; opacity: 0; transition: opacity .2s; }
a.stat-card:hover .stat-arrow { opacity: 1; }

/* Row CTA (hover) */
/* row-cta : style hover row, pas d'opacité */
.row-cta { transition: background .12s; }
.row-cta:hover { background: var(--surface-hover); }
tr:hover .btn-row-cta { opacity: 1; }
.btn-row-cta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 600;
  border: none; cursor: pointer; white-space: nowrap;
  background: rgba(128,100,162,.18); color: var(--text-secondary);
  transition: background .15s;
}
.btn-row-cta:hover { background: rgba(128,100,162,.32); color: var(--text); }
.btn-row-cta.danger { background: rgba(224,82,82,.15); color: var(--danger); }
.btn-row-cta.danger:hover { background: rgba(224,82,82,.28); }

/* Dashboard 3 colonnes */
.dashboard-cols-3 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.dashboard-right-stack { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: hidden; }

/* Donut chart */
.donut-legend-item { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 12px; }
.donut-legend-item:last-child { border-bottom: none; }
.donut-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-name { color: var(--text-secondary); flex: 1; margin-left: 8px; }
.donut-legend-val { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--text-muted); }

/* Card footer */
.card-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card-footer a { font-size: 12px; color: var(--text-secondary); text-decoration: none; transition: color .15s; }
.card-footer a:hover { color: var(--text); }
.card-footer a strong { color: var(--text-secondary); }

/* Stepper */
.erp-stepper {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 8px 16px;
  margin-bottom: 20px; overflow: hidden;
}
.erp-step {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; font-size: 12px; font-weight: 600;
  color: var(--text-muted); flex-shrink: 0;
}
.erp-step-num {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
  background: rgba(255,255,255,.08); color: var(--text-muted);
}
.erp-step.done { color: var(--success); }
.erp-step.done .erp-step-num { background: rgba(62,204,130,.2); color: var(--success); }
.erp-step.active { color: var(--text); }
.erp-step.active .erp-step-num { background: var(--violet); color: #fff; }
.erp-step-sep { color: var(--border); margin: 0 2px; font-size: 14px; }

/* Breadcrumb */
.erp-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 14px;
}
.erp-breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.erp-breadcrumb a:hover { color: var(--text); }
.erp-breadcrumb-sep { color: var(--border); }
.erp-breadcrumb-current { color: var(--text-secondary); font-weight: 500; }

/* Timeline commissions */
.erp-timeline { display: flex; flex-direction: column; padding: 8px 16px; }
.erp-tl-item { display: flex; gap: 14px; padding: 10px 0; }
.erp-tl-left { display: flex; flex-direction: column; align-items: center; width: 18px; flex-shrink: 0; }
.erp-tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.erp-tl-line { flex: 1; width: 1px; background: var(--border); margin-top: 3px; min-height: 14px; }
.erp-tl-body { flex: 1; min-width: 0; }
.erp-tl-date { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.erp-tl-title { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Réserves séparées */
.reserves-section { padding: 10px 16px 4px; }
.reserves-section-head {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.reserves-section-head.danger { color: var(--danger); }
.reserves-section-head.success { color: var(--success); }
.reserves-collapse { font-size: 11px; color: var(--text-muted); cursor: pointer; margin-left: auto; background: none; border: none; padding: 2px 6px; }
.reserves-collapse:hover { color: var(--text); }

/* Filter pills */
.erp-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.erp-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  transition: all .15s;
}
.erp-pill:hover { border-color: rgba(128,100,162,.4); color: var(--text-secondary); }
.erp-pill.active { background: rgba(128,100,162,.18); border-color: rgba(128,100,162,.4); color: var(--text); }
.erp-pill.pill-danger { color: #e05252; border-color: rgba(224,82,82,.2); }
.erp-pill.pill-danger.active { background: rgba(224,82,82,.12); border-color: rgba(224,82,82,.4); color: #e05252; }
.erp-pill.pill-success.active { background: rgba(62,204,130,.1); border-color: rgba(62,204,130,.2); color: var(--success); }
.erp-pill-count { font-family: 'DM Mono', monospace; font-size: 10px; opacity: .7; }

@media (max-width: 1100px) { .dashboard-cols-3 { grid-template-columns: 1fr 1fr; } }

/* ═══════════════════════════════════════
   TRI DE TABLEAUX
═══════════════════════════════════════ */
thead th:not(.no-sort) { cursor: pointer; user-select: none; }

/* Pas de sélection de texte au survol des cartes */
.etab-card, .contrat-card, .ext-card, .apave-obs-card, .apave-rapport-card,
.eq-etab-card, .stat-card, .contrat-stat-block, .contrat-type-chip,
[class*="-card"], [class*="-chip"] { user-select: none; }
[class*="-card"] *, [class*="-chip"] *, .contrat-stat-block *,
.contrat-type-chip * { user-select: none; }
thead th:not(.no-sort):hover { color: var(--text); background: var(--surface-hover); }
thead th[data-sort-dir="asc"]::after  { content: ' ↑'; opacity: .7; font-size: 11px; }
thead th[data-sort-dir="desc"]::after { content: ' ↓'; opacity: .7; font-size: 11px; }

/* ═══════════════════════════════════════
   CHAMPS DE FORMULAIRE — max-width
═══════════════════════════════════════ */
input[type="number"].form-control,
input[type="date"].form-control   { max-width: 200px; }
input[type="tel"].form-control    { max-width: 220px; }
input[type="email"].form-control  { max-width: 300px; }
input[type="text"].form-control   { max-width: 400px; }
select.form-control               { max-width: 320px; }
/* Exceptions : champs pleine largeur explicites */
.form-control-full { max-width: 100% !important; }

/* ═══════════════════════════════════════
   DASHBOARD FIXE (non-scrollable)
═══════════════════════════════════════ */
main.dashboard-fixed {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 0px);
  padding-bottom: 8px;
}
main.dashboard-fixed .dashboard-cols-3 {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: 1fr;
  align-items: stretch;
}
main.dashboard-fixed .dashboard-card-scroll {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
main.dashboard-fixed .dashboard-card-scroll .table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
/* Stats compactes sur le dashboard */
main.dashboard-fixed .stats-grid { margin-bottom: 12px; }
main.dashboard-fixed .page-header { margin-bottom: 12px; padding-bottom: 12px; }
/* Footer boutons droite */
.dash-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Dashboard right stack (répartition + urgentes empilées) */
main.dashboard-fixed .dashboard-right-stack {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
main.dashboard-fixed .dashboard-right-stack .card {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
main.dashboard-fixed .dashboard-right-stack .dashboard-card-scroll .table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}


main.dashboard-fixed .dashboard-cols-3 > .card { margin-bottom: 0; }

/* ═══════════════════════════════════════
   GRILLE ÉTABLISSEMENTS — Cards layout
═══════════════════════════════════════ */
.etab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.etab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, background .15s;
  position: relative;
}
.etab-card:hover {
  border-color: rgba(255,255,255,.18);
  background: var(--surface-hover);
}
.etab-card--alert {
  border-color: rgba(224,82,82,.35);
}
.etab-card--alert:hover {
  border-color: rgba(224,82,82,.55);
}
.etab-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}
.etab-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  display: block;
}
.etab-card-name:hover { color: var(--text); text-decoration: underline; }
.etab-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 2px;
}
.etab-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.etab-meta-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.etab-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* ═══════════════════════════════════════
   FICHE DÉTAIL ÉTABLISSEMENT
═══════════════════════════════════════ */

/* Hero card */
.etab-hero {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.etab-hero-main { flex: 1; min-width: 0; }
.etab-hero-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 6px;
}
.etab-hero-address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.etab-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.etab-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 120px;
}
.etab-chip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-secondary);
}
.etab-chip-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Stats côté droit du hero */
.etab-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--border);
  padding-left: 24px;
  flex-shrink: 0;
}
.etab-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}
.etab-hero-stat:last-child { border-bottom: none; }
.etab-hero-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.etab-hero-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
}
.text-danger  { color: #e05252 !important; }
.text-warning { color: #f0a500 !important; }
.text-success { color: #3ecc82 !important; }

/* Layout 2 colonnes fiche */
.etab-detail-cols {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  align-items: start;
}
.etab-detail-side { display: flex; flex-direction: column; gap: 16px; }

/* Réserve row */
.reserve-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .12s;
}
.reserve-row:hover { border-color: rgba(255,255,255,.15); }
.reserve-row--levee { opacity: .55; }
.reserve-row[data-criticite="URGENT"] { border-left: 3px solid #e05252; }
.reserve-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.reserve-row-libelle {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}
.reserve-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* ═══════════════════════════════════════
   PAGE RÉSERVES — Cards grid
═══════════════════════════════════════ */
.reserves-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.reserve-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, background .15s;
}
.reserve-card:hover { border-color: rgba(255,255,255,.18); background: var(--surface-hover); }
.reserve-card--urgent { border-left: 3px solid #e05252; border-color: rgba(224,82,82,.4); }
.reserve-card--urgent:hover { border-color: rgba(224,82,82,.65); }
.reserve-card--levee { opacity: .55; }
.reserve-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.reserve-card-etab {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.reserve-card-etab:hover { color: var(--text); }
.reserve-card-libelle {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  flex: 1;
}
.reserve-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.reserve-card-actions {
  display: flex;
  gap: 6px;
}

/* ── Commissions grid ─────────────────────────────────────── */
.commissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.commission-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.commission-card:hover {
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.commission-card--danger {
  border-left: 3px solid #e05252;
  border-color: rgba(224,82,82,.35);
}
.commission-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.commission-card-etab {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
  line-height: 1.3;
}
.commission-card-etab:hover { color: var(--violet); }
.commission-card-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.commission-date-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex: 1;
  min-width: 100px;
}
.commission-date-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-secondary);
}
.commission-date-val {
  font-size: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.commission-card-obs {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.commission-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

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

/* ── Contrats de maintenance ───────────────────────────────── */
.contrat-stat-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
}
.contrat-stat-block--money {
  background: rgba(128,100,162,.12);
  border-color: rgba(128,100,162,.3);
}
.contrat-stat-block--warn {
  background: rgba(240,165,0,.08);
  border-color: rgba(240,165,0,.25);
}
.contrat-stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
}
.contrat-stat-num--money { color: #a78bfa; }
.contrat-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Récap par type */
.contrat-type-recap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.contrat-type-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
  user-select: none;
}
.contrat-type-chip:hover { opacity: .85; }
.contrat-type-chip.active { box-shadow: 0 0 0 2px var(--chip-color); }
.contrat-type-chip-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--chip-color);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.contrat-type-chip-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--chip-color);
  background: var(--chip-border);
  border-radius: 10px;
  padding: 1px 6px;
}
.contrat-type-chip-total {
  font-size: 10px;
  color: var(--chip-color);
  opacity: .75;
}

/* Grille cards */
.contrats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.contrat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--card-accent, rgba(255,255,255,.1));
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, border-color .15s;
}
.contrat-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  border-color: rgba(255,255,255,.15);
  border-top-color: var(--card-accent);
}
.contrat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.contrat-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 6px;
}
.contrat-card-etab {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.contrat-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contrat-meta-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
}
.contrat-card-figures {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.contrat-figure {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contrat-figure-val {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}
.contrat-figure-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.contrat-card-obs {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(255,255,255,.03);
  border-radius: 6px;
  border: 1px solid var(--border);
}
.contrat-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

/* ── Extincteurs / BAES / Désenfumage ─────────────────────── */
.ext-totaux {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ext-total-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  cursor: pointer;
  transition: opacity .15s, box-shadow .15s;
  user-select: none;
}
.ext-total-chip:hover { opacity: .85; }
.ext-total-chip.active { box-shadow: 0 0 0 2px var(--chip-color); }
.ext-total-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--chip-color);
  line-height: 1;
}
.ext-total-label {
  font-size: 10px;
  color: var(--chip-color);
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* Grid cards */
.ext-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.ext-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, border-color .15s;
}
.ext-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  border-color: rgba(255,255,255,.18);
}
.ext-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.ext-card-nom {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.ext-card-adresse {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.ext-card-total-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ext-equip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ext-equip-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--eb);
  border: 1px solid var(--eborder);
}
.ext-equip-qty {
  font-size: 16px;
  font-weight: 800;
  color: var(--ec);
  line-height: 1;
}
.ext-equip-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ec);
  opacity: .8;
}

/* Section modal */
.ext-modal-section {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--section-color, var(--violet));
}
.ext-modal-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--section-color, var(--text));
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Équipements de sécurité ───────────────────────────────── */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.eq-etab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow .15s, border-color .15s;
}
.eq-etab-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  border-color: rgba(255,255,255,.18);
}
.eq-etab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.eq-etab-nom {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.eq-etab-nom:hover { color: var(--violet); }
.eq-etab-count {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  flex-shrink: 0;
}
.eq-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.eq-item {
  padding: 10px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color .12s;
}
.eq-item:hover { border-color: rgba(255,255,255,.14); }
.eq-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.eq-type-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
}
.eq-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.eq-detail-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 8px;
}
.eq-item-obs {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
}
.eq-item-actions {
  display: flex;
  gap: 5px;
  margin-top: 2px;
}
.eq-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 7px;
  background: rgba(255,255,255,.03);
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  margin-top: 2px;
}
.eq-add-btn:hover {
  background: rgba(128,100,162,.08);
  border-color: rgba(128,100,162,.3);
  color: var(--violet);
}

/* ══ APAVE ══ */
.apave-rapports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.apave-rapport-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.apave-rapport-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.apave-rapport-etab {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.apave-rapport-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.apave-rapport-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* Observations manuelles grid */
.apave-obs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.apave-obs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-top: 3px solid var(--card-accent, rgba(255,255,255,.12));
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s;
}
.apave-obs-card--levee {
  opacity: .72;
}
.apave-obs-card--levee:hover { opacity: 1; }

/* ══ LÉGIONELLOSE ══ */
.legio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.legio-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid #14b8a6;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s;
}
.legio-card--alerte {
  border-top-color: #f0a500;
}
