/* Kontrollrom · vagnby.no/admin
   Mørkt som standard, lyst når systemet eller brukeren ber om det.
   Bakgrunnsglødet («aurora») bytter farge etter helsa: grønt når alt svarer,
   gult når noe er ukjent, rødt når noe er nede. */

@font-face { font-family: 'Outfit'; font-weight: 300 700; font-display: swap; src: url('/fonts/outfit.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 300 800; font-display: swap; src: url('/fonts/manrope.woff2') format('woff2'); }

:root {
    --bg: #07080c;
    --bg-2: #0c0e14;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.065);
    --surface-solid: #11131a;
    --line: rgba(255, 255, 255, 0.075);
    --line-2: rgba(255, 255, 255, 0.14);
    --text: #eceef5;
    --muted: #9097ab;
    --faint: #5d6478;
    --accent: #a78bfa;
    --accent-2: #22d3ee;
    --up: #34d399;
    --down: #f87171;
    --warn: #fbbf24;
    --unknown: #6b7280;
    --glow-1: rgba(52, 211, 153, 0.22);
    --glow-2: rgba(34, 211, 238, 0.16);
    --glow-3: rgba(167, 139, 250, 0.18);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.8);
    --radius: 18px;
    --radius-sm: 12px;
    --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
    --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
    color-scheme: dark;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f4f5f9; --bg-2: #eceef4; --surface: rgba(255, 255, 255, 0.72); --surface-2: #ffffff;
        --surface-solid: #ffffff; --line: rgba(15, 23, 42, 0.08); --line-2: rgba(15, 23, 42, 0.16);
        --text: #0f172a; --muted: #5b6477; --faint: #8b93a6; --accent: #7c3aed; --accent-2: #0891b2;
        --up: #059669; --down: #dc2626; --warn: #d97706; --unknown: #94a3b8;
        --glow-1: rgba(16, 185, 129, 0.16); --glow-2: rgba(8, 145, 178, 0.12); --glow-3: rgba(124, 58, 237, 0.12);
        --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 32px -24px rgba(15, 23, 42, 0.28);
        color-scheme: light;
    }
}
:root[data-theme="light"] {
    --bg: #f4f5f9; --bg-2: #eceef4; --surface: rgba(255, 255, 255, 0.72); --surface-2: #ffffff;
    --surface-solid: #ffffff; --line: rgba(15, 23, 42, 0.08); --line-2: rgba(15, 23, 42, 0.16);
    --text: #0f172a; --muted: #5b6477; --faint: #8b93a6; --accent: #7c3aed; --accent-2: #0891b2;
    --up: #059669; --down: #dc2626; --warn: #d97706; --unknown: #94a3b8;
    --glow-1: rgba(16, 185, 129, 0.16); --glow-2: rgba(8, 145, 178, 0.12); --glow-3: rgba(124, 58, 237, 0.12);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 32px -24px rgba(15, 23, 42, 0.28);
    color-scheme: light;
}

body[data-health="warn"] { --glow-1: rgba(251, 191, 36, 0.22); }
body[data-health="down"] { --glow-1: rgba(248, 113, 113, 0.28); --glow-3: rgba(251, 146, 60, 0.16); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
    margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
    font: 15px/1.5 var(--font); letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
kbd {
    font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; color: var(--muted);
    background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px;
}
code { font-family: var(--mono); font-size: 0.9em; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--muted); }
.grow { flex: 1; }

/* ---------- bakgrunn ---------- */
.aurora { position: fixed; inset: -20vh -10vw auto; height: 80vh; z-index: -2; pointer-events: none; filter: blur(70px); }
.aurora span { position: absolute; border-radius: 50%; transition: background 1.2s ease; }
.aurora span:nth-child(1) { width: 55vw; height: 45vh; left: 5vw; top: 5vh; background: var(--glow-1); animation: drift 22s ease-in-out infinite alternate; }
.aurora span:nth-child(2) { width: 40vw; height: 40vh; right: 5vw; top: 0; background: var(--glow-2); animation: drift 28s ease-in-out infinite alternate-reverse; }
.aurora span:nth-child(3) { width: 35vw; height: 35vh; left: 40vw; top: 25vh; background: var(--glow-3); animation: drift 34s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(6vw, 4vh, 0) scale(1.1); } }
.gridlines {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
    background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 28px 28px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

/* ---------- toppfelt ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
    padding: 14px max(16px, calc((100vw - 1320px) / 2)); backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid transparent;
    transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 17px; white-space: nowrap; }
.brand-mark {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
    background: linear-gradient(135deg, var(--up), var(--accent-2) 55%, var(--accent)); box-shadow: 0 6px 20px -6px var(--accent-2);
}
.brand-text { color: var(--muted); }
.brand-text b { color: var(--text); font-weight: 600; }
.brand-sep { margin: 0 3px; opacity: 0.5; }

.cmd-trigger {
    flex: 1; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px 10px 14px; border-radius: 12px; cursor: pointer; text-align: left;
    background: var(--surface); border: 1px solid var(--line); color: var(--muted); transition: border-color .15s, background .15s;
}
.cmd-trigger:hover { border-color: var(--line-2); background: var(--surface-2); }
.cmd-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
    background: transparent; border: 1px solid transparent; color: var(--muted); transition: all .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.icon-btn.on { color: var(--accent); }
.live { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 0 10px; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--unknown); }
.live.ok .live-dot { background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: ping 2.4s infinite; }
.live.stale .live-dot { background: var(--warn); }
.live.err .live-dot { background: var(--down); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }

.user { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.user-chip:hover { border-color: var(--line-2); }
.avatar {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 12px; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); text-transform: uppercase;
}
.user-name { color: var(--text); font-weight: 600; }
.menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; padding: 6px; border-radius: 14px; z-index: 40;
    background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .6);
    animation: pop .14s ease-out;
}
.menu a, .menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0;
    background: none; cursor: pointer; font-size: 14px; text-align: left;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); }
.menu i { width: 18px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .danger, .menu .danger i { color: var(--down); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* ---------- oppsett ---------- */
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 36px 0 26px; }
.eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hero h1 { margin: 0; font: 600 clamp(30px, 5vw, 48px)/1.05 var(--font-display); letter-spacing: -0.025em; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--up), var(--accent-2) 50%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.headline { margin: 12px 0 0; font-size: 16px; color: var(--muted); max-width: 60ch; }
.headline b { color: var(--text); }
.headline .bad { color: var(--down); font-weight: 700; }
.clock { font: 300 clamp(40px, 7vw, 72px)/1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--text); opacity: .9; white-space: nowrap; }
.clock small { font-size: .32em; color: var(--faint); margin-left: 4px; letter-spacing: 0; }

/* ---------- bento ---------- */
.bento { display: grid; gap: 14px; grid-template-columns: repeat(12, 1fr); margin-bottom: 28px; }
.tile {
    position: relative; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); min-width: 0;
    display: flex; flex-direction: column; gap: 14px;
}
.tile header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.tile-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tile-foot b { color: var(--text); font-weight: 600; }
.tile-health { grid-column: span 4; }
.tile-host { grid-column: span 4; }
.tile-events { grid-column: span 7; }
.tile-certs { grid-column: span 5; }
@media (max-width: 1080px) {
    .tile-health, .tile-host { grid-column: span 6; }
    .tile-health { grid-column: span 12; }
    .tile-events, .tile-certs { grid-column: span 12; }
}
@media (max-width: 640px) { .tile-host { grid-column: span 12; } }

.health-body { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 20px; position: relative; }
.ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--up); stroke-linecap: round; transition: stroke-dasharray .8s cubic-bezier(.2, .8, .2, 1), stroke .4s; }
body[data-health="warn"] .ring-fg { stroke: var(--warn); }
body[data-health="down"] .ring-fg { stroke: var(--down); }
.ring-center { position: absolute; left: 0; top: 50%; width: 120px; transform: translateY(-50%); text-align: center; display: flex; flex-direction: column; }
.ring-center b { font: 600 28px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.ring-center span { font-size: 11.5px; color: var(--muted); }
.health-stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; font-size: 13.5px; color: var(--muted); }
.health-stats li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.health-stats b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 18px; font-family: var(--font-display); font-weight: 600; }
.health-stats i { color: var(--faint); width: 8px; font-size: 11px; }

.meters { display: grid; gap: 12px; }
.meter { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.meter-label { color: var(--muted); }
.meter-val { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 64px; text-align: right; }
.meter-val small { color: var(--faint); font-weight: 500; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--up)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.bar.warn > i { background: linear-gradient(90deg, var(--warn), #fb923c); }
.bar.crit > i { background: linear-gradient(90deg, #fb923c, var(--down)); }
.connect { font-size: 13.5px; color: var(--muted); display: grid; gap: 10px; }
.connect code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 11.5px; overflow-x: auto; white-space: pre; color: var(--text); }

.events, .certs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 196px; overflow-y: auto; scrollbar-width: thin; }
.events li, .certs li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 9px; font-size: 13.5px; }
.events li.muted, .certs li.muted { display: block; }
.events li:hover, .certs li:hover { background: var(--surface-2); }
.events time, .certs .days { font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.events .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events .what small, .certs small { color: var(--faint); margin-left: 6px; }
.certs .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.certs .days.warn { color: var(--warn); } .certs .days.crit { color: var(--down); font-weight: 700; }
.calm { display: flex; align-items: center; gap: 12px; padding: 14px 10px !important; color: var(--muted); }
.calm i { font-size: 20px; color: var(--up); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--unknown); flex: none; }
.dot.up { background: var(--up); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up) 18%, transparent); }
.dot.down { background: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 22%, transparent); animation: alarm 1.4s ease-in-out infinite; }
.dot.unknown { background: var(--unknown); }
.dot.warn { background: var(--warn); }
@keyframes alarm { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--down) 0%, transparent); } }

.skeleton { border-radius: 12px; min-height: 90px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.card-skel { min-height: 150px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- seksjoner ---------- */
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.section-head h2 { margin: 0; font: 600 18px/1.2 var(--font-display); display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; }
.section-head h2 i { color: var(--muted); font-size: 15px; }
.section-hint { font-size: 12.5px; color: var(--faint); }
.section-head .btn { margin-left: auto; }
.favs { margin-bottom: 26px; }
.fav-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.fav {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    background: var(--surface); border: 1px solid var(--line); transition: transform .15s, border-color .15s, background .15s;
}
.fav:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--surface-2); }
.fav .svc-icon { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
.fav b { font-weight: 600; font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav small { color: var(--faint); font-size: 12px; }
.fav .key { position: absolute; top: 8px; right: 10px; font: 600 10.5px var(--mono); color: var(--faint); }
.fav .dot { position: absolute; bottom: 10px; right: 10px; width: 7px; height: 7px; }

.toolbar {
    position: sticky; top: 66px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    padding: 10px 0 12px; margin-bottom: 8px; background: linear-gradient(var(--bg) 70%, transparent);
}
.filter-input { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--faint); min-width: 220px; flex: 0 1 280px; }
.filter-input:focus-within { border-color: var(--accent); }
.filter-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 99px; cursor: pointer; font-size: 13px; font-weight: 600;
    background: transparent; border: 1px solid var(--line); color: var(--muted); transition: all .15s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.active .dot { box-shadow: none; }
.chip .n { font: 600 11px var(--mono); opacity: .7; }
.chip i { font-size: 11px; }
.jump { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.jump a { font-size: 12.5px; color: var(--faint); padding: 6px 9px; border-radius: 8px; white-space: nowrap; }
.jump a:hover, .jump a.here { color: var(--text); background: var(--surface-2); }
@media (max-width: 900px) { .jump { display: none; } .toolbar { top: 62px; } }

.catalog { display: grid; gap: 34px; margin-bottom: 44px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; cursor: pointer; user-select: none; }
.cat-head h2 { margin: 0; font: 600 19px/1.2 var(--font-display); letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.cat-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.cat-hint { font-size: 13px; color: var(--faint); }
.cat-count { margin-left: auto; font: 600 12px var(--mono); color: var(--muted); display: flex; align-items: center; gap: 8px; }
.cat-head .chev { color: var(--faint); transition: transform .2s; font-size: 12px; }
.cat.collapsed .chev { transform: rotate(-90deg); }
.cat.collapsed .grid, .cat.collapsed .list { display: none; }
.cat-line { flex: 1; height: 1px; background: var(--line); min-width: 20px; }
@media (max-width: 640px) { .cat-hint, .cat-line { display: none; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

/* ---------- tjenestekort ---------- */
.svc {
    --c: var(--accent);
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), border-color .18s, background .18s;
    isolation: isolate; overflow: hidden;
}
.svc::before {
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .25s;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 14%, transparent), transparent 45%);
}
.svc:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 40%, var(--line-2)); background: var(--surface-2); }
.svc:hover::before { opacity: 1; }
.svc.is-down { border-color: color-mix(in srgb, var(--down) 55%, transparent); background: color-mix(in srgb, var(--down) 6%, var(--surface)); }
.svc-open { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.svc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.svc-icon {
    display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; font-size: 18px;
    color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
}
.svc-title { min-width: 0; flex: 1; }
.svc-title h3 { margin: 0; font: 600 15.5px/1.25 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-domain { display: block; font: 500 12px var(--mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-desc { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.beats { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
.beats i { flex: 1; min-width: 1px; border-radius: 2px; background: color-mix(in srgb, var(--up) 55%, transparent); height: var(--h, 40%); }
.beats i.d { background: var(--down); height: 100%; }
.beats.none { align-items: center; font-size: 11.5px; color: var(--faint); }
.svc-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.svc-meta span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.svc-meta .lock { color: var(--accent); }
.svc-meta .warnc { color: var(--warn); }
.svc-meta .badc { color: var(--down); font-weight: 700; }
.svc-actions { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.svc:hover .svc-actions, .svc:focus-within .svc-actions { opacity: 1; }
.svc-actions button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 12.5px; }
.svc-actions button:hover { background: var(--surface-2); color: var(--text); }
.svc-actions button.pinned { color: var(--warn); }
.svc .status-dot { position: absolute; top: 18px; right: 16px; transition: opacity .15s; }
.svc:hover .status-dot, .svc:focus-within .status-dot { opacity: 0; }
.tag { font: 600 10.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; padding: 4px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
@media (hover: none) { .svc-actions { opacity: 1; position: static; align-self: flex-start; margin-top: -4px; } .svc .status-dot { opacity: 1 !important; } }

/* listevisning */
.list { display: grid; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.row {
    --c: var(--accent);
    position: relative; display: grid; grid-template-columns: 14px 32px minmax(140px, 1.3fr) minmax(120px, 1fr) 150px 70px 64px 92px; align-items: center; gap: 14px;
    padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13.5px;
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row .svc-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 9px; }
.row .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nm small { display: block; font: 500 11.5px var(--mono); color: var(--faint); }
.row .hostc { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .num { font: 500 12.5px var(--mono); color: var(--muted); text-align: right; }
.row .beats { height: 18px; }
.row .svc-actions { position: relative; top: auto; right: auto; opacity: 1; background: none; border: 0; justify-self: end; }
.row.is-down { background: color-mix(in srgb, var(--down) 7%, transparent); }
@media (max-width: 900px) { .row { grid-template-columns: 14px 32px 1fr 64px 92px; } .row .hostc, .row .beats, .row .num.up24 { display: none; } }

/* ---------- egne lenker, tabeller ---------- */
.block { margin-bottom: 36px; }
.links-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.link-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--line-2); position: relative; }
.link-card:hover { border-style: solid; background: var(--surface-2); }
.link-card .svc-icon { width: 34px; height: 34px; font-size: 14px; border-radius: 10px; }
.link-card b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card small { display: block; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card > div { min-width: 0; flex: 1; }
.link-card .edit { position: relative; z-index: 2; border: 0; background: none; color: var(--faint); cursor: pointer; width: 28px; height: 28px; border-radius: 8px; }
.link-card .edit:hover { color: var(--text); background: var(--surface-2); }
.empty { padding: 18px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--faint); font-size: 13.5px; grid-column: 1 / -1; }

details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { margin-left: auto; color: var(--faint); transition: transform .2s; }
details[open] > summary .chev { transform: rotate(180deg); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.table th { text-align: left; font-weight: 700; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.table tr:first-child td { border-top: 0; }
.table td:first-child { color: var(--text); font-weight: 600; }
.table td.num { font-family: var(--mono); text-align: right; }
.table .mini { width: 90px; }

/* ---------- knapper, overlegg ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--line-2); background: var(--surface-2); }
.btn:hover { border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--down); }
.linkish { background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.linkish:hover { color: var(--text); }

.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(3, 4, 8, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
.palette { width: min(640px, 100%); border-radius: 18px; overflow: hidden; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8); animation: pop .15s ease-out; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--faint); }
.palette-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 17px; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: min(52vh, 460px); overflow-y: auto; }
.palette-list .grp { padding: 10px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pitem { --c: var(--accent); display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; cursor: pointer; }
.pitem .svc-icon { width: 32px; height: 32px; font-size: 13px; border-radius: 9px; }
.pitem .t { flex: 1; min-width: 0; }
.pitem .t b { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem .t small { color: var(--faint); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pitem mark { background: none; color: var(--accent); font-weight: 800; }
.pitem .hint { font-size: 12px; color: var(--faint); opacity: 0; }
.pitem.active { background: var(--surface-2); }
.pitem.active .hint { opacity: 1; }
.palette-empty { padding: 28px; text-align: center; color: var(--faint); }
.palette-foot { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.palette-foot kbd { font-size: 10px; padding: 2px 5px; }
@media (max-width: 640px) { .palette-foot { display: none; } .overlay { padding-top: 10px; } }

.modal { width: min(480px, 100%); padding: 22px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8); display: grid; gap: 14px; animation: pop .15s ease-out; }
.modal h3 { margin: 0 0 4px; font: 600 20px var(--font-display); }
.modal label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal label small { font-weight: 500; color: var(--faint); }
.modal input { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; font-size: 14px; outline: 0; }
.modal input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; align-items: center; font-size: 14px; }
.keys dt { white-space: nowrap; color: var(--faint); }
.keys dd { margin: 0; }

.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer {
    --c: var(--accent);
    position: relative; width: min(520px, 100vw); height: 100%; overflow-y: auto; padding: 28px 24px 40px;
    background: var(--surface-solid); border-left: 1px solid var(--line-2); animation: slide .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer-close { position: absolute; top: 16px; right: 16px; }
.d-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-right: 40px; }
.d-head .svc-icon { width: 54px; height: 54px; font-size: 22px; border-radius: 15px; }
.d-head h3 { margin: 0; font: 600 24px/1.15 var(--font-display); }
.d-head a { font: 500 12.5px var(--mono); color: var(--muted); }
.d-head a:hover { color: var(--text); }
.d-state { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; font-weight: 600; }
.d-state small { margin-left: auto; font-weight: 500; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.d-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.d-stats div { padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.d-stats b { display: block; font: 600 20px var(--font-display); font-variant-numeric: tabular-nums; }
.d-stats span { font-size: 12px; color: var(--faint); }
.d-chart { padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.d-chart .beats { height: 64px; gap: 1px; }
.d-axis { display: flex; justify-content: space-between; font: 500 11px var(--mono); color: var(--faint); margin-top: 6px; }
.d-list { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0 0 22px; font-size: 13.5px; }
.d-list dt { color: var(--faint); }
.d-list dd { margin: 0; word-break: break-word; }
.d-list code { color: var(--text); }
.d-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); animation: toast .25s cubic-bezier(.2, .8, .2, 1); display: flex; gap: 8px; align-items: center; }
.toast.bad { background: var(--down); color: #fff; }
@keyframes toast { from { opacity: 0; transform: translateY(10px); } }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-top: 22px; padding-bottom: 40px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
.foot span { display: inline-flex; align-items: center; gap: 7px; }
.foot .bad { color: var(--down); }

/* ---------- mobil ---------- */
@media (max-width: 760px) {
    .topbar { gap: 8px; padding-top: 10px; padding-bottom: 10px; }
    .brand-text, .live, .user-name, .user-chip .fa-chevron-down { display: none; }
    .user-chip { padding: 4px; }
    .cmd-trigger { padding: 9px 12px; }
    .cmd-trigger kbd { display: none; }
    .hero { padding-top: 22px; align-items: flex-start; }
    .clock { display: none; }
    .filter-input { flex: 1 1 100%; }
    .health-body { grid-template-columns: 100px 1fr; }
    .ring, .ring-center { width: 100px; height: auto; }
}
@media (max-width: 420px) { #viewBtn, #notifyBtn { display: none; } }
@media (max-width: 520px) { .fav-row { grid-template-columns: 1fr 1fr; } .fav small { display: none; } .health-stats { gap: 10px; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
