:root {
  --bg: #0a0d12;
  --bg-2: #0d1117;
  --surface: #121821;
  --surface-2: #18202b;
  --surface-3: #1f2834;
  --line: #1f2733;
  --line-2: #2a3442;
  --text: #e8edf4;
  --text-2: #b4bfcd;
  --muted: #7d8999;
  --accent: #2dd4bf;
  --accent-2: #5eead4;
  --accent-ink: #032420;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --orange: #fb923c;
  --pink: #f472b6;
  --radius: 14px;
  --radius-sm: 9px;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 10px 30px -12px rgb(0 0 0 / .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(1200px 600px at 80% -10%, rgb(45 212 191 / .06), transparent 60%), var(--bg); min-height: 100vh; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 550; font-size: 13px; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap;
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-3); border-color: #3a4657; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { background: rgb(248 113 113 / .1); border-color: rgb(248 113 113 / .3); color: #fca5a5; }
.btn.danger:hover { background: rgb(248 113 113 / .18); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text-2); cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.sm { width: 28px; height: 28px; background: transparent; border-color: transparent; }
.icon-btn.sm .ic { width: 15px; height: 15px; }
.icon-btn.spinning .ic, .spin-ic { animation: spin .8s linear infinite; }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- pola ---------- */
input, select {
  font: inherit; color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 9px 12px; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(45 212 191 / .15); }
.field { display: grid; gap: 7px; font-size: 13px; color: var(--text-2); }
.input-icon { position: relative; display: block; }
.input-icon .ic { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.input-icon input { width: 100%; padding-left: 38px; }
.form-error { color: var(--err); font-size: 13px; min-height: 1.4em; text-align: center; }

select { appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d8999' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.select-wrap, .search { position: relative; display: inline-flex; }
.select-wrap .ic, .search .ic { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.select-wrap select, .search input { padding-left: 34px; }
.search { flex: 1 1 220px; }
.search input { width: 100%; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; color: var(--text-2); font-size: 13px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; transition: .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + .track { background: rgb(45 212 191 / .25); border-color: var(--accent); }
.switch input:checked + .track::after { left: 16px; background: var(--accent-2); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- logowanie ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); text-align: left; }
.login-card h1 { text-align: center; }
.login-card > p { text-align: center; margin-top: -12px; }
.login-logo { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, rgb(45 212 191 / .25), rgb(96 165 250 / .15)); color: var(--accent-2); border: 1px solid rgb(45 212 191 / .3); }
.login-logo .ic { width: 26px; height: 26px; }

/* ---------- układ ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; border-right: 1px solid var(--line); background: rgb(13 17 23 / .7); backdrop-filter: blur(10px); }
.logo { display: flex; align-items: center; gap: 11px; padding: 4px 8px 10px; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--accent-2); background: linear-gradient(135deg, rgb(45 212 191 / .22), rgb(96 165 250 / .12)); border: 1px solid rgb(45 212 191 / .28); }
.logo-text { display: grid; line-height: 1.25; }
.logo-text small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.nav { display: grid; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--text-2); background: none; border: 0; border-radius: 10px; padding: 9px 11px; cursor: pointer; text-align: left; transition: .15s;
}
.nav button .ic { color: var(--muted); transition: .15s; }
.nav button:hover { background: var(--surface); color: var(--text); }
.nav button[aria-selected=true] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav button[aria-selected=true] .ic { color: var(--accent-2); }
.nav button span { flex: 1; }
.badge { font-style: normal; font-size: 11px; font-weight: 650; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: rgb(251 191 36 / .15); color: var(--warn); }
.badge.err { background: rgb(248 113 113 / .15); color: var(--err); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.host-mini { font-size: 12px; color: var(--muted); display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.host-mini div { display: flex; align-items: center; gap: 7px; }
.host-mini .ic { width: 14px; height: 14px; }
.host-mini b { color: var(--text-2); font-weight: 500; margin-left: auto; font-family: var(--mono); font-size: 11.5px; }

.main { min-width: 0; padding: 26px 32px 60px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head p { margin-top: 3px; font-size: 13px; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.live-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgb(52 211 153 / .6); animation: pulse 2s infinite; }
.live-chip.off .pulse { background: var(--err); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgb(52 211 153 / 0); } 100% { box-shadow: 0 0 0 0 rgb(52 211 153 / 0); } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 14px; flex-wrap: wrap; }
.tab > .section-head:first-child { margin-top: 0; }

/* ---------- karty ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .grid2 + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.card-head > div:not(.card-actions) { flex: 1; min-width: 0; }
.card-head p { margin-top: 1px; }
.card-actions { display: flex; gap: 8px; align-items: center; }
.card-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.card-icon .ic { width: 19px; height: 19px; }
.teal { color: var(--accent-2); background: rgb(45 212 191 / .12); }
.blue { color: var(--blue); background: rgb(96 165 250 / .12); }
.violet { color: var(--violet); background: rgb(167 139 250 / .12); }
.orange { color: var(--orange); background: rgb(251 146 60 / .12); }
.pink { color: var(--pink); background: rgb(244 114 182 / .12); }
.green { color: var(--ok); background: rgb(52 211 153 / .12); }
.red { color: var(--err); background: rgb(248 113 113 / .12); }
.slate { color: #94a3b8; background: rgb(148 163 184 / .12); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }

/* ---------- zdrowie ---------- */
.health { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid rgb(52 211 153 / .25); background: linear-gradient(90deg, rgb(52 211 153 / .1), rgb(52 211 153 / .02) 60%); margin-bottom: 18px; }
.health.warn { border-color: rgb(251 191 36 / .3); background: linear-gradient(90deg, rgb(251 191 36 / .1), rgb(251 191 36 / .02) 60%); }
.health.err { border-color: rgb(248 113 113 / .35); background: linear-gradient(90deg, rgb(248 113 113 / .12), rgb(248 113 113 / .02) 60%); }
.health-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.health-icon .ic { width: 24px; height: 24px; }
.health h2 { font-size: 16px; }
.health p { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.health .health-side { margin-left: auto; display: flex; gap: 22px; text-align: right; }
.health-side b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.health-side span { font-size: 11.5px; color: var(--muted); }

/* ---------- metryki ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 12px; box-shadow: var(--shadow); display: grid; gap: 10px; overflow: hidden; }
.metric-top { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 58px; height: 58px; rotate: -90deg; }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--surface-3); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease, stroke .3s; }
.ring.warn .fg { stroke: var(--warn); } .ring.err .fg { stroke: var(--err); }
.ring .ic { position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; color: var(--text-2); }
.metric-label { font-size: 12px; color: var(--muted); font-weight: 500; display: block; }
.metric-value { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.2; }
.metric-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 40px; display: block; }
.net-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.net-icon .ic { width: 22px; height: 22px; }

/* ---------- usługi ---------- */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.svc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; transition: border-color .2s; }
.svc:hover { border-color: var(--line-2); }
.svc.down { border-color: rgb(248 113 113 / .35); }
.svc-main { padding: 18px 18px 14px; display: grid; gap: 14px; flex: 1; align-content: start; }
.svc-head { display: flex; align-items: center; gap: 12px; }
.svc-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.svc-icon .ic { width: 21px; height: 21px; }
.svc-title { flex: 1; min-width: 0; }
.svc-title b { display: block; font-size: 15px; font-weight: 600; }
.svc-title span { font-size: 12.5px; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: rgb(52 211 153 / .1); }
.pill.warn { color: var(--warn); background: rgb(251 191 36 / .1); }
.pill.err { color: var(--err); background: rgb(248 113 113 / .12); }
.pill.ok::before { box-shadow: 0 0 0 3px rgb(52 211 153 / .2); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); min-width: 0; }
.fact .ic { width: 15px; height: 15px; color: var(--muted); }
.fact div { min-width: 0; display: grid; line-height: 1.3; }
.fact small { font-size: 11px; color: var(--muted); }
.fact b { font-size: 12.5px; font-weight: 550; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact.wide { grid-column: 1 / -1; }
.fact.hot { border-color: rgb(251 191 36 / .35); background: rgb(251 191 36 / .06); }
.fact.hot .ic, .fact.hot b { color: var(--warn); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.link-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.link-chip:hover { color: var(--accent-2); border-color: rgb(45 212 191 / .35); text-decoration: none; }
.link-chip .ic { width: 12px; height: 12px; }
.svc-foot { display: flex; align-items: center; gap: 6px; padding: 11px 14px; border-top: 1px solid var(--line); background: rgb(255 255 255 / .012); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.svc-foot .spacer { flex: 1; }
.act { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 550; padding: 6px 9px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: .15s; }
.act .ic { width: 15px; height: 15px; }
.act:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-2); }
.act.restart:hover, .act.reload:hover { color: var(--blue); }
.act.start:hover { color: var(--ok); }
.act.stop:hover { color: var(--err); background: rgb(248 113 113 / .08); border-color: rgb(248 113 113 / .25); }
.act.update:hover { color: var(--violet); }
.act.logs { color: var(--muted); }
.act:disabled { opacity: .6; cursor: wait; }

/* ---------- logi ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px; margin-bottom: 14px; }
.terminal { border-radius: var(--radius); border: 1px solid var(--line-2); overflow: hidden; background: #06080c; box-shadow: var(--shadow); }
.terminal-head { display: flex; align-items: center; gap: 12px; padding: 9px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.term-dots { display: flex; gap: 6px; }
.term-dots i { width: 11px; height: 11px; border-radius: 50%; background: #3a4352; }
.term-dots i:nth-child(1) { background: #f87171aa; } .term-dots i:nth-child(2) { background: #fbbf24aa; } .term-dots i:nth-child(3) { background: #34d399aa; }
.term-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; }
.term-title .ic { width: 15px; height: 15px; color: var(--accent-2); }
.term-meta { margin-left: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; }
.log { margin: 0; padding: 14px 16px; font: 12px/1.6 var(--mono); color: #c9d2de; overflow: auto; white-space: pre; background: #06080c; }
.log.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
#log-out { height: calc(100vh - 250px); min-height: 320px; }
.card-log { border: 1px solid var(--line); border-radius: var(--radius); max-height: 460px; }
.log.code { max-height: 460px; }
.l-err { color: #fca5a5; } .l-warn { color: #fcd34d; } .l-ok { color: #86efac; }
.l-ts { color: #5b6878; }
mark { background: rgb(45 212 191 / .28); color: #fff; border-radius: 3px; padding: 0 1px; }

/* ---------- strony ---------- */
.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.site { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.site.bad { border-color: rgb(248 113 113 / .35); }
.site-head { display: flex; align-items: center; gap: 11px; }
.site-head .status { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.site-head .status .ic { width: 18px; height: 18px; }
.site-host { flex: 1; min-width: 0; }
.site-host a { color: var(--text); font-weight: 550; display: inline-flex; align-items: center; gap: 5px; }
.site-host a .ic { width: 12px; height: 12px; color: var(--muted); }
.site-host small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-tag { font: 600 12px var(--mono); padding: 3px 8px; border-radius: 7px; }
.cert { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.cert-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cert-row span { display: inline-flex; align-items: center; gap: 6px; }
.cert-row .ic { width: 13px; height: 13px; }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); transition: width .5s; }
.bar i.warn { background: var(--warn); } .bar i.err { background: var(--err); } .bar i.accent { background: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 550; padding: 2px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.ok { color: var(--ok); background: rgb(52 211 153 / .1); }
.tag.warn { color: var(--warn); background: rgb(251 191 36 / .1); }
.tag.err { color: var(--err); background: rgb(248 113 113 / .12); }
.tag .ic { width: 12px; height: 12px; }

/* ---------- bezpieczeństwo / system ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .card-icon { width: 44px; height: 44px; border-radius: 12px; }
.stat b { display: block; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat span { font-size: 12.5px; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: grid; max-height: 340px; overflow: auto; }
.list li { display: flex; align-items: center; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.list li:last-child { border-bottom: 0; }
.list li .ic { width: 16px; height: 16px; color: var(--muted); }
.list li .grow { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.list li .grow small { color: var(--muted); font-size: 12px; }
.list li .grow b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li.empty { color: var(--muted); justify-content: center; padding: 22px 4px; gap: 8px; }
.list li.empty .ic { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.port { display: inline-flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; }
.port b { font-family: var(--mono); font-size: 12.5px; }
.port .ic { width: 15px; height: 15px; color: var(--ok); }
details.raw { margin-top: 14px; }
details.raw summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
details.raw pre { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgb(255 255 255 / .015); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cpu-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cpu-cell .bar { width: 60px; }
.danger-zone { border-color: rgb(248 113 113 / .25); background: linear-gradient(90deg, rgb(248 113 113 / .05), transparent 70%), var(--surface); }
.danger-zone .card-head { margin-bottom: 0; }

/* ---------- historia ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); align-items: center; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.timeline .t-icon .ic { width: 16px; height: 16px; }
.timeline .grow { flex: 1; min-width: 0; }
.timeline .grow b { font-weight: 550; }
.timeline .grow small { display: block; color: var(--muted); font-size: 12px; }
.timeline time { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }

/* ---------- okna ---------- */
dialog { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); border-radius: 18px; padding: 26px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .8); }
dialog.wide { width: min(880px, calc(100vw - 32px)); }
dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } }
dialog::backdrop { background: rgb(3 5 8 / .65); backdrop-filter: blur(4px); }
dialog h3 { font-size: 17px; margin-bottom: 8px; }
dialog p { margin-bottom: 12px; font-size: 13.5px; }
dialog .log { max-height: 60vh; border-radius: 10px; border: 1px solid var(--line); }
.dialog-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px; }
.dialog-icon .ic { width: 24px; height: 24px; }
.callout { padding: 11px 13px; border-radius: 10px; font-size: 13px; }
.callout.warn { background: rgb(251 191 36 / .08); border: 1px solid rgb(251 191 36 / .25); color: #fde68a; }
.callout:empty { display: none; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- powiadomienia ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 50; }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px 12px 13px; max-width: 400px; font-size: 13px; box-shadow: 0 16px 40px -10px rgb(0 0 0 / .7); animation: toast .25s cubic-bezier(.2, .9, .3, 1.2); }
.toast .ic { width: 18px; height: 18px; color: var(--ok); margin-top: 1px; }
.toast.err .ic { color: var(--err); }
@keyframes toast { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); min-height: 150px; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsywność ---------- */
@media (max-width: 1200px) { .metrics, .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .logo { padding: 0; } .logo-text { display: none; }
  .nav { display: flex; gap: 2px; }
  .nav button { padding: 8px 10px; }
  .nav button span { display: none; }
  .nav button[aria-selected=true] span { display: inline; }
  .badge { min-width: 16px; height: 16px; font-size: 10px; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; }
  .host-mini { display: none; }
  #logout { width: auto; padding: 8px; font-size: 0; gap: 0; }
  .main { padding: 18px 16px 48px; }
  .health { flex-wrap: wrap; } .health .health-side { margin-left: 0; text-align: left; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .metrics, .stats { grid-template-columns: 1fr; }
  .services, .sites { grid-template-columns: 1fr; }
  .live-chip span:last-child { display: none; }
  h1 { font-size: 19px; }
}
