@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #232427;
  --surface: #2E3034;
  --raised: #3A3D42;
  --line: #44474D;
  --text: #EDEDEA;
  --muted: #9A9CA1;
  --faint: #6E7177;
  --accent: #FFD334;
  --accent-soft: rgba(255, 211, 52, .14);
  --on-accent: #232427;
  --good: #7BD88F;
  --cool: #FF9F43;
  --occasional: #F2C94C;
  --bad: #FF6B5A;
  --never: #8C9096;
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --nav-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 17px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack > * + * { margin-top: 12px; }

/* ===== App shell ===== */
#app { min-height: 100%; }
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 500; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px;
  background: rgba(35, 36, 39, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .mark { width: 28px; height: 28px; flex: none; }
.topbar .title { font-weight: 800; font-size: 17px; flex: 1; min-width: 0; }
.topbar .back { width: 36px; height: 36px; border: 0; background: none; display: grid; place-items: center; margin-left: -8px; border-radius: 50%; }
.topbar .back:active { background: var(--raised); }
.scope {
  display: flex; align-items: center; gap: 6px; max-width: 46vw;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 650;
}
.scope select { background: transparent; border: 0; outline: 0; max-width: 34vw; font-weight: 650; }
.scope select option { background: var(--surface); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--raised); color: var(--accent); font-weight: 800; font-size: 13px; border: 1px solid var(--line);
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

main.page { padding: 14px 14px 28px; max-width: 1180px; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #1E1F22; border-top: 1px solid var(--line);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 650; color: var(--muted); position: relative; }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--accent); }
.bottomnav a.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.badge-dot { position: absolute; top: 9px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }

/* Tabovi grupe (npr. Kupci: Spisak · Mapa · Target kupci) — jasno odvojeni, aktivni u boji */
/* Posebna traka (tamnija od stranice) sa uokvirenim blokom tabova — ne liči na filtere na stranici. */
.gtabs { position: sticky; top: var(--top-h); z-index: 450; background: #1B1C1F; border-bottom: 1px solid var(--line); box-shadow: 0 6px 14px rgba(0, 0, 0, .25); }
.gtabs.hidden { display: none; }
.gtabs-in { max-width: 1180px; margin: 0 auto; padding: 10px 14px; display: flex; align-items: center; gap: 14px; overflow-x: auto; scrollbar-width: none; }
.gtabs-in::-webkit-scrollbar { display: none; }
.gtabs-title { display: none; font-size: 18px; font-weight: 800; color: var(--text); white-space: nowrap; }
.gtabs-seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); flex: none; }
.gtabs a { flex: none; display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 18px; border-radius: 10px; color: var(--muted); font-weight: 800; font-size: 15px; white-space: nowrap; transition: background .15s, color .15s; }
.gtabs a svg { width: 19px; height: 19px; }
.gtabs a:hover { color: var(--text); background: var(--raised); }
.gtabs a.on { background: var(--accent); color: #1E1F22; box-shadow: 0 2px 12px rgba(255, 211, 52, .3); }
.has-gtabs .map-page { top: calc(var(--top-h) + 73px); }
@media (min-width: 900px) {
  .gtabs-in { padding: 12px 28px; }
  .has-gtabs .map-page { top: calc(var(--top-h) + 77px); }
  .gtabs-title { display: inline-block; }
}
.siderail { display: none; }
@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 232px; }
  .bottomnav { display: none; }
  .siderail {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: 232px; z-index: 600;
    background: #1E1F22; border-right: 1px solid var(--line); padding: 18px 12px;
  }
  .siderail .brand { padding: 4px 8px 22px; }
  .siderail a.brand svg { width: 100%; height: auto; }
  .siderail a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); color: var(--muted); font-weight: 650; }
  .siderail a svg { width: 20px; height: 20px; }
  .siderail a:hover { background: var(--surface); color: var(--text); }
  .siderail a.on { background: var(--accent-soft); color: var(--accent); }
  .siderail .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .siderail .me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px 8px; }
  main.page { padding: 22px 28px 40px; }
  .topbar .mark { display: none; }
}

/* ===== Surfaces ===== */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-h a { font-size: 13px; color: var(--accent); font-weight: 700; }
.section { margin-top: 22px; }
.section > h2 { margin-bottom: 10px; }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid.four { grid-template-columns: repeat(4, 1fr); } }

/* Glavni pokazatelj tempa */
.hero-pace { position: relative; overflow: hidden; }
.hero-pace .big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.hero-pace .big small { font-size: 18px; font-weight: 700; color: var(--muted); margin-left: 4px; }
.hero-pace .verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.verdict.ok { background: rgba(123, 216, 143, .14); color: var(--good); }
.verdict.warn { background: rgba(255, 159, 67, .14); color: var(--cool); }
.verdict.bad { background: rgba(255, 107, 90, .14); color: var(--bad); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 16px; }
.kv .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv .v { font-size: 17px; font-weight: 750; }
@media (min-width: 700px) { .kv.four { grid-template-columns: repeat(4, 1fr); } }

/* Progres ka prošlogodišnjem prometu */
.meter { position: relative; height: 10px; border-radius: 5px; background: var(--raised); margin-top: 14px; }
.meter .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--accent); }
.meter .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); border-radius: 1px; }
.meter-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ===== Liste ===== */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); min-height: 60px; }
.item:first-child { border-top: 0; }
a.item:active, button.item:active { background: var(--raised); }
@media (hover: hover) { a.item:hover { background: #33353A; } }
.item .main { flex: 1; min-width: 0; }
.item .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .end { text-align: right; flex: none; }
.item .end .v { font-weight: 750; }
button.item { width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty b { color: var(--text); display: block; margin-bottom: 4px; }

/* Status segmenti — uvek uz tekst, nikad samo boja */
.seg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.seg::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.seg.aktivan { color: var(--good); } .seg.hladi { color: var(--occasional); } .seg.uspavan { color: var(--bad); } .seg.nikad { color: var(--never); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--raised); color: var(--muted); white-space: nowrap; }
/* Šifra kupca uz naziv; „nije otvoren“ = firma još nema šifru u knjigovodstvu */
/* Šifra kupca: samo broj, bela slova na nešto tamnijoj sivoj — čitko, ali mirno */
.ccode { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, .28); color: #E9E9E6; font-size: 12.5px; font-weight: 700; line-height: 18px; letter-spacing: .02em; font-variant-numeric: tabular-nums; vertical-align: 1px; white-space: nowrap; }
.ccode.no { background: rgba(255, 159, 67, .14); color: var(--cool); font-weight: 800; font-size: 12px; }
/* Dodela gradova komercijalistima */
details.region-box > summary::-webkit-details-marker { display: none; }
details.region-box[open] .t svg { transform: rotate(180deg); }
details.region-box .t svg { width: 16px; height: 16px; vertical-align: -3px; transition: transform .15s; }
.city-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.city-list { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.city-row { display: grid; grid-template-columns: 24px minmax(120px, 1.2fr) 52px 2fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.city-row:last-child { border-bottom: 0; }
.city-row:hover { background: var(--raised); }
.city-row.on { background: var(--accent-soft); }
.city-row input { width: 18px; height: 18px; accent-color: #FFD334; }
.city-row .c-n { text-align: right; font-weight: 800; }
.city-row .c-reps { display: flex; flex-wrap: wrap; gap: 4px; }
.city-row .c-rule { display: flex; gap: 6px; align-items: center; justify-self: end; }
.linkbtn { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0; }
@media (max-width: 640px) { .city-row { grid-template-columns: 24px 1fr 44px; } .city-row .c-reps, .city-row .c-rule { grid-column: 2 / -1; justify-self: start; } }
.code-box { padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; border: 1px dashed var(--cool); background: rgba(255, 159, 67, .06); }
h1 .ccode { font-size: 14px; line-height: 21px; vertical-align: 4px; }
.route-locked { border-left: 4px solid var(--accent); }
/* Zvonce: ruti je prošao datum, a nije zaključana */
.nav-bell { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 800; }
.nav-bell svg { width: 12px !important; height: 12px !important; }
.bottomnav .nav-bell { position: absolute; top: 5px; right: calc(50% - 26px); margin: 0; padding: 0 5px; font-size: 10px; }
.route-card.overdue { box-shadow: inset 4px 0 0 var(--bad); }
.overdue-note { display: flex; align-items: center; gap: 6px; color: var(--bad); font-weight: 800; font-size: 12.5px; margin-bottom: 4px; }
.overdue-note svg { width: 15px; height: 15px; animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.overdue-panel { border-left: 4px solid var(--bad); }
.bell-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 7px; border-radius: 6px; background: var(--bad); color: #fff; vertical-align: -4px; }
.bell-ic svg { width: 14px; height: 14px; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 89% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .overdue-note svg { animation: none; } }
/* Zaključana ruta u listi: katanac uz naziv i žuta oznaka */
.route-card.locked { box-shadow: inset 4px 0 0 var(--accent); }
.lock-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 7px; border-radius: 6px; background: var(--accent); color: #1E1F22; vertical-align: -4px; }
.lock-ic svg { width: 14px; height: 14px; }
.tag.lock-tag { background: var(--accent); color: #1E1F22; font-weight: 800; }
.tag.lock-tag svg { width: 12px; height: 12px; }
/* Fakture: zbir filtera i lista koja se otvara */
.inv-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.inv-sum .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.inv-sum .v { font-size: 20px; font-weight: 800; }
@media (max-width: 640px) { .inv-sum { grid-template-columns: repeat(2, 1fr); } }
details.inv > summary::-webkit-details-marker { display: none; }
details.inv[open] { background: var(--raised); }
details.inv .t a { color: inherit; }
details.inv .inv-lines { margin-top: 10px; }
/* Uplate */
.pay-sum { display: grid; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); margin-bottom: 14px; }
.pay-sum > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pay-sum > div span { color: var(--muted); }
/* Dugovanja: kašnjenje preko valute kao obojena oznaka (zeleno → tamnocrveno) */
.late-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; color: #fff; }
.late-pill.ok { background: rgba(46, 158, 106, .18); color: var(--good); }
.late-pill.l1 { background: #D9A30F; } .late-pill.l2 { background: #E07A22; } .late-pill.l3 { background: #D0453A; } .late-pill.l4 { background: #8E2424; }
.debt-row .t { font-weight: 800; color: inherit; }
.debt-inv { margin-top: 10px; }
[data-det] button { white-space: nowrap; padding-inline: 12px; }
.debt-tile { border-left: 4px solid var(--bad); }
.debt-tile.soon { border-left-color: var(--cool); }
.imp-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 12px; }
.table .imp-used { background: rgba(255, 211, 52, .12); }
th.imp-used { color: var(--accent); }
.pay-list { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 6px; }
.tag.bad { background: rgba(255, 107, 90, .16); color: var(--bad); }
.tag.good { background: rgba(123, 216, 143, .14); color: var(--good); }
.tag.acc { background: var(--accent-soft); color: var(--accent); }
.tag.cool { background: rgba(255, 159, 67, .15); color: var(--cool); }

/* Mala traka tempa u redu kupca */
.minibar { width: 72px; height: 5px; border-radius: 3px; background: var(--raised); position: relative; margin: 6px 0 0 auto; }
.minibar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.minibar i.low { background: var(--bad); }

/* ===== Kontrole ===== */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip .n { opacity: .7; margin-left: 4px; }

.search { position: relative; margin-bottom: 10px; }
.search input { width: 100%; height: 46px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); padding: 0 14px 0 42px; font-size: 16px; }
.search svg { position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--raised); font-weight: 750; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; }
.iconbtn svg { width: 18px; height: 18px; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 5px; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 44px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; font-size: 16px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field select option { background: var(--surface); }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.seg-ctl { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; margin-bottom: 12px; }
.seg-ctl button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 7px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg-ctl button.on { background: var(--raised); color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px -14px 14px; padding: 0 14px; overflow-x: auto; scrollbar-width: none; position: sticky; top: var(--top-h); background: var(--bg); z-index: 50; }
.tabs button { flex: none; background: none; border: 0; padding: 12px 12px; font-weight: 750; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent); border-color: var(--accent); }

/* ===== Bottom sheet / modal ===== */
.sheet-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(18px + var(--safe-b)); border: 1px solid var(--line); animation: rise .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin-bottom: 14px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .actions .btn { flex: 1; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); transform: translateX(-50%); z-index: 2000; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); animation: rise .2s ease; max-width: 90vw; }
.toast.err { background: var(--bad); color: #fff; }

.loader { display: grid; place-items: center; padding: 60px 0; }
.loader svg { width: 42px; height: 42px; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Grafikoni ===== */
.chart { width: 100%; display: block; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .axis-t { fill: var(--muted); font-size: 11px; }
.chart .lbl { fill: var(--text); font-size: 11.5px; font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart-wrap { position: relative; }
.tip { position: absolute; pointer-events: none; background: #1E1F22; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; white-space: nowrap; z-index: 5; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.tip b { display: block; margin-bottom: 2px; }

.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.hbar:first-child { border-top: 0; }
.hbar .bar { grid-column: 1 / -1; height: 6px; background: var(--raised); border-radius: 3px; position: relative; }
.hbar .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.hbar .bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table .r { text-align: right; }
.table-scroll { overflow-x: auto; }

/* ===== Kupac ===== */
.cust-head { display: flex; gap: 14px; align-items: flex-start; }
.cust-head h1 { font-size: 20px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.quick svg { width: 20px; height: 20px; color: var(--accent); }
.timeline .ev { position: relative; padding: 0 0 16px 22px; }
.timeline .ev::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: -4px; width: 2px; background: var(--line); }
.timeline .ev:last-child::before { display: none; }
.timeline .ev::after { content: ''; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--raised); border: 2px solid var(--muted); }
.timeline .ev.akcija::after { border-color: var(--accent); }
.timeline .ev.izvestaj::after { border-color: var(--good); }
.timeline .ev.done { opacity: .6; }
.timeline .meta { font-size: 12px; color: var(--muted); font-weight: 600; }
.timeline .body { white-space: pre-wrap; margin-top: 2px; }
.check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--accent); background: none; display: grid; place-items: center; flex: none; }
.check.on { background: var(--accent); color: var(--on-accent); }
.check svg { width: 14px; height: 14px; }

/* ===== Mapa ===== */
.map-page { position: fixed; top: var(--top-h); left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); }
@media (min-width: 900px) { .map-page { left: 232px; bottom: 0; } }
.map-page #map { position: absolute; inset: 0; }
.map-ctl { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 450; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.map-ctl .chip { box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.map-legend { position: absolute; left: 10px; bottom: 10px; z-index: 450; background: rgba(35, 36, 39, .92); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font-size: 12px; display: grid; gap: 3px; }
.leaflet-container { background: #1b1c1e; font-family: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 12px 14px; font-size: 13.5px; line-height: 1.4; }
.leaflet-popup-content a.btn { color: var(--on-accent); }
.leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--line); }
.leaflet-control-attribution { background: rgba(35, 36, 39, .7) !important; color: var(--faint) !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.pin-depot { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 0 4px rgba(255, 211, 52, .25); }
.pin-stop { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 2px solid #1E1F22; }
.pin-stop.req { background: var(--cool); }
.map-small { height: 260px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
@media (min-width: 900px) { .map-small { height: 380px; } }

/* ===== Rute ===== */
.cap { height: 14px; border-radius: 7px; background: var(--raised); overflow: hidden; position: relative; }
.cap i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); }
.cap i.over { background: var(--bad); }
.stop { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: start; }
.stop:first-child { border-top: 0; }
.stop .n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; display: grid; place-items: center; font-size: 13px; }
.stop.req .n { background: var(--cool); }
.stop .ord { display: flex; flex-direction: column; gap: 4px; }
.stop .ord button { width: 32px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; }
.stop .ord svg { width: 14px; height: 14px; }
.route-card .date { width: 54px; text-align: center; flex: none; border-radius: var(--r); background: var(--raised); padding: 6px 0; }
.route-card .date b { display: block; font-size: 20px; line-height: 1.1; }
.route-card .date span { font-size: 11px; color: var(--muted); font-weight: 700; }
.route-card.today .date { background: var(--accent); color: var(--on-accent); }
.route-card.today .date span { color: var(--on-accent); }

.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + var(--safe-b)); z-index: 550; height: 54px; padding: 0 20px; border-radius: 27px; background: var(--accent); color: var(--on-accent); border: 0; font-weight: 800; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.fab svg { width: 22px; height: 22px; }
@media (min-width: 900px) { .fab { bottom: 24px; right: 28px; } }

/* ===== Login ===== */
.login { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #34363B 0%, #232427 55%, #1B1C1F 100%); display: flex; flex-direction: column; align-items: center; }
.login .steel { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(100deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px), repeating-linear-gradient(100deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 7px); }
.login .radar { position: absolute; width: 150vmax; height: 150vmax; left: 50%; top: 34%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; transition: opacity 1.2s ease .6s; }
.login.ready .radar { opacity: 1; }
.login .radar .rings { position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 calc(7vmax - 1px), rgba(255, 211, 52, .06) calc(7vmax - 1px) 7vmax); }
.login .radar .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255, 211, 52, .16), rgba(255, 211, 52, 0) 60deg); animation: spin 7s linear infinite; mask: radial-gradient(circle, #000 0 45%, transparent 70%); }
.login .blip { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; animation: blip 7s linear infinite; box-shadow: 0 0 10px var(--accent); }
@keyframes blip { 0%, 100% { opacity: 0; } 3% { opacity: .9; } 25% { opacity: 0; } }
.login .stage { position: relative; z-index: 2; width: 100%; max-width: 400px; padding: 0 22px; display: flex; flex-direction: column; align-items: center; flex: 1; }
.login .logo-wrap { margin-top: 14vh; width: 100%; transition: margin .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1); }
.login.ready .logo-wrap { margin-top: 7vh; transform: scale(.82); }
.login .tagline { height: 20px; margin-top: 6px; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; color: var(--muted); text-align: center; }
.login .tagline .caret { display: inline-block; width: 2px; height: 14px; background: var(--accent); vertical-align: -2px; margin-left: 2px; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.login .panel-login { width: 100%; margin-top: 26px; opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.login.ready .panel-login { opacity: 1; transform: none; }
.login .who { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 18px; }
.login .who .name { font-weight: 800; font-size: 18px; }
.login .who button { background: none; border: 0; color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0 8px; height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); transition: all .15s ease; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-dots.err { animation: shake .4s ease; }
.pin-dots.err i { border-color: var(--bad); background: transparent; }
.pin-dots.ok i { background: var(--good); border-color: var(--good); }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
.login .msg { min-height: 20px; text-align: center; font-size: 13px; font-weight: 650; color: var(--bad); margin-bottom: 8px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button {
  height: 64px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .06); background: rgba(58, 61, 66, .55); backdrop-filter: blur(6px);
  font-size: 26px; font-weight: 700; display: grid; place-items: center; transition: background .1s ease, transform .1s ease;
}
.keypad button:active { background: var(--accent); color: var(--on-accent); transform: scale(.96); }
.keypad button.fn { background: transparent; border-color: transparent; font-size: 15px; color: var(--muted); }
.keypad button.go { background: var(--accent); color: var(--on-accent); }
.keypad button svg { width: 24px; height: 24px; }
.login .email-step .field input { background: rgba(35, 36, 39, .8); height: 52px; }
.login .foot { position: relative; z-index: 2; padding: 16px 0 calc(16px + var(--safe-b)); font-size: 11.5px; color: var(--faint); font-weight: 600; }
.login.leaving { animation: leave .6s cubic-bezier(.6, 0, .4, 1) forwards; }
@keyframes leave { to { opacity: 0; transform: scale(1.06); filter: blur(4px); } }

/* Logo */
.logo { width: 100%; height: auto; display: block; overflow: visible; }
.logo .word { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 64px; letter-spacing: 3px; fill: transparent; stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 260; stroke-dashoffset: 260; }
.logo.play .word { animation: draw 1.5s cubic-bezier(.5, 0, .3, 1) forwards, fillin .6s ease 1.25s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { fill: var(--text); stroke-width: 0; } }
.logo .ret-ring { fill: none; stroke: var(--accent); stroke-width: 6; stroke-dasharray: 150.8; stroke-dashoffset: 150.8; transform-origin: center; transform-box: fill-box; }
.logo .ret-tick { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; opacity: 0; transform-box: fill-box; transform-origin: center; }
.logo .ret-dot { fill: var(--accent); transform-origin: center; transform-box: fill-box; transform: scale(0); }
.logo .ret-g { transform-origin: center; transform-box: fill-box; }
.logo.play .ret-ring { animation: draw .9s cubic-bezier(.5, 0, .3, 1) .5s forwards; }
.logo.play .ret-tick { animation: tick .35s ease-out forwards; }
.logo.play .ret-tick.t1 { animation-delay: 1.15s; } .logo.play .ret-tick.t2 { animation-delay: 1.22s; }
.logo.play .ret-tick.t3 { animation-delay: 1.29s; } .logo.play .ret-tick.t4 { animation-delay: 1.36s; }
.logo.play .ret-g { animation: lock .7s cubic-bezier(.3, 1.6, .5, 1) 1.5s both; }
.logo.play .ret-dot { animation: dot .5s cubic-bezier(.3, 1.8, .5, 1) 1.75s forwards; }
@keyframes tick { from { opacity: 0; transform: scale(1.8); } to { opacity: 1; transform: none; } }
@keyframes lock { 0% { transform: rotate(-35deg); } 100% { transform: rotate(0deg); } }
@keyframes dot { to { transform: scale(1); } }
.logo .sub { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 6.4px; fill: var(--muted); opacity: 0; }
.logo.play .sub { animation: fade-in .8s ease 1.9s forwards; }
@keyframes fade-in { to { opacity: 1; } }
.logo.static .word { fill: var(--text); stroke-width: 0; stroke-dashoffset: 0; }
.logo.static .ret-ring { stroke-dashoffset: 0; } .logo.static .ret-tick, .logo.static .sub { opacity: 1; } .logo.static .ret-dot { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .login .radar .sweep { animation: none; }
}

/* ===== Štampa liste za otpremu ===== */
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  html, body { background: #fff !important; color: #000; font-size: 11px; }
  .no-print, .topbar, .bottomnav, .siderail, .fab, .toast { display: none !important; }
  .shell { padding: 0 !important; }
  main.page { padding: 0; max-width: none; }
  .print-only { display: block; }
  .print-sheet { color: #000; }
  .print-sheet h1 { font-size: 18px; }
  .print-sheet table { width: 100%; border-collapse: collapse; }
  .print-sheet th, .print-sheet td { border: 1px solid #999; padding: 5px 6px; text-align: left; vertical-align: top; }
  .print-sheet th { background: #eee; font-size: 10px; }
  .print-sheet tr { page-break-inside: avoid; }
  .print-sheet .qr svg { width: 74px; height: 74px; }
}
.print-sheet { background: #fff; color: #111; border-radius: var(--r); padding: 18px; }
.print-sheet h1 { font-size: 20px; }
.print-sheet .meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px 18px; margin: 10px 0 14px; font-size: 13px; }
.print-sheet .meta b { display: block; font-size: 11px; color: #666; font-weight: 700; }
.print-sheet table { width: 100%; border-collapse: collapse; font-size: 12px; }
.print-sheet th, .print-sheet td { border: 1px solid #ccc; padding: 6px; text-align: left; vertical-align: top; }
.print-sheet th { background: #f2f2f2; }
.print-sheet .qr svg { width: 84px; height: 84px; display: block; }
.print-sheet .sig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 30px; font-size: 12px; }
.print-sheet .sig div { border-top: 1px solid #333; padding-top: 4px; }

/* Fotografije sa posete */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: var(--raised); flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.thumb .ph { width: 100%; height: 100%; background: linear-gradient(90deg, var(--raised), #45484E, var(--raised)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.thumb .ph.err { animation: none; }
.thumb button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.thumb button svg { width: 13px; height: 13px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Ponuda */
.offer-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 10px; }
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 10px; margin-top: 10px; }
.offer-grid > * > span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.offer-grid input { width: 100%; min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 8px 10px; font-size: 16px; font-variant-numeric: tabular-nums; }
.offer-grid input[readonly] { background: transparent; border-color: transparent; padding-left: 0; font-weight: 750; }
.offer-grid input[data-f="discount"] { border-color: rgba(255, 211, 52, .5); }
.offer-grid b { display: block; padding-top: 10px; font-size: 15px; }
.offer-grid .span2 { grid-column: span 2; }
@media (min-width: 700px) { .offer-grid { grid-template-columns: repeat(5, 1fr); } .offer-grid .span2 { grid-column: auto; } }
.rec-note { margin-top: 8px; color: var(--muted); }
.rec-note button { display: none; background: none; border: 0; color: var(--accent); font-weight: 750; text-decoration: underline; padding: 0 4px; font-size: 12px; }
.rec-note.changed { color: var(--cool); }
.rec-note.changed button { display: inline; }
.offer-total { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 540; display: flex; gap: 14px; align-items: center;
  padding: 10px 14px; background: #1E1F22; border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0, 0, 0, .35); }
.offer-total .btn { height: 52px; }
@media (min-width: 900px) { .offer-total { left: 232px; bottom: 0; padding: 12px 28px; } }
@page offer { size: A4 portrait; margin: 14mm; }
@media print { .offer-doc { page: offer; font-size: 11px; } .offer-doc table { font-size: 10.5px; } }

/* OSM pločice u tamnoj varijanti, da mapa prati temu aplikacije */
.leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.82) contrast(.92) saturate(.35); }

/* Stavke fakture kao u Excelu; naziv ostaje vidljiv dok se tabela pomera na telefonu */
.inv-lines { margin: 10px -4px 0; }
.inv-lines .table { font-size: 12.5px; }
.inv-lines .table td, .inv-lines .table th { padding: 6px 8px; white-space: nowrap; }
.inv-lines .table td.sticky { white-space: normal; min-width: 180px; }
.inv-lines .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.inv-lines tfoot td { border-bottom: 0; }

/* Polje za datum dd.mm.gggg + kalendar */
.datefield { position: relative; display: block; }
.datefield [data-datetext] { width: 100%; padding-right: 44px; }
.datefield-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; border-radius: var(--r-sm); cursor: pointer; }
.datefield-btn:hover { color: var(--accent); }
.datefield-btn svg { width: 20px; height: 20px; }
.cal-pop { position: fixed; z-index: 1500; width: 280px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; box-shadow: 0 12px 36px rgba(0, 0, 0, .5); animation: fade .12s ease; }
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-h b { font-size: 14.5px; }
.cal-h button { width: 34px; height: 34px; border: 0; background: none; color: var(--text); border-radius: var(--r-sm); display: grid; place-items: center; cursor: pointer; }
.cal-h button:hover { background: var(--raised); }
.cal-h svg { width: 18px; height: 18px; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-w span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-g button { height: 34px; border: 0; background: none; color: var(--text); border-radius: var(--r-sm); font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cal-g button:hover { background: var(--raised); }
.cal-g button.tdy { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-g button.sel { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.cal-f { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.cal-f button { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 700; font-size: 13px; padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; }
.cal-f button:hover { background: var(--accent-soft); }

/* Prekidač RSD / kg i podela promene na kilažu i cenu */
.seg-ctl.measure { margin-bottom: 12px; }
.seg-ctl.measure button { padding: 7px 6px; }
.pv { display: grid; gap: 4px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* Udaljenost predloga za obilazak */
.item .dist { flex: none; width: 46px; text-align: center; font-weight: 800; font-size: 15px; color: var(--accent); line-height: 1.1; }
.item .dist small { display: block; font-size: 10px; color: var(--muted); font-weight: 700; }

/* Bonitetna ocena: A–B zelena, C žuta, D crvena, E crna — pune boje, da se vidi na prvi pogled */
.rating { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; line-height: 1.5; border: 1px solid transparent; }
.rating.ok { background: #2FA35A; color: #fff; }
.rating.warn { background: #F2C94C; color: #1E1F22; }
.rating.bad { background: #E5484D; color: #fff; }
.rating.black { background: #000; color: #fff; border-color: #8C9096; }
.rating.none { color: var(--muted); border-color: var(--line); font-weight: 600; }
.rating.lg { font-size: 15px; padding: 5px 14px; }
.head-rating { margin-top: 8px; }
/* Obojena traka po levoj ivici reda i zaglavlja kartice */
.item.rt-ok { box-shadow: inset 5px 0 0 #2FA35A; }
.item.rt-warn { box-shadow: inset 5px 0 0 #F2C94C; }
.item.rt-bad { box-shadow: inset 5px 0 0 #E5484D; }
.item.rt-black { box-shadow: inset 5px 0 0 #000, inset 6px 0 0 #8C9096; }
.cust-head[class*=" rt-"] { border-radius: var(--r-lg); padding: 14px 14px 14px 18px; margin: -4px -4px 0; border: 1px solid var(--line); }
.cust-head.rt-ok { background: linear-gradient(90deg, rgba(47, 163, 90, .22), rgba(47, 163, 90, .04)); border-left: 6px solid #2FA35A; }
.cust-head.rt-warn { background: linear-gradient(90deg, rgba(242, 201, 76, .22), rgba(242, 201, 76, .04)); border-left: 6px solid #F2C94C; }
.cust-head.rt-bad { background: linear-gradient(90deg, rgba(229, 72, 77, .24), rgba(229, 72, 77, .05)); border-left: 6px solid #E5484D; }
.cust-head.rt-black { background: linear-gradient(90deg, rgba(0, 0, 0, .75), rgba(0, 0, 0, .25)); border-left: 6px solid #000; }
.cust-head.rt-none { border-left: 6px solid var(--line); }
@media print { .rating { border: 1px solid #333 !important; background: none !important; color: #000 !important; } .rating.black { background: #000 !important; color: #fff !important; } }
.risk-panel { border-left: 4px solid var(--line); }
.risk-panel.ok { border-left-color: #7BD88F; } .risk-panel.warn { border-left-color: #F2C94C; } .risk-panel.bad { border-left-color: #FF6B5A; } .risk-panel.black { border-left-color: #000; box-shadow: inset 0 0 0 1px #6E7177; }
.list .tier-h { padding: 8px 14px; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; color: var(--muted); background: var(--bg); border-top: 1px solid var(--line); text-transform: uppercase; }
.inv-lines tr.hit td { background: var(--accent-soft); }
.inv-lines tr.hit td.sticky { background: #3b3a2c; }

/* PDF ponude u aplikaciji */
.pdf-frame { background: #fff; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); height: min(78vh, 1100px); }
.pdf-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.pdf-frame .loader, .pdf-frame .empty { padding-top: 40px; }
.offer-item .item-desc { margin: 8px 0 4px; }
.offer-item .item-desc input { text-transform: uppercase; }

/* Lim/flah: dimenzije i proračun kilaže u stavci ponude */
.calc-form { max-width: 240px; }
.calc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; margin-top: 10px; }
.calc-grid > label > span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.calc-grid input { width: 100%; min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); padding: 8px 10px; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--text); }
.calc-grid .suffix { position: relative; }
.calc-grid .suffix input { padding-right: 42px; }
.calc-grid .suffix em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 800; font-size: 12px; color: var(--muted); }
@media (max-width: 520px) { .calc-grid { grid-template-columns: repeat(2, 1fr); } }
.calc-warn:not(:empty) { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 159, 67, .14); color: #FFB870; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* Stavka ponude kao jedan pregledan red; dodir otvara izmenu */
.offer-row { display: grid; grid-template-columns: 26px 1fr auto; grid-template-areas: "idx main amt" "idx acts acts"; gap: 2px 10px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; }
.offer-row .idx { grid-area: idx; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.offer-row .main { grid-area: main; text-align: left; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; min-width: 0; }
.offer-row .main .t { font-weight: 750; font-size: 14px; }
.offer-row .main .d { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-top: 1px; }
.offer-row .main .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.offer-row .amt { grid-area: amt; font-weight: 800; white-space: nowrap; padding-top: 1px; }
.offer-row .acts { grid-area: acts; display: flex; justify-content: flex-end; gap: 4px; margin-top: 4px; }
.iconbtn.sm { width: 32px; height: 32px; }
.iconbtn.sm svg { width: 17px; height: 17px; }
.iconbtn[disabled] { opacity: .3; pointer-events: none; }
.offer-item.open { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.offer-grid .span-all { grid-column: 1 / -1; }
.last-price { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.last-price > span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
@media (min-width: 700px) { .offer-row { grid-template-columns: 26px 1fr auto auto; grid-template-areas: "idx main amt acts"; align-items: center; } .offer-row .acts { margin-top: 0; } }
.iconbtn.danger { color: var(--bad); }
.apr-warn { background: rgba(255, 159, 67, .14); color: #FFB870; border-radius: 8px; padding: 8px 10px; margin: -4px 0 12px; font-weight: 700; }
.stop.pickup { background: var(--accent-soft); }
/* Pretovar: upozorenje dok nije odobren, zeleno kad direktor odobri */
.ovl { border: 1px solid rgba(255, 107, 90, .55); background: rgba(255, 107, 90, .08); }
.ovl.ok { border-color: rgba(123, 216, 143, .5); background: rgba(123, 216, 143, .08); }
.table tr.proj td { color: var(--muted); }
.table tr.proj td i { color: var(--text); font-style: italic; }

/* Prijava u dva koraka: QR kod na belom (čitljiv za kameru i u tamnoj temi) */
.totp-qr { background: #fff; padding: 12px; border-radius: 12px; width: 184px; height: 184px; margin: 0 auto; }
.totp-qr svg { width: 100%; height: 100%; display: block; }

/* Kupac isključen iz preporuka */
.nosug-banner { display: flex; gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); border-left: 4px solid var(--bad); }
.seg-ctl.mkt { max-width: 360px; }
/* „Ne predlaži više“ — uočljivo, ali ne kao glavna akcija */
.nosug-btn { color: var(--bad); border: 1px solid rgba(214, 69, 69, .45); background: rgba(214, 69, 69, .08); min-height: 30px; }
.nosug-btn:hover { background: rgba(214, 69, 69, .16); }
.nosug-btn svg { width: 14px; height: 14px; }
.ptt-row { grid-template-columns: 24px minmax(160px, 1.4fr) 52px 2fr 128px; }
.ptt-move { min-height: 32px; padding: 4px 8px; font-size: 13px; width: 124px; }
@media (max-width: 640px) { .ptt-row { grid-template-columns: 24px 1fr 44px; } .ptt-row .c-rule { grid-column: 2 / -1; justify-self: start; } }
