/* AutoDRS — système visuel (bandeau sombre, navigateur latéral, listes et formulaires d'enregistrement). */
:root {
  --banner: #032d42; --banner-2: #0a3c55; --banner-fg: #e8f0f4; --banner-muted: #9fb7c4;
  --brand: #62d84e; --primary: #0e5a6e; --primary-hover: #0a4757; --primary-soft: #e3f0f3;
  --bg: #f3f5f7; --surface: #ffffff; --surface-2: #f8fafb; --line: #dbe1e6; --line-strong: #c4ccd3;
  --text: #17262f; --text-2: #3d4f5a; --muted: #67777f; --focus: #2b7bd6;
  --ok: #1f7a3f; --ok-bg: #e2f3e6; --info: #0b62c1; --info-bg: #e3eefb;
  --warn: #9a5800; --warn-bg: #fcefd9; --bad: #bb2f2a; --bad-bg: #fbe5e3; --neutral: #5d6c74; --neutral-bg: #edf0f2;
  --radius: 8px; --shadow: 0 1px 2px rgba(16, 38, 50, .06), 0 1px 1px rgba(16, 38, 50, .04);
  --nav-w: 244px; --banner-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --banner: #021c2a; --banner-2: #072a3c; --bg: #10171c; --surface: #172128; --surface-2: #1b262e;
    --line: #283741; --line-strong: #34444f; --text: #e3eaee; --text-2: #c2ced5; --muted: #8fa0aa;
    --primary: #3fa5bd; --primary-hover: #58b7cd; --primary-soft: #16323c; --focus: #5aa2f0;
    --ok: #63c47f; --ok-bg: #173323; --info: #6aa8ef; --info-bg: #15283f; --warn: #eaa64a; --warn-bg: #3a2b12;
    --bad: #f08479; --bad-bg: #3d1c1a; --neutral: #9aa8b0; --neutral-bg: #222e35;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ico.sm { width: 15px; height: 15px; }
.ico.lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ------------------------------------------------------------------ bandeau */
.banner { position: fixed; inset: 0 0 auto 0; height: var(--banner-h); z-index: 30; display: flex; align-items: center;
  gap: 14px; padding: 0 16px; background: var(--banner); color: var(--banner-fg); border-bottom: 1px solid #00000033; }
.banner a { color: inherit; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; }
.brand small { font-weight: 400; color: var(--banner-muted); font-size: 12px; display: block; line-height: 1.1; }
.nav-toggle { display: none; background: none; border: 0; color: inherit; padding: 6px; border-radius: 6px; cursor: pointer; }
.banner-search { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.banner .banner-search input { width: 100%; height: 34px; border-radius: 18px; border: 1px solid #ffffff26; background: var(--banner-2);
  color: var(--banner-fg); padding: 0 14px 0 36px; font: inherit; }
.banner .banner-search input::placeholder { color: var(--banner-muted); }
.banner-search .ico { position: absolute; left: 12px; top: 8px; color: var(--banner-muted); }
.banner-right { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px;
  font-weight: 600; background: #ffffff14; border: 1px solid #ffffff22; white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--banner-muted); }
.chip.ok .dot { background: #5fd17a; } .chip.warn .dot { background: #f2b54d; } .chip.bad .dot { background: #ff7b6f; }
.chip.info .dot { background: #77b4f5; } .chip.alarm { background: #bb2f2a; border-color: #ff8f86; }
.icon-btn { position: relative; display: inline-flex; padding: 7px; border-radius: 8px; color: var(--banner-fg); }
.icon-btn:hover { background: #ffffff18; text-decoration: none; }
.icon-btn .count { position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #e5483f; color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: #ffffff18; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #04212f; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; }
.user-menu .menu { position: absolute; right: 0; top: 42px; width: 250px; background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px; }
.user-menu .menu .who { font-weight: 600; }
.user-menu .menu form { margin-top: 10px; }
.user-menu .menu button { width: 100%; }

/* ------------------------------------------------------------------ navigateur latéral */
.nav { position: fixed; top: var(--banner-h); bottom: 0; left: 0; width: var(--nav-w); z-index: 20; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line); padding: 12px 0 24px; }
.nav-filter { margin: 0 12px 10px; position: relative; }
.nav-filter input { width: 100%; height: 32px; padding: 0 10px 0 32px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.nav-filter .ico { position: absolute; left: 9px; top: 8px; color: var(--muted); }
.nav-group { margin-top: 6px; }
.nav-group > span { display: block; padding: 10px 18px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 16px 7px 18px; margin: 1px 8px; border-radius: 6px;
  color: var(--text-2); font-size: 13.5px; position: relative; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--brand); }
.nav a .badge-count { margin-left: auto; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 6px; }
.nav .hidden { display: none; }

/* ------------------------------------------------------------------ contenu */
.workspace { margin-left: var(--nav-w); padding-top: var(--banner-h); min-height: 100%; }
.content { padding: 18px 20px 40px; max-width: 1680px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.crumbs a { color: var(--muted); }
.page-head h1 { margin: 0; font-size: 21px; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.alert-bar { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px;
  border: 1px solid transparent; font-size: 13.5px; }
.alert-bar .ico { margin-top: 1px; }
.alert-bar.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert-bar.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-bar.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-bar.info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.alert-bar strong { color: inherit; }
.alert-bar .text { color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head .count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--neutral-bg); border-radius: 10px; padding: 0 8px; }
.card-body { padding: 14px 16px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.score { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px;
  border-top: 3px solid var(--line-strong); }
.score.ok { border-top-color: var(--ok); } .score.warn { border-top-color: var(--warn); }
.score.bad { border-top-color: var(--bad); } .score.info { border-top-color: var(--info); }
.score .label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.score .value { font-size: 22px; font-weight: 650; margin: 4px 0 2px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.score .value small { font-size: 13px; font-weight: 500; color: var(--muted); }
.score .detail { font-size: 12px; color: var(--muted); }

/* listes */
.list-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; }
.search input { height: 32px; padding: 0 10px 0 32px; min-width: 240px; }
.search .ico { position: absolute; left: 9px; top: 8px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.list { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.list th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; text-align: left; padding: 9px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tbody tr:hover td { background: color-mix(in srgb, var(--primary-soft) 55%, transparent); }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.list td.check, table.list th.check { width: 36px; padding-right: 0; }
table.list td.wrap .cell { white-space: normal; min-width: 190px; max-width: 360px; }
table.list .primary-cell { font-weight: 600; }
table.list .sub-row td { background: var(--surface-2); font-size: 12px; color: var(--muted); padding-top: 4px; padding-bottom: 6px; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty .ico { width: 28px; height: 28px; display: block; margin: 0 auto 6px; opacity: .6; }

/* pastilles */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 8px; border-radius: 11px; font-size: 12px; font-weight: 600;
  white-space: nowrap; line-height: 20px; background: var(--neutral-bg); color: var(--neutral); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.tag { display: inline-block; padding: 0 7px; border-radius: 4px; font-size: 11.5px; font-weight: 700; border: 1px solid var(--line-strong);
  color: var(--text-2); background: var(--surface); line-height: 19px; }
.tag.p0 { border-color: var(--bad); color: var(--bad); } .tag.p1 { border-color: var(--warn); color: var(--warn); }
.tag.p2 { border-color: var(--info); color: var(--info); }
.muted { color: var(--muted); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }

/* barres de capacité */
.bar { height: 6px; background: var(--neutral-bg); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.bar > i.warn { background: #d98b17; } .bar > i.bad { background: var(--bad); }
.bar-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.bar-line .bar { flex: 1; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}
.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}
.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* tuiles d'hôtes */
.sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.site h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hosts { display: grid; gap: 10px; }
.host { border: 1px solid var(--line); border-left: 4px solid var(--neutral); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.host.AVAILABLE { border-left-color: var(--ok); } .host.MAINTENANCE { border-left-color: var(--info); }
.host.FAILED { border-left-color: var(--bad); background: var(--bad-bg); } .host.SUSPECT { border-left-color: var(--warn); background: var(--warn-bg); }
.host-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; }
.host-name { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.host .meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.host .bar-line + .bar-line { margin-top: 4px; }
.host-pick { display: block; cursor: pointer; }
.host-pick input { margin-right: 8px; }

/* formulaires */
/* Styles de base à spécificité nulle : les composants (recherche, filtre du menu) les surchargent. */
:where(input[type=text], input[type=number], input[type=password], input:not([type]), select, textarea) {
  font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 6px 9px; max-width: 100%; }
:where(input, select, textarea):focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: middle; }
:where(textarea) { width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-section { padding: 14px 16px 6px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 20px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; font-weight: 400; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; font-size: 13.5px; color: var(--text); cursor: pointer; }
label.check input { margin-top: 2px; }
.switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2px 20px; }

/* boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { filter: brightness(.93); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }

/* onglets */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; font: inherit; font-size: 13.5px;
  font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel[hidden] { display: none; }

/* divers */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.reasons { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.reasons li { margin: 2px 0; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.steps li:last-child { border-bottom: 0; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--neutral-bg); color: var(--neutral); }
.steps .n.ok { background: var(--ok-bg); color: var(--ok); } .steps .n.bad { background: var(--bad-bg); color: var(--bad); }
.steps .n.info { background: var(--info-bg); color: var(--info); } .steps .n.warn { background: var(--warn-bg); color: var(--warn); }
.drawer summary { cursor: pointer; font-weight: 600; color: var(--primary); list-style: none; display: flex; align-items: center; gap: 6px; }
.drawer summary::-webkit-details-marker { display: none; }
details > summary { cursor: pointer; }
pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; margin: 6px 0 0; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px; max-height: 360px; overflow: auto; }
.confirm-box { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

/* connexion */
.login-page { min-height: 100%; display: grid; grid-template-columns: minmax(320px, 46%) 1fr; }
.login-brand { background: radial-gradient(1200px 600px at -10% 110%, #0f6b5d 0%, transparent 55%), linear-gradient(160deg, #032d42, #021c2a 70%);
  color: #e8f0f4; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand h1 { font-size: 30px; margin: 18px 0 8px; font-weight: 650; }
.login-brand p { color: #a9c1cd; max-width: 420px; }
.login-brand ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: #cfe0e8; }
.login-brand li { display: flex; gap: 10px; align-items: center; }
.login-brand li .ico { color: var(--brand); }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login-card .btn { width: 100%; height: 40px; }
.login-card .field input { height: 38px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* responsive */
@media (max-width: 1100px) { .grid.side { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .nav { transform: translateX(-100%); transition: transform .18s ease, visibility .18s; visibility: hidden; }
  body.nav-open .nav { transform: none; visibility: visible; box-shadow: 0 0 30px rgba(0,0,0,.25); }
  .workspace { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
  .banner-search { display: none; }
  .brand small { display: none; }
  .content { padding: 14px 16px 32px; }
  .login-page { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 20px; }
  .login-brand ul { display: none; }
}
@media (max-width: 560px) {
  .banner { gap: 8px; padding: 0 10px; }
  .banner-right { gap: 4px; }
  .banner-right .chip.mode, .user-menu .uname, .user-menu summary .ico, .brand > span { display: none; }
  .search input { min-width: 0; width: 100%; }
}
.mt { margin-top: 12px; } .mb0 { margin-bottom: 0; }

/* ------------------------------------------------------------------ aide */
.help-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; font-size: 12.5px;
  font-weight: 600; color: var(--banner-fg); border: 1px solid #ffffff33; }
.help-btn:hover, .help-btn.active { background: #ffffff18; text-decoration: none; }

.help-hero { background: linear-gradient(120deg, var(--banner) 0%, var(--banner-2) 60%, var(--primary) 100%); color: #fff;
  border-radius: 12px; padding: 26px 28px 22px; margin-bottom: 22px; }
.help-hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.help-hero h1 .ico { width: 26px; height: 26px; color: var(--brand); }
.help-hero p { margin: 0; max-width: 760px; color: #d6e4ea; font-size: 14.5px; line-height: 1.55; }
.help-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 20px; }
.help-paths a { display: flex; gap: 11px; align-items: flex-start; padding: 13px 14px; border-radius: 10px; color: #fff;
  background: #ffffff12; border: 1px solid #ffffff24; transition: background .15s; }
.help-paths a:hover { background: #ffffff22; text-decoration: none; }
.help-paths .ico { width: 20px; height: 20px; flex: none; color: var(--brand); margin-top: 1px; }
.help-paths strong { display: block; font-size: 14px; }
.help-paths span { display: block; font-size: 12.5px; color: #c4d6de; margin-top: 2px; line-height: 1.4; }

.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.doc-toc { position: sticky; top: calc(var(--banner-h) + 18px); max-height: calc(100vh - var(--banner-h) - 36px); overflow-y: auto;
  padding-right: 4px; font-size: 13px; }
.doc-toc .grp { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  margin: 16px 0 6px 10px; }
.doc-toc .grp:first-child { margin-top: 0; }
.doc-toc a { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 7px; color: var(--text-2); }
.doc-toc a .ico { width: 15px; height: 15px; color: var(--muted); flex: none; }
.doc-toc a:hover { background: var(--neutral-bg); text-decoration: none; color: var(--text); }
.doc-toc a.current { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.doc-toc a.current .ico { color: var(--primary); }

.doc { max-width: 960px; font-size: 14.5px; line-height: 1.65; color: var(--text); }
.doc section { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 26px 18px;
  margin-bottom: 20px; scroll-margin-top: calc(var(--banner-h) + 16px); box-shadow: var(--shadow); }
.doc h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.doc h2 .num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; font-size: 14px;
  background: var(--primary-soft); color: var(--primary); flex: none; }
.doc .lead { color: var(--muted); margin: 0 0 16px 42px; font-size: 14px; }
.doc h3 { font-size: 15px; margin: 22px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc h3:first-of-type { border-top: 0; padding-top: 0; }
.doc p { margin: 6px 0 12px; } .doc ul, .doc ol { margin: 6px 0 14px; padding-left: 22px; } .doc li { margin: 5px 0; }
.doc li::marker { color: var(--muted); }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--neutral-bg);
  padding: 1px 5px; border-radius: 4px; }
.doc .table-wrap { border: 1px solid var(--line); border-radius: 9px; margin: 10px 0 16px; }
.doc table.list { width: 100%; min-width: 0; font-size: 13.5px; }
.doc table.list td, .doc table.list th { white-space: normal; vertical-align: top; padding: 9px 12px; }
.doc table.list tbody tr:hover td { background: transparent; }
.doc table.list td:first-child { white-space: nowrap; }

.callout { display: flex; gap: 12px; padding: 12px 15px; border-radius: 9px; margin: 14px 0; font-size: 14px;
  background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.callout .ico { color: var(--info); flex: none; margin-top: 2px; }
.callout.warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.warn .ico { color: var(--warn); }
.callout.ok { background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.callout.ok .ico { color: var(--ok); }

.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 6px; }
.qa > div { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); }
.qa h4 { margin: 0 0 6px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.qa h4 .ico { color: var(--primary); }
.qa p { margin: 0; font-size: 13.5px; color: var(--text-2); }

.profiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 10px 0 14px; }
.profile { border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: 10px; padding: 14px 16px; }
.profile.p-vital { border-top-color: var(--bad); } .profile.p-prod { border-top-color: var(--info); } .profile.p-sac { border-top-color: var(--ok); }
.profile h4 { margin: 0; font-size: 15px; }
.profile .ex { color: var(--muted); font-size: 12.5px; margin: 2px 0 10px; }
.profile dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 13px; }
.profile dt { color: var(--muted); } .profile dd { margin: 0; font-weight: 600; }
.profile .then { margin: 12px 0 0; font-size: 13px; color: var(--text-2); border-top: 1px dashed var(--line); padding-top: 9px; }

.timeline { list-style: none; padding: 0 !important; margin: 12px 0 14px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-left: 46px; margin: 0 0 16px; }
.timeline li .step { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--primary); color: var(--primary); font-weight: 700; font-size: 13px; }
.timeline li.bad .step { border-color: var(--bad); color: var(--bad); } .timeline li.warn .step { border-color: var(--warn); color: var(--warn); }
.timeline li.ok .step { border-color: var(--ok); color: var(--ok); }
.timeline strong.t { display: block; font-size: 14.5px; margin-bottom: 2px; padding-top: 4px; }

.modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 10px 0 14px; }
.modes > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; position: relative; }
.modes > div.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.modes h4 { margin: 0 0 8px; font-size: 14px; }
.modes .on-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: -2px 0 8px; }
.modes p { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.modes p b { color: var(--text); font-weight: 600; }

.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 10px; }
.pages-grid a { display: flex; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.pages-grid a:hover { border-color: var(--primary); text-decoration: none; background: var(--primary-soft); }
.pages-grid .ico { color: var(--primary); flex: none; margin-top: 2px; }
.pages-grid strong { display: block; font-size: 13.5px; } .pages-grid span { display: block; font-size: 12.5px; color: var(--muted); }

@media (max-width: 1200px) { .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .doc-layout { grid-template-columns: 1fr; } .doc-toc { display: none; }
  .profiles, .qa { grid-template-columns: 1fr; }
}
@media (max-width: 900px) { .help-btn span { display: none; } }
@media (max-width: 560px) { .modes { grid-template-columns: 1fr; } .doc section { padding: 18px 16px; } .doc .lead { margin-left: 0; } }
