/* =====================================================================
   Klijenti: stilovi
   ===================================================================== */

:root {
  color-scheme: light;
  --bg: #F5F6F6;
  --surface: #FFFFFF;
  --surface-2: #F0F2F1;
  --surface-3: #E8EBEA;
  --line: #E2E5E4;
  --line-strong: #CDD2D0;
  --ink: #151918;
  --ink-2: #4E5755;
  --ink-3: #7A8381;
  --accent: #1D6B56;
  --accent-hover: #175946;
  --accent-ink: #FFFFFF;
  --accent-soft: #E2EFEA;
  --red: #B93A29;
  --red-soft: #FBE8E4;
  --orange: #B4600E;
  --orange-soft: #FCEEDC;
  --blue: #2F68AB;
  --blue-soft: #E5EDF7;
  --violet: #6550AE;
  --violet-soft: #EEEBF8;
  --gray: #5F6866;
  --gray-soft: #ECEEED;
  --chart-paid: #0E7F5A;
  --chart-wait: #C98419;
  --focus: #2F68AB;
  --shadow-sm: 0 1px 2px rgba(16, 24, 22, .05);
  --shadow: 0 1px 2px rgba(16, 24, 22, .04), 0 6px 20px -8px rgba(16, 24, 22, .10);
  --shadow-lg: 0 16px 48px -12px rgba(16, 24, 22, .28);
  --scrim: rgba(13, 17, 16, .32);

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --sidebar: 236px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0D1110;
    --surface: #141918;
    --surface-2: #1A201F;
    --surface-3: #222927;
    --line: #242B29;
    --line-strong: #343D3A;
    --ink: #E6EAE9;
    --ink-2: #A9B2AF;
    --ink-3: #7B8582;
    --accent: #57B394;
    --accent-hover: #6CC4A6;
    --accent-ink: #07130F;
    --accent-soft: #15302A;
    --red: #EF7B69;
    --red-soft: #3A1D18;
    --orange: #E9A752;
    --orange-soft: #35260F;
    --blue: #7EAAE0;
    --blue-soft: #172539;
    --violet: #AC9EE8;
    --violet-soft: #241F3B;
    --gray: #A2ABA8;
    --gray-soft: #1F2523;
    --chart-paid: #45A886;
    --chart-wait: #B9802C;
    --focus: #7EAAE0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
    --shadow-lg: 0 20px 60px -12px rgba(0, 0, 0, .7);
    --scrim: rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1110;
  --surface: #141918;
  --surface-2: #1A201F;
  --surface-3: #222927;
  --line: #242B29;
  --line-strong: #343D3A;
  --ink: #E6EAE9;
  --ink-2: #A9B2AF;
  --ink-3: #7B8582;
  --accent: #57B394;
  --accent-hover: #6CC4A6;
  --accent-ink: #07130F;
  --accent-soft: #15302A;
  --red: #EF7B69;
  --red-soft: #3A1D18;
  --orange: #E9A752;
  --orange-soft: #35260F;
  --blue: #7EAAE0;
  --blue-soft: #172539;
  --violet: #AC9EE8;
  --violet-soft: #241F3B;
  --gray: #A2ABA8;
  --gray-soft: #1F2523;
  --chart-paid: #45A886;
  --chart-wait: #B9802C;
  --focus: #7EAAE0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
  --shadow-lg: 0 20px 60px -12px rgba(0, 0, 0, .7);
  --scrim: rgba(0, 0, 0, .55);
}

/* ---------- osnova ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 600; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.ico { width: 18px; height: 18px; flex: none; display: block; }
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }
[data-icon] { display: inline-flex; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- učitavanje ---------- */

.pocetno {
  position: fixed; inset: 0;
  display: grid; place-items: center;
}
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vrti .7s linear infinite;
}
@keyframes vrti { to { transform: rotate(360deg); } }

/* ---------- okvir aplikacije ---------- */

.app { min-height: 100vh; min-height: 100dvh; }

.sidebar { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
  padding: 0 8px 0 16px;
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.senka { border-bottom-color: var(--line); }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
}
.brand img { border-radius: 7px; }

.topbar-akcije { display: flex; gap: 2px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; background: transparent; border-radius: var(--r);
  color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn-sm { width: 34px; height: 34px; border-radius: var(--r-sm); }

.view {
  padding: 8px 16px calc(var(--tabbar) + var(--safe-b) + 32px);
  max-width: 1160px;
  outline: none;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--tabbar) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: 100%;
  font-size: 11px; font-weight: 500; color: var(--ink-3);
}
.tabbar a .ico { width: 22px; height: 22px; }
.tabbar a.aktivno { color: var(--accent); }
.tab-plus {
  justify-self: center;
  display: grid; place-items: center;
  width: 52px; height: 52px; margin-top: -2px;
  border: 0; border-radius: 18px;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  cursor: pointer;
}
.tab-plus .ico { width: 24px; height: 24px; stroke-width: 2.25; }
.tab-plus:active { transform: scale(.96); }

@media (min-width: 1024px) {
  .topbar, .tabbar { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 20;
    width: var(--sidebar);
    display: flex; flex-direction: column; gap: 20px;
    padding: 20px 14px 16px;
    border-right: 1px solid var(--line);
    background: var(--bg);
  }
  .sidebar .brand { padding: 2px 8px; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; }
  .sidenav a, .sidebar-dugme {
    display: flex; align-items: center; gap: 10px;
    height: 36px; padding: 0 10px;
    border: 0; border-radius: var(--r-sm); background: transparent;
    color: var(--ink-2); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
  }
  .sidenav a:hover, .sidebar-dugme:hover { background: var(--surface-2); color: var(--ink); }
  .sidenav a.aktivno { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
  .sidenav a.aktivno .ico { color: var(--accent); }
  .sidebar-dno { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
  .view { margin-left: var(--sidebar); padding: 36px 48px 64px; }
}

@media (min-width: 1400px) {
  .view { margin-left: calc(var(--sidebar) + max(0px, (100vw - var(--sidebar) - 1160px) / 2 - 48px)); }
}

/* ---------- dugmad ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { color: var(--red); }
.btn-danger.potvrdi { background: var(--red); border-color: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 48px; font-size: 15px; padding: 0 18px; border-radius: var(--r); }
.btn-sm { min-height: 32px; padding: 0 10px; font-size: 13px; }

/* ---------- zaglavlje stranice ---------- */

.strana-zaglavlje {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  margin: 8px 0 20px;
}
.strana-zaglavlje p { margin-top: 4px; color: var(--ink-2); }
.strana-zaglavlje .akcije { display: flex; gap: 8px; }
@media (min-width: 1024px) { .strana-zaglavlje { margin: 0 0 28px; } }

/* ---------- panel i sekcije ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.panel-zaglavlje {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-zaglavlje h2 { display: flex; align-items: center; gap: 8px; }
.panel-zaglavlje h2 .broj { color: var(--ink-3); font-weight: 500; }
.panel-telo { padding: 4px 0; }
.panel-telo.uvuceno { padding: 16px; }
.panel + .panel { margin-top: 16px; }

.prazno {
  padding: 20px 16px;
  color: var(--ink-3); font-size: 14px;
}
.prazno-veliko {
  padding: 48px 16px; text-align: center; color: var(--ink-2);
}
.prazno-veliko h2 { margin-bottom: 6px; color: var(--ink); }

/* ---------- statistika ---------- */

.statistika {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 760px) { .statistika { grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; } }

.stat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  text-align: left; cursor: pointer;
}
.stat:hover { border-color: var(--line-strong); }
.stat-oznaka { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.stat-oznaka .ico { width: 15px; height: 15px; color: var(--ink-3); }
.stat-vrednost {
  font-size: 26px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-vrednost .dodatak { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }
.stat-napomena { font-size: 12.5px; color: var(--ink-3); }
.stat.upozorenje .stat-vrednost { color: var(--orange); }

/* ---------- mreže ---------- */

.dodatak { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--ink-2); }

.pregled-mreza { display: grid; gap: 16px; }
.pregled-mreza > * { min-width: 0; }
.pregled-mreza .panel + .panel { margin-top: 0; }
@media (min-width: 1024px) {
  .pregled-mreza {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-areas: "a b" "c b";
    grid-template-rows: auto 1fr;
    gap: 20px; align-items: start;
  }
  .p-zadaci { grid-area: a; }
  .p-tihi { grid-area: b; }
  .p-aktivnost { grid-area: c; }
}

.dve-kolone { display: grid; gap: 16px; }
.dve-kolone > * { min-width: 0; }
@media (min-width: 1024px) {
  .dve-kolone { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .dve-kolone .panel + .panel { margin-top: 20px; }
}
.razmak { height: 16px; }
@media (min-width: 1024px) { .razmak { height: 20px; } }

/* ---------- redovi liste ---------- */

.red {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  min-height: 56px;
}
.red + .red { border-top: 1px solid var(--line); }
a.red:hover, button.red:hover, .red.klik:hover { background: var(--surface-2); }
button.red { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.red-telo { flex: 1; min-width: 0; }
.red-naslov { font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.red-pod { margin-top: 2px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.red-tekst { margin-top: 4px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; white-space: pre-line; }
.red-desno { flex: none; display: flex; align-items: center; gap: 6px; margin-left: auto; text-align: right; }
.red-ikona {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--surface-2); color: var(--ink-2);
}
.red-ikona .ico { width: 16px; height: 16px; }
.dve-linije { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- oznake (badge) ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap;
  background: var(--gray-soft); color: var(--gray);
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge.bez-tacke::before { display: none; }
.badge[data-tone="green"]  { background: var(--accent-soft); color: var(--accent); }
.badge[data-tone="blue"]   { background: var(--blue-soft); color: var(--blue); }
.badge[data-tone="orange"] { background: var(--orange-soft); color: var(--orange); }
.badge[data-tone="red"]    { background: var(--red-soft); color: var(--red); }
.badge[data-tone="violet"] { background: var(--violet-soft); color: var(--violet); }
.badge[data-tone="gray"]   { background: var(--gray-soft); color: var(--gray); }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; color: var(--ink-2); background: var(--surface);
}

.toplina { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.toplina .ico { width: 14px; height: 14px; }
.toplina[data-t="vruc"] .ico { color: var(--red); }
.toplina[data-t="topao"] .ico { color: var(--orange); }
.toplina[data-t="hladan"] .ico { color: var(--blue); }

/* ---------- monogram: prsten pokazuje toplinu ---------- */

.mono-avatar {
  --ring: var(--line-strong);
  flex: none;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ring);
}
.mono-avatar[data-t="vruc"] { --ring: var(--red); }
.mono-avatar[data-t="topao"] { --ring: var(--orange); }
.mono-avatar[data-t="hladan"] { --ring: var(--blue); }
.mono-avatar.veliki { width: 56px; height: 56px; font-size: 18px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ring); }
.mono-avatar.mali { width: 30px; height: 30px; font-size: 11px; }

/* ---------- zadaci ---------- */

.cekboks {
  flex: none;
  display: grid; place-items: center;
  width: 24px; height: 24px; margin: 2px 0 0;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: var(--surface); color: transparent; cursor: pointer;
  padding: 0;
}
.cekboks:hover { border-color: var(--accent); }
.cekboks .ico { width: 14px; height: 14px; stroke-width: 3; }
.cekboks.oznaceno { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.red.gotovo .red-naslov { text-decoration: line-through; color: var(--ink-3); }

.rok { font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.rok.kasni { color: var(--red); }
.rok.danas { color: var(--orange); }

/* ---------- forme ---------- */

.polje { display: flex; flex-direction: column; gap: 6px; }
.polje > span:first-child, .polje-oznaka { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.polje .pomoc { font-size: 12.5px; color: var(--ink-3); }
.polje .obavezno { color: var(--red); }

.unos, select.unos, textarea.unos {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.35;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .02);
  appearance: none; -webkit-appearance: none;
}
textarea.unos { min-height: 96px; resize: vertical; }
select.unos {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A8381' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.unos:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
.unos::placeholder { color: var(--ink-3); }
@media (min-width: 1024px) { .unos, select.unos, textarea.unos { font-size: 14px; min-height: 40px; padding: 8px 12px; } }

.prekidac {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; cursor: pointer;
  font-size: 15px;
}
.prekidac input { position: absolute; opacity: 0; pointer-events: none; }
.prekidac .klizac {
  flex: none; position: relative;
  width: 40px; height: 24px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line-strong);
  transition: background-color .15s;
}
.prekidac .klizac::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.prekidac input:checked + .klizac { background: var(--accent); border-color: var(--accent); }
.prekidac input:checked + .klizac::after { transform: translateX(16px); }
.prekidac input:focus-visible + .klizac { outline: 2px solid var(--focus); outline-offset: 2px; }

.izbori { display: flex; flex-wrap: wrap; gap: 8px; }
.izbor {
  position: relative;
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 14px; cursor: pointer; background: var(--surface);
}
.izbor input { position: absolute; opacity: 0; pointer-events: none; }
.izbor:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.izbor:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

.forma { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.forma > .polje, .forma > .prekidac, .forma > .ceo { grid-column: 1 / -1; }
.forma > .polje.pola { grid-column: auto; }
.greska-poruka { grid-column: 1 / -1; padding: 10px 12px; border-radius: var(--r-sm); background: var(--red-soft); color: var(--red); font-size: 14px; }

/* ---------- sheet (dijalog) ---------- */

.sheet {
  padding: 0; border: 0;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 100%;
  max-height: calc(var(--vidljivo, 100dvh) * .92);
  margin: auto 0 var(--tastatura, 0px);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
/* kad je tastatura otvorena, sheet zauzima sav vidljivi prostor iznad nje */
.sheet.uz-tastaturu { max-height: calc(var(--vidljivo) - 8px); }
.sheet.uz-tastaturu .sheet-rucka { display: none; }
.sheet.uz-tastaturu .sheet-dno { padding-bottom: 10px; }
/* stranica ispod otvorenog sheet-a se ne pomera */
html:has(.sheet[open]) { overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; animation: gore .22s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: var(--scrim); animation: providno .2s ease-out; }
@keyframes gore { from { transform: translateY(24px); opacity: .6; } }
@keyframes providno { from { opacity: 0; } }

.sheet-rucka { width: 36px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; flex: none; }
.sheet-zaglavlje {
  flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 20px;
}
.sheet-zaglavlje h2 { font-size: 18px; }
.sheet-telo { flex: 1; overflow-y: auto; padding: 8px 20px 20px; overscroll-behavior: contain; }
.sheet-dno {
  flex: none;
  display: flex; gap: 8px; align-items: center;
  padding: 12px 20px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.sheet-dno .desno { margin-left: auto; display: flex; gap: 8px; }
.sheet-dno .btn { min-height: 46px; }

@media (min-width: 720px) {
  .sheet {
    width: min(560px, calc(100vw - 48px));
    margin: auto;
    max-height: min(84vh, 760px);
    max-height: min(calc(var(--vidljivo, 100vh) * .84), 760px);
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
  }
  .sheet[open] { animation: iskoci .18s cubic-bezier(.2, .8, .2, 1); }
  .sheet-rucka { display: none; }
  .sheet-zaglavlje { padding: 14px 12px 6px 24px; }
  .sheet-telo { padding: 8px 24px 24px; }
  .sheet-dno { padding: 14px 24px; }
  .sheet-dno .btn { min-height: 40px; }
  @keyframes iskoci { from { transform: scale(.98) translateY(6px); opacity: 0; } }
}

/* brzi unos: mreža izbora */
.brzi-izbor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.brzi-izbor button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 96px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); text-align: left; cursor: pointer;
}
.brzi-izbor button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.brzi-izbor .red-ikona { background: var(--accent-soft); color: var(--accent); }
.brzi-izbor strong { font-weight: 600; font-size: 15px; }
.brzi-izbor small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.brzi-izbor button:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 72px; flex-direction: row; align-items: center; }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; z-index: 100;
  bottom: calc(var(--tabbar) + var(--safe-b) + 16px);
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  max-width: calc(100vw - 32px);
}
.toast.vidljiv { opacity: 1; transform: translate(-50%, 0); }
.toast.greska { background: var(--red); color: #fff; }
@media (min-width: 1024px) { .toast { bottom: 28px; left: calc(50% + var(--sidebar) / 2); } }

/* ---------- prijava ---------- */

.prijava {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
}
.prijava-kartica {
  width: 100%; max-width: 380px;
  padding: 32px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.prijava-kartica img { display: block; margin-bottom: 20px; border-radius: 12px; }
.prijava-kartica h1 { font-size: 22px; }
.prijava-kartica > p { margin: 6px 0 24px; color: var(--ink-2); font-size: 14px; }
.prijava-kartica form { display: flex; flex-direction: column; gap: 14px; }
.prijava-kartica .btn { margin-top: 6px; }
.prijava-napomena { margin-top: 20px; display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-3); }
.prijava-napomena .ico { width: 14px; height: 14px; margin-top: 2px; }

/* ---------- klijenti: alatke ---------- */

.alatke { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.pretraga { position: relative; }
.pretraga .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.pretraga .unos { padding-left: 38px; }
.filteri { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.filteri::-webkit-scrollbar { display: none; }
.filteri select.unos { width: auto; flex: none; min-height: 38px; padding: 6px 32px 6px 12px; font-size: 16px; border-radius: 999px; background-position: right 10px center; }
.filteri select.unos.aktivan { border-color: var(--accent); color: var(--accent); background-color: var(--accent-soft); }
.rezultat { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
@media (min-width: 1024px) {
  .alatke { flex-direction: row; align-items: center; }
  .pretraga { width: 300px; }
  .filteri { margin: 0; padding: 0; overflow: visible; flex-wrap: wrap; }
}

/* kartice klijenata (telefon) */
.lista-kartica { display: flex; flex-direction: column; gap: 10px; }
.kartica-klijent {
  display: block;
  padding: 14px 14px 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.kartica-klijent:active { background: var(--surface-2); }
.kk-gore { display: flex; align-items: center; gap: 12px; }
.kk-ime { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.kk-mesto { font-size: 13px; color: var(--ink-2); }
.kk-gore .badge { margin-left: auto; }
.kk-usluge { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.kk-dole { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.kk-korak { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; font-size: 13.5px; color: var(--ink); }
.kk-korak .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }

/* tabela (računar) */
.tabela-omot { display: none; }
@media (min-width: 1024px) {
  .lista-kartica { display: none; }
  .tabela-omot { display: block; overflow: hidden; }
}
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
  white-space: nowrap;
}
.tabela th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.tabela th button:hover { color: var(--ink); }
.tabela th button.aktivno { color: var(--ink); }
.tabela td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela tbody tr { cursor: pointer; }
.tabela tbody tr:hover td { background: var(--surface-2); }
.tabela .klijent-celija { display: flex; align-items: center; gap: 12px; }
.tabela .klijent-celija strong { font-weight: 500; display: block; color: var(--ink); }
.tabela .klijent-celija small { display: block; font-size: 12.5px; color: var(--ink-3); }
.tabela td:first-child { min-width: 220px; }
.tabela .bez-prelamanja { white-space: nowrap; }
.tabela .desno { text-align: right; }
.tabela .korak { max-width: 260px; color: var(--ink-2); }

/* ---------- pipeline ---------- */

.tabla {
  display: flex; gap: 12px;
  overflow-x: auto;
  margin: 0 -16px; padding: 0 16px 16px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  align-items: flex-start;
}
.kolona {
  flex: none; width: min(82vw, 300px);
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  min-height: 160px;
  transition: background-color .12s, border-color .12s;
}
.kolona.meta { background: var(--accent-soft); border-color: var(--accent); }
.kolona-zaglavlje {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 8px 14px;
}
.kolona-zaglavlje .badge { font-size: 12.5px; height: 24px; }
.kolona-zaglavlje .broj { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kolona-zaglavlje .zbir { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.kolona-telo { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 10px; flex: 1; }
.kolona-prazno { padding: 16px 8px; font-size: 13px; color: var(--ink-3); text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); }

.pk {
  position: relative;
  padding: 12px 12px 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
}
.pk:hover { border-color: var(--line-strong); }
.pk-gore { display: flex; align-items: flex-start; gap: 8px; }
.pk-ime { font-weight: 500; line-height: 1.35; flex: 1; min-width: 0; }
.pk-ruckica {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; margin: -6px -8px -6px 0;
  border: 0; border-radius: 6px; background: transparent;
  color: var(--ink-3); cursor: grab; touch-action: none;
}
.pk-ruckica:hover { background: var(--surface-2); color: var(--ink); }
.pk-detalji { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; color: var(--ink-2); }
.pk-dole { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.pk.vuce-se { opacity: .35; }
.pk-duh {
  position: fixed; z-index: 200; pointer-events: none;
  box-shadow: var(--shadow-lg);
  transform: rotate(1.5deg);
  border-color: var(--accent);
}
@media (min-width: 1024px) {
  .tabla { margin: 0; padding: 0 0 16px; scroll-snap-type: none; }
  .kolona { width: 264px; }
}

/* ---------- detalj klijenta ---------- */

.nazad {
  display: inline-flex; align-items: center; gap: 4px;
  margin: 0 0 12px -6px; padding: 6px 8px 6px 4px;
  border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink-2);
}
.nazad:hover { background: var(--surface-2); color: var(--ink); }

.kz { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.kz-gore { display: flex; align-items: center; gap: 16px; }
.kz-gore h1 { font-size: 24px; overflow-wrap: anywhere; }
.kz-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 14px; color: var(--ink-2); }
.kz-meta .mesto { display: inline-flex; align-items: center; gap: 4px; }
.kz-meta .mesto .ico { width: 14px; height: 14px; }
.kz-izmeni { margin-left: auto; align-self: flex-start; }
.kz-akcije { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kz-akcije .btn { min-height: 48px; flex-direction: column; gap: 4px; font-size: 13px; border-radius: var(--r); }
.kz-akcije .btn .ico { width: 20px; height: 20px; }
.kz-akcije .btn.whatsapp .ico { color: #25A366; }
.kz-akcije .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }
@media (min-width: 720px) {
  .kz-akcije { display: flex; }
  .kz-akcije .btn { flex-direction: row; min-height: 40px; font-size: 14px; border-radius: var(--r-sm); }
  .kz-akcije .btn .ico { width: 16px; height: 16px; }
  .kz-gore h1 { font-size: 28px; }
}

.sledeci-korak {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--ink);
  margin-bottom: 16px;
}
.sledeci-korak .ico { color: var(--accent); margin-top: 2px; }
.sledeci-korak small { display: block; color: var(--ink-2); font-size: 12.5px; margin-bottom: 2px; }

.novac-traka { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.novac-traka > div { padding: 12px 16px; }
.novac-traka > div + div { border-left: 1px solid var(--line); }
.novac-traka small { display: block; font-size: 12.5px; color: var(--ink-3); }
.novac-traka strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
@media (max-width: 420px) { .novac-traka > div { padding: 10px 12px; } .novac-traka strong { font-size: 14.5px; } }

.cena { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cena small { font-weight: 400; color: var(--ink-3); font-size: 12.5px; }

/* vremenska linija */
.linija { position: relative; padding: 8px 0; }
.linija-stavka { position: relative; display: flex; gap: 14px; padding: 10px 16px; }
.linija-stavka::before {
  content: ""; position: absolute; left: 31px; top: 46px; bottom: -10px;
  width: 1px; background: var(--line);
}
.linija-stavka:last-child::before { display: none; }
.linija-stavka .red-ikona { position: relative; z-index: 1; }
.linija-stavka .red-telo { padding-top: 5px; }
.linija-stavka .akcija-izmeni { opacity: 0; }
.linija-stavka:hover .akcija-izmeni, .linija-stavka:focus-within .akcija-izmeni { opacity: 1; }
@media (hover: none) { .linija-stavka .akcija-izmeni { opacity: 1; } }

.korak-strelica { display: flex; gap: 6px; margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13.5px; }
.korak-strelica .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }

.podaci-lista { display: flex; flex-direction: column; }
.podatak { display: flex; gap: 12px; align-items: center; padding: 10px 16px; min-height: 44px; }
.podatak + .podatak { border-top: 1px solid var(--line); }
.podatak .ico { color: var(--ink-3); }
.podatak small { display: block; font-size: 12px; color: var(--ink-3); }
.podatak a { color: var(--accent); overflow-wrap: anywhere; }
.podatak a:hover { text-decoration: underline; }

.beleske-tekst { white-space: pre-line; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }

.klijent-mreza { display: grid; gap: 16px; }
.klijent-mreza > * { min-width: 0; }
.klijent-mreza .panel + .panel { margin-top: 0; }
.kolona-stek { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1024px) {
  .klijent-mreza { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .kolona-stek { gap: 20px; }
}

/* ---------- novac ---------- */

.grafikon-omot { padding: 16px 12px 8px 4px; position: relative; }
.grafikon { width: 100%; height: auto; display: block; overflow: visible; }
.grafikon text { font-family: var(--font); font-size: 11px; fill: var(--ink-3); }
.grafikon .osa { stroke: var(--line); stroke-width: 1; }
.grafikon .mreza-linija { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.grafikon .stub-placeno { fill: var(--chart-paid); }
.grafikon .stub-ceka { fill: var(--chart-wait); }
.grafikon .pogodak { fill: transparent; cursor: pointer; }
.grafikon .pogodak:hover + g .stub-istak, .grafikon g.aktivan .stub-istak { opacity: 1; }
.grafikon .stub-istak { fill: var(--ink); opacity: 0; }
.grafikon .tekuci text.mesec { fill: var(--ink); font-weight: 600; }
.grafikon .oznaka-vrednosti { fill: var(--ink-2); font-weight: 500; font-size: 11px; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 16px 14px; font-size: 13px; color: var(--ink-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.grafikon-info {
  position: absolute; z-index: 5; pointer-events: none;
  min-width: 170px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow); font-size: 13px;
}
.grafikon-info strong { display: block; margin-bottom: 6px; }
.grafikon-info div { display: flex; justify-content: space-between; gap: 16px; }
.grafikon-info div span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); }
.grafikon-info i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.meseci-tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.meseci-tabela th { text-align: right; font-weight: 500; font-size: 12.5px; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); }
.meseci-tabela th:first-child, .meseci-tabela td:first-child { text-align: left; }
.meseci-tabela td { text-align: right; padding: 11px 16px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.meseci-tabela tr:last-child td { border-bottom: 0; }
.meseci-tabela tr.tekuci td:first-child { font-weight: 600; }
.meseci-tabela .ceka { color: var(--orange); }
.meseci-tabela .nula { color: var(--ink-3); }
@media (max-width: 480px) { .meseci-tabela th, .meseci-tabela td { padding: 10px 10px; } .meseci-tabela td:first-child, .meseci-tabela th:first-child { padding-left: 16px; } }

/* ---------- uvoz ---------- */

/* telefon uvećava stranicu kad polje ima slova manja od 16px, zato su polja 16px */
.uvoz-polje { font-family: var(--mono); font-size: 16px !important; min-height: 240px !important; line-height: 1.5; tab-size: 2; }
.uvoz-dugmad { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.uvoz-dugmad .btn-primary { margin-left: auto; }
@media (max-width: 560px) { .uvoz-dugmad .btn-primary { margin-left: 0; width: 100%; order: -1; } }
.uvoz-blok + .uvoz-blok { border-top: 1px solid var(--line); }
.uvoz-blok-zaglavlje { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.uvoz-blok-zaglavlje h3 { font-size: 15px; }
.uvoz-stavka { display: flex; gap: 10px; padding: 8px 16px; font-size: 14px; }
.uvoz-stavka .ico { width: 15px; height: 15px; margin-top: 3px; color: var(--accent); }
.uvoz-stavka .vrsta { color: var(--ink-3); font-size: 12.5px; display: block; }
.uvoz-greske { margin: 0; padding: 12px 16px 12px 36px; color: var(--red); font-size: 14px; background: var(--red-soft); }
.uvoz-greske li + li { margin-top: 4px; }
.uvoz-upozorenja { margin: 0; padding: 10px 16px 10px 36px; color: var(--orange); font-size: 13px; }
.uvoz-potvrda { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--line); }

.uputstvo { font-size: 14px; color: var(--ink-2); }
.uputstvo p + p { margin-top: 8px; }
.uputstvo code { font-family: var(--mono); font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink); }

/* ---------- pomoćno ---------- */

.razdvoj { display: flex; flex-wrap: wrap; gap: 6px; }
.skriveno-na-telefonu { display: none; }
@media (min-width: 720px) { .skriveno-na-telefonu { display: initial; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* paneli kao direktna deca mreže ne dobijaju gornji razmak */
.dve-kolone > .panel + .panel { margin-top: 0; }

@media (min-width: 1024px) {
  .uvoz-polje { font-size: 13px !important; }
  .filteri select.unos { font-size: 14px; }
}
