/*
 * Espace vendeurs — Darty Saran
 * Feuille de style commune (app vendeurs, administration, pages légales)
 * Auteur : Néo Mouradi
 */

@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: swap; src: url('/assets/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }
:root {
  --red: #E30613;
  --red-hi: #FF2A36;
  --red-deep: #B0000D;
  --red-edge: #7C0009;
  --ink: #1B1C20;
  --ink-2: #3A3D45;
  --muted: #6B7079;
  --line: #DFE2E7;
  --bg: #ECEEF2;
  --surface: #FFFFFF;
  --surface-2: #F6F7F9;
  --ok: #0F9D58;
  --warn: #F29900;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;

  --sh-card:
    inset 0 1px 0 rgba(255,255,255,.9),
    0 1px 2px rgba(24,26,33,.06),
    0 6px 14px -6px rgba(24,26,33,.14),
    0 22px 40px -18px rgba(24,26,33,.22);
  --sh-float:
    0 2px 4px rgba(24,26,33,.08),
    0 18px 44px -12px rgba(24,26,33,.35);
  --sh-red:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -2px 0 rgba(0,0,0,.18),
    0 4px 0 var(--red-edge),
    0 12px 24px -8px rgba(176,0,13,.55);

  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-cond: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--red); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid rgba(227,6,19,.45); outline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font-cond); font-weight: 700; line-height: 1.05;
  margin: 0; letter-spacing: -.005em;
}
h1 { font-size: clamp(30px, 6vw, 40px); }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Boutons */
.btn {
  --b: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: var(--r-sm);
  font-weight: 700; font-size: 16px;
  background: var(--b);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #C7CBD2, 0 8px 18px -8px rgba(24,26,33,.3);
  transition: transform .08s ease, box-shadow .08s ease;
  text-decoration: none;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 1px 0 #fff, 0 0 0 #C7CBD2, 0 3px 8px -4px rgba(24,26,33,.3); }
.btn-red {
  color: #fff;
  background: linear-gradient(180deg, var(--red-hi) 0%, var(--red) 45%, var(--red-deep) 100%);
  box-shadow: var(--sh-red);
  text-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.btn-red:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 0 var(--red-edge), 0 4px 10px -4px rgba(176,0,13,.5); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:active { transform: none; box-shadow: none; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* Champs */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
  box-shadow: inset 0 2px 4px rgba(24,26,33,.06);
  font-size: 17px; /* 16px min. : évite le zoom automatique sur iOS */
  transition: border-color .15s, background .15s;
}
.input::placeholder { color: #B4B8C0; }
.input:focus { outline: none; border-color: var(--red); background: #fff; box-shadow: inset 0 2px 4px rgba(24,26,33,.04), 0 0 0 4px rgba(227,6,19,.12); }
textarea.input { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 4px 0 18px; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--red); }

.alert {
  padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600;
  background: #FFEDEE; color: var(--red-deep); border: 1px solid #FFC9CD; margin-bottom: 14px;
}

/* Cartes */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* Écran de connexion ---------------------------------------------------- */
.login {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(120% 60% at 50% 0%, var(--red-hi) 0%, var(--red) 38%, var(--red-deep) 78%, #6E0008 100%);
}
.login-top {
  padding: calc(var(--safe-t) + 44px) 24px 90px;
  color: #fff; text-align: center;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 74px; height: 74px; border-radius: 20px;
  background: linear-gradient(160deg, #fff 0%, #F1F1F1 100%);
  color: var(--red);
  font-family: var(--font-cond); font-weight: 800; font-size: 34px; letter-spacing: -.02em;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08), 0 6px 0 rgba(0,0,0,.18), 0 20px 40px -10px rgba(0,0,0,.45);
  margin-bottom: 18px;
}
.login-top h1 { color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.login-top p { margin: 8px 0 0; opacity: .88; }
.login-panel {
  width: min(440px, calc(100% - 32px));
  margin: -64px auto calc(var(--safe-b) + 32px);
  align-self: start;
  background: var(--surface); border-radius: 26px;
  box-shadow: var(--sh-float);
  padding: 28px 24px 24px;
}
.login-panel h2 { margin-bottom: 4px; }
.login-panel .lead { margin: 0 0 22px; color: var(--muted); }
.code-input {
  font-family: var(--font-cond); font-weight: 700; font-size: 34px;
  letter-spacing: .18em; text-align: center; min-height: 66px;
}
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; color: var(--muted); font-weight: 600; margin-bottom: 16px; }

/* Application vendeur --------------------------------------------------- */
.app { min-height: 100vh; min-height: 100dvh; }

.hero {
  position: relative;
  background: linear-gradient(170deg, var(--red-hi) 0%, var(--red) 40%, var(--red-deep) 100%);
  color: #fff;
  padding: calc(var(--safe-t) + 22px) 20px 92px;
  box-shadow: inset 0 -30px 60px -30px rgba(0,0,0,.35);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(70% 90% at 85% -10%, rgba(255,255,255,.22), transparent 60%);
  pointer-events: none;
}
.hero-row { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; margin: 0 auto; position: relative; z-index: 1; }
.hero-hello { font-size: 15px; opacity: .9; }
.hero h1 { color: #fff; margin-top: 2px; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.hero-date { font-size: 14px; opacity: .85; margin-top: 4px; text-transform: capitalize; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 10px -4px rgba(0,0,0,.3);
}
.icon-btn svg { width: 22px; height: 22px; }

.main {
  position: relative; z-index: 2;
  max-width: 1080px; margin: -70px auto 0;
  padding: 0 16px calc(var(--safe-b) + 110px);
}

/* Badge vendeur */
.badge {
  position: relative; overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(155deg, #26282E 0%, #1B1C20 55%, #121316 100%);
  color: #fff;
  padding: 22px 22px 20px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.12),
    0 3px 0 #000,
    0 26px 50px -18px rgba(0,0,0,.55);
  transform-style: preserve-3d;
  transition: transform .25s ease;
}
.badge::before {
  content: ''; position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 7px; border-radius: 6px;
  background: var(--bg); box-shadow: inset 0 2px 3px rgba(0,0,0,.35);
}
.badge::after {
  content: ''; position: absolute; right: -40px; top: 0; bottom: 0; width: 140px;
  background: linear-gradient(180deg, var(--red-hi), var(--red-deep));
  transform: skewX(-14deg);
  box-shadow: -8px 0 24px rgba(0,0,0,.35);
}
.badge-inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.avatar {
  flex: none; width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  font-family: var(--font-cond); font-weight: 800; font-size: 28px;
  color: var(--red);
  background: linear-gradient(160deg, #fff, #E9EAEE);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08), 0 6px 14px -4px rgba(0,0,0,.5);
}
.badge-name { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1.05; }
.badge-poste { color: #B9BCC4; font-size: 15px; margin-top: 2px; }
.badge-code {
  margin-left: auto; text-align: right;
  font-family: var(--font-cond); font-weight: 800; font-size: 38px; line-height: 1;
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}
.badge-code small { display: block; font-size: 13px; font-weight: 600; opacity: .85; font-family: var(--font); }
.badge-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; margin-top: 18px; font-size: 13px; color: #9EA2AB; }

/* Grille accueil */
.grid { display: grid; gap: 16px; margin-top: 18px; }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px; border: 0; text-align: left;
  border-radius: var(--r-md); background: var(--surface); box-shadow: var(--sh-card);
  transition: transform .1s;
}
.quick-tile:active { transform: scale(.98); }
.quick-tile .ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(180deg, var(--red-hi), var(--red-deep));
  box-shadow: 0 3px 0 var(--red-edge), 0 8px 14px -6px rgba(176,0,13,.6);
}
.quick-tile .ic svg { width: 22px; height: 22px; }
.quick-tile b { font-size: 16px; }
.quick-tile span { font-size: 13px; color: var(--muted); }

/* Annonces */
.annonce { padding: 16px 0; border-top: 1px solid var(--line); }
.annonce:first-of-type { border-top: 0; padding-top: 4px; }
.annonce h3 { font-size: 20px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.annonce p { margin: 0; white-space: pre-wrap; color: var(--ink-2); }
.annonce time { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font); font-size: 12px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
  background: #FFE8EA; color: var(--red-deep);
}
.tag-pin { background: #EEF0F3; color: var(--ink-2); }
.annonce.is-important { position: relative; }
.annonce.is-important::before {
  content: ''; position: absolute; left: -20px; top: 16px; bottom: 16px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--red);
}

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

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--safe-t) - 220px); min-height: 380px; padding: 0; overflow: hidden; }
.chat-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.chat-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-2); overscroll-behavior: contain; }
.msg { max-width: 80%; display: flex; flex-direction: column; align-items: flex-start; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 3px 10px; }
.bubble {
  padding: 10px 14px; border-radius: 18px 18px 18px 6px;
  background: #fff; box-shadow: 0 1px 0 #D6D9DF, 0 4px 10px -6px rgba(24,26,33,.2);
  white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.msg time { font-size: 11px; color: var(--muted); margin: 3px 10px 0; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .bubble {
  color: #fff; border-radius: 18px 18px 6px 18px;
  background: linear-gradient(180deg, var(--red-hi), var(--red) 60%, var(--red-deep));
  box-shadow: 0 2px 0 var(--red-edge), 0 8px 16px -8px rgba(176,0,13,.6);
}
.msg.admin .bubble { background: var(--ink); color: #fff; box-shadow: 0 2px 0 #000; }
.day-sep { align-self: center; font-size: 12px; font-weight: 700; color: var(--muted); background: #E4E7EB; padding: 4px 12px; border-radius: 999px; margin: 10px 0; }
.chat-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-form .input { min-height: 46px; border-radius: 999px; padding: 10px 18px; }
.send-btn {
  flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center;
  color: #fff; background: linear-gradient(180deg, var(--red-hi), var(--red-deep));
  box-shadow: 0 3px 0 var(--red-edge), 0 8px 16px -6px rgba(176,0,13,.6);
}
.send-btn:active { transform: translateY(3px); box-shadow: none; }
.send-btn svg { width: 22px; height: 22px; }

/* Équipe / profil */
.team { display: grid; gap: 10px; }
.member { display: flex; align-items: center; gap: 12px; }
.member .avatar { width: 42px; height: 42px; border-radius: 12px; font-size: 18px; box-shadow: 0 3px 8px -3px rgba(0,0,0,.3); background: var(--surface-2); }
.member small { display: block; color: var(--muted); }

/* Navigation basse (mobile) */
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(27,28,32,.92);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 22px; padding: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 18px 40px -10px rgba(0,0,0,.55);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; color: #9EA2AB; padding: 8px 0 6px; border-radius: 16px;
  font-size: 12px; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] {
  color: #fff;
  background: linear-gradient(180deg, var(--red-hi), var(--red-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 var(--red-edge);
}
.dot {
  position: absolute; top: 5px; right: calc(50% - 20px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #fff; color: var(--red); font-size: 11px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

.view { display: none; }
.view.active { display: block; animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 100px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px;
  box-shadow: var(--sh-float); opacity: 0; transition: .25s; z-index: 50; pointer-events: none; max-width: calc(100% - 40px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Bannière installation */
.install {
  display: flex; gap: 12px; align-items: center;
  background: #fff; border: 1px dashed #FFB3B8; border-radius: var(--r-md); padding: 14px; margin-top: 16px;
  font-size: 14px;
}
.install b { display: block; font-size: 15px; }

/* Ordinateur ------------------------------------------------------------ */
@media (min-width: 900px) {
  .hero { padding: 34px 32px 110px; }
  .main { padding: 0 32px 60px; margin-top: -84px; max-width: 1144px; }
  .tabbar {
    left: 50%; right: auto; transform: translateX(-50%); width: 480px;
    top: 26px; bottom: auto; background: rgba(0,0,0,.22);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
  }
  .tab { flex-direction: row; justify-content: center; gap: 8px; font-size: 14px; padding: 10px 0; color: rgba(255,255,255,.8); }
  .tab svg { width: 20px; height: 20px; }
  .tab[aria-current="page"] { background: #fff; color: var(--red); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
  .dot { top: -4px; right: 6px; }
  .home-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
  .home-grid > .grid { margin-top: 0; }
  .chat { height: calc(100vh - 200px); }
  .days { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); align-items: start; }
  .badge:hover { transform: perspective(900px) rotateX(3deg) rotateY(-4deg) translateY(-2px); }
  .toast { bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Logo : remplace automatiquement le monogramme si /assets/logo.png existe */
.brand-mark { overflow: hidden; }
.brand-mark img { width: 78%; height: 78%; object-fit: contain; display: block; }
.brand-mark.has-logo > span { display: none; }

/* Pied de page et crédits */
.site-foot {
  text-align: center; font-size: 13px; color: rgba(255,255,255,.72);
  padding: 0 20px calc(var(--safe-b) + 28px);
}
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot nav { display: flex; justify-content: center; gap: 18px; margin-bottom: 6px; }
.app-foot { text-align: center; font-size: 13px; color: var(--muted); margin: 26px 0 0; }
.app-foot a { color: var(--muted); }
.app-foot nav { display: flex; justify-content: center; gap: 18px; margin-bottom: 6px; }

/* Pages légales */
.legal { max-width: 760px; margin: 0 auto; padding: calc(var(--safe-t) + 28px) 20px 60px; }
.legal-top { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.legal-top .brand-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; margin: 0; }
.legal-top a { color: var(--muted); font-weight: 600; text-decoration: none; margin-left: auto; }
.legal .card { padding: 28px 24px; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { font-size: 22px; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.6; }
.legal ul { padding-left: 20px; }
.legal .updated { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.legal dt { font-weight: 600; color: var(--ink); }
.legal dd { margin: 0; color: var(--ink-2); }
@media (max-width: 560px) { .legal dl { grid-template-columns: 1fr; } .legal dd { margin-bottom: 8px; } }

/* Planning ---------------------------------------------------------------- */
:root {
  --t-travail: #1B1C20;
  --t-repos: #0B94A3;
  --t-cours: #1E8E4A;
  --t-formation: #6A4FD6;
  --t-absence: #8A8F98;
  --t-autre: #D07A00;
}
.t-travail { --tone: var(--t-travail); }
.t-repos { --tone: var(--t-repos); }
.t-cours { --tone: var(--t-cours); }
.t-formation { --tone: var(--t-formation); }
.t-absence { --tone: var(--t-absence); }
.t-autre { --tone: var(--t-autre); }
.t-vide { --tone: #C3C7CE; }

.ptag {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; line-height: 1;
  padding: 5px 10px; border-radius: 999px;
  color: #fff; background: var(--tone);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 2px 0 rgba(0,0,0,.18);
  white-space: nowrap;
}

.week-card { padding: 18px; }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.week-nav h2 { font-size: 24px; text-align: center; }
.week-nav .week-total { display: block; text-align: center; color: var(--muted); font-size: 14px; margin-top: 2px; }
.nav-arrow {
  flex: none; width: 44px; height: 44px; border-radius: 14px; border: 0;
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
  background: var(--surface-2); color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #D3D6DC;
}
.nav-arrow:active { transform: translateY(3px); box-shadow: none; }
.week-today { display: block; margin: 12px auto 0; }

.week-stats { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.week-stats:empty { display: none; }
.stat-chip {
  flex: 1 0 auto; min-width: 80px;
  padding: 10px 12px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--tone, var(--red)) 9%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--red)) 22%, #fff);
}
.stat-chip b { display: block; font-family: var(--font-cond); font-size: 22px; line-height: 1; color: var(--tone, var(--red)); }
.stat-chip span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Aujourd'hui */
.hero-day {
  position: relative; overflow: hidden;
  color: #fff; border-radius: 24px; padding: 20px 20px 18px; margin-bottom: 16px;
  background: linear-gradient(150deg, #2A2C33 0%, #1B1C20 60%, #111215 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 3px 0 #000, 0 24px 44px -18px rgba(0,0,0,.6);
}
.hero-day:not(.t-travail) {
  background: linear-gradient(150deg, color-mix(in srgb, var(--tone) 85%, #fff) 0%, var(--tone) 55%, color-mix(in srgb, var(--tone) 70%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 3px 0 color-mix(in srgb, var(--tone) 60%, #000), 0 24px 44px -18px rgba(0,0,0,.45);
}
.hd-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 700; opacity: .85; }
.hd-date { font-weight: 500; text-transform: capitalize; }
.hd-hours { font-family: var(--font-cond); font-weight: 800; font-size: 46px; line-height: 1; margin: 12px 0 6px; letter-spacing: -.01em; }
.hd-status { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; opacity: .95; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 4px rgba(61,220,132,.2); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(61,220,132,.08); } }
.hd-progress { height: 8px; border-radius: 8px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 14px; }
.hd-progress span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--red-hi), var(--red)); box-shadow: 0 0 12px rgba(255,42,54,.6); }
.hd-foot { display: flex; justify-content: space-between; font-size: 13px; opacity: .75; margin-top: 8px; }
.hd-note { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(106,79,214,.35); font-size: 14px; font-weight: 600; }
.hero-day .tl { margin-top: 16px; }
.hero-day .tl-track { background: rgba(255,255,255,.08); box-shadow: inset 0 1px 3px rgba(0,0,0,.4); }
.hero-day .tl-scale span { color: rgba(255,255,255,.55); }
.hero-day:not(.t-travail) .tl-block { background: rgba(255,255,255,.9); box-shadow: none; }

/* Barre horaire */
.tl { width: 100%; }
.tl-track {
  position: relative; height: 14px; border-radius: 7px;
  background: repeating-linear-gradient(90deg, #EEF0F3 0 calc(100% / 11 - 1px), #E2E5EA calc(100% / 11 - 1px) calc(100% / 11));
  box-shadow: inset 0 1px 2px rgba(24,26,33,.08);
}
.tl-block {
  position: absolute; top: 0; bottom: 0; border-radius: 7px;
  background: linear-gradient(180deg, var(--red-hi), var(--red) 60%, var(--red-deep));
  box-shadow: 0 2px 6px -1px rgba(176,0,13,.45);
}
.tl-block.is-done { background: linear-gradient(180deg, #8C9099, #6B7079); box-shadow: none; }
.tl-block.is-live { box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(255,42,54,.7); }
.tl-now { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 2px; background: #3DDC84; box-shadow: 0 0 8px #3DDC84; }
.tl-scale { position: relative; height: 16px; margin-top: 5px; }
.tl-scale span { position: absolute; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--muted); }
.tl-scale span:first-child { transform: none; }
.tl-scale span:last-child { transform: translateX(-100%); }

/* Jours */
.days { display: grid; gap: 12px; margin-top: 16px; }
.day {
  position: relative; overflow: hidden;
  background: var(--surface); border-radius: 20px;
  box-shadow: var(--sh-card);
}
.day:not(.t-travail):not(.t-vide) { background: linear-gradient(100deg, color-mix(in srgb, var(--tone) 13%, #fff) 0%, #fff 70%); }
.day::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--tone); }
.day.t-travail::before { background: linear-gradient(180deg, var(--red-hi), var(--red-deep)); }
.day.t-vide::before { background: #D5D8DE; }
.day.is-today { box-shadow: 0 0 0 2px var(--red), 0 18px 34px -16px rgba(227,6,19,.45); }
.day.is-past { opacity: .55; }
.day-main {
  width: 100%; display: flex; align-items: stretch; gap: 14px;
  padding: 16px 16px 16px 20px; border: 0; background: none; text-align: left;
}
.day-date {
  flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 14px; padding: 8px 0; line-height: 1;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-cond);
}
.day-date span { font-size: 13px; font-weight: 700; color: var(--muted); }
.day-date b { font-size: 28px; font-weight: 800; margin-top: 3px; }
.day-date em { font-style: normal; font-family: var(--font); font-size: 10px; font-weight: 700; color: #fff; background: var(--red); border-radius: 6px; padding: 2px 5px; margin-top: 5px; }
.day.is-today .day-date { background: linear-gradient(180deg, var(--red-hi), var(--red-deep)); box-shadow: 0 3px 0 var(--red-edge); }
.day.is-today .day-date span, .day.is-today .day-date b { color: #fff; }
.day.is-today .day-date em { background: #fff; color: var(--red); }
.day-body { flex: 1; min-width: 0; display: grid; gap: 10px; align-content: center; }
.day-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.day-hours { font-family: var(--font-cond); font-weight: 800; font-size: 26px; line-height: 1; }
.day-kind { font-family: var(--font-cond); font-weight: 800; font-size: 26px; line-height: 1; color: var(--tone); }
.day-dur { flex: none; font-weight: 700; font-size: 14px; color: var(--ink-2); background: var(--surface-2); padding: 4px 9px; border-radius: 8px; }
.day-sub { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.4; }
.day-note { font-size: 13px; color: var(--t-formation); font-weight: 700; }

/* Équipe du jour */
.day-team { border-top: 1px solid var(--line); padding: 14px 16px 16px 20px; background: var(--surface-2); }
.day-team h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.gantt { display: grid; gap: 10px; }
.gantt-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: start; }
.gantt-name { line-height: 1.15; padding-top: 0; }
.gantt-name b { display: block; font-size: 14px; }
.gantt-name small { font-size: 11px; color: var(--muted); font-weight: 600; }
.gantt .tl-track { height: 12px; margin-top: 3px; }
.gantt-row.is-me .gantt-name b { color: var(--red); }
.gantt-row:not(.is-me) .tl-block { background: linear-gradient(180deg, #3A3D45, #1B1C20); box-shadow: none; }
.absent-list { display: flex; flex-wrap: wrap; gap: 8px; }
.absent {
  display: inline-flex; flex-direction: column; padding: 7px 11px; border-radius: 12px; font-size: 12px; font-weight: 600;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 11%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 25%, #fff);
}
.absent b { color: var(--ink); font-size: 13px; }

/* Grille d'édition (administration) */
.pgrid-wrap { overflow-x: auto; margin: 0 -20px; padding: 4px 20px 12px; -webkit-overflow-scrolling: touch; }
.pgrid { display: grid; gap: 6px; min-width: max-content; }
.pgrid-row { display: grid; grid-template-columns: 190px repeat(var(--cols), 128px); gap: 6px; align-items: stretch; }
.pgrid-head > div { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.pgrid-head > div.is-monday { color: var(--ink); }
.pgrid-name {
  position: sticky; left: 0; z-index: 2;
  background: var(--surface); padding: 8px 10px 8px 0;
  display: grid; gap: 6px; align-content: center;
}
.pgrid-name b { font-size: 14px; line-height: 1.2; }
.pgrid-name small { color: var(--muted); font-size: 12px; }
.pgrid-name select { font-size: 13px; min-height: 34px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.pgrid-name select.is-missing { border-color: var(--warn); background: #FFF6E5; }
.pcell {
  position: relative; border: 0; text-align: left; cursor: pointer;
  min-height: 74px; padding: 8px 8px 8px 11px; border-radius: 10px;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; gap: 4px; align-content: start; font-size: 12px;
}
.pcell::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0; background: var(--tone); }
.pcell:hover { box-shadow: inset 0 0 0 2px var(--red); }
.pcell .ptag { font-size: 11px; padding: 4px 8px; justify-self: start; }
.pcell .slots { font-size: 12px; font-weight: 600; }
.pcell .tl-track { height: 6px; border-radius: 3px; }
.pcell .tl-block { border-radius: 3px; box-shadow: none; }
.pcell.t-vide { color: var(--muted); place-content: center; text-align: center; }
.pcell.t-vide::before { display: none; }
.pcell.is-monday { margin-left: 6px; }
.pgrid-head > div.is-monday { margin-left: 6px; }
.pgrid-row.is-ignored .pcell { opacity: .35; }

.slot-row { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.slot-row .input { min-height: 44px; }
.slot-row span { color: var(--muted); }
.icon-x { width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--surface-2); color: var(--muted); font-size: 18px; }
.warn-list { margin: 0 0 14px; padding: 12px 14px 12px 32px; border-radius: var(--r-sm); background: #FFF6E5; color: #8A5A00; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.toolbar .field { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
