/* ═══════════════════════════════════════════════════
   GestionAV Pro v2 — Design System Premium
   Support thèmes Dark / Light
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── THÈME SOMBRE (défaut) ── */
:root,
[data-theme="dark"] {
  --bg-base:       #080b12;
  --bg-card:       #0f1420;
  --bg-sidebar:    #0b0f1a;
  --bg-hover:      #161d2e;
  --bg-input:      #131826;
  --bg-modal:      #0f1420;

  --border:        rgba(255,255,255,0.06);
  --border-focus:  rgba(59,130,246,0.5);
  --border-hover:  rgba(255,255,255,0.12);

  --accent:        #3b82f6;
  --accent-light:  rgba(59,130,246,0.12);
  --accent-2:      #10b981;
  --accent-2-light:rgba(16,185,129,0.12);
  --accent-3:      #f59e0b;
  --accent-3-light:rgba(245,158,11,0.12);
  --accent-4:      #ef4444;
  --accent-4-light:rgba(239,68,68,0.12);
  --accent-purple: #8b5cf6;
  --accent-purple-light: rgba(139,92,246,0.12);

  --text-1:        #f0f4ff;
  --text-2:        #8892a4;
  --text-3:        #404860;

  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --secondary:     #8b5cf6;

  --shadow:        0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.3);
}

/* ── THÈME CLAIR ── */
[data-theme="light"] {
  --bg-base:       #f0f2f8;
  --bg-card:       #ffffff;
  --bg-sidebar:    #1e2535;
  --bg-hover:      #f5f7ff;
  --bg-input:      #f8fafc;
  --bg-modal:      #ffffff;

  --border:        rgba(0,0,0,0.08);
  --border-focus:  rgba(59,130,246,0.4);
  --border-hover:  rgba(0,0,0,0.15);

  --text-1:        #0f1728;
  --text-2:        #5a6478;
  --text-3:        #9ba3b2;

  --shadow:        0 8px 32px rgba(0,0,0,0.1);
  --shadow-sm:     0 2px 12px rgba(0,0,0,0.06);
}

/* Sidebar reste dark en mode light */
[data-theme="light"] .sidebar {
  background: #1e2535;
  border-right-color: rgba(255,255,255,0.06);
}
[data-theme="light"] .sidebar .nav-item { color: #94a3b8; }
[data-theme="light"] .sidebar .nav-item:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }
[data-theme="light"] .sidebar .nav-item.active { background: rgba(59,130,246,0.2); color: #60a5fa; }
[data-theme="light"] .sidebar .nav-section-label,
[data-theme="light"] .sidebar .text-muted { color: #475569 !important; }
[data-theme="light"] .sidebar .user-card { background: rgba(255,255,255,0.08); }
[data-theme="light"] .sidebar .user-name { color: #f1f5f9; }
[data-theme="light"] .sidebar .user-role { color: #94a3b8; }

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ── LAYOUT ── */
.app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 256px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.logo-text { font-family: 'Space Grotesk',sans-serif; font-weight: 700; font-size: 15px; color: #f1f5f9; }
.logo-text span { color: var(--accent); }
.logo-badge { font-size: 10px; background: var(--accent-light); color: var(--accent); border-radius: 4px; padding: 1px 5px; margin-left: 4px; font-weight: 600; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px; scrollbar-width: thin; }

.nav-group { margin-bottom: 4px; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3); padding: 10px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; color: var(--text-2);
  text-decoration: none; font-weight: 500; font-size: 13.5px;
  transition: all 0.15s; margin-bottom: 1px; cursor: pointer;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(59,130,246,0.2);
}
.nav-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--accent); color: white;
  border-radius: 12px; padding: 1px 7px;
}

.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
}
.user-pill {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 10px; background: var(--bg-hover); cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.user-pill:hover { background: var(--border); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: white;
}
.user-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.user-info-name { font-weight: 600; font-size: 13px; color: var(--text-1); line-height: 1.2; }
.user-info-role { font-size: 11px; color: var(--text-3); }

/* ── TOPBAR ── */
.topbar {
  height: 60px; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  transition: background 0.3s;
}
.topbar-menu-btn {
  display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 6px;
}
.topbar-menu-btn span { width: 20px; height: 2px; background: var(--text-2); border-radius: 2px; transition: all 0.3s; }
.topbar-title { font-family: 'Space Grotesk',sans-serif; font-weight: 600; font-size: 15px; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── MAIN ── */
.main { margin-left: 256px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; transition: margin 0.3s; }
.page { padding: 24px; flex: 1; }

/* ── PAGE HEADER ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.page-head-left .page-title { font-family: 'Space Grotesk',sans-serif; font-size: 20px; font-weight: 700; }
.page-head-left .page-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── CARDS ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  transition: background 0.3s, border-color 0.2s;
}
.card:hover { border-color: var(--border-hover); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-family: 'Space Grotesk',sans-serif; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-2); }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; position: relative; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-hover); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  border-radius: 12px 12px 0 0;
}
.stat-card.blue::after   { background: linear-gradient(90deg, var(--accent), var(--accent-purple)); }
.stat-card.green::after  { background: var(--accent-2); }
.stat-card.amber::after  { background: var(--accent-3); }
.stat-card.red::after    { background: var(--accent-4); }
.stat-card.purple::after { background: var(--accent-purple); }

.stat-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.stat-value { font-family: 'Space Grotesk',sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
.stat-meta  { font-size: 12px; color: var(--text-2); }
.stat-icon  { position: absolute; top: 16px; right: 16px; font-size: 26px; opacity: 0.1; }

/* ── PÉRIODE TABS ── */
.period-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period-tabs { display: flex; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 1px; }
.period-tab { padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.period-tab:hover { color: var(--text-1); }
.period-tab.active { background: var(--accent); color: white; font-weight: 600; }

.year-select { background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-1); padding: 5px 10px; font-size: 12px; font-family: 'DM Sans',sans-serif; outline: none; cursor: pointer; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; font-family: 'DM Sans',sans-serif;
  text-decoration: none; border: none; cursor: pointer;
  transition: all 0.2s; white-space: nowrap; line-height: 1.4;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #2563eb; box-shadow: 0 0 20px rgba(59,130,246,0.3); }
.btn-success { background: var(--accent-2); color: white; }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--accent-3); color: white; }
.btn-danger  { background: var(--accent-4); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-1); background: var(--bg-hover); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; border-radius: 7px; }

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-grid-3 { grid-template-columns: repeat(3,1fr); }
.form-full { grid-column: 1/-1; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.2px; }
.form-label .req { color: var(--accent-4); margin-left: 2px; }

.form-control {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-1);
  padding: 9px 12px; font-size: 13.5px; font-family: 'DM Sans',sans-serif;
  outline: none; width: 100%; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-light); }
.form-control::placeholder { color: var(--text-3); }
.form-control option { background: var(--bg-card); }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint { font-size: 11px; color: var(--text-3); }
.form-section { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-3); padding: 12px 0 8px; border-top: 1px solid var(--border); margin-top: 8px; }

/* ── SEARCH BAR ── */
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 12px;
  transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
  background: none; border: none; color: var(--text-1); padding: 8px 4px;
  font-size: 13px; font-family: 'DM Sans',sans-serif; outline: none; width: 200px;
}
.search-box input::placeholder { color: var(--text-3); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--bg-base); padding: 11px 14px;
  text-align: left; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-3);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  cursor: pointer; user-select: none; transition: color 0.2s;
}
thead th:hover { color: var(--text-2); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 12px 14px; vertical-align: middle; }
.td-mono { font-family: 'Space Grotesk',sans-serif; font-weight: 600; }
.td-right { text-align: right; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green   { background: var(--accent-2-light); color: var(--accent-2); }
.badge-blue    { background: var(--accent-light);   color: var(--accent); }
.badge-amber   { background: var(--accent-3-light); color: var(--accent-3); }
.badge-red     { background: var(--accent-4-light); color: var(--accent-4); }
.badge-purple  { background: var(--accent-purple-light); color: var(--accent-purple); }
.badge-gray    { background: var(--bg-hover); color: var(--text-2); }

/* ── ALERTS ── */
.alert {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; font-weight: 500;
  animation: slideIn 0.3s ease;
}
.alert-success { background: var(--accent-2-light); border: 1px solid rgba(16,185,129,0.25); color: var(--accent-2); }
.alert-error   { background: var(--accent-4-light); border: 1px solid rgba(239,68,68,0.25);  color: var(--accent-4); }
.alert-warning { background: var(--accent-3-light); border: 1px solid rgba(245,158,11,0.25); color: var(--accent-3); }
.alert-close   { margin-left: auto; cursor: pointer; opacity: 0.7; font-size: 16px; }
@keyframes slideIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 16px; }
.page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; border: 1px solid var(--border); transition: all 0.15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn.disabled { opacity: 0.3; pointer-events: none; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-modal); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px; width: 480px; max-width: 94vw;
  transform: scale(0.94); transition: transform 0.25s;
  max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.open .modal { transform: scale(1); }
.modal-title { font-family: 'Space Grotesk',sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.modal-text  { color: var(--text-2); font-size: 13.5px; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── FRAIS VÉHICULE (dynamique) ── */
.frais-list { display: flex; flex-direction: column; gap: 8px; }
.frais-row {
  display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr auto;
  gap: 8px; align-items: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  transition: border-color 0.2s;
}
.frais-row:hover { border-color: var(--border-hover); }
.frais-row input, .frais-row select { font-size: 12.5px; padding: 6px 10px; }

.add-frais-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-light); border: 1px dashed rgba(59,130,246,0.4);
  border-radius: 8px; padding: 10px 14px; color: var(--accent);
  font-size: 13px; font-weight: 600; cursor: pointer;
  width: 100%; justify-content: center; transition: all 0.2s;
}
.add-frais-btn:hover { background: rgba(59,130,246,0.15); border-style: solid; }

.frais-total-box {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; margin-top: 4px;
}
.frais-total-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.frais-total-value { font-family: 'Space Grotesk',sans-serif; font-size: 18px; font-weight: 700; color: var(--accent-3); }

/* ── CALC BOX ── */
.calc-box {
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.calc-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.calc-row-label { color: var(--text-2); }
.calc-divider { height: 1px; background: var(--border); }
.calc-result { font-family: 'Space Grotesk',sans-serif; font-size: 22px; font-weight: 700; }

/* ── RESULT CARDS ── */
.result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.result-card { background: var(--bg-base); border: 1px solid var(--border); border-radius: 12px; padding: 18px; text-align: center; }
.result-val { font-family: 'Space Grotesk',sans-serif; font-size: 26px; font-weight: 700; margin: 8px 0 4px; }
.result-lbl { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); }

/* ── LOGIN ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg-base); position: relative; overflow: hidden; }
.login-glow {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.06) 0%, transparent 70%);
  top: -100px; left: -100px; pointer-events: none;
}
.login-glow2 {
  position: absolute; width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.05) 0%, transparent 70%);
  bottom: -50px; right: -50px; pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; width: 420px; max-width: 95vw;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo .logo-big { width: 54px; height: 54px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-purple)); }
.login-logo h1 { font-family: 'Space Grotesk',sans-serif; font-size: 22px; font-weight: 700; }
.login-logo p { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* ── THEME SWITCH ── */
.theme-switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.switch-track { width: 36px; height: 20px; background: var(--border); border-radius: 10px; position: relative; transition: background 0.3s; }
.switch-track.on { background: var(--accent); }
.switch-thumb { width: 14px; height: 14px; background: white; border-radius: 50%; position: absolute; top: 3px; left: 3px; transition: left 0.2s; }
.switch-track.on .switch-thumb { left: 19px; }

/* ── HISTORIQUE ── */
.hist-row .old-val { color: var(--accent-4); font-size: 12px; }
.hist-row .new-val { color: var(--accent-2); font-size: 12px; }
.hist-arrow { color: var(--text-3); margin: 0 6px; }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 44px; opacity: 0.3; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-2); }
.empty-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }

/* ── CHART ── */
.chart-wrap { position: relative; height: 240px; }

/* ── COLORS ── */
.text-green  { color: var(--accent-2); }
.text-blue   { color: var(--accent); }
.text-amber  { color: var(--accent-3); }
.text-red    { color: var(--accent-4); }
.text-muted  { color: var(--text-2); }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--accent-2); }
.text-danger  { color: var(--accent-4); }

/* ── UTILS ── */
.divider  { height: 1px; background: var(--border); margin: 16px 0; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.mt-12    { margin-top: 12px; }
.mt-16    { margin-top: 16px; }
.mb-14    { margin-bottom: 14px; }
.w-full   { width: 100%; }
.flex     { display: flex; }
.flex-center { display: flex; align-items: center; }
.j-between { justify-content: space-between; }
.sticky-panel { position: sticky; top: 76px; }
.role-pill-admin   { background: var(--accent-light);   color: var(--accent); }
.role-pill-manager { background: var(--accent-purple-light); color: var(--accent-purple); }
.role-pill-agent   { background: var(--accent-2-light); color: var(--accent-2); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.5); }
  .main { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .result-grid { grid-template-columns: 1fr; }
  .stats-grid  { grid-template-columns: repeat(2,1fr); }
  .frais-row   { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .page { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .login-card { padding: 26px 18px; }
  .result-grid { grid-template-columns: 1fr; }
  .frais-row { grid-template-columns: 1fr; }
}
