/* =====================================================================
   BI Sustav — tema
   Jadranska plava za podatke, plavac mali za isticanje, hladni kamen kao podloga.
   Svijetla i tamna tema: <html data-theme="light|dark">
   ===================================================================== */

:root {
  color-scheme: light;
  --bg: #f2f4f3;
  --surface: #ffffff;
  --surface-2: #f6f8f8;
  --ink: #18232e;
  --muted: #5c6977;
  --faint: #8995a1;
  --line: #dce1e4;
  --line-strong: #c4ccd2;

  --brand: #1d5c86;
  --brand-hover: #174b6e;
  --brand-ink: #ffffff;
  --brand-soft: #e3eef6;
  --wine: #8e2f45;
  --wine-soft: #f6e6ea;

  --ok: #2e7d4f;
  --ok-soft: #e4f3ea;
  --bad: #b4383a;
  --bad-soft: #fbe9e9;
  --info-soft: #e3eef6;

  --sidebar-bg: #102030;
  --sidebar-ink: #b9c7d3;
  --sidebar-ink-strong: #ffffff;
  --sidebar-hover: #17293a;
  --sidebar-active: #1d3a52;
  --sidebar-line: #1c3044;

  --chart-1: #1d5c86;
  --chart-2: #a9c5da;
  --chart-peak: #8e2f45;
  --chart-grid: #e6eaec;
  --chart-axis: #6d7a87;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 32, 48, .06);
  --focus: 0 0 0 3px rgba(29, 92, 134, .35);

  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --sidebar-w: 248px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e151c;
  --surface: #151f29;
  --surface-2: #1a2632;
  --ink: #e4eaee;
  --muted: #95a3b0;
  --faint: #6f7d8a;
  --line: #243240;
  --line-strong: #31424f;

  --brand: #5fa3d3;
  --brand-hover: #7ab4dd;
  --brand-ink: #0b1218;
  --brand-soft: #16304a;
  --wine: #df8195;
  --wine-soft: #3a1d26;

  --ok: #62c48f;
  --ok-soft: #15301f;
  --bad: #f08585;
  --bad-soft: #3a1b1b;
  --info-soft: #16304a;

  --sidebar-bg: #0a1016;
  --sidebar-ink: #93a3b1;
  --sidebar-hover: #121c25;
  --sidebar-active: #182a3a;
  --sidebar-line: #16212b;

  --chart-1: #5fa3d3;
  --chart-2: #2b4a63;
  --chart-peak: #df8195;
  --chart-grid: #22303d;
  --chart-axis: #8392a0;

  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --focus: 0 0 0 3px rgba(95, 163, 211, .4);
}

/* --- Osnova ---------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14.5px/1.55 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 15.5px; line-height: 1.3; font-weight: 600; margin: 0 0 12px; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.muted { color: var(--muted); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- Okvir aplikacije: izbornik lijevo + sadržaj ---------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--sidebar-bg); color: var(--sidebar-ink);
  border-right: 1px solid var(--sidebar-line);
  padding: 18px 12px 14px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px; color: var(--sidebar-ink-strong);
  font-weight: 600; font-size: 16px; letter-spacing: -.01em;
}
.sidebar .brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2a6f9c, #8e2f45);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--sidebar-ink); margin-top: 1px; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group-label { font-size: 12px; color: #6f8396; padding: 0 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-ink); font-weight: 500;
}
.nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-ink-strong); text-decoration: none; }
.nav a.active { background: var(--sidebar-active); color: var(--sidebar-ink-strong); box-shadow: inset 3px 0 0 #6fb0de; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .sub { display: flex; flex-direction: column; margin: 2px 0 6px 21px; padding-left: 10px; border-left: 1px solid var(--sidebar-line); }
.nav .sub a { padding: 5px 10px; font-weight: 400; font-size: 13.5px; }
.nav .sub a.active { box-shadow: none; background: transparent; color: var(--sidebar-ink-strong); font-weight: 500; }

.sidebar-foot { border-top: 1px solid var(--sidebar-line); padding: 12px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
  background: var(--sidebar-active); color: var(--sidebar-ink-strong);
}
.sidebar-foot a.who { color: var(--sidebar-ink); text-decoration: none; }
.sidebar-foot .who { min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-foot .who strong { display: block; color: var(--sidebar-ink-strong); font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot .who span { font-size: 12px; }
.sidebar-foot form { margin: 0; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: var(--sidebar-hover); color: var(--sidebar-ink-strong); }
.icon-btn svg { width: 18px; height: 18px; }

/* --- Gornja traka sadržaja ---------------------------------------- */
.main { min-width: 0; display: flex; flex-direction: column; grid-column: 2; }
/* Sloj iza mobilnog izbornika: na računalu se nikad ne prikazuje i ne zauzima stupac */
.scrim { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(8, 14, 20, .45); }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 32px; min-height: 64px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; font-size: 20px; }
.menu-toggle { display: none; color: var(--ink); }
.menu-toggle:hover { background: var(--surface-2); color: var(--ink); }

.theme-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
.theme-switch button {
  display: inline-grid; place-items: center; width: 30px; height: 28px;
  border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer;
}
.theme-switch button svg { width: 16px; height: 16px; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }

.content { padding: 28px 32px 48px; max-width: 1360px; width: 100%; }
.page-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; color: var(--muted); }

/* --- Površine ------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 > .card { margin-bottom: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 13px; }

/* --- Gumbi i polja -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer;
  font: inherit; font-weight: 500; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font: inherit; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 7px 10px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: var(--date-icon-filter, none); }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
label { display: block; font-size: 13px; color: var(--muted); }
label > input, label > textarea { display: block; width: 100%; margin-top: 5px; }
label.check { display: inline-flex; align-items: flex-start; gap: 8px; color: var(--ink); line-height: 1.4; }
label.check > input { display: inline-block; width: auto; margin: 2px 0 0; accent-color: var(--brand); }

.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin: 10px 0; border: 1px solid transparent; }
.alert.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert.info { background: var(--info-soft); color: var(--ink); border-color: color-mix(in srgb, var(--brand) 30%, transparent); }

.card.narrow { max-width: 620px; }
fieldset.checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 12px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px 16px; }
fieldset.checks legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
form.stack { display: grid; gap: 12px; margin-bottom: 8px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 6px; }
.button-row .action-button { margin: 0; }

/* --- Prijava / prvo postavljanje ----------------------------------- */
body.guest { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.guest-wrap { width: 100%; max-width: 380px; }
.guest-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; margin-bottom: 18px; }
.login { display: grid; gap: 14px; padding: 28px; margin: 0; }
.login h1 { font-size: 22px; }
.guest-theme { position: fixed; top: 16px; right: 16px; }

/* --- Filteri ------------------------------------------------------- */
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 20px;
}
.filterbar label { display: flex; align-items: center; gap: 6px; }
.filterbar label > input { display: inline-block; width: auto; margin: 0; }
.filterbar-extra { margin-left: auto; }

/* --- Gumb Osvježi ---------------------------------------------------- */
.refresh { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.refresh-error { color: var(--bad); max-width: 420px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- KPI pojas: jedan pojas, četiri mjere --------------------------- */
.kpi-band {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.kpi { padding: 20px 24px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; background: linear-gradient(180deg, var(--brand-soft), transparent 85%); }
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 2px; white-space: nowrap; }
.kpi:first-child .kpi-value { font-size: 38px; color: var(--brand); }
.kpi-delta { font-size: 13px; font-weight: 500; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta .muted { font-weight: 400; }

/* --- Lokali: kartica po lokalu ---------------------------------------- */
.locations { margin-bottom: 22px; }
.location-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.location-card {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 14px;
  transition: border-color .15s, opacity .15s;
}
.location-card:hover { border-color: var(--line-strong); }
.location-card.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow); }
.location-card.dimmed { opacity: .55; }
.location-card.dimmed:hover { opacity: .85; }
.location-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.location-name { font-weight: 600; font-size: 15px; }
.badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); vertical-align: 2px; }
.location-share { font-size: 12.5px; color: var(--muted); }
.location-value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.location-delta { font-size: 13px; font-weight: 500; }
.location-delta .up { color: var(--ok); }
.location-delta .down { color: var(--bad); }
.location-spark { display: block; height: 44px; margin: 6px -4px 4px; }
.location-stats { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.location-stats strong { color: var(--ink); font-weight: 600; }
.location-empty { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* --- Tablice ------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { font-size: 12.5px; color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--surface); }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--ink); }
.table tbody tr:hover td { background: var(--surface-2); }
.table tfoot td { font-weight: 600; border-top: 2px solid var(--line-strong); border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table.small td, .table.small th { padding: 6px 8px; font-size: 13px; }
.datatable .search { margin-bottom: 12px; width: 280px; max-width: 100%; }
.empty { padding: 28px 0; text-align: center; }
.is-loading { opacity: .5; transition: opacity .15s; }
.status-ok { color: var(--ok); }
.status-failed { color: var(--bad); }
.status-running { color: var(--wine); }

dl.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0 0 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-all; }

/* --- Zapisnik ------------------------------------------------------ */
.table .nowrap { white-space: nowrap; }
.table.audit td { vertical-align: top; }
.table tr.warn td { background: var(--bad-soft); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }

/* --- Izvještaji: kartice izvještaja ---------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 9px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent;
  cursor: pointer; font: inherit; font-weight: 500;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }
.export-menu { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }

/* --- Modal --------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 14, 20, .55);
  display: grid; place-items: center; padding: 16px;
}
.modal { width: min(500px, 100%); display: grid; gap: 14px; margin: 0; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }
.formats { border: 0; padding: 0; margin: 0; display: flex; gap: 18px; }
.formats legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; }

/* --- Grafovi ------------------------------------------------------- */
.chart-tip {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); box-shadow: 0 6px 18px rgba(0, 0, 0, .15);
  padding: 8px 11px; border-radius: var(--radius-sm); font-size: 13px;
}
.chart-tip strong { display: block; margin-bottom: 2px; }
.island-loading { color: var(--muted); padding: 16px 0; }
pre.preview { background: var(--surface-2); border: 1px solid var(--line); padding: 10px; border-radius: var(--radius-sm); max-height: 240px; overflow: auto; font-size: 12px; }
.action-button { margin-top: 6px; }

/* --- Mobitel / tablet ---------------------------------------------- */
@media (max-width: 1100px) {
  .kpi-band { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .main { grid-column: 1; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .scrim { display: block; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
  .filterbar-extra { margin-left: 0; }
}
@media (max-width: 560px) {
  .kpi-band { grid-template-columns: 1fr; }
  .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .kpi:first-child { border-top: 0; }
}

/* --- Food cost na Pregledu ------------------------------------------- */
.section-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 6px 0 12px; }
.section-title h2 { margin: 0; font-size: 18px; }
.section-title .muted { font-size: 13px; }
.fc-band { grid-template-columns: repeat(4, 1fr); }
.fc-band .kpi:first-child .kpi-value { font-size: 34px; }
.kpi-note { font-size: 12.5px; margin-top: 2px; }
.fc-sub { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
@media (max-width: 900px) { .fc-band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .fc-band { grid-template-columns: 1fr; } }

/* --- Grupni meniji --------------------------------------------------- */
.inline-form { display: inline; margin: 0; }
.page-intro .inline-form label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.link-btn { border: 0; background: none; padding: 0; margin-left: 10px; font: inherit; color: var(--brand); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--bad); }
.groups-grid { align-items: start; }
.fc-note { margin: -8px 0 20px; font-size: 13.5px; }
.group-editor { display: grid; gap: 14px; }
.ge-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.ge-fields .ge-wide { grid-column: span 2; }
.ge-lines input.qty { width: 80px; text-align: right; }
.ge-note input { width: 100%; }
.picker { position: relative; max-width: 520px; }
.picker input { width: 100%; }
.picker-list { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); position: absolute; z-index: 5; left: 0; right: 0; max-height: 320px; overflow-y: auto; }
.picker-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 9px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; border-radius: 5px; }
.picker-list button:hover, .picker-list button:focus-visible { background: var(--surface-2); }
.picker-list .muted { font-size: 12px; }
@media (max-width: 700px) { .ge-fields .ge-wide { grid-column: auto; } }
.ge-unit { font-size: 12px; }
.row-actions .link-btn { margin-left: 8px; }
.fc-cmp { font-size: 12.5px; margin: -4px 0 10px; }

/* --- Marketing ------------------------------------------------------- */
.mk-band { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.mk-band .kpi-value { font-size: 24px; }
.mk-open { color: var(--bad); }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.mk-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mk-form label { display: flex; flex-direction: column; gap: 4px; }
.mk-form .mk-wide { grid-column: span 2; }
.mk-form .mk-full { grid-column: 1 / -1; }
.mk-form textarea { width: 100%; font: inherit; }
.mk-desc { min-width: 220px; max-width: 380px; white-space: normal; }
.pill { border: 0; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.pill.paid { background: var(--ok-soft, #e3f4e8); color: var(--ok); }
.pill.unpaid { background: var(--bad-soft); color: var(--bad); }
.table tr.mk-unpaid td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
@media (max-width: 900px) { .mk-band { grid-template-columns: repeat(2, 1fr); } .mk-form .mk-wide { grid-column: auto; } }
.mk-overdue { color: var(--bad); font-size: 12px; font-weight: 600; }
.mk-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.mk-cat { display: flex; align-items: baseline; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: 13px; }
.mk-cat:hover { border-color: var(--brand); }
.mk-form input[readonly] { background: var(--surface-2); }
.mk-newsup { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; }
.mk-newsup[hidden] { display: none; }
.mk-newsup legend { font-size: 12.5px; color: var(--muted); padding: 0 4px; }
.mk-newsup label { display: flex; flex-direction: column; gap: 4px; }

/* --- Izbornik: moduli u izradi --------------------------------------- */
.nav a.soon { opacity: .62; }
.nav a.soon:hover, .nav a.soon.active { opacity: 1; }
.nav a > span { flex: 1; min-width: 0; }
.soon-tag { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.1); color: inherit; opacity: .8; }
.soon-page { max-width: 760px; }
.soon-page .lead { font-size: 15.5px; margin: 0 0 14px; }
.soon-page ul { margin: 0 0 16px; padding-left: 20px; line-height: 1.7; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.hub-card { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.hub-card:hover { border-color: var(--brand); }
.hub-card strong { display: block; margin-bottom: 4px; }
.hub-card span { font-size: 13px; color: var(--muted); }
.mk-hint { font-size: 12px; margin-left: 6px; }

/* Svi računi: skeniranje, kontrola, usklađivanje */
.mk-actions { margin-bottom: 14px; }
.pill.pending { background: var(--brand-soft); color: var(--brand); }
span.pill { cursor: default; display: inline-block; }
.mk-ok { color: var(--ok); font-weight: 600; }
.mk-wait { color: var(--wine); font-weight: 600; }
.mk-file { font-size: 12px; }
.sc-card { max-width: 640px; }
.sc-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 34px 20px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2);
  color: var(--ink); cursor: pointer; margin-bottom: 14px; }
.sc-drop:hover, .sc-drop:focus-within { border-color: var(--brand); }
.sc-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.sc-drop strong { font-size: 17px; word-break: break-all; }
.sc-icon { color: var(--brand); }
.sc-preview { margin-bottom: 14px; }
.sc-preview img { max-width: 100%; max-height: 360px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.sc-wait { margin-top: 10px; }
.sc-steps { margin: 0; padding-left: 20px; line-height: 1.6; }
.sc-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sc-split > .card { margin: 0; }
.sc-doc { position: sticky; top: 12px; }
.sc-doc iframe { width: 100%; height: 72vh; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sc-doc img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sc-kv { margin-top: 12px; }
.sc-items { font-size: 13px; margin-top: 10px; }
@media (max-width: 900px) { .sc-split { grid-template-columns: 1fr; } .sc-doc { position: static; order: -1; } .sc-doc iframe { height: 60vh; } }
.rc-note { margin: 10px 0 0; font-size: 13px; }
.rc-since { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.rc-since input { padding: 2px 6px; font-size: 13px; }
.rc-h { font-size: 15px; margin: 18px 0 8px; }
.rc-ok { margin-top: 16px; }
.rc-ok summary { cursor: pointer; color: var(--ok); font-weight: 600; }
/* Stavke računa: primka / izravni trošak */
.st-band { margin: 6px 0 12px; }
.st-table select { max-width: 280px; }
.st-table tr.st-primka td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.st-del { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; white-space: nowrap; }
.st-left { margin: 4px 0 12px; padding-left: 20px; font-size: 13px; }
.st-add { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px 12px; margin: 14px 0; display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 10px; }
.st-add legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
@media (max-width: 700px) { .st-add { grid-template-columns: 1fr; } }
.mk-form .mk-rowstart { grid-column-start: 1; }
.sc-items select.sc-kat { max-width: 230px; font-size: 13px; padding: 4px 6px; }
.sc-learn { font-size: 11px; padding: 1px 6px; }
.sc-note { font-size: 13px; margin: 12px 0 4px; }
.mk-katcell div { line-height: 1.35; }
.mk-queue { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; padding: 12px 16px; margin-bottom: 14px; }
.mk-check { color: var(--wine); font-size: 12px; font-weight: 600; white-space: normal; max-width: 220px; margin-bottom: 4px; }
.fs-log { max-height: 260px; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; white-space: pre-wrap; margin: -6px 0 14px; }
.mk-tag { color: var(--wine); font-size: 11.5px; font-weight: 600; }

/* izvještaji: rast / pad u odnosu na prošlu godinu */
td.trend-up { color: var(--ok); }
td.trend-down { color: var(--bad); }

/* ručna raspodjela računa po objektima (%) */
.mk-split { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: end; margin-top: 6px; }
.mk-split label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted, #888); }
.mk-split input { width: 52px; padding: 2px 4px; font-size: 12px; text-align: right; }
.mk-split-edit { display: flex; flex-wrap: wrap; gap: 8px 16px; border: 1px solid var(--border, #ddd); border-radius: 8px; padding: 8px 12px; }
.mk-split-edit input { width: 80px; text-align: right; }
