/* CLIKSPAM — feuille de style commune des portails. Aucune police ni ressource externe. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --text: #17212b;
  --muted: #5d6b7a;
  --border: #d9e0e7;
  --brand: #0f6e8c;
  --brand-strong: #0b5670;
  --brand-ink: #ffffff;
  --sidebar: #0f2233;
  --sidebar-text: #c9d6e2;
  --ok: #1d8a4e;
  --ok-bg: #e3f4ea;
  --warn: #b35c00;
  --warn-bg: #fdf0e1;
  --danger: #c0352b;
  --danger-bg: #fbe7e5;
  --info-bg: #e5f1f7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 34, 51, .06), 0 2px 8px rgba(16, 34, 51, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151c;
    --surface: #16212b;
    --surface-2: #1d2a36;
    --text: #e3eaf1;
    --muted: #93a3b3;
    --border: #2a3a49;
    --brand: #3aa7c9;
    --brand-strong: #63bcd8;
    --brand-ink: #071016;
    --sidebar: #0a1118;
    --ok: #4cc584;
    --ok-bg: #12301f;
    --warn: #f0a24a;
    --warn-bg: #3a2610;
    --danger: #f0776c;
    --danger-bg: #3a1714;
    --info-bg: #13293a;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: .5rem 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, pre, .mono { font-family: var(--mono); font-size: .9em; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--surface-2); padding: 1rem;
  border-radius: var(--radius); max-height: 70vh; overflow: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Coque : barre latérale + contenu --- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 1.25rem 1rem;
  display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 700;
  letter-spacing: .04em; flex-wrap: wrap; }
.brand:hover { text-decoration: none; }
.brand small { width: 100%; font-weight: 500; letter-spacing: 0; color: var(--sidebar-text); font-size: .8rem; }
.logo { width: 28px; height: 28px; color: #6fd0ea; flex: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: var(--sidebar-text); padding: .55rem .75rem; border-radius: 8px; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: rgba(111, 208, 234, .14); color: #fff; font-weight: 600; }
.sidebar hr { border-top-color: rgba(255, 255, 255, .12); }
.who { margin-top: auto; font-size: .85rem; display: flex; flex-direction: column; gap: .25rem;
  overflow-wrap: anywhere; }
.who .link { color: #8fdcf0; }
.main { padding: 1.75rem 2rem 3rem; min-width: 0; max-width: 1280px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: .75rem 1rem; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .who { flex-direction: row; justify-content: space-between; margin-top: 0; }
  .main { padding: 1rem; }
}

/* --- Pages publiques (connexion, liens d'action) --- */
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 1.5rem 1rem; gap: 1rem; }
.public-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; letter-spacing: .04em;
  font-size: 1.2rem; color: var(--brand); }
.public-brand .logo { color: var(--brand); width: 34px; height: 34px; }
.public-footer { color: var(--muted); font-size: .8rem; }

/* --- Blocs --- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; }
.card + .card { margin-top: 1rem; }
.card.narrow { width: 100%; max-width: 440px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .value { font-size: 1.75rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }

/* --- Onglets (vues) --- */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--border);
  margin-bottom: 1rem; }
.tabs a { padding: .55rem .9rem; color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .count { background: var(--surface-2); border-radius: 99px; padding: 0 .45rem;
  font-size: .75rem; margin-left: .3rem; }

/* --- Tableaux --- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: var(--surface-2); }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* --- Pastilles --- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .55rem; border-radius: 99px;
  font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted);
  white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--info-bg); color: var(--brand); }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Jauge du score de confiance : 0-39 dangereux, 40-69 incertain, 70-100 fiable */
.gauge { position: relative; height: 10px; border-radius: 99px; margin: .75rem 0 .35rem;
  background: linear-gradient(90deg, var(--danger) 0 39%, var(--warn) 39% 69%, var(--ok) 69% 100%); }
.gauge-marker { position: absolute; top: -4px; width: 4px; height: 18px; background: var(--text);
  border-radius: 2px; transform: translateX(-2px); }
.gauge-legend { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.score-big { display: flex; align-items: center; gap: 1rem; }
.score-big .num { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.score-big .num.ok { color: var(--ok); }
.score-big .num.warn { color: var(--warn); }
.score-big .num.danger { color: var(--danger); }

/* Lignes du détail du calcul */
.calc { list-style: none; margin: 0; padding: 0; }
.calc li { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0;
  border-bottom: 1px dashed var(--border); }
.calc li:last-child { border-bottom: 0; }
.delta { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.minus { color: var(--danger); }
.delta.plus { color: var(--ok); }

/* --- Formulaires et boutons --- */
form.inline { display: inline; }
.form-grid { display: grid; gap: .9rem; }
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label, .label { font-weight: 600; font-size: .9rem; }
.field .hint { color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=search], input[type=number], input[type=password],
input[type=url], input[type=date], input[type=datetime-local], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .55rem .7rem; width: 100%; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px; }
textarea { min-height: 7rem; }
.checks { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.checks label { font-weight: 400; display: inline-flex; align-items: center; gap: .3rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.btn, button { font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: .4rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; }
.btn:hover, button:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.ok, button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small, button.small { padding: .25rem .6rem; font-size: .85rem; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 500; }
button[disabled], .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar input[type=search] { max-width: 340px; }

/* --- Messages d'état --- */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.flash-info { background: var(--info-bg); color: var(--text); border-color: var(--brand); }
.callout { border-left: 4px solid var(--brand); background: var(--info-bg); padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0; }
.callout.danger { border-left-color: var(--danger); background: var(--danger-bg); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout.ok { border-left-color: var(--ok); background: var(--ok-bg); }

/* --- Listes de définitions (détails) --- */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

/* --- Étapes (déploiement client) --- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: flex; gap: .75rem; padding: .75rem 0;
  border-bottom: 1px solid var(--border); }
.steps li::before { content: counter(step); flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .85rem; }
.steps li.done::before { content: "✓"; background: var(--ok); color: #fff; }
.steps li.todo::before { background: var(--warn-bg); color: var(--warn); }

.pagination { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
