/* Dugovanja — tamni stakleni izgled (Troskovi Market v4) */
:root {
  --bg: #18191c;
  --fg: #f4f4f5;
  --muted: #8b8b94;
  --muted2: #a1a1aa;
  --soft: #d4d4d8;
  --red: #ef4444; --red-fg: #fca5a5; --red-bg: rgba(239,68,68,0.16);
  --amber: #f5b428; --amber-fg: #fcd34d; --amber-bg: rgba(245,180,40,0.16);
  --open-fg: #e4e4e7; --open-bg: rgba(255,255,255,0.1); --open-solid: rgba(255,255,255,0.6);
  --paid-fg: #a1a1aa; --paid-bg: rgba(255,255,255,0.05); --paid-solid: #4ade80;
  --glass-border: 1px solid rgba(255,255,255,0.09);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.25);
}
* { box-sizing: border-box }
html { color-scheme: dark }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased }
a { color: var(--fg); text-decoration: none }
input, select, button { font: inherit }
button { margin: 0 }
form { margin: 0 }
[x-cloak] { display: none !important }
.tnum { font-variant-numeric: tabular-nums }
.nowrap { white-space: nowrap }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.muted { color: var(--muted) }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0 }
.dot.sm { width: 7px; height: 7px }
.dot.glow { box-shadow: 0 0 10px currentColor }
.bg-kasni { background: var(--red); color: var(--red) }
.bg-uskoro { background: var(--amber); color: var(--amber) }
.bg-otvoreno { background: var(--open-solid) }
.bg-placeno { background: var(--paid-solid) }
.fg-kasni { color: var(--red-fg) }
.fg-uskoro { color: var(--amber-fg) }
.fg-otvoreno { color: var(--muted2) }
.fg-placeno { color: #86efac }
.fg-soft { color: var(--soft) }

.shell { min-height: 100vh; position: relative; isolation: isolate; display: flex }
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(640px 420px at 12% 8%, rgba(255,255,255,0.08), transparent 70%), radial-gradient(520px 520px at 88% 28%, rgba(170,180,200,0.09), transparent 70%), radial-gradient(760px 420px at 50% 105%, rgba(255,255,255,0.06), transparent 70%) }
.glass { background: rgba(255,255,255,0.055); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%); border: var(--glass-border); box-shadow: var(--glass-shadow) }

/* Dugmad */
.btn { height: 36px; padding: 0 14px; border-radius: 12px; cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center }
.btn-primary { border: none; background: var(--fg); color: #18181b; font-weight: 700 }
.btn-primary:hover { background: #fff }
.btn-ghost { border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: var(--fg) }
.btn-ghost:hover { background: rgba(255,255,255,0.1) }
.btn-lg { height: 42px; padding: 0 18px; border-radius: 14px; font-size: 14px }
.btn-xl { height: 44px; padding: 0 18px }
.link-btn { background: none; border: none; padding: 0; color: inherit; cursor: pointer; font: inherit }

/* Bočni meni */
.sidebar { width: 272px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; padding: 14px 0 14px 14px }
.sidebar-card { height: 100%; display: flex; flex-direction: column; background: rgba(255,255,255,0.05); backdrop-filter: blur(28px) saturate(140%); -webkit-backdrop-filter: blur(28px) saturate(140%); border: var(--glass-border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 20px 50px rgba(0,0,0,0.3); border-radius: 24px; overflow: hidden }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px }
.logo { width: 34px; height: 34px; border-radius: 11px; background: var(--fg); display: flex; align-items: center; justify-content: center; flex-shrink: 0 }
.logo::after { content: ''; width: 13px; height: 13px; border-radius: 4px; background: var(--bg) }
.logo.sm { width: 32px; height: 32px; border-radius: 9px }
.logo.sm::after { width: 12px; height: 12px; border-radius: 3px }
.brand-title { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; line-height: 1.2 }
.brand-sub { font-size: 11.5px; color: var(--muted) }
.nav-home-wrap { padding: 0 12px 12px; border-bottom: 1px solid rgba(255,255,255,0.07) }
.nav-home { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; font-weight: 700; font-size: 14px; color: var(--soft) }
.nav-home.active { background: var(--fg); color: #18181b }
.nav-home:not(.active):hover { background: rgba(255,255,255,0.06) }
.nav-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; color: #18181b; background: var(--amber) }
.nav-badge.has-over { background: var(--red) }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted) }
.icon-plus { width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,0.08); border: none; color: var(--fg); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1; padding: 0 }
.icon-plus:hover { background: rgba(255,255,255,0.16) }
.side-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 0 10px 10px }
.side-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; font-size: 13.5px; font-weight: 500; color: var(--soft) }
.side-item:hover { background: rgba(255,255,255,0.06) }
.side-item.active { background: rgba(255,255,255,0.1); color: var(--fg); font-weight: 700 }
.side-avatar { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800 }
.side-item.active .side-avatar { background: var(--fg) !important; color: #18181b !important }
.side-amt { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted) }
.side-foot { margin: 0 12px 12px; padding: 14px; border-radius: 18px; background: rgba(0,0,0,0.22); border: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; gap: 10px }
.side-foot-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px }
.side-foot-row > div:first-child { display: flex; align-items: center; gap: 7px; font-weight: 700 }
.side-foot-row > div:last-child { font-weight: 800; font-variant-numeric: tabular-nums }
.side-foot .btn-primary { height: 42px; margin-top: 2px; font-size: 14px }
.side-logout { padding: 0 20px 14px; font-size: 12px; color: var(--muted) }
.side-logout button:hover { text-decoration: underline }

/* Avatari po statusu */
.av-kasni { background: var(--red-bg); color: var(--red-fg) }
.av-uskoro { background: var(--amber-bg); color: var(--amber-fg) }
.av-otvoreno { background: var(--open-bg); color: var(--open-fg) }
.av-placeno { background: var(--paid-bg); color: var(--paid-fg) }

/* Zaglavlje */
.main { flex: 1; min-width: 0 }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(24,25,28,0.55); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid rgba(255,255,255,0.06) }
.head-row { max-width: 1360px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted2); min-width: 0 }
.crumbs a { color: var(--muted2); font-weight: 600 }
.crumbs strong { color: var(--fg); font-weight: 700; white-space: nowrap }
.spacer { flex: 1 }
.pills { display: flex; gap: 8px }
.pill-alert { flex-shrink: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap }
.pill-alert.kasni { background: rgba(239,68,68,0.14); border: 1px solid rgba(239,68,68,0.3); color: var(--red-fg) }
.pill-alert.uskoro { background: rgba(245,180,40,0.12); border: 1px solid rgba(245,180,40,0.3); color: var(--amber-fg) }
.only-compact, .only-mobile { display: none !important }

.content { max-width: 1360px; margin: 0 auto; padding: 22px 24px 48px }

/* Pregled: gornji red */
.top-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 16px; margin-bottom: 22px }
.hero { border-radius: 24px; padding: 26px 28px; display: flex; flex-direction: column; gap: 20px; min-width: 0 }
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap }
.label { font-size: 13.5px; color: var(--muted2); font-weight: 600 }
.big { font-size: 46px; font-weight: 800; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 8px }
.big .cur { font-size: 20px; color: var(--muted); font-weight: 700; margin-left: 8px; letter-spacing: 0 }
.chip-info { font-size: 12.5px; color: var(--muted2); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); padding: 6px 12px; border-radius: 999px; font-weight: 600 }
.segs { display: flex; gap: 4px; height: 12px }
.segs.md { height: 10px }
.segs.sm { gap: 3px; height: 6px }
.seg { border-radius: 999px; min-width: 6px }
.seg-kasni { background: var(--red); box-shadow: 0 0 12px rgba(239,68,68,0.4) }
.seg-uskoro { background: var(--amber); box-shadow: 0 0 12px rgba(245,180,40,0.4) }
.seg-otvoreno { background: rgba(255,255,255,0.55) }
.seg-empty { background: rgba(74,222,128,0.35); flex: 1 }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px }
.legend > div { display: flex; flex-direction: column; gap: 4px }
.legend-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700 }
.legend-v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap }

.chart { border-radius: 24px; padding: 22px 22px 18px; min-width: 0; display: flex; flex-direction: column }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px }
.card-title { font-weight: 700; font-size: 16px }
.card-sub { font-size: 12.5px; color: var(--muted) }
.tl { flex: 1; display: flex; gap: 5px; align-items: stretch; min-height: 170px }
.tl-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; color: inherit }
.tl-col.has { cursor: pointer }
.tl-col.over { flex: 1.9; margin-right: 6px; padding-right: 8px; border-right: 1px dashed rgba(255,255,255,0.12) }
.tl-amt { font-size: 10.5px; font-weight: 700; color: var(--soft); white-space: nowrap; writing-mode: vertical-rl; transform: rotate(180deg); height: 38px; overflow: hidden; display: flex; align-items: center; justify-content: flex-start; line-height: 1 }
.tl-barwrap { flex: 1; display: flex; align-items: flex-end; width: 100% }
.tl-bar { width: 100%; height: 4px; border-radius: 8px; background: rgba(255,255,255,0.07) }
.tl-bar.t-kasni { background: var(--red); box-shadow: 0 0 16px rgba(239,68,68,0.33) }
.tl-bar.t-uskoro { background: var(--amber); box-shadow: 0 0 16px rgba(245,180,40,0.33) }
.tl-bar.t-otvoreno { background: rgba(255,255,255,0.6) }
.tl-day { font-size: 12px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; color: var(--fg); border-radius: 7px; padding: 2px 0; width: 100% }
.tl-col.over .tl-day { color: var(--red-fg) }
.tl-col.today .tl-day { color: #18181b; background: var(--fg) }
.tl-wd { font-size: 10px; color: #b4b4bc; font-weight: 600; text-align: center; width: 100%; overflow: hidden; white-space: nowrap }
.tl-days-m { display: none }

/* Pregled: kartice dobavljača + panel */
.main-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px }
.chips { display: flex; gap: 6px; flex-wrap: wrap }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; display: flex; align-items: center; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; background: rgba(255,255,255,0.06); color: var(--soft); border: 1px solid rgba(255,255,255,0.1) }
.chip.on { background: var(--fg); color: #18181b; border-color: var(--fg) }
.chip span { opacity: 0.6; margin-left: 6px }
.chip.dashed { border: 1px dashed rgba(255,255,255,0.25); background: transparent; color: var(--fg) }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; width: 240px; max-width: 100% }
.search::before { content: ''; width: 11px; height: 11px; border: 2px solid var(--muted); border-radius: 50%; flex-shrink: 0 }
.search input { border: none; outline: none; background: transparent; flex: 1; min-width: 0; font-size: 13.5px; color: var(--fg) }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 14px }
.tile { border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform .15s, border-color .15s; color: inherit }
.tile:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.2) !important }
.tile.st-kasni { background: radial-gradient(260px 140px at 100% 0%, rgba(239,68,68,0.18), transparent 70%), rgba(255,255,255,0.055); border: 1px solid rgba(239,68,68,0.35) }
.tile.st-uskoro { background: radial-gradient(260px 140px at 100% 0%, rgba(245,180,40,0.15), transparent 70%), rgba(255,255,255,0.055); border: 1px solid rgba(245,180,40,0.3) }
.tile.st-placeno { opacity: 0.72 }
.tile-head { display: flex; align-items: center; gap: 12px }
.avatar { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800 }
.avatar.av-placeno { color: var(--soft) }
.tile-name { font-weight: 700; font-size: 15px }
.tile-status { font-size: 12px; font-weight: 600; margin-top: 2px }
.tile-amt { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap }
.tile-amt span, .sup-amt span { font-size: 12px; color: var(--muted); margin-left: 5px; font-weight: 700; letter-spacing: 0 }
.tile-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px }
.tile-foot > div:last-child { font-weight: 700; white-space: nowrap }
.empty { padding: 40px; text-align: center; color: var(--muted); font-size: 14px }

.panel { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; min-width: 0 }
.panel-card { border-radius: 22px; overflow: hidden }
.panel-head { padding: 18px 18px 12px; display: flex; justify-content: space-between; align-items: center }
.count-badge { min-width: 30px; height: 30px; padding: 0 9px; border-radius: 999px; background: rgba(245,180,40,0.16); color: var(--amber-fg); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center }
.alerts { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px }
.alert { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,0.04); color: inherit }
.alert:hover { background: rgba(255,255,255,0.08) }
.alert-badge { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: rgba(245,180,40,0.16); color: var(--amber-fg) }
.alert-badge.kasni { background: rgba(239,68,68,0.18); color: var(--red-fg) }
.alert-badge b { font-size: 15px; font-weight: 800; line-height: 1 }
.alert-badge small { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em }
.alert-sup { font-weight: 700; font-size: 14px }
.alert-meta { font-size: 12px; color: var(--muted); margin-top: 2px }
.alert-amt { font-weight: 800; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap }
.panel-note { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; padding: 0 6px }
.panel-note button { text-decoration: underline }

/* Strana dobavljača */
.sup-hero { border-radius: 24px; padding: 26px 28px; display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; margin-bottom: 16px }
.sup-id { display: flex; align-items: center; gap: 18px; flex: 1 1 320px; min-width: 0 }
.sup-avatar { width: 76px; height: 76px; border-radius: 22px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.16); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; flex-shrink: 0 }
.sup-name { font-size: 30px; font-weight: 800; letter-spacing: -0.03em }
.status-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap }
.sup-meta { font-size: 13.5px; color: var(--muted2); margin-top: 6px }
.sup-debt { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px }
.sup-amt { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap }
.sup-amt span { font-size: 15px; margin-left: 6px }
.sup-legend { display: flex; gap: 8px 22px; flex-wrap: wrap; font-size: 12.5px; font-weight: 600 }
.sup-legend > div { display: flex; align-items: center; gap: 7px }
.sup-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 18px; align-items: start }
.inv-col { min-width: 0; display: flex; flex-direction: column; gap: 18px }
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.inv-title { font-weight: 700; font-size: 17px }
.inv-title span { color: var(--muted); font-weight: 500; font-size: 13.5px }
.switch-wrap { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--muted2); user-select: none; font-weight: 600; background: none; border: none; padding: 0 }
.switch { width: 36px; height: 21px; border-radius: 999px; background: rgba(255,255,255,0.16); position: relative; transition: background .15s }
.switch::after { content: ''; position: absolute; top: 2.5px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s, background .15s }
.switch.on { background: var(--fg) }
.switch.on::after { left: 17px; background: var(--bg) }
.group { display: flex; flex-direction: column; gap: 10px }
.group-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted2) }
.group-h span { color: #5a5a62 }
.inv { border-radius: 20px; overflow: hidden }
.inv.st-kasni { border: 1px solid rgba(239,68,68,0.35) }
.inv.st-uskoro { border: 1px solid rgba(245,180,40,0.3) }
.inv.st-placeno { opacity: 0.75 }
.inv-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 16px 18px; cursor: pointer }
.date-block { width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.08) }
.date-block b { font-size: 22px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums }
.date-block small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px }
.date-block.av-otvoreno, .date-block.av-placeno { color: var(--fg) }
.inv-mid { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 8px }
.inv-mid-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap }
.inv-no { font-weight: 700; font-size: 14.5px }
.inv-no span { color: var(--muted); font-weight: 500; font-size: 12.5px; margin-left: 4px }
.inv-days { font-size: 12.5px; font-weight: 700; white-space: nowrap }
.progress { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.08); overflow: hidden }
.progress > div { height: 100%; border-radius: 999px; background: var(--fg) }
.inv.st-placeno .progress > div { background: #4ade80 }
.inv-paid { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums }
.inv-right { display: flex; align-items: center; gap: 14px; margin-left: auto }
.inv-rem { text-align: right }
.inv-rem small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600 }
.inv-rem b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap }
.btn-pay { height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.08); color: var(--fg); cursor: pointer; font-size: 13px; font-weight: 700 }
.btn-pay:hover { background: var(--fg); color: #18181b }
.inv-detail { margin: 0 18px 16px; padding: 10px 14px 12px; background: rgba(0,0,0,0.18); border-radius: 14px }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; font-variant-numeric: tabular-nums }
.pay-row .dot { width: 6px; height: 6px; background: #4ade80 }
.pay-row b { font-weight: 700 }
.pay-del { color: var(--muted); font-size: 12px; text-decoration: underline }
.inv-detail-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 10px; font-size: 12.5px }
.danger-link { color: var(--red-fg); font-size: 12.5px; font-weight: 700 }
.empty-box { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed rgba(255,255,255,0.12); border-radius: 18px }

.side-col { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.contacts-card { border-radius: 22px; overflow: hidden }
.contacts-head { padding: 16px 18px 8px; display: flex; justify-content: space-between; align-items: center }
.chip-add { cursor: pointer; font-size: 12.5px; font-weight: 700; background: rgba(255,255,255,0.09); padding: 5px 11px; border-radius: 999px; border: none; color: var(--fg) }
.contact { padding: 10px; display: flex; gap: 12px; align-items: center; border-radius: 14px }
.contact:hover { background: rgba(255,255,255,0.05) }
.contact-av { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0 }
.contact-name { font-weight: 700; font-size: 14px }
.contact-role { font-size: 12px; color: var(--muted) }
.tel { height: 32px; padding: 0 12px; border-radius: 10px; background: var(--fg); color: #18181b; font-size: 12.5px; font-weight: 700; display: flex; align-items: center; white-space: nowrap }
.x-btn { color: var(--muted); font-size: 18px; line-height: 1; padding: 2px }
.facts { border-radius: 22px; padding: 6px 18px; box-shadow: none }
.fact { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 13.5px }
.fact:last-child { border-bottom: none }
.fact > div:first-child { color: var(--muted2) }
.fact > div:last-child { font-weight: 600 }
.subtle-link { font-size: 12.5px; color: var(--muted); text-decoration: underline; padding: 0 6px; align-self: flex-start }

/* Modal */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; padding: 16px }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: rgba(38,39,44,0.85); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); border: 1px solid rgba(255,255,255,0.12); border-radius: 22px; box-shadow: 0 24px 60px rgba(0,0,0,0.5); padding: 22px }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px }
.modal-title { font-size: 18px; font-weight: 800 }
.modal-x { font-size: 22px; line-height: 1; color: var(--muted) }
.fields { display: flex; flex-direction: column; gap: 14px }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted2); font-weight: 600 }
.field input, .field select { height: 44px; padding: 0 12px; border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--fg); font-size: 15px; min-width: 0; width: 100% }
.field select { padding: 0 10px }
.field select option { background: #26272c }
.field input:focus, .field select:focus { outline: 2px solid rgba(255,255,255,0.25); outline-offset: 0 }
.row2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px }
.row2.wide { grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) }
.due-preview { background: rgba(255,255,255,0.09); border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; justify-content: space-between; gap: 8px }
.due-preview > div:first-child { color: var(--soft) }
.due-preview > div:last-child { font-weight: 800 }
.pay-info { background: rgba(255,255,255,0.06); border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 4px }
.pay-info > div:last-child { color: var(--muted2); font-size: 13px }
.pay-info b { color: var(--fg) }
.fill-full { font-size: 13px; font-weight: 700; text-decoration: underline; align-self: flex-start }
.form-err { font-size: 13px; color: var(--red-fg); font-weight: 600 }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px }

/* Prijava */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px }
.login { width: 100%; max-width: 380px; border-radius: 24px; padding: 28px }
.login .brand { padding: 0 0 22px }
.login .btn-primary { width: 100%; height: 44px; font-size: 14px; margin-top: 4px }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted2) }

/* Srednje širine: panel ide iznad liste, kontakti ispod faktura */
@media (max-width: 1379px) {
  .main-grid, .sup-grid { grid-template-columns: minmax(0,1fr) }
  .panel { position: static; order: -1 }
}
/* Bez bočnog menija */
@media (max-width: 1099px) {
  .sidebar { display: none }
  .only-compact { display: flex !important }
}
/* Telefon */
@media (max-width: 759px) {
  .head-row { padding: 10px 16px; gap: 8px 10px }
  .pills { order: 10; width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none }
  .pills::-webkit-scrollbar { display: none }
  .not-mobile { display: none !important }
  .only-mobile { display: flex !important }
  .top-grid { grid-template-columns: minmax(0,1fr) }
  .tl-col.far { display: none }
  .tl-days-d { display: none }
  .tl-days-m { display: inline }
}
