/* v19: one responsive layout, one source of theme variables. */
:root { --bg:#f3f6fa; --surface:#fff; --soft:#edf1f7; --text:#172436; --muted:#53657a; --line:#ced8e5; --accent:#c54217; --accent-soft:#fff1e9; --success:#166534; --success-bg:#e8f7ed; --danger:#ac2333; --danger-bg:#fff0f2; --shadow:0 3px 14px #1021390c; color-scheme:light; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; padding:16px; background:var(--bg); color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; font-size:15px; line-height:1.45; }
body.dark-mode { --bg:#0c1320; --surface:#142030; --soft:#1c2b3e; --text:#edf4ff; --muted:#b0bed0; --line:#3c4d63; --accent:#ffab80; --accent-soft:#34241f; --success:#b4f0c6; --success-bg:#153624; --danger:#ffb0b9; --danger-bg:#392129; --shadow:0 3px 14px #0002; color-scheme:dark; }
button,input,select { font:inherit; }
button { min-height:44px; border:1px solid var(--line); border-radius:10px; padding:9px 13px; background:var(--surface); color:var(--text); font-weight:650; cursor:pointer; touch-action:manipulation; }
button:hover:not(:disabled) { border-color:var(--accent); background:var(--accent-soft); }
button:disabled { cursor:not-allowed; opacity:.55; }
.brojcanik button:disabled { background:var(--soft); color:var(--muted); border-color:var(--line); opacity:.42; box-shadow:none; }
button:focus-visible,input:focus,select:focus,summary:focus-visible { outline:3px solid var(--accent); outline-offset:2px; }
input,select { min-height:44px; min-width:0; max-width:100%; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--text); padding:9px 11px; font-size:16px; }
input[aria-invalid="true"] { border:2px solid var(--danger); background:var(--danger-bg); }
label { display:block; font-weight:650; font-size:13px; margin:9px 0 5px; }
input::placeholder { color:var(--muted); }
.primary { background:#c54217; color:#fff; border-color:#c54217; }
.primary:hover:not(:disabled) { background:#aa3610; color:#fff; }
.danger-outline { color:var(--danger); border-color:var(--danger); }
.muted,.version { color:var(--muted); font-size:12px; }
.version { display:block; text-align:center; margin-top:14px; }
.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; }
.poruka { margin:0 auto 12px; max-width:1800px; padding:12px 16px; border:1px solid var(--line); border-left:4px solid var(--accent); border-radius:8px; background:var(--surface); overflow-wrap:anywhere; }
.poruka.greska { border-color:var(--danger); color:var(--danger); background:var(--danger-bg); }
.login-ekran { min-height:calc(100dvh - 50px); display:grid; place-items:center; }
.login-kartica { width:min(100%,350px); background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:26px; box-shadow:var(--shadow); }
.login-brand { display:flex; flex-direction:column; align-items:center; gap:10px; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.09em; }
.login-brand img { object-fit:contain; background:#fff; border-radius:12px; padding:6px; }
.login-kartica h1 { font-size:22px; text-align:center; margin:20px 0 0; }
.login-kartica p { text-align:center; }
.login-kartica input,.login-kartica select { width:100%; }
#pin-input { font-size:25px; text-align:center; letter-spacing:.3em; }
.pin-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin:16px 0; }
.pin-grid button { min-height:54px; }
.theme-button { width:44px; flex:0 0 44px; padding:6px; font-size:24px; line-height:1; }
.workspace { max-width:1800px; margin:auto; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:14px 20px; align-items:center; }
.brand { grid-column:1; grid-row:1; display:flex; align-items:center; gap:12px; min-width:0; }
.logo-plate { display:grid; place-items:center; border-radius:10px; background:#fff; padding:5px; }
.brand img { object-fit:contain; }
.brand>div { display:flex; flex-direction:column; }
.brand strong { font-size:23px; line-height:1.1; letter-spacing:-.04em; }
.brand small { color:var(--muted); font-size:10px; font-weight:750; letter-spacing:.10em; }
.brand span:not(.logo-plate) { color:var(--muted); font-size:11px; }
.user-controls { grid-column:3; grid-row:1; display:flex; align-items:center; gap:8px; min-width:0; }
.user-chip { min-height:44px; border:1px solid var(--line); background:var(--surface); border-radius:10px; display:flex; align-items:center; gap:8px; padding:8px 12px; min-width:0; max-width:240px; }
.user-chip>span { color:var(--success); font-size:10px; }
.user-chip b { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:13px; }
.views { grid-column:2; grid-row:1; justify-self:center; display:flex; gap:6px; padding:5px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.views button { flex:1; border:0; min-width:105px; background:transparent; }
.views button[aria-current="page"] { color:#fff; background:#c54217; }
.radna-smjena-status { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid var(--line); border-radius:12px; padding:10px 14px; background:var(--surface); font-size:13px; }
.radna-smjena-status>div:first-child { display:flex; flex-wrap:wrap; align-items:center; gap:6px 12px; }
.radna-smjena-status strong { color:var(--accent); font-size:12px; }
.radna-smjena-status small { display:block; color:var(--muted); }
.status-actions { display:flex; gap:8px; }
.status-actions button { font-size:12px; }
.radna-smjena-status.upozorenje { border-color:var(--danger); background:var(--danger-bg); }
.migracija-info { grid-column:1/-1; background:var(--accent-soft); color:var(--accent); border-radius:10px; padding:12px; font-size:13px; }
.toolbar { grid-column:1/-1; display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; min-width:0; }
.filters { display:flex; align-items:center; gap:6px; overflow-x:auto; max-width:100%; padding:3px; scrollbar-width:thin; }
.filters button { flex:0 0 auto; font-size:13px; padding:8px 13px; border-radius:24px; }
.filters button[aria-pressed="true"] { color:var(--surface); background:var(--text); border-color:var(--text); }
.lista-alati { display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 380px; max-width:470px; }
.lista-alati select { width:185px; }
.lista-alati input { flex:1; width:100%; }
.main-grid { grid-column:1/-1; display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:18px; align-items:start; min-width:0; }
.content,.summary { min-width:0; }
.summary { display:flex; flex-direction:column; gap:12px; }
.summary-card { background:var(--surface); border:1px solid var(--line); border-radius:15px; padding:17px; box-shadow:var(--shadow); }
.summary-card h2 { font-size:17px; margin:0 0 8px; }
#brojac-unosa { margin:0 0 5px; font-size:13px; color:var(--muted); }
progress { accent-color:var(--accent); width:100%; height:9px; }
.totals { margin:12px 0; }
.totals>div { display:flex; justify-content:space-between; align-items:baseline; gap:8px; padding:7px 0; }
.totals dt { font-size:12px; color:var(--muted); }
.totals dd { margin:0; font-size:14px; font-variant-numeric:tabular-nums; white-space:nowrap; font-weight:700; }
.totals .gross,.totals .net { display:block; border-bottom:1px solid var(--line); padding:9px 0 13px; }
.totals .gross dd { font-size:29px; letter-spacing:-.04em; }
.totals .net { border:0; margin-top:8px; padding:12px; border-radius:10px; background:var(--accent-soft); }
.totals .net dd { font-size:28px; color:var(--accent); letter-spacing:-.035em; }
.totals .net dd.negativno { color:var(--danger); }
.save-actions { display:flex; flex-direction:column; gap:9px; }
.close-shift { background:var(--soft); }
.summary-card details+details { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); }
summary { font-weight:700; cursor:pointer; min-height:30px; }
.summary-card form input,.summary-card form button,.summary-card select { width:100%; }
.summary-card form button { margin:10px 0 14px; }
.fin-stavka { display:flex; align-items:center; gap:7px; border-top:1px solid var(--line); padding:10px 0; flex-wrap:wrap; font-size:12px; }
.fin-stavka>span { flex:1; min-width:90px; overflow-wrap:anywhere; }
.fin-stavka small { display:block; color:var(--muted); }
.fin-stavka button { font-size:11px; }
.tablica-okvir { overflow-x:auto; max-width:100%; border:1px solid var(--line); border-radius:14px; background:var(--surface); }
table { width:100%; border-collapse:collapse; background:var(--surface); font-size:13px; font-variant-numeric:tabular-nums; }
.inventura-tablica { min-width:1010px; }
th { text-align:center; padding:14px 10px; background:var(--soft); color:var(--muted); font-size:11px; text-transform:uppercase; }
td { border-top:1px solid var(--line); padding:12px 9px; text-align:center; vertical-align:middle; }
td:first-child,th:first-child { text-align:left; width:200px; }
td:last-child,th:last-child { text-align:right; }
table input { width:73px; padding:8px 4px; text-align:center; }
.inventura-tablica td:nth-child(6) { width:167px; }
.artikl-naziv { font-size:14px; display:block; line-height:1.3; overflow-wrap:anywhere; }
.artikl-meta { display:flex; flex-wrap:wrap; gap:5px; margin:5px 0; font-size:10px; color:var(--muted); }
.artikl-meta>span { padding:2px 5px; background:var(--soft); border-radius:4px; }
.artikl-meta .sifra { color:var(--accent); background:var(--accent-soft); }
.jedinicna-cijena,[data-sync-row] { display:block; color:var(--muted); font-size:10px; margin-top:4px; }
.brojcanik { display:flex; align-items:center; gap:4px; min-width:0; }
.brojcanik button { width:37px; flex:0 0 37px; padding:4px; min-height:44px; font-size:20px; }
.brojcanik input { width:70px; min-width:0; flex:1; text-align:center; font-weight:750; }
.potvrda { font-size:12px; min-width:114px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:6px; white-space:nowrap; padding:7px 9px; }
.potvrda>span:first-child { font-size:19px; line-height:1; }
.potvrda.oznaceno { color:var(--success); border-color:var(--success); background:var(--success-bg); }
tr.pregledano td { background:var(--success-bg); }
tr:focus-within td { box-shadow:inset 0 2px var(--accent), inset 0 -2px var(--accent); }
.row-error { margin:6px 0; color:var(--danger); font-size:12px; text-align:left; overflow-wrap:anywhere; }
.conflict-panel { color:var(--danger); background:var(--danger-bg); padding:10px; margin-top:9px; border:1px solid var(--danger); border-radius:9px; text-align:left; font-size:12px; }
.conflict-panel button { display:block; width:100%; margin:5px 0; white-space:normal; }
.prazno { padding:30px 20px; text-align:center; background:var(--surface); border:1px dashed var(--line); border-radius:14px; }
.mreza-kartica { display:flex; flex-direction:column; gap:11px; }
.artikl-kartica { padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--surface); scroll-margin-top:76px; }
.artikl-kartica.pregledano { border-color:var(--success); }
.artikl-kartica.otvoreno { border:2px solid var(--accent); padding:13px; background:var(--accent-soft); box-shadow:var(--shadow); }
.kartica-vrh { display:flex; align-items:center; gap:8px; }
.otvori-artikl { display:flex; align-items:center; gap:8px; border:0; background:transparent; padding:0; text-align:left; flex:1; min-width:0; }
.otvori-artikl>span:last-child { min-width:0; }
.otvori-artikl:hover:not(:disabled) { background:transparent; }
.strelica { color:var(--accent); font-size:12px; flex:0 0 15px; }
.iznos-kartice { flex:0 0 auto; text-align:right; font-variant-numeric:tabular-nums; }
.iznos-kartice b { font-size:17px; }
.iznos-kartice small { display:block; color:var(--muted); font-size:11px; }
.kartica-status { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-top:8px; }
.kartica-detalji { padding-top:12px; margin-top:12px; border-top:1px dashed var(--line); }
.kartica-detalji .brojcanik { margin:6px 0 14px; }
.kartica-detalji .brojcanik button { flex-basis:52px; width:52px; height:50px; }
.kartica-detalji .brojcanik input { height:50px; font-size:23px; }
.kartica-stanja { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin-bottom:12px; }
.kartica-stanja>div { background:var(--surface); border-radius:8px; padding:6px; text-align:center; border:1px solid var(--line); min-width:0; }
.kartica-stanja label,.kartica-stanja>div>span:first-child { display:block; font-size:10px; color:var(--muted); margin:0 0 4px; }
.kartica-stanja input { width:100%; padding:6px 2px; text-align:center; }
.kartica-detalji>small { color:var(--muted); font-size:11px; }
.arhiva-kontrole { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:10px 0; font-size:12px; }
.arhiva-tablica { min-width:790px; }
.arhiva-tablica small { display:block; color:var(--muted); }
.arhiva-opis { padding:16px; background:var(--surface); margin-top:12px; border-radius:10px; white-space:pre-wrap; overflow-wrap:anywhere; }
@media (max-width:1279px) { .main-grid { grid-template-columns:minmax(0,1fr); } .summary { display:grid; grid-template-columns:1fr 1fr; align-items:start; } .workspace { column-gap:12px; } .brand strong { font-size:21px; } .user-chip { max-width:150px; } }
@media (max-width:899px) {
    body { padding:10px; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
    .workspace { display:flex; flex-direction:column; gap:10px; align-items:stretch; }
    .brand { order:0; padding:5px 4px; }
    .brand strong { font-size:22px; }
    .brand img { width:52px; height:44px; }
    .user-controls { order:1; width:100%; }
    .user-chip { flex:1 1 auto; max-width:none; }
    .views { order:2; position:sticky; top:env(safe-area-inset-top,0px); z-index:20; width:100%; background:var(--surface); box-shadow:var(--shadow); }
    .views button { min-width:0; }
    .radna-smjena-status { order:3; align-items:stretch; flex-direction:column; gap:7px; padding:10px; }
    .radna-smjena-status>div:first-child { gap:4px 8px; }
    .radna-smjena-status small { flex-basis:100%; font-size:11px; }
    .status-actions { flex-wrap:wrap; }
    .status-actions button { flex:1; }
    .migracija-info { order:4; }
    .toolbar { order:5; display:flex; flex-direction:column; flex-wrap:nowrap; gap:8px; }
    .lista-alati { flex:0 0 auto; max-width:none; width:100%; }
    .lista-alati select { width:45%; }
    .lista-alati input { width:55%; }
    .filters { gap:5px; }
    .filters button { font-size:12px; }
    .main-grid { order:6; gap:15px; }
    .summary { display:flex; }
    .arhiva-kontrole span { text-align:center; }
    input,select { font-size:16px; }
}
@media (max-width:359px) { body { padding:8px; } .lista-alati { flex-direction:column; } .lista-alati select,.lista-alati input { width:100%; } .kartica-stanja { grid-template-columns:repeat(2,minmax(0,1fr)); } .iznos-kartice b { font-size:15px; } }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto !important; } }

/* =========================================================
   v20 beta - Skladiste / Sank / Obracun
   ========================================================= */
.views { grid-template-columns:repeat(5,minmax(0,1fr)); }
.lokacija-page-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:0 0 12px; padding:14px 16px; background:var(--surface); border:1px solid var(--line); border-radius:14px; }
.lokacija-page-head h2 { margin:0 0 3px; font-size:18px; }
.lokacija-page-head p { margin:0; color:var(--muted); font-size:12px; }
.lokacija-page-head .secondary { white-space:nowrap; }
.lokacija-tablica { min-width:720px; }
.lokacija-tablica td:first-child,.lokacija-tablica th:first-child { width:260px; }
.lokacija-brojcanik { max-width:220px; margin:auto; }
.lokacija-status { white-space:normal; line-height:1.2; min-width:150px; }
.lokacija-mini { display:block; margin-top:5px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.02em; }
.default-chip { display:inline-flex; padding:5px 8px; border-radius:8px; background:var(--soft); color:var(--muted); font-size:11px; font-weight:700; white-space:nowrap; }
.lokacija-card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:12px; }
.lokacija-card-top .artikl-naziv { font-size:17px; }
.lokacija-kartica .kartica-status { margin-top:12px; }
.odstupanje { display:block; margin-top:9px; color:var(--muted); }
body.dark-mode .lokacija-page-head { background:var(--surface); }
@media (max-width:899px) {
    .views { grid-template-columns:repeat(5,minmax(96px,1fr)); overflow-x:auto; }
    .views #tab-arhiva { grid-column:auto; }
    .views button { white-space:nowrap; padding-left:10px; padding-right:10px; }
    .lokacija-page-head { align-items:stretch; flex-direction:column; }
    .lokacija-page-head .secondary { width:100%; }
    .lokacija-brojcanik { max-width:none; }
}


/* =========================================================
   v20.11 beta - Vaga
   ========================================================= */
.vaga-head p { max-width:980px; }
.vaga-tablica { min-width:860px; }
.vaga-tablica td:first-child,.vaga-tablica th:first-child { width:250px; }
.vaga-tablica input[data-scale-input] { width:118px; min-height:46px; text-align:center; font-size:17px; font-weight:800; }
.vaga-tablica [data-scale-net] { font-size:18px; }
.vaga-mobile-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.vaga-mobile-fields label { display:flex; flex-direction:column; gap:6px; color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; }
.vaga-mobile-fields input { width:100%; min-height:52px; text-align:center; font-size:19px; font-weight:800; }
.vaga-neto { display:grid; grid-template-columns:auto 1fr; align-items:baseline; gap:4px 12px; margin-top:12px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--soft); }
.vaga-neto span { color:var(--muted); font-size:12px; font-weight:800; text-transform:uppercase; }
.vaga-neto strong { justify-self:end; font-size:26px; }
.vaga-neto small { grid-column:1 / -1; color:var(--muted); }
.vaga-kartica .potvrda { min-height:48px; padding-left:18px; padding-right:18px; }
@media (max-width:899px) {
    .vaga-mobile-fields { grid-template-columns:1fr 1fr; }
}
@media (max-width:390px) {
    .vaga-mobile-fields { grid-template-columns:1fr; }
}


/* v20.13 - informativno prethodno stanje skladista */
.skladiste-prethodno {
    font-weight: 800;
    font-size: 1.05rem;
    white-space: nowrap;
}
.skladiste-prethodno-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
}
.skladiste-prethodno-mobile strong { font-size: 1.15rem; }


/* =========================================================
   v20.15 - Vaga zasebna komponenta + tara konfiguracija + sticky navigacija
   ========================================================= */
.views {
    position: sticky;
    top: 8px;
    z-index: 35;
    box-shadow: var(--shadow);
}
.vaga-tara-fixed {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:118px;
    min-height:46px;
    padding:9px 12px;
    border:1px solid var(--line);
    border-radius:9px;
    background:var(--soft);
    color:var(--text);
    font-size:17px;
    font-weight:800;
    font-variant-numeric:tabular-nums;
}
.vaga-mobile-fields .vaga-tara-fixed { width:100%; min-height:52px; font-size:19px; }
@media (max-width:899px) {
    .views { top:env(safe-area-inset-top,0px); }
}


/* v20.17 - emergency current-shift reset. Intentionally visually distinct from normal close. */
.reset-shift {
    background: var(--danger-bg) !important;
    color: var(--danger) !important;
    border: 1px solid var(--danger) !important;
}
.reset-shift:hover { filter: brightness(0.98); }
.reset-shift:disabled { opacity: .45; cursor: not-allowed; }

/* v20.22 - sortiranje artikala u arhivi */
.arhiva-sort-wrap { margin-left:auto; display:flex; align-items:center; }
.arhiva-sort-wrap select { min-width:190px; padding:9px 11px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--text); font-weight:700; }
@media (max-width:899px) {
    .arhiva-kontrole { flex-wrap:wrap; }
    .arhiva-sort-wrap { flex:1 0 100%; margin-left:0; }
    .arhiva-sort-wrap select { width:100%; min-width:0; }
}


/* v20.24 - Dužnici 2.0 */
.workspace.duznici-view .main-grid{grid-template-columns:minmax(0,1fr)}
.workspace.duznici-view .summary{display:none}
.duznici-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-end;margin-bottom:18px;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface,#fff)}
.duznici-head h2{margin:0 0 4px}.duznici-head p{margin:0;color:var(--muted)}
.duznici-alati{display:flex;gap:8px;flex-wrap:wrap}.duznici-alati input,.duznici-alati select{min-height:42px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface,#fff);color:inherit}
.duznik-kartica{margin-bottom:16px;border:1px solid var(--line);border-radius:16px;background:var(--surface,#fff);overflow:hidden}
.duznik-kartica>header{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:16px 18px;background:rgba(127,127,127,.06);border-bottom:1px solid var(--line)}
.duznik-kartica h3{margin:0;font-size:1.2rem}.duznik-kartica header small{color:var(--muted)}
.duznik-ukupno{text-align:right}.duznik-ukupno span{display:block;color:var(--muted);font-size:.82rem}.duznik-ukupno strong{font-size:1.35rem}
.dugovi-lista{padding:8px 14px}.dug-red{display:grid;grid-template-columns:minmax(160px,.7fr) minmax(320px,2fr) auto;gap:14px;align-items:center;padding:12px 4px;border-bottom:1px solid var(--line)}.dug-red:last-child{border-bottom:0}
.dug-glavno{display:flex;align-items:center;gap:9px}.dug-glavno strong{font-size:1.05rem}.dug-status{font-size:.72rem;font-weight:800;padding:3px 7px;border-radius:999px;background:#fff0c7;color:#795500}.dug-red.placen .dug-status{background:#e6f5eb;color:#25633a}
.dug-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 14px;color:var(--muted);font-size:.88rem}.dug-meta b{color:inherit}
.dug-red button{min-height:40px;white-space:nowrap}
@media(max-width:800px){.duznici-head{align-items:stretch;flex-direction:column}.duznici-alati{flex-direction:column}.duznici-alati input,.duznici-alati select{width:100%}.dug-red{grid-template-columns:1fr;gap:8px}.dug-meta{grid-template-columns:1fr}.dug-red button{width:100%}.duznik-kartica>header{align-items:flex-start}.duznik-ukupno strong{font-size:1.15rem}}

/* v20.25 - Dužnici 2.1: sažeti popis, detalji, uplate i povijest */
.duznik-sazetak{display:grid;grid-template-columns:minmax(220px,1.6fr) minmax(150px,.7fr) minmax(130px,.5fr) auto;gap:14px;align-items:center;padding:16px 18px;margin:10px 0;border:1px solid var(--line);border-radius:14px;background:var(--surface,#fff)}
.duznik-sazetak h3{margin:0 0 4px}.duznik-sazetak small{color:var(--muted)}
.duznik-saldo,.duznik-broj{display:flex;flex-direction:column;gap:3px}.duznik-saldo span,.duznik-broj span{font-size:11px;text-transform:uppercase;color:var(--muted);font-weight:700}.duznik-saldo strong,.duznik-broj strong{font-size:1.12rem}.saldo-dug{color:var(--danger)}.saldo-plus{color:var(--success)}
.duznik-sazetak>button{min-height:42px;padding:9px 16px;border-radius:10px}
.duznik-detalji-head{display:grid;grid-template-columns:auto 1fr minmax(170px,.45fr);gap:16px;align-items:center;padding:18px;border:1px solid var(--line);border-radius:16px;background:var(--surface,#fff);margin-bottom:14px}.duznik-detalji-head h2{margin:0 0 4px}.duznik-detalji-head p{margin:0;color:var(--muted)}
.detalj-saldo{display:flex;flex-direction:column;text-align:right}.detalj-saldo span{font-size:11px;text-transform:uppercase;color:var(--muted);font-weight:700}.detalj-saldo strong{font-size:1.45rem}.detalj-saldo.dug strong{color:var(--danger)}.detalj-saldo.plus strong{color:var(--success)}
.uplata-kartica,.dugovi-sekcija,.duznik-povijest{border:1px solid var(--line);border-radius:14px;background:var(--surface,#fff);padding:16px;margin:12px 0}.uplata-kartica h3,.dugovi-sekcija h3{margin:0 0 6px}.uplata-kartica p{margin:0 0 12px;color:var(--muted)}.uplata-red{display:flex;gap:10px}.uplata-red input{min-height:44px;max-width:220px;font-size:1.1rem;font-weight:700;text-align:right}.uplata-red button{min-height:44px}
.duznik-povijest>summary{cursor:pointer;font-weight:800}.povijest-lista{display:flex;flex-direction:column;gap:8px;margin-top:12px}.povijest-red{display:grid;grid-template-columns:1fr auto;gap:6px 14px;padding:11px 12px;border-radius:10px;background:var(--soft);border:1px solid var(--line)}.povijest-red>div{display:flex;flex-direction:column}.povijest-red small{color:var(--muted)}.povijest-red>b{font-size:1rem}.povijest-red>span{grid-column:1/-1;font-size:12px;color:var(--muted)}.povijest-red.uplata{background:var(--success-bg)}.povijest-plus{color:var(--success)!important;font-weight:700}
.fin-podnaslov{margin:12px 0 6px;padding-top:10px;border-top:1px dashed var(--line);font-size:11px;text-transform:uppercase;font-weight:800;color:var(--muted)}.fin-uplata b{color:var(--success)}
@media(max-width:800px){.duznik-sazetak{grid-template-columns:1fr 1fr}.duznik-identitet{grid-column:1/-1}.duznik-sazetak>button{grid-column:1/-1;width:100%}.duznik-detalji-head{grid-template-columns:1fr}.duznik-detalji-head>.secondary{width:100%}.detalj-saldo{text-align:left}.uplata-red{flex-direction:column}.uplata-red input{max-width:none;width:100%}.uplata-red button{width:100%}}
/* v20.26 - warehouse bottle count for spirits */
.bottle-calc{display:block;margin-top:5px;color:var(--muted);font-size:12px;font-weight:600;white-space:nowrap}
.skladiste-prethodno small{display:block;font-weight:400;color:var(--muted)}
.skladiste-prethodno-mobile small{font-weight:400;color:var(--muted)}


/* v20.27 - direktni obračun i masovne akcije šanka */
.direct-mode-toggle{white-space:nowrap}
.direct-mode-toggle.active{font-weight:800;box-shadow:0 0 0 2px rgba(255,140,0,.25) inset}
.lokacija-head-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-end}
.direktna-potvrda{white-space:nowrap}
@media (max-width:899px){.direct-mode-toggle{width:100%;margin-top:6px}.lokacija-head-actions{width:100%;justify-content:stretch}.lokacija-head-actions button{flex:1;min-height:48px}}

/* v20.28 - nepouzdano prethodno skladište + artikli bez zalihe */
.prethodno-nepouzdano{color:var(--muted);font-style:italic;font-weight:600}
.nema-zalihe{background:rgba(127,127,127,.09)!important;opacity:.72}
.nema-zalihe td,.nema-zalihe .artikl-naziv,.nema-zalihe .artikl-info{color:var(--muted)!important}
.nema-zalihe-status{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:7px 11px;border:1px dashed var(--line);border-radius:9px;color:var(--muted);background:rgba(127,127,127,.06);font-weight:700}

/* v20.30 - konzistentno stanje: nula, greške i potvrđeni unosi */
.inventura-tablica tr.nema-zalihe td,
.lokacija-tablica tr.nema-zalihe td { background:var(--soft)!important; color:var(--muted)!important; }
.artikl-kartica.nema-zalihe { background:var(--soft)!important; border-color:var(--line)!important; opacity:.82; }
.inventura-tablica tr.ima-gresku td,
.lokacija-tablica tr.ima-gresku td { background:var(--danger-bg)!important; color:var(--text)!important; }
.artikl-kartica.ima-gresku { background:var(--danger-bg)!important; border-color:var(--danger)!important; opacity:1; }
.ima-gresku [data-sync-row],.ima-gresku .row-error { color:var(--danger)!important; font-weight:700; }
.nema-zalihe.ima-gresku,.artikl-kartica.nema-zalihe.ima-gresku { opacity:1; }

/* v20.32 permissions */
.user-chip>span:last-child{display:flex;flex-direction:column;line-height:1.05}.role-label{font-size:.68rem;color:var(--muted);font-weight:600;margin-top:3px}.ovlasti-dialog{border:0;padding:0;border-radius:16px;width:min(620px,calc(100vw - 24px));max-height:90vh;background:var(--surface);color:var(--text);box-shadow:0 24px 80px rgba(0,0,0,.35)}.ovlasti-dialog::backdrop{background:rgba(0,0,0,.55)}.ovlasti-panel{padding:20px;display:grid;gap:18px}.ovlasti-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.ovlasti-title h2,.ovlasti-panel h3{margin:0}.ovlasti-title p{margin:4px 0 0;color:var(--muted)}.ovlasti-panel section{display:grid;gap:9px;padding:16px;border:1px solid var(--line);border-radius:12px}.ovlasti-panel select{min-height:42px;padding:8px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}.ovlasti-code-output{padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--soft);display:grid;gap:7px}.ovlasti-code-output strong{font-size:2rem;letter-spacing:.12em}.ovlasti-code-output small{color:var(--muted)}
@media(max-width:700px){.user-controls{gap:5px}.user-controls .secondary{padding:8px;font-size:.78rem}.ovlasti-title{flex-direction:column}.ovlasti-title button{width:100%}}

/* v20.33: biljeska smjene i administratorske postavke */
.shift-note-card{display:grid;gap:9px}.shift-note-card textarea{width:100%;min-height:110px;resize:vertical;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--text);padding:10px;font:inherit;line-height:1.35}.shift-note-card textarea:focus{outline:2px solid color-mix(in srgb,var(--accent) 55%,transparent);outline-offset:1px}.shift-note-actions{display:grid;gap:8px}.shift-note-actions button{width:100%}.feature-toggles{display:grid;gap:10px}.feature-toggle{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:10px}.feature-toggle input{width:20px;height:20px}.feature-toggle span{display:grid;gap:2px}.feature-toggle small{color:var(--muted)}


/* =========================================================
   v20.35 - minimalne / kritične zalihe
   ========================================================= */
.kriticna-zaliha { outline:2px solid rgba(194,65,12,.45); outline-offset:-2px; background:rgba(255,237,213,.55) !important; }
body.dark-mode .kriticna-zaliha { background:rgba(124,45,18,.22) !important; }
.critical-stock-badge { display:inline-flex; align-items:center; gap:5px; margin-top:5px; padding:4px 7px; border-radius:999px; background:#ffedd5; color:#9a3412; font-size:11px; font-weight:800; }
.critical-stock-card details>summary { cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.critical-count { display:inline-flex; min-width:26px; height:26px; padding:0 7px; align-items:center; justify-content:center; border-radius:999px; background:#c2410c; color:white; font-weight:900; }
.critical-stock-list { display:grid; gap:7px; margin-top:10px; }
.critical-stock-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 10px; border:1px solid #fed7aa; border-radius:10px; background:#fff7ed; }
.critical-stock-item span { min-width:0; }
.critical-stock-item b,.critical-stock-item small { display:block; }
.critical-stock-item small { color:var(--muted); margin-top:2px; }
.critical-stock-item strong { white-space:nowrap; color:#9a3412; }
.critical-stock-ok { margin:0; color:var(--muted); font-size:12px; }
.stock-limit-editor { max-height:320px; overflow:auto; border:1px solid var(--line); border-radius:10px; margin:8px 0 10px; }
.stock-limit-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 10px; border-bottom:1px solid var(--line); }
.stock-limit-row:last-child { border-bottom:0; }
.stock-limit-row span:first-child { min-width:0; }
.stock-limit-row b,.stock-limit-row small { display:block; }
.stock-limit-row small { color:var(--muted); margin-top:2px; }
.stock-limit-input { display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.stock-limit-input input { width:88px; text-align:right; }
.stock-limit-input em { min-width:34px; font-style:normal; color:var(--muted); font-size:12px; }
body.dark-mode .critical-stock-item { background:rgba(124,45,18,.18); border-color:rgba(251,146,60,.35); }
@media (max-width:520px) { .stock-limit-row { align-items:flex-start; } .stock-limit-input input { width:74px; } }

/* v20.42: Current-shift debts must stand out from historical open debts. */
.fin-stavka.fin-dug-tekuci { background:var(--success-bg); border:1px solid #66aa83; border-left:5px solid #258550; padding:12px; border-radius:10px; margin:6px 0; }
.fin-stavka.fin-dug-tekuci strong { font-weight:800; }
.fin-dug-oznaka { color:#12653c; font-weight:800; letter-spacing:.02em; }
.fin-stavka.fin-dug-raniji { opacity:.82; }
.fin-stavka.fin-dug-raniji small { color:var(--muted); }

/* v20.43: contrast-safe debt cards, distinguish finance forms, responsive access code. */
.fin-stavka.fin-dug-tekuci {
  background:#eef8f4; border:1px solid #b9dacb; border-left:4px solid #599b7d;
  color:#193b32; box-shadow:0 2px 8px rgba(28,92,70,.055);
}
.fin-stavka.fin-dug-tekuci > span,
.fin-stavka.fin-dug-tekuci strong,
.fin-stavka.fin-dug-tekuci > b { color:#193b32; opacity:1; }
.fin-stavka.fin-dug-tekuci small { color:#436e5d; }
.fin-stavka .fin-dug-oznaka { color:#296b54; font-weight:750; letter-spacing:0; }
.fin-stavka.fin-dug-raniji { opacity:1; background:var(--surface); color:var(--text); border-radius:9px; padding:10px 8px; }
.fin-stavka.fin-dug-raniji strong { color:var(--text); }
.fin-stavka.fin-dug-raniji small { color:var(--muted); }
body.dark-mode .fin-stavka.fin-dug-tekuci { background:#19372f; border-color:#3c7662; border-left-color:#80c6a8; color:#effcf6; }
body.dark-mode .fin-stavka.fin-dug-tekuci > span,
body.dark-mode .fin-stavka.fin-dug-tekuci strong,
body.dark-mode .fin-stavka.fin-dug-tekuci > b { color:#effcf6; }
body.dark-mode .fin-stavka.fin-dug-tekuci small { color:#c0e3d2; }
body.dark-mode .fin-stavka .fin-dug-oznaka { color:#a9e7cc; }
body.dark-mode .fin-stavka.fin-dug-raniji { background:var(--soft); }
/* Distinct but harmonious accents: teal for debt, warm amber for expenses. */
#veresije-blok, #rashodi-blok { border-radius:12px; padding:11px 12px 13px; border:1px solid var(--line); }
#veresije-blok { background:#f2faf8; border-color:#c8e7dc; }
#rashodi-blok { background:#fff8ee; border-color:#eedbc0; }
#veresije-blok > summary { color:#276d60; }
#rashodi-blok > summary { color:#945728; }
#veresije-blok input { border-color:#a6d2c4; background:#fff; color:#172436; }
#rashodi-blok input { border-color:#e0bc91; background:#fff; color:#172436; }
#veresije-blok input:focus { outline-color:#387d6f; }
#rashodi-blok input:focus { outline-color:#b97838; }
#dug-form button[type=submit] { background:#317a6c; color:#fff; border-color:#317a6c; }
#rashod-form button[type=submit] { background:#a86430; color:#fff; border-color:#a86430; }
#dug-form button[type=submit]:hover:not(:disabled) { background:#246356; color:#fff; }
#rashod-form button[type=submit]:hover:not(:disabled) { background:#894e25; color:#fff; }
body.dark-mode #veresije-blok { background:#172e31; border-color:#385d5d; }
body.dark-mode #rashodi-blok { background:#32291f; border-color:#68513a; }
body.dark-mode #veresije-blok > summary { color:#a6ead5; }
body.dark-mode #rashodi-blok > summary { color:#f6c18c; }
body.dark-mode #veresije-blok input { background:#172a34; color:#f2f8ff; border-color:#477b72; }
body.dark-mode #rashodi-blok input { background:#302a28; color:#f2f8ff; border-color:#936c4c; }
/* One-time admin access code: readable on narrow screens in both themes. */
.ovlasti-code-output { min-width:0; overflow-wrap:anywhere; background:#edf4fc; color:#18314d; border-color:#c2d7eb; }
.ovlasti-code-output span { color:inherit; }
.ovlasti-code-output strong { display:block; max-width:100%; min-width:0; color:#173b64; font-size:clamp(1.3rem,6vw,2rem); line-height:1.2; font-weight:850; letter-spacing:.08em; overflow-wrap:anywhere; word-break:break-word; font-variant-numeric:tabular-nums; }
.ovlasti-code-output small { color:#49647e; }
body.dark-mode .ovlasti-code-output { background:#24374c; color:#f0f7ff; border-color:#66839f; }
body.dark-mode .ovlasti-code-output strong { color:#ffffff; }
body.dark-mode .ovlasti-code-output small { color:#d1e2f4; }
@media (max-width:520px) { .ovlasti-code-output { padding:12px; } .ovlasti-code-output strong { font-size:clamp(1.2rem,7vw,1.75rem); letter-spacing:.045em; } }

/* v20.44 - mobile-first layout for finance cards and admin access code. */
.ovlasti-code-output[hidden] { display:none !important; }
.fin-stavka.fin-dug-tekuci > span strong, .fin-stavka.fin-dug-raniji > span strong { color:inherit; }
@media (max-width:700px) {
  .fin-stavka.fin-dug-tekuci, .fin-stavka.fin-dug-raniji {
    display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start;
    gap:9px 10px; padding:13px 12px; margin:8px 0; width:100%;
    overflow-wrap:anywhere; box-sizing:border-box;
  }
  .fin-stavka.fin-dug-tekuci > span, .fin-stavka.fin-dug-raniji > span {
    grid-column:1; min-width:0; flex:none; display:block; line-height:1.4;
  }
  .fin-stavka.fin-dug-tekuci > span > strong, .fin-stavka.fin-dug-raniji > span > strong {
    display:block; font-size:1rem; line-height:1.35; word-break:break-word;
  }
  .fin-stavka.fin-dug-tekuci > span small, .fin-stavka.fin-dug-raniji > span small {
    font-size:.77rem; margin-top:4px; line-height:1.45;
  }
  .fin-stavka.fin-dug-tekuci > b, .fin-stavka.fin-dug-raniji > b {
    grid-column:2; text-align:right; font-size:1rem; white-space:nowrap; align-self:start;
  }
  .fin-stavka.fin-dug-tekuci > button, .fin-stavka.fin-dug-raniji > button {
    grid-column:1/-1; width:100%; min-height:42px; margin:0; white-space:normal;
    font-size:.85rem;
  }
  #veresije-blok, #rashodi-blok { width:100%; min-width:0; box-sizing:border-box; padding:13px; margin-inline:0; }
  #veresije-blok > summary, #rashodi-blok > summary { font-weight:750; line-height:1.4; }
  #dug-form, #rashod-form { width:100%; min-width:0; }
  #dug-form input, #rashod-form input, #dug-form select, #rashod-form select {
    box-sizing:border-box; max-width:100%; min-width:0; width:100%; min-height:44px;
  }
  #dug-form button[type=submit], #rashod-form button[type=submit] {
    width:100%; min-height:46px; white-space:normal;
  }
  .ovlasti-dialog { max-width:calc(100vw - 16px); }
  .ovlasti-panel { padding:12px; gap:12px; }
  .ovlasti-panel section { padding:12px; min-width:0; }
  .ovlasti-code-output { box-sizing:border-box; width:100%; min-width:0; padding:12px; }
  .ovlasti-code-output strong { max-width:100%; font-size:clamp(1.15rem,5.5vw,1.65rem); letter-spacing:.035em; overflow-wrap:anywhere; }
}
@media (max-width:380px) {
  .fin-stavka.fin-dug-tekuci, .fin-stavka.fin-dug-raniji { grid-template-columns:minmax(0,1fr); }
  .fin-stavka.fin-dug-tekuci > b, .fin-stavka.fin-dug-raniji > b { grid-column:1; text-align:left; }
}


/* v20.45 - calculator legibility, accessible mobile counters and calm debt rows. */
.inventura-tablica td:last-child strong[data-iznos] { font-size:19px; font-weight:800; font-variant-numeric:tabular-nums; white-space:nowrap; }
.iznos-kartice b { font-size:21px; font-weight:850; line-height:1.15; }
.dugovi-lista .dug-red { padding:13px 12px; margin:3px 0; border-radius:10px; border-bottom:1px solid var(--line); }
.dugovi-lista .dug-red:nth-child(even) { background:var(--soft); }
.dugovi-lista .dug-red:nth-child(odd) { background:var(--surface); }
.dugovi-lista .dug-red .dug-glavno strong { color:var(--text); }
.dugovi-lista .dug-red.placen { opacity:.86; }
.duznici-view .duznik-sazetak:nth-of-type(even) { background:var(--soft); }
.duznici-view .duznik-sazetak h3 { color:var(--text); }
@media (max-width:899px) {
  /* The selected tab and its background form a single horizontal scroller. */
  .views { display:flex; grid-template-columns:none; gap:5px; padding:5px; border-radius:14px; overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; scroll-padding-inline:6px; -webkit-overflow-scrolling:touch; background:var(--surface); }
  .views button { flex:0 0 auto; min-width:max-content; padding:11px 15px; border-radius:10px; line-height:1.2; white-space:nowrap; }
  .views button[aria-current="page"] { background:#c54217; color:#fff; border-color:transparent; }
  .kartica-detalji .brojcanik { display:grid; grid-template-columns: minmax(60px,76px) minmax(0,1fr) minmax(60px,76px); gap:9px; width:100%; align-items:center; }
  .kartica-detalji .brojcanik button { width:100%; height:62px; min-height:62px; min-width:0; font-size:29px; padding:4px; border-radius:12px; }
  .kartica-detalji .brojcanik input { width:100%; min-width:0; height:62px; min-height:62px; padding:7px 4px; text-align:center; font-size:24px; font-weight:800; }
  .iznos-kartice b { font-size:23px; }
}
@media (max-width:380px) {
  .kartica-detalji .brojcanik { grid-template-columns:62px minmax(0,1fr) 62px; gap:7px; }
  .kartica-detalji .brojcanik button { height:58px; min-height:58px; }
  .kartica-detalji .brojcanik input { height:58px; min-height:58px; font-size:22px; }
}

/* v20.46: calm alternating rows in debtor history/archive (both themes). */
.duznici-view .povijest-lista .povijest-red:nth-child(odd) { background:var(--surface); }
.duznici-view .povijest-lista .povijest-red:nth-child(even) { background:var(--soft); }
.duznici-view .povijest-lista .povijest-red.uplata { border-left:3px solid var(--success); }
.duznici-view .povijest-lista .povijest-red.zaduzenje { border-left:3px solid var(--line); }
.duznici-view .povijest-lista .povijest-red > div > strong,
.duznici-view .povijest-lista .povijest-red > b { color:var(--text); }

/* v20.47: kompaktna arhiva i dosljedni zebra redovi */
.dugovi-sekcija > .dug-red { padding:12px; margin:3px 0; border-radius:9px; border:1px solid var(--line); }
.dugovi-sekcija > .dug-red:nth-of-type(odd) { background:var(--surface); }
.dugovi-sekcija > .dug-red:nth-of-type(even) { background:var(--soft); }
body.dark-mode .dugovi-sekcija > .dug-red:nth-of-type(even) { background:#213149; }
.ovlasti-panel .feature-toggles > .feature-toggle:nth-child(even),
.ovlasti-panel .stock-limit-editor > :nth-child(even) { background:var(--soft); }
.ovlasti-panel .feature-toggles > .feature-toggle:nth-child(odd),
.ovlasti-panel .stock-limit-editor > :nth-child(odd) { background:var(--surface); }
.ovlasti-panel .feature-toggles > .feature-toggle { border-radius:8px; padding:10px; }
#glavni-ekran:has(#arhiva-kontrole:not([hidden])) .arhiva-tablica { min-width:680px; width:100%; border-collapse:collapse; font-size:13px; }
.arhiva-tablica th,.arhiva-tablica td { padding:6px 9px !important; line-height:1.25; }
.arhiva-tablica small { font-size:10px; line-height:1.15; }
.arhiva-tablica tbody tr:nth-child(even) { background:var(--soft); }
.arhiva-tablica tbody tr:nth-child(odd) { background:var(--surface); }
.arhiva-opis { padding:0; margin-top:10px; background:transparent; white-space:normal; }
.arhiva-financije { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.arhiva-sekcija { background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:10px; min-width:0; }
.arhiva-sekcija h3 { margin:0 0 7px; font-size:13px; }
.arhiva-fin-red { display:flex; justify-content:space-between; gap:9px; align-items:flex-start; padding:6px 8px; font-size:12px; }
.arhiva-fin-red:nth-child(even) { background:var(--soft); }
.arhiva-fin-red span { min-width:0; overflow-wrap:anywhere; }
.arhiva-fin-red strong { display:block; }
.arhiva-fin-red small { display:block; color:var(--muted); font-size:10px; }
.arhiva-fin-red b { white-space:nowrap; font-variant-numeric:tabular-nums; }
.arhiva-prazno,.arhiva-biljeska { margin:0; font-size:12px; overflow-wrap:anywhere; }
.arhiva-biljeska { white-space:pre-wrap; }
#arhiva-datum { font-weight:700; overflow-wrap:anywhere; }
@media(max-width:700px) {
  .arhiva-financije { grid-template-columns:minmax(0,1fr); gap:8px; }
  .arhiva-sekcija { padding:9px; }
  .arhiva-kontrole { gap:6px; }
  #arhiva-datum { flex:1 1 100%; order:-1; text-align:center; font-size:12px; }
  .arhiva-tablica { min-width:620px; font-size:12px; }
  .arhiva-tablica th,.arhiva-tablica td { padding:5px 6px !important; }
}

.ovlasti-user-list { border:1px solid var(--line); border-radius:9px; overflow:hidden; max-height:220px; overflow-y:auto; }
.ovlasti-user-row { display:flex; justify-content:space-between; gap:10px; padding:8px 10px; font-size:12px; }
.ovlasti-user-row:nth-child(even) { background:var(--soft); }
.ovlasti-user-row:nth-child(odd) { background:var(--surface); }
.ovlasti-user-row span { color:var(--muted); text-align:right; }

/* v20.47.1: stabilna arhivska navigacija na desktopu. */
@media (min-width: 701px) {
  #arhiva-kontrole:not([hidden]) {
    display:grid;
    grid-template-columns: 120px minmax(0,1fr) 120px;
    align-items:center;
    gap:12px;
    width:100%;
  }
  #arhiva-prethodni, #arhiva-sljedeci {
    width:120px;
    min-width:120px;
    max-width:120px;
    box-sizing:border-box;
    justify-self:stretch;
  }
  #arhiva-datum {
    min-width:0;
    width:100%;
    text-align:center;
    overflow-wrap:anywhere;
  }
}

/* v20.48 Admin Artikli */
.article-admin-dialog{width:min(1200px,calc(100vw - 20px));max-height:94dvh;border:0;border-radius:14px;padding:0;color:var(--text);background:var(--surface)}
.article-admin-dialog::backdrop{background:rgba(0,0,0,.62)}
.article-admin-panel{padding:18px;display:grid;gap:12px}
.article-admin-panel header,.article-tools,.article-form-actions{display:flex;flex-wrap:wrap;gap:9px;align-items:center;justify-content:space-between}
.article-admin-panel h2{margin:0}.article-admin-panel header p{margin:3px 0;color:var(--muted)}
.article-tools input{flex:1;min-width:200px}.article-tools input,.article-tools select,.article-fields input{background:var(--surface);color:var(--text);border:1px solid var(--line);padding:9px;border-radius:8px}
.article-table-wrap{overflow:auto;max-height:49dvh;border:1px solid var(--line);border-radius:10px}
.article-table{border-collapse:collapse;width:100%;font-size:.85rem}.article-table th,.article-table td{padding:7px 9px;white-space:nowrap;border-bottom:1px solid var(--line)}
.article-table tbody tr:nth-child(2n){background:var(--soft)}.article-table th{position:sticky;top:0;background:var(--surface);z-index:1;text-align:left}
.article-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.article-fields label{display:grid;gap:5px;font-size:.85rem}.article-fields label input{width:100%;box-sizing:border-box}.article-fields label.article-check{display:flex;align-items:center;gap:10px}.article-fields .article-check input{width:auto}
#article-form{border:1px solid var(--line);border-radius:10px;padding:15px}#article-form[hidden]{display:none}
@media(max-width:700px){.article-admin-panel{padding:12px}.article-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.article-table th,.article-table td{padding:5px 7px}.article-tools select{width:100%}}
@media(max-width:400px){.article-fields{grid-template-columns:1fr}}

/* v20.48.1 Admin Artikli warnings must appear inside the modal, above the editor. */
.article-admin-warning:not([hidden]){display:block;position:sticky;top:0;z-index:10;padding:14px 16px;background:#fff0e5;color:#692f12;border:2px solid #d9772c;border-radius:10px;font-weight:700;box-shadow:0 3px 14px rgba(0,0,0,.12)}
.dark-mode .article-admin-warning:not([hidden]){background:#482715;color:#ffe4cb;border-color:#f3a361}
.article-active-shift:not([hidden]){display:grid;gap:8px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--soft)}
.article-active-shift p{margin:0}
.article-active-shift button{justify-self:start}

/* v20.50 guest admin */
.guest-merge-form {border-top:1px solid var(--line);margin-top:14px;padding-top:12px;display:grid;gap:9px}
.guest-merge-form select {display:block;min-height:40px;width:100%;max-width:420px}
#guests-admin-rows tr:nth-child(even) {background:var(--row-alt)}
#guests-admin-rows td {padding:9px 8px}
@media(max-width:600px){#guests-admin-rows td {padding:8px 5px;font-size:.88rem}.guest-merge-form {gap:8px}}

/* v20.51: viewport-level notices, including messages from modal dialogs. */
.poruka:not([hidden]) {
    position:fixed;
    z-index:2147480000;
    top:16px;
    right:16px;
    left:auto;
    bottom:auto;
    width:min(460px,calc(100vw - 32px));
    max-width:none;
    max-height:min(55dvh,420px);
    margin:0;
    display:flex;
    align-items:flex-start;
    gap:12px;
    overflow:auto;
    padding:13px 12px 13px 14px;
    border:1px solid var(--line);
    border-left:4px solid var(--success);
    border-radius:13px;
    background:var(--surface);
    color:var(--text);
    box-shadow:0 14px 44px rgba(0,0,0,.22);
    overflow-wrap:anywhere;
}
.poruka.greska:not([hidden]) {
    border-color:var(--danger);
    border-left:4px solid var(--danger);
    color:var(--text);
    background:var(--danger-bg);
}
.notice-symbol {
    flex:none;
    width:24px;
    height:24px;
    border-radius:50%;
    background:var(--success-bg);
    color:var(--success);
    display:inline-grid;
    place-items:center;
    font-weight:800;
    font-size:15px;
}
.greska .notice-symbol { color:var(--danger); background:var(--surface); }
.notice-content { flex:1; min-width:0; white-space:pre-wrap; font-size:14px; line-height:1.45; padding-top:2px; }
.notice-close {
    flex:none;
    border-radius:9px;
    width:36px;
    min-height:36px;
    height:36px;
    padding:0;
    font-size:23px;
    line-height:1;
    background:transparent;
    color:var(--text);
    border:1px solid transparent;
}
.notice-close:hover { border-color:var(--line); }
/* Appearance follows the selected application theme (body.dark-mode), not system theme. */
@media (max-width:899px) {
    .poruka:not([hidden]) {
        top:auto;
        left:12px;
        right:12px;
        bottom:calc(12px + env(safe-area-inset-bottom, 0px));
        width:auto;
        max-height:min(45dvh,350px);
        padding:12px;
        gap:10px;
    }
    .notice-content { font-size:14px; }
}

/* v20.51: compact, mobile-responsive Admin / Site Settings. */
.site-admin-dialog { width:min(580px,calc(100vw - 20px)); }
.site-form { display:grid; gap:7px; }
.site-form label { margin:7px 0 0; }
.site-form input:not([type="checkbox"]),.site-logo-editor input[type="file"] { width:100%; }
.site-field-help { font-size:12px; color:var(--muted); }
.site-logo-choice { display:flex; align-items:center; gap:10px; margin:10px 0 6px; font-size:14px; }
.site-logo-choice input { flex:none; width:19px; height:19px; min-height:19px; accent-color:var(--accent); }
.site-logo-editor { display:grid; gap:9px; border:1px solid var(--line); border-radius:12px; padding:14px; }
.site-logo-editor h3 { margin:0; }
.site-logo-editor p { margin:0; }
.site-logo-preview { display:flex; align-items:center; justify-content:center; border:1px solid var(--line); background:#fff; min-height:100px; max-height:170px; border-radius:12px; padding:10px; }
.site-logo-preview img { width:auto; height:auto; max-width:100%; max-height:140px; object-fit:contain; }
.site-logo-editor input[type="file"] { font-size:14px; padding:8px; }
.site-logo-actions { display:flex; flex-wrap:wrap; gap:8px; }
.site-logo-actions button { flex:1 1 160px; }
.site-admin-message:not([hidden]) { padding:10px 12px; margin:0; background:var(--success-bg); color:var(--success); border:1px solid var(--line); border-radius:9px; font-size:13px; }
.site-admin-message.site-admin-error:not([hidden]) { background:var(--danger-bg); color:var(--danger); border-color:var(--danger); }
@media (max-width:520px) {
    .site-admin-dialog .ovlasti-panel { padding:13px; gap:12px; }
    .site-logo-editor { padding:11px; }
    .site-logo-actions { flex-direction:column; }
    .site-logo-actions button { width:100%; flex:auto; }
}

.login-brand #login-site-name { color:var(--text); font-size:20px; font-weight:800; line-height:1.15; text-transform:none; letter-spacing:-.025em; text-align:center; }

/* v20.52.1 Admin / Backup: compact, readable on desktop and iPhone */
.backup-admin-dialog { width:min(760px,calc(100vw - 18px)); max-height:92dvh; }
.backup-warning { padding:12px 14px; border:1px solid #dfaa63; border-radius:12px; background:#fff8ea; color:#704714; line-height:1.45; font-size:13px; }
body.dark-mode .backup-warning { background:#382a1e; border-color:#97713c; color:#ffddb2; }
.backup-section { display:grid; gap:10px; padding:14px; border:1px solid var(--line); border-radius:12px; }
.backup-section h3 { margin:0; }
.backup-section p { margin:0; }
.backup-actions { display:flex; gap:9px; flex-wrap:wrap; }
.backup-actions button { flex:1 1 190px; }
.backup-list { border:1px solid var(--line); border-radius:11px; overflow:hidden; max-height:365px; overflow-y:auto; }
.backup-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 11px; }
.backup-row:nth-child(odd) { background:var(--surface); }
.backup-row:nth-child(even) { background:var(--soft); }
.backup-file { display:flex; flex-direction:column; min-width:0; overflow-wrap:anywhere; }
.backup-file strong { font-size:13px; }
.backup-file .backup-date { color:var(--text); font-weight:650; font-size:12px; font-variant-numeric:tabular-nums; }
.backup-file small { color:var(--muted); margin-top:2px; }
.backup-row button { flex-shrink:0; min-width:96px; }
.backup-status:not([hidden]) { padding:11px 12px; border:1px solid var(--line); border-radius:10px; background:var(--success-bg); color:var(--success); font-weight:650; font-size:13px; }
.backup-status.backup-status-error:not([hidden]) { background:var(--danger-bg); color:var(--danger); border-color:var(--danger); }
.backup-restore-guide { background:var(--soft); }
.backup-restore-guide ol { margin:4px 0; padding-left:23px; display:grid; gap:7px; font-size:13px; }
.backup-section code,.backup-warning code { word-break:break-word; }
@media(max-width:520px){
    .backup-admin-dialog .ovlasti-panel { padding:12px; gap:12px; }
    .backup-actions { flex-direction:column; }
    .backup-row { align-items:stretch; flex-direction:column; gap:6px; }
    .backup-row button { width:100%; }
    .backup-section { padding:12px; }
}

.backup-pin-label { margin:2px 0 0; }
#backup-pin { width:min(250px,100%); max-width:100%; }
@media(max-width:520px){
    .backup-actions button { flex:0 0 auto; min-height:46px; }
}

/* v20.54 – Admin PIN renewal dashboard, both themes */
.user-pin-status{margin:10px 0 12px;padding:9px 12px;border-radius:9px;font-size:.88rem;line-height:1.4}
.user-pin-status-warn{background:#fff5df;color:#663d07;border:1px solid #dfba78}
.user-pin-status-ok{background:#e9f6ef;color:#125637;border:1px solid #a3d5b9}
.pin-status{display:inline-block;font-size:.78rem;font-weight:700;border-radius:7px;padding:4px 7px;white-space:nowrap}
.pin-status-pending{background:#fff2d6;color:#68410a}
.pin-status-ok{background:#e6f5eb;color:#145c39}
body.dark-mode .user-pin-status-warn{background:#3b2e1c;color:#ffdd9b;border-color:#836039}
body.dark-mode .user-pin-status-ok{background:#203d30;color:#b6edca;border-color:#456f59}
body.dark-mode .pin-status-pending{background:#46351b;color:#ffdeaa}
body.dark-mode .pin-status-ok{background:#234634;color:#c2f3d0}

/* v20.56: one-time opening balances, separate from regular stock movement. */
.opening-stock-dialog{width:min(1020px,calc(100vw - 20px))}
.opening-stock-info{padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--soft);font-size:.9rem}
.opening-stock-lock:not([hidden]){padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--soft);font-weight:700}
.opening-stock-wrap{max-height:55dvh}
.opening-stock-filter{display:inline-flex;align-items:center;gap:7px;font-size:.9rem;white-space:nowrap}
.opening-stock-input{display:flex;align-items:center;gap:8px}
.opening-stock-input input{width:108px;max-width:35vw;min-height:36px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:6px}
.opening-stock-input input[aria-invalid="true"]{border:2px solid var(--danger)}
.opening-stock-input small{color:var(--muted);font-size:.75rem}
.opening-stock-actions{display:flex;align-items:end;gap:12px;flex-wrap:wrap;justify-content:space-between}
.opening-stock-actions[hidden]{display:none}
.opening-stock-memo{display:grid;gap:5px;flex:1;min-width:220px;font-size:.86rem}
.opening-stock-memo input{width:100%;box-sizing:border-box;min-height:40px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;padding:8px}
@media(max-width:600px){.opening-stock-input{flex-direction:column;align-items:stretch;gap:3px}.opening-stock-input input{width:100%;max-width:unset;box-sizing:border-box}.opening-stock-wrap{max-height:48dvh}.opening-stock-actions>button{width:100%}}

/* v20.57 – a separate read-only remote dashboard. */
.nadzor-link{display:inline-flex;align-items:center;justify-content:center;padding:.55rem .85rem;border:1px solid var(--line);border-radius:.65rem;text-decoration:none;white-space:nowrap}
.nadzor-login-link{display:block;text-align:center;margin:.8rem 0;color:inherit;text-decoration:underline}

.nadzor-link[hidden]{display:none!important}

/* INVENTURA v20.57 - POPRAVAK MOBILNOG PROZORA OVLASTI */

#ovlasti-dialog.ovlasti-dialog {
    box-sizing: border-box;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

#ovlasti-dialog .ovlasti-panel {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

#ovlasti-dialog .ovlasti-title {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface);
    padding: 8px 0 10px;
    border-bottom: 1px solid var(--line);
}

#ovlasti-dialog .ovlasti-panel section {
    min-width: 0;
}

/* Sprijeci pomicanje pozadine dok su Ovlasti otvorene */
html:has(#ovlasti-dialog[open]),
body:has(#ovlasti-dialog[open]) {
    overflow: hidden;
}

/* Mobilni telefoni */
@media (max-width: 700px) {
    #ovlasti-dialog.ovlasti-dialog {
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
    }

    #ovlasti-dialog .ovlasti-title {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    #ovlasti-dialog .ovlasti-title > div {
        min-width: 0;
    }

    #ovlasti-dialog .ovlasti-title h2 {
        font-size: 1.05rem;
    }

    #ovlasti-dialog .ovlasti-title button {
        width: auto;
        min-height: 44px;
        flex: 0 0 auto;
    }
}


/* v20.58: article editor feedback; the tested permissions patch above is unchanged. */
#article-admin-dialog { box-sizing:border-box; max-height:calc(100vh - 16px); max-height:calc(100dvh - 16px); overflow-y:auto; overscroll-behavior-y:contain; }
#article-admin-dialog .article-admin-panel { box-sizing:border-box; min-width:0; }
#article-admin-dialog .article-admin-panel > header { position:sticky; top:0; z-index:12; background:var(--surface); padding:8px 0; border-bottom:1px solid var(--line); }
#article-admin-dialog .article-admin-panel > header button { min-height:44px; flex:0 0 auto; }
#article-admin-dialog .article-admin-warning { position:static; }
#article-admin-dialog .article-admin-warning.is-success { background:var(--success-bg,#e9f6ef); color:var(--success,#125637); border-color:var(--success,#125637); }
#article-admin-dialog .article-form-hint { padding:10px; background:var(--soft); border-radius:8px; line-height:1.45; }
#article-admin-dialog .article-table button:disabled { opacity:.5; cursor:not-allowed; }
#article-admin-dialog .article-form-actions { margin-top:12px; }
.new-article-badge { display:inline-block; margin-top:5px; font-size:.72rem; font-weight:700; color:var(--accent); }
html:has(#article-admin-dialog[open]), body:has(#article-admin-dialog[open]) { overflow:hidden; }
@media(max-width:700px) {
    #article-admin-dialog { height:calc(100vh - 16px); height:calc(100dvh - 16px); }
    #article-admin-dialog .article-admin-panel > header { flex-wrap:nowrap; align-items:flex-start; }
    #article-admin-dialog h2 { font-size:1.05rem; }
    #article-admin-dialog .article-admin-panel > header > div { min-width:0; }
    #article-admin-dialog .article-form-actions button { min-height:44px; }
    #article-admin-dialog .article-fields input { font-size:16px; }
}


/* v20.60 - minimalna naplata duga dostupna svim aktivnim korisnicima */
.uplata-duga-form{display:grid;gap:8px;padding:10px 0}.uplata-duga-form select,.uplata-duga-form input{width:100%;box-sizing:border-box;min-height:44px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);padding:9px 10px}.uplata-duga-form button{width:100%;min-height:46px}.uplata-duga-form small{line-height:1.35}.uplata-duga-form+#veresije-detalji{margin-top:12px}#veresije-detalji[hidden]{display:none!important}#veresije-detalji hr{border:0;border-top:1px solid var(--line);margin:12px 0}#veresije-detalji h3{font-size:.95rem;margin:0 0 8px}


/* =========================================================
   v20.61 - jedinstveni vizualni sustav i diskretni zebra redovi
   ========================================================= */
:root {
    --row-alt:#f8fafc;
    --accent-fill:#c54217;
    --accent-fill-hover:#aa3610;
    --on-accent:#fff;
    --warning:#704714;
    --warning-bg:#fff8ea;
    --debt-bg:#f2faf8;
    --debt-border:#c8e7dc;
    --debt-input-border:#a6d2c4;
    --expense-bg:#fff8ee;
    --expense-border:#eedbc0;
    --expense-input-border:#e0bc91;
}
body.dark-mode {
    --row-alt:#18283a;
    --accent-fill:#c54217;
    --accent-fill-hover:#aa3610;
    --on-accent:#fff;
    --warning:#ffddb2;
    --warning-bg:#382a1e;
    --debt-bg:#172e31;
    --debt-border:#385d5d;
    --debt-input-border:#477b72;
    --expense-bg:#32291f;
    --expense-border:#68513a;
    --expense-input-border:#936c4c;
}

/* Ista akcijska boja u navigaciji, filtrima i primarnim gumbima. */
.primary,
.views button[aria-current="page"],
.filters button[aria-pressed="true"] {
    background:var(--accent-fill);
    border-color:var(--accent-fill);
    color:var(--on-accent);
}
.primary:hover:not(:disabled),
.views button[aria-current="page"]:hover:not(:disabled),
.filters button[aria-pressed="true"]:hover:not(:disabled) {
    background:var(--accent-fill-hover);
    border-color:var(--accent-fill-hover);
    color:var(--on-accent);
}
.nadzor-link { border-color:var(--line); }

/* Rucno odabrana tema upravlja svim komponentama; CSS ne prati OS mimo prvog odabira teme. */
#veresije-blok { background:var(--debt-bg); border-color:var(--debt-border); }
#rashodi-blok { background:var(--expense-bg); border-color:var(--expense-border); }
#veresije-blok input { border-color:var(--debt-input-border); }
#rashodi-blok input { border-color:var(--expense-input-border); }

/* Jedinstveni zebra-prikaz: statusne boje uvijek imaju prednost. */
table tbody tr:nth-child(even):not(.pregledano):not(.nema-zalihe):not(.ima-gresku):not(.kriticna-zaliha) > td {
    background:var(--row-alt);
}
.mreza-kartica > .artikl-kartica:nth-child(even):not(.pregledano):not(.nema-zalihe):not(.ima-gresku):not(.kriticna-zaliha):not(.otvoreno) {
    background:var(--row-alt);
}
.dugovi-lista .dug-red:nth-child(even),
.duznici-view .duznik-sazetak:nth-of-type(even),
.duznici-view .povijest-lista .povijest-red:nth-child(even),
.dugovi-sekcija > .dug-red:nth-of-type(even),
.ovlasti-panel .feature-toggles > .feature-toggle:nth-child(even),
.ovlasti-panel .stock-limit-editor > :nth-child(even),
.ovlasti-user-row:nth-child(even),
.backup-row:nth-child(even),
.arhiva-fin-red:nth-child(even),
#lista-rashoda > .fin-stavka:nth-child(even),
#lista-duznika > .fin-uplata:nth-child(even) {
    background:var(--row-alt);
}
.dugovi-lista .dug-red:nth-child(odd),
.duznici-view .duznik-sazetak:nth-of-type(odd),
.duznici-view .povijest-lista .povijest-red:nth-child(odd),
.dugovi-sekcija > .dug-red:nth-of-type(odd),
.ovlasti-panel .feature-toggles > .feature-toggle:nth-child(odd),
.ovlasti-panel .stock-limit-editor > :nth-child(odd),
.ovlasti-user-row:nth-child(odd),
.backup-row:nth-child(odd) {
    background:var(--surface);
}

/* Admin tablice koriste isti vizualni ritam kao radni prikazi. */
.article-table th { background:var(--soft); color:var(--muted); }
.article-table tbody tr:nth-child(2n) { background:transparent; }
#guests-admin-rows tr:nth-child(even) { background:transparent; }

/* Upozorenja i statusi ostaju semanticki, ali koriste paletu aktivne teme. */
.backup-warning { background:var(--warning-bg); color:var(--warning); }
body.dark-mode .backup-warning { background:var(--warning-bg); color:var(--warning); }

/* Dosljedniji tipografski detalji. */
button { font-weight:650; }
summary { line-height:1.35; }
.article-admin-panel h2,.ovlasti-title h2 { letter-spacing:-.015em; }


/* =========================================================
   v20.62 - mobilne lokacije, admin hijerarhija i arhiva
   ========================================================= */
@media (max-width:899px) {
  .lokacija-kartica .lokacija-brojcanik { display:grid; grid-template-columns:minmax(60px,76px) minmax(0,1fr) minmax(60px,76px); gap:9px; width:100%; max-width:none; align-items:center; }
  .lokacija-kartica .lokacija-brojcanik button { width:100%; height:62px; min-height:62px; min-width:0; font-size:29px; padding:4px; border-radius:12px; }
  .lokacija-kartica .lokacija-brojcanik input { width:100%; min-width:0; height:62px; min-height:62px; padding:7px 4px; text-align:center; font-size:24px; font-weight:800; }
  .arhiva-report-sort-wrap { order:3; }
}
@media (max-width:420px) {
  .lokacija-kartica .lokacija-brojcanik { grid-template-columns:62px minmax(0,1fr) 62px; gap:7px; }
  .lokacija-kartica .lokacija-brojcanik button { height:58px; min-height:58px; }
  .lokacija-kartica .lokacija-brojcanik input { height:58px; min-height:58px; font-size:22px; }
}


/* v20.63 - oznake automatskih sigurnosnih kopija */
.backup-file-title{display:flex;align-items:center;gap:7px;flex-wrap:wrap;min-width:0}.backup-file-title strong{min-width:0;overflow-wrap:anywhere}.backup-kind{display:inline-flex;align-items:center;min-height:20px;padding:2px 7px;border-radius:999px;border:1px solid var(--line);background:var(--soft);color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.01em;white-space:nowrap}.backup-kind-auto{background:var(--success-bg);color:var(--success)}


/* v20.68: clearer mobile calculation amounts. Only appearance changes; calculation unchanged. */
@media (max-width:899px) {
  .mreza-kartica .artikl-kartica .kartica-vrh { align-items:flex-start; }
  .mreza-kartica .artikl-kartica .iznos-kartice { flex:0 0 auto; padding-top:1px; }
  .mreza-kartica .artikl-kartica .iznos-kartice b[data-iznos] {
    display:inline-block; padding:4px 7px; border:1px solid transparent; border-radius:9px;
    color:var(--muted); line-height:1.15; white-space:nowrap;
  }
  .mreza-kartica .artikl-kartica.ima-prodaju .iznos-kartice b[data-iznos] {
    color:var(--success); background:var(--success-bg); border-color:var(--success);
  }
  .mreza-kartica .artikl-kartica.negativna-prodaja .iznos-kartice b[data-iznos] {
    color:var(--danger); background:var(--danger-bg); border-color:var(--danger);
  }
  .mreza-kartica .artikl-kartica .iznos-kartice small {
    display:block; margin-top:4px; font-size:14px; font-weight:650;
    line-height:1.35; color:var(--text); white-space:nowrap;
  }
  .mreza-kartica .artikl-kartica .iznos-kartice small [data-prodano] { font-weight:800; }
}
@media (max-width:359px) {
  .mreza-kartica .artikl-kartica .iznos-kartice b[data-iznos] { font-size:18px; }
}


/* v20.69: Visual distinction on desktop matches mobile sales badges. */
@media (min-width:900px) {
  .inventura-tablica td:last-child strong[data-iznos] {
    display:inline-block; padding:4px 7px; border-radius:9px;
    color:var(--muted); box-shadow:inset 0 0 0 1px transparent;
    white-space:nowrap;
  }
  .inventura-tablica tr.ima-prodaju td:last-child strong[data-iznos] {
    color:var(--success); background:var(--success-bg);
    box-shadow:inset 0 0 0 1px var(--success);
  }
  .inventura-tablica tr.negativna-prodaja td:last-child strong[data-iznos] {
    color:var(--danger); background:var(--danger-bg);
    box-shadow:inset 0 0 0 1px var(--danger);
  }
}
/* The badge text, not colour alone, indicates the server state. */
.radna-smjena-status .sync-state {
  display:inline-flex; align-items:center; padding:4px 9px;
  border-radius:8px; font-weight:750; font-size:13px;
  line-height:1.35; overflow-wrap:anywhere;
  background:var(--soft); color:var(--text);
}
.radna-smjena-status .sync-state[data-sync-state="saved"],
[data-sync-row][data-sync-state="saved"] {
  background:var(--success-bg); color:var(--success);
}
.radna-smjena-status .sync-state[data-sync-state="pending"],
[data-sync-row][data-sync-state="pending"] {
  background:var(--accent-soft); color:var(--accent);
}
.radna-smjena-status .sync-state[data-sync-state="offline"],
[data-sync-row][data-sync-state="offline"] {
  background:var(--accent-soft); color:var(--accent);
}
.radna-smjena-status .sync-state[data-sync-state="error"],
[data-sync-row][data-sync-state="conflict"],
[data-sync-row][data-sync-state="error"] {
  background:var(--danger-bg); color:var(--danger);
}
[data-sync-row] {
  display:inline-block; min-width:0; max-width:100%; margin-top:5px;
  padding:3px 7px; border-radius:7px; font-size:11px;
  line-height:1.35; font-weight:700; white-space:normal;
  overflow-wrap:anywhere; background:var(--soft);
}
.kartica-status [data-sync-row] { text-align:center; }
@media (max-width:359px) {
  .kartica-status [data-sync-row] { flex:0 1 auto; }
}


/* v20.70 - filter feedback and safe mobile touch targets. */
.filter-feedback {
  flex: 1 0 100%; display:flex; align-items:center; justify-content:flex-end;
  flex-wrap:wrap; gap:8px; min-width:0;
}
.filter-feedback [role="status"] {
  color:var(--muted); font-weight:650; font-size:13px;
}
.filter-feedback button {
  min-height:38px; padding:6px 12px; border:1px solid var(--line);
  border-radius:9px; font-size:13px;
}
@media (max-width:899px) {
  .filter-feedback { justify-content:space-between; width:100%; }
  .lokacija-kartica button[data-action="confirm-location"],
  .artikl-kartica button[data-action="confirm"],
  .artikl-kartica button[data-action="confirm-direct"] { min-height:48px; }
}

/* v20.72: local draft and in-flight work indicators, no changes to accounting. */
.pending-overview { grid-column:1/-1; margin: 0.45rem 0 0.8rem; padding: 0.75rem 0.9rem; border-radius: 0.75rem;
    border: 1px solid var(--border, #b7a06b); background: rgba(196, 148, 47, 0.12);
    font-size: 0.9rem; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.pending-overview[data-state="error"] { border-color: #d85e5e; background: rgba(216,94,94,0.11); }
.pending-overview[data-state="offline"] { border-color: #c78b38; }
.pending-overview[hidden], .note-conflict[hidden], #biljeska-odbaci[hidden] { display: none !important; }
.shift-note-actions { flex-wrap: wrap; }
.shift-note-buttons { display:flex; flex-wrap:wrap; align-items:center; gap:0.5rem; }
.shift-note-buttons button { min-height: 42px; }
.note-conflict { margin-top:0.7rem; padding:0.85rem; border-radius:0.65rem;
    border: 1px solid #c97836; background:rgba(201,120,54,.1); }
.note-conflict pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:190px;
    overflow-y:auto; font:inherit; padding:0.5rem; border:1px solid currentColor; border-radius:0.4rem; }
@media (max-width: 899px) { .pending-overview { order:4; } }
@media (max-width: 600px) {
    .pending-overview { font-size: 0.93rem; line-height:1.5; margin:0.5rem 0 0.65rem; }
    .shift-note-buttons button { flex:1 1 auto; }
}


/* v20.72 UI R2: retain important sync warnings in view while scrolling.
   The banner is rendered only for work needing attention, never for a
   normal quick + / - PATCH. Thus ordinary clicks do not shift article rows. */
.pending-overview:not([hidden]) {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 19;
  align-self: start;
  background: var(--surface); /* Opaque: no article controls visible through text. */
  border: 2px solid #b27b27;
  box-shadow: 0 4px 12px #00000025;
  max-height: min(30dvh, 170px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pending-overview[data-state="error"]:not([hidden]) { border-color: var(--danger); }
@media (max-width: 899px) {
  .pending-overview:not([hidden]) {
    /* Mobile navigation stays sticky and measures 56px in v20.72. */
    top: calc(env(safe-area-inset-top, 0px) + 62px);
    margin: 0 0 10px;
    padding: 8px 10px;
    line-height: 1.35;
    font-size: 13px;
    max-height: min(25dvh, 132px);
  }
}

/* v20.73: Field-by-field safe reconciliation of multi-device conflicts. */
.conflict-table-scroll { overflow-x:auto; max-width:100%; margin:.6rem 0; }
.conflict-compare { width:100%; border-collapse:collapse; color:var(--text); font-size:clamp(12px, 1.2vw, 14px); text-align:left; }
.conflict-compare th, .conflict-compare td { padding:6px 7px; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.conflict-compare thead th { font-weight:700; }
.conflict-compare .conflict-direct { font-weight:700; }
.conflict-hint { font-size:13px; line-height:1.4; }
.conflict-panel > strong { font-size:14px; display:block; }

/* v20.75: correction audit and modal clarity */
.arhiva-dorada { border-left: 3px solid var(--boja-primarna, currentColor); padding-left: 0.75rem; }
.correction-history { margin: .75rem 0; padding-left: 1.5rem; }
.correction-history li { margin: 0 0 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border, #9995); }
.correction-history li p { margin: .2rem 0; }
#archive-correction-dialog form { display: grid; gap: .65rem; }
#archive-correction-dialog textarea, #archive-correction-dialog select { width: 100%; box-sizing: border-box; }

/* v20.75.1: show Admin correction controls in the right Archive tools column. */
.arhiva-dorada-alati {display:grid; gap:8px; padding:12px; border-top:1px solid var(--line); border-radius:10px;}
.arhiva-dorada-alati[hidden] {display:none !important;}
.arhiva-dorada-alati strong {font-size:13px;}
.arhiva-dorada-alati small {display:block; line-height:1.45;}
.arhiva-dorada-alati button {width:100%;}
.arhiva-dorada-alati button:disabled {opacity:.55; cursor:not-allowed;}

/* 20.78 (U2): vlastiti prozor za potvrdu/unos */
dialog.app-dialog{border:1px solid var(--line,#ccc);border-radius:14px;padding:0;max-width:min(520px,calc(100vw - 32px));width:100%;background:var(--surface,#fff);color:var(--text,inherit);box-shadow:0 18px 50px rgba(0,0,0,.35)}
dialog.app-dialog::backdrop{background:rgba(0,0,0,.45)}
dialog.app-dialog form{margin:0;padding:20px 20px 16px;display:flex;flex-direction:column;gap:14px}
.app-dialog-text{margin:0;white-space:pre-line;font-size:16px;line-height:1.45;overflow-wrap:anywhere;max-height:60vh;overflow:auto}
.app-dialog-input{font-size:18px;padding:10px 12px;min-height:46px;border:1px solid var(--line,#bbb);border-radius:10px;width:100%;box-sizing:border-box;background:var(--surface,#fff);color:inherit}
.app-dialog-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.app-dialog-actions button{min-height:46px;min-width:120px;padding:0 18px;border-radius:10px;font-size:16px;cursor:pointer}
.app-dialog-cancel{background:transparent;border:1px solid var(--line,#bbb);color:inherit}
@media (max-width:420px){.app-dialog-actions button{flex:1 1 auto;min-width:0}}

/* 20.78 (U5): Arhiva — zaglavlje tablice i stupac Artikl uvijek vidljivi */
.arhiva-okvir { max-height:calc(100dvh - 210px); min-height:240px; overflow:auto; }
.arhiva-okvir .arhiva-tablica thead th { position:sticky; top:0; z-index:2; background:var(--soft); box-shadow:inset 0 -1px 0 var(--line); }
.arhiva-okvir .arhiva-tablica td.arhiva-artikl, .arhiva-okvir .arhiva-tablica thead th:first-child { position:sticky; left:0; z-index:1; box-shadow:inset -1px 0 0 var(--line); text-align:left; }
.arhiva-okvir .arhiva-tablica thead th:first-child { z-index:3; }
.arhiva-okvir .arhiva-tablica tbody tr:nth-child(even) td.arhiva-artikl { background:var(--soft); }
.arhiva-okvir .arhiva-tablica tbody tr:nth-child(odd) td.arhiva-artikl { background:var(--surface); }
@media (max-width:700px) {
  .arhiva-okvir { max-height:calc(100dvh - 170px); }
  .arhiva-okvir .arhiva-tablica td.arhiva-artikl { max-width:38vw; min-width:110px; cursor:pointer; }
  .arhiva-okvir .arhiva-tablica td.arhiva-artikl strong, .arhiva-okvir .arhiva-tablica td.arhiva-artikl small { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .arhiva-okvir .arhiva-tablica td.arhiva-artikl.puni-naziv strong, .arhiva-okvir .arhiva-tablica td.arhiva-artikl.puni-naziv small { white-space:normal; overflow:visible; }
}

/* 20.78 (U7): Veresije — Novo zaduženje iznad Naplate duga, jasno razdvojeno bojom */
#veresije-blok .fin-odjeljak { border-radius:10px; padding:10px 12px 12px; margin-top:10px; border:1px solid; border-left-width:5px; }
#veresije-blok .fin-odjeljak h3 { margin:0 0 6px; font-size:15px; display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
#veresije-blok .fin-odjeljak h3 small { font-weight:500; font-size:12px; color:var(--muted); }
#veresije-blok .fin-znak { display:inline-grid; place-items:center; width:22px; height:22px; border-radius:50%; font-weight:800; color:#fff; flex:0 0 auto; }
#veresije-blok .fin-zaduzenje { background:#fff3f0; border-color:#efc4b8; border-left-color:#c0442b; }
#veresije-blok .fin-zaduzenje h3 { color:#9c3320; }
#veresije-blok .fin-zaduzenje .fin-znak { background:#c0442b; }
#veresije-blok .fin-zaduzenje input { border-color:#e4a998; }
#dug-form button[type=submit] { background:#b23d26; border-color:#b23d26; color:#fff; }
#dug-form button[type=submit]:hover:not(:disabled) { background:#93301d; color:#fff; }
#veresije-blok .fin-naplata { background:#eefaf4; border-color:#bfe3d0; border-left-color:#2f7d5b; }
#veresije-blok .fin-naplata h3 { color:#22684a; }
#veresije-blok .fin-naplata .fin-znak { background:#2f7d5b; }
#uplata-duga-form button[type=submit] { background:#2f7d5b; border-color:#2f7d5b; color:#fff; }
#uplata-duga-form button[type=submit]:hover:not(:disabled) { background:#25664a; color:#fff; }
body.dark-mode #veresije-blok .fin-zaduzenje { background:#3a2220; border-color:#7a4135; border-left-color:#ff8a70; }
body.dark-mode #veresije-blok .fin-zaduzenje h3 { color:#ffb4a3; }
body.dark-mode #veresije-blok .fin-zaduzenje .fin-znak { background:#d2553b; }
body.dark-mode #veresije-blok .fin-naplata { background:#16322a; border-color:#386b57; border-left-color:#5fd3a0; }
body.dark-mode #veresije-blok .fin-naplata h3 { color:#a6ead5; }
body.dark-mode #veresije-blok .fin-naplata .fin-znak { background:#2f8f66; }
/* 20.78 (U5): naziv artikla u Arhivi kao gumb — dodir radi i na iPhoneu/iPadu */
.arhiva-naziv { all:unset; display:block; width:100%; cursor:pointer; text-align:left; -webkit-tap-highlight-color:transparent; }
.arhiva-naziv:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }
.arhiva-naziv strong, .arhiva-naziv small { display:block; }
/* 20.78.2 (U8): bez „plivanja” tablice na iPhoneu/iPadu — isključi elastično odbijanje i prijenos pomicanja na stranicu */
/* 20.78.3: samo na dodirnim uređajima i samo za tablicu koja se sama pomiče okomito (Arhiva).
   Na desktopu kotačić mora prenijeti pomicanje na stranicu kad tablica nema što pomaknuti. */
.tablica-okvir { overscroll-behavior-x:none; }
@media (pointer:coarse) { .arhiva-okvir { overscroll-behavior:none; } }

/* ===== 20.79 (U1): KOMPAKTNI PRIKAZ ZA DESKTOP =====
   Vrijedi samo kad je <html class="gustoca-kompakt"> (Auto na računalu s mišem ≥1280 px ili ručni izbor).
   Touch prikaz ostaje nepromijenjen. */
.gustoca-gumb { white-space:nowrap; font-size:13px; }
@media (max-width:700px) { .gustoca-gumb { display:none; } }

html.gustoca-kompakt .inventura-tablica { font-size:12.5px; }
html.gustoca-kompakt .inventura-tablica th { padding:7px 6px; font-size:10.5px; }
html.gustoca-kompakt .inventura-tablica td { padding:3px 6px; }
html.gustoca-kompakt .inventura-tablica td:first-child { text-align:left; }
/* Naziv, kategorija, šifra i stanje lokacija u jednom-dva reda umjesto četiri */
html.gustoca-kompakt .inventura-tablica .artikl-naziv { display:inline; font-size:13px; line-height:1.25; }
html.gustoca-kompakt .inventura-tablica .artikl-meta { display:inline-flex; margin:0 0 0 6px; vertical-align:1px; gap:3px; }
html.gustoca-kompakt .inventura-tablica .artikl-meta>span { padding:0 4px; }
html.gustoca-kompakt .inventura-tablica .lokacija-mini { display:block; font-size:10px; line-height:1.2; margin-top:1px; }
/* „Spremljeno” se ne ponavlja u svakom retku; prikazuje se samo kad nešto nije spremljeno ili je sukob */
html.gustoca-kompakt .inventura-tablica [data-sync-row][data-sync-state="saved"],
html.gustoca-kompakt .inventura-tablica [data-sync-row]:empty { display:none; }
html.gustoca-kompakt .inventura-tablica [data-sync-row] { margin-top:1px; font-size:10px; padding:0 4px; }
/* Polja i gumbi u tablici */
html.gustoca-kompakt .inventura-tablica input { min-height:30px; height:30px; padding:3px 6px; font-size:14px; border-radius:7px; }
html.gustoca-kompakt .inventura-tablica button { min-height:30px; padding:3px 8px; border-radius:7px; }
html.gustoca-kompakt .inventura-tablica .brojcanik { gap:3px; }
html.gustoca-kompakt .inventura-tablica .brojcanik button { width:28px; flex:0 0 28px; min-height:30px; height:30px; font-size:16px; padding:0; }
html.gustoca-kompakt .inventura-tablica .brojcanik input { width:62px; }
html.gustoca-kompakt .inventura-tablica .potvrda { min-height:30px; min-width:96px; font-size:11px; padding:3px 7px; gap:4px; }
html.gustoca-kompakt .inventura-tablica .potvrda>span:first-child { font-size:15px; }
html.gustoca-kompakt .inventura-tablica .lokacija-status { font-size:11px; min-width:120px; }
html.gustoca-kompakt .inventura-tablica td:nth-child(6) { width:140px; }
html.gustoca-kompakt .inventura-tablica td:last-child strong[data-iznos] { font-size:14px; }
html.gustoca-kompakt .inventura-tablica .jedinicna-cijena { margin-top:0; font-size:9.5px; }
html.gustoca-kompakt .inventura-tablica .row-error { margin:2px 0 0; font-size:11px; }
/* Traka iznad tablice i bočni panel */
html.gustoca-kompakt #pogled-filteri button, html.gustoca-kompakt #pogled-filteri select, html.gustoca-kompakt #pogled-filteri input { min-height:34px; padding-top:4px; padding-bottom:4px; font-size:13px; }
html.gustoca-kompakt .lokacija-page-head { padding-top:8px; padding-bottom:8px; }
html.gustoca-kompakt .lokacija-page-head button { min-height:34px; padding:4px 10px; font-size:13px; }
html.gustoca-kompakt .summary-card button { min-height:38px; }
html.gustoca-kompakt .inventura-tablica tbody tr:hover td { background:var(--accent-soft); }
html.gustoca-kompakt .vaga-tablica .vaga-tara-fixed { min-height:30px; height:30px; padding:3px 8px; font-size:14px; border-radius:7px; }
html.gustoca-kompakt .inventura-tablica td:first-child { min-width:270px; }
html.gustoca-kompakt .lokacija-page-head p { margin:2px 0 0; font-size:12px; }
/* 20.79.1: uži razmaci među stupcima u kompaktnom prikazu — tablica je široka koliko sadržaj, ne cijeli ekran */
html.gustoca-kompakt .tablica-okvir:has(> .inventura-tablica) { width:fit-content; max-width:100%; }
html.gustoca-kompakt .inventura-tablica { width:auto; min-width:0; }
html.gustoca-kompakt .inventura-tablica th, html.gustoca-kompakt .inventura-tablica td { padding-left:9px; padding-right:9px; }
html.gustoca-kompakt .inventura-tablica td:nth-child(6) { width:auto; }
html.gustoca-kompakt .inventura-tablica td:first-child { min-width:250px; max-width:340px; }
html.gustoca-kompakt .inventura-tablica .prethodno-nepouzdano { font-size:11px; font-style:italic; white-space:normal; display:inline-block; max-width:150px; line-height:1.2; }
html.gustoca-kompakt .inventura-tablica .bottle-calc { font-size:9.5px; margin-top:1px; line-height:1.1; }
/* 20.79.1: Dužnici u kompaktnom prikazu — popis kao gusta tablica */
html.gustoca-kompakt .duznici-head { padding:10px 14px; margin-bottom:10px; }
html.gustoca-kompakt .duznici-head h2 { font-size:18px; margin:0; }
html.gustoca-kompakt .duznici-head p { font-size:12px; }
html.gustoca-kompakt .duznici-alati input, html.gustoca-kompakt .duznici-alati select { min-height:34px; padding:4px 10px; font-size:13px; }
html.gustoca-kompakt .duznik-sazetak { grid-template-columns:minmax(220px,340px) 130px 130px auto; justify-content:start; gap:6px 24px; padding:5px 12px; margin:0; border-radius:0; border-top:0; max-width:900px; }
html.gustoca-kompakt .duznici-head + .duznik-sazetak { border-top:1px solid var(--line); border-radius:10px 10px 0 0; }
html.gustoca-kompakt .duznik-sazetak:last-child { border-radius:0 0 10px 10px; }
html.gustoca-kompakt .duznik-sazetak h3 { display:inline; font-size:14px; margin:0 8px 0 0; }
html.gustoca-kompakt .duznik-sazetak small { font-size:11px; }
html.gustoca-kompakt .duznik-saldo, html.gustoca-kompakt .duznik-broj { flex-direction:row; align-items:baseline; gap:6px; }
html.gustoca-kompakt .duznik-saldo span, html.gustoca-kompakt .duznik-broj span { font-size:9.5px; }
html.gustoca-kompakt .duznik-saldo strong, html.gustoca-kompakt .duznik-broj strong { font-size:14px; }
html.gustoca-kompakt .duznik-sazetak > button { min-height:30px; padding:3px 12px; font-size:13px; }
html.gustoca-kompakt .duznik-detalji-head, html.gustoca-kompakt .uplata-kartica, html.gustoca-kompakt .dugovi-sekcija, html.gustoca-kompakt .duznik-povijest { padding:10px 14px; margin:8px 0; max-width:900px; }
html.gustoca-kompakt .duznik-detalji-head button, html.gustoca-kompakt .uplata-kartica button, html.gustoca-kompakt .dugovi-sekcija button { min-height:32px; padding:4px 12px; }
html.gustoca-kompakt .uplata-kartica input { min-height:34px; padding:4px 10px; }
html.gustoca-kompakt .dug-red { padding:5px 10px; gap:6px 16px; }
html.gustoca-kompakt .povijest-lista { gap:2px; }
html.gustoca-kompakt .povijest-red { padding:5px 10px; }

/* ===== 20.79.2 (U14): bočni panel u kompaktnom prikazu =====
   - panel ostaje DESNO od tablice i na užim zaslonima (1000–1279 px, npr. zoom 125–150 %)
   - panel prati pomicanje stranice (sticky) da su Spremi / Zaključi uvijek pri ruci
   - gušće kartice: Radna smjena, Rashodi, Veresije, Kritične zalihe */
@media (min-width:1000px) {
  html.gustoca-kompakt .main-grid { grid-template-columns:minmax(0,1fr) 260px; gap:14px; }
  html.gustoca-kompakt .summary { display:flex; flex-direction:column; gap:10px; position:sticky; top:10px; max-height:calc(100dvh - 20px); overflow:auto; overscroll-behavior:contain; }
  html.gustoca-kompakt .workspace.duznici-view .main-grid { grid-template-columns:minmax(0,1fr); }
}
html.gustoca-kompakt .summary-card { padding:10px 12px; border-radius:12px; }
html.gustoca-kompakt .summary-card h2 { font-size:15px; margin:0 0 4px; }
html.gustoca-kompakt #brojac-unosa { margin:0 0 4px; font-size:12px; }
html.gustoca-kompakt .totals { margin:6px 0; }
html.gustoca-kompakt .totals>div { padding:3px 0; }
html.gustoca-kompakt .totals .gross { padding:4px 0 6px; }
html.gustoca-kompakt .totals .gross dd { font-size:21px; }
html.gustoca-kompakt .totals .net { margin-top:4px; padding:7px 10px; }
html.gustoca-kompakt .totals .net dd { font-size:21px; }
html.gustoca-kompakt #sazetak-napomena { font-size:11px; margin:4px 0 6px; }
html.gustoca-kompakt .summary-card .save-actions button { min-height:36px; padding:5px 10px; font-size:14px; }
html.gustoca-kompakt .summary-card .save-actions { gap:6px; }
html.gustoca-kompakt #rashodi-blok, html.gustoca-kompakt #veresije-blok { padding:7px 9px 9px; }
html.gustoca-kompakt .summary-card details+details { margin-top:8px; padding-top:8px; }
html.gustoca-kompakt .summary-card details > summary { font-size:14px; }
html.gustoca-kompakt .summary-card form label { font-size:12px; margin-top:4px; }
html.gustoca-kompakt .summary-card form input, html.gustoca-kompakt .summary-card select { min-height:32px; padding:4px 8px; font-size:14px; }
html.gustoca-kompakt .summary-card form button { min-height:34px; padding:4px 10px; margin:6px 0 8px; font-size:14px; }
html.gustoca-kompakt #veresije-blok .fin-odjeljak { padding:6px 9px 8px; margin-top:7px; }
html.gustoca-kompakt #veresije-blok .fin-odjeljak h3 { font-size:13px; margin-bottom:2px; }
html.gustoca-kompakt #veresije-blok .fin-znak { width:18px; height:18px; font-size:12px; }
html.gustoca-kompakt .summary-card small, html.gustoca-kompakt .summary-card .muted { font-size:11px; }
html.gustoca-kompakt .critical-stock-card summary { font-size:14px; }
html.gustoca-kompakt .critical-stock-card p { font-size:11px; margin:4px 0; }
/* 20.79.3: Obračun stane bez vodoravnog pomicanja od ~1180 px (kompaktno) */
html.gustoca-kompakt .inventura-tablica td:first-child { min-width:180px; max-width:260px; }
html.gustoca-kompakt .inventura-tablica .artikl-meta { flex-wrap:wrap; }
html.gustoca-kompakt .inventura-tablica input[data-field="primljeno"], html.gustoca-kompakt .inventura-tablica input[data-field="otpis"] { width:58px; }
html.gustoca-kompakt .inventura-tablica .brojcanik input { width:56px; }
html.gustoca-kompakt .inventura-tablica .brojcanik button { width:24px; flex-basis:24px; }
html.gustoca-kompakt .inventura-tablica .potvrda, html.gustoca-kompakt .inventura-tablica .lokacija-status { min-width:0; max-width:130px; white-space:normal; line-height:1.15; text-align:left; }
html.gustoca-kompakt .inventura-tablica th, html.gustoca-kompakt .inventura-tablica td { padding-left:6px; padding-right:6px; }

/* 20.79.3: Touch prikaz na užem zaslonu (700–1279 px): kartice ispod tablice bez praznina (dva stupca, popunjavanje odozgo) */
@media (min-width:701px) and (max-width:1279px) {
  html:not(.gustoca-kompakt) .summary { display:block; columns:2; column-gap:12px; }
  html:not(.gustoca-kompakt) .summary > * { break-inside:avoid; margin:0 0 12px; display:block; width:100%; }
  html:not(.gustoca-kompakt) .summary > [hidden] { display:none; }
}

/* 20.79.4 (U17): kompaktno — tablice koriste cijelu širinu do bočnog panela; jedinična cijena (€) uvijek vidljiva */
html.gustoca-kompakt .tablica-okvir:has(> .inventura-tablica) { width:auto; }
html.gustoca-kompakt .inventura-tablica { width:100%; }
html.gustoca-kompakt .inventura-tablica td:first-child { max-width:none; }
html.gustoca-kompakt .inventura-tablica td:not(:first-child), html.gustoca-kompakt .inventura-tablica th:not(:first-child) { width:1%; }
html.gustoca-kompakt .inventura-tablica .potvrda, html.gustoca-kompakt .inventura-tablica .lokacija-status { max-width:150px; }
@media (min-width:1180px) { html.gustoca-kompakt .inventura-tablica .lokacija-status { min-width:118px; } }
html.gustoca-kompakt .inventura-tablica .prethodno-nepouzdano { min-width:140px; }
html.gustoca-kompakt .inventura-tablica .jedinicna-cijena { display:block; white-space:nowrap; font-size:10.5px; color:var(--muted); }
@media (max-width:1179px) { html.gustoca-kompakt .inventura-tablica td:first-child { min-width:160px; } }
/* 20.79.4 (U18): kompaktno ispod 1600 px glavna navigacija ide u vlastiti red — ne prekriva naziv lokala ni ime korisnika */
@media (min-width:900px) and (max-width:1599px) {
  html.gustoca-kompakt .workspace { row-gap:10px; }
  html.gustoca-kompakt .views { grid-column:1/-1; grid-row:2; justify-self:stretch; }
  html.gustoca-kompakt .views button { min-height:38px; padding-top:6px; padding-bottom:6px; }
  html.gustoca-kompakt .brand, html.gustoca-kompakt .user-controls { grid-row:1; }
  html.gustoca-kompakt .user-controls { grid-column:2/-1; justify-self:end; }
}

/* ===== 20.80 (F1): nevagano piće s vagom — prijenos stanja uz pojedinačnu potvrdu ===== */
.vaga-akcije { display:inline-flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.potvrda.prijenos-potvrda.nevagano { border-color:#d98b16; color:#8a5200; background:#fff7e6; }
.potvrda.prijenos-potvrda.oznaceno { border-color:#b9770e; color:#7a4a00; background:#fdf0d5; }
body.dark-mode .potvrda.prijenos-potvrda.nevagano, body.dark-mode .potvrda.prijenos-potvrda.oznaceno { background:#3a2a10; color:#f3c776; border-color:#a8761f; }
body.dark-mode .oznaka-preneseno { color:#f3c776; }
.oznaka-preneseno { color:#b26a00; font-weight:700; }
html.gustoca-kompakt .inventura-tablica .prijenos-potvrda { white-space:normal; max-width:150px; text-align:left; line-height:1.15; }
@media (min-width:1180px) {
  .vaga-tablica .vaga-akcije { flex-wrap:nowrap; }
  .vaga-tablica .prijenos-potvrda, html.gustoca-kompakt .vaga-tablica .prijenos-potvrda { max-width:none; white-space:nowrap; }
}
/* 20.80.1: gumb prijenosa u Obračunu u najviše dva retka */
@media (min-width:1180px) { .inventura-tablica .prijenos-potvrda, html.gustoca-kompakt .inventura-tablica .prijenos-potvrda { min-width:128px; } }
/* 20.80.2: mobitel/tablet (kartice Vage) — Primijeni i Nije vagano u istom redu, jednake širine; „Spremljeno” ispod */
.vaga-kartica .kartica-status { flex-wrap:wrap; }
.vaga-kartica .kartica-status .vaga-akcije { flex:1 1 100%; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.vaga-kartica .kartica-status .vaga-akcije .potvrda { width:100%; min-width:0; justify-content:center; white-space:normal; text-align:center; line-height:1.2; }
.vaga-kartica .kartica-status .vaga-akcije + [data-sync-row] { margin-left:auto; }

/* ===== 20.82 (U20): Admin / Ovlasti — sekcije se razlikuju po vrsti ===== */
:root{--sek-alati:#2563a8;--sek-pristup:#6d4bb3;--sek-postavke:#0f7b84;--sek-bg:#f6f8fb}
body.dark-mode{--sek-alati:#7fb2ee;--sek-pristup:#b9a1f0;--sek-postavke:#6fd3dc;--sek-bg:#182739}
.ovlasti-panel section{background:var(--sek-bg);border-left:5px solid var(--line)}
.ovlasti-panel section>h3{padding-bottom:6px;border-bottom:1px solid var(--line)}
/* Ovlasti korisnika: 1–5 alati (artikli, backup, lokal, gosti, korisnici), 6–8 pristup, 9+ postavke */
#ovlasti-dialog .ovlasti-panel section:nth-of-type(-n+5){border-left-color:var(--sek-alati)}
#ovlasti-dialog .ovlasti-panel section:nth-of-type(-n+5)>h3{color:var(--sek-alati)}
#ovlasti-dialog .ovlasti-panel section:nth-of-type(n+6):nth-of-type(-n+8){border-left-color:var(--sek-pristup)}
#ovlasti-dialog .ovlasti-panel section:nth-of-type(n+6):nth-of-type(-n+8)>h3{color:var(--sek-pristup)}
#ovlasti-dialog .ovlasti-panel section:nth-of-type(n+9){border-left-color:var(--sek-postavke)}
#ovlasti-dialog .ovlasti-panel section:nth-of-type(n+9)>h3{color:var(--sek-postavke)}
/* ostali admin prozori (postavke lokala, backup, korisnici…): ujednačeno, plavi rub */
.ovlasti-dialog:not(#ovlasti-dialog) .ovlasti-panel section{border-left-color:var(--sek-alati)}
.ovlasti-panel .feature-toggles > .feature-toggle:nth-child(odd), .ovlasti-panel .stock-limit-editor > :nth-child(odd) { background:var(--surface); }

/* ===== 20.83 (F2): unos skladišta u kutijama + komadima ===== */
.pakiranje-unos { display:inline-flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.pakiranje-unos label { display:inline-flex; align-items:center; gap:4px; margin:0; font-weight:700; font-size:13px; color:var(--muted); }
.pakiranje-unos input { width:72px; text-align:center; }
.pakiranje-plus { font-weight:800; color:var(--muted); }
html.gustoca-kompakt .inventura-tablica .pakiranje-unos input { width:52px; }
@media (max-width:700px) { .pakiranje-unos { display:flex; width:100%; } .pakiranje-unos label { flex:1; } .pakiranje-unos input { width:100%; } }
