/* Grainbox Labo : même palette que la boutique (orange #FF5A1F, encre #14161A, Archivo). */
:root {
  --bg: #F1F3F4; --surface: #FFFFFF; --ink: #14161A; --muted: #5B636E; --line: #DCE0E4; --hover: #F6F7F8;
  --accent: #FF5A1F; --accent-ink: #14161A; --band: #14161A; --band-ink: #F5F6F7; --band-muted: #A6ADB7;
  --ok: #1F9D55; --ok-bg: #E7F6EE; --err: #C8341B; --err-bg: #FDECE8; --info-bg: #EEF1F4;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif; --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --r: 16px; --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--body); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
code { font-family: var(--display); font-stretch: 85%; font-weight: 700; letter-spacing: .01em; font-size: 1.02em; }
h1, h2 { font-family: var(--display); line-height: 1.05; letter-spacing: -0.01em; }
h1 { font-stretch: 75%; font-weight: 800; font-size: clamp(30px, 4vw, 44px); margin: 8px 0 14px; }
h1 code { font-stretch: 75%; font-weight: 800; }
h2 { font-stretch: 85%; font-weight: 750; font-size: 21px; margin: 0 0 14px; }
[hidden] { display: none !important; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Bandeau */
.bandeau { background: var(--band); color: var(--band-ink); position: sticky; top: 0; z-index: 10; }
.bandeau-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }
.marque { font-family: var(--display); font-stretch: 62%; font-weight: 800; font-size: 28px; line-height: 1; text-decoration: none; color: var(--band-ink); white-space: nowrap; }
.marque b { color: var(--accent); }
.marque span { font-stretch: 100%; font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--band-muted); margin-left: 4px; vertical-align: 4px; }
.marque:hover { color: var(--band-ink); }
.menu { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.menu a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--band-muted); }
.menu a:hover { color: var(--band-ink); background: rgba(255,255,255,.07); }
.menu a[aria-current] { color: var(--accent-ink); background: var(--accent); }
.menu i { font-style: normal; font-size: 12px; font-weight: 800; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; margin-left: 3px; }
.menu a[aria-current] i { background: var(--accent-ink); color: var(--accent); }
.cherche input { width: 230px; max-width: 100%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: var(--band-ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; }
.cherche input::placeholder { color: var(--band-muted); }
.cherche input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sortie button { background: none; border: 0; color: var(--band-muted); font-size: 20px; cursor: pointer; padding: 4px 6px; }
.sortie button:hover { color: var(--accent); }

.page { max-width: 1240px; margin: 0 auto; padding: 18px 20px 80px; }
.titre-page, .titre-film { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.titre-page h1, .titre-film h1 { margin-bottom: 6px; }
.fil { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.sous-titre { margin: 0 0 8px; color: var(--muted); }
.sous-titre b { color: var(--ink); }
.aide { color: var(--muted); max-width: 820px; margin: 0 0 18px; }
.meta { color: var(--muted); font-size: 14px; }
.vide { color: var(--muted); margin: 6px 0; }
.alerte { display: inline-block; font-size: 12px; font-weight: 700; color: var(--err); background: var(--err-bg); border-radius: 999px; padding: 1px 8px; vertical-align: 2px; }

/* Cartes et colonnes */
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; }
.titre-carte { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.titre-carte h2 { margin: 0; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; align-items: start; }
.colonnes.larges { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.pile { display: grid; align-content: start; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 700; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer; color: var(--bg); background: var(--ink); transition: background-color .2s, color .2s, transform .15s; }
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; background: var(--ink); color: var(--bg); }
.btn.ligne { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ligne:hover { box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); color: var(--ink); }
.btn.petit { padding: 8px 16px; font-size: 14px; }
.btn.large { width: 100%; margin-top: 14px; }
.lien { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lien:hover { color: var(--accent); }
.lien.danger { color: var(--err); font-size: 14px; }
.a-droite { margin-left: auto; text-align: right; }

/* Champs */
.champ { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
select.champ { width: auto; max-width: 100%; }
.champ:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea.champ { resize: vertical; }
label { font-weight: 600; font-size: 14px; }
label small { font-weight: 400; color: var(--muted); }
.notes { display: grid; gap: 14px; }
.notes label { display: grid; gap: 6px; }
.notes .btn { justify-self: start; }
.case-ligne { display: flex !important; align-items: center; gap: 10px; font-weight: 500; font-size: 15px; }
.case-ligne input, .case input, .tout input { width: 18px; height: 18px; accent-color: var(--accent); }
.ligne-form { display: flex; gap: 10px 12px; align-items: flex-end; flex-wrap: wrap; margin: 6px 0; }
.ligne-form label { display: grid; gap: 6px; flex: 1 1 220px; }
.ligne-form .champ[type=search] { flex: 1 1 260px; width: auto; }
.encadre { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Messages */
.message { border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; font-weight: 600; }
.message.ok { background: var(--ok-bg); color: #155B34; }
.message.err { background: var(--err-bg); color: var(--err); }

/* Flux du tableau de bord */
.flux { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; counter-reset: e; }
.flux a { display: flex; flex-direction: column; justify-content: space-between; min-height: 112px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; position: relative; transition: border-color .2s, transform .2s var(--ease); }
.flux a:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-2px); }
.flux b { font-family: var(--display); font-stretch: 70%; font-weight: 800; font-size: 46px; line-height: 1; }
.flux span { font-weight: 600; font-size: 14px; color: var(--muted); }
.flux li:nth-child(5) a:not(.zero), .flux li:nth-child(6) a:not(.zero) { background: var(--accent); border-color: var(--accent); }
.flux li:nth-child(5) a:not(.zero) span, .flux li:nth-child(6) a:not(.zero) span { color: var(--accent-ink); }
.flux a.zero b { color: #B7BDC4; }
.taches { list-style: none; padding: 0; margin: 0; }
.taches li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.taches b { font-family: var(--display); font-stretch: 75%; font-size: 22px; margin-right: 4px; }
.liste-simple { margin: 0; padding-left: 18px; }
.liste-simple li { margin: 6px 0; }
.journal { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.journal li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.journal li:last-child { border-bottom: 0; }
.journal time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 6px; }

/* Tableaux */
.tableau { width: 100%; border-collapse: collapse; font-size: 15px; }
.tableau th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tableau td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tableau tbody tr:hover { background: var(--hover); }
.tableau tr.probleme { background: #FFF7F4; }
.tableau .case { width: 34px; padding-right: 0; }
.tableau tr:last-child td { border-bottom: 0; }
.carte > .tableau { margin: 0 -10px; width: calc(100% + 20px); }
.groupee { padding-top: 12px; }
.barre-actions { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 8px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; position: sticky; top: 58px; background: var(--surface); z-index: 2; }
.tout { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.compte { color: var(--muted); font-size: 14px; margin-right: auto; }

/* Pastilles */
.pastille { display: inline-block; font-family: var(--body); font-size: 12px; font-weight: 700; letter-spacing: .02em; padding: 3px 10px; border-radius: 999px; background: var(--info-bg); color: var(--ink); vertical-align: middle; white-space: nowrap; }
.e-recu, .e-au_partenaire, .l-envoye { background: #FFF1E0; color: #8A4A00; }
.e-developpe { background: #E8EEFF; color: #2C46A8; }
.e-scanne, .l-preparation { background: var(--accent); color: var(--accent-ink); }
.e-livre, .l-revenu { background: var(--ok-bg); color: #155B34; }
h1 .pastille { font-size: 14px; vertical-align: 8px; }
.type { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; border: 1px solid currentColor; color: #B04317; white-space: nowrap; vertical-align: 1px; }
.type.t-nb { color: var(--ink); }

/* Onglets */
.onglets { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.onglets a { text-decoration: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.onglets a[aria-current] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.onglets i { font-style: normal; color: var(--muted); margin-left: 3px; }
.onglets a[aria-current] i { color: var(--accent); }

/* Expédition */
.exp-tete { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.exp-tete h2 { margin-bottom: 4px; }
.exp-tete h2 a { text-decoration: none; }
.exp-corps { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 18px; margin: 14px 0; }
address { font-style: normal; line-height: 1.5; }
.films-exp { list-style: none; margin: 0; padding: 0; }
.films-exp li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.exp-envoi { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.exp-envoi label { display: grid; gap: 6px; flex: 1 1 240px; max-width: 360px; }
.note-client { background: #FFF7E8; border-radius: 10px; padding: 10px 14px; font-size: 15px; }

/* Réception */
.reception { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.champ.geant { flex: 1 1 360px; width: auto; font-family: var(--display); font-stretch: 80%; font-weight: 800; font-size: 34px; letter-spacing: .02em; padding: 14px 20px; border-radius: var(--r); border: 2px solid var(--ink); text-transform: uppercase; }
.champ.geant::placeholder { color: #C4C9CF; }
.reception .btn { padding: 0 34px; font-size: 17px; min-height: 64px; }
.resultat { border-radius: var(--r); padding: 20px 24px; margin-bottom: 18px; border: 2px solid; }
.resultat h2 { font-size: 30px; font-stretch: 75%; margin-bottom: 8px; }
.resultat p { margin: 4px 0 8px; }
.resultat.ok { background: var(--ok-bg); border-color: var(--ok); }
.resultat.err { background: var(--err-bg); border-color: var(--err); }
.resultat.info { background: var(--info-bg); border-color: #B7BDC4; }
.consigne { font-size: 19px; }

/* Fiche film */
.scan-demande { background: var(--ink); color: var(--bg); border-radius: var(--r); padding: 12px 20px; text-align: right; }
.scan-demande span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--band-muted); }
.scan-demande b { font-family: var(--display); font-stretch: 75%; font-size: 26px; color: var(--accent); }
.parcours { list-style: none; padding: 0; margin: 4px 0 20px; display: flex; gap: 6px; flex-wrap: wrap; }
.parcours li { flex: 1 1 120px; padding: 10px 14px 9px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 600; position: relative; }
.parcours li time { display: block; font-weight: 400; font-size: 13px; }
.parcours li.fait { color: var(--ink); border-color: var(--ink); }
.parcours li.fait::after { content: "✓"; position: absolute; right: 12px; top: 9px; color: var(--ok); }
.parcours li.ici { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.correction { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.correction summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.correction form { margin-top: 10px; }

/* Dépôt des scans */
.depot { border: 2px dashed #B7BDC4; border-radius: var(--r); padding: 22px; text-align: center; transition: border-color .2s, background .2s; margin-bottom: 14px; }
.depot p { margin: 0; }
.depot .lien { color: var(--accent); font-weight: 700; font-size: inherit; }
.depot.survol { border-color: var(--accent); background: #FFF4EF; }
.envois { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; display: grid; gap: 6px; }
.envois:empty { display: none; }
.envois li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 14px; }
.envois progress { grid-column: 1 / -1; width: 100%; height: 6px; appearance: none; border: 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.envois progress::-webkit-progress-bar { background: var(--line); }
.envois progress::-webkit-progress-value { background: var(--accent); }
.envois progress::-moz-progress-bar { background: var(--accent); }
.envois .ok { color: var(--ok); font-weight: 700; }
.envois .err { color: var(--err); font-weight: 700; }
.envois .err-texte { grid-column: 1 / -1; color: var(--err); }
.grille-scans { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grille-scans li { position: relative; background: var(--bg); border-radius: 12px; overflow: hidden; }
.grille-scans .vignette { display: block; aspect-ratio: 3 / 2; background: #1E2126; }
.grille-scans img { width: 100%; height: 100%; object-fit: contain; display: block; }
.grille-scans .vignette.sans { display: grid; place-items: center; color: var(--band-muted); font-family: var(--display); font-weight: 800; font-size: 22px; }
.legende { padding: 6px 9px 8px; font-size: 13px; line-height: 1.3; }
.legende span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.legende small { color: var(--muted); }
.gestes { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; }
.grille-scans li:hover .gestes, .grille-scans li:focus-within .gestes { opacity: 1; }
.gestes a, .gestes button { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(20,22,26,.8); color: #fff; text-decoration: none; font: 700 16px/1 var(--body); cursor: pointer; }
.gestes button:hover { background: var(--err); }
.gestes a:hover { background: var(--accent); color: var(--accent-ink); }
.gestes form { margin: 0; }
.actions-scans { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.actions-scans form { margin: 0; }
.visionneuse { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 94vh; }
.visionneuse::backdrop { background: rgba(10,11,13,.9); }
.visionneuse img { max-width: 96vw; max-height: 94vh; display: block; }
.visionneuse button { position: fixed; top: 14px; right: 18px; background: none; border: 0; color: #fff; font-size: 38px; cursor: pointer; }

.puces { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.puces label { display: flex !important; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 500; }
.lien-galerie { display: flex; gap: 8px; }
.lien-galerie .champ { font-size: 13px; }

/* Connexion */
.ecran-connexion { min-height: 100vh; display: grid; place-items: center; background: var(--band); color: var(--band-ink); }
.connexion { width: min(420px, 90vw); }
.marque.grande { font-size: 58px; margin: 0; }
.marque.grande span { font-size: 16px; vertical-align: 12px; }
.connexion .sous { color: var(--band-muted); margin: 6px 0 28px; }
.connexion form { display: grid; gap: 10px; }
.connexion label { color: var(--band-muted); font-weight: 500; }
.connexion .champ { background: #1E2126; border-color: #2B3038; color: var(--band-ink); padding: 14px 16px; font-size: 17px; }
.connexion .btn { background: var(--accent); color: var(--accent-ink); padding: 15px; font-size: 17px; margin-top: 6px; }
.connexion .btn:hover { background: var(--band-ink); }

@media (max-width: 1000px) {
  .flux { grid-template-columns: repeat(3, 1fr); }
  .colonnes.larges { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .bandeau { position: static; }
  .barre-actions { top: 0; }
  .menu { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .cherche { flex: 1; } .cherche input { width: 100%; }
  .flux { grid-template-columns: repeat(2, 1fr); }
  .flux b { font-size: 38px; }
  .exp-corps { grid-template-columns: 1fr; }
  .tableau { font-size: 14px; }
  .tableau th:nth-child(n+5), .tableau td:nth-child(n+5) { display: none; }
  .carte { padding: 16px; }
  .champ.geant { font-size: 26px; }
  .scan-demande { text-align: left; }
}
