:root{
  --vert-menthe:#2E8B6B;
  --vert-menthe-dark:#22694F;
  --vert-pastel:#DCEFE6;
  --marron:#E8934C;
  --marron-clair:#FCEBD9;
  --bleu-globe:#1D6FE0;
  --bleu-globe-dark:#1554AD;
  --bleu-globe-clair:#DCEAFD;
  --orange:#C98A1F;
  --orange-dark:#96660F;
  --orange-clair:#FCF1DE;
  --blanc-casse:#FAF7F1;
  --encre:#221F1B;
  --encre-douce:#8A8378;
  --ligne:#EEE8DD;
  --danger:#C0533E;
  --font-head:'Space Grotesk', sans-serif;
  --font-body:'Inter', sans-serif;
  --font-mono:'IBM Plex Mono', monospace;
  --shadow-card:0 1px 2px rgba(42,38,34,.05),0 4px 16px rgba(42,38,34,.05);
  --shadow-soft:0 1px 2px rgba(42,38,34,.05),0 2px 8px rgba(42,38,34,.05);
  --shadow-pop:0 10px 20px -6px rgba(34,105,79,.4);
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:var(--font-body);
  background:var(--blanc-casse);
  color:var(--encre);
  -webkit-font-smoothing:antialiased;
  overscroll-behavior:none;
}
#root{max-width:520px;margin:0 auto;min-height:100vh;position:relative;background:var(--blanc-casse);}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--vert-menthe);outline-offset:2px;}
input,select,textarea{font-family:inherit;}
h1,h2,h3,h4{font-family:var(--font-head);margin:0;letter-spacing:-0.01em;}
p{margin:0;}
.mono{font-family:var(--font-mono);}
i.ti{line-height:1;}

/* ---- Login ---- */
.login-screen{
  min-height:100vh;display:flex;flex-direction:column;justify-content:center;
  padding:32px 28px 48px;background:
    radial-gradient(circle at 15% 8%, var(--vert-pastel) 0%, transparent 45%),
    radial-gradient(circle at 85% 92%, var(--bleu-globe-clair) 0%, transparent 40%),
    var(--blanc-casse);
}
.login-bg-pattern{
  position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0;
  mask-image:radial-gradient(ellipse 75% 65% at 50% 30%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.85) 55%, #000 80%);
  -webkit-mask-image:radial-gradient(ellipse 75% 65% at 50% 30%, rgba(0,0,0,.55) 0%, rgba(0,0,0,.85) 55%, #000 80%);
}
.login-bg-pattern i{position:absolute;}
.login-halo{
  position:absolute;top:-70px;left:50%;transform:translateX(-50%);width:320px;height:320px;border-radius:50%;
  background:radial-gradient(circle,rgba(46,139,107,.30) 0%,rgba(46,139,107,.12) 45%,rgba(46,139,107,0) 72%);
  z-index:0;pointer-events:none;
}
.track-card{
  display:flex;align-items:center;gap:12px;margin-top:14px;padding:13px 14px;border-radius:14px;
  background:#fff;border:1px solid var(--ligne);box-shadow:var(--shadow-card);text-decoration:none;color:inherit;
}
.track-ic{width:38px;height:38px;border-radius:11px;background:var(--vert-pastel);color:var(--vert-menthe-dark);display:flex;align-items:center;justify-content:center;font-size:18px;flex-shrink:0;}
.track-txt{font-size:13.5px;font-weight:600;color:var(--encre);}
.track-sub{font-size:11.5px;color:var(--encre-douce);margin-top:1px;}
.brand-mark{
  width:56px;height:56px;border-radius:16px;background:var(--vert-menthe);color:#fff;
  display:flex;align-items:center;justify-content:center;font-size:26px;margin-bottom:18px;
  box-shadow:var(--shadow-pop);
}
.login-screen h1{font-size:26px;font-weight:600;color:var(--encre);margin-bottom:4px;letter-spacing:-0.02em;}
.login-sub{color:var(--encre-douce);font-size:14.5px;margin-bottom:32px;line-height:1.5;}
.field-label{font-size:12.5px;font-weight:500;color:var(--encre-douce);margin:0 0 6px 2px;display:block;}
.field-wrap{margin-bottom:16px;}
.field-input{
  width:100%;padding:14px 16px;border:1px solid var(--ligne);border-radius:12px;
  font-size:16px;background:#fff;color:var(--encre);box-shadow:var(--shadow-soft);
}
.search-box{display:flex;align-items:center;gap:9px;background:#fff;border:1px solid var(--ligne);border-radius:12px;padding:11px 14px;box-shadow:var(--shadow-soft);margin-bottom:14px;}
.search-box i{font-size:16px;color:var(--encre-douce);flex-shrink:0;}
.search-box input{flex:1;border:none;background:none;font-size:13.5px;color:var(--encre);padding:0;}
.search-box input:focus{outline:none;}
.search-box input::placeholder{color:#B0A99C;}
.field-input:focus{outline:none;border-color:var(--vert-menthe);}
.phone-row{align-items:stretch;}
.phone-row select{height:48px;}
.phone-row .field-input{flex:1 1 0%;min-width:0;}
.pin-row{display:flex;gap:10px;}
.pin-box{
  width:100%;aspect-ratio:1;text-align:center;font-size:22px;border:1px solid var(--ligne);
  border-radius:12px;background:#fff;box-shadow:var(--shadow-soft);
}
.role-toggle{display:flex;gap:4px;margin-bottom:24px;background:var(--ligne);padding:4px;border-radius:16px;}
.role-btn{flex:1;padding:10px 6px;border-radius:12px;font-size:13px;font-weight:500;color:var(--encre-douce);text-align:center;}
.role-btn.active{background:#fff;color:var(--encre);font-weight:600;box-shadow:0 1px 3px rgba(42,38,34,.12);}
.btn-primary{
  width:100%;padding:16px;border-radius:14px;background:linear-gradient(155deg,#38A47A,var(--vert-menthe-dark));color:#fff;
  font-weight:600;font-size:15.5px;letter-spacing:.005em;
  box-shadow:var(--shadow-pop);transition:transform .15s ease;
}
.btn-primary:active{transform:scale(.98);}
.login-foot{margin-top:20px;text-align:center;font-size:12.5px;color:var(--encre-douce);}

/* ---- App shell ---- */
.app-shell{padding-bottom:88px;min-height:100vh;}
.topbar{
  position:sticky;top:0;z-index:20;background:rgba(250,247,241,.92);backdrop-filter:blur(8px);
  padding:16px 20px 12px;border-bottom:1px solid var(--ligne);
}
.topbar-row{display:flex;align-items:center;justify-content:space-between;}
.topbar-title{font-size:19px;font-weight:600;letter-spacing:-0.01em;}
.topbar-sub{font-size:12px;color:var(--encre-douce);margin-top:2px;}
.avatar-chip{
  width:38px;height:38px;border-radius:11px;background:var(--marron);color:#fff;
  display:flex;align-items:center;justify-content:center;font-weight:600;font-size:14px;font-family:var(--font-head);
}
.page{padding:18px 20px 8px;}
.section-title{font-size:13.5px;font-weight:600;color:var(--encre);margin:22px 0 10px 2px;}
.section-title:first-child{margin-top:0;}

/* ---- Bottom nav ---- */
.bottom-nav{
  position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:520px;
  background:#fff;border-top:1px solid var(--ligne);display:flex;align-items:center;z-index:30;
  padding:10px 4px calc(10px + env(safe-area-inset-bottom));
  box-shadow:0 -1px 0 rgba(42,38,34,.04),0 -8px 24px rgba(42,38,34,.05);
}
.nav-btn{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 2px;border-radius:12px;color:var(--encre-douce);position:relative;}
.nav-btn .nav-ic{
  font-size:19px;display:flex;align-items:center;justify-content:center;
  width:34px;height:34px;border-radius:50%;border:1.5px solid transparent;
  transition:border-color .15s ease,color .15s ease,transform .15s ease;
}
.nav-btn:active .nav-ic{transform:scale(.9);}
.nav-btn .nav-lb{font-size:11.5px;font-weight:500;transition:color .15s ease;}
.nav-btn.active{color:var(--vert-menthe-dark);}
.nav-btn.active .nav-ic{border-color:currentColor;transform:rotate(-3deg);}
.nav-btn.active .nav-lb{font-weight:700;}
.nav-btn .nav-badge{
  position:absolute;top:2px;right:calc(50% - 26px);background:var(--danger);color:#fff;font-size:9.5px;
  font-weight:700;border-radius:8px;padding:1px 5px;min-width:8px;text-align:center;line-height:1.4;
}
.nav-fab{
  width:54px;height:54px;border-radius:50%;flex-shrink:0;
  background:linear-gradient(155deg,#38A47A,var(--vert-menthe-dark));display:flex;align-items:center;justify-content:center;
  margin:-28px 6px 0;box-shadow:var(--shadow-pop);color:#fff;font-size:24px;transition:transform .12s ease;
}
.nav-fab:active{transform:scale(.92);}
.nav-fab-wrap{display:flex;flex-direction:column;align-items:center;}
.nav-fab-wrap .nav-fab-lb{font-size:10.5px;font-weight:600;color:var(--vert-menthe-dark);margin-top:2px;}

/* ---- Cards ---- */
.card{background:#fff;border:1px solid var(--ligne);border-radius:18px;padding:16px;margin-bottom:12px;box-shadow:var(--shadow-card);}
.stat-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:4px;}
.stat-box{background:#fff;border:1px solid var(--ligne);border-radius:16px;padding:14px 14px 12px;box-shadow:var(--shadow-card);}
.stat-num{font-family:var(--font-mono);font-size:22px;font-weight:600;}
.stat-lb{font-size:12px;color:var(--encre-douce);margin-top:2px;}

/* Quick actions grid (accueil) */
.quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:6px;}
.quick-tile{display:flex;flex-direction:column;align-items:center;gap:7px;padding:4px 2px;}
.quick-ic{
  width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:19px;
  background:none;border:1.5px solid currentColor;transition:transform .12s ease;
}
.quick-tile:nth-child(1) .quick-ic{transform:rotate(-4deg);}
.quick-tile:nth-child(2) .quick-ic{transform:rotate(3deg);}
.quick-tile:nth-child(3) .quick-ic{transform:rotate(-2deg);}
.quick-tile:nth-child(4) .quick-ic{transform:rotate(4deg);}
.quick-tile:active .quick-ic{transform:scale(.9);}
.quick-lb{font-size:10.5px;font-weight:500;color:var(--encre-douce);text-align:center;line-height:1.2;}

/* Mode / vehicle tiles */
.mode-scroll{display:flex;gap:14px;overflow-x:auto;padding:2px 2px 4px 8px;margin:0 -2px 4px -8px;}
.mode-tile{
  flex-shrink:0;width:128px;border-radius:0 16px 16px 0;padding:14px 14px 12px 20px;color:#fff;position:relative;
  box-shadow:0 8px 18px -10px rgba(42,38,34,.35);text-align:left;transition:transform .12s ease;
}
.mode-tile::before{
  content:'';position:absolute;left:-7px;top:50%;transform:translateY(-50%);width:14px;height:14px;border-radius:50%;
  background:var(--blanc-casse);box-shadow:0 0 0 1.5px rgba(255,255,255,.4) inset;
}
.mode-tile:active{transform:scale(.96);}
.mode-tile.maritime{background:linear-gradient(150deg,#38A47A,var(--vert-menthe-dark));}
.mode-tile.aerien{background:linear-gradient(150deg,#5A9BD4,var(--bleu-globe-dark));}
.mode-tile.terrestre{background:linear-gradient(150deg,#D9A54A,var(--orange-dark));}
.mode-tile-ic{font-size:21px;}
.mode-tile-lb{font-size:13px;font-weight:600;margin-top:10px;font-family:var(--font-head);}
.mode-tile-sub{font-family:var(--font-mono);font-size:10px;opacity:.85;margin-top:1px;}

/* XP bar */
.xp-card{
  background:radial-gradient(120% 140% at 8% -10%,rgba(255,255,255,.35) 0%,rgba(255,255,255,0) 45%),
    linear-gradient(135deg,var(--vert-menthe) 0%,var(--vert-menthe-dark) 100%);
  border:1.5px dashed rgba(255,255,255,.4);
  border-radius:16px;padding:18px 20px 16px;color:#fff;margin-bottom:14px;position:relative;
  overflow:hidden;box-shadow:0 14px 28px -14px rgba(34,105,79,.55);
}
.xp-card::before,.xp-card::after{
  content:'';position:absolute;top:50%;transform:translateY(-50%);width:16px;height:16px;border-radius:50%;
  background:var(--blanc-casse);box-shadow:0 0 0 1.5px rgba(255,255,255,.4) inset;z-index:1;
}
.xp-card::before{left:-9px;}
.xp-card::after{right:-9px;}
.xp-top{display:flex;justify-content:space-between;align-items:flex-start;position:relative;}
.xp-level{font-family:var(--font-head);font-size:16px;font-weight:600;color:#fff;}
.xp-title{font-family:var(--font-mono);font-size:12px;color:rgba(255,255,255,.82);margin-top:2px;}
.xp-emoji{font-size:22px;width:40px;height:40px;border-radius:50%;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;position:relative;}
.xp-track{height:8px;background:rgba(255,255,255,.28);border-radius:6px;margin-top:14px;overflow:hidden;position:relative;}
.xp-fill{height:100%;background:#fff;border-radius:6px;transition:width .6s cubic-bezier(.4,0,.2,1);box-shadow:0 0 10px rgba(255,255,255,.6);}
.xp-foot{display:flex;justify-content:space-between;font-family:var(--font-mono);font-size:11px;color:rgba(255,255,255,.82);margin-top:8px;position:relative;}

/* badges */
.badge-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;}
.badge-stamp{
  border:1px solid var(--ligne);border-radius:16px;aspect-ratio:1;display:flex;flex-direction:column;
  align-items:center;justify-content:center;text-align:center;padding:6px;background:#fff;box-shadow:var(--shadow-soft);
  position:relative;overflow:hidden;transition:transform .2s ease;
}
.badge-stamp.unlocked{
  border-color:transparent;
  background:linear-gradient(150deg,var(--vert-menthe) 0%,var(--vert-menthe-dark) 100%);
  box-shadow:0 8px 18px -8px rgba(34,105,79,.55),0 0 0 3px var(--vert-pastel);
  animation:badge-pop .45s cubic-bezier(.34,1.56,.64,1);
}
.badge-stamp.unlocked::after{
  content:'';position:absolute;top:-60%;left:-20%;width:60%;height:220%;
  background:rgba(255,255,255,.22);transform:rotate(20deg);pointer-events:none;
}
@keyframes badge-pop{0%{transform:scale(.6);opacity:0;}60%{transform:scale(1.08);opacity:1;}100%{transform:scale(1);}}
.badge-ic{font-size:22px;position:relative;}
.badge-nm{font-size:9px;font-weight:600;margin-top:3px;line-height:1.2;color:var(--encre-douce);position:relative;}
.badge-stamp.unlocked .badge-nm{color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.15);}

/* unit card */
.unit-card{background:#fff;border:1px solid var(--ligne);border-radius:18px;padding:16px;margin-bottom:12px;box-shadow:var(--shadow-card);}
.unit-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;}
.unit-ic-badge{
  width:38px;height:38px;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:17px;
  flex-shrink:0;color:#fff;
}
.unit-ic-badge.maritime{background:var(--vert-menthe-dark);}
.unit-ic-badge.aerien{background:var(--bleu-globe-dark);}
.unit-ic-badge.terrestre{background:var(--orange-dark);}
.unit-name{font-size:15px;font-weight:600;font-family:var(--font-head);}
.unit-meta{font-size:11.5px;color:var(--encre-douce);margin-top:1px;}
.mode-pill{font-size:10.5px;font-weight:600;padding:4px 9px;border-radius:20px;white-space:nowrap;}
.mode-pill.maritime{background:var(--vert-pastel);color:var(--vert-menthe-dark);}
.mode-pill.aerien{background:var(--bleu-globe-clair);color:var(--bleu-globe-dark);}
.mode-pill.terrestre{background:var(--orange-clair);color:var(--orange-dark);}

/* Timeline verticale de suivi */
.timeline{margin:16px 2px 4px;}
.tl-row{display:flex;gap:12px;}
.tl-rail{display:flex;flex-direction:column;align-items:center;width:22px;flex-shrink:0;}
.tl-dot{
  width:22px;height:22px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;
  background:var(--ligne);color:var(--encre-douce);flex-shrink:0;
}
.tl-dot.done{background:var(--vert-menthe);color:#fff;}
.tl-dot.current{background:var(--orange-dark);color:#fff;box-shadow:0 0 0 4px var(--orange-clair);}
.tl-bar{width:2px;flex:1;min-height:18px;background:var(--ligne);margin:2px 0;}
.tl-bar.done{background:var(--vert-menthe);}
.tl-body{padding-bottom:18px;flex:1;}
.tl-row:last-child .tl-body{padding-bottom:2px;}
.tl-label{font-size:13px;font-weight:500;color:var(--encre-douce);}
.tl-row.done .tl-label,.tl-row.current .tl-label{color:var(--encre);}
.tl-row.current .tl-label{font-weight:600;}

.unit-actions{display:flex;gap:8px;margin-top:14px;}
.btn-sm{padding:10px 12px;border-radius:12px;font-size:12.5px;font-weight:600;flex:1;text-align:center;display:flex;align-items:center;justify-content:center;gap:6px;}
.btn-sm.primary{background:var(--vert-menthe);color:#fff;box-shadow:0 4px 12px -6px rgba(46,139,107,.5);}
.btn-sm.ghost{background:var(--vert-pastel);color:var(--vert-menthe-dark);}
.btn-sm.outline{border:1px solid var(--ligne);color:var(--encre-douce);background:#fff;}

/* colis / shipment row — carte d'expédition avec trajet + barre de progression */
.ship-row{padding:14px 4px;border-bottom:1px solid var(--ligne);}
.ship-row:last-child{border-bottom:none;}
.ship-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px;}
.colis-code{
  font-family:var(--font-mono);font-size:10.5px;background:var(--vert-pastel);color:var(--vert-menthe-dark);
  padding:3px 7px;border-radius:6px;font-weight:600;white-space:nowrap;display:inline-block;
}
.colis-name{font-weight:600;font-size:14px;margin-top:5px;}
.colis-desc{font-size:12px;color:var(--encre-douce);margin-top:1px;}
.status-tag{font-size:10.5px;font-weight:600;padding:5px 10px;border-radius:20px;white-space:nowrap;flex-shrink:0;}
.status-tag.livre{background:var(--vert-pastel);color:var(--vert-menthe-dark);}
.status-tag.transit{background:var(--orange-clair);color:var(--orange-dark);}
.status-tag.attente{background:var(--bleu-globe-clair);color:var(--bleu-globe-dark);}
.ship-route{display:flex;align-items:center;gap:8px;}
.ship-route-pkg{font-size:15px;display:flex;color:var(--encre-douce);}
.route-line{flex:1;height:4px;border-radius:2px;background:var(--ligne);position:relative;margin:0 2px;}
.route-line-fill{position:absolute;left:0;top:0;height:4px;border-radius:2px;background:linear-gradient(90deg,#38A47A,var(--vert-menthe));}
.route-line-dot{position:absolute;top:50%;width:11px;height:11px;border-radius:50%;background:var(--vert-menthe);border:2px solid #fff;box-shadow:0 1px 4px rgba(46,139,107,.5);transform:translate(-50%,-50%);}
.ship-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;margin-top:10px;}
.wa-btn{
  width:32px;height:32px;border-radius:10px;background:#25D366;color:#fff;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;font-size:15px;transition:transform .12s ease;
}
.wa-btn:active{transform:scale(.88);}
/* boutons d'action avec icône + libellé, pour que chaque action soit compréhensible sans avoir à deviner */
.act-btn{
  display:flex;align-items:center;gap:5px;height:32px;padding:0 11px;border-radius:10px;
  color:#fff;font-size:11.5px;font-weight:600;white-space:nowrap;flex-shrink:0;transition:transform .12s ease;
}
.act-btn i{font-size:14px;}
.act-btn:active{transform:scale(.93);}
.act-btn.outline{background:var(--blanc-casse);color:var(--encre-douce);border:1px solid var(--ligne);}

/* forms */
.form-row{margin-bottom:14px;}
.form-row label{font-size:12.5px;font-weight:500;color:var(--encre-douce);display:block;margin-bottom:6px;}
.form-row input,.form-row select{
  width:100%;padding:12px 14px;border:1px solid var(--ligne);border-radius:11px;font-size:14.5px;background:#fff;box-shadow:var(--shadow-soft);
}
.form-row input:focus,.form-row select:focus{outline:none;border-color:var(--vert-menthe);}
.mode-select{display:flex;gap:8px;}
.mode-opt{flex:1;border:1.5px solid var(--ligne);border-radius:12px;padding:12px 8px;text-align:center;background:#fff;transition:border-color .15s ease,background-color .15s ease,color .15s ease,transform .12s ease;}
.mode-opt:active{transform:scale(.97);}
.mode-opt-ic{font-size:19px;color:var(--encre-douce);display:flex;justify-content:center;}
.mode-opt.active .mode-opt-ic{color:inherit;}
.mode-opt.active{border-color:var(--vert-menthe-dark);background:var(--vert-pastel);color:var(--vert-menthe-dark);box-shadow:0 1px 3px rgba(34,105,79,.15);}
.mode-opt.active.maritime{border-color:var(--vert-menthe-dark);background:var(--vert-pastel);color:var(--vert-menthe-dark);}
.mode-opt.active.aerien{border-color:var(--bleu-globe-dark);background:var(--bleu-globe-clair);color:var(--bleu-globe-dark);}
.mode-opt.active.terrestre{border-color:var(--orange-dark);background:var(--orange-clair);color:var(--orange-dark);}
.mode-opt.active.groupe,.mode-opt.active.individuel{border-color:var(--vert-menthe-dark);background:var(--vert-pastel);color:var(--vert-menthe-dark);}
.mode-opt-lb{font-size:11.5px;font-weight:600;margin-top:6px;}

.sheet-overlay{
  position:fixed;inset:0;background:rgba(42,38,34,.45);z-index:40;display:flex;align-items:flex-end;
  max-width:520px;margin:0 auto;
}
.sheet{
  background:var(--blanc-casse);width:100%;border-radius:22px 22px 0 0;max-height:88vh;overflow-y:auto;
  padding:10px 20px 28px;animation:slideUp .25s ease-out;
}
@keyframes slideUp{from{transform:translateY(30px);opacity:0;}to{transform:translateY(0);opacity:1;}}
.sheet-handle{width:36px;height:4px;background:var(--ligne);border-radius:3px;margin:6px auto 16px;}
.sheet-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;}
.sheet-head h3{font-size:16px;font-weight:600;}
.sheet-close{font-size:18px;color:var(--encre-douce);width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--ligne);transition:transform .12s ease;}
.sheet-close:active{transform:scale(.88);}

.empty-state{text-align:center;padding:40px 20px;color:var(--encre-douce);}
.empty-ic{font-size:30px;margin-bottom:10px;color:var(--encre-douce);}
.empty-txt{font-size:13.5px;line-height:1.5;}

.csv-drop{
  border:1.5px dashed var(--ligne);border-radius:14px;padding:26px 16px;text-align:center;background:#fff;
}
.csv-drop-ic{font-size:24px;margin-bottom:6px;color:var(--encre-douce);}
.preview-table{width:100%;border-collapse:collapse;font-size:12.5px;}
.preview-table th{text-align:left;font-size:10.5px;color:var(--encre-douce);padding:6px 4px;border-bottom:1.5px solid var(--ligne);}
.preview-table td{padding:6px 4px;border-bottom:1px solid var(--ligne);}
.preview-table input{width:100%;border:none;background:transparent;font-size:12.5px;padding:2px;}
.preview-table input:focus{outline:1px solid var(--vert-menthe);border-radius:4px;}

.toast{
  position:fixed;bottom:100px;left:50%;transform:translateX(-50%);background:var(--encre);color:#fff;
  padding:12px 18px;border-radius:12px;font-size:13.5px;font-weight:500;z-index:60;display:flex;gap:8px;
  align-items:center;box-shadow:0 10px 30px -10px rgba(0,0,0,.4);max-width:88%;
}
.levelup{
  position:fixed;inset:0;z-index:70;display:flex;align-items:center;justify-content:center;
  background:rgba(42,38,34,.55);
}
.levelup-card{
  background:#fff;border-radius:24px;padding:32px 28px;text-align:center;max-width:280px;
  animation:pop .35s cubic-bezier(.34,1.56,.64,1);
  border-top:5px solid var(--vert-menthe);
  box-shadow:0 20px 40px -16px rgba(34,105,79,.4);
}
@keyframes pop{from{transform:scale(.7);opacity:0;}to{transform:scale(1);opacity:1;}}
.levelup-emoji{font-size:48px;margin-bottom:10px;filter:drop-shadow(0 4px 10px rgba(34,105,79,.35));}
.levelup-title{font-family:var(--font-head);font-size:19px;font-weight:600;color:var(--vert-menthe-dark);}
.levelup-sub{font-size:13px;color:var(--encre-douce);margin-top:6px;line-height:1.5;}

.offline-banner{
  background:var(--orange-clair);color:var(--orange-dark);font-size:12px;font-weight:500;text-align:center;
  padding:8px 12px;display:flex;align-items:center;justify-content:center;gap:6px;
}
.sync-dot{width:7px;height:7px;border-radius:50%;background:var(--orange-dark);display:inline-block;animation:pulse 1.2s infinite;}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.3;}}

.notif-row{display:flex;gap:12px;padding:13px 4px;border-bottom:1px solid var(--ligne);}
.notif-ic{width:34px;height:34px;border-radius:10px;background:#25D36622;color:#1a9c4a;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:15px;}
.notif-txt{font-size:13px;line-height:1.4;}
.notif-time{font-size:11px;color:var(--encre-douce);margin-top:2px;}

.link-row{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--ligne);font-size:14px;}
.link-row:last-child{border-bottom:none;}
.chev{color:var(--encre-douce);}

::-webkit-scrollbar{display:none;}
/* ---- Splash screen (logo officiel au démarrage) ---- */
#splash{
  position:fixed;inset:0;z-index:200;background:var(--blanc-casse);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  transition:opacity .4s ease,visibility .4s ease;
}
#splash-logo{width:104px;height:104px;object-fit:contain;border-radius:26px;background:#fff;box-shadow:0 14px 32px -14px rgba(46,139,107,.4);animation:splashPop .5s cubic-bezier(.34,1.56,.64,1);}
#splash-name{font-family:var(--font-head);font-size:20px;font-weight:600;color:var(--encre);margin-top:16px;}
#splash-sub{font-size:12.5px;color:var(--encre-douce);margin-top:2px;}
#splash-spinner{width:24px;height:24px;border-radius:50%;border:3px solid var(--ligne);border-top-color:var(--vert-menthe);margin-top:26px;animation:splashSpin .8s linear infinite;}
@keyframes splashSpin{to{transform:rotate(360deg);}}
@keyframes splashPop{from{transform:scale(.8);opacity:0;}to{transform:scale(1);opacity:1;}}
.splash-out{opacity:0;visibility:hidden;}
.brand-mark-img{width:56px;height:56px;border-radius:16px;object-fit:contain;margin-bottom:18px;box-shadow:0 8px 20px -8px rgba(46,139,107,.35);background:#fff;}

/* ================= AFFICHAGE PC (desktop) ================= */
@media (min-width:900px){
  body{background:linear-gradient(160deg,#F0ECE3 0%,var(--blanc-casse) 420px);}

  .login-screen{
    min-height:auto;width:min(420px,92vw);margin:6vh auto;border-radius:26px;
    background:#fff;box-shadow:0 30px 70px -30px rgba(42,38,34,.28);
    border:1px solid var(--ligne);padding:40px 40px 36px;
  }
  .login-screen .brand-mark-img{width:64px;height:64px;}
  .login-screen[style*="flex-start"]{
    justify-content:flex-start!important;min-height:auto;width:min(460px,92vw);margin:7vh auto;
    border-radius:26px;background:#fff;box-shadow:0 30px 70px -30px rgba(42,38,34,.28);border:1px solid var(--ligne);
  }

  #root{max-width:none;background:transparent;}
  .app-shell{padding-bottom:0;max-width:1180px;margin:0 auto;position:relative;}
  .app-shell:has(.bottom-nav) .topbar{margin-left:232px;border-radius:0;background:rgba(250,247,241,.96);}
  .app-shell:has(.bottom-nav) .page{margin-left:232px;padding:24px 32px 40px;max-width:900px;}
  .app-shell:not(:has(.bottom-nav)) .page{padding:24px 32px 40px;max-width:900px;margin:0 auto;}

  .bottom-nav{
    position:fixed;left:0;top:0;bottom:0;transform:none;width:216px;max-width:216px;
    flex-direction:column;align-items:stretch;justify-content:flex-start;
    border-top:none;border-right:1px solid var(--ligne);padding:26px 12px;gap:2px;box-shadow:none;
  }
  .bottom-nav::before{
    content:'';display:block;width:46px;height:46px;margin:0 auto 26px;border-radius:14px;
    background:#fff url('/logo.png') center/contain no-repeat;box-shadow:0 6px 16px -8px rgba(42,38,34,.25);
  }
  .nav-btn{flex-direction:row;justify-content:flex-start;gap:12px;padding:11px 14px;border-radius:12px;}
  .nav-btn.active{background:var(--vert-pastel);}
  .nav-btn .nav-ic{font-size:18px;width:auto;height:auto;border-radius:0;}
  .nav-btn.active .nav-ic{border-color:transparent;transform:none;}
  .nav-btn .nav-lb{font-size:13px;}
  .nav-btn .nav-badge{position:static;margin-left:auto;margin-top:0;}
  .nav-fab{
    display:flex;width:auto;height:auto;border-radius:12px;justify-content:flex-start;align-items:center;
    gap:12px;margin:2px 0 14px;padding:11px 14px;box-shadow:none;
  }
  .nav-fab i{font-size:18px;}
  .nav-fab::after{content:'Créer';font-size:13px;font-weight:600;}
  .nav-fab-wrap{display:block;width:100%;}
  .nav-fab-wrap .nav-fab-lb{display:none;}

  .stat-grid{grid-template-columns:repeat(4,1fr);}
  .quick-grid{grid-template-columns:repeat(4,1fr);max-width:520px;}
  .badge-grid{grid-template-columns:repeat(6,1fr);}

  .sheet-overlay{max-width:none;align-items:center;justify-content:center;}
  .sheet{width:min(560px,90vw);border-radius:22px;max-height:82vh;}
  .sheet-handle{display:none;}

  .toast{bottom:32px;}
}
