/* ============================================================ PathLog – wygląd */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 9px;
  --side-w: 248px;

  /* kolory z logo */
  --brand-1: #22d3ee;
  --brand-2: #3b82f6;
  --brand-3: #a855f7;
  --grad: linear-gradient(120deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));

  /* wagi */
  --critical: #ff3d68;
  --high: #ff8a3d;
  --medium: #f7c948;
  --low: #4da3ff;
  --info: #8b97b5;
  --ok: #22c993;
  --offline: #6b7694;

  /* serie wykresów */
  --s-failed: #ff5d7a;
  --s-web: #f7a531;
  --s-priv: #a97bff;
  --s-success: #22c993;
}

:root, [data-theme="dark"] {
  --bg: #060a16;
  --bg-2: #0a1022;
  --panel: rgba(17, 25, 48, .78);
  --panel-solid: #111930;
  --panel-2: #172242;
  --panel-3: #1d2a50;
  --border: #233158;
  --border-2: #2e3f6e;
  --text: #eef2fb;
  --text-2: #c3cbe0;
  --muted: #8592b3;
  --accent: #38bdf8;
  --accent-ink: #04121f;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --glow-1: rgba(34, 211, 238, .10);
  --glow-2: rgba(168, 85, 247, .10);
  --chip-ink: #0a0f1d;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f6fc;
  --bg-2: #e9eef8;
  --panel: rgba(255, 255, 255, .92);
  --panel-solid: #ffffff;
  --panel-2: #f1f4fb;
  --panel-3: #e6ebf6;
  --border: #dbe2f0;
  --border-2: #c7d1e6;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5d6b86;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --glow-1: rgba(34, 211, 238, .12);
  --glow-2: rgba(168, 85, 247, .08);
  --chip-ink: #0a0f1d;
  --medium: #e0a800;
  --ok: #10a877;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text);
  background:
    radial-gradient(900px 500px at 100% -10%, var(--glow-2), transparent 60%),
    radial-gradient(800px 500px at 0% 0%, var(--glow-1), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .88em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.sm { width: 14px; height: 14px; vertical-align: -2px; }
.i.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------ przyciski i formularze */
button, select, input, textarea {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
button { padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; transition: border-color .15s, background .15s, transform .1s; }
button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 4px 14px rgba(59, 130, 246, .35); }
button.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); }
button.danger:hover { background: color-mix(in srgb, var(--critical) 12%, var(--panel-2)); border-color: var(--critical); }
button.ghost { background: transparent; }
button.sm { padding: 4px 10px; font-size: 13px; }
select, input, textarea { padding: 8px 11px; font-size: 14px; }
select { cursor: pointer; padding-right: 28px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand-2); vertical-align: -3px; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
label.f { display: grid; gap: 5px; font-size: 13px; color: var(--muted); font-weight: 500; }
label.f input, label.f select { color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------ układ: menu u góry */
.top {
  position: sticky; top: 0; z-index: 40; background: var(--bg-2);
  border-bottom: 1px solid var(--border); box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.bar { display: flex; align-items: center; gap: 18px; padding: 10px 28px; max-width: 1700px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
.brand b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.1; }
.brand b span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { color: var(--muted); font-size: 12px; }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
.icon-btn.on { color: var(--brand-1); border-color: color-mix(in srgb, var(--brand-1) 60%, transparent); background: color-mix(in srgb, var(--brand-1) 12%, var(--panel-2)); }
.threat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; color: var(--text); border: 1px solid color-mix(in srgb, var(--c, var(--ok)) 55%, transparent); background: color-mix(in srgb, var(--c, var(--ok)) 12%, var(--panel-2)); white-space: nowrap; }
.threat-pill:hover { text-decoration: none; }
.threat-pill:empty { display: none; }
.threat-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.live { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 500; padding-left: 4px; white-space: nowrap; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: var(--offline); }
.live.on { color: var(--ok); }
.live.on i { background: var(--ok); }

.tabs { display: flex; gap: 2px; padding: 0 22px; max-width: 1700px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px 12px; color: var(--text-2); font-weight: 600; font-size: 14px;
  white-space: nowrap; position: relative; border-radius: 8px 8px 0 0;
}
.tabs a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.tabs a.active { color: var(--text); }
.tabs a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.tabs a.active .i { color: var(--brand-1); }
.tabs .cnt { font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; background: var(--panel-3); color: var(--text-2); }
.tabs .cnt.hot { background: var(--critical); color: #fff; }
.tabs .cnt.warm { background: var(--high); color: #fff; }

.page { max-width: 1700px; margin: 0 auto; padding: 22px 28px 70px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 26px; line-height: 1.2; }
.page-head #page-sub { font-size: 14px; color: var(--muted); }
main#view { display: grid; gap: 20px; align-content: start; }
.loading { color: var(--muted); padding: 60px; text-align: center; display: flex; gap: 12px; align-items: center; justify-content: center; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--brand-1); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ panele */
.panel {
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; min-width: 0; box-shadow: var(--shadow);
}
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-h h2 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.panel-h h2 .i { color: var(--brand-1); }
.panel-h .sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.panel-h .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.g-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.g-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; }
.empty { color: var(--muted); padding: 26px 8px; text-align: center; }
.empty .i { width: 30px; height: 30px; display: block; margin: 0 auto 8px; color: var(--ok); }

/* ------------------------------------------------------------ KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1500px) { .kpis:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
.kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px 12px;
  position: relative; overflow: hidden; box-shadow: var(--shadow); color: var(--text); display: block;
}
a.kpi:hover { text-decoration: none; border-color: var(--c); }
.kpi .lbl { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kpi .lbl .i { color: var(--c); }
.kpi .val { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .sub { color: var(--muted); font-size: 13px; }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 50%; height: 38px; opacity: .55; }
.kpi .lbl, .kpi .val, .kpi .sub { position: relative; z-index: 1; }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, var(--accent)); }

/* ------------------------------------------------------------ poziom zagrożenia */
.threat { display: grid; grid-template-columns: 1fr; gap: 6px; justify-items: center; text-align: center; }
.threat p { margin: 4px 0 0; }
.threat .g-wrap { position: relative; width: 200px; }
.threat .g-val { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; }
.threat .g-val b { font-size: 38px; font-weight: 800; display: block; line-height: 1; }
.threat .g-val span { font-size: 13px; color: var(--muted); }
.threat .lvl { font-size: 24px; font-weight: 800; color: var(--c); }
.threat p { color: var(--text-2); font-size: 14px; }
.todo { display: grid; gap: 8px; margin-top: 4px; }
.todo a, .todo div {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--panel-2);
  color: var(--text); font-size: 14px; border-left: 3px solid var(--c);
}
.todo a:hover { text-decoration: none; background: var(--panel-3); }
.todo .i { color: var(--c); }
.todo .go { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ------------------------------------------------------------ strażnik (Sentinel) */
.sentinel { display: block; flex: none; overflow: visible; }
.sentinel .halo { fill: none; stroke: var(--sc); stroke-width: 1.5; opacity: 0; }
.sentinel .shield { fill: color-mix(in srgb, var(--sc) 18%, var(--panel-solid)); stroke: var(--sc); stroke-width: 3; }
.sentinel .eye { fill: var(--panel-solid); stroke: var(--sc); stroke-width: 2.5; }
.sentinel .iris { fill: var(--sc); }
.sentinel .pupil { fill: var(--panel-solid); }
.hero .sentinel .scan { animation: look 6s ease-in-out infinite; }
.s-ok { --sc: var(--ok); }
.s-info, .s-low { --sc: var(--low); }
.s-medium { --sc: var(--medium); }
.s-high { --sc: var(--high); }
.s-critical { --sc: var(--critical); }
.s-offline { --sc: var(--offline); }
.s-muted { --sc: var(--offline); }
.s-offline .scan { animation: none; transform: translateY(3px); }
.s-offline .eye { stroke-dasharray: 4 3; }
.s-critical .halo { animation: halo 1.6s ease-out infinite; }
@keyframes look { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }
@keyframes glow { 50% { fill: color-mix(in srgb, var(--sc) 45%, var(--panel-solid)); } }
@keyframes halo { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }
.sentinel .halo { transform-origin: 32px 32px; transform-box: view-box; }

.sentinels { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.s-card {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; position: relative;
  padding: 14px 14px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); transition: transform .12s, border-color .12s, box-shadow .12s;
}
.s-card:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--sc); box-shadow: 0 8px 24px color-mix(in srgb, var(--sc) 20%, transparent); }
.s-card .body { min-width: 0; display: grid; gap: 1px; }
.s-card b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 70px; }
.s-card .os { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-card .stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.s-card .stats span { display: inline-flex; align-items: center; gap: 4px; }
.s-card .badges { position: absolute; top: 10px; right: 10px; }
.s-card .state { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 9px; color: var(--muted); }
.s-card .state b { font-size: 12.5px; padding: 0; color: var(--sc); }
.s-card .state .go { color: var(--muted); }
.s-card:hover .state .go { color: var(--accent); }

/* ------------------------------------------------------------ odznaki, wagi, tagi */
.badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; gap: 3px; border-radius: 11px; padding: 0 8px;
  font-size: 12px; font-weight: 700; line-height: 20px; color: var(--chip-ink); background: var(--c);
}
.badges.big .badge { font-size: 14px; line-height: 28px; padding: 0 12px; border-radius: 14px; }
.badge.c-critical { animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .55; } }
.sev { display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 2px 9px; font-size: 12px; font-weight: 700; color: var(--chip-ink); background: var(--c); white-space: nowrap; }
.sev .i { stroke-width: 2.6; }
.c-critical { --c: var(--critical); } .c-high { --c: var(--high); } .c-medium { --c: var(--medium); }
.c-low { --c: var(--low); } .c-info { --c: var(--info); } .c-ok { --c: var(--ok); } .c-offline { --c: var(--offline); }
.c-brand { --c: var(--brand-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-2); color: var(--text-2); border-radius: 6px; padding: 0 6px; white-space: nowrap; line-height: 19px; }
.tag.red { border-color: var(--critical); color: var(--critical); }
.tag.green { border-color: var(--ok); color: var(--ok); }
.tag.blue { border-color: var(--brand-2); color: var(--brand-2); }
.tag.amber { border-color: var(--high); color: var(--high); }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--ok); vertical-align: 0; }
.status-dot.off { background: var(--critical); }
.status-dot.mute { background: var(--offline); }

/* ------------------------------------------------------------ wykresy */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart text { fill: var(--muted); font-size: 11.5px; font-family: var(--font); }
.chart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .hit:hover { fill: color-mix(in srgb, var(--text) 5%, transparent); }
.tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--panel-solid); border: 1px solid var(--border-2);
  border-radius: 10px; padding: 9px 12px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); min-width: 170px;
}
.tip b { display: block; margin-bottom: 5px; }
.tip .row { display: flex; justify-content: space-between; gap: 16px; }
.tip i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(50px, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 5px; align-items: center; }
.hbar .track { height: 12px; background: var(--panel-3); border-radius: 6px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 6px; background: var(--c, var(--s-failed)); }
.hbar .num { font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 40px; text-align: right; font-weight: 600; }

.donut-wrap { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.donut text { font-family: var(--font); }
.donut .tot { font-size: 26px; font-weight: 800; fill: var(--text); }
.donut .lab { font-size: 11px; fill: var(--muted); }
.dlegend { display: grid; gap: 8px; font-size: 14px; }
.dlegend div { display: flex; align-items: center; gap: 9px; }
.dlegend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.dlegend b { margin-left: auto; font-variant-numeric: tabular-nums; }

.heat { display: grid; grid-template-columns: 78px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 11.5px; }
.heat .hl { color: var(--muted); display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.heat .hh { color: var(--muted); text-align: center; overflow: hidden; }
.heat .cell { height: 22px; border-radius: 4px; background: var(--panel-3); }
.heat .cell:hover { outline: 2px solid var(--text); }
.heat-scale { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 10px; justify-content: flex-end; }
.heat-scale i { width: 16px; height: 12px; border-radius: 3px; }

.risk { display: flex; align-items: center; gap: 8px; }
.risk .bar { width: 70px; height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.risk .bar i { display: block; height: 100%; background: var(--c); }
.risk b { font-variant-numeric: tabular-nums; min-width: 26px; }
.pbar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; width: 110px; background: var(--panel-3); }
.pbar i { display: block; height: 100%; }

/* ------------------------------------------------------------ alerty */
.alerts { display: grid; gap: 10px; }
.day-h { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 0; }
.alert {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  padding: 13px 15px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border);
  border-left: 4px solid var(--c);
}
.alert.acked { opacity: .62; }
.alert .t { font-weight: 700; font-size: 15px; }
.alert .d { color: var(--text-2); font-size: 14px; word-break: break-word; margin-top: 2px; }
.alert .m { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 7px; align-items: center; }
.alert .m a, .alert .m span { display: inline-flex; align-items: center; gap: 5px; }
.alert .note { margin-top: 8px; font-size: 13.5px; padding: 7px 10px; border-radius: 8px; background: color-mix(in srgb, var(--brand-2) 10%, transparent); border: 1px dashed color-mix(in srgb, var(--brand-2) 40%, transparent); }
.alert .a-side { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 260px; }
.alerts.compact .alert { padding: 10px 12px; gap: 6px; grid-template-columns: 1fr auto; }
.alerts.compact .alert > .sev { grid-column: 1; justify-self: start; }
.alerts.compact .alert > div:not(.a-side) { grid-column: 1 / -1; grid-row: 2; }
.alerts.compact .alert > .a-side { grid-column: 2; grid-row: 1; }
.alerts.compact .alert .t { font-size: 14px; }
.alerts.compact .alert .d { font-size: 13px; }

/* ------------------------------------------------------------ filtry */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { min-width: 220px; flex: 1; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: none; background: none; padding: 6px 12px; border-radius: 7px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border-radius: 18px; padding: 5px 12px; font-size: 13px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2); }
.chip.on { background: color-mix(in srgb, var(--c, var(--brand-2)) 18%, var(--panel-2)); border-color: var(--c, var(--brand-2)); color: var(--text); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }

/* ------------------------------------------------------------ tabele */
.table-wrap { overflow: auto; max-height: 640px; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 10px 12px; background: var(--panel-solid); position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
tbody tr:hover td { background: color-mix(in srgb, var(--brand-2) 8%, transparent); }
td.msg { word-break: break-word; min-width: 240px; }
td .host { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
tr.clickable { cursor: pointer; }
.more { display: flex; justify-content: center; padding-top: 12px; }

/* ------------------------------------------------------------ strona agenta / IP */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero h2 { font-size: 30px; letter-spacing: -.02em; }
.hero .meta { color: var(--text-2); display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero .meta .i { color: var(--muted); }
.hero .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.posture { display: grid; gap: 7px; }
.posture .p { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 10px; background: var(--panel-2); font-size: 14px; }
.posture .p .v { color: var(--text-2); font-size: 13px; text-align: right; font-family: var(--mono); }
.posture .p .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); }
.posture .p .ic .i { width: 15px; height: 15px; stroke-width: 2.6; }
.score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.score-row .pbar { flex: 1; height: 10px; width: auto; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ ustawienia / pomoc */
pre {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto;
  white-space: pre-wrap; word-break: break-all; font-size: 13px; margin: 8px 0 12px; font-family: var(--mono); color: var(--text);
}
.copy-box { position: relative; }
.copy-box button { position: absolute; top: 8px; right: 8px; }
.copy-box pre { padding-right: 90px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 9px 18px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.legend-grid > div { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--panel-2); }
.legend-grid p { margin: 0; font-size: 13px; color: var(--muted); }
.ok-t { color: var(--ok); font-weight: 600; } .bad-t { color: var(--critical); font-weight: 600; }
.section-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: color-mix(in srgb, var(--brand-2) 10%, transparent); border: 1px solid color-mix(in srgb, var(--brand-2) 35%, transparent); font-size: 14px; color: var(--text-2); }
.section-note .i { color: var(--brand-2); margin-top: 2px; }
.report-sum { font-size: 16px; line-height: 1.7; color: var(--text-2); }
.report-sum b { color: var(--text); }

/* ------------------------------------------------------------ toasty, modal */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 10px; width: min(400px, calc(100vw - 32px)); }
.toast {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--panel-solid); border: 1px solid var(--c); border-left-width: 4px; border-radius: 12px; padding: 12px 12px 12px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45); animation: slidein .25s ease-out;
}
.toast .t { font-weight: 700; font-size: 14px; }
.toast .d { font-size: 13px; color: var(--muted); }
.toast a { font-size: 13px; font-weight: 600; }
.toast .x { background: none; border: none; color: var(--muted); padding: 4px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(2, 6, 18, .7); padding: 16px; }
.modal[hidden] { display: none; }
.modal .box { width: min(560px, 100%); max-height: 90vh; overflow: auto; background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 16px; padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); display: grid; gap: 14px; animation: pop .18s ease-out; }
.modal .box h3 { font-size: 19px; }
.modal .box .acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* ------------------------------------------------------------ responsywność */
@media (max-width: 1280px) {
  .g3 { grid-template-columns: 1fr 1fr; }
  .g3 > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .g-2-1, .g-1-2, .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .bar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .brand small { display: none; }
  .live span { display: none; }
  .tabs { padding: 0 10px; }
  .tabs a { padding: 10px 11px 11px; }
  .page { padding: 16px 16px 60px; }
  main#view { gap: 16px; }
  .g3 { grid-template-columns: 1fr; }
  .alert { grid-template-columns: 1fr; }
  .alert .a-side { justify-content: flex-start; max-width: none; }
  .hero .acts { margin-left: 0; justify-content: flex-start; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .dlegend { width: 100%; }
  .heat { grid-template-columns: 54px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .heat .hh:nth-child(odd) { visibility: hidden; }
  #range { max-width: 150px; }
  .fields { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .threat-pill span { display: none; }
  .tabs a span:not(.cnt) { display: none; }
  .tabs a.active span:not(.cnt) { display: inline; }
}
@media (max-width: 520px) {
  .kpis, .kpis:has(> :nth-child(6):last-child) { grid-template-columns: 1fr 1fr; }
  .kpi .val { font-size: 27px; }
  .tools .icon-btn { width: 36px; height: 36px; }
  #page-sub { display: none; }
}

/* ------------------------------------------------------------ druk (raporty) */
@media print {
  .top, #toasts, .no-print { display: none !important; }
  .page { padding: 0; }
  body { background: #fff; color: #000; }
  .panel, .kpi { box-shadow: none; border-color: #ccc; background: #fff; break-inside: avoid; }
  .table-wrap { max-height: none; overflow: visible; }
}

/* ------------------------------------------------------------ szczegóły zdarzenia / alertu */
tr.clickable td { cursor: pointer; }
tr.current td { background: color-mix(in srgb, var(--brand-2) 18%, transparent) !important; font-weight: 600; }
td.go-cell { width: 28px; color: var(--muted); text-align: right; }
tr.clickable:hover td.go-cell { color: var(--accent); }
td.msg .short { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.what { font-size: 18px; line-height: 1.55; color: var(--text); }
.explain { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.explain > div { padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border-left: 4px solid var(--c, var(--brand-2)); }
.explain h3 { font-size: 14px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.explain p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.log {
  background: #050913; color: #d6e2ff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  max-height: 520px; overflow: auto; margin: 0;
}
[data-theme="light"] .log { background: #0f172a; color: #e2e8f0; }
.log .hl-ip { color: #fbbf24; font-weight: 600; }
.log .hl-user { color: #c4b5fd; font-weight: 600; }
.log .hl-bad { color: #ff7a93; font-weight: 600; }
.log .hl-ok { color: #4ade80; font-weight: 600; }
.fields { display: grid; grid-template-columns: max-content 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; font-size: 14px; }
.fields > span { padding: 9px 14px; border-bottom: 1px solid var(--border); word-break: break-word; }
.fields > span:nth-child(odd) { color: var(--muted); background: var(--panel-2); font-weight: 500; }
.fields > span:nth-last-child(-n+2) { border-bottom: none; }
.nav-arrows { display: flex; gap: 8px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.mini-stats > div { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.mini-stats b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 12.5px; color: var(--muted); }
.alert .t a { color: var(--text); }
.alert .t a:hover { color: var(--accent); }
@media (max-width: 1000px) { .explain { grid-template-columns: 1fr; } }
.s-card .state { gap: 10px; }
.s-card .state > * { white-space: nowrap; }
.s-card .state > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; text-align: center; }
@media (max-width: 640px) {
  .tools { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .tools .icon-btn { width: 34px; height: 34px; }
  #range { max-width: 112px; padding-right: 22px; }
  .threat-pill { padding: 5px 9px; }
}

/* ============================================================ v3: spokojniejszy układ */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-actions:empty { display: none; }
main#view { gap: 24px; }
.panel { padding: 22px 24px; }
.panel-h { margin-bottom: 18px; }
.panel-h h2 { font-size: 17px; }
.panel-h .acts a { font-size: 14px; font-weight: 600; }
.stack { display: grid; gap: 16px; align-content: start; }
.box { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: grid; gap: 12px; margin: 0; }
.box legend { padding: 0 6px; font-weight: 700; }
h3.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 -4px; }

/* karta stanu na pulpicie */
.status-card { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; border-left: 5px solid var(--c); }
.status-card .g-wrap { position: relative; width: 200px; }
.status-card .g-val { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.status-card .g-val b { font-size: 36px; font-weight: 800; display: block; line-height: 1; }
.status-card .g-val span { font-size: 13px; color: var(--c); font-weight: 700; }
.status-card .eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.status-card h2 { font-size: 24px; margin: 4px 0 4px; }
.status-card p { color: var(--text-2); margin-bottom: 14px; }
.status-card .todo { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kpis.k4 { grid-template-columns: repeat(4, 1fr); }

/* karta strażnika - mniej elementów */
.s-card { padding: 14px; }
.s-card .st-line { display: flex; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.s-card .st-line b { color: var(--sc); font-size: 12.5px; padding: 0; }
.s-card b { padding-right: 90px; }

/* zakładki wewnątrz strony */
.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: -4px; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { background: none; border: none; border-radius: 8px 8px 0 0; padding: 10px 16px 12px; color: var(--text-2); font-weight: 600; position: relative; white-space: nowrap; }
.subtabs button:hover { color: var(--text); background: var(--panel-2); }
.subtabs button.on { color: var(--text); }
.subtabs button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.subtabs .cnt { font-size: 11.5px; border-radius: 10px; padding: 0 7px; background: var(--critical); color: #fff; }

/* menu użytkownika */
.menu-wrap { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 280px; z-index: 70; background: var(--panel-solid);
  border: 1px solid var(--border-2); border-radius: 14px; padding: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); display: grid; gap: 2px;
}
.dropdown[hidden] { display: none; }
.dropdown .dd-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown .dd-head small { display: block; color: var(--muted); font-size: 12px; }
.dropdown button, .dropdown a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; background: none; border-radius: 9px; color: var(--text); font-weight: 500; font-size: 14px; text-align: left; }
.dropdown button:hover, .dropdown a:hover { background: var(--panel-2); text-decoration: none; }
.dropdown .val { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.dropdown .val.on { color: var(--ok); }
.dropdown hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }

@media (max-width: 1100px) { .kpis.k4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .status-card { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; }
  .status-card .todo { grid-template-columns: 1fr; text-align: left; width: 100%; }
  .page-head { align-items: flex-start; }
  .panel { padding: 18px 16px; }
}
html { background: var(--bg); }
body { min-height: 100vh; background-repeat: no-repeat; }

/* ============================================================ v4: styl konsoli (płasko, ciemno, fiolet) */
:root, [data-theme="dark"] {
  --bg: #0c0e14;
  --bg-2: #11131b;
  --panel: #161923;
  --panel-solid: #161923;
  --panel-2: #1c2030;
  --panel-3: #262b3d;
  --border: #242939;
  --border-2: #313750;
  --text: #e9ebf3;
  --text-2: #b8bed0;
  --muted: #7f879d;
  --accent: #9d8cff;
  --brand-2: #6d4aff;
  --purple: #6d4aff;
  --purple-2: #8b6dff;
  --purple-3: #b9a6ff;
  --ok: #14b8a6;
  --shadow: none;
  --radius: 8px;
  --radius-sm: 6px;
  --s-failed: #6d4aff;
  --s-web: #b9a6ff;
  --s-priv: #22d3ee;
  --s-success: #14b8a6;
}
[data-theme="light"] {
  --bg: #f4f5f9; --bg-2: #ffffff; --panel: #ffffff; --panel-solid: #ffffff; --panel-2: #f3f4f8; --panel-3: #e7e9f0;
  --border: #e1e4ec; --border-2: #cfd3df; --text: #1a1d29; --text-2: #3d4356; --muted: #6b7286;
  --accent: #5b36f2; --brand-2: #5b36f2; --purple: #5b36f2; --purple-2: #7b5cff; --purple-3: #b4a3ff;
  --ok: #0d9488; --s-failed: #5b36f2; --s-web: #a993ff; --s-priv: #0891b2; --s-success: #0d9488; --shadow: none;
}
body { background: var(--bg); font-size: 14.5px; }
a { color: var(--accent); }

/* górny pasek */
.top { background: var(--bg-2); box-shadow: none; border-bottom: 1px solid var(--border); }
.bar { gap: 14px; padding: 8px 24px; }
.brand b { font-size: 18px; }
.brand img { filter: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs::before { content: ""; width: 1px; height: 22px; background: var(--border-2); margin-right: 6px; flex: none; }
.crumbs a { color: var(--text-2); font-weight: 500; }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--border-2); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.tools { margin-left: 0; gap: 10px; }
.threat-pill { border-radius: 8px; padding: 6px 10px; font-size: 12.5px; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; background: transparent; border-color: transparent; color: var(--text-2); }
.icon-btn:hover { background: var(--panel-2); border-color: var(--border); }
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.bell:hover { text-decoration: none; }
.bell .dot { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--bg-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; padding: 0; justify-content: center; font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--brand-1)); border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--border-2); }
.avatar:hover { box-shadow: 0 0 0 2px var(--purple-2); }

/* menu główne */
.tabs { padding: 0 16px; gap: 0; }
.tabs a { font-size: 13.5px; padding: 10px 13px 11px; border-radius: 0; color: var(--text-2); }
.tabs a:hover { background: transparent; color: var(--text); }
.tabs a.active::after { left: 8px; right: 8px; height: 2px; background: var(--purple-2); }
.tabs a.active .i { color: var(--purple-2); }
.tabs a .i { width: 16px; height: 16px; }

/* nagłówek strony + podzakładki */
.page { padding: 20px 24px 60px; }
.page-head { margin-bottom: 14px; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.subtabs button { font-size: 13.5px; padding: 9px 2px 11px; margin-right: 22px; border-radius: 0; color: var(--text-2); }
.subtabs button:hover { background: transparent; color: var(--text); }
.subtabs button.on { color: var(--accent); }
.subtabs button.on::after { left: 0; right: 0; height: 2px; background: var(--purple-2); }

/* panele = widżety */
main#view { gap: 18px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 16px 18px; box-shadow: none; }
.panel-h { margin-bottom: 14px; }
.panel-h h2 { font-size: 15px; font-weight: 700; gap: 8px; }
.panel-h h2 .i { color: var(--muted); width: 16px; height: 16px; }
.panel-h .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.panel-h .acts { position: relative; }
.widget { display: flex; flex-direction: column; }
.widget .w-body { flex: 1; min-height: 0; }
.widget .w-foot { margin-top: 12px; text-align: right; font-size: 11.5px; color: var(--muted); }
.kebab { width: 30px; height: 26px; padding: 0; justify-content: center; border: none; background: transparent; color: var(--muted); border-radius: 6px; }
.kebab:hover { background: var(--panel-2); color: var(--text); }
.wmenu { position: absolute; right: 0; top: 30px; z-index: 30; min-width: 210px; background: var(--panel-solid); border: 1px solid var(--border-2); border-radius: 8px; padding: 6px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); display: grid; }
.wmenu[hidden] { display: none; }
.wmenu a, .wmenu button { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border: none; background: none; border-radius: 6px; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; width: 100%; }
.wmenu a:hover, .wmenu button:hover { background: var(--panel-2); text-decoration: none; }

/* pasek pulpitu (zakładki pulpitów + narzędzia) */
.dash-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.dash-tabs { display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.dash-tabs button { border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; background: transparent; padding: 8px 16px; font-size: 13px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.dash-tabs button:hover { color: var(--text); border-color: transparent; }
.dash-tabs button.on { background: var(--panel); border-color: var(--border); color: var(--text); margin-bottom: -1px; padding-bottom: 9px; }
.dash-tools { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.sq-btn { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 6px; background: var(--panel-2); }

/* przyciski i kontrolki - płasko */
button.primary { background: var(--purple); box-shadow: none; }
button.primary:hover { background: var(--purple-2); }
.seg { border-radius: 8px; }
.seg button.on { background: var(--purple); color: #fff; box-shadow: none; }

/* KPI - spokojniej */
.kpi { border-radius: var(--radius); box-shadow: none; padding: 14px 16px 12px; background: var(--panel); }
.kpi::after { display: none; }
.kpi .lbl .i { width: 26px; height: 26px; padding: 5px; border-radius: 7px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); box-sizing: border-box; }
.kpi .val { font-size: 30px; }
.kpi .spark { opacity: .45; }

/* baner krajobrazu zagrożeń */
.status-card { border-left: 3px solid var(--c); }
.status-card h2 { font-size: 21px; }

/* wykresy */
.legend { font-size: 12.5px; }
.legend i { border-radius: 50%; width: 10px; height: 10px; }
.dlegend { font-size: 13px; gap: 9px; }
.dlegend i { border-radius: 50%; width: 11px; height: 11px; }
.dlegend b { color: var(--text-2); font-weight: 600; }
.donut .tot { font-size: 24px; }
.hchart { display: grid; grid-template-columns: max-content 1fr; gap: 0 12px; font-size: 12.5px; align-items: center; }
.hchart .lab { color: var(--text-2); text-align: right; padding: 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.hchart .lab a { color: var(--text-2); }
.hchart .lane { position: relative; height: 26px; border-left: 1px solid var(--border-2);
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: 20% 100%; }
.hchart .lane i { position: absolute; left: 0; top: 7px; height: 12px; border-radius: 0 3px 3px 0; background: var(--purple); }
.hchart .lane span { position: absolute; top: 5px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.hchart .axis { grid-column: 2; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; padding-top: 4px; }
.feed { display: grid; }
.feed a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); color: var(--text); align-items: start; }
.feed a:last-child { border-bottom: none; }
.feed a:hover { text-decoration: none; background: var(--panel-2); }
.feed .t { font-weight: 600; font-size: 13.5px; }
.feed .d { font-size: 12.5px; color: var(--muted); }
.feed .w { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* karty, alerty, tabele - płasko */
.s-card { border-radius: var(--radius); background: var(--panel-2); }
.s-card:hover { transform: none; box-shadow: none; }
.alert { border-radius: var(--radius); }
.table-wrap { border-radius: var(--radius); }
th { background: var(--panel-2); font-size: 12px; }
tbody tr:nth-child(even) td { background: transparent; }
.g-3e { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 18px; }
.g-3e > .panel, .g2 > .panel, .g-2-1 > .panel { min-height: 0; }
@media (max-width: 1200px) { .g-3e { grid-template-columns: 1fr 1fr; } .g-3e > :last-child { grid-column: 1 / -1; } }
@media (max-width: 1000px) { .crumbs { display: none; } }
@media (max-width: 700px) { .g-3e { grid-template-columns: 1fr; } }
.widget { container-type: inline-size; }
.widget .panel-h { flex-wrap: nowrap; align-items: flex-start; }
.widget .panel-h h2 { min-width: 0; flex-wrap: wrap; row-gap: 2px; }
.widget .panel-h .acts { flex: none; }
.widget .donut-wrap { justify-content: center; }
@container (max-width: 420px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; gap: 14px; } .dlegend { width: 100%; max-width: 240px; } }

/* ============================================================ v5: projekt PathLog (granat, poświaty, szkło) */
:root, [data-theme="dark"] {
  --head: "Exo 2", "Inter", system-ui, sans-serif;
  --bg: #070b22;
  --bg-2: #0a0f2b;
  --panel: rgba(18, 25, 66, .62);
  --panel-solid: #121a45;
  --panel-2: rgba(30, 40, 96, .55);
  --panel-3: rgba(52, 64, 140, .45);
  --border: rgba(110, 130, 255, .20);
  --border-2: rgba(130, 150, 255, .34);
  --text: #eef1ff;
  --text-2: #c3c9ee;
  --muted: #8d95c4;
  --accent: #8ea2ff;
  --purple: #7b5cff;
  --purple-2: #9a7bff;
  --purple-3: #c0b0ff;
  --pink: #ff4fa3;
  --cyan: #2fd6ff;
  --blue: #4a7dff;
  --critical: #ff4d6d;
  --high: #ff9a3d;
  --medium: #ffc94a;
  --low: #4aa3ff;
  --ok: #22d38a;
  --s-failed: #6e5bff;
  --s-web: #ff9a3d;
  --s-priv: #2fd6ff;
  --s-success: #22d38a;
  --g-main: linear-gradient(90deg, #3d7bff, #7b5cff 55%, #c04dff);
  --g-hot: linear-gradient(90deg, #ff4fa3, #9a5cff);
  --g-cool: linear-gradient(90deg, #4a7dff, #2fd6ff);
  --g-gauge: linear-gradient(90deg, #2fd6ff, #4a7dff, #7b5cff, #ff4fa3, #ff4d6d);
  --glow: 0 0 0 1px rgba(110, 130, 255, .12), 0 10px 40px rgba(20, 30, 120, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: var(--glow);
}
body {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(123, 92, 255, .22), transparent 60%),
    radial-gradient(900px 600px at -5% 10%, rgba(47, 120, 255, .20), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(192, 77, 255, .14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="light"] body { background: var(--bg); }
h1, h2, h3, .brand b, .kpi .val, .g-val b { font-family: var(--head); }

/* ---------- górny pasek */
.top { background: rgba(7, 11, 34, .82); border-bottom: 1px solid rgba(110, 130, 255, .14); backdrop-filter: blur(10px); box-shadow: none; }
.bar { padding: 12px 28px; gap: 24px; }
.brand { gap: 12px; }
.brand img { filter: drop-shadow(0 0 14px rgba(90, 120, 255, .6)); }
.brand b { font-size: 26px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.brand b span { background: linear-gradient(90deg, #6aa8ff, #a58bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tools { gap: 14px; margin-left: auto; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; color: var(--text); background: transparent; border: none; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--panel-2); text-decoration: none; }
.icon-btn .i { width: 22px; height: 22px; }
.bell .dot { top: 4px; right: 5px; min-width: 10px; height: 10px; padding: 0; font-size: 0; background: var(--pink); border: 2px solid var(--bg); box-shadow: 0 0 10px var(--pink); }
.avatar-btn { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 2px; color: var(--text); }
.avatar-btn .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font); color: #fff;
  background: linear-gradient(135deg, #5b5cff, #9a5cff); box-shadow: 0 0 0 2px rgba(150, 140, 255, .35), 0 0 18px rgba(123, 92, 255, .5); border: none; }
.avatar-btn .caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--text-2); }

/* ---------- menu w pigułkach */
.tabs { padding: 6px 22px 12px; gap: 8px; justify-content: center; }
.tabs a { border-radius: 12px; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text); border: 1px solid transparent; }
.tabs a:hover { background: rgba(40, 52, 120, .5); }
.tabs a.active { background: linear-gradient(135deg, rgba(74, 125, 255, .55), rgba(123, 92, 255, .55)); border-color: rgba(140, 160, 255, .55);
  box-shadow: 0 0 22px rgba(90, 110, 255, .45), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.tabs a.active::after { display: none; }
.tabs a .i { width: 18px; height: 18px; color: var(--text-2); }
.tabs a.active .i { color: #fff; }
.tabs .cnt { background: var(--pink); color: #fff; border-radius: 9px; padding: 0 8px; line-height: 20px; font-size: 12px; }
.tabs .cnt.hot { background: var(--pink); }
.tabs .cnt.warm { background: var(--high); }

/* ---------- strona */
.page { max-width: 1480px; padding: 26px 28px 70px; }
.page-head { margin-bottom: 22px; align-items: center; }
.page-head h1 { font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.page-head #page-sub { font-size: 15px; color: var(--text-2); }
main#view { gap: 22px; }

/* ---------- karty jako szkło z poświatą */
.panel, .kpi {
  background: linear-gradient(160deg, rgba(26, 34, 88, .72), rgba(14, 20, 56, .72));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--glow);
}
.panel { padding: 22px 24px; }
.panel-h h2 { font-family: var(--head); font-size: 19px; font-weight: 700; color: #fff; }
.panel-h h2 .i { display: none; }
.panel-h .sub { font-family: var(--font); font-size: 13px; color: var(--text-2); font-weight: 500; }
.panel-h .sub::before { content: "•"; margin: 0 8px 0 2px; color: var(--muted); }
.widget .w-foot { display: none; }
.kebab { color: var(--text); }
.kebab .i { width: 22px; height: 22px; }
.panel-h .acts a { color: var(--text); font-weight: 600; font-size: 13.5px; }

/* ---------- przyciski / segmenty */
.seg { background: rgba(18, 25, 66, .7); border: 1px solid var(--border-2); border-radius: 12px; padding: 4px; }
.seg button { padding: 8px 16px; border-radius: 9px; font-size: 14px; color: var(--text-2); }
.seg button.on { background: linear-gradient(135deg, #4a7dff, #7b5cff); color: #fff; box-shadow: 0 0 16px rgba(110, 100, 255, .55); }
.sq-btn, .cal-btn { width: 44px; height: 44px; border-radius: 12px; background: rgba(18, 25, 66, .7); border: 1px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--text); }
button.primary { background: linear-gradient(135deg, #4a7dff, #7b5cff); box-shadow: 0 0 16px rgba(110, 100, 255, .45); }
button { border-radius: 10px; }

/* ---------- baner: krajobraz zagrożeń */
.hero-threat {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: center; padding: 24px 30px;
  border: 1px solid rgba(120, 150, 255, .45);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 200' preserveAspectRatio='none'><defs><linearGradient id='a' x1='0' x2='1'><stop offset='0' stop-color='%234a7dff' stop-opacity='0'/><stop offset='.6' stop-color='%234a7dff' stop-opacity='.7'/><stop offset='1' stop-color='%23c04dff' stop-opacity='.9'/></linearGradient></defs><g fill='none' stroke='url(%23a)' stroke-width='1.4'><path d='M120 200 C300 160 380 60 600 10'/><path d='M150 200 C320 170 400 80 600 30'/><path d='M180 200 C340 180 420 100 600 52'/><path d='M210 200 C360 186 440 122 600 76'/><path d='M240 200 C380 192 460 146 600 100'/></g></svg>") right top / 60% 100% no-repeat,
    radial-gradient(500px 200px at 95% 0%, rgba(90, 110, 255, .35), transparent 70%),
    linear-gradient(160deg, rgba(28, 38, 104, .85), rgba(14, 20, 60, .85));
  box-shadow: 0 0 40px rgba(60, 90, 255, .25), inset 0 0 0 1px rgba(255, 255, 255, .03);
}
.hero-threat .g-wrap { position: relative; width: 240px; margin: 0 auto; }
.hero-threat .g-val { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; }
.hero-threat .g-val b { font-size: 56px; font-weight: 800; color: #fff; line-height: 1; display: block; }
.hero-threat .g-val span { font-size: 19px; font-weight: 700; color: var(--c); }
.hero-threat .eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--text-2); }
.hero-threat h2 { font-size: 27px; font-weight: 700; color: #fff; margin: 6px 0 4px; }
.hero-threat p { color: var(--text-2); margin-bottom: 18px; }
.act-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.act-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--text);
  background: rgba(10, 14, 40, .55); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); box-shadow: inset 0 0 18px color-mix(in srgb, var(--c) 10%, transparent); }
.act-card:hover { text-decoration: none; background: rgba(20, 26, 70, .7); }
.act-card .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--c); flex: none; }
.act-card .ico .i { width: 24px; height: 24px; }
.act-card b { display: block; font-size: 14.5px; }
.act-card small { color: var(--text-2); font-size: 12.5px; }
.act-card .arr { margin-left: auto; color: var(--text-2); }

/* ---------- KPI */
.kpis.k4 { gap: 20px; }
.kpi { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 20px 20px 16px; min-height: 120px; }
.kpi .lbl { grid-column: 2; font-size: 14.5px; color: var(--text); font-weight: 500; }
.kpi .lbl .i { display: none; }
.kpi .k-ico { grid-row: 1 / span 3; width: 40px; height: 40px; display: grid; place-items: start center; color: var(--c); padding-top: 4px; }
.kpi .k-ico .i { width: 32px; height: 32px; stroke-width: 1.7; }
.kpi .val { grid-column: 2; font-size: 32px; font-weight: 700; color: #fff; margin: 0; }
.kpi .sub { grid-column: 2; font-size: 14px; color: var(--text-2); }
.trend { font-weight: 600; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--critical); }
.trend.bad.up { color: var(--critical); }
.trend.bad.down { color: var(--ok); }
.kpi .spark { width: 46%; height: 56px; opacity: 1; right: 0; bottom: 0; }

/* ---------- wrażliwe serwery */
.srv-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.srv-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 14px 16px; border-radius: 12px; color: var(--text);
  background: rgba(14, 20, 56, .6); border: 1px solid var(--border); }
.srv-card:hover { text-decoration: none; border-color: var(--border-2); background: rgba(24, 32, 84, .7); }
.srv-card .ico { grid-row: 1 / span 3; color: var(--purple-2); }
.srv-card .ico .i { width: 34px; height: 34px; stroke-width: 1.6; }
.srv-card .nm { display: flex; align-items: center; gap: 10px; min-width: 0; }
.srv-card .nm b { font-family: var(--head); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-card .os { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-card .rk { font-size: 13px; font-weight: 600; color: var(--c); }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 85%, #fff 0%); color: #fff; }
.pill.out { background: transparent; border: 1.5px solid var(--c); color: var(--c); }

/* ---------- wykres aktywności i dostępność */
.g-act { display: grid; grid-template-columns: 1fr 330px; gap: 22px; }
.avail { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.avail .ring { position: relative; width: 160px; height: 160px; }
.avail .ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 30px var(--head); color: #fff; }
.avail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.avail li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.avail .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.avail .ck .i { width: 13px; height: 13px; stroke-width: 3.2; }

/* ---------- bieżące alerty i źródła */
.g-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.arow { display: grid; grid-template-columns: auto auto 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 12px; color: var(--text);
  background: rgba(14, 20, 56, .55); border: 1px solid var(--border); border-left: 4px solid var(--c); margin-bottom: 10px; }
.arow:last-child { margin-bottom: 0; }
.arow:hover { text-decoration: none; background: rgba(24, 32, 84, .7); }
.arow .warn { color: var(--c); }
.arow .warn .i { width: 26px; height: 26px; fill: color-mix(in srgb, var(--c) 30%, transparent); }
.arow b { display: block; font-size: 14px; }
.arow small { color: var(--text-2); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow .w { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.arow > div { min-width: 0; }
.srcs { display: grid; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(14, 20, 56, .55); border: 1px solid var(--border); }
.src { display: grid; grid-template-columns: 130px 100px 1fr 44px; gap: 14px; align-items: center; font-size: 14.5px; }
.src a { color: var(--text); font-family: var(--mono); font-size: 13.5px; }
.src .track { height: 10px; border-radius: 6px; background: rgba(60, 70, 140, .35); overflow: hidden; }
.src .track i { display: block; height: 100%; border-radius: 6px; }
.src .n { text-align: right; font-weight: 700; color: #fff; }

/* ---------- pozostałe elementy w tym stylu */
.s-card, .alert, .posture .p, .todo a, .todo div, .feed a, .mini-stats > div, .legend-grid > div, .explain > div { background: rgba(14, 20, 56, .55); border-color: var(--border); }
.alert { border-radius: 12px; }
.sev { border-radius: 999px; color: #fff; padding: 2px 10px; }
.c-medium.sev, .sev.c-medium { color: #2a1c00; }
.badge { color: #fff; }
.badge.c-medium { color: #2a1c00; }
th { background: rgba(24, 32, 84, .85); color: var(--text-2); }
td { border-color: rgba(110, 130, 255, .12); }
.table-wrap { border-color: var(--border); background: rgba(10, 14, 40, .35); }
input, select, textarea { background: rgba(14, 20, 56, .7); border-color: var(--border-2); }
.subtabs { border-color: var(--border); }
.subtabs button.on { color: #fff; }
.subtabs button.on::after { background: var(--g-main); }
.dropdown, .wmenu, .modal .box, .toast, .tip { background: #121a45; border-color: var(--border-2); }
.chart .grid { stroke: rgba(110, 130, 255, .14); }
.hchart .lane i { background: var(--g-main); }
pre { background: rgba(6, 9, 28, .8); }
@media (max-width: 1200px) {
  .g-act { grid-template-columns: 1fr; }
  .g-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .hero-threat { grid-template-columns: 1fr; text-align: center; padding: 20px; }
  .act-cards { text-align: left; }
  .tabs { justify-content: flex-start; }
  .src { grid-template-columns: 110px 84px 1fr 40px; gap: 8px; }
  .page-head h1 { font-size: 26px; }
  .brand b { font-size: 21px; }
}
@media (max-width: 560px) {
  .src { grid-template-columns: 1fr auto; }
  .src .track, .src .pill { display: none; }
  .avail { grid-template-columns: 1fr; justify-items: center; }
}
[data-theme="light"] body { background: #eef1fb; }
[data-theme="light"] .top { background: rgba(255,255,255,.92); }
[data-theme="light"] .panel, [data-theme="light"] .kpi, [data-theme="light"] .hero-threat { background: #fff; box-shadow: 0 4px 18px rgba(30,40,110,.08); border-color: #dfe3f3; }
[data-theme="light"] .srv-card, [data-theme="light"] .arow, [data-theme="light"] .srcs, [data-theme="light"] .act-card, [data-theme="light"] .s-card, [data-theme="light"] .alert, [data-theme="light"] .posture .p, [data-theme="light"] .todo a, [data-theme="light"] .feed a { background: #f5f7fd; border-color: #e1e5f3; }
[data-theme="light"] .brand b, [data-theme="light"] .page-head h1, [data-theme="light"] .panel-h h2, [data-theme="light"] .kpi .val, [data-theme="light"] .hero-threat h2, [data-theme="light"] .hero-threat .g-val b, [data-theme="light"] .src .n, [data-theme="light"] .avail .ring b { color: var(--text); }
[data-theme="light"] .seg, [data-theme="light"] .cal-btn, [data-theme="light"] input, [data-theme="light"] select { background: #fff; }
[data-theme="light"] th { background: #f0f2fa; }
[data-theme="light"] .dropdown, [data-theme="light"] .wmenu, [data-theme="light"] .modal .box, [data-theme="light"] .toast, [data-theme="light"] .tip { background: #fff; }
.cal-btn:hover { text-decoration: none; border-color: var(--accent); }
.okmark .i { width: 24px; height: 24px; vertical-align: -3px; }
#live[hidden], #threat-pill[hidden], #crumbs[hidden] { display: none !important; }
.srv-card .nm { flex-wrap: wrap; row-gap: 4px; }
.srv-card .nm b { flex: none; max-width: 100%; }
.act-card b { white-space: nowrap; }

/* ---------- puls wykresów */
.pulse-tag { margin-left: auto; display: inline-flex; align-items: center; color: var(--text-2); cursor: help; }
.pulse-tag i { will-change: transform; }
.pulse-tag b { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .pulse-line, .chart .pulse-halo, .spark path { pointer-events: none; }
.chart .pulse-line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.chart .pulse-halo { fill: none; stroke-width: 7; stroke-linejoin: round; opacity: .16; }
@media print { .pulse-line, .pulse-halo, .pulse-dot, .sp-dot, .pulse-tag { display: none; } }

/* ---------- lista serwerów */
.srv-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.srv-list { display: grid; gap: 12px; }
.srv-item { display: grid; grid-template-columns: 80px minmax(150px, 1.2fr) minmax(120px, .8fr) minmax(130px, 1fr) minmax(110px, 1fr) minmax(90px, .8fr) 70px minmax(90px, .8fr) 20px; gap: 16px; align-items: center;
  padding: 14px 18px; border-radius: 14px; background: rgba(14, 20, 56, .6); border: 1px solid var(--border); cursor: pointer; }
.srv-item:hover { border-color: var(--border-2); background: rgba(24, 32, 84, .7); }
.srv-item .srv-img { display: block; }
.srv-item .led { animation: blink 2.4s infinite; }
.si-main { display: grid; gap: 4px; min-width: 0; }
.si-main b { font-family: var(--head); font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-main > span { font-size: 13px; color: var(--text-2); }
.si-f { display: grid; gap: 3px; min-width: 0; font-size: 14px; }
.si-f small { color: var(--muted); font-size: 12px; }
.si-f > span { overflow-wrap: anywhere; }
.si-copy { padding: 2px 5px; vertical-align: 1px; }
.kind-select { width: 100%; max-width: 130px; padding: 4px 6px; font-size: 13px; border-radius: 8px; cursor: pointer; }
.kind-select:disabled { cursor: default; opacity: .8; }
.srv-item .go-cell { color: var(--muted); display: flex; }
.srv-item:hover .go-cell { color: var(--accent); }
[data-theme="light"] .srv-item { background: #fff; }
@media (max-width: 1100px) {
  .srv-item { grid-template-columns: 80px 1fr 1fr 20px; }
  .srv-item .si-main { grid-column: 2 / 4; }
  .srv-item .srv-img { grid-row: 1 / span 3; }
  .srv-item .go-cell { grid-column: 4; grid-row: 1; }
}
@media (max-width: 560px) {
  .srv-item { grid-template-columns: 64px 1fr 20px; gap: 12px; padding: 12px; }
  .srv-item .srv-img { width: 64px; height: auto; grid-row: 1; }
  .srv-item .si-main { grid-column: 2; grid-row: 1; }
  .srv-item .go-cell { grid-column: 3; grid-row: 1; }
  .srv-item .si-f { grid-column: 1 / -1; grid-template-columns: 110px 1fr; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .srv-item .led { animation: none; } }

/* ---------- górny pasek: logo, menu i narzędzia w jednym rzędzie */
.bar { max-width: none; }
.bar .tabs { flex: 1 1 auto; min-width: 0; padding: 0; margin: 0; justify-content: center; gap: 4px; }
.bar .tools { margin-left: 0; flex: none; }
@media (max-width: 1560px) {
  .bar { gap: 14px; padding-left: 18px; padding-right: 18px; }
  .brand b { font-size: 22px; }
  .bar .tabs a { padding: 9px 10px; font-size: 13.5px; gap: 6px; }
  .bar .tabs a .i { width: 16px; height: 16px; }
}
@media (max-width: 1240px) {
  .bar { flex-wrap: wrap; }
  .bar .tools { margin-left: auto; }
  .bar .tabs { order: 5; flex-basis: 100%; justify-content: flex-start; }
}

/* ---------- tło logowania i wejście do aplikacji */
.dune-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(90% 90% at 88% 8%, #2a1570 0%, transparent 60%), radial-gradient(70% 70% at 6% 12%, #0b2a7a 0%, transparent 62%), #050824; }
.dune-bg .arcs { position: absolute; inset: 0; width: 100%; height: 100%; }
.dune-bg canvas { position: absolute; left: 0; bottom: 0; width: 100%; height: 44vh; }
html.entering, html.entering body { background: #050824; }
#enter-veil { display: none; }
html.entering #enter-veil, html.leaving #enter-veil { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
html.entering #enter-veil img, html.leaving #enter-veil img { position: relative; z-index: 1; width: 170px; height: 170px; }
html.entering #enter-veil::after, html.leaving #enter-veil::after { content: ""; position: absolute; left: 50%; top: 50%; width: 900px; height: 900px; margin: -450px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(84, 120, 255, .5), rgba(120, 80, 255, .2) 45%, transparent 72%); }
html.entering.settling #enter-veil { opacity: .995; } /* panel pod spodem rysuje się, zanim zasłona ruszy */
html.entered #enter-veil { animation: veil-out .8s cubic-bezier(.4,0,.2,1) both; will-change: opacity; }
html.entered #enter-veil img { animation: veil-logo .8s cubic-bezier(.4,0,.6,1) both; will-change: transform, opacity; }
@keyframes veil-out { to { opacity: 0; } }
@keyframes veil-logo { to { transform: scale(1.5); opacity: 0; } }

/* ---------- serwery i komputery */
.kind-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.kind-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 12px; font-weight: 600; color: var(--text-2); background: rgba(14, 20, 56, .6); border: 1px solid var(--border); }
.kind-tabs button .i { width: 17px; height: 17px; }
.kind-tabs button.on { color: #fff; background: linear-gradient(135deg, rgba(74, 125, 255, .55), rgba(123, 92, 255, .55)); border-color: rgba(140, 160, 255, .55); }
[data-theme="light"] .kind-tabs button { background: #fff; }
[data-theme="light"] .kind-tabs button.on { color: var(--text); }

/* ---------- kafelek dostępności: długie nazwy serwerów zostają w kontenerze */
.g-act { grid-template-columns: minmax(0, 1fr) 400px; }
.avail { grid-template-columns: auto minmax(0, 1fr); gap: 18px; }
.avail .ring { width: 140px; height: 140px; }
.avail .ring svg { width: 100%; height: 100%; }
.avail .ring b { font-size: 26px; }
.avail ul { min-width: 0; gap: 10px; }
.avail li { min-width: 0; font-size: 14px; }
.avail li a { min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
@media (max-width: 1200px) { .g-act { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) {
  .avail { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .avail ul { justify-self: stretch; }
}

/* ---------- konta i authenticator */
.qr-setup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 12px; }
.qr-box { width: fit-content; background: #fff; border-radius: 10px; overflow: hidden; line-height: 0; }
.qr-box svg { display: block; }
.qr-setup .steps { margin: 0; font-size: 13.5px; }
.qr-key { display: block; margin-top: 4px; font: 600 12px var(--mono); overflow-wrap: anywhere; user-select: all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.codes code { padding: 7px 10px; text-align: center; font: 600 14px var(--mono); border-radius: 8px; background: rgba(14, 20, 56, .75); border: 1px solid var(--border-2); }
#user-menu > a { display: flex; align-items: center; gap: 10px; color: inherit; }
html.role-operator [data-unblock], html.role-operator [data-untrust], html.role-operator #f-trust, html.role-operator [data-reset-key] { display: none !important; }
@media (max-width: 520px) { .qr-setup { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

/* ---------- okno profilu */
#user-menu { min-width: 280px; }
.dropdown .dd-head { align-items: center; gap: 12px; padding: 10px 10px 12px; }
.dropdown .dd-head .avatar { display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; line-height: 1; font-size: 14px; }
.dd-who { display: grid; gap: 1px; min-width: 0; }
.dd-who b { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown .dd-head .dd-who small { display: block; line-height: 1.35; white-space: nowrap; }
.dropdown .dd-head .dd-live { display: flex; align-items: center; gap: 6px; }
.dd-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dropdown .dd-head .dd-live.on { color: var(--ok); }
.dd-live.on i { background: var(--ok); }

/* ---------- jasny motyw: musi być po wszystkich blokach kolorów ciemnego motywu */
html[data-theme="light"] {
  --bg: #eef1fb; --bg-2: #e4e8f7; --panel: #ffffff; --panel-solid: #ffffff; --panel-2: #eff1fb; --panel-3: #e2e6f6;
  --border: #dde1f2; --border-2: #c8cee8; --text: #171c3f; --text-2: #434a74; --muted: #686f9a; --accent: #4b5fe6;
  --purple: #6248ee; --purple-2: #6d52f2; --purple-3: #8a74f5; --pink: #d92e85; --cyan: #0792bb; --blue: #3a68e8;
  --critical: #dc2450; --high: #d9660b; --medium: #b98500; --low: #2474d6; --ok: #0b9560; --info: #6b7694; --offline: #7f87a8;
  --s-failed: #5d49ef; --s-web: #e8821f; --s-priv: #0ea5d0; --s-success: #0fa86b;
  --glow: 0 1px 2px rgba(30, 40, 110, .05), 0 6px 22px rgba(30, 40, 110, .08); --shadow: var(--glow);
  color-scheme: light;
}
html[data-theme="light"] body { background: radial-gradient(1000px 520px at 88% -8%, rgba(123, 92, 255, .1), transparent 60%), radial-gradient(900px 520px at -4% 6%, rgba(47, 120, 255, .09), transparent 60%), var(--bg); background-attachment: fixed; }
html[data-theme="light"] .top { background: rgba(255, 255, 255, .9); border-bottom-color: var(--border); }
html[data-theme="light"] .brand b, html[data-theme="light"] .panel-h h2, html[data-theme="light"] .hero-threat h2, html[data-theme="light"] .hero-threat .g-val b,
html[data-theme="light"] .kpi .val, html[data-theme="light"] .avail .ring b, html[data-theme="light"] .src .n, html[data-theme="light"] .page-head h1,
html[data-theme="light"] h1, html[data-theme="light"] h2, html[data-theme="light"] h3, html[data-theme="light"] .subtabs button.on { color: var(--text); }
html[data-theme="light"] .tabs a { color: var(--text-2); }
html[data-theme="light"] .tabs a .i { color: var(--muted); }
html[data-theme="light"] .tabs a:hover { background: var(--panel-2); color: var(--text); }
html[data-theme="light"] .tabs a.active { color: #fff; background: linear-gradient(135deg, #4a6cf0, #6e50ee); border-color: transparent; box-shadow: 0 3px 10px rgba(90, 80, 230, .28); }
html[data-theme="light"] .tabs a.active .i { color: #fff; }
html[data-theme="light"] .panel, html[data-theme="light"] .kpi, html[data-theme="light"] .hero-threat { background: #fff; border-color: var(--border); box-shadow: var(--glow); }
html[data-theme="light"] .srv-card, html[data-theme="light"] .arow, html[data-theme="light"] .srcs, html[data-theme="light"] .act-card, html[data-theme="light"] .srv-item,
html[data-theme="light"] .s-card, html[data-theme="light"] .alert, html[data-theme="light"] .posture .p, html[data-theme="light"] .todo a, html[data-theme="light"] .todo div,
html[data-theme="light"] .feed a, html[data-theme="light"] .mini-stats > div, html[data-theme="light"] .legend-grid > div, html[data-theme="light"] .explain > div,
html[data-theme="light"] .codes code, html[data-theme="light"] .kind-tabs button { background: #f7f8fe; border-color: var(--border); color: var(--text); }
html[data-theme="light"] .arow, html[data-theme="light"] .alert { border-left-color: var(--c); }
html[data-theme="light"] .act-card { border-color: color-mix(in srgb, var(--c) 45%, var(--border)); box-shadow: none; }
html[data-theme="light"] .srv-card:hover, html[data-theme="light"] .arow:hover, html[data-theme="light"] .srv-item:hover, html[data-theme="light"] .feed a:hover { background: #eef0fc; }
html[data-theme="light"] .kind-tabs button.on { color: #fff; background: linear-gradient(135deg, #4a6cf0, #6e50ee); border-color: transparent; }
html[data-theme="light"] .kind-tabs button.on .i { color: #fff; }
html[data-theme="light"] .arow b, html[data-theme="light"] .act-card b, html[data-theme="light"] .srv-card b, html[data-theme="light"] .srv-item b, html[data-theme="light"] .alert b { color: var(--text); }
html[data-theme="light"] .seg, html[data-theme="light"] .sq-btn, html[data-theme="light"] .cal-btn { background: #fff; border-color: var(--border-2); color: var(--text-2); }
html[data-theme="light"] .seg button { color: var(--text-2); }
html[data-theme="light"] .seg button.on { color: #fff; box-shadow: 0 2px 8px rgba(90, 80, 230, .3); }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea { background: #fff; color: var(--text); border-color: var(--border-2); }
html[data-theme="light"] input::placeholder, html[data-theme="light"] textarea::placeholder { color: var(--muted); }
html[data-theme="light"] :where(button:not(.primary, .danger, .chip, .icon-btn, .avatar-btn, .kebab, .x)) { background: #fff; color: var(--text-2); border-color: var(--border-2); }
html[data-theme="light"] .dropdown button, html[data-theme="light"] .wmenu button, html[data-theme="light"] .subtabs button { background: none; border-color: transparent; }
html[data-theme="light"] .dropdown button:hover, html[data-theme="light"] .wmenu button:hover { background: var(--panel-2); }
html[data-theme="light"] .seg button:not(.on) { background: none; border-color: transparent; }
html[data-theme="light"] .seg button.on, html[data-theme="light"] .kind-tabs button.on { background: linear-gradient(135deg, #4a6cf0, #6e50ee); color: #fff; }
html[data-theme="light"] button.primary { color: #fff; }
html[data-theme="light"] .chip { background: #fff; color: var(--text-2); border: 1px solid var(--border-2); }
html[data-theme="light"] .chip:hover { background: var(--panel-2); }
html[data-theme="light"] .chip.on { background: #e9e7fe; color: #3b2fb5; border-color: #b9b0f7; }
html[data-theme="light"] th { background: #f0f2fb; color: var(--text-2); }
html[data-theme="light"] td { border-color: var(--border); color: var(--text); }
html[data-theme="light"] tr, html[data-theme="light"] tbody tr { background: transparent; }
html[data-theme="light"] tr.clickable:hover td, html[data-theme="light"] tbody tr:hover td { background: #f4f5fd; }
html[data-theme="light"] .table-wrap { background: #fff; border-color: var(--border); }
html[data-theme="light"] .dropdown, html[data-theme="light"] .wmenu, html[data-theme="light"] .modal .box, html[data-theme="light"] .toast, html[data-theme="light"] .tip { background: #fff; color: var(--text); border-color: var(--border-2); box-shadow: 0 12px 34px rgba(30, 40, 110, .18); }
html[data-theme="light"] .tip b, html[data-theme="light"] .toast .t, html[data-theme="light"] .modal h3 { color: var(--text); }
html[data-theme="light"] .section-note { background: #f1f2fd; color: var(--text-2); border-color: var(--border); }
html[data-theme="light"] .tag { color: var(--text-2); background: #fff; }
html[data-theme="light"] .tag.green { color: #087a4f; border-color: #8fd9bb; background: #e9f9f2; }
html[data-theme="light"] .tag.amber { color: #94660a; border-color: #e7cf8d; background: #fdf7e4; }
html[data-theme="light"] .tag.red { color: #b81c42; border-color: #efa8ba; background: #fdecf0; }
html[data-theme="light"] .tag.blue { color: #1f62b5; border-color: #a8c8ef; background: #eaf3fd; }
html[data-theme="light"] .pill { color: #fff; }
html[data-theme="light"] .pill.out { color: var(--c); background: transparent; }
html[data-theme="light"] .src .track { background: var(--panel-3); }
html[data-theme="light"] .sev, html[data-theme="light"] .badge { color: #fff; }
html[data-theme="light"] .c-medium.sev, html[data-theme="light"] .sev.c-medium, html[data-theme="light"] .badge.c-medium { color: #fff; }
html[data-theme="light"] .chart .grid { stroke: #dfe3f4; }
html[data-theme="light"] .hero-threat .g-wrap svg circle { fill: #fff; }
html[data-theme="light"] pre { background: #f3f4fc; color: var(--text); }
html[data-theme="light"] .log { background: #0f172a; color: #e2e8f0; }
html[data-theme="light"] .ok-t { color: var(--ok); }
html[data-theme="light"] .bad-t { color: var(--critical); }

/* ---------- pełny opis zdarzenia */
.what + .what { margin-top: 6px; font-size: 16px; color: var(--text-2); }
.ev-code { display: inline; padding: 1px 6px; border-radius: 6px; font: 600 13.5px var(--mono); color: var(--text); background: var(--panel-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.ev-sub { margin-top: 12px; font-size: 15px; }
.ev-list { margin: 6px 0 12px; line-height: 2; font-size: 13.5px; }

/* ---------- szukanie urządzeń */
.srv-search { flex: 1 1 280px; max-width: 460px; }
.srv-search input[type=search] { width: 100%; min-width: 0; height: 40px; padding: 0 14px; border-radius: 11px; }
@media (max-width: 760px) { .srv-search { flex-basis: 100%; max-width: none; order: 3; } }

/* ---------- Powiadom klientów */
.notify-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.preview-panel { position: sticky; top: 90px; }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; text-align: left; font-weight: 600; }
.tpl-card.on { color: #fff; background: linear-gradient(135deg, #4a7dff, #7b5cff); border-color: transparent; }
.pick-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pick-tools input[type=search] { flex: 1 1 200px; }
.client-pick { display: grid; gap: 6px; max-height: 260px; overflow: auto; padding: 4px; border: 1px solid var(--border); border-radius: 12px; }
.pick { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.pick:hover { background: var(--panel-2); }
.pick[hidden] { display: none; }
.pick span { display: grid; min-width: 0; }
.pick small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-body { margin-top: 12px; padding: 16px; border-radius: 12px; white-space: pre-wrap; line-height: 1.55; font-size: 14.5px; background: var(--panel-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.tpl-edit { display: grid; gap: 20px; }
html[data-theme="light"] .tpl-card.on { color: #fff; background: linear-gradient(135deg, #4a6cf0, #6e50ee); }
@media (max-width: 1000px) { .notify-grid { grid-template-columns: minmax(0, 1fr); } .preview-panel { position: static; } }

/* długi komunikat błędu strony: jedna linia, całość w podpowiedzi */
.clip { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
