/* QG du Groupe — identité du Groupe Hookette (nom provisoire). Indépendant de l’habillage de la plateforme REA. */
:root {
  color-scheme: light;
  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --bg: #f6f4ef;
  --bg-2: #efece4;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e4e0d6;
  --line-strong: #cfc9bb;
  --ink: #16202f;
  --ink-2: #4a5465;
  --ink-3: #737b88;
  --navy: #16243f;
  --navy-2: #22365c;
  --gold: #c98a12;
  --gold-strong: #a86f05;
  --gold-soft: #fbf0d9;
  --good: #1f7a4d;
  --good-soft: #e2f3ea;
  --warn: #9a5b00;
  --warn-soft: #fdf0d6;
  --bad: #b8322a;
  --bad-soft: #fce9e7;
  --info: #2c5fa8;
  --info-soft: #e6eefa;
  --focus: #2c5fa8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(22, 32, 47, 0.05), 0 6px 20px rgba(22, 32, 47, 0.05);
  --shadow-lift: 0 2px 4px rgba(22, 32, 47, 0.06), 0 12px 32px rgba(22, 32, 47, 0.09);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='clair']) {
    color-scheme: dark;
    --bg: #0f1420;
    --bg-2: #141a28;
    --surface: #171e2d;
    --surface-2: #1b2334;
    --line: #273146;
    --line-strong: #364259;
    --ink: #eceae4;
    --ink-2: #b9bfcb;
    --ink-3: #8c94a3;
    --navy: #e8edf7;
    --navy-2: #c4d0e6;
    --gold: #f2b544;
    --gold-strong: #f6c66a;
    --gold-soft: #3a2d12;
    --good: #5ccc93;
    --good-soft: #15312a;
    --warn: #f0b858;
    --warn-soft: #382a10;
    --bad: #f28b82;
    --bad-soft: #3d1c1c;
    --info: #8db4f0;
    --info-soft: #1b2a45;
    --focus: #8db4f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 8px 28px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme='sombre'] {
  color-scheme: dark;
  --bg: #0f1420;
  --bg-2: #141a28;
  --surface: #171e2d;
  --surface-2: #1b2334;
  --line: #273146;
  --line-strong: #364259;
  --ink: #eceae4;
  --ink-2: #b9bfcb;
  --ink-3: #8c94a3;
  --navy: #e8edf7;
  --navy-2: #c4d0e6;
  --gold: #f2b544;
  --gold-strong: #f6c66a;
  --gold-soft: #3a2d12;
  --good: #5ccc93;
  --good-soft: #15312a;
  --warn: #f0b858;
  --warn-soft: #382a10;
  --bad: #f28b82;
  --bad-soft: #3d1c1c;
  --info: #8db4f0;
  --info-soft: #1b2a45;
  --focus: #8db4f0;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 8px 28px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 14px; background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-lift); }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 24px; text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Démarrage, chargement ─────────────────────────────────────────────── */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--ink-3); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-strong); border-top-color: var(--gold); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { background: linear-gradient(90deg, var(--bg-2) 0%, var(--surface-2) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ─── Connexion ─────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-art { background: #16243f; color: #eef1f6; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 48px solid rgba(242, 181, 68, 0.09); }
.login-art .brand { color: #fff; }
.login-art h2 { font-size: 2rem; max-width: 420px; font-weight: 650; }
.login-art p { color: #b9c3d6; max-width: 420px; margin-top: 12px; }
.login-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login-card h1 { font-size: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.input { width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn.primary { background: #16243f; border-color: #16243f; color: #fff; }
.btn.primary:hover { background: #22365c; }
:root[data-theme='sombre'] .btn.primary { background: var(--gold); border-color: var(--gold); color: #1b1404; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='clair']) .btn.primary { background: var(--gold); border-color: var(--gold); color: #1b1404; } }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.icon { padding: 8px; }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.92rem; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.info { background: var(--info-soft); color: var(--info); }

/* ─── Structure ─────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand small { display: block; font-weight: 500; color: var(--ink-3); font-size: 0.78rem; letter-spacing: 0; }
.login-art .brand small { color: #9fb0cc; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 0.93rem; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: var(--bg-2); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a .code { font-size: 0.72rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); color: var(--ink-2); }
.nav a[aria-current='page'] .code { background: var(--gold-soft); color: var(--gold-strong); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.who { color: var(--ink-3); font-size: 0.88rem; margin-right: 6px; }
main { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 28px; }
.foot { max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; color: var(--ink-3); font-size: 0.85rem; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

/* Téléphone : barre d’onglets en bas, comme une application */
.tabbar { display: none; }
@media (max-width: 820px) {
  .nav, .who { display: none; }
  .top-in { padding: 10px 16px; }
  main { padding: 20px 16px 104px; gap: 22px; }
  .foot { padding: 0 16px 104px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; text-decoration: none; color: var(--ink-3); font-size: 0.72rem; font-weight: 600; border-radius: 10px; }
  .tabbar a[aria-current='page'] { color: var(--ink); background: var(--bg-2); }
  .tabbar a[aria-current='page'] svg { color: var(--gold-strong); }
  .tabbar svg.i { width: 22px; height: 22px; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 22px; min-height: auto; }
  .login-art h2 { font-size: 1.4rem; margin-top: 28px; }
  .login-art::after { width: 220px; height: 220px; right: -90px; bottom: -90px; border-width: 30px; }
}

/* ─── En-tête de page ───────────────────────────────────────────────────── */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-strong); display: flex; align-items: center; gap: 8px; }
.eyebrow a { text-decoration: none; color: var(--ink-3); text-transform: none; letter-spacing: 0; font-weight: 600; }
.eyebrow a:hover { color: var(--ink); }
.head h1 { font-size: 1.9rem; font-weight: 720; margin-top: 6px; }
.head .meta { color: var(--ink-3); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 0.92rem; }
@media (max-width: 820px) { .head h1 { font-size: 1.5rem; } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; background: var(--bg-2); color: var(--ink-2); }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--gold-soft); color: var(--gold-strong); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ─── Sections ──────────────────────────────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.15rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-head .hint { color: var(--ink-3); font-size: 0.88rem; }
.count { display: inline-flex; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; align-items: center; justify-content: center; background: var(--navy); color: var(--bg); font-size: 0.8rem; font-weight: 700; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Alertes */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert.bloquant { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.alert.attention { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }
.alert strong { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.alert p { color: var(--ink); }

/* Décisions */
.decisions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) { .decisions { grid-template-columns: 1fr; } }
.decision { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; border-left: 4px solid var(--gold); transition: box-shadow 0.15s, transform 0.15s; }
.decision:hover { box-shadow: var(--shadow-lift); }
.decision.late { border-left-color: var(--bad); }
.decision-top { display: flex; gap: 14px; align-items: flex-start; }
.numero { flex: none; min-width: 54px; padding: 6px 8px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-strong); text-align: center; line-height: 1.1; }
.numero small { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.numero b { font-size: 1.2rem; }
.decision.late .numero { background: var(--bad-soft); color: var(--bad); }
.decision h3 { font-size: 1.02rem; font-weight: 650; }
.decision .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dl { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dl div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.dl dt { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
.dl dd { margin: 3px 0 0; }
.answer { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 0.86rem; padding-top: 2px; }
.answer b { color: var(--ink-2); }
.answered { padding: 0; }
.answered summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
.answered summary::-webkit-details-marker { display: none; }
.answered summary svg { transition: transform 0.15s; }
.answered[open] summary svg { transform: rotate(90deg); }
.answered ul { list-style: none; margin: 0; padding: 0 18px 12px; }
.answered li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.answered li b { color: var(--ink-3); min-width: 48px; }

/* Frise du plan */
.plan { padding: 22px 22px 18px; }
.frise { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); position: relative; }
.frise::before { content: ''; position: absolute; top: 17px; left: calc(100% / 18); right: calc(100% / 18); height: 3px; border-radius: 3px; background: var(--line); }
.frise li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 4px; }
.pastille { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-3); }
.frise li.fait .pastille { background: var(--good); border-color: var(--good); color: var(--surface); }
.frise li.en_cours .pastille { border-color: var(--gold); color: var(--gold-strong); }
.frise li.actuelle .pastille { background: var(--gold); border-color: var(--gold); color: #1b1404; box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 22%, transparent); }
.frise .titre { font-size: 0.8rem; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.frise li.actuelle .titre { color: var(--ink); }
.frise li.inconnue .titre { color: var(--ink-3); font-weight: 500; }
.plan-now { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--gold-soft); display: flex; gap: 12px; align-items: flex-start; }
.plan-now svg { color: var(--gold-strong); margin-top: 2px; }
.plan-now b { display: block; }
.plan-now p { color: var(--ink-2); }
@media (max-width: 820px) {
  .frise { grid-template-columns: 1fr; gap: 0; }
  .frise::before { top: 18px; bottom: 18px; left: 17px; right: auto; width: 3px; height: auto; }
  .frise li { flex-direction: row; text-align: left; padding: 6px 0; gap: 12px; }
  .frise .titre { font-size: 0.92rem; }
}

/* Sociétés */
.companies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .companies { grid-template-columns: 1fr; } }
.company { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s; }
.company:hover { box-shadow: var(--shadow-lift); border-color: var(--line-strong); transform: translateY(-1px); }
.company-top { display: flex; align-items: center; gap: 12px; }
.mono { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--navy); color: var(--bg); flex: none; }
.company h3 { font-size: 1.05rem; }
.company .sub { color: var(--ink-3); font-size: 0.86rem; }
.company .go { margin-left: auto; color: var(--ink-3); }
.company:hover .go { color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.kpi .l { font-size: 0.74rem; color: var(--ink-3); font-weight: 600; }
.kpi .v { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }

/* Chiffres */
.groups { display: flex; flex-direction: column; gap: 26px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.tile { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 6px; min-height: 132px; }
.tile .t { font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.tile .v { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.tile .v .u { font-size: 0.95rem; font-weight: 600; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.tile .src { margin-top: auto; font-size: 0.78rem; color: var(--ink-3); line-height: 1.35; }
.tile .src .late { color: var(--warn); font-weight: 600; }
.tile.non_mesure { background: transparent; border-style: dashed; box-shadow: none; }
.tile.non_mesure .v { font-size: 1.05rem; font-weight: 600; color: var(--ink-3); font-style: italic; letter-spacing: 0; padding: 6px 0; }
.tile.non_a_jour .v { color: var(--ink-2); }
@media (max-width: 520px) { .tile { min-height: 120px; padding: 13px; } .tile .v { font-size: 1.35rem; } }

/* Outils */
.tools { display: flex; flex-direction: column; }
.tool { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--line); }
.tool:first-child { border-top: 0; }
.tool .grow { flex: 1; min-width: 0; }
.tool h3 { font-size: 1rem; }
.tool p { color: var(--ink-3); font-size: 0.88rem; }
@media (max-width: 520px) { .tool { flex-wrap: wrap; } .tool .badge { margin-left: 54px; } }

/* États vides et erreurs */
.empty { padding: 44px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; background: var(--gold-soft); color: var(--gold-strong); }
.empty .ic svg { width: 26px; height: 26px; }
.empty h2 { font-size: 1.15rem; }
.empty p { color: var(--ink-3); max-width: 460px; }
.empty.small { padding: 24px; }

.fade { animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Finitions */
.head .meta > span { display: inline-flex; align-items: center; gap: 6px; }
.head .meta svg.i { width: 16px; height: 16px; }
.brand img { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.login-art .brand img { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); }
.badge svg.i { width: 13px; height: 13px; }
.answer svg.i, .eyebrow svg.i { width: 15px; height: 15px; }
