/* ==========================================================================
   Backstage — direction : coulisses de salle de concert.
   Nuit aubergine, une poursuite ambrée, des billets à talon, des laminates de tournée.
   ========================================================================== */

/* Polices auto-hébergées (OFL) : Bricolage Grotesque (graisse + largeur variables) et Figtree */
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-display: swap;
  font-weight: 200 800; font-stretch: 75% 100%;
  src: url(../fonts/bricolage-latin.woff2) format('woff2');
  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: 'Bricolage Grotesque'; font-style: normal; font-display: swap;
  font-weight: 200 800; font-stretch: 75% 100%;
  src: url(../fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree'; font-style: normal; font-display: swap;
  font-weight: 300 900;
  src: url(../fonts/figtree-latin.woff2) format('woff2');
  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: 'Figtree'; font-style: normal; font-display: swap;
  font-weight: 300 900;
  src: url(../fonts/figtree-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #120f1c;
  --surface: #1a1628;
  --raise: #231d35;
  --raise-2: #2c2542;
  --line: rgba(236, 228, 255, 0.08);
  --line-strong: rgba(236, 228, 255, 0.16);
  --text: #f3eefc;
  --muted: #a69cbd;
  --faint: #6f6687;
  --amber: #ffcf6e;
  --ok: #5fe3a1;
  --danger: #ff5a6e;

  --display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 9px;
  --stub: 96px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
code { font-size: .9em; padding: .1em .4em; border-radius: 6px; background: var(--raise); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* La poursuite : une seule lumière de scène, fixe, derrière tout */
.stage-light {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 70vh at 18% -12%, rgba(255, 207, 110, 0.16), transparent 70%),
    radial-gradient(50vw 60vh at 100% 0%, rgba(255, 79, 139, 0.10), transparent 70%),
    radial-gradient(70vw 50vh at 50% 120%, rgba(124, 108, 255, 0.10), transparent 70%),
    var(--bg);
}

/* ---------- Typo de marque ---------- */
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 75%;
  font-variation-settings: 'wdth' 75, 'opsz' 96;
  letter-spacing: -0.02em;
  line-height: .9;
  text-decoration: none;
  background: linear-gradient(100deg, #fff3d6 0%, var(--amber) 40%, #ff7aa8 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.wordmark--small { font-size: 30px; }

/* ---------- Pastille projet (laminate) ---------- */
.pill {
  --p: var(--amber);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font: 700 13px/1.2 var(--display);
  font-variation-settings: 'wdth' 85;
  letter-spacing: .01em;
  color: color-mix(in oklab, var(--p) 55%, white);
  background: color-mix(in oklab, var(--p) 16%, transparent);
  border: 1px solid color-mix(in oklab, var(--p) 45%, transparent);
  white-space: nowrap;
}
.pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--p);
  box-shadow: 0 0 10px 1px var(--p);
}

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 6px;
  font: 600 12px/1.3 var(--body);
}
.tag--cancel { color: #ffd0d6; background: rgba(255, 90, 110, .18); border: 1px solid rgba(255, 90, 110, .4); }

/* ---------- Boutons icône ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  transition: color .2s, background .2s, border-color .2s;
  text-decoration: none;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .07); border-color: var(--line-strong); }
.icon-btn--sm { width: 34px; height: 34px; border-radius: 10px; }
.icon-btn--danger:hover, .icon-btn.is-confirm { color: #fff; background: var(--danger); border-color: var(--danger); }
.icon-btn.is-spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Login
   ========================================================================== */
.login-page { display: grid; place-items: center; padding: 24px; }

.login { width: 100%; max-width: 400px; perspective: 900px; }

.laminate {
  position: relative;
  padding: 58px 32px 32px;
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(255, 207, 110, .10), transparent 40%),
    linear-gradient(180deg, var(--raise), var(--surface));
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: rotate(-1.5deg);
  animation: swing 1.4s var(--ease) both;
  transform-origin: 50% -40px;
}
@keyframes swing {
  0% { transform: rotate(6deg) translateY(-18px); opacity: 0; }
  55% { transform: rotate(-3deg); opacity: 1; }
  100% { transform: rotate(-1.5deg); }
}
.laminate-hole {
  position: absolute; top: 18px; left: 50%; translate: -50% 0;
  width: 58px; height: 12px; border-radius: 99px;
  background: var(--bg);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6);
}
.laminate-kicker {
  margin: 0 0 6px;
  font: 600 14px/1 var(--body);
  color: var(--amber);
}
.laminate .wordmark { font-size: clamp(64px, 18vw, 92px); }
.login-sub { margin: 14px 0 28px; color: var(--muted); font-size: 15px; max-width: 30ch; }

.pw-field {
  display: flex; align-items: center;
  padding: 6px 6px 6px 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line-strong);
  transition: border-color .2s, box-shadow .2s;
}
.pw-field:focus-within { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255, 207, 110, .14); }
.pw-field input {
  flex: 1; min-width: 0; height: 44px;
  background: none; border: 0; outline: none;
  font-size: 17px; letter-spacing: .04em;
}
.pw-field input::placeholder { color: var(--faint); letter-spacing: 0; }
.pw-go {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  color: #241a05;
  background: linear-gradient(135deg, #ffe1a1, var(--amber));
  transition: transform .2s var(--ease), filter .2s;
}
.pw-go:hover { transform: translateX(2px); filter: brightness(1.06); }
.is-loading .pw-go { opacity: .6; pointer-events: none; }
.login-error { min-height: 22px; margin: 12px 4px 0; color: #ff9aa8; font-size: 14px; }

.laminate.is-denied { animation: deny .45s; }
@keyframes deny {
  20%, 60% { transform: rotate(-1.5deg) translateX(-9px); }
  40%, 80% { transform: rotate(-1.5deg) translateX(9px); }
}
.laminate.is-granted { border-color: var(--ok); box-shadow: 0 0 0 4px rgba(95, 227, 161, .2), 0 40px 80px -30px rgba(0, 0, 0, .7); }

/* ==========================================================================
   App
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(20px, calc((100vw - 1080px) / 2));
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar-actions { display: flex; gap: 8px; }

.shell { max-width: 1080px; margin: 0 auto; padding: 28px 20px 96px; }

/* ---------- Hero : le prochain concert sous la poursuite ---------- */
.hero { margin-bottom: 36px; }

.hero-card {
  --p: var(--amber);
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px;
  width: 100%; text-align: left;
  padding: 34px 36px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--raise), var(--surface));
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 70px -40px color-mix(in oklab, var(--p) 60%, black);
  transition: border-color .3s;
}
.hero-card:hover { border-color: color-mix(in oklab, var(--p) 50%, transparent); }

/* Le faisceau : un cône de lumière qui balaie une seule fois à l'arrivée */
.hero-beam {
  position: absolute; z-index: -1; inset: -40% -10% -10% 30%;
  background: conic-gradient(from 200deg at 85% 0%, transparent 0deg,
    color-mix(in oklab, var(--p) 34%, transparent) 18deg, transparent 46deg);
  filter: blur(18px);
  transform-origin: 85% 0%;
  animation: sweep 1.8s var(--ease) .15s both;
}
@keyframes sweep {
  from { transform: rotate(-38deg); opacity: 0; }
  to { transform: rotate(0); opacity: 1; }
}

.hero-main { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.hero-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: 'wdth' 80, 'opsz' 96;
  font-size: clamp(34px, 6vw, 60px);
  line-height: .95;
  letter-spacing: -0.025em;
  text-wrap: balance;
  max-width: 18ch;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 16px; }
.hero-loc { display: inline-flex; align-items: center; gap: 6px; }
.hero-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 8px; }
.hero-todo { color: var(--muted); font-size: 14px; }

.hero-count { display: flex; flex-direction: column; align-items: flex-end; line-height: .8; }
.hero-num {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: 'wdth' 75, 'opsz' 96;
  font-size: clamp(96px, 16vw, 180px);
  letter-spacing: -0.05em;
  color: transparent;
  background: linear-gradient(180deg, #fff 10%, color-mix(in oklab, var(--p) 80%, white) 100%);
  -webkit-background-clip: text; background-clip: text;
  font-variant-numeric: tabular-nums;
}
.hero-unit { margin-top: 10px; font-size: 15px; font-weight: 600; color: var(--muted); }

.hero-empty { padding: 34px 0 6px; }
.hero-empty .hero-title { display: block; margin: 8px 0 12px; }
.hero-hint { color: var(--muted); max-width: 60ch; margin: 0; }

/* ---------- Étapes de checklist (barrettes) ---------- */
.steps { display: inline-flex; gap: 4px; }
.steps i {
  width: 14px; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  transition: background .3s, box-shadow .3s;
}
.steps i.on { background: var(--ok); box-shadow: 0 0 8px rgba(95, 227, 161, .55); }
.steps--lg i { width: 26px; height: 6px; }

/* ---------- Alertes ---------- */
.warnings:empty { display: none; }
.warnings { display: grid; gap: 8px; margin-bottom: 24px; }
.warning {
  margin: 0; padding: 12px 16px; border-radius: var(--r-md);
  background: rgba(255, 90, 110, .1); border: 1px solid rgba(255, 90, 110, .3);
  color: #ffd0d6; font-size: 14px;
}

/* ---------- Barre de filtres ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 10px;
}
.segmented {
  display: inline-flex; padding: 4px; gap: 2px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--line);
}
.segmented button {
  padding: 8px 14px; border-radius: 10px;
  font-weight: 600; font-size: 14px; color: var(--muted);
  transition: color .2s, background .2s;
}
.segmented button[aria-selected="true"] { color: #241a05; background: var(--amber); }
.segmented button:not([aria-selected="true"]):hover { color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  --p: var(--amber);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px;
  font: 700 13px/1.2 var(--display); font-variation-settings: 'wdth' 85;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: all .2s;
}
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--p); opacity: .6; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-on {
  color: color-mix(in oklab, var(--p) 55%, white);
  background: color-mix(in oklab, var(--p) 16%, transparent);
  border-color: color-mix(in oklab, var(--p) 50%, transparent);
}
.chip.is-on .chip-dot { opacity: 1; box-shadow: 0 0 10px var(--p); }

.search {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto; padding: 0 14px;
  height: 42px; min-width: 220px;
  border-radius: 14px;
  color: var(--faint);
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--amber); color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 15px; }
.search input::placeholder { color: var(--faint); }

/* ---------- Liste : mois + billets ---------- */
.month {
  margin: 34px 0 14px;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: 'wdth' 85;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.month-list { display: grid; gap: 12px; }

.empty { padding: 48px 0; color: var(--muted); text-align: center; }

.ticket {
  --p: var(--amber);
  position: relative;
  display: grid;
  grid-template-columns: var(--stub) 1fr auto;
  align-items: stretch;
  min-height: 112px;
  border-radius: 18px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--p) 7%, var(--surface)), var(--surface) 55%);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background .25s, box-shadow .25s, transform .25s var(--ease);
  /* Encoches de perforation entre le talon et le billet */
  -webkit-mask:
    radial-gradient(circle at var(--stub) 0, #0000 10px, #000 10.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at var(--stub) 100%, #0000 10px, #000 10.5px) bottom / 100% 51% no-repeat;
          mask:
    radial-gradient(circle at var(--stub) 0, #0000 10px, #000 10.5px) top / 100% 51% no-repeat,
    radial-gradient(circle at var(--stub) 100%, #0000 10px, #000 10.5px) bottom / 100% 51% no-repeat;
}
.ticket:hover {
  background: linear-gradient(90deg, color-mix(in oklab, var(--p) 13%, var(--raise)), var(--raise) 60%);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--p) 35%, transparent);
}
.ticket:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--amber); }

.ticket-stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  border-right: 2px dashed color-mix(in oklab, var(--p) 30%, transparent);
  color: color-mix(in oklab, var(--p) 45%, white);
}
.stub-wd, .stub-mon { font-size: 13px; font-weight: 600; text-transform: lowercase; color: var(--muted); }
.stub-day {
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: 'wdth' 75, 'opsz' 96;
  font-size: 46px;
  line-height: .9;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stub-day small { font-size: 22px; letter-spacing: -0.02em; opacity: .7; }

.ticket-body { min-width: 0; padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.ticket-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-rel { font-size: 13px; color: var(--faint); font-weight: 500; }
.ticket-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: 'wdth' 90;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticket-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 14px; }
.ticket-meta > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ticket-meta svg { flex: none; opacity: .75; }
.ticket-loc { max-width: min(100%, 52ch); }
.ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ticket-side {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 12px;
  padding: 16px 22px 16px 8px;
}
.ticket-counts { display: flex; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; min-height: 15px; }
.ticket-counts span { display: inline-flex; align-items: center; gap: 4px; }

.ticket.is-past { opacity: .62; }
.ticket.is-past:hover { opacity: 1; }
.ticket.is-cancelled .ticket-title { text-decoration: line-through; text-decoration-color: rgba(255, 90, 110, .7); }
.ticket.is-complete .ticket-stub { color: var(--ok); }

/* Dépôt de fichier sur un billet */
.ticket-drop {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border-radius: inherit;
  font-weight: 700;
  color: color-mix(in oklab, var(--p) 40%, white);
  background: color-mix(in oklab, var(--p) 22%, rgba(18, 15, 28, .9));
  box-shadow: inset 0 0 0 2px var(--p);
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.ticket.is-drop .ticket-drop { opacity: 1; }

/* ==========================================================================
   Panneau de détail
   ========================================================================== */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8, 6, 14, .55);
  backdrop-filter: blur(3px);
  animation: fade .25s both;
}
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(640px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  box-shadow: -40px 0 80px -20px rgba(0, 0, 0, .6);
  transform: translateX(104%);
  transition: transform .45s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer.is-open { transform: none; }

.drawer-loading { display: grid; place-items: center; height: 60vh; }
.drawer-loading span {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--amber);
  animation: spin .8s linear infinite;
}

.d-head {
  --p: var(--amber);
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 30px 32px 28px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--p) 26%, transparent), transparent 60%),
    linear-gradient(180deg, var(--raise), var(--surface));
  border-bottom: 1px solid var(--line);
}
.drawer-close { position: absolute; top: 20px; right: 20px; }
.d-title {
  margin: 4px 48px 0 0;
  font-family: var(--display);
  font-weight: 800;
  font-variation-settings: 'wdth' 80, 'opsz' 96;
  font-size: clamp(30px, 5vw, 42px);
  line-height: .98;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.d-date { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 600; }
.d-date span { color: var(--muted); font-weight: 500; }
.d-loc {
  display: inline-flex; align-items: flex-start; gap: 8px;
  color: var(--muted); text-decoration: none; font-size: 15px;
  white-space: pre-line;
}
.d-loc:hover { color: var(--text); }
.d-loc svg { flex: none; margin-top: 3px; }
.d-desc { width: 100%; color: var(--muted); font-size: 14px; }
.d-desc summary { cursor: pointer; color: var(--faint); font-weight: 600; }
.d-desc summary:hover { color: var(--muted); }
.d-desc p { margin: 10px 0 0; white-space: pre-wrap; max-width: 70ch; }

.d-section { padding: 26px 32px; border-bottom: 1px solid var(--line); }
.d-section:last-child { border-bottom: 0; padding-bottom: 48px; }
.d-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.d-section h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-variation-settings: 'wdth' 85;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.d-count { color: var(--faint); font-weight: 700; font-variant-numeric: tabular-nums; }
.d-count.is-done { color: var(--ok); }
.d-save { font-size: 13px; color: var(--faint); }
.d-empty { margin: 0; color: var(--faint); font-size: 14px; }

/* Progression */
.progress { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-bottom: 14px; }
.progress span {
  display: block; height: 100%;
  width: calc(var(--v) * 100%);
  background: linear-gradient(90deg, var(--amber), var(--ok));
  border-radius: inherit;
  transition: width .5s var(--ease);
}

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.check {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 12px 14px;
  border-radius: var(--r-md);
  text-align: left;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
  transition: background .2s, border-color .2s;
}
.check:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-strong); }
.check-box {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--line-strong);
  color: transparent;
  transition: all .25s var(--ease);
}
.check-label { flex: 1; font-weight: 600; }
.check-date { font-size: 13px; color: var(--faint); }
.check.is-done { background: rgba(95, 227, 161, .06); border-color: rgba(95, 227, 161, .25); }
.check.is-done .check-box {
  border-color: var(--ok); background: var(--ok); color: #0c2a1b;
  box-shadow: 0 0 14px rgba(95, 227, 161, .45);
  animation: pop .35s var(--ease);
}
.check.is-done .check-label { color: #d9fbe9; }
@keyframes pop { 50% { transform: scale(1.18); } }

/* Zone de dépôt */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 26px 20px;
  border-radius: 18px;
  border: 1.5px dashed var(--line-strong);
  background: rgba(0, 0, 0, .18);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.dropzone:hover { border-color: color-mix(in oklab, var(--p, var(--amber)) 60%, transparent); color: var(--text); }
.dropzone:focus-within { outline: 2px solid var(--amber); outline-offset: 3px; }
.dropzone.is-over {
  border-color: var(--p, var(--amber));
  border-style: solid;
  background: color-mix(in oklab, var(--p, var(--amber)) 12%, transparent);
  color: var(--text);
  transform: scale(1.01);
}
.dz-title { font-weight: 700; color: var(--text); margin-top: 4px; }
.dz-sub { font-size: 13px; max-width: 46ch; }

/* Envois en cours */
.uploads { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.uploads:not(:empty) { margin-top: 12px; }
.upload { display: grid; grid-template-columns: 1fr 120px 48px; align-items: center; gap: 12px; font-size: 14px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.upload-bar span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .15s; }
.upload-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Liste de fichiers */
.files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.file {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 10px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--line);
}
.file:hover { border-color: var(--line-strong); }
.badge {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 11px;
  font: 800 11px/1 var(--display); font-variation-settings: 'wdth' 80;
  letter-spacing: .03em;
  color: #fff;
  background: #3a3350;
}
.badge--pdf { background: linear-gradient(135deg, #ff6b6b, #c7354a); }
.badge--doc { background: linear-gradient(135deg, #5b9dff, #2f5fd0); }
.badge--xls { background: linear-gradient(135deg, #4fd18b, #1f8f57); }
.badge--ppt { background: linear-gradient(135deg, #ffa25b, #d9632a); }
.badge--audio { background: linear-gradient(135deg, #b77cff, #7442d6); }
.badge--video { background: linear-gradient(135deg, #ff7ac3, #c43a8a); }
.badge--zip { background: linear-gradient(135deg, #a7a0b8, #6b6480); }
.badge--txt { background: linear-gradient(135deg, #8d86a3, #57506c); }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; gap: 2px; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main:hover .file-name { color: var(--amber); }
.file-meta { font-size: 13px; color: var(--faint); }
.file-actions { display: flex; gap: 4px; flex: none; }
.file-rename {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--amber);
  background: rgba(0, 0, 0, .3); outline: none;
}

/* Galerie */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--raise); }
.thumb-open { display: block; width: 100%; height: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease), filter .3s; }
.thumb-open:hover img { transform: scale(1.06); filter: brightness(1.08); }
.thumb-del {
  position: absolute; top: 6px; right: 6px;
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  color: #fff; background: rgba(10, 8, 18, .7);
  backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s, background .2s;
}
.thumb:hover .thumb-del, .thumb-del:focus-visible, .thumb-del.is-confirm { opacity: 1; }
.thumb-del:hover, .thumb-del.is-confirm { background: var(--danger); }

/* Notes */
.notes {
  width: 100%; resize: vertical; min-height: 120px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  line-height: 1.6;
  outline: none;
}
.notes:focus { border-color: var(--amber); }
.notes::placeholder { color: var(--faint); }

/* ==========================================================================
   Visionneuse
   ========================================================================== */
.viewer {
  position: fixed; inset: 0; z-index: 80;
  display: grid; grid-template-rows: auto 1fr;
  background: rgba(8, 6, 14, .94);
  backdrop-filter: blur(10px);
  animation: fade .2s both;
}
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; }
.viewer-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 8px; }
.viewer-body { display: grid; place-items: center; padding: 0 72px 28px; min-height: 0; }
.viewer-body img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.viewer-body iframe { width: min(1000px, 100%); height: calc(100vh - 110px); border: 0; border-radius: 10px; background: #fff; }
.viewer-body video { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 10px; }
.viewer-body audio { width: min(520px, 100%); }
.viewer-nav {
  position: absolute; top: 50%; translate: 0 -50%;
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  color: var(--text); background: rgba(255, 255, 255, .08);
}
.viewer-nav:hover { background: rgba(255, 255, 255, .16); }
.viewer-nav--prev { left: 12px; }
.viewer-nav--next { right: 12px; }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toasts {
  position: fixed; left: 50%; bottom: 24px; z-index: 100;
  translate: -50% 0;
  display: grid; gap: 8px; justify-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 18px; border-radius: 12px;
  background: var(--raise-2); border: 1px solid var(--line-strong);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .6);
  font-weight: 600; font-size: 14px;
  animation: toast-in .35s var(--ease) both;
  transition: opacity .4s, transform .4s;
}
.toast--success { border-color: rgba(95, 227, 161, .45); color: #d9fbe9; }
.toast--error { border-color: rgba(255, 90, 110, .5); color: #ffd0d6; }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* ==========================================================================
   Mobile
   ========================================================================== */
@media (max-width: 720px) {
  :root { --stub: 76px; }
  .shell { padding: 20px 14px 80px; }
  .topbar { padding: 12px 14px; }

  .hero-card { grid-template-columns: 1fr; padding: 26px 22px; gap: 4px; }
  .hero-count { flex-direction: row; align-items: baseline; gap: 10px; order: -1; }
  .hero-num { font-size: 84px; }
  .hero-unit { margin: 0; }

  .search { margin-left: 0; min-width: 0; flex: 1 1 100%; }

  .ticket { grid-template-columns: var(--stub) 1fr; grid-template-rows: auto auto; min-height: 0; }
  .ticket-stub { grid-row: span 2; }
  .stub-day { font-size: 38px; }
  .ticket-body { padding: 14px 14px 4px; }
  .ticket-title { font-size: 18px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ticket-side { flex-direction: row; justify-content: space-between; align-items: center; padding: 6px 14px 14px; }

  .d-head { padding: 24px 20px 22px; }
  .d-section { padding: 22px 20px; }
  .upload { grid-template-columns: 1fr 70px 44px; }
  .file-actions .icon-btn--sm:nth-child(2) { display: none; }
  .viewer-body { padding: 0 12px 20px; }
  .viewer-nav { top: auto; bottom: 18px; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
