:root {
  --ink: #0f1115;
  --gold: #c8a24a;
  --gold-dark: #a8862f;
  --bg: #f6f6f4;
  --line: #e4e4e0;
  --muted: #6b6b66;
  --red: #c62828;
  --green: #2e7d32;
  --radius: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; font-weight: 600; }
h2, h3 { margin: 0; }
p { margin: 0.4rem 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.block { display: block; }
.strong { font-weight: 600; }
.red { color: var(--red); }
.green { color: var(--green); }
.gold { color: var(--gold); }
.right { text-align: right; }
.label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 0.5rem; }
.mt { margin-top: 1.5rem; }
.mt-s { margin-top: 0.5rem; }
.nowrap { white-space: nowrap; }

/* ---------- gradniki ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: block; }
.card.hover:hover { border-color: var(--gold); }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grow { flex: 1 1 200px; min-width: 0; }
.w-s { width: 140px; }
.grid2, .grid3, .grid4 { display: grid; gap: 12px; }
@media (min-width: 640px) {
  .grid2 { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .grid4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }

.input {
  font: inherit; font-size: 0.9rem; padding: 8px 10px; border: 1px solid #cfcfca; border-radius: 6px;
  background: #fff; color: var(--ink); min-width: 0;
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 162, 74, 0.25); }
.input.slim { padding: 4px 8px; }
textarea.input { resize: vertical; width: 100%; }
.title-input { font: inherit; font-size: 1.5rem; font-weight: 600; border: 0; background: transparent; width: 100%; padding: 0; }
.title-input:focus { outline: none; }
.btn, .btn-gold {
  font: inherit; font-size: 0.9rem; font-weight: 500; border: 0; border-radius: 6px; padding: 9px 16px; cursor: pointer;
  background: var(--ink); color: #fff; display: inline-block; text-align: center;
}
.btn:hover { background: #2a2d33; }
.btn-gold { background: var(--gold); color: var(--ink); padding: 12px 20px; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { font: inherit; font-size: 0.85rem; background: none; border: 0; color: var(--muted); padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.btn-ghost:hover { background: #eee; color: var(--ink); }
.btn-ghost.red { color: var(--red); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.9rem; }
.error { color: var(--red); font-size: 0.9rem; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.b-sky { background: #e0f2fe; color: #0369a1; }
.b-green { background: #dcfce7; color: #15803d; }
.b-amber { background: #fef3c7; color: #b45309; }
.b-gray { background: #eeeeec; color: #57575a; }
.b-red { background: #fee2e2; color: #b91c1c; }

.list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid #efefec; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.list li > span:first-child:not(.grow) { flex: 1; }
.box { width: 18px; height: 18px; accent-color: var(--ink); }
.done { text-decoration: line-through; color: #9a9a95; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stat { font-size: 1.5rem; font-weight: 600; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; color: var(--muted); background: #fafaf8; padding: 8px 10px; }
td { padding: 8px 10px; border-top: 1px solid #efefec; }
.r { text-align: right; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tabs button, #nav a { font: inherit; font-size: 0.9rem; border: 0; background: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; color: #55554f; }
.tabs button:hover, #nav a:hover { background: #eee; }
.tabs button.on, #nav a.on { background: var(--ink); color: #fff; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 10; font-size: 0.9rem; }

/* ---------- operativa ---------- */
.opsbar { background: #fff; border-bottom: 1px solid var(--line); }
.opsbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; }
#nav { display: flex; flex-wrap: wrap; gap: 2px; }
.who { margin-left: auto; font-size: 0.85rem; color: var(--muted); }
.who a { text-decoration: underline; }
.main { padding-top: 24px; padding-bottom: 60px; }

/* ---------- javna stran ---------- */
.logo { font-weight: 600; letter-spacing: 0.06em; }
.logo b { color: var(--gold); font-weight: 600; }
.logo.dark b { color: var(--gold-dark); }
body.public { background: var(--ink); color: #fff; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 24px; }
.topbar nav { display: flex; gap: 20px; font-size: 0.9rem; color: #c9c9c4; }
.topbar nav a:hover { color: #fff; }
.hero { padding-top: 64px; padding-bottom: 96px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.1; max-width: 800px; }
.hero p { font-size: 1.15rem; color: #c9c9c4; max-width: 640px; margin: 1.5rem 0 2.5rem; }
.section { padding-top: 72px; padding-bottom: 72px; }
.section h2 { font-size: 1.5rem; font-weight: 600; margin-bottom: 1.25rem; }
.light { background: var(--bg); color: var(--ink); }
.light .card h3 { font-size: 1.05rem; }
.link { color: var(--gold-dark); font-size: 0.9rem; display: inline-block; margin-top: 8px; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 20px; padding-bottom: 20px; font-size: 0.8rem; color: #85857f; }
.footer a:hover { color: #ddd; }

/* ---------- prijava ---------- */
body.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { font-size: 1.3rem; margin: 0; }
