/* Nadzor — ista paleta kao /izvestaji/ (svetlo, tamni levi meni). Bez inline stilova (CSP). */
:root {
  color-scheme: light;
  --bg: #f6f7f9; --panel: #fff; --ink: #1c2430; --muted: #6b7885; --line: #dfe4ea;
  --accent: #3550b4; --ok: #2f8f5b; --warn: #b8792a; --bad: #c0392b; --info: #6b4fa8;
  --ok-bg: #e7f4ec; --warn-bg: #fbf1e3; --bad-bg: #fbe9e7; --info-bg: #efeaf8;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-size: 14px; color: var(--ink); background: var(--bg); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--bad); margin-top: 10px; min-height: 18px; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }

/* prijava */
#login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px 30px; width: 340px; }
.login-box h1 { font-size: 19px; margin: 0 0 4px; }
.login-box label { display: block; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.login-box input { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
.login-box button { margin-top: 18px; width: 100%; padding: 10px; background: var(--accent); color: #fff; border: 0; border-radius: 6px; font-size: 14px; cursor: pointer; }

/* raspored */
#app { display: flex; min-height: 100vh; }
#side { width: 228px; min-width: 228px; background: #141a22; color: #dbe3ec; display: flex; flex-direction: column; padding: 16px 0; position: sticky; top: 0; height: 100vh; }
#side h1 { font-size: 15px; margin: 0 16px 2px; letter-spacing: .3px; }
#side .tag { font-size: 11px; color: #8595a8; margin: 0 16px 10px; }
#side nav { flex: 1; overflow-y: auto; }
#side .grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: #6d7f94; margin: 14px 16px 5px; }
#side a { display: block; padding: 7px 16px; color: #c8d3df; text-decoration: none; font-size: 13px; border-left: 3px solid transparent; cursor: pointer; }
#side a:hover { background: #1b232d; }
#side a.on { background: #1b232d; border-left-color: #5b7cfa; color: #fff; }
#side .badge { float: right; background: var(--bad); color: #fff; border-radius: 9px; font-size: 10.5px; padding: 1px 6px; }
#side .badge.warn { background: var(--warn); }
.fresh { margin: 8px 16px; font-size: 11.5px; color: #8595a8; line-height: 1.6; border-top: 1px solid #253040; padding-top: 10px; }
.fresh.stale { color: #f0a58f; }
.side-foot { margin: 6px 16px 0; display: flex; justify-content: space-between; }
.side-foot a { padding: 0 !important; border: 0 !important; font-size: 12px !important; color: #8595a8 !important; }

main { flex: 1; padding: 26px 32px 60px; min-width: 0; max-width: 1400px; }
.head { border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
.head h2 { font-size: 24px; margin: 0 0 3px; font-weight: 650; }
.head .sub { color: var(--muted); font-size: 13px; }
h3 { font-size: 15px; margin: 26px 0 8px; }
h3 .note { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }
p.lead { color: var(--muted); margin: 0 0 14px; max-width: 880px; line-height: 1.5; }

/* kartice */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; border-left: 4px solid var(--line); }
.card.ok { border-left-color: var(--ok); } .card.warn { border-left-color: var(--warn); } .card.bad { border-left-color: var(--bad); } .card.info { border-left-color: var(--info); }
.card .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.card .v { font-size: 24px; font-weight: 650; margin: 3px 0 2px; }
.card .d { font-size: 12.5px; color: var(--muted); }
.card.click { cursor: pointer; } .card.click:hover { box-shadow: 0 1px 6px rgba(0,0,0,.08); }

/* status tačka */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--muted); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }
.pill { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 10px; background: #eef1f5; color: var(--ink); white-space: nowrap; margin: 1px 2px 1px 0; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }

/* tabele */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap; position: sticky; top: 0; }
th.sort { cursor: pointer; } th.sort:hover { color: var(--ink); }
td { border-bottom: 1px solid #eef1f4; padding: 7px 10px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f5f7fb; }
tr.bad td { background: #fdf4f3; } tr.warn td { background: #fdf9f2; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.w { white-space: nowrap; }
td .sub { color: var(--muted); font-size: 12px; }
td.long { max-width: 520px; word-break: break-word; }

/* alati */
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.tools input, .tools select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 13px; background: #fff; }
.tools input { min-width: 240px; }
.btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.danger:hover { border-color: var(--bad); color: var(--bad); }

/* grafikon (div stubići — bez inline stila, visina preko klasa h0..h20) */
.chart { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 6px; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 110px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; min-width: 3px; cursor: default; }
.bar:hover span { filter: brightness(.85); }
.bar span { display: block; width: 100%; }
.bar .ext { background: #b8c4e6; } .bar .scan { background: var(--warn); } .bar .fail { background: var(--bad); }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.legend { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.legend .ext { background: #b8c4e6; } .legend .scan { background: var(--warn); } .legend .fail { background: var(--bad); }
.h0{height:0}.h1{height:5%}.h2{height:10%}.h3{height:15%}.h4{height:20%}.h5{height:25%}.h6{height:30%}.h7{height:35%}.h8{height:40%}.h9{height:45%}.h10{height:50%}.h11{height:55%}.h12{height:60%}.h13{height:65%}.h14{height:70%}.h15{height:75%}.h16{height:80%}.h17{height:85%}.h18{height:90%}.h19{height:95%}.h20{height:100%}

/* napomene */
.notice { border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; border: 1px solid; line-height: 1.5; }
.notice.ok { background: var(--ok-bg); border-color: #bfe0cc; } .notice.warn { background: var(--warn-bg); border-color: #efd7b3; }
.notice.bad { background: var(--bad-bg); border-color: #f0c4be; } .notice.info { background: #eef2fb; border-color: #cdd8f3; }

/* detalji (fioka sa desne strane) */
#drawer { position: fixed; inset: 0; background: rgba(15,20,28,.35); display: flex; justify-content: flex-end; z-index: 10; }
.drawer-box { background: var(--bg); width: min(760px, 96vw); height: 100%; overflow-y: auto; padding: 22px 26px 40px; position: relative; box-shadow: -4px 0 18px rgba(0,0,0,.15); }
.drawer-box .x { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--muted); }
.drawer-box h2 { margin: 0 0 4px; font-size: 20px; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 12px 0; font-size: 13px; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; word-break: break-word; }
.bar-inline { display: inline-block; height: 8px; background: #b8c4e6; border-radius: 2px; vertical-align: 1px; }
.w0{width:0}.w1{width:4px}.w2{width:10px}.w3{width:18px}.w4{width:28px}.w5{width:40px}.w6{width:55px}.w7{width:70px}.w8{width:85px}.w9{width:100px}.w10{width:120px}

@media (max-width: 800px) {
  #app { flex-direction: column; } #side { width: 100%; height: auto; position: static; }
  main { padding: 16px; }
}

/* --- Zaštita i pragovi --- */
.lnk { color: var(--accent); cursor: pointer; text-decoration: underline; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { color: #fff; filter: brightness(1.1); }
.btn:disabled { opacity: .45; cursor: default; }
.zgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 14px; }
.zcard { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.zcard h3 { margin: 0 0 4px; }
.zcard > p.muted { margin: 0 0 12px; font-size: 12.5px; line-height: 1.45; }
.zrow { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: baseline; padding: 7px 0; border-top: 1px dashed var(--line); line-height: 2.1; }
.zrow b { font-weight: 600; font-size: 13px; }
.zrow.off { opacity: .45; }
.zf { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin: 0 2px; }
.zf input { width: 64px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 14px; font-weight: 600; text-align: right; }
.zf i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.zf em { font-style: normal; font-size: 11px; color: var(--warn); background: var(--warn-bg); border-radius: 4px; padding: 0 4px; line-height: 1.5; }
.zf.bad input { border-color: var(--bad); background: var(--bad-bg); }
.zerr { color: var(--bad); font-size: 12.5px; margin: -2px 0 6px 104px; }
.zchk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin: 0 0 4px; }
.zlbl { display: block; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.zlbl textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: 13px ui-monospace, Consolas, monospace; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.45; }
.zbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 22px; padding: 10px 0; border-top: 1px solid var(--line); }
.tools input.short { min-width: 0; width: 70px; }
.tools input[type=checkbox] { min-width: 0; flex: none; width: auto; }
.tools .zchk { margin: 0 0 0 8px; }
@media (max-width: 800px) {
  .zgrid { grid-template-columns: 1fr; }
  .zrow { grid-template-columns: 1fr; gap: 0; }
  .zerr { margin-left: 0; }
  .tools input:not([type=checkbox]) { min-width: 0; flex: 1 1 180px; }
}
