/* ==========================================================================
   YNOV · Magasin AV — Pôle Excellence Média & Création de contenu
   ========================================================================== */
:root {
  /* Charte Ynov — univers « Creative Factory » (Audiovisuel, Création & Digital Design) */
  --ynov-dark: #0a0006;
  --ynov-light: #eaf0eb;
  --ynov-red: #ff1a1a;
  --ynov-pink: #ff84ef;
  --ynov-yellow: #eeff57;
  --ynov-mint: #5affb6;
  --ynov-cyan: #00eaff;
  --ynov-lavender: #859cff;
  --ynov-blue: #4a8cff;
  --ynov-green: #018e4d;
  --grad-rainbow: linear-gradient(90deg, #ff1a1a 4%, #ff84ef 16%, #eeff57 30%, #5affb6 47%, #00eaff 61%, #859cff 78%, #4a8cff 87%, #018e4d 96%);
  --grad-univers: linear-gradient(135deg, var(--ynov-red) 0%, var(--ynov-pink) 45%, var(--ynov-yellow) 100%);
  --accent: var(--ynov-pink);
  --accent-2: var(--ynov-yellow);
  --accent-3: var(--ynov-red);
  --on-accent: #0a0006;
  --accent-ink: var(--accent);
  --accent-2-ink: var(--accent-2);
  --bg: #0a0006;
  --bg-2: #120a10;
  --side: #120a10;
  --surface: #1a1118;
  --surface-2: #231921;
  --surface-3: #30242d;
  --line: rgba(234, 240, 235, 0.08);
  --line-2: rgba(234, 240, 235, 0.14);
  --text: #f6f8f6;
  --text-2: #b7b2b6;
  --text-3: #7d757b;
  --ok: #5affb6;
  --warn: #ffb020;
  --bad: #ff4b4b;
  --info: #4a8cff;
  --radius: 14px;
  --radius-lg: 24px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* LT Superior = police officielle Ynov (utilisée si installée sur le poste) */
  --font: "LT Superior", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --serif: "LT Superior Serif", ui-serif, "New York", Georgia, serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eaf0eb;
  --bg-2: #f4f7f4;
  --side: #0a0006;
  --accent-ink: color-mix(in srgb, var(--accent) 55%, #5a0040);
  --accent-2-ink: color-mix(in srgb, var(--accent-2) 35%, #3a4000);
  --surface: #ffffff;
  --surface-2: #f4f7f4;
  --surface-3: #e3e9e4;
  --line: rgba(10, 0, 6, 0.08);
  --line-2: rgba(10, 0, 6, 0.15);
  --text: #0a0006;
  --text-2: #4f4a4e;
  --text-3: #8a848a;
  --ok: #018e4d;
  --warn: #b26a00;
  --bad: #d81b1b;
  --info: #2f6fe0;
  --shadow: 0 10px 40px rgba(10, 0, 6, 0.1);
  color-scheme: light;
}
/* En thème clair, la barre latérale reste noire comme le menu de ynov.com */
:root[data-theme="light"] .sidebar {
  --surface: #1a1118; --surface-2: #2a1f27; --surface-3: #3a2e37;
  --line: rgba(234, 240, 235, 0.1); --line-2: rgba(234, 240, 235, 0.18);
  --text: #f6f8f6; --text-2: #b7b2b6; --text-3: #8a828a;
  --accent-ink: var(--accent); --accent-2-ink: var(--accent-2);
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea, [contenteditable] { user-select: text; -webkit-user-select: text; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
svg.ico { width: 17px; height: 17px; flex: none; vertical-align: -3px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout ---------- */
#app { height: 100vh; display: flex; }
.sidebar {
  width: 248px; flex: none; display: flex; flex-direction: column; position: relative;
  background: var(--side);
  border-right: 1px solid var(--line);
  padding: 44px 14px 14px;
  -webkit-app-region: drag;
}
.sidebar * { -webkit-app-region: no-drag; }
.brand { padding: 4px 10px 18px; }
.brand .word { display: flex; align-items: flex-end; gap: 10px; line-height: 1; color: var(--text); }
.ynov-logo { display: block; width: 84px; height: auto; }
.login-art .ynov-logo { width: 140px; }
.brand .word small { font-family: var(--serif); font-size: 17px; color: var(--text-2); padding-bottom: 7px; }
.brand .pole { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--text-3); margin-top: 10px; font-weight: 700; line-height: 1.4; }
.rainbow { height: 3px; background: var(--grad-rainbow); }
.sidebar::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad-rainbow); }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.nav .sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); font-weight: 700; padding: 14px 10px 6px; }
.nav button {
  all: unset; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
  color: var(--text-2); cursor: pointer; font-weight: 550; position: relative; transition: background .2s, color .2s, transform .15s var(--spring);
}
.nav button:hover { background: var(--surface); color: var(--text); }
.nav button:active { transform: scale(.97); }
.nav button.active { background: var(--surface-2); color: var(--text); }
.nav button.active::before { content: ""; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(var(--ynov-red), var(--ynov-pink), var(--ynov-yellow)); animation: grow .35s var(--ease); }
@keyframes grow { from { transform: scaleY(0); } }
.nav .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; background: var(--accent); color: var(--on-accent); }
.nav .count.soft { background: var(--surface-3); color: var(--text-2); }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.who:hover { background: var(--surface); }
.who .meta { min-width: 0; }
.who .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .meta small { color: var(--text-3); font-size: 11.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  border-bottom: 1px solid var(--line); -webkit-app-region: drag;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(20px);
}
.topbar * { -webkit-app-region: no-drag; }
.topbar .crumb { font-weight: 750; font-size: 15px; }
.topbar .grow { flex: 1; -webkit-app-region: drag; height: 100%; }
.search-btn {
  all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-3); min-width: 220px; transition: border-color .2s;
}
.search-btn:hover { border-color: var(--line-2); }
.search-btn kbd { margin-left: auto; }
kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }
.view { flex: 1; overflow: auto; padding: 28px 32px 60px; position: relative; }
.view-inner { max-width: 1400px; margin: 0 auto; }

/* ---------- Status pill (magasin ouvert / fermé) ---------- */
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 30px; font-weight: 650; font-size: 12.5px; cursor: pointer; border: 1px solid var(--line); background: var(--surface); transition: transform .2s var(--spring); }
.status-pill:hover { transform: translateY(-1px); }
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); position: relative; }
.status-pill.open .dot { background: var(--ok); }
.status-pill.open .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); animation: ping 1.8s var(--ease) infinite; }
@keyframes ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.status-pill small { color: var(--text-3); font-weight: 500; }

/* ---------- Typo ---------- */
h1 { font-family: var(--serif); font-size: 34px; letter-spacing: -0.6px; margin: 0; font-weight: 500; line-height: 1.1; }
h2 { font-size: 19px; letter-spacing: -0.3px; margin: 0; font-weight: 750; }
h3 { font-size: 15px; margin: 0; font-weight: 700; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--text-2); font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 3px; background: var(--grad-univers); flex: none; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.grad-text { background: linear-gradient(90deg, var(--ynov-red), var(--ynov-pink) 45%, var(--ynov-yellow)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sp { flex: 1; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 680px; }

/* ---------- Buttons ---------- */
.btn {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: 13.5px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  transition: transform .18s var(--spring), background .2s, box-shadow .25s, opacity .2s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.95); }
.btn.primary { background: var(--accent); color: var(--on-accent); border: none; box-shadow: 0 6px 22px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); box-shadow: 0 8px 30px color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.hot { background: var(--grad-univers); color: var(--on-accent); border: none; box-shadow: 0 6px 22px color-mix(in srgb, var(--ynov-red) 30%, transparent); }
.btn.dark { background: var(--ynov-dark); color: var(--ynov-light); border-color: var(--ynov-dark); }
.btn.danger { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: 6px 13px; font-size: 12.5px; border-radius: 999px; }
.btn.lg { padding: 13px 24px; font-size: 15px; border-radius: 999px; }
.btn.icon { padding: 8px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; position: relative; }
.seg button { all: unset; cursor: pointer; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--text-2); transition: background .25s var(--ease), color .2s; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; position: relative; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .sp { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.sp { flex: 1; }
.clickable { cursor: pointer; transition: transform .25s var(--ease), border-color .2s, box-shadow .25s; }
.clickable:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.clickable:active { transform: translateY(0) scale(.99); }

.kpi { overflow: hidden; }
.kpi .label { color: var(--text-2); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.kpi .value { font-size: 36px; font-weight: 850; letter-spacing: -1.2px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--text-3); font-size: 12px; }
.kpi .glow { position: absolute; width: 160px; height: 160px; border-radius: 50%; right: -60px; top: -60px; filter: blur(40px); opacity: .22; pointer-events: none; }

.hero {
  border-radius: 26px; padding: 28px 30px; position: relative; overflow: hidden; margin-bottom: 20px;
  background: radial-gradient(1200px 300px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
              radial-gradient(800px 300px at 100% 100%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 60%), var(--surface);
  border: 1px solid var(--line);
}
.hero h1 { font-size: 34px; }
.hero .blob { position: absolute; right: -40px; top: -60px; width: 340px; height: 340px; border-radius: 50%; background: conic-gradient(from 0deg, var(--accent), var(--accent-3), var(--accent-2), var(--accent)); filter: blur(70px); opacity: .25; animation: spin 18s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Badges / tags ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.b-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.b-bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.b-info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.b-acc { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-ink); }
.b-hot { background: color-mix(in srgb, var(--accent-2) 15%, transparent); color: var(--accent-2-ink); }
.b-vio { background: color-mix(in srgb, var(--accent-3) 18%, transparent); color: #a78bff; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 1px solid; }

/* ---------- Avatar ---------- */
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; color: #fff; flex: none; letter-spacing: .3px; }
.av.lg { width: 64px; height: 64px; font-size: 22px; }
.av.sm { width: 26px; height: 26px; font-size: 10px; }
.stack { display: flex; }
.stack .av { border: 2px solid var(--surface); margin-left: -8px; }
.stack .av:first-child { margin-left: 0; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .15s; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 650; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input, select.input, textarea.input {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 12px; outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.input { resize: vertical; min-height: 80px; }
.input.big { font-size: 22px; padding: 14px 16px; font-weight: 700; }
.search-input { position: relative; }
.search-input svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search-input .input { padding-left: 34px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 8px 10px; border-radius: 10px; transition: background .15s; }
.check:hover { background: var(--surface-2); }
.check input { display: none; }
.check .box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--line-2); display: grid; place-items: center; transition: all .25s var(--spring); flex: none; }
.check input:checked + .box { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.check input:checked + .box::after { content: ""; width: 5px; height: 10px; border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); animation: pop .25s var(--spring); }
@keyframes pop { from { transform: rotate(45deg) scale(0); } }
.toggle { width: 40px; height: 24px; border-radius: 20px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .25s; flex: none; border: none; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .3s var(--spring); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* ---------- Modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; animation: fade .25s var(--ease); }
.overlay.closing { animation: fade .2s var(--ease) reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border: 1px solid var(--line-2); border-radius: 24px; width: min(720px, 94vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: modalIn .4s var(--spring); }
.modal.wide { width: min(1080px, 96vw); }
.modal.xl { width: min(1240px, 97vw); }
.overlay.closing .modal { animation: modalIn .2s var(--ease) reverse forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.modal-head { padding: 22px 24px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-body { padding: 18px 24px; overflow: auto; flex: 1; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); align-items: center; }
.x { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--text-3); transition: background .2s, transform .3s var(--spring); margin-left: auto; flex: none; }
.x:hover { background: var(--surface-3); color: var(--text); transform: rotate(90deg); }

.drawer-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); animation: fade .25s; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 92vw); background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0,0,0,.4); display: flex; flex-direction: column; animation: slideIn .45s var(--ease); }
.drawer-wrap.closing { animation: fade .2s reverse forwards; }
.drawer-wrap.closing .drawer { animation: slideIn .25s var(--ease) reverse forwards; }
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer .modal-head { padding-top: 26px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface-3); border: 1px solid var(--line-2); padding: 11px 16px 11px 12px; border-radius: 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; font-weight: 600; animation: toastIn .5s var(--spring); pointer-events: auto; }
.toast.out { animation: toastIn .3s var(--ease) reverse forwards; }
.toast .ti { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: var(--on-accent); font-weight: 900; font-size: 13px; }
.toast.err .ti { background: var(--bad); color: #fff; }
.toast.info .ti { background: var(--info); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }

/* ---------- Motion helpers ---------- */
.stagger > * { animation: rise .55s var(--ease) backwards; }
.stagger > *:nth-child(1) { animation-delay: .02s; } .stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; } .stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; } .stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; } .stagger > *:nth-child(8) { animation-delay: .30s; }
.stagger > *:nth-child(n+9) { animation-delay: .33s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.view-enter { animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty .big { font-size: 42px; margin-bottom: 8px; }

/* ---------- Login ---------- */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); z-index: 30; }
.login-art { position: relative; overflow: hidden; padding: 56px; background: var(--ynov-dark); color: #fff; display: flex; flex-direction: column; justify-content: space-between; -webkit-app-region: drag; }
.login-art .orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.login-art .o1 { width: 420px; height: 420px; background: var(--ynov-pink); left: -80px; top: -60px; animation: float1 14s ease-in-out infinite; }
.login-art .o2 { width: 380px; height: 380px; background: var(--ynov-yellow); right: -60px; bottom: 40px; animation: float2 16s ease-in-out infinite; }
.login-art .o3 { width: 300px; height: 300px; background: var(--ynov-red); left: 30%; top: 40%; animation: float1 20s ease-in-out infinite reverse; }
@keyframes float1 { 50% { transform: translate(60px, 80px) scale(1.1); } }
@keyframes float2 { 50% { transform: translate(-70px, -50px) scale(.9); } }
.login-art .grain { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 4px 4px; }
.login-art > * { position: relative; }
.login-art .big { font-family: var(--serif); font-size: 66px; font-weight: 500; letter-spacing: -1.5px; line-height: 1; }
.login-art .rec { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: 2px; }
.login-art .rec i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-box { width: 100%; max-width: 420px; }
.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.role-card { all: unset; cursor: pointer; border-radius: 18px; padding: 18px; background: var(--surface); border: 1.5px solid var(--line); transition: all .3s var(--ease); }
.role-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.role-card.on { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.role-card .emo { font-size: 26px; }
.role-card b { display: block; margin-top: 10px; }
.role-card small { color: var(--text-3); }
.pin { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.pin input { width: 54px; height: 62px; text-align: center; font-size: 26px; font-weight: 800; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line-2); outline: none; transition: border-color .2s, transform .2s var(--spring); }
.pin input:focus { border-color: var(--accent); transform: translateY(-2px); }
.pick-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.pick:hover { background: var(--surface); }

/* ---------- Planning (Gantt) ---------- */
.plan-wrap { overflow: auto; position: relative; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); }
.plan { position: relative; min-width: 100%; }
.plan-head { display: flex; position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 1px solid var(--line); }
.plan-corner { position: sticky; left: 0; z-index: 4; background: var(--surface); border-right: 1px solid var(--line); flex: none; padding: 10px 14px; font-size: 11px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: flex-end; }
.plan-day { flex: none; text-align: center; padding: 8px 0 6px; border-right: 1px solid var(--line); font-size: 11px; color: var(--text-3); position: relative; }
.plan-day b { display: block; font-size: 16px; color: var(--text); font-weight: 750; }
.plan-day.today b { color: var(--accent-ink); }
.plan-day.closed { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text) 4%, transparent) 6px 12px); }
.plan-day.closed::after { content: "fermé"; display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .8px; color: var(--bad); opacity: .7; }
.plan-day.weekend { color: var(--text-3); opacity: .7; }
.plan-body { position: relative; }
.plan-grid { position: absolute; inset: 0; display: flex; pointer-events: none; }
.plan-grid div { flex: none; border-right: 1px solid var(--line); height: 100%; }
.plan-grid div.closed { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text) 3%, transparent) 6px 12px); }
.plan-grid div.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.plan-row { display: flex; position: relative; border-bottom: 1px solid var(--line); }
.plan-label { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--line); flex: none; padding: 8px 14px; display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.plan-label .t { min-width: 0; }
.plan-label b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-label small { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.plan-lane { position: relative; flex: none; }
.bar {
  position: absolute; height: 34px; border-radius: 10px; padding: 0 10px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; cursor: pointer; overflow: hidden; white-space: nowrap; color: #fff;
  transition: transform .25s var(--spring), box-shadow .25s, filter .2s; animation: barIn .6s var(--ease) backwards;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.bar:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 10px 26px rgba(0,0,0,.4); z-index: 2; }
.bar small { opacity: .8; font-weight: 600; }
.bar.s-demande { background: linear-gradient(90deg, #b07a10, #d89a1c); }
.bar.s-validee { background: linear-gradient(90deg, #1173d4, #4da3ff); }
.bar.s-sortie { background: linear-gradient(90deg, color-mix(in srgb, var(--accent-2) 90%, #000), var(--accent-2)); }
.bar.s-retournee { background: linear-gradient(90deg, #1d7a4b, #2ed47a); opacity: .65; }
.bar.s-refusee, .bar.s-annulee { background: var(--surface-3); color: var(--text-3); text-decoration: line-through; }
.bar.late { background: repeating-linear-gradient(135deg, #c62837 0 10px, #ff4d5e 10px 20px); }
@keyframes barIn { from { opacity: 0; transform: scaleX(.3); transform-origin: left; } }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 2; pointer-events: none; box-shadow: 0 0 12px var(--accent); }
.now-line::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.occ { position: absolute; top: 6px; bottom: 6px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: center; gap: 0; }
.step { display: flex; align-items: center; gap: 10px; flex: 1; }
.step .n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-3); color: var(--text-3); flex: none; transition: all .4s var(--spring); font-size: 13px; }
.step .lbl { font-weight: 650; font-size: 12.5px; color: var(--text-3); white-space: nowrap; transition: color .3s; }
.step .bar-l { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); margin: 0 10px; position: relative; overflow: hidden; }
.step .bar-l::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.step.done .bar-l::after { transform: scaleX(1); }
.step.done .n { background: var(--accent); color: var(--on-accent); }
.step.cur .n { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; transform: scale(1.12); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent); }
.step.cur .lbl, .step.done .lbl { color: var(--text); }
.step:last-child { flex: none; }
.step.click { cursor: pointer; }

/* Timeline (history) */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl-item small { color: var(--text-3); display: block; }

/* ---------- Catalogue ---------- */
.item-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.item-thumb { height: 92px; border-radius: 14px; display: grid; place-items: center; font-size: 40px; position: relative; overflow: hidden; }
.item-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.18), transparent 60%); }
.price { font-weight: 800; font-variant-numeric: tabular-nums; }
.qty-ctl { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty-ctl button { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; font-weight: 800; transition: background .15s; }
.qty-ctl button:hover { background: var(--surface-3); }
.qty-ctl span { min-width: 26px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.avail { font-size: 11.5px; font-weight: 700; }
.cart { position: sticky; top: 0; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); animation: rise .35s var(--ease); }
.cart-line:last-child { border-bottom: none; }
.fly { position: fixed; z-index: 200; pointer-events: none; font-size: 26px; transition: transform .7s cubic-bezier(.5,-0.3,.6,1), opacity .7s; }

/* Wizard */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.wiz-panel { animation: viewIn .45s var(--ease); }
.drop { border: 2px dashed var(--line-2); border-radius: 18px; padding: 30px; text-align: center; cursor: pointer; transition: all .25s var(--ease); }
.drop:hover, .drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); transform: scale(1.01); }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); animation: rise .35s var(--ease); }
.deadline { padding: 14px 16px; border-radius: 14px; display: flex; gap: 12px; align-items: center; font-weight: 600; transition: all .3s; }
.deadline.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.deadline.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.deadline .ic { font-size: 22px; }
.deadline small { display: block; font-weight: 500; opacity: .85; color: var(--text-2); }

/* Signature pad */
.sigpad { border-radius: 16px; background: #fff; position: relative; overflow: hidden; border: 1px solid var(--line-2); }
.sigpad canvas { display: block; width: 100%; height: 150px; cursor: crosshair; touch-action: none; }
.sigpad .ph { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; color: #b5b5c4; font-size: 12px; pointer-events: none; transition: opacity .3s; }
.sigpad .base { position: absolute; left: 24px; right: 24px; bottom: 30px; border-bottom: 1.5px dashed #d0d0dc; pointer-events: none; }
.sigpad .clr { position: absolute; right: 8px; top: 8px; }
.sigpad.signed .ph { opacity: 0; }
.sig-block { display: flex; flex-direction: column; gap: 8px; }
.sig-block .who-l { font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.sig-img { height: 60px; background: #fff; border-radius: 8px; padding: 4px; }

/* Inventory */
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring .trk { stroke: var(--surface-3); }
.ring .val { stroke: url(#ringgrad); transition: stroke-dashoffset 1s var(--ease); }
.ring .lab { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .lab b { font-size: 30px; font-weight: 850; display: block; letter-spacing: -1px; }
.scan-box { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.inv-row.flash { animation: flash 1s var(--ease); }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 35%, transparent); } }
.state-seg button.ok.on { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }
.state-seg button.casse.on { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.state-seg button.perdu.on, .state-seg button.manquant.on { background: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }

/* Hours */
.hours-grid { display: grid; grid-template-columns: 110px repeat(1, 1fr); gap: 6px; }
.week-hours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-col { border-radius: 14px; padding: 12px 10px; background: var(--surface-2); border: 1px solid var(--line); min-height: 120px; transition: all .25s; }
.day-col.today { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.day-col .dn { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); }
.day-col.today .dn { color: var(--accent-ink); }
.slot { margin-top: 8px; padding: 6px 8px; border-radius: 9px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); font-weight: 700; font-size: 12px; text-align: center; }
.slot.closed { background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .cd { aspect-ratio: 1.25; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 6px 8px; font-size: 12px; font-weight: 700; cursor: pointer; transition: transform .2s var(--spring), border-color .2s; position: relative; display: flex; flex-direction: column; justify-content: space-between; }
.cal .cd:hover { transform: scale(1.05); border-color: var(--line-2); z-index: 1; }
.cal .cd.out { opacity: .3; }
.cal .cd.open { background: color-mix(in srgb, var(--ok) 10%, var(--surface-2)); }
.cal .cd.closed { background: color-mix(in srgb, var(--bad) 8%, var(--surface-2)); }
.cal .cd.exc { border-color: var(--warn); }
.cal .cd.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal .cd small { font-size: 9.5px; font-weight: 600; color: var(--text-3); line-height: 1.1; }
.cal .dh { font-size: 10.5px; text-transform: uppercase; color: var(--text-3); font-weight: 800; text-align: center; letter-spacing: 1px; }

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); display: flex; justify-content: center; padding-top: 14vh; animation: fade .2s; }
.palette-box { width: min(640px, 92vw); background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; animation: modalIn .3s var(--spring); height: fit-content; }
.palette-box input { all: unset; width: 100%; box-sizing: border-box; padding: 18px 20px; font-size: 17px; border-bottom: 1px solid var(--line); }
.palette-res { max-height: 50vh; overflow: auto; padding: 6px; }
.pr { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.pr.sel { background: var(--surface-3); }
.pr .k { margin-left: auto; font-size: 11px; color: var(--text-3); }

/* Labels (étiquettes imprimables) */
.label-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lbl-card { background: #fff; color: #111; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; border: 1px solid #ddd; }
.lbl-card .top { display: flex; justify-content: space-between; font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.lbl-card b { font-size: 12px; }
.lbl-card svg { width: 100%; height: 44px; }
.lbl-card .code { font-family: var(--mono); font-size: 10px; text-align: center; letter-spacing: 2px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button { all: unset; cursor: pointer; padding: 10px 14px; font-weight: 650; color: var(--text-3); position: relative; transition: color .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2.5px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: grow2 .35s var(--ease); }
@keyframes grow2 { from { transform: scaleX(0); } }

.alert { padding: 14px 16px; border-radius: 14px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid; }
.alert.warn { background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert.bad { background: color-mix(in srgb, var(--bad) 9%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.ok { background: color-mix(in srgb, var(--ok) 9%, transparent); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.info { background: color-mix(in srgb, var(--info) 9%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert .ai { font-size: 20px; line-height: 1; }

.charte-text { max-height: 46vh; overflow: auto; padding: 18px 20px; background: var(--bg-2); border-radius: 16px; border: 1px solid var(--line); font-size: 13px; line-height: 1.6; color: var(--text-2); user-select: text; -webkit-user-select: text; }
.charte-text h4 { color: var(--text); margin: 18px 0 6px; font-size: 13.5px; text-transform: uppercase; letter-spacing: .8px; }
.charte-text h4:first-child { margin-top: 0; }
.charte-text strong { color: var(--text); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s var(--ease); }
.swatch { width: 26px; height: 26px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: transform .2s var(--spring); }
.swatch:hover { transform: scale(1.15); }
.swatch.on { border-color: var(--text); }

/* Tiroir rafraîchi en temps réel : pas de nouvelle animation */
.drawer-wrap.no-anim, .drawer-wrap.no-anim .drawer { animation: none; }

/* ---------- Téléphone / petite fenêtre (signature à distance, réservation mobile) ---------- */
@media (max-width: 860px) {
  body { overflow: auto; }
  #app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; width: auto; height: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction: row; border-right: none; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--side) 94%, transparent); backdrop-filter: blur(16px); }
  .brand, .side-foot, .nav .sec, .nav .count { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 2px; margin: 0; padding: 0; }
  .nav button { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 10px; white-space: nowrap; }
  .nav button.active::before { display: none; }
  .main { min-height: 100vh; }
  .topbar { height: auto; min-height: 52px; padding: 8px 14px; flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
  .topbar .grow, .search-btn { display: none; }
  .topbar select.input { max-width: 140px; }
  .view { overflow: visible; padding: 16px 16px 110px; }
  h1, .hero h1 { font-size: 26px !important; }
  .hero { padding: 20px !important; }
  .hero .row, .page-head, .card .row { flex-wrap: wrap; }
  .g2, .g3, .g4, .wizard, .grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .page-head { gap: 10px; }
  .stepper .lbl { display: none; }
  .modal, .modal.wide, .modal.xl { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .drawer { width: 100vw; }
  .login { grid-template-columns: 1fr; position: static; min-height: 100vh; }
  .login-art { display: none; }
  .login-panel { padding: 24px 18px; }
  .table th, .table td { padding: 9px 10px; }
  .plan-wrap { max-height: none !important; }
}

/* ---------- Planning : agenda semaine ---------- */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.wk-day { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; min-height: 260px; display: flex; flex-direction: column; overflow: hidden; transition: border-color .2s, box-shadow .25s; }
.wk-day.today { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.wk-day.closed { background: repeating-linear-gradient(135deg, var(--surface) 0 8px, color-mix(in srgb, var(--text) 3%, var(--surface)) 8px 16px); }
.wk-day.slim { opacity: .55; }
.wk-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.wk-dow { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); font-weight: 800; }
.wk-num { font-size: 22px; font-weight: 850; letter-spacing: -.5px; }
.wk-day.today .wk-num, .wk-day.today .wk-dow { color: var(--accent-ink); }
.wk-hours { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.wk-day.closed .wk-hours { color: var(--bad); font-weight: 700; }
.wk-cnt { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 20px; }
.wk-cnt.out { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); }
.wk-cnt.in { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2-ink); }
.wk-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wk-empty { color: var(--text-3); font-size: 12px; text-align: center; padding: 18px 0; }
.ev { position: relative; border-radius: 12px; padding: 9px 10px 9px 13px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: transform .2s var(--spring), box-shadow .25s, border-color .2s; animation: rise .45s var(--ease) backwards; }
.ev::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.ev:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.3); border-color: var(--line-2); }
.ev-in::before { background: var(--accent-2); }
.ev-late { background: color-mix(in srgb, var(--bad) 10%, var(--surface-2)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.ev-late::before { background: var(--bad); }
.ev.pending { border-style: dashed; }
.ev.pending::before { background: var(--warn); }
.ev.done { opacity: .55; }
.ev-top { display: flex; align-items: center; gap: 6px; }
.ev-kind { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--accent-ink); }
.ev-in .ev-kind { color: var(--accent-2-ink); }
.ev-late .ev-kind { color: var(--bad); }
.ev-time { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.ev-title { display: block; font-size: 13px; margin-top: 3px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ev-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.ev-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ev-foot:empty { display: none; }
@media (max-width: 1250px) { .wk { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Planning : mois ---------- */
.mo { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mo-h { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; color: var(--text-3); text-align: center; padding: 4px 0; }
.mo-cell { min-height: 104px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: transform .2s var(--spring), border-color .2s; }
.mo-cell:hover { transform: scale(1.03); border-color: var(--line-2); z-index: 1; }
.mo-cell.out { opacity: .35; }
.mo-cell.today { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.mo-cell.closed { background: repeating-linear-gradient(135deg, var(--surface) 0 8px, color-mix(in srgb, var(--text) 3%, var(--surface)) 8px 16px); }
.mo-chip { font-size: 11px; font-weight: 800; border-radius: 7px; padding: 2px 6px; width: fit-content; }
.mo-chip.out { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-ink); }
.mo-chip.in { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2-ink); }
.mo-line { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Planning : flux (kanban) ---------- */
.flux { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.flux-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 10px; min-height: 300px; }
.flux-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-size: 13px; }
.flux-head .badge { margin-left: auto; }
.flux-body { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Planning : dispo matériel ---------- */
.table.dispo th.today { color: var(--accent-ink); }
.table.dispo th.closed { color: var(--bad); opacity: .7; }
.table.dispo td { padding: 6px 4px; }
.table.dispo td:first-child { padding-left: 14px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.dispo-cell { display: inline-block; min-width: 30px; padding: 3px 0; border-radius: 7px; text-align: center; font-weight: 800; font-size: 12px; }

/* ---------- Inventaires obligatoires ---------- */
.inv-card.k-late { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.inv-card.k-soon { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.inv-card.k-done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.inv-count { text-align: center; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); min-width: 78px; }
.inv-count b { display: block; font-size: 26px; font-weight: 850; letter-spacing: -1px; line-height: 1; }
.inv-count small { font-size: 10.5px; color: var(--text-3); }
.inv-count.soon b { color: var(--warn); }
.inv-count.late b { color: var(--bad); }
.dot-st { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.dot-st.open { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
@media (max-width: 860px) { .wk, .mo { grid-template-columns: 1fr; } .flux { grid-template-columns: repeat(6, 80vw); } }

/* ---------- Motion : écran d'accueil et transitions d'écran ---------- */
#app.swap-out > * { animation: swapOut .26s var(--ease) forwards; pointer-events: none; }
@keyframes swapOut { to { opacity: 0; transform: scale(.985); filter: blur(6px); } }
#app.swap-in .sidebar { animation: sideIn .55s var(--ease) backwards; }
#app.swap-in .main { animation: viewIn .55s var(--ease) .08s backwards; }
#app.swap-in .login { animation: fade .45s var(--ease) backwards; }
@keyframes sideIn { from { opacity: 0; transform: translateX(-24px); } }
.role-card { transition: border-color .25s var(--ease), box-shadow .3s var(--ease), transform .3s var(--spring), background .25s; }
.role-card:active { transform: scale(.97); }
.role-card .emo { display: inline-block; transition: transform .45s var(--spring); }
.role-card.on .emo { transform: scale(1.18) rotate(-6deg); }
.role-card.on { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.pick { transition: background .15s, transform .2s var(--spring); }
.pick:hover { transform: translateX(3px); }
.pick:active { transform: scale(.98); }
.pick.picked { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.pin.ok input { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); transition: all .2s; }
.ynov-logo { color: #fff; }

/* ---------- Comptes, classes, droits ---------- */
.count-chip { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; margin-left: 4px; border-radius: 10px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.count-chip.hot { background: var(--accent); color: var(--on-accent); }
.class-card .av { width: 42px; height: 42px; font-size: 13px; }
.rights-matrix td:first-child { font-weight: 550; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin: 18px 0 6px; }
.auth-tabs button { all: unset; text-align: center; padding: 9px 0; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--text-2); transition: background .25s var(--ease), color .2s; }
.auth-tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
