/* WeOpen — système de design de l'application (Claude Design, octobre 2026).
 *
 * Pourquoi un fichier de classes plutôt que Tailwind : le design repose sur des
 * jetons (variables CSS) qui basculent entre thème clair et sombre via
 * l'attribut data-theme de <html>. Les pages composent ces classes ; aucune
 * couleur ne doit être écrite en dur dans une page (sauf le module Chabbat,
 * qui a sa propre ambiance « soirée », classes ch-*).
 *
 * Inventaire (voir aussi js/components/ui.js et js/components/AppShell.js) :
 *   mise en page   .page .page--narrow .page--wide .stack(-sm|-lg) .row .row-between .grow .grid-cards .grid-2 .grid-auto
 *   texte          .h-hello .h-section .h-card .eyebrow .muted .ink2 .mono .small .danger-text .ok-text .truncate
 *   boutons        .btn + .btn-primary .btn-secondary .btn-danger .btn-danger-soft .btn-dashed .btn-ghost .btn-link .btn-sm .btn-block
 *                  .icon-btn (.icon-btn--soft .icon-btn--danger) .back-link
 *   formulaires    .field .label .input .select .textarea .input--mono .input--code .input-wrap (+ .input-eye) .hint .error-text
 *                  .switch[aria-checked] .seg (> button[aria-checked]) .chips (> .chip[aria-pressed]) .stepper
 *                  .check (case à cocher + libellé)
 *   surfaces       .card (.card--pad .card--inv .card--flush) .list (> .list-row / .list-item) .tile .stat
 *   statuts        .pill (.pill--info .pill--warn .pill--ok .pill--danger .pill--muted) .status-chip (.is-on) .dot (.dot--on)
 *   états          .empty .skel-card .skel .alert (.alert--danger .alert--ok .alert--info) .spinner
 *   ouverture      .slider (porte à glisser pour ouvrir, états via data-state)
 *   fenêtres       .sheet-root .sheet-scrim .sheet (.is-open) .toast-host .toast
 *   coque          .shell .drawer .scrim .topbar .content (AppShell.js)
 *   connexion      .auth .auth-hero .auth-main .auth-box .otp
 *   Chabbat        .ch .ch-card .ch-tile .ch-seg .ch-row .ch-stepper .ch-muted .ch-gold
 */

@font-face { font-family: 'Schibsted Grotesk'; src: url('../fonts/schibsted-grotesk-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Schibsted Grotesk'; src: url('../fonts/schibsted-grotesk-latin-ext.woff2') format('woff2'); font-weight: 400 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }

/* ── Jetons ───────────────────────────────────────────────────── */
:root, [data-theme=light] {
  --bg:#F3F0E8; --surface:#FBFAF6; --surface2:#EAE6DB; --ink:#121417; --ink2:#3E4248; --muted:#5B5F66;
  --line:rgba(18,20,23,.09); --line-strong:rgba(18,20,23,.2); --accent:#1FC36F; --accent-ink:#0E7A45; --ok-bg:#D5F3E1;
  --inv:#121417; --on-inv:#F3F0E8; --danger:#B4321A; --on-danger:#fff; --danger-bg:#F8E3DC; --warn:#8A5200; --warn-bg:#F7E7C6;
  --info:#2B57C9; --info-bg:#DFE7FA; --toggle-off:#CFC9BB; --overlay:rgba(18,20,23,.42); --skel:#E4DFD3;
  --mono:'IBM Plex Mono', ui-monospace, monospace; --ease:cubic-bezier(.2,.8,.2,1);
  color-scheme: light;
}
[data-theme=dark] {
  --bg:#0E1013; --surface:#171A1E; --surface2:#23272D; --ink:#F1EEE6; --ink2:#C9CCD1; --muted:#9A9EA5;
  --line:rgba(241,238,230,.08); --line-strong:rgba(241,238,230,.2); --accent:#1FC36F; --accent-ink:#4BD98C; --ok-bg:#12351F;
  --inv:#F1EEE6; --on-inv:#121417; --danger:#FF8A70; --on-danger:#2A0E07; --danger-bg:#3A1D16; --warn:#F2B661; --warn-bg:#3A2A10;
  --info:#8FB0FF; --info-bg:#1A2747; --toggle-off:#3A3F46; --overlay:rgba(0,0,0,.6); --skel:#23272D;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
input, select, textarea, button { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
::placeholder { color: var(--muted); opacity: 1; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@keyframes scrIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── Mise en page ─────────────────────────────────────────────── */
.page { width: 100%; max-width: 640px; margin: 0 auto; padding: 8px 16px 48px; display: flex; flex-direction: column; gap: 16px; animation: scrIn .32s var(--ease) backwards; }
.page--narrow { max-width: 720px; }
@media (min-width: 960px) { .page { max-width: 1100px; padding: 28px 40px 72px; } .page--narrow { max-width: 720px; } }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.scroll-x { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { flex: none; }
.pt-8 { padding-top: 8px; }

/* ── Texte ────────────────────────────────────────────────────── */
.h-hello { font-size: 32px; line-height: 1.05; letter-spacing: -0.04em; font-weight: 800; }
.h-page { font-size: 32px; letter-spacing: -0.04em; font-weight: 800; line-height: 1.05; }
.h-section { font-size: 20px; letter-spacing: -0.02em; font-weight: 800; }
.h-card { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink2); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
.lead { font-size: 16px; line-height: 1.5; color: var(--muted); }
.strong { font-weight: 700; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--accent-ink); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Boutons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 999px;
  border: 1.5px solid transparent; background: transparent; font-size: 16px; font-weight: 600; text-decoration: none; line-height: 1.15;
  transition: background .2s, transform .15s, opacity .2s; text-align: center; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .4; }
.btn-primary { background: var(--inv); color: var(--on-inv); font-weight: 700; min-height: 56px; font-size: 17px; }
.btn-primary:hover { color: var(--on-inv); }
.btn-secondary { border-color: var(--line-strong); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--surface2); color: var(--ink); }
.btn-danger { background: var(--danger); color: var(--on-danger); font-weight: 700; }
.btn-danger-soft { background: var(--danger-bg); color: var(--danger); font-weight: 700; }
.btn-dashed { border: 1.5px dashed var(--line-strong); font-weight: 700; }
.btn-dashed:hover:not(:disabled) { background: var(--surface2); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface2); }
.btn-link { min-height: 44px; padding: 0; border: none; background: none; font-weight: 600; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-xs { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { flex: none; width: 48px; height: 48px; border-radius: 14px; border: none; background: transparent; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; transition: background .2s; }
.icon-btn:hover:not(:disabled), .icon-btn:active { background: var(--surface2); }
.icon-btn--sm { width: 44px; height: 44px; border-radius: 12px; }
.icon-btn--soft { background: var(--surface2); }
.icon-btn--round { border-radius: 50%; }
.icon-btn--danger { color: var(--danger); }
.icon-btn--danger:hover { background: var(--danger-bg) !important; }
.back-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px 0 0; border: none; background: none; font-weight: 600; }

/* ── Formulaires ──────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.label { font-size: 14px; font-weight: 600; }
.input, .select, .textarea { width: 100%; min-width: 0; height: 52px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: 14px;
  background: var(--surface); color: var(--ink); font-size: 16px; transition: border-color .15s; }
.select { padding: 0 12px; }
.textarea { height: auto; min-height: 110px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: none; }
.input[aria-invalid=true], .select[aria-invalid=true] { border-color: var(--danger); }
.input:disabled, .select:disabled { opacity: .6; }
.input--lg { height: 54px; border-radius: 16px; font-size: 17px; }
.input--mono { font-family: var(--mono); letter-spacing: .04em; }
.input--code { height: 56px; font-family: var(--mono); font-size: 22px; letter-spacing: .2em; }
.on-bg .input, .on-bg .select, .on-bg .textarea, .card .input, .card .select, .card .textarea, .sheet .input, .sheet .select, .sheet .textarea { background: var(--bg); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 56px; }
.input-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: none; background: transparent;
  border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }
.error-text { font-size: 13px; color: var(--danger); font-weight: 600; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: var(--ink2); min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--inv); flex: none; }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 46px; border-radius: 999px; }

/* Interrupteur : <button class="switch" role="switch" aria-checked="true|false"><span/></button> */
.switch { flex: none; width: 52px; height: 32px; border-radius: 999px; border: none; padding: 3px; background: var(--toggle-off); transition: background .2s; display: flex; }
.switch > span { display: block; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true] > span { transform: translateX(20px); }
.switch:disabled { opacity: .45; }

/* Sélecteur segmenté : <div class="seg" role="radiogroup"><button role="radio" aria-checked> */
.seg { display: flex; background: var(--surface2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg > button { flex: 1; min-height: 44px; border: none; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; padding: 0 8px; transition: background .2s, color .2s; }
.seg > button[aria-checked=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.14); }
.seg--sm > button { min-height: 40px; }

/* Puces / filtres : <button class="chip" aria-pressed> */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: transparent; color: var(--ink);
  font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip--lg { min-height: 44px; padding: 0 16px; font-size: 15px; }
.chip[aria-pressed=true], .chip[aria-selected=true] { background: var(--inv); border-color: var(--inv); color: var(--on-inv); }

/* Compteur −/+ */
.stepper { display: flex; align-items: center; gap: 4px; background: var(--surface2); border-radius: 999px; padding: 3px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface); font-size: 20px; }
.stepper span { min-width: 64px; text-align: center; font-family: var(--mono); font-size: 15px; }

/* ── Surfaces ─────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.card--pad { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.card--door { border-radius: 26px; padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.card--inv { background: var(--inv); color: var(--on-inv); border-color: transparent; }
.card--flush { overflow: hidden; }
.card--dashed { background: transparent; border: 1.5px dashed var(--line-strong); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.list-row { width: 100%; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border: none; border-bottom: 1px solid var(--line);
  background: transparent; text-align: left; color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: none; }
button.list-row:hover, a.list-row:hover { background: var(--surface2); color: inherit; }
.list-row--tall { min-height: 76px; }
.list-add { width: 100%; min-height: 56px; border: none; border-top: 1px solid var(--line); background: transparent; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.list-add:first-child { border-top: none; }
.list-add:hover { background: var(--surface2); }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  text-align: left; color: inherit; text-decoration: none; min-height: 76px; width: 100%; }
button.tile:hover, a.tile:hover { border-color: var(--line-strong); color: inherit; }
.tile-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; background: var(--surface2); display: flex; align-items: center; justify-content: center; }
.tile-icon--sm { width: 42px; height: 42px; border-radius: 12px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.avatar--inv { background: var(--inv); color: var(--on-inv); }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; font-weight: 800; }
.stat { padding: 12px 14px; border-radius: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat > span:first-child { font-size: 12px; color: var(--muted); }
.stat > span:last-child { font-size: 14px; font-weight: 600; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg); }

/* ── Statuts ──────────────────────────────────────────────────── */
.pill { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface2); color: var(--ink2); white-space: nowrap; }
.pill--info { background: var(--info-bg); color: var(--info); }
.pill--warn { background: var(--warn-bg); color: var(--warn); }
.pill--ok { background: var(--ok-bg); color: var(--accent-ink); }
.pill--danger { background: var(--danger-bg); color: var(--danger); }
.pill--muted { color: var(--muted); }
.pill--plain { font-weight: 600; }
.status-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 999px; background: var(--surface2); }
.status-chip.is-on { color: var(--accent-ink); }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot--lg { width: 10px; height: 10px; }
.dot--on { background: var(--accent); }

/* ── États ────────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 48px 20px; border: 1.5px dashed var(--line-strong); border-radius: 28px; }
.empty--plain { border: none; }
.empty-icon { width: 72px; height: 72px; border-radius: 24px; background: var(--surface2); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.empty h3 { font-size: 21px; letter-spacing: -0.02em; }
.empty p { font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 22em; }
.skel-card { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 18px; display: flex; flex-direction: column; gap: 16px; animation: pulse 1.4s ease-in-out infinite; }
.skel { background: var(--skel); border-radius: 7px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; font-size: 15px; line-height: 1.45; font-weight: 600; background: var(--surface2); }
.alert--danger { background: var(--danger-bg); color: var(--danger); }
.alert--ok { background: var(--ok-bg); color: var(--accent-ink); }
.alert--info { background: var(--info-bg); color: var(--info); }
.alert--warn { background: var(--warn-bg); color: var(--warn); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; color: var(--muted); }

/* ── Glisser pour ouvrir ─────────────────────────────────────── */
.slider { position: relative; height: 64px; border-radius: 999px; background: var(--surface2); overflow: hidden; user-select: none; -webkit-user-select: none; transition: background .3s; }
.slider-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 999px; }
.slider-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 66px; font-size: 16px; font-weight: 600;
  color: var(--muted); text-align: center; line-height: 1.2; pointer-events: none; }
.slider-knob { position: absolute; top: 4px; left: 4px; width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--inv); color: var(--on-inv);
  display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.slider.is-animated .slider-knob { transition: left .4s var(--ease), background .3s; }
.slider.is-animated .slider-fill { transition: width .4s var(--ease); }
.slider[data-state=sending], .slider[data-state=sent] { background: var(--accent); }
.slider[data-state=sending] .slider-label, .slider[data-state=sent] .slider-label { color: #0B2A18; }
.slider[data-state=sending] .slider-knob { left: calc(100% - 60px); background: #0B2A18; color: #1FC36F; cursor: default; }
.slider[data-state=sending] .slider-knob svg { animation: spin .8s linear infinite; }
.slider[data-state=sent] .slider-knob { left: calc(100% - 60px); background: #fff; color: #0E7A45; cursor: default; }
.slider[data-state=error] { background: var(--danger-bg); }
.slider[data-state=error] .slider-label { color: var(--danger); }
.slider[data-state=error] .slider-knob { background: var(--danger); color: var(--on-danger); cursor: pointer; }
.slider[data-state=disabled] { opacity: .6; }
.slider[data-state=disabled] .slider-knob { background: var(--toggle-off); color: var(--muted); cursor: not-allowed; }

/* ── Fenêtres (bottom sheet sur mobile, modale centrée sur ordinateur) ── */
.sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet-root.is-open { pointer-events: auto; }
.sheet-scrim { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity .3s; }
.sheet-root.is-open .sheet-scrim { opacity: 1; }
.sheet-pos { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.sheet { pointer-events: auto; width: 100%; max-height: 90%; overflow-y: auto; background: var(--surface); border-radius: 28px 28px 0 0;
  transform: translateY(105%); transition: transform .36s var(--ease), opacity .25s; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px; box-shadow: 0 -10px 40px rgba(0,0,0,.18); overscroll-behavior: contain; }
.sheet-root.is-open .sheet { transform: none; }
.sheet-grabber { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin-bottom: -4px; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head h2 { flex: 1; font-size: 22px; letter-spacing: -0.025em; font-weight: 800; line-height: 1.15; }
.sheet-close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface2); display: flex; align-items: center; justify-content: center; }
@media (min-width: 960px) {
  .sheet-pos { align-items: center; padding: 24px; }
  .sheet { max-width: 520px; border-radius: 28px; transform: translateY(16px) scale(.98); opacity: 0; padding: 24px 28px 28px; }
  .sheet--wide { max-width: 720px; }
  .sheet-root.is-open .sheet { opacity: 1; }
  .sheet-grabber { display: none; }
}
.confirm-body { display: flex; gap: 14px; align-items: flex-start; }
.confirm-icon { flex: none; width: 48px; height: 48px; border-radius: 16px; background: var(--danger-bg); color: var(--danger); display: flex; align-items: center; justify-content: center; }
.confirm-body p { font-size: 16px; line-height: 1.5; color: var(--ink2); }

.toast-host { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 160%); opacity: 0;
  transition: transform .4s var(--ease), opacity .3s; pointer-events: none; max-width: calc(100% - 32px); }
.toast-host.is-on { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 960px) { .toast-host { bottom: 28px; } }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 18px 14px 14px; border-radius: 18px; background: var(--inv); color: var(--on-inv);
  font-weight: 600; font-size: 15px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.toast-badge { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #1FC36F; color: #0B2A18; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.toast--error { background: var(--danger-bg); color: var(--danger); }
.toast--error .toast-badge { background: var(--danger); color: var(--on-danger); }

/* ── Coque de l'application ───────────────────────────────────── */
.shell { position: relative; display: flex; min-height: 100vh; min-height: 100dvh; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 41; width: min(86%, 320px); transform: translateX(-104%); visibility: hidden;
  transition: transform .34s var(--ease), visibility 0s linear .34s; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px; padding: calc(20px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; }
.drawer.is-open { transform: none; visibility: visible; transition: transform .34s var(--ease), visibility 0s; box-shadow: 0 0 50px rgba(0,0,0,.28); }
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; font-weight: 800; font-size: 21px; letter-spacing: -0.035em; }
.drawer-me { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface2); }
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-item { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 14px; border: none; border-radius: 14px; background: transparent;
  font-size: 16px; font-weight: 500; text-align: left; color: var(--ink); text-decoration: none; }
.drawer-item:hover { background: var(--surface2); color: var(--ink); }
.drawer-item[aria-current=page] { background: var(--surface2); font-weight: 700; }
.drawer-item--danger { color: var(--danger); font-weight: 600; }
.drawer-item--danger:hover { background: var(--danger-bg); color: var(--danger); }
.drawer-section { padding: 0 14px 6px; }
.drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.drawer-setting { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.drawer-setting > span { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; flex: none; height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  display: flex; align-items: center; gap: 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.topbar-action { flex: none; min-height: 44px; padding: 0 18px; border-radius: 999px; border: none; background: var(--inv); color: var(--on-inv); font-weight: 700; font-size: 15px; margin-right: 4px; }
.content { flex: 1; min-height: 0; }
@media (min-width: 960px) {
  .drawer { position: sticky; top: 0; height: 100vh; width: 280px; transform: none; visibility: visible; box-shadow: none !important; transition: none; flex: none; }
  .scrim, .burger { display: none !important; }
  .topbar { padding: 0 32px; }
  .topbar h1 { font-size: 24px; }
  .topbar--sub h1 { font-size: 19px; }
}

/* ── Écrans de connexion ──────────────────────────────────────── */
.auth { display: flex; min-height: 100vh; min-height: 100dvh; }
.auth-hero { display: none; }
.auth-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.auth-box { width: 100%; max-width: 440px; margin: auto; padding: calc(32px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 28px; animation: scrIn .32s var(--ease) backwards; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 24px; letter-spacing: -0.035em; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-title { display: flex; flex-direction: column; gap: 6px; }
.auth-title h1 { font-size: 32px; letter-spacing: -0.04em; font-weight: 800; line-height: 1.05; }
.auth-title p { font-size: 16px; line-height: 1.5; color: var(--muted); }
.auth-alt { font-size: 15px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: center; }
@media (min-width: 960px) {
  .auth-hero { flex: 1; max-width: 560px; background: #121417; color: #F3F0E8; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
  .auth-hero p { position: relative; font-size: 40px; line-height: 1.02; letter-spacing: -0.04em; font-weight: 800; max-width: 9em; }
  .auth-hero-mark { position: absolute; right: -120px; top: 50%; transform: translateY(-50%); width: 520px; height: 520px; opacity: .9; }
  .auth-box .auth-brand { display: none; }
}
.otp { position: relative; display: block; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-boxes > div { height: 60px; border-radius: 14px; border: 1.5px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 26px; font-weight: 500; }
.otp-boxes > div.is-active { border-color: var(--ink); }
.otp input { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; cursor: text; }
.pw-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pw-rules li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pw-rules li.is-ok { color: var(--accent-ink); }

/* ── Module Chabbat (ambiance « soirée », identique en thème clair et sombre) ── */
.ch { position: relative; overflow: hidden; background: #17192F; color: #EDEAF7; border-radius: 28px; padding: 20px 18px 22px; display: flex; flex-direction: column; gap: 18px; animation: scrIn .28s backwards; }
.ch-stars { position: absolute; right: 28px; top: 22px; width: 3px; height: 3px; border-radius: 50%; background: #F2B661;
  box-shadow: -40px 18px 0 -0.5px rgba(237,234,247,.45), -14px 46px 0 -1px rgba(237,234,247,.3), -70px 6px 0 -1px rgba(237,234,247,.25); pointer-events: none; }
.ch-icon { flex: none; width: 48px; height: 48px; border-radius: 16px; background: rgba(242,182,97,.14); display: flex; align-items: center; justify-content: center; color: #F2B661; }
.ch-muted { color: #B9B6D3; }
.ch-gold { color: #F2B661; }
.ch-card { padding: 14px 16px; border-radius: 16px; background: #1E2140; border: 1px solid rgba(237,234,247,.1); }
.ch-list { border-radius: 16px; background: #1E2140; overflow: hidden; }
.ch-row { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; border-bottom: 1px solid rgba(237,234,247,.1); }
.ch-row:last-child { border-bottom: none; }
.ch-tile { padding: 12px 14px; border-radius: 14px; background: #22254A; display: flex; flex-direction: column; gap: 2px; }
.ch-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(237,234,247,.12); border-radius: 18px; overflow: hidden; }
.ch-grid2 > div { background: #1E2140; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.ch-seg { display: flex; background: #22254A; border-radius: 14px; padding: 4px; gap: 4px; overflow-x: auto; }
.ch-seg > button { flex: 1; min-height: 44px; border: none; border-radius: 10px; background: transparent; color: #B9B6D3; font-weight: 600; font-size: 14px; padding: 0 10px; white-space: nowrap; }
.ch-seg > button[aria-checked=true] { background: #EDEAF7; color: #17192F; }
.ch .chip { border-color: rgba(237,234,247,.3); color: #EDEAF7; }
.ch .chip[aria-pressed=true], .ch .chip[aria-selected=true] { background: #EDEAF7; border-color: #EDEAF7; color: #17192F; }
.ch-stepper { display: flex; align-items: center; gap: 4px; background: #22254A; border-radius: 999px; padding: 3px; }
.ch-stepper button { width: 44px; height: 44px; border-radius: 50%; border: none; background: #2C2F5A; color: #EDEAF7; font-size: 20px; }
.ch-stepper span { min-width: 64px; text-align: center; font-family: var(--mono); }
.ch .btn-dashed { border-color: rgba(237,234,247,.3); color: #EDEAF7; }
.ch .btn-dashed:hover { background: rgba(237,234,247,.06); }
.ch .btn-primary { background: #EDEAF7; color: #17192F; }
.ch .input, .ch .select, .ch .textarea { background: #22254A; border-color: rgba(237,234,247,.2); color: #EDEAF7; color-scheme: dark; }
.ch .input:focus, .ch .select:focus { border-color: #EDEAF7; }
.ch .label, .ch .h-card { color: #EDEAF7; }
.ch .hint, .ch .muted { color: #B9B6D3; }
.ch .switch[aria-checked=false] { background: #3A3F66; }
.ch-entry { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 22px;
  border: 2px solid transparent; background: #17192F; color: #EDEAF7; text-align: left; min-height: 112px; }
.ch-entry[aria-pressed=true] { border-color: #F2B661; }
.mod-entry { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-align: left; min-height: 112px; transition: background .25s; }
.mod-entry[aria-pressed=true] { background: var(--inv); color: var(--on-inv); }
.mod-entry .small { opacity: .75; }

/* Barres de plages horaires (0–24 h) */
.week { display: flex; flex-direction: column; gap: 7px; }
.week-row { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; }
.week-row > span { font-size: 13px; font-weight: 600; color: var(--ink2); }
.week-bar { position: relative; height: 26px; background: var(--surface2); border-radius: 8px; overflow: hidden; }
.week-bar > div { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 6px; }
.week-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* Tableau de bureau (commandes) */
.table { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.table-head, .table-row { display: grid; gap: 16px; padding: 14px 20px; align-items: center; border-bottom: 1px solid var(--line); }
.table-head { font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table-row:last-child { border-bottom: none; }
.only-desk { display: none !important; }
@media (min-width: 960px) { .only-desk { display: revert !important; } .only-mob { display: none !important; } }
