/**
 * css/style.css — Design system de Legal Notary (Enterprise Notary ERP & SaaS).
 *
 * Interface fintech & juridique haute fidélité avec double thème :
 * - Dark Mode (Anthracite profond #16161A, cartes #1E1E24, indigo #6366F1, or brossé #C5A880)
 * - Light Mode (Blanc cassé doux #F8F9FA, cartes blanches #FFFFFF, indigo royal #4F46E5, laiton #B38F5F)
 * - Typographie prestigieuse (Playfair / Cinzel pour les titres d'actes, Space Grotesk + Inter pour les métriques & workflows)
 * - Badges d'état sémantiques (Signed, In Progress, Missing Document, Overdue)
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,400&family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* =========================================================================
   THÈME SOMBRE (DÉFAUT / DARK MODE)
   ========================================================================= */
:root, [data-theme="dark"] {
  --color-bg: #16161a;
  --color-sidebar: #0f1218;
  --color-surface: #1e1e24;
  --color-surface-2: #272730;
  --color-surface-card: #202028;
  --color-text: #f3f4f6;
  --color-text-dim: #9ca3af;
  --color-text-muted: #6b7280;

  /* Couleurs d'accentuation & Prestige */
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --color-accent-dim: rgba(99, 102, 241, 0.16);
  --color-gold: #c5a880;
  --color-gold-hover: #d4af37;
  --color-gold-bg: rgba(197, 168, 128, 0.16);
  --color-gold-border: rgba(197, 168, 128, 0.35);

  /* États Sémantiques Fintech */
  --color-signed: #10b981;
  --color-signed-bg: rgba(16, 185, 129, 0.14);
  --color-signed-border: rgba(16, 185, 129, 0.30);
  
  --color-progress: #38bdf8;
  --color-progress-bg: rgba(56, 189, 248, 0.14);
  --color-progress-border: rgba(56, 189, 248, 0.30);

  --color-missing: #f59e0b;
  --color-missing-bg: rgba(245, 158, 11, 0.14);
  --color-missing-border: rgba(245, 158, 11, 0.30);

  --color-overdue: #ef4444;
  --color-overdue-bg: rgba(239, 68, 68, 0.14);
  --color-overdue-border: rgba(239, 68, 68, 0.30);

  /* Rétro-compatibilité */
  --color-success: #10b981;
  --color-success-100: rgba(16, 185, 129, 0.16);
  --color-success-800: #86efac;
  --color-warning: #f59e0b;
  --color-warning-100: rgba(245, 158, 11, 0.16);
  --color-warning-800: #fde68a;
  --color-danger: #ef4444;
  --color-danger-100: rgba(239, 68, 68, 0.16);
  --color-danger-800: #fca5a5;
  --color-info: #38bdf8;
  --color-info-100: rgba(56, 189, 248, 0.16);

  /* Bordures & Ombres Dark */
  --color-divider: rgba(255, 255, 255, 0.08);
  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-subtle: rgba(255, 255, 255, 0.05);
  --color-border-hover: rgba(99, 102, 241, 0.50);

  --font-legal: 'Playfair Display', Georgia, serif;
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --space-1: 6px; --space-2: 10px; --space-3: 14px; --space-4: 20px; --space-6: 28px; --space-8: 40px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
}

/* =========================================================================
   THÈME CLAIR (LIGHT MODE / FINTECH SOPHISTICATED)
   ========================================================================= */
[data-theme="light"] {
  --color-bg: #f8f9fa;
  --color-sidebar: #0f172a;
  --color-surface: #ffffff;
  --color-surface-2: #f1f5f9;
  --color-surface-card: #ffffff;
  --color-text: #0f172a;
  --color-text-dim: #475569;
  --color-text-muted: #94a3b8;

  /* Couleurs d'accentuation Light */
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-dim: rgba(79, 70, 229, 0.10);
  --color-gold: #b38f5f;
  --color-gold-hover: #967244;
  --color-gold-bg: rgba(179, 143, 95, 0.12);
  --color-gold-border: rgba(179, 143, 95, 0.35);

  /* États Sémantiques Light */
  --color-signed: #059669;
  --color-signed-bg: #ecfdf5;
  --color-signed-border: #a7f3d0;

  --color-progress: #0284c7;
  --color-progress-bg: #f0f9ff;
  --color-progress-border: #bae6fd;

  --color-missing: #d97706;
  --color-missing-bg: #fffbeb;
  --color-missing-border: #fde68a;

  --color-overdue: #dc2626;
  --color-overdue-bg: #fef2f2;
  --color-overdue-border: #fecaca;

  /* Rétro-compatibilité */
  --color-success: #059669;
  --color-success-100: #ecfdf5;
  --color-success-800: #047857;
  --color-warning: #d97706;
  --color-warning-100: #fffbeb;
  --color-warning-800: #b45309;
  --color-danger: #dc2626;
  --color-danger-100: #fef2f2;
  --color-danger-800: #b91c1c;
  --color-info: #0284c7;
  --color-info-100: #f0f9ff;

  /* Bordures & Ombres Light */
  --color-divider: #e2e8f0;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  --color-border-hover: rgba(79, 70, 229, 0.40);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { 
  background: var(--color-bg); 
  color: var(--color-text); 
  font-family: var(--font-body); 
  font-size: 14.5px; 
  line-height: 1.55; 
  transition: background-color .2s ease, color .2s ease;
}

h1, h2, h3, h4, h5, h6 { 
  font-family: var(--font-heading); 
  font-weight: 700; 
  margin: 0 0 var(--space-2); 
  letter-spacing: -.02em; 
  color: var(--color-text);
}
h1 { font-size: 26px; } 
h3 { font-size: 18px; } 
h5 { font-size: 14px; }

.legal-serif-title {
  font-family: var(--font-legal);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--color-text-dim); }

/* Boutons modernes Fintech */
button { font-family: inherit; }
.btn { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 6px; 
  cursor: pointer; 
  font-family: var(--font-heading); 
  font-weight: 600; 
  font-size: 13px; 
  padding: 8px 16px; 
  border-radius: var(--radius); 
  border: 1px solid var(--color-border); 
  color: var(--color-text); 
  background: var(--color-surface); 
  box-shadow: var(--shadow-sm);
  transition: all .15s cubic-bezier(0.4, 0, 0.2, 1); 
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { 
  background: var(--color-accent); 
  color: #ffffff !important; 
  border-color: var(--color-accent); 
  font-weight: 700; 
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover:not(:disabled) { 
  background: var(--color-accent-hover); 
  border-color: var(--color-accent-hover); 
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.50); 
  transform: translateY(-1px);
}
.btn-secondary { 
  background: var(--color-surface-2); 
  border-color: var(--color-border); 
}
.btn-secondary:hover:not(:disabled) { 
  background: var(--color-surface); 
  border-color: var(--color-border-hover); 
  transform: translateY(-1px);
}
.btn-ghost { 
  color: var(--color-text-dim); 
  padding-inline: 8px; 
  background: transparent; 
  border-color: transparent; 
  box-shadow: none;
}
.btn-ghost:hover { 
  background: var(--color-accent-dim); 
  color: var(--color-accent); 
}
.btn-gold {
  background: var(--color-gold-bg);
  color: var(--color-gold);
  border-color: var(--color-gold-border);
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--color-gold);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(197, 168, 128, 0.4);
}
.btn-block { width: 100%; }

/* Champs de saisie */
.field label { 
  display: block; 
  font-size: 12px; 
  font-weight: 600; 
  margin-bottom: 6px; 
  color: var(--color-text-dim); 
  letter-spacing: .01em; 
}
.input { 
  width: 100%; 
  box-sizing: border-box; 
  min-height: 40px; 
  padding: 9px 13px; 
  font: inherit; 
  font-size: 14px; 
  color: var(--color-text); 
  background: var(--color-surface-2); 
  border: 1px solid var(--color-border); 
  border-radius: var(--radius); 
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; 
}
.input:focus-visible { 
  outline: none; 
  border-color: var(--color-accent); 
  box-shadow: 0 0 0 3px var(--color-accent-dim); 
  background: var(--color-surface);
}
textarea.input { min-height: 90px; resize: vertical; font-family: var(--font-body); }
select.input { -webkit-appearance: none; appearance: none; }

/* Cartes & Conteneurs modernes avec surfaces étagées */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-md);
}
.card-kicker { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-dim); }
.card-title { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--color-text); }
.card-body { margin: 0; font-size: 13px; color: var(--color-text-dim); flex: 1; line-height: 1.5; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-dim); }
.elev-sm { box-shadow: var(--shadow-sm); } .elev-md { box-shadow: var(--shadow-md); } .elev-lg { box-shadow: var(--shadow-lg); }

/* =========================================================================
   BADGES D'ÉTAT SÉMANTIQUES (SIGNED, IN PROGRESS, MISSING DOC, OVERDUE)
   ========================================================================= */
.tag, .badge-status { 
  display: inline-flex; 
  align-items: center; 
  gap: 5px;
  font-size: 11.5px; 
  font-weight: 700; 
  letter-spacing: .02em; 
  padding: 4px 10px; 
  border-radius: 999px; 
  border: 1px solid transparent; 
  white-space: nowrap;
}
.tag-signed, .badge-signed, .tag-neutral { 
  background: var(--color-signed-bg); 
  color: var(--color-signed); 
  border-color: var(--color-signed-border); 
}
.tag-progress, .badge-progress { 
  background: var(--color-progress-bg); 
  color: var(--color-progress); 
  border-color: var(--color-progress-border); 
}
.tag-missing, .badge-missing, .tag-accent { 
  background: var(--color-missing-bg); 
  color: var(--color-missing); 
  border-color: var(--color-missing-border); 
}
.tag-overdue, .badge-overdue, .tag-accent-2 { 
  background: var(--color-overdue-bg); 
  color: var(--color-overdue); 
  border-color: var(--color-overdue-border); 
}
.tag-outline { 
  border: 1px solid var(--color-border); 
  color: var(--color-text-dim); 
  background: var(--color-surface-2); 
}
.tag-gold {
  background: var(--color-gold-bg);
  color: var(--color-gold);
  border-color: var(--color-gold-border);
}

/* =========================================================================
   CODES COULEURS FINTECH : PRIORITÉS DES DOSSIERS
   ========================================================================= */
.tag-prio-critique {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.40);
  font-weight: 700;
}
.tag-prio-haute, .tag-prio-vigilance {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.40);
  font-weight: 700;
}
.tag-prio-normale {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.35);
  font-weight: 600;
}
.tag-prio-faible {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.28);
  font-weight: 600;
}

[data-theme="light"] .tag-prio-critique {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}
[data-theme="light"] .tag-prio-haute, [data-theme="light"] .tag-prio-vigilance {
  background: #fffbeb;
  color: #d97706;
  border-color: #fde68a;
}
[data-theme="light"] .tag-prio-normale {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}
[data-theme="light"] .tag-prio-faible {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

/* =========================================================================
   CODES COULEURS FINTECH : ÉTAPES DU CIRCUIT JURIDIQUE & STATUTS
   ========================================================================= */
.tag-etape-1 {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border-color: rgba(2, 132, 199, 0.35);
}
.tag-etape-2 {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.35);
}
.tag-etape-3 {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}
.tag-etape-4 {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.40);
}
.tag-etape-5 {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.35);
}
.tag-etape-6, .tag-statut-cloture {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
.tag-statut-actif {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.30);
}
.tag-statut-bloque {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.30);
}

[data-theme="light"] .tag-etape-1 { background: #f0f9ff; color: #0284c7; border-color: #bae6fd; font-weight: 700; }
[data-theme="light"] .tag-etape-2 { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; font-weight: 700; }
[data-theme="light"] .tag-etape-3 { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; font-weight: 700; }
[data-theme="light"] .tag-etape-4 { background: #fefce8; color: #a16207; border-color: #fef08a; font-weight: 700; }
[data-theme="light"] .tag-etape-5 { background: #fff7ed; color: #c2410c; border-color: #ffedd5; font-weight: 700; }
[data-theme="light"] .tag-etape-6, [data-theme="light"] .tag-statut-cloture { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; font-weight: 700; }
[data-theme="light"] .tag-statut-actif { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; font-weight: 700; }
[data-theme="light"] .tag-statut-bloque { background: #fef2f2; color: #b91c1c; border-color: #fecaca; font-weight: 700; }

/* Indicateurs de statut en pastilles rondes */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot-signed { background: var(--color-signed); box-shadow: 0 0 6px var(--color-signed); }
.status-dot-progress { background: var(--color-progress); box-shadow: 0 0 6px var(--color-progress); }
.status-dot-missing { background: var(--color-missing); box-shadow: 0 0 6px var(--color-missing); }
.status-dot-overdue { background: var(--color-overdue); box-shadow: 0 0 6px var(--color-overdue); }

.status-dot-etape-1 { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.6); }
.status-dot-etape-2 { background: #818cf8; box-shadow: 0 0 6px rgba(129, 140, 248, 0.6); }
.status-dot-etape-3 { background: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.6); }
.status-dot-etape-4 { background: #facc15; box-shadow: 0 0 6px rgba(250, 204, 21, 0.6); }
.status-dot-etape-5 { background: #fb923c; box-shadow: 0 0 6px rgba(251, 146, 60, 0.6); }
.status-dot-etape-6 { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.6); }

/* Bouton sélecteur de thème ☀️ / 🌙 */
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.theme-switch-btn:hover {
  background: var(--color-surface);
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* Grille et cartes KPI */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-accent, var(--color-accent));
}
.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--kpi-accent, var(--color-border-hover));
  box-shadow: var(--shadow-md);
}

/* Cartes et éléments interactifs du Dashboard */
.card-interactive {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.card-interactive:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent) !important;
  box-shadow: var(--shadow-md);
}

.circuit-chip-dash, .circuit-prio-dash, .badge-filtre-dash {
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
  user-select: none;
}
.circuit-chip-dash:hover, .circuit-prio-dash:hover, .badge-filtre-dash:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  opacity: 0.95;
}
.actif-circuit-filter {
  outline: 2px solid var(--color-accent) !important;
  outline-offset: 1px;
  font-weight: 700 !important;
}

.ligne-clerc-dash {
  cursor: pointer;
  transition: background-color .15s ease;
}
.ligne-clerc-dash:hover {
  background-color: var(--color-surface-2) !important;
}
.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-dim);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kpi-valeur {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--kpi-color, var(--color-text));
}

/* Panneaux de section du tableau de bord */
.dashboard-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--color-border);
}
.panel-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.panel-body {
  padding: var(--space-4);
}

/* Tableau encadré et stylisé */
.table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
}
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--color-border);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--color-surface-2); }

/* Navigation supérieure */
.nav { 
  display: flex; 
  align-items: center; 
  gap: var(--space-3); 
  padding: 10px var(--space-4); 
  background: var(--color-surface); 
  border-bottom: 1px solid var(--color-divider); 
  box-shadow: var(--shadow-sm);
  transition: background-color .2s ease, border-color .2s ease;
}
.nav-brand { 
  font-family: var(--font-heading); 
  font-weight: 700; 
  font-size: 17px; 
  color: var(--color-text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Barre latérale haute fidélité (Dark Slate Enterprise) */
.barre-laterale {
  background: var(--color-sidebar);
  border-right: 1px solid var(--color-divider);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
  transition: background-color .2s ease;
}
.barre-laterale .lnk-item { 
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.barre-laterale .lnk-item:hover { 
  color: #ffffff !important; 
  background: rgba(255, 255, 255, 0.08); 
  transform: translateX(2px);
}
.barre-laterale .lnk-item.actif,
.barre-laterale .lnk-item[data-actif="true"] { 
  color: #ffffff !important; 
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.28) 0%, rgba(99, 102, 241, 0.12) 100%) !important; 
  border-left: 3px solid var(--color-accent) !important;
  font-weight: 700 !important;
}

.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.toggle input { width: 36px; height: 20px; accent-color: var(--color-accent); }

/* ---------------------------------------------------------------- */
/* Mise en page applicative (pas dans le fichier de design d'origine, */
/* ajoutée ici pour l'app réelle — mêmes jetons, même esprit)         */
/* ---------------------------------------------------------------- */
#app { display: none; }
#app.pret { display: block; }

.ecran { display: none; }
.ecran.actif { display: block; }

.chargement {
  position: fixed; inset: 0; background: var(--color-bg); color: var(--color-text-dim);
  display: flex; align-items: center; justify-content: center; font-size: 14px; z-index: 500;
}

.erreur-inline { color: var(--color-danger-800); font-size: 13px; margin-top: var(--space-2); }

/* ---------------------------------------------------------------- */
/* Onglets de navigation (Paramètres, Vues détaillées)               */
/* ---------------------------------------------------------------- */
.tabs-nav {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 18px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.tab-btn:hover { color: var(--color-text); }
.tab-btn.actif { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.tab-pane { display: none; }
.tab-pane.actif { display: block; }

/* ---------------------------------------------------------------- */
/* Modales (Équipe, Nouveau membre, Validation acte, Web Push)       */
/* ---------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: var(--space-4);
}
.modal-conteneur {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.modal-body {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-divider);
}

.print-only { display: none; }

/* ---------------------------------------------------------------- */
/* Mise en page d'impression officielle (@media print)               */
@media print {
  @page {
    margin: 4mm 6mm !important;
    size: A4 portrait;
  }
  body, html {
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 7.5pt !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
  }
  #app,
  .barre-laterale,
  .nav,
  .no-print,
  #toast,
  .chargement,
  button,
  .tabs-nav,
  input,
  select,
  textarea,
  #modal-racine,
  .zone-scroll,
  .ecran {
    display: none !important;
  }
  #print-container,
  .print-only {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 285mm !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
    page-break-after: avoid !important;
    page-break-before: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    break-after: avoid !important;
    break-before: avoid !important;
    overflow: hidden !important;
  }
  .print-header {
    border-bottom: 2px solid #111827;
    padding-bottom: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    margin-bottom: 20px;
    font-size: 10pt;
  }
  .print-table th {
    background: #f3f4f6 !important;
    color: #111827 !important;
    border: 1px solid #9ca3af !important;
    padding: 6px 10px !important;
    text-align: left;
  }
  .print-table td {
    border: 1px solid #d1d5db !important;
    padding: 6px 10px !important;
    color: #111827 !important;
  }
  .print-total-row {
    font-weight: 700;
    background: #f9fafb !important;
  }
  .print-signatures {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
  }
}

/* Responsive layout & Mobile Drawer definitions are handled in dedicated mobile section below */

/* Sélecteur rapide de rôles dans la barre supérieure */
.btn-role-switch {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-dim);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.btn-role-switch:hover {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-role-switch.actif {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.4);
}

/* Bandeau Top 5 Actes dans Dossiers */
.top-actes-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  flex-wrap: nowrap !important;
  padding-bottom: 6px;
  margin-bottom: var(--space-4);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.top-actes-bar::-webkit-scrollbar {
  display: none;
}
.top-acte-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--color-surface-2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.top-acte-chip span {
  font-size: 13px;
}
.top-acte-chip strong {
  color: var(--color-text-dim);
  font-weight: 600;
}
.top-acte-chip:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.top-acte-chip:hover strong {
  color: var(--color-accent);
}
.top-acte-chip.actif {
  background: var(--color-accent-dim);
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
  box-shadow: 0 0 12px var(--color-accent-dim);
}
.top-acte-chip.actif strong {
  color: var(--color-accent);
  font-weight: 700;
}

/* Accordéon / Cartes multi-dossiers client */
.client-dossier-subitem {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  transition: border-color .15s ease, background-color .15s ease;
}
.client-dossier-subitem:hover {
  border-color: var(--color-border-hover);
}

/* Panneau latéral / Tiroir détaillé d'un acte */
.tiroir-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  justify-content: flex-end;
}
.tiroir-contenu {
  width: 100%;
  max-width: 640px;
  height: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
}

/* =========================================================================
   VUE ARCHIVAGE & NUMÉRISATION NOTARIALE
   ========================================================================= */
.archive-nav-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 8px;
  margin-bottom: var(--space-4);
  overflow-x: auto;
}
.archive-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-dim);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s ease;
  white-space: nowrap;
}
.archive-nav-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.archive-nav-btn.actif {
  background: var(--color-surface-2);
  border-color: var(--color-border);
  color: var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
}

/* Grille des cartons physiques */
.carton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.carton-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform .15s ease, border-color .15s ease;
}
.carton-card:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}
.carton-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--color-divider);
}
.carton-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width .3s ease;
}

/* Fiche officielle d'archivage & Étiquette */
.fiche-archivage-document {
  background: #ffffff;
  color: #1e293b;
  border: 2px solid #0f172a;
  border-radius: 6px;
  padding: 24px;
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.4;
}
.fiche-archivage-document h2 {
  font-family: 'Times New Roman', Times, serif;
  color: #0f172a;
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: 1px;
}
.etiquette-carton-box {
  background: #ffffff;
  color: #000000;
  border: 3px solid #000000;
  padding: 16px;
  border-radius: 4px;
  font-family: monospace;
  text-align: center;
}

/* =========================================================================
   DOCUMENT A4 NOTARIÉ (Fiche de taxe, Note de frais, Facture normalisée)
   ========================================================================= */
.document-a4-notarie {
  width: 100%;
  max-width: 210mm;
  min-height: 297mm;
  background-color: #ffffff !important;
  color: #111827 !important;
  padding: 12mm 14mm;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.document-a4-notarie * {
  box-sizing: border-box;
}

.document-a4-notarie table td,
.document-a4-notarie table th {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.document-a4-notarie td[style*="text-align:right"],
.document-a4-notarie th[style*="text-align:right"] {
  white-space: nowrap !important;
}

#zone-apercu-feuille-a4 {
  background: #374151;
  padding: 24px 16px;
  border-radius: var(--radius);
  max-height: 72vh;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

@media print {
  @page {
    margin: 4mm 6mm;
    size: A4 portrait;
  }
  .document-a4-notarie {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: 100% !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: hidden !important;
  }
}

/* Lignes et interactions dynamiques dans la Facturation */
.tr-compta-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.tr-compta-row:hover td {
  background-color: var(--color-surface-2) !important;
}
.badge-statut-compta-click:hover {
  filter: brightness(0.92);
  transform: translateY(-1px);
  transition: all 0.15s ease;
}

/* =========================================================================
   DOCUMENT KYC NOTARIÉ MULTI-PAGES (5 PAGES A4 CONFORMES CENTIF / DÉONTOLOGIE)
   ========================================================================= */
.document-kyc-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 210mm;
  margin: 0 auto;
}

.document-kyc-page {
  background: #ffffff !important;
  color: #111827 !important;
  padding: 12mm 14mm;
  box-sizing: border-box;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  min-height: 297mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 8.5pt;
  line-height: 1.35;
  position: relative;
}

.document-kyc-page * {
  box-sizing: border-box;
}

@media print {
  .document-kyc-container {
    gap: 0 !important;
    max-width: 100% !important;
  }
  .document-kyc-page {
    page-break-after: always !important;
    break-after: page !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 6mm 8mm !important;
    min-height: 100vh !important;
    height: auto !important;
  }
  .document-kyc-page:last-child {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}

/* =========================================================================
   SYSTÈME RESPONSIVE MOBILE & MULTI-ÉCRANS HAUTE FIDÉLITÉ (ODOO-GRADE ERP)
   ========================================================================= */

/* Reset tactile & Viewport dynamique */
html, body {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Bouton Hamburger Mobile (Caché sur grand écran Desktop) */
.mobile-burger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--radius);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 19px;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.mobile-burger-btn:hover {
  background: var(--color-accent-dim);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.mobile-burger-btn:active {
  transform: scale(0.95);
}

/* Backdrop sombre flouté pour le menu Off-Canvas Mobile */
.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu-backdrop.actif {
  opacity: 1;
  pointer-events: auto;
}

/* En-tête mobile interne au drawer de navigation */
.drawer-mobile-header {
  display: none;
}

/* Conteneur universel pour tableaux défilables */
.table-wrap, .table-container, .table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: var(--space-4);
  scrollbar-width: thin;
}

.table-wrap table.table,
.table-container table.table,
.table-wrapper table.table {
  min-width: 620px;
  width: 100%;
  border-collapse: collapse;
}

/* =========================================================================
   BREAKPOINT TABLETTES & MOBILES (Largeur <= 992px)
   ========================================================================= */
@media (max-width: 992px) {
  /* Barre de navigation supérieure */
  .mobile-burger-btn {
    display: inline-flex !important;
  }

  .nav {
    padding: 0 12px !important;
    gap: 8px !important;
    height: 54px !important;
    min-height: 54px !important;
  }

  .nav-brand {
    font-size: 14px !important;
    max-width: 140px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: -0.3px !important;
  }

  .nav-user-info, .nav-user-divider {
    display: none !important;
  }

  .nav-btn-doc {
    padding: 5px 8px !important;
    font-size: 12px !important;
  }
  .nav-btn-doc .nav-doc-text {
    display: none !important;
  }
  .nav-btn-doc .nav-doc-icon {
    display: inline !important;
    font-size: 15px;
  }

  .theme-switch-btn {
    padding: 5px 8px !important;
  }
  .theme-switch-btn .theme-switch-label {
    display: none !important;
  }

  .btn-nav-deconnexion {
    padding: 5px 8px !important;
  }
  .btn-nav-deconnexion .deconnexion-text {
    display: none !important;
  }
  .btn-nav-deconnexion .deconnexion-icon {
    display: inline !important;
    font-size: 14px;
  }

  /* BARRE LATÉRALE TRANSFORMÉE EN TIROIR OFF-CANVAS NATIVE-LIKE */
  .barre-laterale {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 295px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999 !important;
    background: var(--color-sidebar) !important;
    border-right: 1px solid var(--color-border) !important;
    box-shadow: 4px 0 35px rgba(0, 0, 0, 0.75) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 16px 14px 28px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
  }

  .barre-laterale.menu-mobile-ouvert {
    transform: translateX(0) !important;
  }

  .drawer-mobile-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 4px 14px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid var(--color-border) !important;
  }

  .drawer-close-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 34px !important;
    height: 34px !important;
    border-radius: var(--radius) !important;
    background: var(--color-surface-2) !important;
    border: 1px solid var(--color-border) !important;
    color: var(--color-text) !important;
    font-size: 16px !important;
    cursor: pointer !important;
  }

  .barre-laterale .lnk-item {
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
  }

  /* Disposition globale du contenu */
  .app-main-layout {
    flex-direction: column !important;
    height: calc(100vh - 54px) !important;
    height: calc(100dvh - 54px) !important;
  }

  .zone-scroll {
    padding: 14px 12px 64px 12px !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Ajustements typographiques et d'en-tête */
  h1, .ecran-titre {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  /* Grille des KPIs */
  .grid-dashboard, .stats-grid, .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .kpi-card {
    padding: 12px 14px !important;
  }
  .kpi-label {
    font-size: 11px !important;
  }
  .kpi-valeur {
    font-size: 22px !important;
  }

  /* En-têtes collants adaptés pour mobile */
  div[style*="position:sticky"] {
    top: -14px !important;
    padding: 10px 0 6px 0 !important;
  }

  /* Cartes dossiers dans Kanban et Listes */
  .carte-dossier {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Grille d'agenda semaine */
  div[style*="grid-template-columns:repeat(7, 1fr)"],
  div[style*="grid-template-columns:repeat(7,1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Grille 4 colonnes des rapports */
  div[style*="grid-template-columns:repeat(4, 1fr)"],
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
}

/* =========================================================================
   BREAKPOINT SMARTPHONES (< 768px) — EXPÉRIENCE NATIVE MOBILE
   ========================================================================= */
@media (max-width: 768px) {
  /* Éviter le zoom automatique intempestif sur iOS Safari lors du focus */
  .input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select.input, textarea.input {
    font-size: 16px !important;
    min-height: 44px !important;
  }
  .btn {
    min-height: 42px !important;
  }

  /* Adaptation des formulaires en colonne unique */
  div[style*="grid-template-columns:repeat(auto-fit,minmax(240px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fit,minmax(280px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fit,minmax(300px,1fr))"],
  div[style*="grid-template-columns:repeat(auto-fit,minmax(320px,1fr))"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Alignement vertical des sous-éléments de comparants et clients */
  .client-dossier-subitem {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
  .client-dossier-subitem > div:last-child {
    width: 100% !important;
    justify-content: flex-end !important;
    border-top: 1px solid var(--color-divider);
    padding-top: 8px;
  }

  /* Lignes de comparants dans le formulaire nouveau dossier */
  #nd-comparants > div {
    flex-direction: column !important;
    align-items: stretch !important;
    background: var(--color-surface-2);
    padding: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
  }
  #nd-comparants > div .input {
    width: 100% !important;
    flex: none !important;
  }
  #nd-comparants > div .nd-retirer-comparant {
    align-self: flex-end !important;
    color: var(--color-danger) !important;
    font-weight: 600;
  }

  /* MODALES EN BOTTOM-SHEET SUR MOBILE */
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
    z-index: 100000 !important;
  }
  .modal-conteneur {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    margin: 0 !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6) !important;
    animation: slideUpBottomSheet 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  @keyframes slideUpBottomSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-header {
    padding: 16px 16px 12px !important;
    position: relative !important;
  }
  .modal-header::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: var(--color-divider);
    border-radius: 2px;
  }
  .modal-body {
    padding: 14px 16px 20px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 12px !important;
  }
  .modal-footer {
    padding: 12px 16px 24px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }
  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 11px !important;
  }
}

/* =========================================================================
   BREAKPOINT TRÈS PETITS ÉCRANS (< 480px)
   ========================================================================= */
@media (max-width: 480px) {
  .nav-brand {
    font-size: 13px !important;
    max-width: 120px !important;
  }

  .grid-dashboard, .stats-grid, .kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .kpi-card {
    padding: 10px 10px !important;
  }
  .kpi-label {
    font-size: 10px !important;
  }
  .kpi-valeur {
    font-size: 19px !important;
  }

  /* Boutons d'action dans les barres supérieures */
  .ecran-header .btn, .header-action-row .btn {
    width: 100% !important;
  }
}


