/* =========================================
   NurseTrack v2 — style.css
   ========================================= */

:root {
  --navy:       #114456;
  --navy-lt:    #1a5f7a;
  --navy-pale:  #e8f4f8;
  --sky:        #3b9dc8;
  --sky-lt:     #d6eef8;
  --green:      #2a9d5c;
  --green-lt:   #d4f0e2;
  --red:        #e05252;
  --red-lt:     #fde8e8;
  --amber:      #f4a261;
  --gray-50:    #f8fafc;
  --gray-100:   #f1f5f9;
  --gray-200:   #e2e8f0;
  --gray-300:   #cbd5e1;
  --gray-400:   #94a3b8;
  --gray-500:   #64748b;
  --gray-700:   #334155;
  --gray-900:   #0f172a;
  --sh-sm: 0 1px 2px rgba(15,23,42,.04),0 3px 10px -4px rgba(15,23,42,.06);
  --sh:    0 2px 6px rgba(15,23,42,.05),0 12px 26px -10px rgba(15,23,42,.10);
  --sh-lg: 0 4px 12px rgba(15,23,42,.06),0 24px 48px -16px rgba(15,23,42,.16);
  --r:     14px;
  --r-sm:  10px;
  --r-lg:  20px;

  /* Jetons sémantiques (voir thème sombre plus bas) */
  --surface:     #fff;              /* fond des cartes, modales, champs */
  --accent:      #114456;           /* couleur de marque en avant-plan (texte, icônes, bordures) */
  --accent-soft: #e8f4f8;           /* fond des puces / états sélectionnés */
  --chart-tick:  #64748b;
  --chart-grid:  #e2e8f0;
  --chart-empty: #e2e8f0;
}

/* ─── Thème sombre ─── */
:root[data-theme="dark"]{
  --navy:       #0f3d4d;   /* fonds pleins (header, boutons) — texte blanc dessus */
  --navy-lt:    #155066;
  --navy-pale:  #12303b;
  --sky:        #57b6de;
  --sky-lt:     #12303f;
  --green:      #46c483;   --green-lt: #12362a;
  --red:        #f08a8a;   --red-lt:   #3d2626;
  --amber:      #e6a355;
  --gray-50:    #111a22;   /* fond de page */
  --gray-100:   #1b2730;
  --gray-200:   #2b3b48;
  --gray-300:   #3f515f;
  --gray-400:   #8b9db0;
  --gray-500:   #a7b7c6;
  --gray-700:   #cad4de;
  --gray-900:   #e9eff4;
  --surface:     #1a252f;
  --accent:      #57b6de;
  --accent-soft: #17323f;
  --chart-tick:  #8b9db0;
  --chart-grid:  #2b3b48;
  --chart-empty: #2b3b48;
  --sh-sm: 0 1px 2px rgba(0,0,0,.3),0 3px 10px -4px rgba(0,0,0,.4);
  --sh:    0 2px 6px rgba(0,0,0,.35),0 12px 26px -10px rgba(0,0,0,.5);
  --sh-lg: 0 4px 12px rgba(0,0,0,.4),0 24px 48px -16px rgba(0,0,0,.6);
  color-scheme: dark;
}

*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{height:100%;scroll-behavior:smooth}
body{font-family:'Geist',system-ui,-apple-system,sans-serif;background:var(--gray-50);color:var(--gray-900);min-height:100vh;overscroll-behavior:none;overflow-x:hidden;touch-action:pan-x pan-y;-webkit-text-size-adjust:100%}
.hidden{display:none!important}
[hidden]{display:none!important}
input,select,button,textarea{font-family:inherit;color:inherit}
/* Chiffres alignés (mono tabulaire) */
.stat-val,.km-start-value,.goal-val,.trip-km,.trip-detail,.fin-amount,.fin-bar-val,
.km-result-val,.rec-row-meta,.year-display,.priv-gap-km{font-variant-numeric:tabular-nums}

/* ─── Auth / Config ─── */
#config-screen,#auth-screen{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(145deg,var(--navy) 0%,var(--navy-lt) 55%,var(--sky) 100%);
  padding:24px;
}
.auth-card{
  background:var(--surface);border-radius:var(--r-lg);padding:36px 32px;
  width:100%;max-width:400px;box-shadow:var(--sh-lg);
}
.auth-logo{text-align:center;margin-bottom:28px}
.auth-logo-img-wrap{
  width:72px;height:72px;border-radius:18px;
  background:var(--navy);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 14px;overflow:hidden;
}
.auth-logo-img-wrap img{width:52px;height:52px;object-fit:contain}
.auth-logo h1{font-size:24px;font-weight:600;color:var(--accent)}
.auth-logo p{font-size:14px;color:var(--gray-400);margin-top:4px}
.auth-hint{font-size:13px;color:var(--gray-400);text-align:center;line-height:1.7;margin-bottom:18px}
.form-group{margin-bottom:16px}
.form-group label,.field label{
  font-size:11px;font-weight:600;color:var(--gray-500);
  text-transform:uppercase;letter-spacing:.07em;display:block;margin-bottom:6px;
}
.form-group input,.field input,.field select,.field textarea{
  width:100%;padding:13px 14px;
  border:1.5px solid var(--gray-200);border-radius:var(--r-sm);
  font-size:16px;color:var(--gray-900);background:var(--surface);
  transition:border-color .2s;outline:none;
  -webkit-appearance:none;appearance:none;
}
.form-group input:focus,.field input:focus,.field select:focus,.field textarea:focus{
  border-color:var(--accent);box-shadow:0 0 0 3px rgba(17,68,86,.10);
}
.btn-primary{
  width:100%;padding:15px;background:var(--navy);color:#fff;border:none;
  border-radius:var(--r-sm);font-size:16px;font-weight:600;cursor:pointer;
  transition:background .2s,transform .1s;margin-top:4px;
}
.btn-primary:hover{background:var(--navy-lt)}
.btn-primary:active{transform:scale(.985);background:var(--navy-lt)}
.btn-primary:disabled{opacity:.6;cursor:not-allowed}
.error-box{
  background:var(--red-lt);color:var(--red);
  padding:11px 14px;border-radius:var(--r-sm);font-size:14px;
  margin-bottom:14px;border-left:3px solid var(--red);line-height:1.5;
}
.link-muted{font-size:12px;color:var(--gray-400);text-decoration:none}
.link-muted:hover{color:var(--sky)}

/* ─── App shell ─── */
#app{min-height:100%;display:flex;flex-direction:column;position:relative}

.app-header{
  background:var(--navy);color:#fff;
  padding:14px 18px 12px;
  display:flex;align-items:center;justify-content:space-between;
  position:sticky;top:0;z-index:100;
  box-shadow:0 1px 0 rgba(0,0,0,.06),0 6px 18px -10px rgba(17,68,86,.35);
  flex-shrink:0;
}
.header-title{letter-spacing:-.01em}
.header-left{display:flex;align-items:center;gap:10px;font-size:22px}
.header-title{font-size:16px;font-weight:600;line-height:1.2}
.header-sub{font-size:12px;color:rgba(255,255,255,.6);margin-top:1px}
.header-actions{display:flex;gap:8px}
.btn-icon{
  background:rgba(255,255,255,.13);border:none;color:#fff;
  width:36px;height:36px;border-radius:9px;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
  transition:background .2s;
}
.btn-icon i{width:16px;height:16px;stroke-width:2}
.btn-icon:hover{background:rgba(255,255,255,.22)}

/* ─── Month nav ─── */
.month-nav{
  background:var(--surface);
  display:flex;align-items:center;
  padding:8px 12px;gap:8px;
  border-bottom:1px solid var(--gray-200);
  flex-shrink:0;
}
.month-select{
  flex:1;
  padding:10px 14px;
  border:1.5px solid var(--gray-200);
  border-radius:var(--r-sm);
  font-family:'Geist',sans-serif;
  font-size:15px;font-weight:500;
  color:var(--accent);
  background:var(--surface);
  cursor:pointer;
  outline:none;
  -webkit-appearance:none;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:34px;
  transition:border-color .2s;
}
.month-select:focus{border-color:var(--accent)}
.month-add-btn{
  flex-shrink:0;width:38px;height:38px;border-radius:var(--r-sm);
  background:var(--accent-soft);border:1.5px solid var(--accent-soft);
  color:var(--accent);cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:all .2s;
}
.month-add-btn i{width:18px;height:18px;stroke-width:2.5}
.month-add-btn:hover{background:var(--navy);color:#fff}
.month-del-btn{
  flex-shrink:0;width:38px;height:38px;border-radius:var(--r-sm);
  background:var(--red-lt);border:1.5px solid var(--red-lt);
  color:var(--red);cursor:pointer;
  display:flex;align-items:center;justify-content:center;transition:all .2s;
}
.month-del-btn i{width:16px;height:16px;stroke-width:2}
.month-del-btn:hover{background:var(--red);color:#fff}

/* ─── Bandeau de rappels ─── */
.reminder-banner{
  display:flex;align-items:flex-start;gap:10px;
  background:#fff8ed;border-bottom:1px solid var(--amber);
  padding:11px 14px;flex-shrink:0;
}
.reminder-banner-ico{width:17px;height:17px;color:var(--amber);flex-shrink:0;margin-top:2px}
.reminder-banner-body{flex:1;min-width:0;font-size:13px;color:#92400e;line-height:1.5}
.reminder-banner-body > div{margin:1px 0}
.reminder-banner-body b{font-weight:600}
.reminder-banner-close{
  flex-shrink:0;background:none;border:none;color:#b45309;
  font-size:15px;cursor:pointer;padding:0 2px;line-height:1;opacity:.7;
}
.reminder-banner-close:hover{opacity:1}
.notif-perm-btn{
  flex-shrink:0;padding:8px 14px;border:none;border-radius:var(--r-sm);
  background:var(--navy);color:#fff;font-family:inherit;
  font-size:13px;font-weight:600;cursor:pointer;
}
.notif-perm-btn:disabled{background:var(--gray-200);color:var(--gray-400);cursor:default}

/* ─── Tab nav (barre du bas, style mobile) ─── */
.tab-nav{
  background:var(--surface);border-top:1px solid var(--gray-200);
  display:flex;
  position:fixed;left:0;right:0;bottom:0;z-index:200;
  width:100%;
  box-shadow:0 -8px 22px -14px rgba(17,68,86,.14);
  padding-bottom:env(safe-area-inset-bottom, 0px);
}
.tab-nav-item{
  flex:1;padding:9px 8px 8px;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  border:none;background:none;cursor:pointer;
  font-size:11px;font-weight:600;color:var(--gray-400);
  text-transform:uppercase;letter-spacing:.04em;
  border-top:2.5px solid transparent;
  transition:all .2s;
}
.tab-nav-item i{width:20px;height:20px;stroke-width:1.8}
.tab-nav-item.active{color:var(--accent);border-top-color:var(--accent)}

/* ─── App content ─── */
.app-content{
  flex:1;padding:14px 14px calc(84px + env(safe-area-inset-bottom, 0px));
  max-width:700px;margin:0 auto;width:100%;
}

/* ─── Km start banner ─── */
.km-start-banner{
  background:var(--navy);color:#fff;
  border-radius:var(--r);padding:14px 16px;
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:12px;
}
.km-start-label{font-size:11px;opacity:.7;text-transform:uppercase;letter-spacing:.06em;margin-bottom:3px}
.km-start-value{font-size:15px;font-weight:600;font-family:'Geist Mono',monospace}
.km-start-edit-btn{
  background:rgba(255,255,255,.15);border:none;color:#fff;
  padding:8px 12px;border-radius:8px;font-size:14px;cursor:pointer;
  transition:background .2s;
}
.km-start-edit-btn:hover{background:rgba(255,255,255,.25)}

/* Version discrète quand le compteur est déjà connu (report auto du mois précédent) */
.km-start-banner.is-set{
  background:var(--gray-50);border:1px solid var(--gray-200);
  color:var(--gray-500);padding:7px 10px 7px 12px;margin-bottom:10px;
}
.km-start-banner.is-set .km-start-label{display:none}
.km-start-banner.is-set .km-start-value{font-size:12px;font-weight:500;color:var(--gray-500)}
.km-start-banner.is-set .km-start-edit-btn{background:none;color:var(--gray-400);padding:4px 6px}
.km-start-banner.is-set .km-start-edit-btn:hover{background:var(--gray-100);color:var(--accent)}

/* ─── Chiffres du mois (grille sobre, sans icônes ni liserés) ─── */
.stats-grid{
  display:grid;grid-template-columns:1fr 1fr;
  background:var(--surface);border:1px solid var(--gray-100);
  border-radius:var(--r);box-shadow:var(--sh-sm);overflow:hidden;
  margin-bottom:12px;
}
.stat-card{
  padding:17px 16px 16px;position:relative;background:none;border:none;
  border-top:1px solid var(--gray-100);transition:background .15s;
}
.stat-card:nth-child(1),.stat-card:nth-child(2){border-top:none}
.stat-card:nth-child(odd){border-right:1px solid var(--gray-100)}
.stat-card::before{display:none}
.stat-icon-wrap{display:none}
.stat-card.stat-card-wide{grid-column:1 / -1;border-right:none}
.stat-card-wide .stat-val{color:var(--accent)}
.stat-label{
  font-size:11px;font-weight:600;color:var(--gray-400);
  text-transform:uppercase;letter-spacing:.06em;margin-bottom:7px;
}
.stat-val{
  font-size:24px;font-weight:650;font-family:'Geist Mono',monospace;
  color:var(--gray-900);line-height:1;letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;
}
.stat-sub{font-size:12px;color:var(--gray-400);margin-top:5px}

/* ─── Objectifs & jauges ─── */
.goals-card{
  background:var(--surface);border:1px solid var(--gray-100);
  border-radius:var(--r);padding:14px 16px;box-shadow:var(--sh-sm);
  margin-bottom:12px;display:flex;flex-direction:column;gap:13px;
}
.goal-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:7px}
.goal-head span:first-child{
  font-size:11px;font-weight:600;color:var(--gray-400);
  text-transform:uppercase;letter-spacing:.05em;
}
.goal-val{font-family:'Geist Mono',monospace;font-weight:600;font-size:12.5px;color:var(--gray-900)}
.goal-track{height:8px;border-radius:5px;background:var(--gray-100);overflow:hidden}
.goal-fill{height:100%;border-radius:5px;background:var(--green);width:0;transition:width .45s ease}
.goal-fill.expense{background:var(--sky)}
.goal-fill.over{background:var(--red)}
.goal-alert{
  display:flex;align-items:center;gap:6px;
  font-size:12.5px;font-weight:500;color:var(--red);
}
.goal-alert i{width:14px;height:14px}

/* ─── Charts ─── */
.charts-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.chart-card{background:var(--surface);border-radius:var(--r);padding:16px;box-shadow:var(--sh-sm);border:1px solid var(--gray-100);min-width:0}
.chart-title{font-size:12px;font-weight:600;color:var(--gray-500);letter-spacing:0;margin-bottom:14px;text-align:left}
.chart-wrap{position:relative;height:160px}
@media(max-width:400px){
  .chart-card{padding:12px}
  .chart-wrap{height:140px}
}

/* ─── Export row ─── */
.export-row{
  background:var(--surface);border-radius:var(--r);padding:13px 16px;
  display:flex;align-items:center;gap:12px;
  box-shadow:var(--sh-sm);border:1px solid var(--gray-100);
  width:100%;cursor:pointer;font-family:inherit;text-align:left;
  transition:box-shadow .15s;
}
.export-row:hover{box-shadow:var(--sh)}
.export-row-icon{width:40px;height:40px;border-radius:10px;background:var(--accent-soft);display:flex;align-items:center;justify-content:center;flex-shrink:0;color:var(--accent)}
.export-row-icon i{width:20px;height:20px;stroke-width:1.8}
.export-row-title{font-size:14px;font-weight:600;color:var(--gray-700)}
.export-row-sub{font-size:12px;color:var(--gray-400);margin-top:1px}
.export-row-arrow{color:var(--gray-300);margin-left:auto}
.export-row-arrow.i{width:18px;height:18px}

/* ─── List header ─── */
.list-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.list-title{font-size:14px;font-weight:600;color:var(--gray-700)}
.list-badge{background:var(--gray-100);color:var(--gray-500);padding:2px 9px;border-radius:10px;font-size:12px;font-weight:500}
.list-badge.red-badge{background:var(--red-lt);color:var(--red)}
.list-badge.green-badge{background:var(--green-lt);color:var(--green)}

/* ─── Trip card ─── */
.trip-card{
  background:var(--surface);border-radius:var(--r-sm);padding:12px 14px;
  display:flex;align-items:center;gap:10px;
  box-shadow:var(--sh-sm);border:1px solid var(--gray-100);
  margin-bottom:6px;cursor:pointer;transition:box-shadow .15s,transform .1s;
}
.trip-card:hover{box-shadow:var(--sh);transform:translateY(-1px)}
.trip-card:active{transform:scale(.99)}
.trip-moment{
  flex-shrink:0;width:34px;height:34px;border-radius:9px;
  background:var(--sky-lt);display:flex;align-items:center;justify-content:center;font-size:15px;
}
.trip-info{flex:1;min-width:0}
.trip-date{font-size:13px;font-weight:500;color:var(--gray-700)}
.trip-detail{font-size:12px;color:var(--gray-400);margin-top:1px;font-family:'Geist Mono',monospace}
.trip-km{font-size:15px;font-weight:600;font-family:'Geist Mono',monospace;color:var(--accent);flex-shrink:0}

/* Km privé entre tournées */
.priv-gap{
  display:flex;align-items:center;gap:8px;
  padding:6px 14px 6px 58px;
  margin-bottom:4px;
}
.priv-gap-line{flex:1;height:1px;background:var(--gray-200)}
.priv-gap-label{font-size:11px;color:var(--gray-400);white-space:nowrap;font-family:'Geist Mono',monospace}
.priv-gap-km{font-size:11px;font-weight:600;color:var(--gray-400);font-family:'Geist Mono',monospace}

/* ─── Expense / Income card ─── */
.fin-card{
  background:var(--surface);border-radius:var(--r-sm);padding:12px 14px;
  display:flex;align-items:center;gap:10px;
  box-shadow:var(--sh-sm);border:1px solid var(--gray-100);
  margin-bottom:6px;cursor:pointer;transition:box-shadow .15s,transform .1s;
}
.fin-card:hover{box-shadow:var(--sh);transform:translateY(-1px)}
.fin-card:active{transform:scale(.99)}
.fin-icon{
  flex-shrink:0;width:34px;height:34px;border-radius:9px;
  display:flex;align-items:center;justify-content:center;font-size:15px;
}
.fin-icon.dep{background:var(--red-lt)}
.fin-icon.inc{background:var(--green-lt)}
.fin-info{flex:1;min-width:0}
.fin-cat{font-size:13px;font-weight:500;color:var(--gray-700)}
.fin-note{font-size:12px;color:var(--gray-400);margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fin-amount{font-size:15px;font-weight:600;font-family:'Geist Mono',monospace;flex-shrink:0}
.fin-amount.dep{color:var(--red)}
.fin-amount.inc{color:var(--green)}

/* ─── Finance bar ─── */
.fin-bar{
  background:var(--surface);border-radius:var(--r);padding:14px 16px;
  display:flex;align-items:center;gap:0;
  box-shadow:var(--sh-sm);border:1px solid var(--gray-100);
  margin-bottom:14px;
}
.fin-bar-item{flex:1;text-align:center}
.fin-bar-label{font-size:11px;font-weight:600;color:var(--gray-400);text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px;display:flex;align-items:center;gap:4px;justify-content:center}
.fin-bar-label i{width:12px;height:12px;stroke-width:2}
.fin-bar-val{font-size:16px;font-weight:600;font-family:'Geist Mono',monospace}
.fin-bar-val.red{color:var(--red)}
.fin-bar-val.green{color:var(--green)}
.fin-bar-sep{width:1px;background:var(--gray-200);height:36px;flex-shrink:0;margin:0 8px}

/* ─── FAB ─── */
#fab-container{
  position:fixed !important;
  bottom:calc(74px + env(safe-area-inset-bottom, 0px)) !important;
  right:18px !important;
  z-index:99999 !important;
  pointer-events:auto;
}
.fab-menu{
  display:none;
  flex-direction:column;
  gap:7px;
  align-items:flex-end;
  position:relative;
  z-index:99999;
}
.fab-menu.open{display:flex}
.fab-item{
  display:flex;align-items:center;gap:9px;
  background:var(--surface);border:none;cursor:pointer;
  border-radius:22px;padding:9px 15px 9px 11px;
  box-shadow:0 4px 20px rgba(0,0,0,.18);
  font-size:14px;font-weight:500;color:var(--gray-700);
  animation:fadeUp .18s ease;transition:transform .12s;
  white-space:nowrap;
  position:relative;
  z-index:99999;
}
.fab-item:hover{transform:translateX(-2px)}
.fi{
  width:30px;height:30px;border-radius:7px;
  display:flex;align-items:center;justify-content:center;font-size:14px;
  flex-shrink:0;
}
.fi.trip{background:var(--sky-lt)}
.fi.expense{background:var(--red-lt)}
.fi.income{background:var(--green-lt)}
.fab{
  width:56px;height:56px;border-radius:50%;
  background:var(--navy);border:none;color:#fff;
  font-size:26px;cursor:pointer;line-height:1;
  box-shadow:0 6px 24px rgba(17,68,86,.4);
  transition:background .2s,transform .2s;
  display:flex;align-items:center;justify-content:center;
  position:relative;
  z-index:99999;
}
.fab:hover{background:var(--navy-lt)}
.fab.open{transform:rotate(45deg);background:var(--gray-700)}
@keyframes fadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

/* ─── Modal ─── */
.overlay{
  position:fixed;inset:0;background:rgba(15,23,42,.5);
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  z-index:300;display:flex;align-items:flex-end;justify-content:center;
}
.modal{
  background:var(--surface);width:100%;max-width:520px;
  border-radius:var(--r-lg) var(--r-lg) 0 0;
  padding-bottom:env(safe-area-inset-bottom,16px);
  box-shadow:0 -6px 32px rgba(15,23,42,.18);
  max-height:92vh;overflow-y:auto;
  animation:slideUp2 .22s cubic-bezier(.32,.72,0,1);
}
@keyframes slideUp2{from{transform:translateY(100%)}to{transform:translateY(0)}}
.modal-pill{width:36px;height:4px;background:var(--gray-200);border-radius:2px;margin:11px auto 7px}
.modal-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 18px 13px;border-bottom:1px solid var(--gray-100);
}
.modal-title{font-size:16px;font-weight:600;color:var(--gray-900);letter-spacing:-.01em}
.btn-close{
  background:var(--gray-100);border:none;width:30px;height:30px;
  border-radius:50%;font-size:13px;cursor:pointer;color:var(--gray-500);
  display:flex;align-items:center;justify-content:center;transition:background .15s;
}
.btn-close:hover{background:var(--gray-200)}
.modal-body{padding:16px 18px 4px}
.modal-hint{font-size:13px;color:var(--gray-400);line-height:1.6;margin-bottom:14px}
.modal-footer{padding:4px 18px 18px;display:flex;gap:8px}
.field{margin-bottom:15px}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* Toggle row */
.toggle-row{display:flex;gap:6px}
.toggle-btn{
  flex:1;padding:10px 6px;
  border:1.5px solid var(--gray-200);border-radius:var(--r-sm);
  background:var(--surface);font-size:13px;font-weight:500;color:var(--gray-400);
  cursor:pointer;transition:all .18s;text-align:center;
  display:flex;align-items:center;justify-content:center;gap:5px;
}
.toggle-btn i{width:14px;height:14px;stroke-width:2;flex-shrink:0}
.toggle-btn.active{background:var(--sky-lt);border-color:var(--sky);color:var(--accent)}

/* Km result */
.km-result{
  background:var(--accent-soft);border-radius:var(--r-sm);
  padding:11px 14px;display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;
}
.km-result-label{font-size:13px;color:var(--accent);font-weight:500}
.km-result-val{font-size:21px;font-weight:600;color:var(--accent);font-family:'Geist Mono',monospace}
.km-priv-info{
  background:var(--gray-100);border-radius:var(--r-sm);
  padding:9px 13px;font-size:13px;color:var(--gray-500);
  margin-bottom:10px;line-height:1.5;
}

/* Buttons */
.btn-cancel{
  flex:1;padding:14px;border:1.5px solid var(--gray-200);border-radius:var(--r-sm);
  background:var(--surface);cursor:pointer;font-size:15px;font-weight:500;color:var(--gray-500);
  transition:background .15s;
}
.btn-cancel:hover{background:var(--gray-50)}
.btn-save{
  flex:2;padding:14px;background:var(--navy);color:#fff;border:none;
  border-radius:var(--r-sm);font-size:15px;font-weight:600;cursor:pointer;
  transition:background .2s,transform .1s;
}
.btn-save:hover{background:var(--navy-lt)}
.btn-save:active{transform:scale(.985);background:var(--navy-lt)}
.btn-save:disabled{opacity:.6;cursor:not-allowed}
.btn-icon-danger{
  padding:14px 13px;background:var(--red-lt);color:var(--red);
  border:1.5px solid rgba(224,82,82,.2);border-radius:var(--r-sm);
  cursor:pointer;transition:background .15s;
  flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.btn-icon-danger i{width:16px;height:16px;stroke-width:2}
.btn-icon-danger:hover{background:#fbd5d5}
.btn-danger-full{
  flex:1;padding:14px;background:var(--red-lt);color:var(--red);
  border:1.5px solid rgba(224,82,82,.2);border-radius:var(--r-sm);
  font-size:15px;font-weight:500;cursor:pointer;transition:background .15s;
}
.btn-danger-full:hover{background:#fbd5d5}

/* Confirm modal */
.confirm-modal{border-radius:var(--r-lg)}
.confirm-body{padding:24px 20px 6px;text-align:center}
.confirm-icon{font-size:36px;margin-bottom:10px;display:flex;align-items:center;justify-content:center}
.confirm-icon i{width:40px;height:40px;stroke-width:1.5;color:var(--amber)}
.confirm-title{font-size:17px;font-weight:600;color:var(--gray-900);margin-bottom:6px}
.confirm-msg{font-size:14px;color:var(--gray-500);line-height:1.6;white-space:pre-line;text-align:left}

/* Settings */
.settings-sep{height:1px;background:var(--gray-200);margin:18px 0}
.toggle-field{display:flex;align-items:center;gap:10px}
.toggle-field input[type=checkbox]{
  width:20px;height:20px;flex-shrink:0;accent-color:var(--accent);cursor:pointer;margin:0;
}
.toggle-field label{
  margin:0;font-size:15px;font-weight:600;color:var(--gray-700);
  text-transform:none;letter-spacing:0;cursor:pointer;
}
.settings-account-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.btn-logout-sm{
  padding:8px 14px;background:var(--red-lt);color:var(--red);
  border:1.5px solid rgba(224,82,82,.2);border-radius:var(--r-sm);
  font-size:13px;font-weight:500;cursor:pointer;white-space:nowrap;
  transition:background .15s;flex-shrink:0;
}
.btn-logout-sm:hover{background:#fbd5d5}
.btn-logout-sm i{width:13px;height:13px;vertical-align:middle;margin-right:4px}

/* ─── Page Paramètres (plein écran) ─── */
.settings-screen{
  position:fixed;inset:0;z-index:100000;
  background:var(--gray-50);
  display:flex;flex-direction:column;
  animation:settingsIn .22s ease;
}
@keyframes settingsIn{from{transform:translateX(100%)}to{transform:translateX(0)}}
.settings-topbar{
  flex-shrink:0;display:flex;align-items:center;gap:12px;
  background:var(--navy);color:#fff;
  padding:calc(12px + env(safe-area-inset-top,0px)) 14px 12px;
  box-shadow:0 2px 10px rgba(17,68,86,.3);
}
.settings-back{
  background:rgba(255,255,255,.13);border:none;color:#fff;
  width:36px;height:36px;border-radius:9px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
}
.settings-back i{width:18px;height:18px}
.settings-topbar-title{flex:1;font-size:17px;font-weight:600}
.settings-save-top{
  background:var(--surface);color:var(--accent);border:none;
  padding:9px 18px;border-radius:9px;font-family:inherit;
  font-size:14px;font-weight:600;cursor:pointer;flex-shrink:0;
}
.settings-save-top:disabled{opacity:.6}
.settings-scroll{
  flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:14px 14px calc(28px + env(safe-area-inset-bottom,0px));
  max-width:700px;margin:0 auto;width:100%;
}
.settings-group{
  background:var(--surface);border:1px solid var(--gray-100);
  border-radius:var(--r);padding:16px 15px;
  box-shadow:var(--sh-sm);margin-bottom:12px;
}
.settings-group-title{
  font-size:12px;font-weight:700;color:var(--accent);
  text-transform:uppercase;letter-spacing:.06em;margin-bottom:4px;
}
.settings-group-hint{font-size:12.5px;color:var(--gray-400);line-height:1.5;margin-bottom:12px}
.settings-group .field:last-child{margin-bottom:0}
.switch-line{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:11px 0;border-top:1px solid var(--gray-100);cursor:pointer;
  font-size:14px;color:var(--gray-700);
}
.switch-line:first-of-type{border-top:none}
.switch-line-title{display:block;font-weight:500}
.switch-line-sub{display:block;font-size:12px;color:var(--gray-400);margin-top:2px}
.switch-line input[type=checkbox]{
  width:20px;height:20px;flex-shrink:0;accent-color:var(--accent);cursor:pointer;margin:0;
}
.settings-action{
  display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;
  background:var(--accent-soft);border:1px solid var(--accent-soft);
  border-radius:var(--r-sm);padding:12px 14px;margin-bottom:8px;
  font-family:inherit;cursor:pointer;color:var(--accent);
}
.settings-action:hover{background:#dcecf3}
.settings-action > span:first-child{font-size:14px;font-weight:600;display:flex;align-items:center;gap:8px}
.settings-action > span:first-child i{width:16px;height:16px}
.settings-action-sub{font-size:12px;color:var(--gray-500)}
.settings-stats{font-size:12px;color:var(--gray-400);margin-top:6px;line-height:1.6}
.settings-account-label{font-size:12px;color:var(--gray-400);margin-bottom:3px}
#set-user-email{font-size:14px;color:var(--gray-700);word-break:break-all}
.inline-action{display:flex;gap:8px}
.inline-action input{flex:1;min-width:0}
.inline-action button{
  flex-shrink:0;padding:0 16px;border:none;border-radius:var(--r-sm);
  background:var(--navy);color:#fff;font-family:inherit;font-size:13px;
  font-weight:600;cursor:pointer;
}
.settings-version{font-size:11px;color:var(--gray-300);margin-top:14px;text-align:center}
.settings-group + .settings-group{margin-top:0}

/* Menu à rubriques (style Instagram/Snapchat) */
.settings-menu-list{
  background:var(--surface);border:1px solid var(--gray-100);
  border-radius:var(--r);overflow:hidden;box-shadow:var(--sh-sm);
}
.settings-row{
  display:flex;align-items:center;gap:14px;width:100%;
  padding:15px 14px;background:none;border:none;cursor:pointer;
  font-family:inherit;text-align:left;
  border-top:1px solid var(--gray-100);
}
.settings-row:first-child{border-top:none}
.settings-row:active{background:var(--gray-50)}
.settings-row-ico{
  width:34px;height:34px;border-radius:9px;flex-shrink:0;
  background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;
}
.settings-row-ico i{width:18px;height:18px;stroke-width:1.9}
.settings-row-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.settings-row-title{font-size:14.5px;font-weight:600;color:var(--gray-900)}
.settings-row-sub{font-size:12px;color:var(--gray-400);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.settings-row-arrow{width:18px;height:18px;color:var(--gray-300);flex-shrink:0}
.settings-panel{animation:settingsIn .2s ease}
.settings-panel .settings-group{margin-bottom:0}
.settings-menu-logout{
  margin-top:12px;width:100%;
  padding:13px;border-radius:var(--r);
  background:var(--red-lt);color:var(--red);
  border:1px solid rgba(224,82,82,.2);
  font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.settings-menu-logout i{width:15px;height:15px}

/* ─── Gestion des catégories ─── */
.cat-subhead{
  font-size:12px;font-weight:700;color:var(--accent);
  text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px;
}
.cat-list{display:flex;flex-direction:column}
.cat-manage-row{
  display:flex;align-items:center;gap:12px;
  padding:10px 0;border-top:1px solid var(--gray-100);
}
.cat-manage-row:first-child{border-top:none}
.cat-manage-hidden{opacity:.45}
.cat-manage-ico{
  width:30px;height:30px;border-radius:8px;flex-shrink:0;
  background:var(--accent-soft);color:var(--accent);
  display:flex;align-items:center;justify-content:center;
}
.cat-manage-ico i{width:15px;height:15px}
.cat-manage-label{flex:1;min-width:0;font-size:14px;color:var(--gray-700);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cat-manage-btn{
  flex-shrink:0;width:32px;height:32px;border-radius:8px;border:none;
  background:var(--gray-100);color:var(--gray-500);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.cat-manage-btn i{width:15px;height:15px}
.cat-manage-btn:hover{background:var(--gray-200);color:var(--accent)}
.cat-add-btn{
  margin-top:10px;width:100%;padding:11px;
  border:1.5px dashed var(--gray-300);border-radius:var(--r-sm);
  background:none;color:var(--accent);font-family:inherit;
  font-size:13px;font-weight:600;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:6px;
}
.cat-add-btn:hover{background:var(--accent-soft);border-color:var(--accent)}
.cat-add-btn i{width:15px;height:15px}
.cat-editor{margin-top:12px}
.cat-icon-label{font-size:11px;font-weight:600;color:var(--gray-500);
  text-transform:uppercase;letter-spacing:.07em;margin-bottom:8px}
.cat-icon-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));
  gap:8px;margin-bottom:16px;
}
.cat-icon-opt{
  aspect-ratio:1;border-radius:9px;border:1.5px solid var(--gray-200);
  background:var(--surface);color:var(--gray-500);cursor:pointer;
  display:flex;align-items:center;justify-content:center;
}
.cat-icon-opt i{width:18px;height:18px}
.cat-icon-opt.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.cat-editor-actions{display:flex;gap:8px;align-items:center}
.cat-editor-actions .btn-cancel{flex:1}
.cat-editor-actions .btn-save{flex:2}
/* Lignes de récurrences (2 lignes de texte) */
.cat-manage-row .cat-manage-label{white-space:normal}
.rec-row-label{display:block;font-weight:500;color:var(--gray-700)}
.rec-row-meta{display:block;font-size:12px;color:var(--gray-400);
  font-family:'Geist Mono',monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Badge ↻ sur une entrée issue d'une récurrence */
.fin-recur{width:11px;height:11px;color:var(--gray-400);vertical-align:-1px}
/* Badge "tournées incomplètes" sur l'onglet du bas */
.tab-nav-item{position:relative}
.tab-badge{
  position:absolute;top:4px;left:50%;margin-left:6px;
  min-width:16px;height:16px;padding:0 4px;border-radius:8px;
  background:var(--red);color:#fff;font-size:10px;font-weight:700;
  display:flex;align-items:center;justify-content:center;line-height:1;
}

/* Empty */
.empty{
  text-align:center;padding:36px 20px;color:var(--gray-400);
  background:var(--surface);border-radius:var(--r);border:1.5px dashed var(--gray-200);
}
.empty-emoji{font-size:34px;display:block;margin-bottom:9px}
.empty p{font-size:14px;line-height:1.6}

/* Loading */
.loading{
  display:flex;align-items:center;justify-content:center;
  padding:36px;color:var(--gray-400);gap:9px;font-size:14px;
}
.spinner{
  width:18px;height:18px;border:2px solid var(--gray-200);
  border-top-color:var(--accent);border-radius:50%;
  animation:spin .65s linear infinite;flex-shrink:0;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* Splash (écran de démarrage) — les positions/couleur de fond sont en style inline
   sur l'élément pour couvrir l'écran dès le 1er octet, avant même style.css */
#splash-screen{transition:opacity .32s ease}
#splash-screen.fade{opacity:0;pointer-events:none}
.splash-logo{width:84px;height:auto}
.splash-spinner{
  width:26px;height:26px;border-radius:50%;
  border:3px solid rgba(255,255,255,.28);border-top-color:#fff;
  animation:spin .8s linear infinite;
}
.splash-version{
  margin-top:-8px;
  font-size:11px;font-weight:500;letter-spacing:.03em;
  color:rgba(255,255,255,.45);
  font-variant-numeric:tabular-nums;
}

/* Toast */
.toast{
  position:fixed;bottom:90px;left:50%;
  transform:translateX(-50%) translateY(10px);
  background:var(--gray-900);color:#fff;
  padding:10px 18px;border-radius:22px;
  font-size:14px;font-weight:500;
  z-index:400;opacity:0;pointer-events:none;
  transition:opacity .28s,transform .28s;
  white-space:nowrap;max-width:calc(100vw - 36px);text-align:center;
}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.success{background:var(--green)}
.toast.error{background:var(--red)}

/* Barre « Annuler » (undo) */
.undobar{
  position:fixed;bottom:90px;left:50%;
  transform:translateX(-50%) translateY(10px);
  display:flex;align-items:center;gap:12px;
  background:var(--gray-900);color:#fff;
  padding:8px 8px 8px 18px;border-radius:24px;
  font-size:14px;font-weight:500;
  z-index:401;opacity:0;
  transition:opacity .28s,transform .28s;
  max-width:calc(100vw - 28px);box-shadow:var(--sh-lg);
}
.undobar.show{opacity:1;transform:translateX(-50%) translateY(0)}
.undobar button{
  background:rgba(255,255,255,.16);color:#fff;border:0;
  padding:8px 16px;border-radius:18px;font-weight:700;font-size:13px;cursor:pointer;
  flex-shrink:0;
}
.undobar button:active{transform:scale(.96)}
:root[data-theme="dark"] .undobar{background:#33434f;color:var(--gray-900)}
:root[data-theme="dark"] .undobar button{background:rgba(0,0,0,.14);color:var(--gray-900)}

/* Barre de recherche / tri des listes */
.list-toolbar{display:flex;gap:8px;margin:2px 0 10px}
.search-wrap{
  position:relative;flex:1;display:flex;align-items:center;
}
.search-wrap i{
  position:absolute;left:11px;width:16px;height:16px;
  color:var(--gray-400);pointer-events:none;stroke-width:2;
}
.search-wrap input{
  width:100%;padding:9px 12px 9px 34px;
  border:1.5px solid var(--gray-200);border-radius:var(--r-sm);
  background:var(--surface);color:var(--gray-900);font-size:14px;
  -webkit-appearance:none;appearance:none;
}
.search-wrap input:focus{outline:none;border-color:var(--accent)}
.list-toolbar select{
  border:1.5px solid var(--gray-200);border-radius:var(--r-sm);
  background:var(--surface);color:var(--gray-700);font-size:13px;
  padding:0 8px;font-weight:500;
}
.list-toolbar select:focus{outline:none;border-color:var(--accent)}

/* Répartition des dépenses par catégorie */
.cat-totals{
  background:var(--surface);border:1px solid var(--gray-200);
  border-radius:var(--r);padding:12px 14px;margin:10px 0 4px;
  box-shadow:var(--sh-sm);
}
.cat-totals-head{
  font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;
  color:var(--gray-500);margin-bottom:8px;
}
.cat-total-row{
  position:relative;display:flex;align-items:center;gap:8px;
  padding:7px 8px;border-radius:8px;overflow:hidden;
  font-size:13.5px;color:var(--gray-900);
}
.cat-total-fill{
  position:absolute;left:0;top:0;bottom:0;
  background:var(--accent-soft);z-index:0;
}
.cat-total-row > *{position:relative;z-index:1}
.cat-total-row i{width:15px;height:15px;color:var(--accent);stroke-width:2;flex-shrink:0}
.cat-total-label{flex:1;font-weight:500}
.cat-total-amt{font-weight:700}
.cat-total-pct{
  color:var(--gray-400);font-size:12px;font-weight:600;
  min-width:34px;text-align:right;
}

/* Bouton icône neutre (dupliquer) */
.btn-icon-ghost{
  padding:14px 13px;background:var(--gray-100);color:var(--gray-500);
  border:1.5px solid var(--gray-200);border-radius:var(--r-sm);
  cursor:pointer;transition:background .15s;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.btn-icon-ghost i{width:16px;height:16px;stroke-width:2}
.btn-icon-ghost:hover{background:var(--gray-200)}

/* Responsive */
@media(min-width:600px){
  .stats-grid{grid-template-columns:repeat(4,1fr)}
  .stat-card:nth-child(-n+4){border-top:none}
  .stat-card{border-right:1px solid var(--gray-100)}
  .stat-card:nth-child(4n),.stat-card.stat-card-wide{border-right:none}
  .stat-card.stat-card-wide{border-top:1px solid var(--gray-100)}
  .overlay{align-items:center}
  .modal{border-radius:var(--r-lg);margin-bottom:36px}
  .confirm-modal{border-radius:var(--r-lg)}
}
@media(max-width:360px){
  .stat-val{font-size:18px}
  .stat-card{padding:13px 12px}
  .fab{width:50px;height:50px;font-size:22px}
}

/* ─── Tournée incomplète ─── */
.trip-incomplete{
  border-left:3px solid var(--amber) !important;
  background:linear-gradient(to right,#fff9f0,#fff) !important;
}
.km-optional-badge{
  font-size:10px;font-weight:500;
  background:var(--gray-100);color:var(--gray-400);
  padding:2px 6px;border-radius:8px;
  text-transform:lowercase;letter-spacing:0;
  margin-left:4px;
}
.km-incomplete-warn{
  background:#fff8ed;
  border:1.5px solid var(--amber);
  border-radius:var(--r-sm);
  padding:10px 13px;
  font-size:13px;color:#92400e;
  margin-bottom:12px;
  line-height:1.5;
}

/* ─── Logo header ─── */
.header-logo-img{
  height:36px;width:36px;object-fit:contain;
  border-radius:8px;flex-shrink:0;
}

/* ─── Export modal ─── */
.export-checks{display:flex;flex-direction:column;gap:8px;margin-top:4px}
.check-row{
  display:flex;align-items:center;gap:12px;
  font-size:15px;color:var(--gray-700);cursor:pointer;
  padding:13px 14px;border-radius:var(--r-sm);
  border:1.5px solid var(--gray-200);background:var(--surface);
  transition:border-color .15s,background .15s;
  user-select:none;-webkit-user-select:none;
  width:100%;
}
.check-row:hover{border-color:var(--sky);background:var(--sky-lt)}
.check-row:has(input:checked){
  border-color:var(--accent);background:var(--accent-soft);
}
.check-row input[type=checkbox]{
  width:20px;height:20px;accent-color:var(--accent);
  cursor:pointer;flex-shrink:0;
  pointer-events:none;
}

/* ─── Export modal ─── */
.export-content-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:8px;
}
.export-content-item{cursor:pointer}
.export-content-item input[type=checkbox]{display:none}
.eci-box{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:14px 8px;border-radius:var(--r-sm);
  border:2px solid var(--gray-200);background:var(--surface);
  transition:all .18s;
}
.eci-icon{display:flex;align-items:center;justify-content:center}
.eci-icon i{width:22px;height:22px;stroke-width:1.8}
.eci-label{font-size:12px;font-weight:600;color:var(--gray-500);text-transform:uppercase;letter-spacing:.04em}
.export-content-item input:checked + .eci-box{
  border-color:var(--accent);background:var(--accent-soft);
}
.export-content-item input:checked + .eci-box .eci-label{color:var(--accent)}

.export-format-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.export-fmt-btn{
  display:flex;align-items:center;justify-content:center;gap:8px;
  padding:13px;border-radius:var(--r-sm);
  border:2px solid var(--gray-200);background:var(--surface);
  font-family:'Geist',sans-serif;font-size:15px;font-weight:600;
  color:var(--gray-500);cursor:pointer;transition:all .18s;
}
.export-fmt-btn i{width:20px;height:20px;stroke-width:1.8}
.export-fmt-btn.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}
.export-fmt-btn:hover:not(.active){border-color:var(--gray-300);background:var(--gray-50)}

/* ─── Barre période dashboard ─── */
.period-bar{
  display:flex;gap:6px;margin-bottom:12px;
  background:var(--gray-100);border-radius:var(--r);
  padding:4px;
  overflow-x:auto;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.period-bar::-webkit-scrollbar{display:none}
.period-btn{
  flex:1 0 auto;min-width:58px;padding:8px 10px;
  border:none;border-radius:10px;
  font-family:'Geist',sans-serif;font-size:12px;font-weight:600;
  color:var(--gray-400);background:none;cursor:pointer;
  transition:all .18s;white-space:nowrap;
}
.period-btn.active{
  background:var(--surface);color:var(--accent);
  box-shadow:0 1px 3px rgba(15,23,42,.10);
}
.period-btn:hover:not(.active){color:var(--accent)}
/* ─── FAB items refactored ─── */
.fab-item-btn{
  display:flex;align-items:center;gap:10px;
  background:var(--surface);border:none;cursor:pointer;
  border-radius:22px;padding:10px 16px 10px 12px;
  box-shadow:0 4px 20px rgba(0,0,0,.18);
  font-family:'Geist',sans-serif;
  font-size:14px;font-weight:500;color:var(--gray-700);
  white-space:nowrap;transition:transform .12s;
  animation:fadeUp .18s ease;
}
.fab-item-btn:hover{transform:translateX(-2px)}
.fab-item-ico{
  width:30px;height:30px;border-radius:7px;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.fab-item-ico i{width:15px;height:15px;stroke-width:2}
.fab-item-ico.trip{background:var(--sky-lt);color:var(--sky)}
.fab-item-ico.expense{background:var(--red-lt);color:var(--red)}
.fab-item-ico.income{background:var(--green-lt);color:var(--green)}
#fab-btn:active{transform:scale(.92)}

/* ─── Drawer « Ajouter » ─── */
.add-drawer{display:flex;flex-direction:column;gap:10px;padding-bottom:14px}
.add-drawer-item{
  display:flex;align-items:center;gap:14px;width:100%;
  background:var(--gray-50);border:1px solid var(--gray-100);
  border-radius:var(--r);padding:14px;cursor:pointer;
  font-family:inherit;text-align:left;transition:background .15s;
}
.add-drawer-item:active{background:var(--accent-soft)}
.add-drawer-ico{
  width:42px;height:42px;border-radius:11px;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
}
.add-drawer-ico i{width:20px;height:20px;stroke-width:1.9}
.add-drawer-ico.trip{background:var(--sky-lt);color:var(--sky)}
.add-drawer-ico.expense{background:var(--red-lt);color:var(--red)}
.add-drawer-ico.income{background:var(--green-lt);color:var(--green)}
.add-drawer-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.add-drawer-title{font-size:15px;font-weight:600;color:var(--gray-900)}
.add-drawer-sub{font-size:12px;color:var(--gray-400)}
.add-drawer-arrow{width:18px;height:18px;color:var(--gray-300);flex-shrink:0}

/* ─── Sélecteur d'année ─── */
.year-selector{
  display:flex;align-items:center;justify-content:center;gap:12px;
  background:var(--surface);border-radius:var(--r);
  padding:10px 16px;margin-bottom:12px;
  box-shadow:var(--sh-sm);border:1px solid var(--gray-100);
}
.year-nav-btn{
  background:none;border:none;cursor:pointer;
  color:var(--gray-400);padding:4px;
  display:flex;align-items:center;justify-content:center;
  border-radius:6px;transition:all .15s;
}
.year-nav-btn:hover{background:var(--gray-100);color:var(--accent)}
.year-nav-btn i{width:18px;height:18px;stroke-width:2.5}
.year-display{
  font-size:18px;font-weight:600;color:var(--accent);
  font-family:'Geist Mono',monospace;
  min-width:60px;text-align:center;
}

/* ─── Amélioration trip card ─── */
.trip-moment i{width:16px;height:16px;stroke-width:1.8}
.trip-moment{
  flex-shrink:0;width:34px;height:34px;border-radius:9px;
  background:var(--sky-lt);display:flex;align-items:center;
  justify-content:center;color:var(--sky);
}
.trip-moment.soir{background:#f0f0ff;color:#6366f1}
.trip-moment.autre{background:var(--gray-100);color:var(--gray-500)}

/* ─── Fin card icons ─── */
.fin-icon i{width:16px;height:16px;stroke-width:1.8}

/* ─── Empty state avec Lucide ─── */
.empty-icon{
  width:52px;height:52px;border-radius:14px;
  background:var(--gray-100);
  display:flex;align-items:center;justify-content:center;
  margin:0 auto 12px;color:var(--gray-400);
}
.empty-icon i{width:26px;height:26px;stroke-width:1.5}

/* ─── Km start edit btn ─── */
.km-start-edit-btn i{width:14px;height:14px;stroke-width:2}

/* ─── Stat val font ─── */
.stat-val{font-size:24px;font-weight:650;font-family:'Geist Mono',monospace;color:var(--gray-900);line-height:1;letter-spacing:-.02em;font-variant-numeric:tabular-nums}

/* ─── Thème sombre : retouches ciblées ─── */
:root[data-theme="dark"] .toast{background:#33434f;color:var(--gray-900)}
:root[data-theme="dark"] .reminder-banner{background:#33291a;border-bottom-color:#7a5c2e}
:root[data-theme="dark"] .reminder-banner-body,
:root[data-theme="dark"] .reminder-banner-close{color:#eabf82}
:root[data-theme="dark"] .km-incomplete-warn{background:#33291a;color:#eabf82}
:root[data-theme="dark"] .trip-incomplete{
  background:linear-gradient(to right,#2e2618,var(--surface)) !important;
}
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder{color:var(--gray-400)}
:root[data-theme="dark"] .stat-icon-wrap.navy{background:var(--gray-100)}
:root[data-theme="dark"] .month-add-btn:hover,
:root[data-theme="dark"] .btn-primary:hover,
:root[data-theme="dark"] .btn-save:hover{background:var(--navy-lt)}
:root[data-theme="dark"] .month-select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b9db0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}