/* Fin-Tracker – izgled (#18). Tokeni u :root; tamna tema posebno podešena (ne obrnuta). */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f0f2f5; --border: #e2e5ea; --border-strong: #cdd2da;
  --text: #12161c; --text-2: #4a5260; --muted: #7a8291;
  --accent: #1d5fc4; --accent-ink: #ffffff; --accent-soft: #e5eefb;
  --s-income: #2a78d6; --s-expense: #eb6834; --s-profit: #1baf7a; --s-vat: #4a3aa7;
  --series-1: var(--s-income); --series-2: var(--s-expense);
  --age-1: #86b6ef; --age-2: #5598e7; --age-3: #2a78d6; --age-4: #1c5cab; --age-5: #184f95;
  --good: #0a7d0a; --good-bg: #e5f4e5; --warning: #8a5a00; --warning-bg: #fdf1d6; --warn-stripe: #e0a100;
  --critical: #c22f2f; --critical-bg: #fbe5e5; --info-bg: var(--accent-soft);
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 12px 32px rgba(20,30,50,.10);
  --font: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121519; --surface: #191c21; --surface-2: #22262c; --border: #2b3038; --border-strong: #3a414b;
    --text: #f2f4f7; --text-2: #b9c0cb; --muted: #8a93a1; --accent: #4d8ff0; --accent-ink: #0b1220; --accent-soft: #1a2a42;
    --s-income: #3987e5; --s-expense: #d95926; --s-profit: #199e70; --s-vat: #9085e9;
    --age-1: #184f95; --age-2: #1c5cab; --age-3: #2a78d6; --age-4: #5598e7; --age-5: #86b6ef;
    --good: #5fd35f; --good-bg: #15301a; --warning: #f2c14e; --warning-bg: #3a2e10; --critical: #ff8a8a; --critical-bg: #3b1a1a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121519; --surface: #191c21; --surface-2: #22262c; --border: #2b3038; --border-strong: #3a414b;
  --text: #f2f4f7; --text-2: #b9c0cb; --muted: #8a93a1; --accent: #4d8ff0; --accent-ink: #0b1220; --accent-soft: #1a2a42;
  --s-income: #3987e5; --s-expense: #d95926; --s-profit: #199e70; --s-vat: #9085e9;
  --age-1: #184f95; --age-2: #1c5cab; --age-3: #2a78d6; --age-4: #5598e7; --age-5: #86b6ef;
  --good: #5fd35f; --good-bg: #15301a; --warning: #f2c14e; --warning-bg: #3a2e10; --critical: #ff8a8a; --critical-bg: #3b1a1a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 22px; margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 11.5px; margin: 0 0 8px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.pos { color: var(--good); } .neg { color: var(--critical); }
.mono { font-family: var(--mono); font-size: 12px; }
.ellipsis { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Okvir: meni lijevo, sadržaj desno --- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.firm { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; min-width: 0; }
.firm .mark { width: 30px; height: 30px; flex: none; border-radius: 6px; background: var(--text); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.firm-txt { min-width: 0; flex: 1; }
.firm .n { font-weight: 600; font-size: 13px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firm .s { font-size: 11.5px; color: var(--muted); }
.tenant-switch { width: 100%; padding: 3px 6px; font-size: 12.5px; border-radius: 6px; font-weight: 600; }
.new-wrap { position: relative; }
.menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; z-index: 30; display: grid; }
.menu a { padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13.5px; }
.menu a:hover, .menu a:focus { background: var(--surface-2); text-decoration: none; outline: none; }
.nav { display: grid; gap: 12px; }
.nav .g { display: grid; gap: 1px; }
.nav .gl { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 10px 3px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav .cnt { margin-left: auto; font-size: 11px; font-weight: 600; background: var(--critical-bg); color: var(--critical); padding: 0 7px; border-radius: 999px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }
.side-foot .nav { gap: 1px; }
.user-box { display: flex; flex-direction: column; gap: 6px; padding: 4px 10px 0; }
.user-box .who { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .row { display: flex; gap: 6px; flex-wrap: wrap; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 12px 28px 0; }
#btn-menu { display: none; }
.search { position: relative; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 0 10px; color: var(--muted); width: min(100%, 360px); margin-left: auto; }
.search input { border: 0; background: transparent; padding: 7px 0; flex: 1; min-width: 0; outline: none; box-shadow: none; color: var(--text); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd { font: 11px var(--mono); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); z-index: 30; max-height: 60vh; overflow-y: auto; padding: 4px; }
.search-results .sr-h { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px 2px; }
.search-results a { display: flex; gap: 8px; align-items: baseline; padding: 7px 8px; border-radius: 6px; color: var(--text); font-size: 13px; }
.search-results a:hover, .search-results a.kb { background: var(--surface-2); text-decoration: none; }
.search-results a .muted { margin-left: auto; white-space: nowrap; }
.view { padding: 18px 28px 60px; max-width: 1440px; width: 100%; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, 280px); z-index: 40; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .app.menu-open .sidebar { transform: none; }
  #btn-menu { display: inline-flex; }
  .topbar, .view { padding-left: 16px; padding-right: 16px; }
  .search { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* --- Zaglavlje stranice, kartice --- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sub { color: var(--muted); margin-top: 2px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.card-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-h h2 { margin: 0 auto 0 0; }
.grid { display: grid; gap: 12px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid.two { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .grid.three { grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); }
.grid > .card { overflow-x: auto; }
@media (max-width: 1000px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }

.tile .label { color: var(--text-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.tile .label i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.tile .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 2px; }
.tile .delta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tile .delta.up { color: var(--good); } .tile .delta.down { color: var(--critical); }
.tile.alert { border-color: var(--critical); }
.chip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; border-radius: 4px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.chip.up { background: var(--good-bg); color: var(--good); } .chip.down { background: var(--critical-bg); color: var(--critical); } .chip.flat { background: var(--surface-2); color: var(--text-2); }

/* --- Filter perioda --- */
.period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper button { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper .lbl { min-width: 160px; text-align: center; font-weight: 600; }
.period .cmp { font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* --- Zahtijeva pažnju --- */
.attn { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 12px 0; }
.att { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: 8px; padding: 10px 14px; min-width: 0; }
.att.crit { border-left-color: var(--critical); } .att.warn { border-left-color: var(--warn-stripe); } .att.info { border-left-color: var(--accent); } .att.ok { border-left-color: var(--good); }
.att .t { font-size: 13px; font-weight: 600; } .att .s { font-size: 12.5px; color: var(--muted); }
.att a { margin-left: auto; font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* --- Tabele --- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; } tbody tr.click:hover { background: var(--surface-2); }
tr.sel { background: var(--accent-soft) !important; }
tfoot th { color: var(--text); }
.table-wrap { overflow-x: auto; }
td.actions { white-space: nowrap; text-align: right; }

/* --- Statusi --- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.open { background: var(--info-bg); color: var(--accent); }
.badge.partial, .badge.unmatched { background: var(--warning-bg); color: var(--warning); }
.badge.paid, .badge.matched { background: var(--good-bg); color: var(--good); }
.badge.cancelled, .badge.ignored { background: var(--surface-2); color: var(--muted); }
.badge.overdue { background: var(--critical-bg); color: var(--critical); }

/* --- Dugmad i polja --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 500; line-height: 1.2; color: var(--text); text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; } .btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical); border-color: var(--critical); background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.block { width: 100%; }
.btn.icon-only { padding: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
input, select, textarea { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 10px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 700px) { .form-grid > * { grid-column: span 12 !important; } }
.check { display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 7px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; cursor: pointer; color: var(--text-2); border-radius: 5px; font-weight: 500; font-size: 13px; }
.seg button.on, .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* --- Modal, toast --- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade .12s ease; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(100%, var(--w, 760px)); max-height: 92vh; display: flex; flex-direction: column; }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal header h2 { margin: 0; font-size: 16px; }
.modal .body { padding: 18px 20px; overflow: auto; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal footer .left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.items-table input { width: 100%; padding: 5px 7px; } .items-table td { padding: 4px; border: 0; }
.totals { margin-left: auto; width: min(100%, 320px); margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; } .totals .g { font-weight: 700; font-size: 16px; border-top: 2px solid var(--text); margin-top: 6px; padding-top: 8px; }
#toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 500; animation: fade .15s; max-width: 400px; }
.toast.err { background: var(--critical); color: #fff; }

/* --- Ostalo iz postojećih stranica --- */
.empty { padding: 30px; text-align: center; color: var(--muted); }
.split { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 20px; }
.sugg { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.sugg .score { font-weight: 700; font-size: 12px; color: var(--accent); min-width: 34px; }
.sugg .meta { flex: 1; min-width: 0; } .sugg .reasons { font-size: 11.5px; color: var(--muted); }
.drop { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 36px; text-align: center; color: var(--text-2); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }

/* --- Grafikoni --- */
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 10px; height: 10px; border-radius: 2px; } .legend .ln { width: 14px; height: 2px; border-radius: 1px; }
.legend span[style*="--c"]::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart .lbl-strong { fill: var(--text); font-weight: 600; }
.chart .hit { fill: transparent; }
.chart .hit:hover, .chart .hit:focus { fill: var(--surface-2); fill-opacity: .6; outline: none; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; min-width: 170px; transform: translate(-50%, calc(-100% - 10px)); z-index: 2; }
.tip .h { font-weight: 600; margin-bottom: 4px; }
.tip .r { display: flex; align-items: center; gap: 8px; } .tip .r b { margin-left: auto; font-variant-numeric: tabular-nums; }
.tip .k { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .track { height: 8px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--s-expense); border-radius: 0 3px 3px 0; }
.hbar .num { min-width: 92px; font-weight: 500; }
.aging { display: flex; height: 22px; gap: 2px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.aging div { height: 100%; min-width: 2px; }
.aglist { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; font-size: 12px; margin: 8px 0 6px; }
.aglist div { display: grid; gap: 2px; color: var(--text-2); } .aglist i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.aglist b { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
@media (max-width: 600px) { .aglist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vatbox { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vatbox div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; display: grid; gap: 2px; }
.vatbox span { font-size: 12px; color: var(--muted); } .vatbox b { font-size: 15px; font-variant-numeric: tabular-nums; }
.vatbox .due { background: var(--accent-soft); } .vatbox .due span { color: var(--accent); }

/* --- Prijava (#16) --- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-wrap { width: min(100%, 420px); }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-size: 18px; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: var(--text); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.auth-card { padding: 26px 26px 22px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card > p { margin: 0 0 16px; }
.auth-card .field { margin-bottom: 12px; }
.auth-card input { width: 100%; padding: 10px 12px; }
.auth-error { color: var(--critical); min-height: 1.2em; margin: 4px 0 10px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.auth-card .btn.block { padding: 10px 14px; margin-top: 6px; }
.code-input { font-size: 20px; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-steps { padding-left: 20px; margin: 8px 0 14px; color: var(--text-2); font-size: 13px; }
.auth-steps li { margin-bottom: 4px; }
.qr { background: #fff; border-radius: 10px; padding: 10px; width: 200px; margin: 0 auto 10px; }
.qr svg { width: 100%; height: auto; display: block; }
.secret { word-break: break-all; background: var(--surface-2); padding: 8px; border-radius: 6px; font-size: 13px; }
.codes { columns: 2; list-style: none; padding: 12px 16px; background: var(--surface-2); border-radius: 8px; font-size: 15px; margin: 0 0 12px; }
.codes li { padding: 3px 0; }
.auth-row { display: flex; gap: 8px; margin-bottom: 12px; }
.auth-foot { text-align: center; margin-top: 14px; }
