/* =========================================================
   Gestion des heures — interface v2
   Mobile d'abord, tablette (rail latéral) et ordinateur.
   ========================================================= */
:root {
  --bg: #f2f4f8;
  --bg-grad: radial-gradient(1200px 500px at 100% -10%, #e4ecf8 0%, transparent 60%);
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #e7ecf2;
  --text: #0e1a2b;
  --text-2: #3b4a5c;
  --muted: #6b7a8c;
  --border: #e1e6ed;
  --brand: #0b1f3a;
  --brand-2: #16345e;
  --accent: #f5b301;
  --accent-ink: #1b1400;
  --primary: #0b1f3a;
  --primary-ink: #ffffff;
  --ok: #12a150;
  --ok-soft: #e2f6eb;
  --warn: #c27803;
  --warn-soft: #fff4dc;
  --danger: #d93a2b;
  --danger-soft: #fde9e7;
  --info: #2463d1;
  --info-soft: #e6effd;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-1: 0 1px 2px rgba(14, 26, 43, .05), 0 2px 8px rgba(14, 26, 43, .04);
  --shadow-2: 0 10px 30px rgba(14, 26, 43, .10), 0 2px 6px rgba(14, 26, 43, .06);
  --shadow-3: 0 24px 60px rgba(14, 26, 43, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --rail: 0px;
  --tabbar-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070d16;
    --bg-grad: radial-gradient(1000px 500px at 100% -10%, #10233f 0%, transparent 60%);
    --surface: #0f1825;
    --surface-2: #152131;
    --surface-3: #1c2a3d;
    --text: #eaf0f7;
    --text-2: #c3cfdc;
    --muted: #8797aa;
    --border: #1f2d40;
    --primary: #f5b301;
    --primary-ink: #1b1400;
    --ok: #3ddc84;
    --ok-soft: #0f2d1e;
    --warn: #ffbf47;
    --warn-soft: #33270b;
    --danger: #ff6b5e;
    --danger-soft: #3a1714;
    --info: #6ea2ff;
    --info-soft: #13243f;
    --shadow-1: 0 0 0 1px rgba(255,255,255,.02);
    --shadow-2: 0 10px 30px rgba(0,0,0,.45);
    --shadow-3: 0 24px 60px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
html { overscroll-behavior-y: none; }
body {
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 "Inter", system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
button, a, .tab, .chip, .seg button { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
svg.i { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.hidden { display: none !important; }
a { color: var(--info); text-decoration: none; }

/* ---------- Structure ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px calc(16px + var(--rail));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; font-size: 17px; min-width: 0; }
.brand img { border-radius: 9px; box-shadow: var(--shadow-1); }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 999px; background: var(--surface-2); }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.sync.on i { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2.4s infinite; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 14px; border: 0; background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; border: 2px solid var(--bg); animation: pop .35s var(--spring); }

#app {
  max-width: 1180px; margin: 0 auto;
  padding: 8px 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom));
  padding-left: calc(16px + var(--rail));
}
.view { animation: viewIn .32s var(--ease) both; }
.view > * { animation: rise .42s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .03s; } .view > *:nth-child(3) { animation-delay: .06s; }
.view > *:nth-child(4) { animation-delay: .09s; } .view > *:nth-child(5) { animation-delay: .12s; }
.view > *:nth-child(n+6) { animation-delay: .15s; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -.025em; font-weight: 850; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 4px 10px; font-weight: 750; }
h3 { font-size: 17px; margin: 0 0 6px; letter-spacing: -.01em; }
p { margin: 6px 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .strong { font-weight: 700; }
.tnum { font-variant-numeric: tabular-nums; }

.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-1); margin-bottom: 14px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card.tap { cursor: pointer; }
.card.tap:hover { box-shadow: var(--shadow-2); }
.card.tap:active { transform: scale(.985); }
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 750; margin-bottom: 10px; }
.card-title .ico { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); }

.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(145deg, #0b1f3a 0%, #16345e 60%, #1f4a84 100%);
  border: 0; border-radius: 26px; padding: 22px 20px 20px; box-shadow: var(--shadow-2);
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(245,179,1,.35), transparent); pointer-events: none; }
.hero.working { background: linear-gradient(145deg, #0a3a28 0%, #0f5a3c 55%, #128a54 100%); }
.hero.break { background: linear-gradient(145deg, #4a2a00 0%, #7a4700 55%, #b36b00 100%); }
.hero .label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.14); padding: 6px 12px; border-radius: 999px; }
.hero .label .live { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.8s infinite; }
.hero .big { font-size: clamp(54px, 15vw, 76px); font-weight: 850; letter-spacing: -.04em; line-height: 1; margin: 18px 0 6px; font-variant-numeric: tabular-nums; }
.hero .caption { opacity: .8; font-size: 14px; }
.hero .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.hero .meta div { background: rgba(255,255,255,.10); border-radius: 14px; padding: 10px; text-align: center; }
.hero .meta b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.hero .meta span { font-size: 11.5px; opacity: .8; }
.hero .progress { height: 8px; background: rgba(255,255,255,.15); border-radius: 99px; margin-top: 16px; overflow: hidden; }
.hero .progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .8s var(--ease); }
.hero .progress.over i { background: #ff6b5e; }
.hero .hint { font-size: 13px; margin-top: 8px; opacity: .9; }

/* Anneau de pause */
.ring { position: relative; width: min(240px, 66vw); aspect-ratio: 1; margin: 14px auto 4px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255,255,255,.15); }
.ring .bar { stroke: var(--accent); transition: stroke-dashoffset 1s linear, stroke .4s; filter: drop-shadow(0 0 8px rgba(245,179,1,.5)); }
.ring.done .bar { stroke: #3ddc84; filter: drop-shadow(0 0 10px rgba(61,220,132,.6)); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .big { margin: 0; font-size: clamp(44px, 13vw, 58px); }
.ring.done { animation: pop .5s var(--spring); }

/* ---------- Boutons ---------- */
.btn {
  --b: var(--surface-2); --c: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 14px; border: 0;
  background: var(--b); color: var(--c); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), filter .2s, background .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { --b: var(--primary); --c: var(--primary-ink); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn.accent { --b: var(--accent); --c: var(--accent-ink); box-shadow: 0 6px 16px rgba(245,179,1,.3); }
.btn.ok { --b: var(--ok); --c: #fff; }
.btn.danger { --b: var(--danger-soft); --c: var(--danger); }
.btn.solid-danger { --b: var(--danger); --c: #fff; }
.btn.ghost { --b: transparent; --c: var(--text-2); }
.btn.glass { --b: rgba(255,255,255,.14); --c: #fff; }
.btn.white { --b: #fff; --c: #0b1f3a; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 11px; }
.btn.xl { min-height: 68px; font-size: 19px; border-radius: 20px; width: 100%; letter-spacing: -.01em; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: currentColor; opacity: .25; animation: ripple .6s var(--ease); pointer-events: none; }
.actions { display: grid; gap: 12px; margin-top: 18px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.linkbtn { background: none; border: 0; color: var(--info); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 2px; }

/* ---------- Formulaires ---------- */
label.f { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: 13px; padding: 12px 14px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--info); background: var(--surface); box-shadow: 0 0 0 4px var(--info-soft); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.suffix { position: relative; }
.suffix input { padding-right: 44px; }
.suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 600; pointer-events: none; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; margin-top: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--primary); }

/* Interrupteur */
.switch { display: flex; align-items: center; gap: 14px; padding: 12px 0; cursor: pointer; }
.switch .txt { flex: 1; min-width: 0; }
.switch .txt b { display: block; font-size: 15px; }
.switch .txt span { font-size: 13px; color: var(--muted); }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 99px; background: var(--surface-3); position: relative; flex: none; padding: 0; border: 0; cursor: pointer; transition: background .25s var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .3s var(--spring); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(20px); }
.switch input:focus { box-shadow: 0 0 0 4px var(--info-soft); }

/* ---------- Pastilles, notices ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 750; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok .d { animation: pulse 2s infinite; }
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: 16px; padding: 14px; margin: 0 0 14px; font-size: 14px; background: var(--info-soft); color: var(--text); }
.notice > svg { color: var(--info); margin-top: 2px; }
.notice.warn { background: var(--warn-soft); } .notice.warn > svg { color: var(--warn); }
.notice.danger { background: var(--danger-soft); } .notice.danger > svg { color: var(--danger); }
.notice.ok { background: var(--ok-soft); } .notice.ok > svg { color: var(--ok); }
.notice .grow > b { display: block; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-1); }
.kpi span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.kpi b { display: block; font-size: 24px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi small { color: var(--muted); font-size: 12px; }

/* ---------- Listes ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; margin-bottom: 14px; }
.li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.li:last-child { border-bottom: 0; }
.li.tap { cursor: pointer; }
.li.tap:hover { background: var(--surface-2); }
.li.tap:active { background: var(--surface-3); }
.li .main { flex: 1; min-width: 0; }
.li .main b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .main span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .end { text-align: right; flex: none; }
.li .chev { color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 15px; letter-spacing: .02em; position: relative; }
.avatar .st { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--surface); background: var(--muted); }
.avatar .st.working { background: var(--ok); } .avatar .st.break { background: var(--accent); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg.i { width: 44px; height: 44px; opacity: .5; margin-bottom: 8px; }

/* ---------- Segments / onglets internes ---------- */
.seg { position: relative; display: inline-flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 11px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .2s; }
.seg button.active { color: var(--text); }
.seg .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-1); transition: left .3s var(--ease), width .3s var(--ease); }
.period-nav { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.period-nav b { flex: 1; text-align: center; font-size: 15px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 750; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { transition: background .15s; }
tbody tr.tap { cursor: pointer; }
tbody tr.tap:hover { background: var(--surface-2); }
tfoot td { font-weight: 800; border-bottom: 0; }
.day-group { padding: 10px 16px 6px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); display: flex; justify-content: space-between; }

/* Barres (graphique simple) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 8px 2px 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--info), color-mix(in srgb, var(--info) 60%, transparent)); transform-origin: bottom; animation: grow .7s var(--ease) both; min-height: 3px; }
.bars .b i.zero { background: var(--surface-3); }
.bars .b i.over { background: linear-gradient(180deg, var(--warn), color-mix(in srgb, var(--warn) 60%, transparent)); }
.bars .b span { font-size: 11px; color: var(--muted); font-weight: 650; }

/* Fiche de paie simulée */
.pay { width: 100%; font-size: 14.5px; }
.pay td { border: 0; padding: 7px 0; white-space: normal; }
.pay td.num { white-space: nowrap; padding-left: 12px; }
.pay tr.sep td { border-top: 1px dashed var(--border); padding-top: 12px; }
.pay tr.total td { font-weight: 850; font-size: 17px; }
.pay tr.cost td { font-weight: 850; font-size: 19px; color: var(--info); }

/* ---------- Navigation ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: stretch;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-top: 1px solid var(--border);
}
.tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; transition: color .2s; }
.tab svg.i { width: 24px; height: 24px; transition: transform .3s var(--spring); }
.tab.active { color: var(--text); }
.tab.active svg.i { transform: translateY(-1px) scale(1.08); }
.tab .bubble { position: absolute; top: 2px; left: 50%; width: 56px; height: 30px; margin-left: -28px; border-radius: 99px; background: var(--surface-3); z-index: -1; transform: scale(.4); opacity: 0; transition: transform .35s var(--spring), opacity .2s; }
.tab.active .bubble { transform: scale(1); opacity: 1; }
.tab .badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 800; }
.rail-brand { display: none; }

/* Tablette et ordinateur : rail latéral */
@media (min-width: 768px) {
  :root { --rail: 96px; --tabbar-h: 0px; }
  .tabbar {
    top: 0; right: auto; width: var(--rail); flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: calc(16px + env(safe-area-inset-top)) 10px 16px; border-top: 0; border-right: 1px solid var(--border);
  }
  .rail-brand { display: flex; justify-content: center; margin-bottom: 14px; }
  .rail-brand img { width: 44px; height: 44px; border-radius: 13px; box-shadow: var(--shadow-2); }
  .tab { flex: none; padding: 10px 4px; font-size: 11.5px; }
  .tab .bubble { width: 60px; height: 34px; margin-left: -30px; top: 6px; }
  .tab .badge { top: 4px; }
  .brand img { display: none; }
  .page-head h1 { font-size: 34px; }
  #app { padding-top: 14px; }
}
@media (min-width: 1100px) {
  :root { --rail: 236px; }
  .tabbar { padding-left: 14px; padding-right: 14px; }
  .rail-brand { justify-content: flex-start; align-items: center; gap: 12px; padding: 0 8px; font-weight: 850; font-size: 16px; }
  .tab { flex-direction: row; gap: 12px; font-size: 15px; padding: 12px 14px; }
  .tab .bubble { inset: 0; width: auto; height: auto; margin: 0; border-radius: 14px; transform: scaleX(.6); }
  .tab.active .bubble { transform: none; }
  .tab .badge { position: static; margin-left: auto; }
}
body.no-nav { --rail: 0px; --tabbar-h: 0px; }

/* ---------- Feuille modale (bottom sheet) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(5, 10, 18, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .25s var(--ease) both; }
.sheet {
  position: relative; width: 100%; max-width: 620px; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-3);
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .38s var(--ease) both;
}
.sheet .grab { width: 42px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet h2.t { font-size: 22px; text-transform: none; letter-spacing: -.02em; color: var(--text); margin: 0 0 6px; font-weight: 850; }
.sheet-wrap.closing .sheet { animation: sheetDown .25s var(--ease) both; }
.sheet-wrap.closing .sheet-backdrop { animation: fade .25s var(--ease) reverse both; }
@media (min-width: 768px) {
  .sheet-wrap { align-items: center; padding: 24px; padding-left: calc(24px + var(--rail)); }
  .sheet { border-radius: 26px; animation: zoomIn .3s var(--ease) both; }
  .sheet .grab { display: none; }
  .sheet-wrap.closing .sheet { animation: zoomOut .2s var(--ease) both; }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top)); width: min(440px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; background: #0e1a2b; color: #fff; padding: 14px 16px; border-radius: 18px; box-shadow: var(--shadow-3); font-size: 14px; animation: toastIn .45s var(--spring) both; }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast.error { background: #b3261e; }
.toast.ok { background: #0f7a3f; }
.toast b { display: block; font-size: 15px; }
.toast svg.i { margin-top: 2px; }

/* ---------- Squelettes de chargement ---------- */
.sk { border-radius: 16px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }

/* ---------- Carte (Leaflet) ---------- */
.map { height: min(62dvh, 560px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-1); margin-bottom: 14px; background: var(--surface-2); z-index: 0; }
.leaflet-container { font: inherit; }
.pin { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 6px 16px rgba(0,0,0,.3); border: 3px solid #fff; }
.pin span { transform: rotate(45deg); }
.pin.old { filter: grayscale(.8); opacity: .7; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.6s infinite; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100dvh - 80px); display: flex; flex-direction: column; justify-content: center; max-width: 440px; margin: 0 auto; }
.auth .logo { width: 76px; height: 76px; border-radius: 22px; box-shadow: var(--shadow-2); margin: 0 auto 14px; display: block; animation: pop .6s var(--spring) both; }
.auth h1 { text-align: center; font-size: 30px; letter-spacing: -.03em; margin: 0 0 4px; }
.auth .sub { text-align: center; color: var(--muted); margin-bottom: 20px; }

/* ---------- Animations ---------- */
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes zoomIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes zoomOut { to { opacity: 0; transform: scale(.96); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,132,.55); } 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Correctifs d'affichage */
.li .main span.pill, .li .main b .pill { display: inline-flex; width: auto; font-size: 11.5px; color: inherit; }
.li .main span.pill:not(.ok):not(.warn):not(.danger):not(.info) { color: var(--muted); }
.li .main .pill .d { display: inline-block; }
.ring { width: min(240px, 62vw, 30vh); }
@media (min-width: 768px) {
  .tabbar { z-index: 40; background: var(--surface); }
}
@media (min-width: 768px) and (max-width: 1099px) { .rail-brand span { display: none; } }
