:root {
  --bg:        #EBF6FF;
  --surface:   #FFFFFF;
  --border:    rgba(0, 130, 190, 0.13);
  --text:      #0C1E34;
  --muted:     #4A7090;
  --accent:    #00A8C6;
  --accent2:   #0074A8;
  --rail-bg1:  #0074A8;
  --rail-bg2:  #00A8C6;
  --shadow:    rgba(0, 80, 160, 0.09);
  --rail-w:    76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  min-height: 100vh;
  background: linear-gradient(160deg, #DCEEFB 0%, #EBF6FF 50%, #F0FAFF 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
}

.nora-app { display: flex; min-height: 100vh; }

/* ── OZEK ICON RAIL ─────────────────────────────────────── */
.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--rail-bg1) 0%, var(--rail-bg2) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 8px;
  box-shadow: 3px 0 20px rgba(0, 100, 180, 0.18);
}

.rail-logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.32);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900; color: #fff;
  margin-bottom: 10px;
}

.rail-item {
  position: relative;
  width: 48px; height: 48px; border-radius: 13px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.72);
  transition: background 0.15s, color 0.15s;
}
.rail-item svg { width: 23px; height: 23px; }
a.rail-item { text-decoration: none; }
.rail-item:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.rail-item:hover { background: rgba(255,255,255,0.15); color: #fff; }
.rail-item.active { background: rgba(255,255,255,0.95); color: var(--accent2); }

/* tooltip ob hoverju */
.rail-tip {
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) scale(0.9);
  background: var(--text); color: #fff;
  font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  padding: 5px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity 0.12s, transform 0.12s;
  z-index: 100;
}
.rail-item:hover .rail-tip { opacity: 1; transform: translateY(-50%) scale(1); }

.rail-sep { width: 34px; height: 1px; background: rgba(255,255,255,0.28); margin: 8px 0; }
.rail-spacer { flex: 1; }
.rail-back { color: rgba(255,255,255,0.6); }

/* ── MAIN ───────────────────────────────────────────────── */
.nora-main { flex: 1; display: flex; flex-direction: column; padding: 26px 32px; min-width: 0; }

/* ── SEKCIJE ────────────────────────────────────────────── */
.sec { display: none; }
.sec.active { display: block; }
.sec-h { font-size: 1.7rem; font-weight: 800; line-height: 1.1; margin-bottom: 20px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }

/* ── ORODJA (povezave na pod-aplikacije, npr. Matcher) ──── */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tool-card {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 4px 20px var(--shadow);
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 26px rgba(0,120,180,0.16); }
.tool-ic { font-size: 1.7rem; line-height: 1; }
.tool-body { display: flex; flex-direction: column; min-width: 0; }
.tool-body b { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.tool-body small { font-size: 0.82rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.tool-arrow { margin-left: auto; font-size: 1.3rem; font-weight: 800; color: var(--accent2); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 20px;
  box-shadow: 0 4px 20px var(--shadow);
}
.card .k { font-size: 0.82rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.card .v { font-size: 2.1rem; font-weight: 800; margin-top: 6px; color: var(--text); }
.card .v small { font-size: 1rem; color: var(--muted); font-weight: 600; }

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; margin-top: 18px;
  box-shadow: 0 4px 20px var(--shadow);
}
.panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }

/* skeleton placeholder vrstice */
.skel { height: 14px; border-radius: 7px; margin: 10px 0;
  background: linear-gradient(90deg, #E3F0FB 25%, #EEF7FF 50%, #E3F0FB 75%);
  background-size: 200% 100%; animation: sk 1.4s linear infinite; }
.skel.w70 { width: 70%; } .skel.w50 { width: 50%; } .skel.w40 { width: 40%; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.mock-note {
  display: inline-block; margin-top: 4px; font-size: 0.72rem; font-weight: 700;
  color: var(--accent2); background: rgba(0,168,198,0.1);
  border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px;
}

/* ── BLOG (skupen template za Nora + Arty) ──────────────── */
.blog-msg { color: var(--muted); font-weight: 600; padding: 10px 2px; }

/* iskalnik */
.blog-search { max-width: 820px; margin-bottom: 12px; }
.blog-search input {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 16px; box-shadow: 0 3px 14px var(--shadow);
  outline: none;
}
.blog-search input:focus { border-color: var(--accent); }

/* seznam po letih */
.blog-results { max-width: 820px; }
.blog-year {
  position: sticky; top: 0; z-index: 5;
  font-size: 0.8rem; font-weight: 800; letter-spacing: 1px; color: var(--accent2);
  background: var(--bg); padding: 10px 4px 6px; margin-top: 6px;
  border-bottom: 1px solid var(--border);
}
.post-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 11px 8px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.post-row:hover { background: rgba(0,168,198,0.07); }
.post-row-date  { flex-shrink: 0; width: 72px; font-size: 0.85rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-row-title { flex: 1; font-size: 1.02rem; font-weight: 600; color: var(--text); }
.post-row-author { flex-shrink: 0; margin-left: 14px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.post-row:hover .post-row-title { color: var(--accent2); }

.post-meta { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

/* posamezna objava */
.blog-back {
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  color: var(--accent2); font-weight: 700; font-size: 0.9rem;
  border-radius: 10px; padding: 7px 14px; margin-bottom: 18px;
}
.blog-back:hover { background: var(--bg); }
.post-full { max-width: 820px; }
.post-full h1 { font-size: 2rem; font-weight: 800; line-height: 1.15; color: var(--text); }
.post-full .post-meta { margin: 6px 0 20px; font-size: 0.9rem; }

/* renderiran Markdown */
.post-content { font-size: 1.05rem; line-height: 1.7; color: var(--text); }
.post-content h1, .post-content h2, .post-content h3 { margin: 1.2em 0 0.5em; line-height: 1.25; font-weight: 800; }
.post-content h1 { font-size: 1.6rem; } .post-content h2 { font-size: 1.35rem; } .post-content h3 { font-size: 1.15rem; }
.post-content p { margin: 0 0 1em; }
.post-content ul, .post-content ol { margin: 0 0 1em 1.4em; }
.post-content li { margin: 0.25em 0; }
.post-content a { color: var(--accent2); }
.post-content blockquote {
  margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--accent);
  background: rgba(0,168,198,0.06); color: var(--muted); border-radius: 0 8px 8px 0;
}
.post-content code {
  background: #EEF6FD; border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 5px; font-size: 0.9em;
}
.post-content pre { background: #EEF6FD; border: 1px solid var(--border); border-radius: 10px; padding: 14px; overflow-x: auto; }
.post-content pre code { border: none; padding: 0; background: none; }
.post-content img { max-width: 100%; border-radius: 10px; }
.post-content table { border-collapse: collapse; margin: 1em 0; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 6px 12px; }

/* ── UREJANJE (editor) ──────────────────────────────────── */
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  color: var(--accent2); border-radius: 9px; padding: 3px 9px; font-size: 0.95rem; line-height: 1.4;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn.danger { color: #C0392B; }
.blog-edit-btn { vertical-align: middle; margin-left: 8px; font-size: 0.85rem; }

.btn {
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
  color: var(--text); font-family: inherit; font-weight: 700; font-size: 0.9rem;
  border-radius: 10px; padding: 8px 16px;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

/* prijava */
.login-box {
  max-width: 340px; margin-top: 20px; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; box-shadow: 0 4px 20px var(--shadow);
}
.login-box h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.login-box input {
  font-family: inherit; font-size: 1rem; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px; outline: none;
}
.login-box input:focus { border-color: var(--accent); }
.login-err { color: #C0392B; font-size: 0.85rem; font-weight: 600; }

/* admin bar + seznam */
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-bar-right { display: flex; gap: 8px; }
.admin-list { max-width: 900px; }
.admin-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 8px; border-bottom: 1px solid var(--border);
}
.admin-date  { width: 68px; flex-shrink: 0; font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.admin-title { flex: 1; font-weight: 600; }
.admin-actions { display: flex; gap: 6px; }
.badge {
  flex-shrink: 0; width: 82px; text-align: center; font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px; border-radius: 20px; padding: 3px 0;
}
.badge-published { background: rgba(74,222,128,0.18); color: #1E7F43; }
.badge-draft     { background: rgba(251,191,36,0.18); color: #9A6B00; }
.badge-archived  { background: rgba(120,140,160,0.16); color: var(--muted); }

/* urejevalnik */
.editor { max-width: 900px; display: flex; flex-direction: column; }
.editor label { font-size: 0.82rem; font-weight: 700; color: var(--muted); margin: 14px 0 5px; }
.editor input, .editor select, .editor textarea {
  font-family: inherit; font-size: 1rem; color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; outline: none;
  background: var(--surface);
}
.editor input:focus, .editor select:focus, .editor textarea:focus { border-color: var(--accent); }
.editor textarea { resize: vertical; line-height: 1.6; font-size: 1.02rem; }
.editor-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.editor-msg { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

/* ── SISTEM — "dihanje" (zdravje storitev, pipeline) ────────── */
.sys-root { max-width: 880px; }
.sys-stamp { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-left: 10px; vertical-align: middle; }

.sys-summary { font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.sys-summary small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.sys-big { font-size: 1.7rem; font-weight: 800; margin-right: 4px; }
.sys-big.ok  { color: #1E9E57; }
.sys-big.bad { color: #D64545; }

.svc-row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--border); }
.svc-row:last-child { border-bottom: none; }
.svc-name { font-weight: 700; min-width: 130px; }
.svc-kind {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 9px;
}
.svc-detail { color: var(--muted); font-weight: 600; font-size: 0.9rem; margin-left: auto; text-align: right; }

.dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}
.dot-up    { background: #22C55E; }
.dot-stale { background: #F59E0B; }
.dot-warn  { background: #F59E0B; }
.dot-down  { background: #EF4444; }
.dot-run   { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.step-row { display: flex; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); font-weight: 600; }
.step-row:last-child { border-bottom: none; }
.step-name { min-width: 140px; font-weight: 700; }
.step-age { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* funnel toka (Danes) */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.fn-row { display: flex; align-items: center; gap: 12px; }
.fn-row.sub { padding-left: 18px; }
.fn-row.sub .fn-lbl, .fn-row.sub .fn-n { color: var(--muted); }
.fn-lbl { min-width: 180px; font-weight: 700; font-size: 0.92rem; }
.fn-bar { flex: 1; height: 22px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.fn-bar span { display: block; height: 100%; border-radius: 7px; transition: width 0.5s ease; }
.fn-bar .in     { background: linear-gradient(90deg, #0074A8, #00A8C6); }
.fn-bar .pass   { background: linear-gradient(90deg, #00A8C6, #35C7DE); }
.fn-bar .filt   { background: #D64545; opacity: 0.55; }
.fn-bar .placed { background: #22C55E; }
.fn-bar .skip   { background: #94A3B8; }
.fn-bar .noodds { background: #F59E0B; }
.fn-n { min-width: 44px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.fn-reasons { margin-top: 14px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.chip {
  display: inline-block; background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px; margin: 2px 3px; font-size: 0.8rem; font-weight: 700;
}

/* tip vrstice (zadnji skozi gate) */
.tip-row { display: flex; align-items: center; gap: 14px; padding: 9px 6px; border-bottom: 1px solid var(--border); }
.tip-row:last-child { border-bottom: none; }
.tip-eval {
  flex-shrink: 0; width: 48px; text-align: center; font-weight: 800; font-size: 0.9rem;
  color: var(--accent2); background: var(--bg); border-radius: 8px; padding: 4px 0;
  font-variant-numeric: tabular-nums;
}
.tip-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tip-ev { font-size: 0.98rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-sub { font-size: 0.82rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tip-dec { flex-shrink: 0; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--muted); }

/* krog-2 napredek */
.k2 {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; margin-bottom: 18px; box-shadow: 0 4px 20px var(--shadow);
}
.k2-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.k2-head b { font-size: 1.1rem; font-weight: 800; }
.k2-head span { font-size: 0.95rem; font-weight: 700; color: var(--accent2); font-variant-numeric: tabular-nums; }
.k2-bar { height: 28px; background: var(--bg); border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.k2-bar span {
  display: block; height: 100%; border-radius: 9px;
  background: linear-gradient(90deg, #0074A8, #00A8C6 60%, #35C7DE);
  transition: width 0.6s ease;
}
.k2-sub { margin-top: 10px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.k2-sub b { color: var(--text); }
.k2-sub em { color: var(--accent2); font-style: normal; font-weight: 700; }

/* tipsterji: churn + top rang */
.churn {
  background: rgba(0,168,198,0.08); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 16px; margin-bottom: 18px; font-size: 0.9rem; font-weight: 600; color: var(--muted);
}
.churn b { color: var(--text); }
.tip-rank {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; text-align: center; line-height: 24px;
  font-weight: 800; font-size: 0.82rem; color: var(--accent2); background: var(--bg);
}
.tip-cnt { flex-shrink: 0; font-weight: 800; font-size: 1rem; color: var(--text); font-variant-numeric: tabular-nums; }

/* ban panel */
.ban-search {
  width: 100%; font-family: inherit; font-size: 0.98rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; outline: none;
}
.ban-search:focus { border-color: var(--accent); }
.ban-hint { font-size: 0.8rem; color: var(--muted); font-weight: 600; margin: 8px 2px 4px; }
.ban-results { margin-top: 6px; }
.ban-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px; border-bottom: 1px solid var(--border);
}
.ban-row:last-child { border-bottom: none; }
.ban-row.banned { opacity: 0.62; }
.ban-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ban-main b { font-size: 0.98rem; font-weight: 700; }
.ban-main small { font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ban-badge {
  flex-shrink: 0; font-size: 0.75rem; font-weight: 800; color: #9A6B00;
  background: rgba(245,158,11,0.14); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 10px;
}
.icon-btn.danger { color: #C0392B; }
.icon-btn.danger:hover { background: rgba(216,69,69,0.1); }

/* alarmi */
.alert-summary {
  font-size: 1.1rem; font-weight: 700; padding: 14px 18px; border-radius: 14px;
  margin-bottom: 16px; border: 1px solid var(--border);
}
.alert-summary.ok  { background: rgba(34,197,94,0.12); color: #1E9E57; }
.alert-summary.bad { background: rgba(245,158,11,0.12); color: #9A6B00; }
.alert-summary b   { color: #D64545; }
.alerts { display: flex; flex-direction: column; gap: 10px; max-width: 880px; }
.alert-row {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 4px;
  border-radius: 12px; padding: 13px 16px; box-shadow: 0 3px 14px var(--shadow);
}
.alert-row.sev-critical { border-left-color: #EF4444; }
.alert-row.sev-warning  { border-left-color: #F59E0B; }
.alert-row.sev-info     { border-left-color: var(--accent); }
.alert-ic { font-size: 1.15rem; line-height: 1.3; flex-shrink: 0; }
.alert-body { display: flex; flex-direction: column; min-width: 0; }
.alert-body b { font-size: 1rem; font-weight: 700; }
.alert-body small { font-size: 0.83rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.alert-src { text-transform: uppercase; letter-spacing: 0.4px; font-size: 0.72rem; opacity: 0.85; }

/* Za urediti — ročne naloge + dismiss */
.todo-add-box { display: flex; gap: 8px; max-width: 880px; margin-bottom: 14px; }
.todo-add-box input {
  flex: 1; font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.todo-add-box input:focus { outline: none; border-color: var(--accent); }
.todos-list { display: flex; flex-direction: column; gap: 8px; max-width: 880px; margin-bottom: 18px; }
.todo-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 11px 14px; box-shadow: 0 3px 14px var(--shadow);
}
.todo-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent2); cursor: pointer; flex-shrink: 0; }
.todo-txt { flex: 1; font-size: 1rem; font-weight: 600; color: var(--text); min-width: 0; word-break: break-word; }
.todo-row.done { border-left-color: #1E9E57; opacity: 0.6; }
.todo-row.done .todo-txt { text-decoration: line-through; color: var(--muted); }
.todo-x {
  flex-shrink: 0; margin-left: auto; background: transparent; border: 0; cursor: pointer;
  color: var(--muted); font-size: 1.05rem; line-height: 1; padding: 4px 7px; border-radius: 8px;
}
.todo-x:hover { background: rgba(214,69,69,0.12); color: #D64545; }
.board-sub { font-size: 0.8rem; font-weight: 800; letter-spacing: 1px; color: var(--accent2);
  text-transform: uppercase; margin: 6px 4px 10px; }
.board-hint { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--muted); }

/* rail badge (opozorila na Alarmi ikoni) */
.rail-item { overflow: visible; }
.rail-badge {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: #F59E0B; color: #fff; font-size: 0.66rem; font-weight: 800;
  line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--rail-bg1);
}
.rail-badge.crit { background: #EF4444; }
