/* Espace client QG du Diag. Charte : noir #0A0A0A, vert QG #05A68C, Helvetica. */
:root {
  --ink: #0A0A0A;
  --ground: #F4F5F3;
  --surface: #FFFFFF;
  --line: #E2E4E0;
  --line-soft: #EEF0EC;
  --muted: #5B5F5C;
  --brand: #05A68C;
  --brand-text: #047A67;
  --brand-dark: #035C4E;
  --brand-tint: #E6F6F3;
  --brand-on-dark: #5FD8C2;
  --urgent: #B42318;
  --urgent-tint: #FDECEA;
  --warn: #8A4B08;
  --warn-tint: #FEF3E2;
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45; }
a { color: var(--brand-text); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 20px; font-weight: 800; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Coque : menu + contenu */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.nav { flex: 1 1 248px; background: var(--ink); padding: 28px 18px; display: flex; flex-direction: column; gap: 26px; color: #C9CCCA; }
.nav .logo { width: 150px; margin-left: 6px; display: block; }
.nav .account { background: #141716; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.nav .eyebrow { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #9A9E9B; }
.nav .account strong { color: #FFF; font-size: 15px; }
.nav .account span { font-size: 13px; color: #9A9E9B; }
.nav .group { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.nav .group .eyebrow { padding: 0 12px 8px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: #C9CCCA; text-decoration: none; }
.nav a:hover { color: #FFF; background: #1A1D1C; }
.nav a[aria-current="page"] { background: #10302B; color: var(--brand-on-dark); font-weight: 600; }
.nav a svg, .nav .foot svg { flex: none; }
.nav .badge { margin-left: auto; background: var(--brand); color: var(--ink); font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 8px; }
.nav .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.nav .foot .note { display: flex; align-items: center; gap: 8px; color: #9A9E9B; padding: 0 12px; }
.nav form button { all: unset; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: #C9CCCA; width: 100%; box-sizing: border-box; }
.nav form button:hover { color: #FFF; background: #1A1D1C; }
.nav form button:focus-visible, .nav a:focus-visible { outline: 2px solid var(--brand-on-dark); outline-offset: 2px; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 26px; }
@media (max-width: 720px) {
  .main { padding: 24px 16px 48px; }
  .nav { padding: 20px 14px; }
}

/* Blocs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.card.dark { background: var(--ink); color: #FFF; border-color: var(--ink); }
.card.dark p { color: #C9CCCA; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; }
.card-head h2 { flex: 1 1 auto; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-2 { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-1 { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat .label, .stat .sub, .muted { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 800; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.header .titles { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--ink); color: var(--brand-on-dark); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.who { display: flex; align-items: center; gap: 10px; }
.who div { display: flex; flex-direction: column; font-size: 14px; }

.alert { background: var(--ink); color: #FFF; border-radius: 14px; padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.alert .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.alert .body { flex: 1 1 360px; display: flex; flex-direction: column; gap: 4px; }
.alert .kicker { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brand-on-dark); font-weight: 700; }
.alert .title { font-size: 18px; font-weight: 700; }
.alert .meta { font-size: 14px; color: #C9CCCA; }

.flash { border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.flash.ok { background: var(--brand-tint); color: var(--brand-dark); }
.flash.err { background: var(--urgent-tint); color: var(--urgent); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--brand); color: var(--ink); }
.btn-primary:hover { background: #049A82; color: var(--ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: #DADDD8; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-on-dark { background: transparent; color: #FFF; border-color: #3A3F3D; }
.btn-on-dark:hover { color: #FFF; border-color: #FFF; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn:focus-visible { outline: 3px solid var(--brand-text); outline-offset: 2px; }
.lnk { color: var(--brand-text); font-weight: 600; text-decoration: none; }
.lnk:hover { text-decoration: underline; }

/* Puces de statut */
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.chip.urgent { background: var(--urgent-tint); color: var(--urgent); }
.chip.attention { background: var(--warn-tint); color: var(--warn); }
.chip.info { background: var(--brand-tint); color: var(--brand-dark); }
.chip.ok { background: var(--brand-tint); color: var(--brand-dark); }
.chip.neutre { background: var(--ground); color: #3F4341; }

/* Dossier dans une liste */
.ao { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.ao:hover { border-color: var(--brand); color: var(--ink); }
.ao .top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ao .name { font-size: 16px; font-weight: 700; flex: 1 1 280px; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.steps .bar { height: 6px; border-radius: 3px; background: var(--line); }
.steps .bar.done { background: var(--brand); }
.steps .lbl { font-size: 12px; color: var(--muted); }
.steps .lbl.current { color: var(--brand-text); font-weight: 700; }

/* Listes */
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.list-item:last-child { border-bottom: none; }
a.list-item:hover { color: var(--brand-dark); }
.list-item .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.list-item .txt strong { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.ext { width: 38px; height: 38px; border-radius: 8px; background: var(--ground); display: flex; align-items: center; justify-content: center; flex: none; font-size: 10px; font-weight: 800; color: #3F4341; }
.date-box { flex: none; width: 52px; text-align: center; border-radius: 10px; background: var(--ground); padding: 6px 0; display: flex; flex-direction: column; }
.date-box .m { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.date-box .d { font-size: 20px; font-weight: 800; }
.date-box.visio { background: var(--brand-tint); }
.date-box.visio .m, .date-box.visio .d { color: var(--brand-dark); }
.date-box.depot { background: var(--urgent-tint); }
.date-box.depot .m, .date-box.depot .d { color: var(--urgent); }
.todo li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li:last-child { border-bottom: none; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--brand-text); margin-top: 6px; }

/* Parcours vertical */
.timeline { display: flex; flex-direction: column; }
.tl { display: flex; gap: 14px; }
.tl .rail { display: flex; flex-direction: column; align-items: center; }
.tl .dot { width: 26px; height: 26px; border-radius: 13px; border: 2px solid #C9CCCA; background: var(--surface); flex: none; display: flex; align-items: center; justify-content: center; }
.tl .dot.done { background: var(--brand); border-color: var(--brand); }
.tl .dot.current { border: 3px solid var(--brand); }
.tl .line { width: 2px; flex: 1 1 auto; min-height: 26px; background: #DADDD8; }
.tl .line.done { background: var(--brand); }
.tl .txt { display: flex; flex-direction: column; gap: 2px; padding-bottom: 16px; }
.tl .txt strong { font-size: 15px; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 700; }
td { padding: 12px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: none; }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: 18px; }
label.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=file], textarea {
  min-height: 46px; border: 1px solid #C9CCCA; border-radius: 8px; padding: 10px 14px; font-size: 15px; font-family: inherit; background: #FFF; color: var(--ink); width: 100%;
}
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; border-color: var(--brand-text); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.error { color: var(--urgent); font-size: 13px; font-weight: 600; }
.inline-form { display: inline; }

/* Écrans de connexion */
.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-brand { flex: 1 1 420px; background: var(--ink); color: #FFF; padding: 56px; display: flex; flex-direction: column; gap: 40px; }
.auth-brand img { width: 190px; }
.auth-brand .pitch { margin-top: auto; display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.auth-brand .pitch .kicker { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--brand-on-dark); font-weight: 700; }
.auth-brand .pitch h1 { font-size: 42px; line-height: 1.1; }
.auth-brand .pitch p { font-size: 17px; color: #C9CCCA; line-height: 1.55; }
.auth-brand .trust { display: flex; flex-wrap: wrap; gap: 22px; font-size: 13px; color: #9A9E9B; }
.auth-brand .trust span { display: flex; align-items: center; gap: 8px; }
.auth-panel { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 48px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #FFF; border: 1px solid var(--line); border-radius: 16px; padding: 36px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 720px) {
  .auth-brand { padding: 32px 20px; gap: 24px; }
  .auth-brand .pitch h1 { font-size: 30px; }
  .auth-card { padding: 24px; }
}
.qr { background: #FFF; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: inline-block; }
.qr svg { display: block; width: 200px; height: 200px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: var(--ground); padding: 14px; border-radius: 10px; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; }

/* Recherche et navigation dans les dossiers */
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row input { flex: 1 1 auto; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; padding: 4px 0; color: var(--muted); }
.crumbs strong { color: var(--ink); }
.ext.folder { background: var(--brand-tint); color: var(--brand-dark); }
.preview-bar { background: #FEF3E2; color: var(--warn); border-radius: 10px; padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; }
.source { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.source:last-child { border-bottom: none; }
.source .txt { flex: 1 1 300px; display: flex; flex-direction: column; gap: 2px; }
