/* webadmin – wenesec brand (logo #41a2da / #233d51, accent #0065cb, dark #0d1821) */
:root {
  color-scheme: light;
  --bg: #eef6fc; --panel: #ffffff; --panel2: #f5faff; --line: #cfe3f3; --line2: #e4f0fa;
  --text: #13283a; --muted: #557089; --heading: #233d51;
  --accent: #0065cb; --accent2: #0057ad; --accent-soft: #dcecfa; --brand: #41a2da; --brand-dark: #233d51;
  --side: #dfeefa; --side-hover: #cbe3f6; --on-accent: #ffffff;
  --ok: #1a8f5f; --ok-soft: #e0f5ec; --ok-line: #b6e5d1;
  --warn: #b77c06; --warn-soft: #fdf3dc;
  --err: #c93a34; --err-soft: #fde8e7; --err-line: #f2c2bf;
  --mute-soft: #eef2f6; --mute: #6b8199;
  --input: #ffffff; --input-line: #b9d6ee; --focus: #9ccdf3;
  --code: #f3f8fd; --grid: #e3eef8; --axis: #6f8fae;
  --logo-dark: #233d51; --logo-light: #41a2da;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1821; --panel: #13222f; --panel2: #172a39; --line: #22394c; --line2: #1b3041;
    --text: #e2edf6; --muted: #8ea8bf; --heading: #f1f7fc;
    --accent: #41a2da; --accent2: #6bb8e6; --accent-soft: #163a55; --brand: #41a2da; --brand-dark: #233d51;
    --side: #0a131b; --side-hover: #172a39; --on-accent: #06121c;
    --ok: #46c48f; --ok-soft: #12342a; --ok-line: #1f5a44;
    --warn: #e5b04a; --warn-soft: #3a2f14;
    --err: #f07a73; --err-soft: #3d1a1a; --err-line: #6b2b29;
    --mute-soft: #1d2c39; --mute: #8ea8bf;
    --input: #0f1d29; --input-line: #2b4559; --focus: #2c6f9b;
    --code: #0f1d29; --grid: #1d3243; --axis: #7f9bb3;
    --logo-dark: #dbe8f3; --logo-light: #41a2da;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1821; --panel: #13222f; --panel2: #172a39; --line: #22394c; --line2: #1b3041;
  --text: #e2edf6; --muted: #8ea8bf; --heading: #f1f7fc;
  --accent: #41a2da; --accent2: #6bb8e6; --accent-soft: #163a55; --brand: #41a2da; --brand-dark: #233d51;
  --side: #0a131b; --side-hover: #172a39; --on-accent: #06121c;
  --ok: #46c48f; --ok-soft: #12342a; --ok-line: #1f5a44;
  --warn: #e5b04a; --warn-soft: #3a2f14;
  --err: #f07a73; --err-soft: #3d1a1a; --err-line: #6b2b29;
  --mute-soft: #1d2c39; --mute: #8ea8bf;
  --input: #0f1d29; --input-line: #2b4559; --focus: #2c6f9b;
  --code: #0f1d29; --grid: #1d3243; --axis: #7f9bb3;
  --logo-dark: #dbe8f3; --logo-light: #41a2da;
}

* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif }
a { color: var(--accent2); text-decoration: none } a:hover { text-decoration: underline }
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh }
aside { background: var(--side); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--heading); text-decoration: none }
.brand:hover { text-decoration: none }
.brand svg { width: 44px; height: auto; flex: none }
.brand b { display: block; font-size: 18px; letter-spacing: .01em; line-height: 1.1 }
.brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase }
.logo .ld { fill: var(--logo-dark) } .logo .ll { fill: var(--logo-light) }
nav a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); margin: 1px 0 }
nav a:hover { background: var(--side-hover); text-decoration: none }
nav a.on { background: var(--accent); color: var(--on-accent) }
nav .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px }
.me { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted) }
.theme { display: flex; gap: 4px; margin: 8px 0 }
.theme button { flex: 1; padding: 4px 0; font-size: 12px; background: transparent; color: var(--muted); border: 1px solid var(--line) }
.theme button:hover { background: var(--side-hover) }
.theme button.on { background: var(--accent-soft); color: var(--accent2); border-color: var(--accent) }
main { padding: 22px 28px; max-width: 1400px; width: 100% }
h1 { font-size: 22px; margin: 0 0 16px; color: var(--heading) } h2 { font-size: 16px; margin: 0 0 12px; color: var(--heading) } h3 { font-size: 14px; margin: 14px 0 8px; color: var(--heading) }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px }
.grid { display: grid; gap: 16px } .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)) }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-top: 3px solid var(--brand) }
.stat b { display: block; font-size: 22px; color: var(--heading) } .stat span { color: var(--muted); font-size: 12px }
table { width: 100%; border-collapse: collapse }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line2); vertical-align: top }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel2) }
tr:hover td { background: var(--panel2) }
.mono, code, pre, textarea.mono { font-family: var(--mono); font-size: 12.5px }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow: auto; max-height: 520px; white-space: pre-wrap; word-break: break-all }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--input-line); border-radius: 8px; padding: 7px 9px; background: var(--input); width: 100% }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); border-color: var(--accent) }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent) }
textarea { min-height: 90px }
textarea.raw { min-height: 70vh; font-size: 12.5px; line-height: 1.45; tab-size: 2; white-space: pre }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px }
label.inline { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; margin-right: 14px }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end } .row > * { flex: 1; min-width: 140px }
.row.tight { flex-wrap: nowrap; gap: 6px; align-items: center } .row.tight > * { min-width: 56px }
.card { overflow-x: auto }
.btn, button { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); padding: 7px 14px; border-radius: 8px; font: inherit; cursor: pointer; white-space: nowrap }
.btn:hover, button:hover { background: var(--accent2); border-color: var(--accent2); text-decoration: none }
.btn.sec, button.sec { background: transparent; color: var(--accent2) } .btn.sec:hover, button.sec:hover { background: var(--accent-soft) }
button.danger { background: transparent; color: var(--err); border-color: var(--err-line) } button.danger:hover { background: var(--err-soft) }
button.small, .btn.small { padding: 3px 9px; font-size: 12px }
form.inl { display: inline }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px }
.tabs a { padding: 8px 13px; border-radius: 8px 8px 0 0; color: var(--muted) }
.tabs a.on { background: var(--panel); border: 1px solid var(--line); border-bottom-color: var(--panel); margin-bottom: -1px; color: var(--heading); font-weight: 600 }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--accent-soft); color: var(--accent2) }
.badge.ok { background: var(--ok-soft); color: var(--ok) } .badge.err { background: var(--err-soft); color: var(--err) }
.badge.warn { background: var(--warn-soft); color: var(--warn) } .badge.mute { background: var(--mute-soft); color: var(--mute) }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px }
.flash.ok { background: var(--ok-soft); border: 1px solid var(--ok-line) } .flash.err { background: var(--err-soft); border: 1px solid var(--err-line) }
.muted { color: var(--muted) } .right { text-align: right } .nowrap { white-space: nowrap }
.secret { font-family: var(--mono); font-size: 15px; background: var(--code); border: 1px dashed var(--accent); border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center }
.bar { height: 8px; background: var(--line2); border-radius: 99px; overflow: hidden } .bar i { display: block; height: 100%; background: var(--accent) }
.chart { width: 100%; height: 170px; display: block }
.chart .grid line { stroke: var(--grid) } .chart text { font-size: 10px; fill: var(--axis) }
.legend { font-size: 12px; color: var(--muted) } .legend i { display: inline-block; width: 10px; height: 3px; margin: 0 4px 2px 10px; vertical-align: middle }
details summary { cursor: pointer; color: var(--accent2) }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px }
.svc { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: start; margin: 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); color: var(--text); font-size: 14px; cursor: pointer }
.svc input { grid-row: span 2; margin-top: 3px }
.svc span { grid-column: 2; font-size: 12px; color: var(--muted) }
.svc:has(input:checked) { border-color: var(--accent); background: var(--accent-soft) }
[data-when][hidden] { display: none !important }
hr { border: 0; border-top: 1px solid var(--line) }
.login { max-width: 400px; margin: 12vh auto }
.login .card { border-top: 4px solid var(--brand); padding: 26px 28px }
.login .brand { padding: 0 0 18px }
.login .theme { justify-content: center; margin-top: 16px }
.login .theme button { flex: 0 0 auto; padding: 4px 12px }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr } aside { position: static; height: auto } .g2, .g3, .g4 { grid-template-columns: 1fr } main { padding: 16px } }
