/* ============================================================
   Digital Flow style.css
   Design system : Apple Liquid Glass · iOS 26 · visionOS · Fintech Premium
   ============================================================ */

/* ---------- Google Fonts (Inter) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- Variables globales ---------- */
:root {
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --font: "SF Pro Display", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --trans: .28s cubic-bezier(.4, 0, .2, 1);
  --trans-spring: .35s cubic-bezier(.34, 1.56, .64, 1);
  --sidebar-w: 272px;
  --green: #16C784;
  --red: #FF453A;
  --amber: #FF9F0A;
  --blue: #0A84FF;
  --purple: #BF5AF2;
  --indigo: #5E5CE6;

  /* Shadows multicouches */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow:    0 4px 16px rgba(0,0,0,.12), 0 12px 40px rgba(0,0,0,.10), 0 1px 0 rgba(255,255,255,.08) inset;
  --shadow-lg: 0 8px 32px rgba(0,0,0,.18), 0 24px 64px rgba(0,0,0,.14);
  --shadow-glow-green: 0 0 40px rgba(22,199,132,.22);
  --shadow-glow-blue:  0 0 40px rgba(10,132,255,.18);

  /* Accent glow */
  --glow-btn: 0 4px 20px rgba(22,199,132,.45);
}

/* ---------- Thème sombre (défaut) ---------- */
[data-theme="dark"] {
  --bg:          #060C17;
  --bg2:         #0A1628;
  --bg3:         #0D1E38;
  --card:        rgba(14, 26, 50, .72);
  --card2:       rgba(20, 34, 62, .65);
  --card-solid:  #0E1A32;
  --glass:       rgba(12, 22, 44, .62);
  --glass-light: rgba(255, 255, 255, .06);
  --glass-heavy: rgba(10, 18, 38, .88);
  --border:      rgba(255, 255, 255, .09);
  --border-light:rgba(255, 255, 255, .15);
  --border-acc:  rgba(22, 199, 132, .30);
  --text:        #F0F4FF;
  --text2:       #C8D6EE;
  --muted:       #6A82A4;
  --accent:      #16C784;
  --accent-dim:  #0D9E68;
  --accent-soft: rgba(22, 199, 132, .12);
  --accent-glow: rgba(22, 199, 132, .25);
  --input:       rgba(8, 16, 34, .80);
  --topbar-bg:   rgba(8, 14, 28, .75);

  /* Gradient de fond */
  --bg-grad: radial-gradient(ellipse 900px 600px at 80% -5%,  rgba(22,199,132,.08)  0%, transparent 70%),
             radial-gradient(ellipse 700px 500px at -5% 110%, rgba(10,132,255,.07)  0%, transparent 65%),
             radial-gradient(ellipse 600px 400px at 50% 50%,  rgba(94,92,230,.04)   0%, transparent 70%);
}

/* ---------- Thème clair ---------- */
[data-theme="light"] {
  --bg:          #F0F4FA;
  --bg2:         #E6EDF7;
  --bg3:         #EBF0F8;
  --card:        rgba(255, 255, 255, .82);
  --card2:       rgba(246, 249, 255, .88);
  --card-solid:  #FFFFFF;
  --glass:       rgba(255, 255, 255, .72);
  --glass-light: rgba(255, 255, 255, .50);
  --glass-heavy: rgba(255, 255, 255, .95);
  --border:      rgba(0, 0, 0, .07);
  --border-light:rgba(0, 0, 0, .05);
  --border-acc:  rgba(15, 169, 112, .30);
  --text:        #0A1628;
  --text2:       #2A3A55;
  --muted:       #6B7FA0;
  --accent:      #0FA970;
  --accent-dim:  #0D8C5C;
  --accent-soft: rgba(15, 169, 112, .10);
  --accent-glow: rgba(15, 169, 112, .20);
  --input:       rgba(255, 255, 255, .90);
  --topbar-bg:   rgba(240, 244, 250, .80);

  --shadow-sm: 0 1px 4px rgba(0,0,0,.05), 0 4px 18px rgba(0,0,0,.07);
  --shadow:    0 2px 12px rgba(0,0,0,.07), 0 8px 32px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.10), 0 20px 56px rgba(0,0,0,.08);

  --bg-grad: radial-gradient(ellipse 900px 600px at 80% -5%,  rgba(15,169,112,.07) 0%, transparent 70%),
             radial-gradient(ellipse 700px 500px at -5% 110%, rgba(10,132,255,.06) 0%, transparent 65%);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background-color: var(--bg);
  background-image:
    url('../assets/hero.png');
  background-repeat: no-repeat, no-repeat;
  background-position: center center, center center;
  background-size: 420px, auto;
  background-attachment: fixed, fixed;
}
@media (max-width: 768px) {
  html {
    background-attachment: scroll;
  }
}
[data-theme="light"] html {
  filter: none;
}

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
  background: transparent;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- Utilitaires ---------- */
.hidden  { display: none !important; }
.muted   { color: var(--muted); }
.pos     { color: var(--green); }
.neg     { color: var(--red); }
.warn    { color: var(--amber); }
.num     { font-variant-numeric: tabular-nums; letter-spacing: -.01em; font-feature-settings: "tnum"; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Layout ---------- */
.app {
  display: flex;
  min-height: 100dvh;
  position: relative;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 0 22px 100px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.view {
  animation: fadeUp .38s var(--trans) both;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pop {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

/* ============================================================
   LIQUID GLASS composant de base
   ============================================================ */
.glass {
  background: var(--glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  /* Reflet interne subtil sur le bord haut */
  position: relative;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Variante plus profonde */
.glass-heavy {
  background: var(--glass-heavy);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 16px 12px 20px;
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-right: 1px solid var(--border);
  z-index: 60;
  overflow: hidden;
}

/* Halo décoratif dans la sidebar */
.sidebar::after {
  content: "";
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

/* Marque */
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 10px 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 14px rgba(22,199,132,.4));
  transition: filter var(--trans);
}

.brand-mark:hover { filter: drop-shadow(0 6px 20px rgba(22,199,132,.6)); }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
}

.brand-text span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .02em;
  margin-top: 1px;
}

/* Nav */
.nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.nav-tagline {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  padding: 1.25rem 1rem 1rem;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.01em;
  border-top: 1px solid var(--border-subtle);
}
.nav::-webkit-scrollbar { width: 3px; }
.nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
  font-weight: 700;
  padding: 16px 10px 6px;
  opacity: .75;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--trans);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link .ni {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity var(--trans);
}

.nav-link:hover {
  color: var(--text);
  background: var(--glass-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-link:hover .ni { opacity: 1; }

.nav-link.active {
  color: var(--text);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px var(--accent-glow);
}

.nav-link.active .ni { opacity: 1; }

.sidebar-foot {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin: 14px 0 20px;
  border-radius: var(--radius);
  background: var(--topbar-bg);
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--trans);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.05) 0%, transparent 60%);
  pointer-events: none;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.025em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  border: 1px solid var(--border-acc);
  border-radius: 999px;
  padding: 4px 8px;
  transition: all var(--trans);
}

.month-picker:hover { background: rgba(22,199,132,.18); }

.month-picker span {
  font-size: 13px;
  font-weight: 600;
  min-width: 112px;
  text-align: center;
  text-transform: capitalize;
  letter-spacing: -.01em;
}

/* Boutons icônes */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: all var(--trans);
  position: relative;
  overflow: hidden;
}

.icon-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}

.icon-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(22,199,132,.15);
}

.icon-btn:active { transform: scale(.95); }

#menu-btn { display: none; }

/* ============================================================
   GRILLE & CARTES
   ============================================================ */
.grid { display: grid; gap: 18px; }
.g2   { grid-template-columns: repeat(2, 1fr); }
.g3   { grid-template-columns: repeat(3, 1fr); }
.g4   { grid-template-columns: repeat(4, 1fr); }

/* Carte de base Liquid Glass */
.card {
  background: var(--card);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  position: relative;
  overflow: hidden;
}

/* Reflet haut-gauche */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.18) 40%, rgba(255,255,255,.08) 70%, transparent 100%);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}

.card.hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-acc);
}

.card h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
}

/* KPI */
.kpi {
  position: relative;
  overflow: hidden;
}

.kpi .k-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.kpi .k-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.04em;
  margin-top: 6px;
  line-height: 1;
  color: var(--text);
}

.kpi .k-sub {
  font-size: 12px;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 500;
}

.kpi::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}

/* Carte héro / patrimoine */
.hero {
  background: linear-gradient(135deg,
    rgba(10,132,255,.18) 0%,
    rgba(14,26,50,.92) 40%,
    rgba(11,38,28,.90) 100%);
  border: 1px solid rgba(22,199,132,.20);
  color: #EAF1FB;
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  padding: 28px 30px;
}

/* Halo lumineux hero */
.hero::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(22,199,132,.18) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -50px;
  left: 30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(10,132,255,.12) 0%, transparent 65%);
  pointer-events: none;
}

[data-theme="light"] .hero {
  background: linear-gradient(135deg, #0B1B33 0%, #143b66 50%, #0d5c44 100%);
  color: #EAF1FB;
}

.hero .k-label { color: rgba(234,241,251,.65); }
.hero .k-value { font-size: 36px; color: #fff; }
.hero .k-sub   { color: rgba(234,241,251,.55); }

.hero .spark {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  opacity: .8;
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.hero-val {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -.05em;
  line-height: 1;
}

.hero-spark {
  flex: 1;
  min-width: 0;
  opacity: .7;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  transition: all var(--trans);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--trans);
}

.btn:hover::before { opacity: 1; }

.btn-primary {
  background: var(--accent);
  color: #02180E;
  box-shadow: var(--glow-btn);
}

.btn-primary:hover {
  filter: brightness(1.10);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(22,199,132,.55);
}

.btn-primary:active { transform: scale(.97); }

.btn-ghost {
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border-light);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent-dim);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(255,69,58,.12);
  color: var(--red);
  border-color: rgba(255,69,58,.25);
}

.btn-danger:hover { background: rgba(255,69,58,.20); }

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-block { width: 100%; }

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form     { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--input);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  outline: none;
  transition: border var(--trans), box-shadow var(--trans);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field select option { background: var(--bg3); }

/* Segmenté */
.seg {
  display: flex;
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 3px;
}

.seg button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  border-radius: calc(var(--radius-xs) - 4px);
  font-weight: 600;
  font-size: 13px;
  transition: all var(--trans);
}

.seg button.on {
  background: var(--accent);
  color: #02180E;
  box-shadow: 0 2px 8px rgba(22,199,132,.30);
}

/* ============================================================
   LISTES & TABLES
   ============================================================ */
.list { display: flex; flex-direction: column; }

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border);
  transition: background var(--trans), border-radius var(--trans);
}

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

.row:hover {
  background: var(--glass-light);
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
}

.row .ric {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  background: var(--card2);
  border: 1px solid var(--border);
}

.row .rmain        { flex: 1; min-width: 0; }
.row .rmain strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .rmain span { font-size: 12px; color: var(--muted); }
.row .ramount    { font-weight: 700; font-size: 14px; white-space: nowrap; }

.row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--trans);
}

.row:hover .row-actions { opacity: 1; }

@media (hover: none) { .row-actions { opacity: 1; } }

.mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  place-items: center;
  transition: all var(--trans);
}

.mini-btn:hover { color: var(--text); border-color: var(--accent); }

/* Tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }

.tbl th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.tbl td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tbl tr:last-child td { border-bottom: none; }

.tbl tr:hover td {
  background: var(--glass-light);
}

.tbl .num { text-align: right; }

/* ============================================================
   BADGES & PROGRESS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .01em;
}

.b-green  { background: rgba(22,199,132,.15); color: var(--green); }
.b-red    { background: rgba(255,69,58,.15);  color: var(--red);   }
.b-amber  { background: rgba(255,159,10,.15); color: var(--amber); }
.b-blue   { background: rgba(10,132,255,.15); color: var(--blue);  }

/* Compatibilité avec anciens noms */
.badge-green { background: rgba(22,199,132,.15); color: var(--green); }
.badge-red   { background: rgba(255,69,58,.15);  color: var(--red);   }
.badge-amber { background: rgba(255,159,10,.15); color: var(--amber); }

/* Progress */
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(22,199,132,.7));
  transition: width .7s var(--trans);
  box-shadow: 0 0 8px var(--accent-glow);
}

.progress.amber > i { background: linear-gradient(90deg, var(--amber), rgba(255,159,10,.7)); }
.progress.red > i   { background: linear-gradient(90deg, var(--red),   rgba(255,69,58,.7));  }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  animation: slideDown .3s var(--trans) both;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.alert.warn   { background: rgba(255,159,10,.10); border-color: rgba(255,159,10,.30); color: var(--amber); }
.alert.danger { background: rgba(255,69,58,.10);  border-color: rgba(255,69,58,.30);  color: var(--red);   }
.alert.info   { background: rgba(10,132,255,.10); border-color: rgba(10,132,255,.30); color: var(--blue);  }

/* ============================================================
   MODALE
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 20, .65);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn .22s ease both;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  animation: pop .32s var(--trans) both;
  background: var(--glass-heavy);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.04) inset;
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,.04) 0%, transparent 80%);
  flex-shrink: 0;
}

.modal-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* ============================================================
   FAB & TOAST
   ============================================================ */
.fab {
  position: fixed;
  right: 22px;
  bottom: 28px;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  border: none;
  background: var(--accent);
  color: #02180E;
  font-size: 26px;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(22,199,132,.45), 0 0 0 1px rgba(22,199,132,.30) inset;
  z-index: 50;
  transition: transform var(--trans-spring), box-shadow var(--trans);
  display: none;
  align-items: center;
  justify-content: center;
}

.fab:hover {
  transform: scale(1.08) rotate(90deg);
  box-shadow: 0 10px 36px rgba(22,199,132,.60);
}

.fab:active { transform: scale(.94); }

.toast-zone {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--glass-heavy);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--accent-dim);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow), 0 0 20px rgba(22,199,132,.15);
  animation: fadeUp .3s var(--trans) both;
  pointer-events: auto;
}

/* ============================================================
   CHARTS
   ============================================================ */
.chart-wrap { position: relative; width: 100%; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  font-size: 12.5px;
}

.chart-legend .li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 500;
}

.chart-legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.tooltip {
  position: fixed;
  pointer-events: none;
  background: var(--glass-heavy);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-acc);
  padding: 8px 13px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 600;
  z-index: 300;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity .15s;
  white-space: nowrap;
}

/* ============================================================
   ÉCRAN DE VERROUILLAGE
   ============================================================ */
.lock-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn .3s ease;
}

.lock-card {
  max-width: 380px;
  width: 100%;
  border-radius: 28px;
  padding: 40px 36px;
  text-align: center;
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
}

.lock-logo {
  font-size: 44px;
  margin-bottom: 14px;
  animation: pulse-dot 2.8s ease-in-out infinite;
}

.lock-card h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 26px 0;
}

.pin-dots i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  transition: all .15s var(--trans);
}

.pin-dots i.on {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scale(1.1);
}

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

.pin-pad button {
  height: 64px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  transition: all var(--trans);
  position: relative;
  overflow: hidden;
}

.pin-pad button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}

.pin-pad button:hover {
  border-color: var(--accent-dim);
  background: var(--accent-soft);
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(22,199,132,.15);
}

.pin-pad button:active { transform: scale(.95); }

.pin-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 14px;
  min-height: 20px;
  font-weight: 600;
  animation: fadeUp .2s ease;
}

/* ============================================================
   CALENDRIER
   ============================================================ */
.cal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal-dow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 6px 0;
}

.cal-cell {
  min-height: 84px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px;
  background: var(--card2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  transition: all var(--trans);
  cursor: pointer;
}

.cal-cell:hover { border-color: var(--accent-dim); }

.cal-num {
  font-size: 12px;
  font-weight: 700;
  display: block;
  margin-bottom: 3px;
}

.cal-cell .d {
  font-weight: 700;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.cal-cell.dim  { opacity: .35; }

.cal-cell.off {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.cal-cell.today {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.cal-ev {
  display: block;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-ev.in      { background: rgba(22,199,132,.18);  color: var(--green); }
.cal-ev.out     { background: rgba(255,69,58,.18);   color: var(--red);   }
.cal-ev.bill    { background: rgba(255,159,10,.18);  color: var(--amber); }
.cal-ev.pending { background: rgba(255,159,10,.18);  color: var(--amber); }
.cal-ev.late    { background: rgba(255,69,58,.18);   color: var(--red);   }
.cal-ev.paid    { background: rgba(22,199,132,.18);  color: var(--green); }
.cal-ev.credit  { background: rgba(10,132,255,.18);  color: var(--blue);  }

.cal-more { font-size: 10px; color: var(--muted); display: block; }
.cal-tot  { font-size: 10px; font-weight: 700; display: block; margin-top: 2px; }

/* ============================================================
   DIVERS
   ============================================================ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
}

.empty .e-ic {
  font-size: 42px;
  margin-bottom: 14px;
  opacity: .55;
}

.empty p {
  font-size: 14px;
  margin-bottom: 18px;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  margin: 26px 0 13px;
  letter-spacing: -.02em;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filters select,
.filters input {
  padding: 8px 13px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--input);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 13.5px;
  transition: border var(--trans);
}

.filters select:focus,
.filters input:focus {
  border-color: var(--accent);
  outline: none;
}

.card.mini { padding: 15px 17px; }

.empty-ico { font-size: 42px; margin-bottom: 12px; opacity: .6; }

/* Score ring */
.score-ring { display: grid; place-items: center; position: relative; }

.score-ring .sv { position: absolute; text-align: center; }
.score-ring .sv strong { font-size: 34px; font-weight: 800; display: block; }
.score-ring .sv span   { font-size: 12px; color: var(--muted); }

/* Tips */
.tip {
  background: var(--card2);
  border-left: 3px solid var(--accent);
  padding: 12px 15px;
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-size: 13.5px;
  margin-bottom: 10px;
}

.tip.warn   { border-color: var(--amber); }
.tip.danger { border-color: var(--red);   }

/* Toggle switch */
.toggle { display: inline-flex; align-items: center; cursor: pointer; }
.toggle input { display: none; }

.toggle-track {
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: var(--border);
  transition: background var(--trans);
  position: relative;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  transition: transform var(--trans);
}

.toggle input:checked ~ .toggle-track { background: var(--accent); }
.toggle input:checked ~ .toggle-track::after { transform: translateX(20px); }

/* Icône de compte */
.acc-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--card2);
  border: 1px solid var(--border);
}

/* Rows (listes modules) */
.row-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--card2);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main b {
  font-size: .93rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-amt { font-size: .93rem; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* Pick (sélecteurs icône/couleur) */
.pick-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.pick {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 2px solid transparent;
  background: var(--card2);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--trans);
}

.pick.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pick.color { width: 28px; height: 28px; border-radius: 50%; }
.pick.color.sel { border-color: var(--text); }

/* Table tbl-wrap */
.tbl-wrap { overflow-x: auto; }

/* ============================================================
   BACKDROP (overlay mobile sidebar)
   ============================================================ */
.backdrop { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    transform: translateX(-108%);
    transition: transform var(--trans);
    box-shadow: var(--shadow-lg);
    z-index: 70;
    /* ✅ Désactiver backdrop-filter sur mobile — cause le bug iOS */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg2); /* fond opaque à la place */
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 20, .70);
    /* ✅ Pas de backdrop-filter sur le backdrop non plus */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 65;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans);
  }

  .backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 640px) {
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .form-row      { grid-template-columns: 1fr; }

  .topbar h1 { font-size: 16px; }

  .month-picker span { min-width: 88px; font-size: 12.5px; }

  .kpi .k-value  { font-size: 23px; }
  .hero .k-value { font-size: 28px; }

  .cal-cell {
    min-height: 58px;
    padding: 4px;
  }

  .cal-ev { display: none; }

  .cal-cell .pips { display: flex; gap: 2px; flex-wrap: wrap; }
  .cal-cell .pip  { width: 6px; height: 6px; border-radius: 50%; }
}

@media (min-width: 641px) {
  .cal-cell .pips { display: none; }
}

/* Ultra-large */
@media (min-width: 1600px) {
  .main { padding: 0 32px 100px; }
  .grid { gap: 22px; }
}

/* ============================================================
   IMPRESSION
   ============================================================ */
@media print {
  .sidebar, .topbar, .fab, #alerts-bar, .toast-zone { display: none !important; }
  body { background: #fff; color: #000; }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
    backdrop-filter: none;
  }
}

/* ============================================================
   ACCESSIBILITÉ & MOUVEMENT RÉDUIT
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
/* ============================================================
   INPUTS GLOBAUX — modale & formulaires sans .field
   ============================================================ */
.modal-body input,
.modal-body select,
.modal-body textarea {
  width: 100%;
  padding: 12px 15px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  outline: none;
  font-size: 15px;
  font-weight: 500;
  transition: border var(--trans), box-shadow var(--trans), background var(--trans);
  font-family: var(--font);
}

.modal-body input::placeholder,
.modal-body textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.modal-body input:focus,
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
  background: rgba(22, 199, 132, .05);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-body input:hover,
.modal-body select:hover {
  background: rgba(255, 255, 255, .09);
  border-color: var(--border-light);
}

.modal-body select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236A82A4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.modal-body select option {
  background: var(--bg3);
  color: var(--text);
}

[data-theme="light"] .modal-body input,
[data-theme="light"] .modal-body select,
[data-theme="light"] .modal-body textarea {
  background: rgba(255, 255, 255, .90);
  border-color: rgba(0, 0, 0, .10);
}

[data-theme="light"] .modal-body input:focus,
[data-theme="light"] .modal-body select:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* ============================================================
   SELECTS & INPUTS hors modale (Settings, filtres, vue)
   ============================================================ */
.view select,
.view input[type="text"],
.view input[type="number"],
.view input[type="date"],
.view input[type="email"],
.view input[type="password"] {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  outline: none;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  transition: border var(--trans), box-shadow var(--trans), background var(--trans);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236A82A4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
  min-width: 160px;
}

.view select:focus,
.view input:focus {
  border-color: var(--accent);
  background: rgba(22, 199, 132, .05);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.view select:hover,
.view input:hover {
  background: rgba(255, 255, 255, .09);
  border-color: var(--border-light);
}

.view select option {
  background: var(--bg3);
  color: var(--text);
}

[data-theme="light"] .view select,
[data-theme="light"] .view input {
  background: rgba(255, 255, 255, .90);
  border-color: rgba(0, 0, 0, .10);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7FA0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

[data-theme="light"] .view select:focus,
[data-theme="light"] .view input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
/* ============================================================
   CUSTOM SELECT — dropdown stylisé
   ============================================================ */
.custom-select {
  position: relative;
  display: inline-block;
}

.custom-select select {
  padding: 9px 36px 9px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  min-width: 160px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236A82A4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border var(--trans), background var(--trans);
  /* Plus de position absolute, plus de z-index, plus d'opacity */
}

.custom-select select:focus {
  border-color: var(--accent);
  background-color: rgba(22,199,132,.05);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.custom-select select:hover {
  background-color: rgba(255,255,255,.09);
  border-color: var(--accent-dim);
}

.custom-select select option {
  background: var(--bg3);
  color: var(--text);
}

/* Supprimer l'affichage custom qui n'est plus nécessaire */
.custom-select-display { display: none !important; }


#logout-btn {
  margin-left: auto;
  flex-shrink: 0;
  opacity: .6;
  transition: opacity var(--trans), color var(--trans);
}

#logout-btn:hover {
  opacity: 1;
  color: var(--red);
  border-color: rgba(255,69,58,.3);
  background: rgba(255,69,58,.08);
  box-shadow: none;
}
.menu-manuel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 5px 39px;
    margin: 8px 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(22, 199, 131, 0.447), rgba(22, 199, 131, 0.447));
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 0px 0px rgba(22, 199, 131, 0.299);
    transition: all 0.3s ease;
}

.menu-manuel i {
    font-size: 22px;
    opacity: 0.9;
}

.menu-manuel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(22, 199, 131, 0.447);
    background: linear-gradient(135deg, #16C784, #16C784);
}

.menu-manuel:active {
    transform: scale(0.98);
}
/* ============================================================
   FIX iOS Safari — backdrop-filter bloque les interactions tactiles
   ============================================================ */
@media (max-width: 860px) {

  #menu-btn {
    display: grid !important;
  }

  .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #0A1628 !important;
  }

  .backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .topbar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #08111C !important;
  }

  .sig-d {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #0E1A32 !important;
  }

  .card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .modal-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(4, 8, 20, .92) !important;
  }
}
button, .btn, .nav-link, .mini-btn, .icon-btn {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
#app {
  position: relative;
  z-index: 1;
}
/* ============================================================
   DASHBOARD — Améliorations refonte
   ============================================================ */

/* Score gauge dans le hero */
.score-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.score-ring svg { width: 92px !important; }
.score-ring .sv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: -68px;
}
.score-ring .sv strong { font-size: 22px; line-height: 1; }
.score-ring .sv span {
  font-size: 9.5px;
  color: rgba(234,241,251,.65);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* KPI mini cards (4-up row) */
.kpi.card.mini {
  padding: 14px 16px;
}
.kpi.card.mini .k-value { font-size: 19px; margin-top: 4px; }
.kpi.card.mini .k-label { font-size: 10.5px; }

/* Empty states dans les graphiques — plus respirant */
.card .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.card .empty p {
  color: var(--muted);
  font-size: 13px;
  max-width: 260px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-spark { width: 100%; }
  #db-score { align-self: center; margin-top: 8px; }
}