/* ALConnect UI – corporate design automationslösung (Brand System v1.0):
   Ink Navy #0B1929, Signal Green #1FAD78, Barlow / Barlow Semi Condensed (self-hosted, OFL) */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-400.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-500.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url(fonts/barlow-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-semi-condensed-600.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-semi-condensed-700.woff2) format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 800; font-display: swap; src: url(fonts/barlow-semi-condensed-800.woff2) format("woff2"); }
:root {
  /* brand constants (same in light and dark) */
  --brand: #1FAD78; --brand-ink: #062A1D; --navy: #0B1929; --panel: #12273D;
  --bg: #F4F7FA; --surface: #fff; --surface-2: #EEF3F7; --border: #DDE5EC; --border-strong: #C5D2DD;
  --text: #0B1929; --muted: #5C6E7E; --faint: #8A9BAB;
  --accent: #1FAD78; --accent-hover: #17875E; --accent-weak: #E7F6EF; --accent-text: #137A54; --on-accent: #062A1D;
  --ok: #17875E; --ok-weak: #E7F6EF; --warn: #A9561B; --warn-weak: #FFF3E6; --danger: #C8453B; --danger-weak: #FCECEA;
  --wg: #2463A6; --wg-weak: #EFF6FF; --ovpn: #A9561B; --ovpn-weak: #FFF3E6;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 25, 41, .05);
  --shadow-lg: 0 14px 36px rgba(11, 25, 41, .16);
  --font: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Barlow Semi Condensed", "Barlow", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --topbar: #fff; --hover: var(--surface-2); --logo-plate: transparent;
  --rings-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 1200'%3E%3Cg fill='none' stroke='rgba(11,25,41,0.09)'%3E%3Ccircle cx='600' cy='600' r='560'/%3E%3Ccircle cx='600' cy='600' r='430'/%3E%3Ccircle cx='600' cy='600' r='300'/%3E%3Ccircle cx='600' cy='600' r='180'/%3E%3C/g%3E%3Ccircle cx='600' cy='600' r='560' fill='none' stroke='%231FAD78' stroke-width='2' stroke-dasharray='130 3380' stroke-linecap='round' transform='rotate(100 600 600)'/%3E%3C/svg%3E");
  --rings-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 1200'%3E%3Cg fill='none' stroke='rgba(120,160,190,0.12)'%3E%3Ccircle cx='600' cy='600' r='560'/%3E%3Ccircle cx='600' cy='600' r='430'/%3E%3Ccircle cx='600' cy='600' r='300'/%3E%3Ccircle cx='600' cy='600' r='180'/%3E%3C/g%3E%3Ccircle cx='600' cy='600' r='560' fill='none' stroke='%231FAD78' stroke-width='2' stroke-dasharray='130 3380' stroke-linecap='round' transform='rotate(100 600 600)'/%3E%3C/svg%3E");
  --rings: var(--rings-light);
  color-scheme: light;
}
/* dark tokens: device setting (unless "Hell" chosen) or "Dunkel" chosen in the top bar (data-theme, cookie) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1929; --surface: #12273D; --surface-2: #183049; --border: #1F3852; --border-strong: #2C4763;
    --text: #EAF1F6; --muted: #9DB1C4; --faint: #6E8298;
    --accent: #1FAD78; --accent-hover: #57C19A; --accent-weak: #133A35; --accent-text: #57C19A; --on-accent: #062A1D;
    --ok: #57C19A; --ok-weak: #133A35; --warn: #E9A36B; --warn-weak: #33291F; --danger: #E2645A; --danger-weak: #3A2128;
    --wg: #8CB8EC; --wg-weak: #17304B; --ovpn: #E9A36B; --ovpn-weak: #33291F;
    --topbar: #0B1929; --hover: rgba(255, 255, 255, .06); --logo-plate: #fff;
    --rings: var(--rings-dark);
    --shadow: none; --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1929; --surface: #12273D; --surface-2: #183049; --border: #1F3852; --border-strong: #2C4763;
  --text: #EAF1F6; --muted: #9DB1C4; --faint: #6E8298;
  --accent: #1FAD78; --accent-hover: #57C19A; --accent-weak: #133A35; --accent-text: #57C19A; --on-accent: #062A1D;
  --ok: #57C19A; --ok-weak: #133A35; --warn: #E9A36B; --warn-weak: #33291F; --danger: #E2645A; --danger-weak: #3A2128;
  --wg: #8CB8EC; --wg-weak: #17304B; --ovpn: #E9A36B; --ovpn-weak: #33291F;
  --topbar: #0B1929; --hover: rgba(255, 255, 255, .06); --logo-plate: #fff;
  --rings: var(--rings-dark);
  --shadow: none; --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand); color: var(--navy); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-family: var(--font-head); font-size: 28px; line-height: 1.15; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-family: var(--font-head); font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -.005em; }
h3 { font-size: 11.5px; margin: 0 0 8px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .16em; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---- layout ---- */
/* sidebar on wide screens; drawer (menu button in .mobilebar) on phones and in the remote view */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 18px 12px 14px; background: var(--topbar); border-right: 1px solid var(--border); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 2px 8px 6px; }
.side-head .brand { flex: 1; }
.sidebar .side-close { display: none; }  /* only in the drawer */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.side-nav a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.side-nav a.active { background: var(--accent-weak); color: var(--accent-text); font-weight: 600; }
.side-nav a span { flex: 1; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 4px 0; display: flex; flex-direction: column; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-width: 0; }
.side-user .who { line-height: 1.25; min-width: 0; }
.side-user .who b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user .who span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.side-actions .btn { color: var(--muted); }
.content { min-width: 0; display: flex; flex-direction: column; }
.content > main { width: 100%; }
.content > .site-foot { width: 100%; }
.mobilebar { display: none; position: sticky; top: 0; z-index: 20; height: 56px; align-items: center; gap: 8px; padding: 0 10px;
  background: var(--topbar); border-bottom: 1px solid var(--border); }
.mobilebar .avatar:hover { text-decoration: none; }
.nav-scrim { display: none; position: fixed; inset: 0; z-index: 39; background: rgba(4, 12, 22, .45); }
/* drawer: phones (media query below) and always in the remote view */
.drawer .mobilebar { display: flex; }
.drawer .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 280px; max-width: 86vw; height: auto;
  transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.drawer .sidebar .side-close { display: inline-flex; }
.drawer.nav-open .sidebar { transform: none; }
.drawer.nav-open .nav-scrim { display: block; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
/* dot mark + wordmark: never recoloured, "AL" always green */
svg.mark { width: 26px; height: 26px; flex: none; fill: var(--brand); }
/* logo of the user's organization instead of the brand; on a white plate in dark mode (logos are mostly made for white) */
.org-logo { display: block; width: auto; height: auto; max-height: 44px; max-width: 176px; object-fit: contain;
  background: var(--logo-plate); border-radius: 8px; padding: 3px 6px; margin-left: -6px; }
.mobilebar .org-logo { max-height: 36px; max-width: 150px; }
.org-logo.auth-logo { max-height: 90px; max-width: 300px; margin: 0; padding: 6px 10px; }
.logo-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.logo-preview { min-height: 50px; min-width: 120px; display: flex; align-items: center; }
.logo-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.logo-form .input { width: auto; max-width: 100%; }
.logo-hosts { margin-top: 16px; max-width: 640px; }
.wordmark { font-family: var(--font-head); font-weight: 800; font-size: 21px; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.wordmark b { color: var(--brand); font-weight: 800; }
.spacer { flex: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--brand-ink); text-transform: uppercase; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1; min-width: 220px; position: relative; padding-left: 18px; }
/* accent bar: green rule anchoring the page headline */
.page-head .titles::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 3px; background: var(--brand); }
.page-head .sub { color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs svg.i { width: 14px; height: 14px; color: var(--faint); }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { flex: 1; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.card.danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.card.danger .card-head h2 { color: var(--danger); }
a.card { display: block; color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
a.card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-1px); }

.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-weak); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.stat-icon.ok { background: var(--ok-weak); color: var(--ok); }
.stat-icon svg.i { width: 19px; height: 19px; }
.stat b { display: block; font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
.stat span { color: var(--muted); font-size: 12.5px; }

.group-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; height: 100%; }
.group-card .top { display: flex; align-items: flex-start; gap: 10px; }
.group-card .name { font-family: var(--font-head); font-weight: 700; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.group-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.group-card .foot { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; }

/* ---- key/value ---- */
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 9px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv dd.with-action { display: flex; align-items: center; gap: 4px; margin: -6px 0; }

/* ---- badges / chips / dots ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge svg.i { width: 12px; height: 12px; }
.badge.ok { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-weak); color: var(--danger); border-color: transparent; }
.badge.accent { background: var(--accent-weak); color: var(--accent-text); border-color: transparent; }
.badge.wg { background: var(--wg-weak); color: var(--wg); border-color: transparent; }
.badge.ovpn { background: var(--ovpn-weak); color: var(--ovpn); border-color: transparent; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 4px 0 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 12px; }
.chip.plain { padding-right: 9px; }
.chip.text { font-family: var(--font); font-size: 12.5px; }
.chip form { display: inline; }
.chip button { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0 3px; height: 20px; border-radius: 4px; display: grid; place-items: center; }
.chip button:hover { color: var(--danger); background: var(--danger-weak); }
.chip button svg.i { width: 13px; height: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-weak); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #57C19A; border-color: #57C19A; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger-weak); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13.5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-weight: 600; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12.5px; }
.input, select.input { height: 40px; width: 100%; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; }
select.input { padding-right: 28px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-weak); }
.input.code { font-family: var(--mono); letter-spacing: 6px; text-align: center; font-size: 22px; height: 52px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.searchbox { position: relative; }
.searchbox svg.i { position: absolute; left: 11px; top: 11px; color: var(--faint); pointer-events: none; }
.searchbox .input { padding-left: 34px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.check:hover { background: var(--surface-2); }
.check input { margin-top: 3px; accent-color: var(--accent); }
.check b { display: block; font-weight: 600; }
.check span { color: var(--muted); font-size: 12.5px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.checks .check { padding: 8px 10px; align-items: center; }
.checks .check input { margin-top: 0; }
.checks.scroll { max-height: 280px; overflow-y: auto; overflow-x: hidden; }
/* long names: own line for the organization, cut with "…" (full text in the title) */
.checks .check { min-width: 0; }
.check .check-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; color: inherit; font-size: inherit; }
.check-text b, .check-text span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-text.wrap span { white-space: normal; color: var(--muted); font-size: 12.5px; }
.checks.wide { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }  /* add-ons: 2 x 2 */
.section-title { font-size: 17px; display: flex; align-items: center; gap: 8px; margin: 22px 0 4px; }
.section-title:first-child { margin-top: 0; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 100%; }
.seg span b { display: block; font-weight: 600; }
.seg span small { color: var(--muted); font-size: 12px; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-weak); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .12em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 10px 8px; }  /* narrow side cards */
.table.compact td:first-child { padding-left: 14px; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--surface-2); }
.table .cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .cell-main .name { font-weight: 600; }
.table .right { text-align: right; }
.table .sub { color: var(--muted); font-size: 12px; }

/* ---- alerts / toasts / empty ---- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 16px; }
.alert svg.i { margin-top: 2px; }
.alert.warn { background: var(--warn-weak); border-color: transparent; color: var(--warn); }
.alert.info { background: var(--accent-weak); border-color: transparent; color: var(--accent-text); }
.alert .grow { flex: 1; }
.alert b { color: inherit; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); animation: toast-in .18s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.error svg.i { color: var(--danger); }
.toast.ok svg.i { color: var(--ok); }
.toast .grow { flex: 1; }
.toast button { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.result-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 16px 6px; font-size: 13px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 1px solid var(--border); }
.card-head + .result-head, .result-note + .result-head { border-top: 0; }
.result-note { margin: 12px 16px 0; }
.ok-text { color: var(--ok); font-weight: 600; }
.empty .empty-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 12px; color: var(--faint); }
.empty .empty-icon svg.i { width: 22px; height: 22px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---- dialog ---- */
dialog { border: 0; padding: 0; border-radius: var(--radius); width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(11, 25, 41, .55); }
dialog .dlg-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
dialog .dlg-head h2 { flex: 1; font-size: 20px; }
dialog .dlg-body { padding: 10px 20px 4px; }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }

/* ---- auth pages ---- */
/* Paper / Ink Navy ground with the faint concentric-ring motif pinned to a corner (≤ 16 % opacity) */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; background-color: var(--bg);
  background-image: var(--rings);
  background-repeat: no-repeat; background-size: 1100px 1100px; background-position: right -340px top -280px; }
.auth-card { width: 100%; max-width: 390px; position: relative; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; text-align: center; }
.auth-brand svg.mark { width: 52px; height: 52px; }
.auth-brand .wordmark { font-size: 38px; }
.auth-brand .eyebrow { margin-top: -2px; }
.eyebrow { font-weight: 600; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-text); }
.endorse { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; font-size: 12.5px; letter-spacing: .03em; color: var(--faint); }
.endorse svg.mark { width: 15px; height: 15px; }
/* page footer with the endorsement */
.site-foot { max-width: 1200px; margin: 0 auto; padding: 0 20px 28px; }
.site-foot .endorse { justify-content: flex-start; margin: 0; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--border); display: inline-block; line-height: 0; }
.qr-box svg { width: 100%; height: 100%; }

/* ---- profile tiles (user role) ---- */
.tile { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.tile .head { display: flex; gap: 12px; align-items: center; }
.tile .icon-box { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.tile .icon-box svg.i { width: 20px; height: 20px; }
.tile .head b { display: block; font-size: 15px; }
.tile .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tile .btns .btn { flex: 1; }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 6px; }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .split, .grid.cols-3 { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-md { display: none; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .shell .mobilebar { display: flex; }
  .shell .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 40; width: 280px; max-width: 86vw; height: auto;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
  .shell .sidebar .side-close { display: inline-flex; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .nav-scrim { display: block; }
}
@media (max-width: 720px) {
  .site-foot { padding: 0 14px 22px; }
}
@media (max-width: 520px) {
  main { padding: 18px 14px 50px; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .page-head .actions { width: 100%; }
}

/* ---- security page ---- */
.badge.sev-critical { background: #7a1712; color: #fff; border-color: transparent; }
.badge.sev-high { background: var(--danger-weak); color: var(--danger); border-color: transparent; }
.badge.sev-medium { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.badge.sev-low { background: var(--accent-weak); color: var(--accent-text); border-color: transparent; }
.badge.sev-unknown, .badge.sev-negligible { background: var(--surface-2); color: var(--muted); }
.stat-icon.warn { background: var(--warn-weak); color: var(--warn); }
.stat-icon.bad { background: var(--danger-weak); color: var(--danger); }
.alert.danger-box { background: var(--danger-weak); color: var(--danger); border-color: transparent; }
.alert.ok-box { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
a.link-alert { text-decoration: none; align-items: center; }
a.link-alert:hover { filter: brightness(.97); }
.checklist { display: flex; flex-direction: column; }
.check-row { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.check-row:last-child { border-bottom: 0; }
.check-row .grow { flex: 1; min-width: 0; }
.check-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-weak); color: var(--ok); }
.check-icon svg.i { width: 14px; height: 14px; }
.check-row.warn .check-icon { background: var(--warn-weak); color: var(--warn); }
.check-row.fail .check-icon { background: var(--danger-weak); color: var(--danger); }
.check-row.info .check-icon { background: var(--surface-2); color: var(--muted); }
.fix-hint { margin-top: 4px; color: var(--accent-text); }
.fix-hint svg.i { width: 12px; height: 12px; }
.update-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; max-width: 100%; }
code.cmd { display: block; flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; overflow-x: auto; white-space: nowrap; }
td .fix { color: var(--ok); font-weight: 600; }
.side-nav a { position: relative; }
.nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.nav-dot.fail { background: var(--danger); }

details.findings { border-top: 1px solid var(--border); }
details.findings > summary { padding: 12px 18px; cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 13px; }
details.findings > summary:hover { background: var(--surface-2); }
.kvpair { display: inline-block; margin-right: 10px; }
/* hidden attribute wins over component display rules (JS toggles it) */
[hidden] { display: none !important; }
.org-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.org-tag .i { width: 13px; height: 13px; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select.input { width: auto; min-width: 200px; height: 34px; }

/* remote view (Fernansicht): toolbar + noVNC screen filling the window */
.remote-page { display: flex; flex-direction: column; height: 100vh; }
.remote { display: flex; flex-direction: column; flex: 1; min-height: 0; background: #0b0d12; }
.remote-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.remote-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.remote-status { font-size: 12.5px; color: var(--muted); }
.remote-status.on { color: var(--ok); }
.remote-status.off { color: var(--danger); }
.remote-password .input { width: 170px; height: 30px; }
.remote-screen { flex: 1; min-height: 0; overflow: hidden; }
/* SSH console (xterm.js) */
.remote-screen.term { background: #0B1929; padding: 6px 8px; }
.remote-screen.term .xterm { height: 100%; }
.i.flip { transform: rotate(180deg); }
.tile .btns form { display: flex; flex: 1; }
.tile .btns form.fav { flex: none; }
svg.i.filled { fill: currentColor; }
.fav-btn.on { color: #e3a008; }
.fav-btn.on:hover { color: #b77f00; }
.remote-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.remote-item { display: flex; align-items: center; gap: 10px; }
.remote-item .grow { flex: 1; min-width: 0; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-row > .field { flex: 1; min-width: 120px; }

/* light/dark switch in the top bar: shows the current choice */
.theme-btn .ti-light, .theme-btn .ti-dark { display: none; }
:root[data-theme="light"] .theme-btn .ti-auto, :root[data-theme="dark"] .theme-btn .ti-auto { display: none; }
:root[data-theme="light"] .theme-btn .ti-light, :root[data-theme="dark"] .theme-btn .ti-dark { display: inline; }
