/* ==================================================================================================
   Systeme de design de la console : la DA « liquid glass sobre » de HandballVision
   (frontend/src/index.css + DESIGN.md), portee en CSS pur pour des pages statiques.

   Deux matieres, comme chez Apple :
   - SURFACE (.surface, .surface-2, .track) : le CONTENU. Presque opaque, sans flou.
   - VERRE (.glass, .lg-*) : ce qui FLOTTE au-dessus (menu, barre d'onglets, boutons, pastilles).
   Une seule couleur vive : --accent. Le rouge (--danger) ne sert qu'au desabonnement et aux confirmations.
   Le mode clair ne change que les variables (html[data-theme="light"]).
   ================================================================================================== */

@property --mx { syntax: "<length-percentage>"; inherits: true; initial-value: 50%; }
@property --my { syntax: "<length-percentage>"; inherits: true; initial-value: -30%; }

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --bg: #04060a;
  --bg-2: #0b1019;
  --ink: #f4f6fb;
  --ink-2: rgb(244 246 251 / 0.74);
  --ink-3: rgb(244 246 251 / 0.58);
  --accent: #4f8bff;
  --accent-rgb: 79 139 255;
  --accent-fill: #2a5fd6;
  --accent-ink: #ffffff;
  --line: rgb(255 255 255 / 0.08);
  --warn: #f5b454;
  --danger: #ff6b6b;
  --danger-rgb: 255 107 107;
  --danger-fill: #c93b3b;
  --ok: #4fd1a5;

  --surface-top: rgb(21 26 37 / 0.9);
  --surface-bottom: rgb(13 17 26 / 0.9);
  --surface-border: rgb(255 255 255 / 0.065);
  --surface-hilite: rgb(255 255 255 / 0.06);
  --surface-shadow: 0 26px 60px -32px rgb(0 0 0 / 0.95), 0 1px 2px rgb(0 0 0 / 0.45);
  --surface-2: rgb(255 255 255 / 0.035);
  --surface-2-border: rgb(255 255 255 / 0.06);
  --track: rgb(0 0 0 / 0.34);
  --track-shadow: inset 0 1px 2px rgb(0 0 0 / 0.55), inset 0 0 0 1px rgb(255 255 255 / 0.045);

  --glass-top: rgb(255 255 255 / 0.15);
  --glass-bottom: rgb(255 255 255 / 0.05);
  --glass-tint: rgb(12 16 26 / 0.36);
  --glass-border: rgb(255 255 255 / 0.1);
  --glass-rim-a: rgb(255 255 255 / 0.55);
  --glass-rim-b: rgb(255 255 255 / 0.04);
  --glass-hilite: rgb(255 255 255 / 0.18);
  --glass-shadow: 0 22px 50px -18px rgb(0 0 0 / 0.75), 0 2px 8px rgb(0 0 0 / 0.35);
  --lift-shadow: 0 34px 70px -30px rgb(0 0 0 / 0.95), 0 1px 2px rgb(0 0 0 / 0.45);
  --pill-shadow: 0 8px 20px -10px rgb(0 0 0 / 0.7);
  --btn-hover-drop: 0 16px 34px -12px rgb(0 0 0 / 0.8);
  --shimmer: rgb(255 255 255 / 0.08);

  --btn-top: rgb(255 255 255 / 0.2);
  --btn-bottom: rgb(255 255 255 / 0.05);
  --btn-edge: rgb(255 255 255 / 0.5);
  --btn-inner-shade: rgb(0 0 0 / 0.28);
  --btn-drop: 0 10px 28px -10px rgb(0 0 0 / 0.75);
  --spec: rgb(255 255 255 / 0.42);

  --aurora-1: rgb(79 139 255 / 0.3);
  --aurora-2: rgb(56 170 255 / 0.14);
  --aurora-3: rgb(99 102 241 / 0.16);
  --court: rgb(160 190 255 / 0.09);
  --noise-opacity: 0.035;
  --scrim: rgb(2 4 8 / 0.62);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #e9edf4;
  --bg-2: #f8f9fc;
  --ink: #0a0e16;
  --ink-2: rgb(10 14 22 / 0.72);
  --ink-3: rgb(10 14 22 / 0.6);
  --accent: #1f56e0;
  --accent-rgb: 31 86 224;
  --accent-fill: #1f56e0;
  --accent-ink: #ffffff;
  --line: rgb(10 14 22 / 0.08);
  --warn: #8a5200;
  --danger: #b42323;
  --danger-rgb: 180 35 35;
  --danger-fill: #b42323;
  --ok: #0e6e4f;

  --surface-top: rgb(255 255 255 / 0.95);
  --surface-bottom: rgb(252 253 255 / 0.93);
  --surface-border: rgb(10 14 22 / 0.06);
  --surface-hilite: rgb(255 255 255 / 1);
  --surface-shadow: 0 22px 50px -30px rgb(20 35 70 / 0.35), 0 1px 2px rgb(20 35 70 / 0.07);
  --surface-2: rgb(10 14 22 / 0.03);
  --surface-2-border: rgb(10 14 22 / 0.05);
  --track: rgb(10 14 22 / 0.06);
  --track-shadow: inset 0 1px 2px rgb(10 14 22 / 0.1), inset 0 0 0 1px rgb(10 14 22 / 0.03);

  --glass-top: rgb(255 255 255 / 0.72);
  --glass-bottom: rgb(255 255 255 / 0.42);
  --glass-tint: rgb(255 255 255 / 0.22);
  --glass-border: rgb(255 255 255 / 0.85);
  --glass-rim-a: rgb(255 255 255 / 1);
  --glass-rim-b: rgb(255 255 255 / 0.3);
  --glass-hilite: rgb(255 255 255 / 0.9);
  --glass-shadow: 0 20px 44px -20px rgb(20 35 70 / 0.35), 0 2px 8px rgb(20 35 70 / 0.08), 0 0 0 1px rgb(20 35 70 / 0.05);
  --lift-shadow: 0 30px 60px -30px rgb(20 35 70 / 0.4), 0 1px 2px rgb(20 35 70 / 0.08);
  --pill-shadow: 0 8px 18px -10px rgb(20 35 70 / 0.35), 0 0 0 1px rgb(20 35 70 / 0.06);
  --btn-hover-drop: 0 14px 28px -12px rgb(20 35 70 / 0.4), 0 0 0 1px rgb(20 35 70 / 0.07);
  --shimmer: rgb(10 14 22 / 0.06);

  --btn-top: rgb(255 255 255 / 0.95);
  --btn-bottom: rgb(255 255 255 / 0.6);
  --btn-edge: rgb(255 255 255 / 1);
  --btn-inner-shade: rgb(20 35 70 / 0.1);
  --btn-drop: 0 10px 24px -12px rgb(20 35 70 / 0.35), 0 0 0 1px rgb(20 35 70 / 0.07);
  --spec: rgb(255 255 255 / 0.9);

  --aurora-1: rgb(37 99 255 / 0.2);
  --aurora-2: rgb(56 170 255 / 0.14);
  --aurora-3: rgb(99 102 241 / 0.12);
  --court: rgb(37 60 120 / 0.1);
  --noise-opacity: 0.02;
  --scrim: rgb(20 35 70 / 0.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "tnum";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
body.verrou { overflow: hidden; }
::selection { background: rgb(var(--accent-rgb) / 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
.cache { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ================================================================== FOND VIVANT */
.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(140% 90% at 50% -20%, var(--bg-2), var(--bg) 62%); }
.ambient .layer { position: absolute; will-change: transform; }
.ambient .aurora { width: 100%; height: 100%; border-radius: 50%; }
.ambient .l1 { left: 50%; top: -45vmax; width: 105vmax; height: 105vmax; margin-left: -52.5vmax; transform: translate3d(0, var(--y1, 0px), 0); }
.ambient .l2 { right: -30vmax; top: 5vh; width: 70vmax; height: 70vmax; transform: translate3d(0, var(--y2, 0px), 0); }
.ambient .l3 { left: -25vmax; bottom: -40vmax; width: 80vmax; height: 80vmax; transform: translate3d(0, var(--y2, 0px), 0); }
.ambient .a1 { background: radial-gradient(closest-side, var(--aurora-1), transparent); }
.ambient .a2 { background: radial-gradient(closest-side, var(--aurora-2), transparent); }
.ambient .a3 { background: radial-gradient(closest-side, var(--aurora-3), transparent); }
.ambient .court { left: 50%; bottom: -18vh; width: 150vmax; max-width: 2200px; margin-left: calc(min(150vmax, 2200px) / -2);
  perspective: 900px; transform: translate3d(0, var(--yc, 0px), 0); }
.ambient .court > div { aspect-ratio: 2 / 1; transform-origin: bottom; transform: rotateX(64deg);
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent); mask-image: linear-gradient(to top, #000 35%, transparent); }
.ambient .court svg { width: 100%; height: 100%; display: block; }
.ambient .noise { position: absolute; inset: 0; mix-blend-mode: overlay; opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* derive lente : ordinateur seulement (le verre flottant recalculerait le fond a chaque image sur mobile) */
@media (hover: hover) and (min-width: 1024px) {
  .ambient .a1 { animation: hv-drift 26s ease-in-out infinite; }
  .ambient .a2 { animation: hv-drift 34s ease-in-out infinite reverse; }
  .ambient .a3 { animation: hv-drift 30s ease-in-out infinite; }
}
@keyframes hv-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(6%, -4%, 0) scale(1.08); }
  66% { transform: translate3d(-5%, 3%, 0) scale(0.95); }
}

/* ================================================================== MATIERES */
.surface { position: relative; isolation: isolate;
  background: linear-gradient(180deg, var(--surface-top), var(--surface-bottom));
  border: 1px solid var(--surface-border); border-radius: 26px;
  box-shadow: var(--surface-shadow), inset 0 1px 0 var(--surface-hilite); }
.surface-2 { position: relative; background: var(--surface-2); border: 1px solid var(--surface-2-border); border-radius: 18px; }
.track { position: relative; background: var(--track); box-shadow: var(--track-shadow); }
.lift { transition: transform 500ms var(--ease), box-shadow 500ms var(--ease); }
@media (hover: hover) { .lift:hover { box-shadow: var(--lift-shadow), inset 0 1px 0 var(--surface-hilite); } }

.glass { position: relative; isolation: isolate;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom)), var(--glass-tint);
  -webkit-backdrop-filter: blur(16px) saturate(190%) brightness(1.05); backdrop-filter: blur(16px) saturate(190%) brightness(1.05);
  border: 1px solid var(--glass-border); border-radius: 26px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hilite), inset 0 -1px 0 rgb(255 255 255 / 0.05); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(55% 160% at 30% -30%, var(--glass-hilite), transparent 62%); }
.glass::after, .lg-btn::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(155deg, var(--glass-rim-a), var(--glass-rim-b) 34%, var(--glass-rim-b) 66%, rgb(255 255 255 / 0.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* ================================================================== BOUTONS VERRE LIQUIDE */
.lg-btn { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 15px; letter-spacing: -0.005em; text-decoration: none;
  transition: transform 650ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 550ms var(--ease), background-color 300ms var(--ease), color 300ms var(--ease), filter 300ms var(--ease);
  will-change: transform; }
.lg-btn::after { inset: 0; }
.lg-btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0.35;
  background: radial-gradient(140px circle at var(--mx) var(--my), var(--spec), transparent 62%);
  transition: opacity 400ms var(--ease); }
@media (hover: hover) {
  .lg-btn:hover::before { opacity: 1; }
  .lg-btn:hover { transform: translateY(-1px); }
}
.lg-btn:active { transform: scale(1.04, 0.9); transition: transform 110ms ease-out, box-shadow 110ms ease-out; }
.lg-btn:disabled { pointer-events: none; opacity: 0.45; }
.lg-btn.block { display: flex; width: 100%; }
.lg-btn.sm { min-height: 38px; padding: 0 16px; font-size: 13.5px; }
.lg-btn.icon { width: 44px; padding: 0; }
.lg-btn.icon.sm { width: 38px; }

.lg-glass { color: var(--ink);
  background: linear-gradient(180deg, var(--btn-top) 0%, var(--btn-bottom) 55%, rgb(255 255 255 / 0.02) 100%), var(--glass-tint);
  -webkit-backdrop-filter: blur(18px) saturate(190%); backdrop-filter: blur(18px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--btn-edge), inset 0 -1px 0 rgb(255 255 255 / 0.08), inset 0 -10px 18px -8px var(--btn-inner-shade), var(--btn-drop); }
@media (hover: hover) { .lg-glass:hover { box-shadow: inset 0 1px 0 var(--btn-edge), inset 0 -1px 0 rgb(255 255 255 / 0.12), inset 0 -10px 18px -8px var(--btn-inner-shade), var(--btn-hover-drop); } }
.surface .lg-glass, .surface-2 .lg-glass { -webkit-backdrop-filter: none; backdrop-filter: none; }

.lg-primary { color: var(--accent-ink); background-color: var(--accent-fill);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.3) 0%, transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent-fill) 90%, white), var(--accent-fill) 60%, color-mix(in srgb, var(--accent-fill) 86%, black));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.65), inset 0 -2px 8px rgb(0 0 0 / 0.22), inset 0 0 0 1px rgb(255 255 255 / 0.14),
    0 12px 32px -10px rgb(var(--accent-rgb) / 0.9), 0 0 0 1px rgb(var(--accent-rgb) / 0.5);
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.18); }
@media (hover: hover) { .lg-primary:hover { filter: brightness(1.08) saturate(1.05); } }
.lg-primary:active { box-shadow: inset 0 2px 6px rgb(0 0 0 / 0.25), 0 6px 18px -8px rgb(var(--accent-rgb) / 0.9), 0 0 0 1px rgb(var(--accent-rgb) / 0.5); }

/* variante rouge : desabonnement et confirmation d'une action irreversible, nulle part ailleurs */
.lg-danger { color: #fff; background-color: var(--danger-fill);
  background-image: linear-gradient(180deg, rgb(255 255 255 / 0.28) 0%, transparent 32%),
    linear-gradient(180deg, color-mix(in srgb, var(--danger-fill) 88%, white), var(--danger-fill) 60%, color-mix(in srgb, var(--danger-fill) 86%, black));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.55), inset 0 -2px 8px rgb(0 0 0 / 0.22), inset 0 0 0 1px rgb(255 255 255 / 0.12),
    0 12px 32px -10px rgb(var(--danger-rgb) / 0.8), 0 0 0 1px rgb(var(--danger-rgb) / 0.5);
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.2); }
@media (hover: hover) { .lg-danger:hover { filter: brightness(1.08); } }

.lg-ghost { color: var(--ink-2); background: transparent; }
.lg-ghost::after { opacity: 0; transition: opacity 400ms var(--ease); }
@media (hover: hover) {
  .lg-ghost:hover { color: var(--ink); background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)); box-shadow: inset 0 1px 0 var(--btn-edge), var(--btn-drop); }
  .lg-ghost:hover::after { opacity: 1; }
}
@media (hover: none) { .lg-btn::before { opacity: 0.7; background: radial-gradient(140px circle at 30% -25%, var(--spec), transparent 62%); } }

.lg-pill { background: linear-gradient(180deg, var(--btn-top), var(--btn-bottom)), var(--glass-tint);
  box-shadow: inset 0 1px 0 var(--btn-edge), inset 0 -8px 14px -8px var(--btn-inner-shade), var(--pill-shadow); }

/* ================================================================== PASTILLE LIQUIDE (onglets, menu) */
.liquid { position: relative; }
.liquid > .lg-pill { position: absolute; border-radius: 999px; pointer-events: none; opacity: 0; z-index: 0;
  transition: opacity 300ms var(--ease), transform 420ms var(--ease); }
.liquid.pret > .lg-pill { opacity: 1; }
.liquid > :not(.lg-pill) { position: relative; z-index: 1; }

/* ================================================================== TYPO / ELEMENTS */
.label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.big-number { font-weight: 650; letter-spacing: -0.045em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-2); }
.page-title { font-size: clamp(28px, 4.2vw, 40px); font-weight: 650; letter-spacing: -0.04em; line-height: 1.05; }
.page-sub { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--surface-2-border); }
.chip.accent { color: var(--accent-ink); background: var(--accent-fill); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 4px 14px -6px rgb(var(--accent-rgb) / 0.9); }
.chip.soft { color: var(--accent); background: rgb(var(--accent-rgb) / 0.13); box-shadow: inset 0 0 0 1px rgb(var(--accent-rgb) / 0.25); }
.chip.danger { color: #fff; background: var(--danger-fill); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.3), 0 4px 14px -6px rgb(var(--danger-rgb) / 0.9); }
.chip.dim { opacity: 0.7; }
.chip.ok { color: var(--ok); background: rgb(79 209 165 / 0.12); box-shadow: inset 0 0 0 1px rgb(79 209 165 / 0.25); }
[data-theme="light"] .chip.ok { background: rgb(14 110 79 / 0.1); box-shadow: inset 0 0 0 1px rgb(14 110 79 / 0.2); }

.field { width: 100%; min-height: 48px; padding: 12px 16px; font: inherit; font-size: 15px; color: var(--ink); background: var(--track); box-shadow: var(--track-shadow);
  border: 0; border-radius: 16px; transition: box-shadow 300ms var(--ease); }
.field::placeholder { color: var(--ink-3); }
.field:focus { outline: none; box-shadow: var(--track-shadow), 0 0 0 2px var(--accent); }
select.field { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
select.field option { color: #0a0e16; background: #fff; }
textarea.field { min-height: 190px; resize: vertical; line-height: 1.55; }
.field-label { display: block; margin: 0 0 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

.segmented { display: inline-flex; padding: 4px; border-radius: 999px; }
.segmented button { min-height: 38px; padding: 0 18px; border: 0; background: transparent; border-radius: 999px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--ink-3); transition: color 300ms var(--ease); }
.segmented button[aria-selected="true"] { color: var(--ink); }
.segmented.full { display: flex; } .segmented.full button { flex: 1; }
.segmented .n { margin-left: 7px; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 99px; background: var(--accent-fill); color: #fff; }

.progress { height: 6px; border-radius: 99px; overflow: hidden; }
.progress > div { position: relative; height: 100%; border-radius: inherit; width: 0; overflow: hidden;
  background: linear-gradient(90deg, var(--accent-fill), var(--accent)); box-shadow: 0 0 18px rgb(var(--accent-rgb) / 0.6); transition: width 900ms var(--ease); }
.progress > div::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.55), transparent); animation: hv-sheen 2.6s var(--ease) infinite; }
@keyframes hv-sheen { from { transform: translateX(-120%); } to { transform: translateX(320%); } }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 12px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--shimmer), transparent); animation: hv-shimmer 1.6s var(--ease) infinite; }
@keyframes hv-shimmer { to { transform: translateX(100%); } }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--danger); } .dot.off { background: var(--ink-3); }
.dot.live { box-shadow: 0 0 0 0 rgb(245 180 84 / 0.6); animation: hv-ping 1.6s ease-out infinite; }
@keyframes hv-ping { to { box-shadow: 0 0 0 9px rgb(245 180 84 / 0); } }

/* ================================================================== COQUE : menu, barre mobile, onglets */
.sidebar, .topbar, .tabbar { position: fixed; z-index: 30; }
.sidebar { display: none; top: 16px; bottom: 16px; left: 16px; width: 264px; padding: 20px 14px 14px; flex-direction: column; gap: 6px; }
.topbar { top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; height: 56px; padding: 0 10px 0 14px; display: flex; align-items: center; justify-content: space-between; border-radius: 999px; }
.tabbar { left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 28px), 380px); padding: 5px; display: flex; border-radius: 999px; }
.tabbar .tab { flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; text-decoration: none; color: var(--ink-3); font-weight: 600; font-size: 14px; transition: color 300ms var(--ease); }
.tabbar .tab[aria-current="page"] { color: var(--ink); }

.brand { display: flex; align-items: center; gap: 12px; }
.brand .tile { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 13px; font-size: 13px; font-weight: 700; letter-spacing: -0.02em; cursor: default; }
.brand .name { font-size: 15px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.15; }
.brand .sub { font-size: 11.5px; color: var(--ink-3); }
.sidebar .brand { padding: 4px 8px 18px; }
.sidebar .nav { display: flex; flex-direction: column; gap: 4px; }
.nav .item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 999px; text-decoration: none; color: var(--ink-3); font-weight: 600; font-size: 14.5px; transition: color 300ms var(--ease); }
.nav .item[aria-current="page"] { color: var(--ink); }
@media (hover: hover) { .nav .item:hover { color: var(--ink); } }
.nav .badge, .tabbar .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent-fill); box-shadow: 0 4px 12px -4px rgb(var(--accent-rgb) / 0.9); }
.tabbar .badge { margin-left: 0; min-width: 20px; height: 20px; font-size: 11px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 4px 0; }
.side-foot .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { max-width: 1120px; margin: 0 auto; padding: calc(84px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-left)) calc(116px + env(safe-area-inset-bottom)); }
.page { animation: hv-in 520ms var(--ease) backwards; }
/* fondu seulement : un transform sur la page deplacerait le repere des elements `fixed` (la feuille mobile) */
@keyframes hv-in { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .topbar, .tabbar { display: none; }
  .main { padding: 48px 40px 64px 304px; max-width: none; }
  .main > .wrap { max-width: 1120px; margin: 0 auto; }
}

/* ================================================================== TOASTS */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 28px), 440px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 28px; left: calc(50% + 140px); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 22px; font-size: 14px; font-weight: 550; animation: hv-toast 520ms var(--ease) both; }
.toast .ic { width: 20px; height: 20px; }
.toast.ok .ic { color: var(--ok); } .toast.err .ic { color: var(--danger); }
.toast.sortie { animation: hv-toast-out 300ms var(--ease) both; }
@keyframes hv-toast { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes hv-toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ================================================================== CONNEXION */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login .glass { width: min(100%, 400px); padding: 34px 28px 28px; }
.login .brand { flex-direction: column; text-align: center; gap: 14px; margin-bottom: 26px; }
.login .brand .tile { width: 58px; height: 58px; min-height: 58px; border-radius: 19px; font-size: 19px; }
.login h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; }
.login .err { margin-top: 14px; padding: 11px 14px; border-radius: 14px; font-size: 13.5px; color: var(--danger); background: rgb(var(--danger-rgb) / 0.12); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
