:root {
  --bg: #f2f5fa; --surface: #fff; --surface-2: #f6f8fc; --line: #e0e6ef; --line-strong: #c9d2e0;
  --fg: #0d1a33; --muted: #5f6c84; --acc: #1765d8; --acc-2: #0b3d91; --acc-fg: #fff; --acc-soft: #e6effd;
  --ok: #128a4a; --ok-soft: #e2f5ea; --warn: #b36b00; --warn-soft: #fcf0d9; --bad: #cf2f3a; --bad-soft: #fde7e8;
  --gold: #e0a400; --navy: #0b1a3a; --navy-2: #12285a; --side-fg: #c7d3ea;
  --term-bg: #0b1324; --term-fg: #d6dde8;
  --radius: 12px; --shadow: 0 1px 2px rgba(11, 26, 58, .06), 0 2px 6px rgba(11, 26, 58, .05);
  --shadow-lg: 0 14px 36px rgba(11, 26, 58, .22);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #070d1c; --surface: #0f1830; --surface-2: #142040; --line: #1f2c4d; --line-strong: #2b3b63;
  --fg: #e6ecf7; --muted: #8e9bb6; --acc: #4b8df5; --acc-2: #2d6ee0; --acc-fg: #fff; --acc-soft: #16294f;
  --ok: #3ccf7f; --ok-soft: #10301f; --warn: #f0a63a; --warn-soft: #33260f; --bad: #f26b6f; --bad-soft: #3a1719;
  --gold: #f1bd2f; --navy: #050b18; --navy-2: #0c1730; --side-fg: #b6c3dd;
  --term-bg: #050a14; --shadow: none; --shadow-lg: 0 14px 36px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070d1c; --surface: #0f1830; --surface-2: #142040; --line: #1f2c4d; --line-strong: #2b3b63;
    --fg: #e6ecf7; --muted: #8e9bb6; --acc: #4b8df5; --acc-2: #2d6ee0; --acc-fg: #fff; --acc-soft: #16294f;
    --ok: #3ccf7f; --ok-soft: #10301f; --warn: #f0a63a; --warn-soft: #33260f; --bad: #f26b6f; --bad-soft: #3a1719;
    --gold: #f1bd2f; --navy: #050b18; --navy-2: #0c1730; --side-fg: #b6c3dd;
    --term-bg: #050a14; --shadow: none; --shadow-lg: 0 14px 36px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 10px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .86em; }
.mono, pre, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); } .bad-text { color: var(--bad); } .warn-text { color: var(--warn); }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- kontrole --- */
input, select { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 11px; min-width: 0; width: 100%; }
input:focus-visible, select:focus-visible, button:focus-visible, .srv:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
input[type="checkbox"] { width: auto; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: .92em; }
.btn { font: inherit; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-fg); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line-strong)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger-ghost { color: var(--bad); border-color: transparent; background: none; }
.btn.danger-ghost:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { padding: 7px; }
.btn.wide { width: 100%; }
.hint { color: var(--muted); font-size: .86em; }
.badge, .tag { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* --- prijava --- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.brand.big { font-size: 1.4rem; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--acc); color: var(--acc-fg); font-weight: 800; font-size: .95rem; }

/* --- raspored --- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 20px 14px; background: var(--surface); border-right: 1px solid var(--line); }
.side .brand { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { font: inherit; font-weight: 500; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--fg); }
.nav-item.on { background: var(--acc-soft); color: var(--acc); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.who { display: flex; flex-direction: column; overflow: hidden; }
.who strong { font-size: .9em; overflow: hidden; text-overflow: ellipsis; }
.side-actions { display: flex; justify-content: space-between; }
.main { padding: 28px 32px 48px; max-width: 1200px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head p { margin-top: 2px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.head-actions input { width: 240px; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 18px; font-weight: 550; }

/* --- serveri --- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 26px; max-width: 760px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.tile span { font-size: .82em; }
.tile strong { font-size: 1.6rem; font-weight: 650; line-height: 1.2; }
.group + .group { margin-top: 28px; }
.group-title { display: flex; gap: 8px; align-items: baseline; margin-bottom: 12px; font-size: 1rem; }
.group-title .muted { font-weight: 500; font-size: .85em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.srv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, transform .12s; }
.srv:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.srv-top { display: flex; align-items: center; gap: 9px; }
.srv-top h3 { margin: 0; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--fg); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv .addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv .err { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.wait { background: var(--line-strong); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.meter { display: flex; flex-direction: column; gap: 4px; }
.meter-top { display: flex; justify-content: space-between; font-size: .8em; color: var(--muted); }
.meter-bar { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.meter-bar.warn i { background: var(--warn); }
.meter-bar.bad i { background: var(--bad); }
.skeleton { height: 10px; border-radius: 6px; background: var(--surface-2); animation: pulse 1.2s ease-in-out infinite; }
.skeleton.short { width: 60%; }
.empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty p { max-width: 420px; }

/* --- tabele i kartice --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card.flush { padding: 0; }
.card.narrow { max-width: 460px; }
.card h2 { margin: 22px 0 14px; }
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .detail { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table input.lim { width: 84px; padding: 5px 8px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }
.info { display: grid; gap: 10px; margin: 0; }
.info div { display: flex; justify-content: space-between; gap: 12px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; font-weight: 550; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; }
.row .grow { flex: 1; }
.row .port { width: 110px; }

/* --- bočni panel servera --- */
.backdrop { position: fixed; inset: 0; background: rgba(10, 14, 20, .35); z-index: 20; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); z-index: 21; display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head p { margin-top: 3px; word-break: break-all; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 22px 22px; }
.drawer-foot { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.status-box { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.status-box > p:first-child { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.svc input { margin-bottom: 10px; }
.shell-row { display: flex; align-items: center; gap: 8px; background: var(--term-bg); border-radius: 8px; padding: 4px 4px 4px 12px; }
.shell-row .prompt { color: var(--ok); font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.shell-row input { background: none; border: 0; color: var(--term-fg); font-family: ui-monospace, "SF Mono", Menlo, monospace; padding: 8px 4px; }
.shell-row input:focus-visible { outline: none; }
.term { margin-top: 18px; border-radius: var(--radius); overflow: hidden; background: var(--term-bg); color: var(--term-fg); border: 1px solid var(--line); }
.term-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: .8em; color: #8b95a5; border-bottom: 1px solid #222833; }
.term pre { margin: 0; padding: 12px 14px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: .82rem; line-height: 1.55; }

/* --- nadzor i recepti --- */
.h3-row { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.h3-row h3 { margin: 0; }
.btn.sm { padding: 4px 10px; font-size: .85em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.checks li { display: grid; grid-template-columns: 14px 110px 1fr; gap: 10px; align-items: baseline; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: .92em; }
.checks li:last-child { border-bottom: 0; }
.checks li .dot { transform: translateY(1px); }
.checks .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.checks .lbl { font-weight: 600; }
.checks .det small { display: block; color: var(--muted); font-size: .85em; }
.checks .empty-li { display: block; color: var(--muted); }
.inline { display: flex; gap: 8px; }
.recipes { display: flex; flex-direction: column; gap: 10px; }
.recipe { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.recipe p { margin-top: 2px; }
.recipe .side-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.recipe .last { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.mt { margin-top: 18px; } .mt-s { margin-top: 12px; }
.card h2.first { margin-top: 0; }
.badge.running { background: var(--acc-soft); color: var(--acc); border-color: transparent; }

/* --- prozori --- */
.dlg { width: min(460px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 24px; background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); }
.dlg::backdrop { background: rgba(10, 14, 20, .4); }
.dlg[open] { animation: fade .15s; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* --- obavijesti --- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 550; box-shadow: var(--shadow-lg); max-width: min(520px, calc(100vw - 32px)); animation: fade .15s; transition: opacity .4s; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; }

/* --- mobitel --- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; }
  .nav-item span { white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .who { display: none; }
  .main { padding: 20px 16px 40px; }
  .tiles { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .head-actions input { width: 100%; }
}

/* ================= IT Coban: izgled prema logu ================= */
body { font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
h1 { font-weight: 800; letter-spacing: -.02em; color: var(--fg); }
.btn.primary { background: linear-gradient(180deg, var(--acc), var(--acc-2)); border-color: var(--acc-2); box-shadow: 0 1px 2px rgba(11, 61, 145, .3); }
.btn.primary:hover { filter: brightness(1.08); }

/* bočni meni: tamnoplava s planinama */
.side { background: linear-gradient(180deg, var(--navy-2), var(--navy)) ; border-right: 0; color: var(--side-fg);
  background-image: url("brand/mountains.svg"), linear-gradient(180deg, var(--navy-2), var(--navy));
  background-repeat: no-repeat; background-position: bottom center, 0 0; background-size: 100% auto, auto; }
.side .brand { color: #fff; padding: 0 6px; gap: 10px; }
.mark { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.wordmark { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.wordmark b { color: #4b8df5; font-style: italic; font-weight: 900; margin-right: 1px; }
.nav-item { color: var(--side-fg); }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.on { background: rgba(75, 141, 245, .18); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { border-top-color: rgba(255, 255, 255, .1); }
.side { padding-bottom: 84px; } /* planine ispod podnožja, ne preko njega */
.side .who strong { color: #fff; }
.side .muted { color: #8fa0c2; }
.side .btn.ghost { color: var(--side-fg); }
.side .btn.ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* prijava: logo na kartici, planine u pozadini */
.login { background: url("brand/mountains.svg") no-repeat bottom center / 100% auto, radial-gradient(ellipse at top, #ffffff, var(--bg) 70%); }
:root[data-theme="dark"] .login { background: url("brand/mountains.svg") no-repeat bottom center / 100% auto, radial-gradient(ellipse at top, var(--navy-2), var(--bg) 70%); }
.login-card { max-width: 420px; padding: 18px 30px 30px; gap: 14px; border-top: 4px solid var(--acc); box-shadow: var(--shadow-lg); }
.login-logo { width: 100%; height: auto; display: block; margin: 0 auto -6px; border-radius: 8px; }

/* naslovi sekcija i pločice u bojama brenda */
.head h1 { position: relative; padding-bottom: 6px; }
.head h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--acc), var(--gold)); }
.tile { border-top: 3px solid var(--acc); }
.srv:hover { border-color: color-mix(in srgb, var(--acc) 45%, var(--line)); }
.group-title { color: var(--fg); }
.table th { background: var(--surface-2); color: var(--muted); }
.term { border-color: #1a2a4d; }

@media (max-width: 820px) {
  .side { background-image: linear-gradient(180deg, var(--navy-2), var(--navy)); }
  .wordmark { font-size: 1.1rem; }
}
