:root {
  --ink: #0b1b2b; --ink2: #3d4f63; --mute: #74859a; --line: #e2e8ef; --bg: #f4f6f9; --card: #fff;
  --brand: #0f766e; --brand2: #e5f4f2; --brand-ink: #0b4f4a; --navy: #0d1f30; --navy2: #15304a;
  --ok: #157f3b; --okbg: #e7f6ec; --warn: #a15c07; --warnbg: #fff3df; --danger: #b42318; --dangerbg: #fdecea;
  --r: 12px; --shadow: 0 1px 2px rgba(13,31,48,.05), 0 8px 24px rgba(13,31,48,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin: 0 0 10px; font-weight: 700; }
.muted { color: var(--mute); } .small { font-size: 12.5px; } .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 9px; padding: 8px 14px; font-weight: 550; }
button:hover { border-color: #c4cfdb; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
button.primary:hover { background: #0c5f59; }
button.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
button.danger { color: var(--danger); }
button.sm { padding: 5px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid #b9e3de; border-color: var(--brand); }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink2); font-weight: 600; }
.grid { display: grid; gap: 14px; } .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)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); padding: 9px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
td { padding: 11px 12px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f7fafc; }
.empty { text-align: center; color: var(--mute); padding: 34px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: #eef2f6; color: var(--ink2); white-space: nowrap; }
.pill.ok { background: var(--okbg); color: var(--ok); } .pill.warn { background: var(--warnbg); color: var(--warn); }
.pill.danger { background: var(--dangerbg); color: var(--danger); } .pill.brand { background: var(--brand2); color: var(--brand-ink); }
.kpi .l { color: var(--mute); font-size: 12.5px; } .kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--mute); font-size: 12px; }

/* coque éditeur */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c8d6e5; padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; gap: 10px; align-items: center; padding: 0 8px; color: #fff; }
.logo b { font-size: 16px; display: block; } .logo small { color: #7f9ab5; font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a { color: #c8d6e5; padding: 10px 12px; border-radius: 9px; display: flex; gap: 10px; align-items: center; text-decoration: none; }
.nav a:hover { background: var(--navy2); } .nav a.on { background: #fff; color: var(--navy); font-weight: 650; }
.side .foot { margin-top: auto; font-size: 12px; color: #7f9ab5; padding: 0 8px; }
.side .foot button { margin-top: 8px; background: transparent; color: #c8d6e5; border-color: #2a4560; }
main { padding: 28px 34px 50px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.top .sub { color: var(--mute); }

/* barres */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 8px; }
.bars div { flex: 1; background: var(--brand2); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; }
.bars div b { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--ink2); }
.bars div span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--mute); }
.bars div.last { background: var(--brand); }

/* modales, toasts */
.modal { position: fixed; inset: 0; background: rgba(8,20,32,.5); display: grid; place-items: center; z-index: 50; padding: 18px; }
.modal-box { background: #fff; border-radius: 16px; padding: 22px 24px; width: min(620px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-box.wide { width: min(920px, 100%); }
.modal-box .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-box .head h2 { margin: 0; }
.foot-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.x { border: 0; background: none; font-size: 18px; color: var(--mute); padding: 4px 8px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 90; }
.toast.err { background: var(--danger); }
.codebox { font-family: "Cascadia Mono", Consolas, monospace; font-size: 20px; letter-spacing: .08em; background: var(--brand2); color: var(--brand-ink); padding: 12px 16px; border-radius: 10px; display: inline-flex; gap: 12px; align-items: center; }
.keybox { font-family: Consolas, monospace; font-size: 11.5px; word-break: break-all; background: #f4f6f9; border: 1px dashed #c4cfdb; padding: 10px; border-radius: 8px; max-height: 140px; overflow: auto; }

/* connexion */
.auth { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 10% 0%, #134e4a 0%, transparent 60%), linear-gradient(160deg, #0d1f30, #0b2a3c); padding: 18px; }
.auth .box { background: #fff; border-radius: 18px; padding: 34px; width: min(400px, 100%); box-shadow: 0 30px 80px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 12px; }
.auth h1 { font-size: 22px; } .err { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }
.busy { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* espace client */
.cl-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.cl-top .in { max-width: 1120px; margin: 0 auto; padding: 14px 22px; display: flex; align-items: center; gap: 22px; }
.cl-top .logo { color: var(--ink); padding: 0; } .cl-top .logo small { color: var(--mute); }
.cl-nav { display: flex; gap: 4px; }
.cl-nav a { color: var(--ink2); padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 550; }
.cl-nav a.on { background: var(--brand2); color: var(--brand-ink); }
.cl-main { max-width: 1120px; margin: 0 auto; padding: 28px 22px 60px; }
.hero { background: linear-gradient(120deg, #0d1f30, #0f4f4a); color: #fff; border-radius: 16px; padding: 26px 28px; margin-bottom: 20px; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero h1 { color: #fff; } .hero p { margin: 4px 0 0; color: #b7d3d0; }

/* assistant de téléchargement */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps div { flex: 1; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.steps div b { display: block; color: var(--ink2); font-size: 13.5px; }
.steps div.on { border-color: var(--brand); box-shadow: 0 0 0 3px #b9e3de; } .steps div.on b { color: var(--brand-ink); }
.steps div.done { background: var(--brand2); border-color: var(--brand2); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.choice { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; background: #fff; position: relative; }
.choice:hover { border-color: #a9bdcf; } .choice.on { border-color: var(--brand); background: #f5fbfa; box-shadow: 0 0 0 3px #d4efeb; }
.choice .ic { font-size: 24px; } .choice b { display: block; margin: 6px 0 2px; font-size: 14.5px; } .choice p { margin: 0; color: var(--mute); font-size: 12.5px; }
.choice.on::after { content: "✓"; position: absolute; top: 12px; right: 14px; color: var(--brand); font-weight: 800; }
.choice.disabled { opacity: .45; cursor: not-allowed; }
.howto li { margin: 6px 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; }
  .g4, .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } main { padding: 20px 16px; }
  .cl-top .in { flex-wrap: wrap; } .steps { flex-direction: column; }
}

select.langsel { width: auto; padding: 5px 9px; font-size: 12.5px; }
html.rtl .num { text-align: left; } html.rtl th { text-align: right; }
html.rtl .choice.on::after { right: auto; left: 14px; }
html.rtl code, html.rtl .mono, html.rtl .codebox, html.rtl .keybox { direction: ltr; }
