:root {
  --bg: #f4f6fb; --bg2: #eef1f8; --surface: #ffffff; --surface2: #f7f8fc; --raise: #ffffff;
  --line: #e3e7f0; --line2: #d3d9e6; --text: #141a2a; --muted: #5d6680; --faint: #8b93a7;
  --accent: #4f5fe8; --accent2: #7b6cf0; --accent-soft: rgba(79, 95, 232, .10);
  --ok: #0f9f6e; --ok-soft: rgba(15, 159, 110, .12);
  --warn: #c27c0e; --warn-soft: rgba(214, 140, 20, .14);
  --crit: #d93b3b; --crit-soft: rgba(217, 59, 59, .12);
  --info: #2f74d0; --info-soft: rgba(47, 116, 208, .11);
  --down: #b91c1c;
  --shadow: 0 1px 2px rgba(20, 26, 42, .05), 0 6px 24px rgba(20, 26, 42, .06);
  --shadow-lg: 0 24px 64px rgba(20, 26, 42, .18);
  --glow: radial-gradient(1200px 500px at 10% -10%, rgba(123, 108, 240, .10), transparent 60%),
          radial-gradient(900px 400px at 100% 0%, rgba(79, 95, 232, .08), transparent 60%);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090c14; --bg2: #0c111c; --surface: #10162a; --surface2: #0d1324; --raise: #151c33;
    --line: #1c2440; --line2: #27304f; --text: #e7eaf4; --muted: #98a1bb; --faint: #6b7493;
    --accent: #8ea0ff; --accent2: #a68cff; --accent-soft: rgba(142, 160, 255, .13);
    --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13);
    --warn: #f5b14c; --warn-soft: rgba(245, 177, 76, .14);
    --crit: #fb7185; --crit-soft: rgba(251, 113, 133, .14);
    --info: #6aa8ff; --info-soft: rgba(106, 168, 255, .13);
    --down: #ff5a5a;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
    --glow: radial-gradient(1200px 520px at 8% -12%, rgba(120, 100, 255, .16), transparent 60%),
            radial-gradient(900px 420px at 100% -5%, rgba(70, 120, 255, .12), transparent 60%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #090c14; --bg2: #0c111c; --surface: #10162a; --surface2: #0d1324; --raise: #151c33;
  --line: #1c2440; --line2: #27304f; --text: #e7eaf4; --muted: #98a1bb; --faint: #6b7493;
  --accent: #8ea0ff; --accent2: #a68cff; --accent-soft: rgba(142, 160, 255, .13);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13);
  --warn: #f5b14c; --warn-soft: rgba(245, 177, 76, .14);
  --crit: #fb7185; --crit-soft: rgba(251, 113, 133, .14);
  --info: #6aa8ff; --info-soft: rgba(106, 168, 255, .13);
  --down: #ff5a5a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --glow: radial-gradient(1200px 520px at 8% -12%, rgba(120, 100, 255, .16), transparent 60%),
          radial-gradient(900px 420px at 100% -5%, rgba(70, 120, 255, .12), transparent 60%);
  color-scheme: dark;
}

* { box-sizing: border-box; scrollbar-color: var(--line2) transparent; }
html { background: var(--bg); }
html, body { margin: 0; }
body {
  background: var(--glow), var(--bg); background-attachment: fixed;
  color: var(--text); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hidden { display: none !important; }
svg { display: block; }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: 9px; border: 1px solid var(--line2); background: var(--surface); cursor: pointer;
  font-weight: 550; font-size: 13px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { color: var(--crit); }
.btn.danger:hover { border-color: var(--crit); background: var(--crit-soft); }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.spin svg, svg.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.field small { color: var(--faint); font-size: 11.5px; }
.input, select.input, textarea.input {
  height: 36px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line2);
  background: var(--surface2); outline: none; width: 100%; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 72px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 28px 26px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.login::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--ok));
}
.login h1 { font-size: 21px; margin: 18px 0 4px; letter-spacing: -.01em; }
.login p { margin: 0 0 20px; color: var(--muted); }
.login form { display: grid; gap: 14px; }
.login .btn.primary { height: 40px; justify-content: center; font-size: 14px; }
.otp { font: 600 26px/1 var(--mono); letter-spacing: .45em; text-align: center; height: 54px !important; padding-left: .45em !important; }
.login .err { color: var(--crit); font-size: 13px; min-height: 18px; }
.login .foot { margin-top: 18px; font-size: 12px; color: var(--faint); text-align: center; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; background: #0d1220; display: grid; place-items: center; box-shadow: 0 4px 16px rgba(91, 108, 240, .35); }
.brand .mark svg { width: 34px; height: 34px; }
.brand b { font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--faint); font-size: 11.5px; margin-top: -1px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line);
}
.search { position: relative; flex: 1; max-width: 460px; margin-left: 12px; }
.search svg { position: absolute; left: 11px; top: 9px; width: 16px; height: 16px; color: var(--faint); }
.search input { padding-left: 34px; padding-right: 34px; background: var(--surface); }
.search kbd { position: absolute; right: 9px; top: 8px; }
kbd { font: 11px var(--mono); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line2); color: var(--faint); background: var(--surface2); }
.top .grow { flex: 1; }
.top .actions { display: flex; gap: 8px; align-items: center; }
.badge-dot { position: relative; }
.badge-dot[data-n]:not([data-n="0"])::after {
  content: attr(data-n); position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--crit); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
}
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 40px; min-width: 220px; background: var(--raise); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
}
.menu-pop .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-pop .who b { display: block; }
.menu-pop button { width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; display: flex; gap: 9px; align-items: center; }
.menu-pop button:hover { background: var(--accent-soft); }
.menu-pop svg { width: 16px; height: 16px; color: var(--muted); }

main { padding: 22px 24px 60px; max-width: 1680px; margin: 0 auto; }

/* ---------- summary tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px 13px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left; position: relative; overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--line2); transform: translateY(-1px); }
.tile.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.tile .k svg { width: 15px; height: 15px; }
.tile .v { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 14px; color: var(--faint); font-weight: 600; margin-left: 2px; }
.tile .s { font-size: 12px; color: var(--faint); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tone, transparent); opacity: .9; }
.tile.t-ok { --tone: var(--ok); } .tile.t-warn { --tone: var(--warn); } .tile.t-crit { --tone: var(--crit); } .tile.t-info { --tone: var(--info); }
.tile.t-crit .v { color: var(--crit); } .tile.t-warn .v { color: var(--warn); }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--surface); font-size: 12.5px; font-weight: 550; cursor: pointer; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .75; }
.filters .grow { flex: 1; }

/* ---------- groups / table ---------- */
.group { margin-bottom: 26px; }
.group-h { display: flex; align-items: center; gap: 10px; margin: 0 4px 10px; }
.group-h h2 { font-size: 15px; margin: 0; letter-spacing: -.005em; }
.group-h .count { font-size: 12px; color: var(--faint); font-weight: 600; }
.group-h .mini { display: flex; gap: 5px; }
.group-h .tools { margin-left: auto; display: flex; gap: 4px; opacity: .0; transition: opacity .15s; }
.group:hover .group-h .tools, .group-h .tools:focus-within { opacity: 1; }
.caret { width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; cursor: pointer; color: var(--faint); display: grid; place-items: center; }
.caret svg { width: 14px; height: 14px; transition: transform .2s; }
.group.collapsed .caret svg { transform: rotate(-90deg); }
.group.collapsed .table { display: none; }

.table { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: grid; align-items: center; gap: 14px; padding: 11px 16px;
  grid-template-columns: 30px minmax(190px, 2.1fr) minmax(110px, 1fr) minmax(150px, 1.35fr) minmax(108px, .95fr) minmax(118px, 1fr) minmax(120px, 1.05fr) minmax(84px, .8fr) minmax(84px, .8fr) minmax(96px, 1fr) 64px;
}
.row.head { padding-top: 9px; padding-bottom: 9px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; background: var(--surface2); border-bottom: 1px solid var(--line); }
.row.host { border-top: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.row.head + .row.host { border-top: 0; }
.row.host:hover { background: var(--accent-soft); }
.row.host.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.cell { min-width: 0; }
.cell .l1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .l2 { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.hname b { font-weight: 650; }
.hname .dom { color: var(--faint); font-weight: 450; }
.tags { display: flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; margin-top: 4px; }
.tag {
  display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600;
  font-family: var(--mono); border: 1px solid var(--line2); color: var(--muted); background: var(--surface2); white-space: nowrap;
}
.tag.alias { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.tag.free { font-family: var(--sans); }
.ap { display: inline-flex; align-items: center; gap: 7px; }
.ap .code {
  font: 700 11.5px/1 var(--mono); letter-spacing: .06em; padding: 4px 6px; border-radius: 6px;
  background: var(--text); color: var(--surface);
}
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--line);
}
.pill svg { width: 12px; height: 12px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.crit, .pill.down { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.pill.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.osdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; background: var(--faint); }
.osdot.ubuntu { background: #e95420; } .osdot.debian { background: #d70a53; }

.status {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--tone-soft); color: var(--tone);
}
.status svg { width: 14px; height: 14px; }
.status.ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.status.info { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.status.warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.status.crit { --tone: var(--crit); --tone-soft: var(--crit-soft); }
.status.down { --tone: var(--down); --tone-soft: var(--crit-soft); }
.status.down::after, .status.crit::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--tone); opacity: 0; animation: ping 2s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(1.35); opacity: 0; } }
.status.busy::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin .9s linear infinite;
}

.bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--ok); }
.bar i.warn { background: var(--warn); } .bar i.crit { background: var(--crit); }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.spark { display: flex; align-items: center; gap: 8px; }
.spark svg { width: 74px; height: 26px; flex: none; overflow: visible; }
.svc { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.svc i { width: 9px; height: 9px; border-radius: 3px; background: var(--ok); display: block; }
.svc i.bad { background: var(--crit); box-shadow: 0 0 0 3px var(--crit-soft); }
.svc i.unk { background: var(--line2); }
.seen { text-align: right; font-size: 12px; color: var(--faint); }
.chan { display: inline-flex; gap: 3px; justify-content: flex-end; margin-top: 3px; }
.chan b { font: 700 9.5px/1 var(--mono); padding: 2px 3px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); }
.chan b.off { background: var(--surface2); color: var(--faint); text-decoration: line-through; }
.chan b.bad { background: var(--crit-soft); color: var(--crit); }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--faint); }

.foot { display: flex; gap: 16px; justify-content: space-between; color: var(--faint); font-size: 12px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 8, 16, .38); z-index: 40; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); z-index: 41; background: var(--bg2);
  border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: slide .22s cubic-bezier(.2, .8, .2, 1);
}
.drawer.narrow { width: min(520px, 100vw); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.d-head { padding: 18px 22px 0; background: var(--surface); border-bottom: 1px solid var(--line); }
.d-title { display: flex; gap: 13px; align-items: flex-start; }
.d-title .status { width: 34px; height: 34px; margin-top: 2px; }
.d-title .status svg { width: 17px; height: 17px; }
.d-title h3 { margin: 0; font-size: 19px; letter-spacing: -.01em; word-break: break-all; }
.d-title .sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.d-title .x { margin-left: auto; display: flex; gap: 6px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.tabs .n.crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.d-body { padding: 20px 22px 40px; overflow-y: auto; flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h4 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); display: flex; align-items: center; gap: 8px; }
.card h4 .r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.issues { display: grid; gap: 8px; }
.issue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); font-size: 13.5px; }
.issue i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--info); }
.issue.crit i, .issue.down i { background: var(--crit); } .issue.warn i { background: var(--warn); }
.disk { margin-bottom: 10px; }
.disk .t { display: flex; justify-content: space-between; font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lifebar { position: relative; height: 8px; border-radius: 5px; background: var(--line); margin: 10px 0 6px; overflow: hidden; }
.lifebar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: linear-gradient(90deg, var(--ok), var(--ok)); }
.lifebar i.warn { background: var(--warn); } .lifebar i.crit { background: var(--crit); }
.lifelegend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); }

.charts { display: grid; gap: 14px; }
.chart { position: relative; }
.chart .ct { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; margin-bottom: 4px; }
.chart .ct b { font-weight: 650; }
.chart svg { width: 100%; height: 92px; overflow: visible; }
.chart .tip {
  position: absolute; pointer-events: none; background: var(--raise); border: 1px solid var(--line2); border-radius: 7px;
  padding: 4px 8px; font-size: 11.5px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, -110%);
}
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: 0; background: none; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

table.pk { width: 100%; border-collapse: collapse; font-size: 13px; }
table.pk th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 0 8px 8px; font-weight: 700; }
table.pk td { padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
table.pk td.v { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
table.pk td.v b { color: var(--text); font-weight: 600; }
.pk-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.pk-tools .input { max-width: 240px; height: 32px; }
.cmd { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 7px 7px 11px; margin-top: 8px; }
.cmd code { font: 12.5px var(--mono); flex: 1; overflow-x: auto; white-space: nowrap; }
.cmd .lbl { font-size: 11px; color: var(--faint); font-weight: 600; white-space: nowrap; }

.svc-list { display: grid; gap: 8px; }
.svc-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); }
.svc-row .nm { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.svc-row .ty { font-size: 11px; color: var(--faint); }
.svc-row .r { margin-left: auto; text-align: right; font-size: 12px; color: var(--faint); }

.feed { display: grid; }
.ev { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.ev:first-child { border-top: 0; }
.ev i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--info); }
.ev.ok i { background: var(--ok); } .ev.warn i { background: var(--warn); } .ev.crit i { background: var(--crit); }
.ev time { color: var(--faint); font-size: 12px; white-space: nowrap; }

/* ---------- form ---------- */
.form { display: grid; gap: 16px; }
.form .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form .cols3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.form fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; display: grid; gap: 14px; background: var(--surface); }
.form legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.chips-in { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 36px; padding: 4px 6px; border-radius: 9px; border: 1px solid var(--line2); background: var(--surface2); cursor: text; }
.chips-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chips-in .tag { height: 24px; gap: 6px; font-size: 12px; }
.chips-in .tag button { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; opacity: .6; font-size: 14px; line-height: 1; }
.chips-in input { border: 0; outline: 0; background: none; flex: 1; min-width: 100px; height: 26px; }
.form .bar-actions { display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: -40px; padding: 14px 0 0; background: linear-gradient(transparent, var(--bg2) 30%); }
.form .err { color: var(--crit); font-size: 13px; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; }
.suggest button { font-size: 11.5px; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 16, .45); animation: fade .15s; }
.modal { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 22px; }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 550; box-shadow: var(--shadow-lg); animation: fade .2s; }
.toast.err { background: var(--crit); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1360px) {
  .row { grid-template-columns: 30px minmax(180px, 2fr) minmax(100px, 1fr) minmax(150px, 1.3fr) minmax(104px, .95fr) minmax(112px, 1fr) minmax(110px, 1fr) minmax(80px, .8fr) minmax(96px, 1fr) 60px; }
  .row .c-mem { display: none; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .row { grid-template-columns: 30px minmax(170px, 2fr) minmax(140px, 1.3fr) minmax(100px, 1fr) minmax(110px, 1fr) minmax(80px, .8fr) minmax(90px, 1fr); }
  .row .c-loc, .row .c-load, .row .c-mem, .row .c-seen { display: none; }
}
@media (max-width: 760px) {
  .top { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .search kbd { display: none; }
  .top .actions .lbl { display: none; }
  main { padding: 16px 16px 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .v { font-size: 23px; }
  .row.head { display: none; }
  .row.host { grid-template-columns: 30px 1fr auto; gap: 4px 12px; padding: 13px 14px; }
  .row.host .cell { grid-column: 2 / 4; }
  .row.host .c-status { grid-column: 1; grid-row: 1 / 4; align-self: start; }
  .row.host .c-host { grid-column: 2; }
  .row.host .c-upd { grid-column: 3; grid-row: 1; justify-self: end; }
  .row.host .c-os { display: block; }
  .row.host .c-kern, .row.host .c-disk, .row.host .c-svc { display: none; }
  .group-h .tools { opacity: 1; }
  .kv { grid-template-columns: 120px 1fr; }
  .grid2, .form .cols, .form .cols3 { grid-template-columns: 1fr; }
  .d-head { padding: 14px 16px 0; }
  .d-body { padding: 16px 16px 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
