/* wp-health: jedan stil za sučelje i prijavu. Boja nosi samo značenje (hitno, pažnja, u redu, napomena); sve ostalo je tinta na papiru. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#eef1ec, #0e1210);
  --panel: light-dark(#fbfcfa, #151a17);
  --sunk: light-dark(#e3e8e0, #0b0f0d);
  --line: light-dark(#d2d9ce, #272f2a);
  --line2: light-dark(#b7c0b2, #3a443d);
  --ink: light-dark(#101612, #e8ede7);
  --ink2: light-dark(#445047, #a6b1a8);
  --ink3: light-dark(#6f7b73, #7b877e);
  --crit: light-dark(#b2361f, #f28e77);
  --warn: light-dark(#8f5a00, #e5b455);
  --ok: light-dark(#2a7347, #7fcd9b);
  --info: light-dark(#38678a, #8ab6d8);
  --grey: light-dark(#8a958d, #5f6b63);
  --crit-bg: color-mix(in srgb, var(--crit) 11%, var(--panel));
  --warn-bg: color-mix(in srgb, var(--warn) 11%, var(--panel));
  --ok-bg: color-mix(in srgb, var(--ok) 11%, var(--panel));
  --info-bg: color-mix(in srgb, var(--info) 10%, var(--panel));
  --r: 12px;
  --rs: 7px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { margin: 0; }
.boot { padding: 40px 20px; color: var(--ink3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ---------------------------------------------------------------- bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.bar { display: flex; align-items: center; gap: 22px; min-height: 58px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand span { color: var(--ok); }
.tabs { display: flex; gap: 2px; align-self: stretch; }
.tab { display: flex; align-items: center; gap: 7px; padding: 0 12px; color: var(--ink2); border-bottom: 2px solid transparent; font-weight: 550; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.count { min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; background: var(--sunk); color: var(--ink2); }
.count.crit { background: var(--crit); color: var(--bg); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { position: relative; }
.search input { width: 220px; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
.search input::placeholder { color: var(--ink3); }
.search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--ink3); pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); padding: 2px; }
.seg button { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--ink3); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg svg { width: 16px; height: 16px; }
.seg.text button { width: auto; padding: 0 14px; font-weight: 600; font-size: 14px; }
.ibtn { display: inline-grid; place-items: center; height: 36px; padding: 0 12px; gap: 6px; grid-auto-flow: column; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink2); font-weight: 550; }
.ibtn:hover { color: var(--ink); border-color: var(--line2); }
.ibtn svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- generic */
main.wrap { padding-top: 28px; padding-bottom: 90px; }
.banner { position: sticky; top: 58px; z-index: 15; margin: 0 0 16px; padding: 10px 16px; border-radius: var(--rs); background: var(--crit-bg); color: var(--crit); border: 1px solid color-mix(in srgb, var(--crit) 40%, transparent); font-weight: 600; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 16px; border: 1px solid var(--line2); border-radius: var(--rs); background: var(--panel); font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { opacity: .88; }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink2); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn small { font-weight: 500; opacity: .75; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; background: var(--sunk); color: var(--ink2); white-space: nowrap; }
.chip.crit { background: var(--crit-bg); color: var(--crit); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.info { background: var(--info-bg); color: var(--info); }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px 0 9px; border-radius: 999px; font-size: 13.5px; font-weight: 650; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.amber { background: var(--warn-bg); color: var(--warn); }
.pill.red { background: var(--crit-bg); color: var(--crit); }
.pill.grey { background: var(--sunk); color: var(--ink3); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.muted { color: var(--ink3); }
.sub { color: var(--ink2); }
.h2 { font-size: 13.5px; font-weight: 700; color: var(--ink2); margin: 34px 0 10px; letter-spacing: .01em; }
.h2:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- hero: the verdict */
.hero { padding: 6px 0 26px; }
.verdict { font-size: clamp(31px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -.035em; font-weight: 680; max-width: 18ch; }
.verdict.ok { color: var(--ok); }
.hero-sub { margin-top: 12px; color: var(--ink2); font-size: 16.5px; max-width: 62ch; }
.fleet { display: flex; gap: 5px; margin-top: 26px; }
.fleet a { flex: 1 1 0; min-width: 0; display: block; }
.fleet i { display: block; height: 12px; border-radius: 6px; background: var(--grey); }
.fleet .green i { background: var(--ok); }
.fleet .amber i { background: var(--warn); }
.fleet .red i { background: var(--crit); }
.fleet span { display: block; margin-top: 6px; font-size: 12px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fleet a:hover span { color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-weight: 600; color: var(--ink2); }
.toggle:hover { border-color: var(--line2); color: var(--ink); }
.toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.toggle b { font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); }
.dot.crit { background: var(--crit); } .dot.warn { background: var(--warn); } .dot.info { background: var(--info); } .dot.ok, .dot.green { background: var(--ok); } .dot.red { background: var(--crit); } .dot.amber { background: var(--warn); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }

/* ---------------------------------------------------------------- the worklist */
.issues { display: grid; gap: 10px; }
.issue { --c: var(--ink3); background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--r); overflow: hidden; }
.issue.crit { --c: var(--crit); } .issue.warning { --c: var(--warn); } .issue.info { --c: var(--info); }
.issue-head { display: grid; gap: 5px; padding: 15px 18px 15px 20px; }
.issue-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.issue-toggle:hover .issue-title { text-decoration: underline; text-underline-offset: 3px; }
.issue-title { font-size: 16.5px; font-weight: 650; letter-spacing: -.005em; }
.issue-where { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.issue-where a { color: var(--ink2); font-size: 13.5px; }
.issue-where a:hover { color: var(--ink); text-decoration: underline; }
.issue-where .sep { color: var(--ink3); }
.sevlabel { color: var(--c); font-size: 13px; font-weight: 700; margin-right: 2px; }
.chev { flex: none; width: 18px; height: 18px; color: var(--ink3); transition: transform .15s; }
[aria-expanded="true"] .chev { transform: rotate(90deg); }
.issue-body { padding: 2px 18px 18px 20px; border-top: 1px solid var(--line); }
.issue-body > p { margin-top: 14px; color: var(--ink2); max-width: 70ch; }
.lines { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.lines li { padding: 8px 12px; border-radius: var(--rs); background: var(--sunk); font-family: var(--mono); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ok-card { padding: 28px; text-align: left; }
.ok-card h3 { font-size: 18px; }
.ok-card p { margin-top: 6px; color: var(--ink2); }

/* ---------------------------------------------------------------- rail */
.rail .panel { padding: 6px; }
.rail .h2 { margin-top: 0; }
.rail-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; }
.rail-row:hover { background: var(--sunk); }
.rail-row b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-row small { color: var(--ink3); white-space: nowrap; }
.rail-act { padding: 9px 10px; font-size: 13.5px; color: var(--ink2); }
.rail-act b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- tables as rows */
.table { display: grid; }
.trow { display: grid; grid-template-columns: var(--cols); gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow.head { padding-top: 10px; padding-bottom: 10px; font-size: 12.5px; font-weight: 650; color: var(--ink3); background: var(--sunk); border-radius: var(--r) var(--r) 0 0; }
a.trow:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.cell-name { display: grid; gap: 1px; min-width: 0; }
.cell-name b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-name small { color: var(--ink3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dots i { width: 10px; height: 10px; border-radius: 3px; background: var(--ok); }
.dots i.fail { background: var(--crit); } .dots i.off { background: var(--grey); }
.group-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--sunk); border-bottom: 1px solid var(--line); font-weight: 650; }
.group-head small { color: var(--ink3); font-weight: 500; }
.group-head + .trow { }
.tools-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.tools-row .grow { flex: 1; }

/* ---------------------------------------------------------------- detail pages */
.crumb { display: inline-block; margin-bottom: 14px; color: var(--ink2); font-size: 14px; }
.crumb:hover { color: var(--ink); }
.page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-title h1 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.025em; font-weight: 680; }
.page-sub { margin-top: 8px; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.page-sub a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { display: grid; gap: 10px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
a.card:hover { border-color: var(--line2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; grid-template-columns: minmax(130px, max-content) 1fr; margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--ink3); font-size: 13.5px; padding-right: 24px; }
.kv dd { overflow-wrap: anywhere; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv .bad { color: var(--crit); font-weight: 650; }
.panel.pad { padding: 8px 20px; }
.upd { list-style: none; margin: 0; padding: 0; }
.upd li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.upd li:last-child { border-bottom: 0; }
.upd .ver { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
.upd .ver i { font-style: normal; color: var(--ink3); padding: 0 6px; }
.upd .ver b { font-weight: 650; }
.upd .what { display: grid; }
.upd .what small { color: var(--ink3); }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-size: 12.5px; color: var(--ink3); font-weight: 650; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.ptable td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.ptable tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.empty { padding: 36px 20px; text-align: center; color: var(--ink3); }

/* ---------------------------------------------------------------- dialog + toast */
dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); color: var(--ink); box-shadow: 0 24px 80px rgba(0, 0, 0, .35); overflow: auto; }
dialog::backdrop { background: rgba(8, 12, 10, .55); }
.dlg { padding: 24px; display: grid; gap: 16px; }
.dlg h2 { font-size: 21px; letter-spacing: -.02em; }
.dlg .sub { margin-top: -8px; }
.dlg .codebox { font: 700 30px/1 var(--mono); letter-spacing: .3em; padding: 14px 18px; border-radius: var(--rs); background: var(--sunk); width: fit-content; }
.dlg input[name=code] { height: 44px; width: 100%; max-width: 280px; padding: 0 14px; border: 1px solid var(--line2); border-radius: var(--rs); background: var(--bg); font-size: 18px; letter-spacing: .2em; text-transform: uppercase; }
.dlg .err { padding: 10px 14px; border-radius: var(--rs); background: var(--crit-bg); color: var(--crit); font-weight: 600; }
.dlg .foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.dlg .warnbox { padding: 12px 14px; border-radius: var(--rs); background: var(--warn-bg); color: var(--ink); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; z-index: 60; max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 600; transition: opacity .2s, transform .2s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- login */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login { width: min(400px, calc(100vw - 32px)); }
.login-brand { font-size: 40px; letter-spacing: -.03em; }
.login-brand span { color: var(--ok); }
.login-sub { margin: 6px 0 24px; color: var(--ink2); }
.login-card { display: grid; gap: 12px; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.login-card label { font-weight: 650; }
.login-card input { height: 44px; padding: 0 14px; border: 1px solid var(--line2); border-radius: var(--rs); background: var(--bg); font-size: 16px; }
.login-error { padding: 10px 14px; border-radius: var(--rs); background: var(--crit-bg); color: var(--crit); font-weight: 600; }

/* ---------------------------------------------------------------- narrow */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .rail { order: 2; }
  .search input { width: 150px; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .bar { flex-wrap: wrap; gap: 6px 12px; padding-top: 10px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; margin: 0 -4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .fleet span { display: none; }
  .fleet { margin-top: 20px; }
  .tab { padding: 10px 12px; }
  .tools { gap: 6px; }
  .search { display: none; }
  .ibtn span { display: none; }
  .ibtn { padding: 0 11px; }
  .trow:not(.head) { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  .trow.head { display: none; }
  .trow > :first-child { grid-column: 1 / -1; }
  .trow [data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink3); margin-bottom: 1px; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .kv dd { padding-top: 2px; }
  .issue-head { padding: 14px 14px 14px 16px; }
  .issue-body { padding: 2px 14px 16px 16px; }
  .banner { top: 98px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------------------------------------------------------- settings and forms */
.settings { display: grid; gap: 14px; max-width: 860px; }
.setcard { padding: 20px 22px; display: grid; gap: 14px; }
.setcard h3 { font-size: 18px; letter-spacing: -.01em; }
.setcard .sub { margin: -8px 0 0; }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; }
.field { display: grid; gap: 5px; align-content: start; }
.flabel { font-weight: 650; font-size: 14px; }
.help { color: var(--ink3); font-size: 13px; line-height: 1.4; }
.field input, .field select, .row input[type=email], .dlg select { height: 42px; width: 100%; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--rs); background: var(--bg); }
.row input[type=email] { max-width: 280px; }
.field input:focus, .field select:focus, .row input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.fs { border: 1px solid var(--line); border-radius: var(--rs); padding: 10px 14px 12px; margin: 0; display: grid; gap: 6px; }
.fs legend { padding: 0 6px; font-weight: 650; font-size: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 3px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.formmsg { margin: 0; padding: 9px 13px; border-radius: var(--rs); font-weight: 600; }
.formmsg.ok { background: var(--ok-bg); color: var(--ok); }
.formmsg.bad { background: var(--crit-bg); color: var(--crit); }
.row.tight { margin-top: 0; }
.rule.off b { color: var(--ink3); }
.rule .chip { margin-left: 8px; }
.hint { color: var(--ink2); }
.hint a { text-decoration: underline; text-underline-offset: 3px; font-weight: 650; }
.dlg .fs { max-height: 260px; overflow: auto; }
.upd li.rule { flex-wrap: nowrap; align-items: center; }
.upd li.rule .what { flex: 1 1 auto; min-width: 0; }
.upd li.rule small { white-space: normal; }
@media (max-width: 760px) { .upd li.rule { flex-wrap: wrap; } }

[hidden] { display: none !important; }
