/* =====================================================================
   Prijava šteta — izgled (po uzoru na HA RENT, paleta tamnoplava + crvena)
   Boje se mijenjaju na jednom mjestu: varijable u :root.
   ===================================================================== */
:root {
  --radius: 10px;
  --background: #f4f6fa;
  --foreground: #1a2233;
  --card: #ffffff;
  --primary: #1f2b47;
  --primary-hover: #2c3b5f;
  --primary-foreground: #ffffff;
  --accent-red: #e0453a;
  --secondary: #eef1f6;
  --muted: #f0f2f7;
  --muted-foreground: #667085;
  --border: #e3e7ef;
  --ring: #5b74b8;
  --success: #16a34a;
  --warning: #d97706;
  --destructive: #dc2626;
  --info: #2563eb;
  --violet: #7c3aed;
  --sidebar: #1b2338;
  --sidebar-foreground: #dde3ef;
  --sidebar-muted: #8f9ab3;
  --sidebar-accent: #252f4a;
  --sidebar-border: #2b3552;
  --sidebar-highlight: #ff8f85; /* naziv aplikacije ispod loga, kao HA RENT */
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Barlow Semi Condensed", "IBM Plex Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
code { background: var(--muted); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
[hidden] { display: none !important; }

.ic { width: 16px; height: 16px; flex-shrink: 0; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
.tiny { font-size: 11px; color: var(--muted-foreground); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.r { text-align: right; } .c { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.pad { padding: 20px; }
.stack > * + * { margin-top: 12px; }
.eyebrow { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .18em; color: var(--accent-red); }

/* ---------- okvir aplikacije ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 240px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-foreground); }
.sidebar-in { display: flex; flex-direction: column; height: 100%; padding: 16px; }
/* logo + naziv aplikacije (isti raspored kao HA RENT) */
.brand-logo { display: block; padding: 8px 8px 4px; }
.brand-logo img { display: block; width: 190px; max-width: 100%; height: auto; }
.brand-logo span { display: block; margin-top: 6px; font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--sidebar-highlight); }
.nav { margin-top: 24px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-weight: 500; color: var(--sidebar-muted); transition: background .15s, color .15s; }
.nav a:hover { background: var(--sidebar-accent); color: #fff; }
.nav a.active { background: #fff; color: var(--primary); box-shadow: 0 2px 8px rgb(0 0 0 / .18); }
.nav a.active .ic { color: var(--accent-red); }
.sidebar-user { margin-top: 16px; border-top: 1px solid var(--sidebar-border); padding-top: 16px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sidebar-accent); color: #fff; font-size: 13px; font-weight: 600; flex-shrink: 0; border: 1px solid var(--sidebar-border); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.user-name { display: block; padding: 0 8px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-name:hover, .user-name.active { color: var(--sidebar-highlight); }
.user-role { padding: 0 8px; font-size: 12px; color: var(--sidebar-muted); }
.logout { margin-top: 12px; display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 8px; background: none; cursor: pointer; color: var(--sidebar-muted); }
.logout:hover { background: var(--sidebar-accent); color: #fff; }
.main-wrap { flex: 1; min-width: 0; }
.main { padding: 28px 28px 40px; max-width: 1600px; }
.appbar, .scrim, .tabbar, .case-cards { display: none; }
.strong { font-weight: 600; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- naslov stranice ---------- */
.page-head { margin-bottom: 24px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin-top: 4px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .muted { margin-top: 2px; }
h1 { font-size: 26px; font-weight: 700; margin-bottom: 12px; }
h3 { font-family: var(--font-sans); font-size: 18px; font-weight: 600; margin-bottom: 6px; }

/* ---------- kartice ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 2px rgb(16 24 40 / .04); }
.card-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); padding-bottom: 12px; }
.table-wrap > .card-title { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 24px; }
.kpi { display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 16px; box-shadow: 0 1px 2px rgb(16 24 40 / .04); }
.kpi-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.kpi-ic.info { background: #e8efff; color: var(--info); }
.kpi-ic.warn { background: #fff3e0; color: var(--warning); }
.kpi-ic.ok { background: #e6f7ed; color: var(--success); }
.kpi-ic.violet { background: #f1eaff; color: var(--violet); }
.kpi-ic.bad { background: #fdeceb; color: var(--accent-red); }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted-foreground); }
.kpi-value { margin-top: 2px; font-size: 22px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 12px; color: var(--muted-foreground); }
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { padding: 12px; gap: 10px; } .kpi-ic { width: 36px; height: 36px; } .kpi-value { font-size: 18px; } }

/* ---------- dugmad ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; background: none; transition: background .15s, border-color .15s, color .15s; text-decoration: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 1px 2px rgb(16 24 40 / .12); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { border-color: var(--border); background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgb(16 24 40 / .04); }
.btn-outline:hover { background: var(--muted); }
.btn-secondary { background: var(--secondary); color: var(--primary); }
.btn-secondary:hover { background: #e2e7f0; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; cursor: pointer; color: var(--muted-foreground); }
.icon-btn:hover { background: var(--muted); color: var(--foreground); }
.icon-btn.danger { color: var(--destructive); }
.icon-btn.danger:hover { background: #fdeceb; }

/* ---------- polja ---------- */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input:not([type]), select, textarea, .input {
  width: 100%; min-height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  padding: 7px 12px; font-size: 14px; box-shadow: 0 1px 2px rgb(16 24 40 / .03); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(91 116 184 / .2); }
textarea { min-height: 80px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
label > input, label > select, label > textarea { margin-top: 6px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--foreground); }
.lbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); margin-bottom: 6px; }
label.check { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--foreground); margin-bottom: 12px; }
label.check input { width: auto; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.input-icon > input { padding-left: 38px; }

/* ---------- traka s filterima ---------- */
.toolbar { display: grid; grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 1100px) { .toolbar { grid-template-columns: 1fr 1fr; } .toolbar .search { grid-column: 1 / -1; } }
.mf { position: relative; }
.mf-btn { width: 100%; height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); cursor: pointer; text-align: left; box-shadow: 0 1px 2px rgb(16 24 40 / .03); transition: border-color .15s, box-shadow .15s; }
.mf-btn:hover { border-color: #c9d0de; }
.mf.open .mf-btn { border-color: var(--ring); box-shadow: 0 0 0 3px rgb(91 116 184 / .2); }
.mf-label { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.mf-val { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.mf.has .mf-btn { border-color: #b9c4dd; background: #f5f7fc; }
.mf.has .mf-val { color: var(--primary); }
.mf-count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; }
.mf-btn .caret { color: var(--muted-foreground); transition: transform .15s; }
.mf.open .caret { transform: rotate(180deg); }
.mf-pop { display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 100%; width: 280px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgb(16 24 40 / .16); overflow: hidden; }
.mf.open .mf-pop { display: block; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mf-head { display: none; }
.mf-search { position: relative; padding: 8px; border-bottom: 1px solid var(--border); }
.mf-search .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); }
.mf-search input { min-height: 34px !important; padding-left: 32px !important; font-size: 13px !important; background: var(--muted) !important; border-color: transparent !important; box-shadow: none !important; }
.mf-items { max-height: 280px; overflow-y: auto; padding: 6px; }
.mf-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 400; color: var(--foreground); }
.mf-item:hover { background: var(--muted); }
.mf-item input { position: absolute; opacity: 0; pointer-events: none; }
.cbx { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1.5px solid #c3cad8; border-radius: 5px; background: #fff; flex-shrink: 0; transition: all .12s; }
.cbx .ic { width: 12px; height: 12px; stroke-width: 3; color: #fff; opacity: 0; }
.mf-item.on .cbx { background: var(--primary); border-color: var(--primary); }
.mf-item.on .cbx .ic { opacity: 1; }
.mf-item.on { font-weight: 500; }
.mf-empty { padding: 16px; text-align: center; font-size: 13px; color: var(--muted-foreground); }
.mf-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); background: #fafbfd; font-size: 12px; color: var(--muted-foreground); }
.mf-clear { border: 0; background: none; color: var(--accent-red); font-weight: 600; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.mf-clear:hover:not(:disabled) { background: #fdeceb; }
.mf-clear:disabled { color: #b8bfcc; cursor: default; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tone-info.dot { background: var(--info); } .tone-warn.dot { background: var(--warning); } .tone-ok.dot { background: var(--success); }
.tone-violet.dot { background: var(--violet); } .tone-neutral.dot { background: #98a2b3; }
.pad.small, .muted.small.pad { padding: 8px; }

/* filteri izvještaja */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; padding: 16px; margin-bottom: 20px; align-items: end; }
.rep-btns { display: flex; gap: 8px; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .rep-btns { grid-column: 1 / -1; } }

/* ---------- tabele ---------- */
.table-box, .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: 0 1px 2px rgb(16 24 40 / .04); }
.table, .tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .tbl th { padding: 10px 8px; text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); white-space: nowrap; background: #f8f9fc; border-bottom: 1px solid var(--border); }
.table th.r, .tbl th.r { text-align: right; }
.table th.c { text-align: center; }
.table td, .tbl td { white-space: nowrap; padding: 10px 8px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:first-child td, .tbl tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover td, .tbl tbody tr:hover td { background: #fafbfd; }
.table tr.closed td { color: #4b5565; }
.table tr.sub td { font-size: 12.5px; background: #fbfcfe; }
.table tr.sub:hover td { background: #f6f8fc; }
.empty-row, .tbl .empty { text-align: center; color: var(--muted-foreground); padding: 40px 16px !important; }
.w8 { width: 36px; }
.actions .btn-sm { padding: 0 10px; }
.actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; }
.case-no { font-weight: 600; font-variant-numeric: tabular-nums; }
.cell-sub { font-size: 12px; color: var(--muted-foreground); }
.toggle { display: inline-flex; align-items: center; gap: 2px; height: 24px; padding: 0 8px 0 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--foreground); }
.toggle:hover, .toggle.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.count { display: inline-flex; min-width: 24px; height: 22px; padding: 0 7px; align-items: center; justify-content: center; border-radius: 999px; background: var(--muted); font-size: 12px; font-weight: 600; }
.att { display: inline-flex; align-items: center; gap: 2px; color: var(--muted-foreground); font-size: 12px; margin-left: 4px; }

/* ---------- oznake ---------- */
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--secondary); color: var(--primary); }
.badge-info { background: #e8efff; color: #1d4ed8; }
.badge-warn { background: #fff3e0; color: #b45309; }
.badge-ok { background: #e6f7ed; color: #15803d; }
.badge-violet { background: #f1eaff; color: #6d28d9; }
.badge-neutral { background: #eef0f4; color: #475467; }

/* ---------- poruke ---------- */
.alert { padding: 12px 14px; border-radius: 8px; margin: 12px 0; font-size: 13.5px; border: 1px solid; }
.alert.err { background: #fef3f2; color: #b42318; border-color: #fecdca; }
.alert.ok { background: #ecfdf3; color: #067647; border-color: #abefc6; }
.alert.warn { background: #fffaeb; color: #93370d; border-color: #fedf89; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; padding: 12px 16px; border: 1px solid var(--border); border-left: 4px solid var(--success); border-radius: 10px; background: var(--card); box-shadow: 0 10px 28px rgb(16 24 40 / .14); font-weight: 500; }
.toast.err { border-left-color: var(--destructive); color: var(--destructive); }
.toast.info { border-left-color: var(--info); }

/* ---------- dijalozi ---------- */
.dlg { width: min(520px, calc(100% - 32px)); max-height: 90vh; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); color: var(--foreground); box-shadow: 0 24px 64px rgb(16 24 40 / .25); }
.dlg.wide { width: min(800px, calc(100% - 24px)); }
.dlg::backdrop { background: rgb(10 14 25 / .55); }
.dlg > p { margin-bottom: 8px; }
.dlg-head { padding-bottom: 4px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .dlg { padding: 18px; } }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.mini { background: var(--muted); border-radius: 8px; padding: 10px; }
.mini.warn { background: #fff3e0; }
.mini b { font-variant-numeric: tabular-nums; }
.file-btn { text-transform: none; letter-spacing: 0; color: var(--foreground); }
.atts { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.atts a { display: inline-flex; align-items: center; gap: 4px; color: var(--info); }
.atts a:hover { text-decoration: underline; }

/* ---------- izvještaji ---------- */
.sumgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.sum { padding: 16px; }
.sum .muted.small { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sum b { display: block; margin-top: 4px; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .sumgrid { grid-template-columns: 1fr 1fr; } }

/* ---------- administracija ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tabs a { margin-bottom: -1px; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 500; color: var(--muted-foreground); }
.tabs a:hover { color: var(--foreground); }
.tabs a.active { border-color: var(--accent-red); color: var(--foreground); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }
.add-row { display: flex; gap: 8px; align-items: center; margin: 0; }
.add-row.wrap { flex-wrap: wrap; }
.add-row.wrap input, .add-row.wrap select { width: auto; flex: 1 1 170px; }
.add-row.grow { flex: 1; }
.list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; }
.list li.wrap { flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }

/* kartice sa zaglavljem i redovima (administracija) */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-family: var(--font-sans); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--border); }
.rows > li:first-child { border-top: 0; }
.rows > li:hover { background: #fafbfd; }
.rows .icon-btn.danger { opacity: .55; }
.rows > li:hover .icon-btn.danger { opacity: 1; }
.card-add { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.card-head + .card-add { border-top: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.card-add input { flex: 1; min-width: 0; }
.rename { display: flex; gap: 8px; align-items: center; }
.rename input { max-width: 420px; }
.avatar-sm { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--secondary); color: var(--primary); font-size: 12.5px; font-weight: 600; }
.avatar-sm.admin { background: var(--primary); color: #fff; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.users > li { align-items: flex-start; padding: 14px 18px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.stack-form { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.hint-text { margin-top: 4px; font-size: 12px; color: var(--muted-foreground); }
.dlg form > .field { margin-top: 14px; }
.badge-bad { background: #fdeceb; color: #b42318; }
.sum-small { font-size: 13px !important; line-height: 1.4; }
.auth-msg.info { color: #1d4ed8; background: #eef4ff; border-color: #c7d7fe; }


/* ---------- prijava ---------- */
body.public { background: var(--card); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 32px; padding: 40px 56px; color: var(--sidebar-foreground);
  background: radial-gradient(1200px 600px at -10% -20%, #2b3a63 0%, transparent 60%), linear-gradient(160deg, #1f2945 0%, #151c2e 100%); }
.auth-hero::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 460px; height: 460px; border-radius: 50%; border: 64px solid rgb(224 69 58 / .08); pointer-events: none; }
.auth-hero::before { content: ""; position: absolute; right: 120px; top: -80px; width: 220px; height: 220px; border-radius: 50%; border: 36px solid rgb(255 255 255 / .03); pointer-events: none; }
.auth-hero > .brand-logo { padding: 0; }
.auth-hero > .brand-logo img { width: 230px; }
.auth-hero-text { margin: auto 0; max-width: 540px; position: relative; z-index: 1; }
.auth-hero h1 { margin-top: 14px; font-size: 54px; line-height: 1.02; font-weight: 700; color: #fff; letter-spacing: -0.02em; }
.auth-lead { margin-top: 16px; font-size: 16px; color: #b8c2d9; max-width: 460px; }
.auth-feat { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.auth-feat li { display: flex; gap: 12px; align-items: flex-start; }
.auth-feat li > span { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .08); color: #ff8a80; }
.auth-feat strong { display: block; color: #fff; font-weight: 600; }
.auth-feat p { margin-top: 2px; font-size: 13px; color: #9aa6c1; }
.auth-foot { font-size: 12px; color: #7d89a6; position: relative; z-index: 1; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--card); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h2 { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.auth-box > .muted { margin-top: 4px; }
.auth-form { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.auth-form input { min-height: 48px; border-radius: 10px; font-size: 15px; }
.auth-form .btn-lg { height: 50px; border-radius: 10px; margin-top: 4px; }
.pw > input { padding-right: 84px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--muted); color: var(--muted-foreground); font-size: 12px; font-weight: 600; cursor: pointer; }
.pw-toggle:hover { color: var(--foreground); }
.auth-msg { margin-top: 18px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; border: 1px solid; }
.auth-msg.err { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.auth-note { margin-top: 22px; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--muted); font-size: 12.5px; color: var(--muted-foreground); }
.auth-note .ic { margin-top: 2px; color: var(--accent-red); }
@media (max-width: 1023px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { gap: 18px; padding: calc(24px + env(safe-area-inset-top)) 22px 60px; }
  .auth-hero h1 { font-size: 32px; margin-top: 8px; }
  .auth-lead { font-size: 14px; margin-top: 8px; }
  .auth-feat, .auth-foot { display: none; }
  .auth-side { align-items: flex-start; margin-top: -32px; border-radius: 24px 24px 0 0; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); position: relative; z-index: 2; box-shadow: 0 -8px 24px rgb(0 0 0 / .12); }
  .auth-box h2 { font-size: 26px; }
}

/* ---------- forma stavke ---------- */
.form-dlg { padding: 0; width: min(860px, calc(100% - 24px)); overflow: hidden; }
.form-dlg form { display: flex; flex-direction: column; max-height: 90vh; }
.fd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.fd-head h3 { margin: 0; font-size: 20px; }
.fd-body { overflow-y: auto; padding: 4px 24px 8px; background: #fbfcfe; }
.fd-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--card); }
.fs { padding: 18px 0; border-bottom: 1px dashed var(--border); }
.fs:last-child { border-bottom: 0; }
.fs-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 600; font-size: 14px; color: var(--foreground); }
.fs-title > span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .fgrid, .fgrid.three { grid-template-columns: 1fr; } .fgrid.four { grid-template-columns: 1fr 1fr; } .fd-head, .fd-foot { padding-left: 16px; padding-right: 16px; } .fd-body { padding: 0 16px; } }
.field > label { font-size: 12px; }
.field > label i { color: var(--accent-red); font-style: normal; }
.form-dlg .input { background: #fff; }
.hint { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--muted-foreground); }
.hint .ic { color: var(--success); }
.link-btn { margin-left: auto; border: 0; background: none; padding: 4px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--info); cursor: pointer; }
.link-btn:hover { background: #e8efff; }

/* dugmad za izbor */
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-opt { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 13.5px; font-weight: 500; color: #344054; cursor: pointer; transition: all .12s; }
.pick-opt:hover { border-color: #b9c4dd; background: #f5f7fc; }
.pick-opt.on { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 2px 6px rgb(31 43 71 / .25); }
.pick-opt.on .ic { stroke-width: 3; }
.pick-opt.tone-info.on { background: var(--info); border-color: var(--info); }
.pick-opt.tone-warn.on { background: var(--warning); border-color: var(--warning); }
.pick-opt.tone-ok.on { background: var(--success); border-color: var(--success); }
.pick-opt.tone-violet.on { background: var(--violet); border-color: var(--violet); }
.pick-opt.tone-neutral.on { background: #667085; border-color: #667085; }

/* pretraživi padajući meni */
.combo { position: relative; }
.combo > input { padding-right: 34px; }
.combo-chev { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; color: var(--muted-foreground); cursor: pointer; }
.combo-chev:hover { background: var(--muted); }
.combo.open .combo-chev { transform: translateY(-50%) rotate(180deg); }
.combo-list { display: none; position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 6px); max-height: 260px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgb(16 24 40 / .16); }
.combo.open .combo-list { display: block; animation: pop .12s ease-out; }
.combo-list li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.combo-list li small { font-size: 12px; color: var(--muted-foreground); }
.combo-list li.on, .combo-list li[data-i]:hover { background: #eef2fb; }
.combo-list mark { background: #fff1b8; color: inherit; border-radius: 2px; padding: 0 1px; }
.combo-new { flex-direction: row !important; align-items: center; gap: 6px; color: var(--info); font-weight: 500; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px !important; margin-top: 4px; cursor: default !important; }
.combo-new b { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border-radius: 5px; background: #e8efff; }
.combo-empty { color: var(--muted-foreground); cursor: default !important; font-size: 13px !important; }

/* iznosi */
.money { position: relative; }
.money input { padding-right: 42px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.money > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 600; color: var(--muted-foreground); pointer-events: none; }

/* privici */
.drop { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 16px 18px; border: 1.5px dashed #c6cedd; border-radius: 12px; background: #fff; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--muted-foreground); transition: all .15s; }
.drop:hover, .drop.over { border-color: var(--ring); background: #f3f6fd; color: var(--primary); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop > .ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: var(--muted); color: var(--primary); }
.drop b { display: block; font-size: 14px; color: var(--foreground); font-weight: 600; }
.drop small { display: block; font-size: 12px; font-weight: 400; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; }
.file-list li small { color: var(--muted-foreground); }
.atts-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); margin-top: 6px; }
.toolbar .mf:last-child .mf-pop { left: auto; right: 0; }

/* ---------- stranice (1 2 3 …) ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.pager:empty { display: none; }
.pager-info { font-size: 13px; color: var(--muted-foreground); }
.pager-info b { color: var(--foreground); font-weight: 600; }
.pager-btns { display: flex; align-items: center; gap: 4px; }
.pg { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-size: 13.5px; font-weight: 500; cursor: pointer; color: var(--foreground); font-variant-numeric: tabular-nums; transition: background .12s, border-color .12s; }
.pg:hover:not(:disabled):not(.on) { background: var(--muted); border-color: #c9d0de; }
.pg.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; cursor: default; }
.pg:disabled { opacity: .4; cursor: default; }
.pg .flip { transform: rotate(180deg); }
.pg-gap { min-width: 24px; text-align: center; color: var(--muted-foreground); }
body.is-loading .table-box, body.is-loading .case-cards, body.is-loading .pager { opacity: .55; pointer-events: none; transition: opacity .15s; }
@media (max-width: 760px) {
  .pager { flex-direction: column-reverse; align-items: stretch; gap: 10px; }
  .pager-info { text-align: center; }
  .pager-btns { justify-content: center; }
  .pg { min-width: 40px; height: 40px; border-radius: 10px; }
}

/* ---------- historija izmjena ---------- */
.history { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.history > li { position: relative; }
.history > li::before { content: ""; position: absolute; left: -21px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--primary); }
.h-top { font-size: 13.5px; }
.h-meta { font-size: 12px; color: var(--muted-foreground); margin-top: 1px; }
.h-changes { list-style: none; margin: 6px 0 0; padding: 8px 10px; background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; display: flex; flex-direction: column; gap: 3px; }
.old { color: var(--destructive); text-decoration: line-through; text-decoration-thickness: 1px; }
.new { color: var(--success); font-weight: 600; }
.changes > div + div { margin-top: 3px; }
.changes { font-size: 12.5px; white-space: normal !important; }
.audit-tbl td { vertical-align: top; }
.audit-filters { grid-template-columns: minmax(160px, 1fr) minmax(200px, 2fr) 150px 150px auto; }
.btn-danger-ghost { color: var(--destructive); background: none; border-color: transparent; margin-right: auto; }
.btn-danger-ghost:hover { background: #fdeceb; }

/* ---------- ostalo (profil, firma, sistem) ---------- */
.mt { margin-top: 16px; }
.pad-x { padding: 12px 18px 0; }
.split.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .split.even { grid-template-columns: 1fr; } }
.stack-form.tight { padding: 0; gap: 10px; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 52px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; }
.logo-preview { padding: 16px; border-radius: 12px; background: var(--sidebar); }
.drop.small { margin-top: 0; padding: 12px 14px; }
.checks .chk { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.chk.ok { background: #e6f7ed; color: #15803d; } .chk.warn { background: #fff3e0; color: #b45309; } .chk.bad { background: #fdeceb; color: #b42318; }
.users > li.inactive { opacity: .6; }

/* stranice bez menija: zaboravljena lozinka, nova lozinka, privatnost */
.auth.single { grid-template-columns: 1fr; background: var(--background); }
.auth.single .auth-side { background: var(--background); }
.auth.single .auth-box { background: var(--card); padding: 32px; border-radius: 18px; border: 1px solid var(--border); box-shadow: 0 10px 40px rgb(16 24 40 / .08); }
.auth.single .brand-logo, .doc-box .brand-logo { display: inline-block; margin-bottom: 22px; padding: 14px 18px 10px; border-radius: 12px; background: var(--sidebar); }
.auth.single .brand-logo img, .doc-box .brand-logo img { width: 170px; }
.auth-links { margin-top: 18px; text-align: center; font-size: 13.5px; }
.auth-links a, .auth-note a, .auth-foot a { color: var(--info); font-weight: 500; }
.auth-foot a { color: inherit; text-decoration: underline; }
.auth-msg.ok { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.doc { min-height: 100vh; padding: 40px 16px; background: var(--background); }
.doc-box { max-width: 760px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 36px 40px; line-height: 1.65; }
.doc-box h1 { font-size: 30px; margin: 0 0 4px; }
.doc-box h2 { font-family: var(--font-sans); font-size: 16px; font-weight: 600; margin: 26px 0 6px; }
.doc-box p, .doc-box li { color: #344054; }
.doc-box ul { padding-left: 20px; }
.doc-box a { color: var(--info); }
@media (max-width: 640px) { .doc-box { padding: 24px 20px; } .auth.single .auth-box { padding: 22px; } }

/* ---------- predmeti kao kartice (laptop < 1200 px, tablet, mobitel) ---------- */
@media (max-width: 1536px) { .c-doc { display: none; } }
@media (max-width: 1366px) { .c-veh { display: none; } }
.c-party { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.c-party .cell-sub { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1199px) {
  .table-box:has(#cases-body) { display: none; }
  .case-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
}
@media (max-width: 760px) { .case-cards { grid-template-columns: 1fr; gap: 10px; } }
/* predmeti kao kartice */
.cc { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 14px 14px 10px; box-shadow: 0 1px 2px rgb(16 24 40 / .05); }
.cc:active { background: #fbfcfe; }
.cc.closed { background: #fafbfc; }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cc-top .case-no { font-size: 15px; }
.cc-party { margin-top: 8px; font-size: 16px; font-weight: 600; line-height: 1.3; }
.cc-sub { margin-top: 2px; font-size: 13px; color: var(--muted-foreground); }
.cc-veh { margin-top: 6px; display: inline-flex; padding: 3px 8px; border-radius: 6px; background: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .02em; color: #344054; }
.cc-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cc-amounts > div { padding: 8px 10px; border-radius: 12px; background: #f6f8fc; }
.cc-amounts small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.cc-amounts b { display: block; margin-top: 2px; font-size: 17px; font-weight: 600; }
.cc-amounts b::after { content: " KM"; font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.cc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cc-more { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 6px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer; }
.cc-more:active { background: var(--muted); }
.cc .icon-btn { width: 36px; height: 36px; border-radius: 999px; background: var(--muted); color: var(--primary); }
.cc .btn-sm { height: 36px; border-radius: 999px; padding: 0 14px; }
.cc-entries { list-style: none; margin: 10px -6px 0; padding: 0; border-top: 1px solid var(--border); }
.cc-entries li { display: flex; align-items: center; gap: 10px; padding: 11px 6px; border-bottom: 1px solid #eef0f4; cursor: pointer; }
.cc-entries li:last-child { border-bottom: 0; }
.cc-entries li:active { background: var(--muted); border-radius: 10px; }
.cc-e-top { font-size: 14px; }
.cc-e-sub { margin-top: 3px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-foreground); }
.cc-e-sub .badge { font-size: 11px; padding: 1px 8px; }
.cc-e-amt { text-align: right; font-weight: 600; font-size: 14px; }
.cc-e-amt small { display: block; font-size: 11px; font-weight: 500; color: var(--muted-foreground); }
.cc-e-go { color: #98a2b3; }
.cards-empty { padding: 40px 16px; text-align: center; color: var(--muted-foreground); border: 1px dashed var(--border); border-radius: 18px; }
.cards-empty .ic { width: 28px; height: 28px; margin-bottom: 8px; color: #98a2b3; }


/* =====================================================================
   MOBITEL — izgled kao aplikacija (po uzoru na HA RENT):
   gornja traka, donja traka s tabovima, plutajuće dugme, kartice,
   prozori koji izlaze odozdo, list "Više".
   ===================================================================== */
:root { --appbar-h: 56px; --tabbar-h: 62px; }
@media (max-width: 1023px) {
  html { -webkit-tap-highlight-color: transparent; }
  html, body { overscroll-behavior-y: none; }
  a, button, input, select, textarea, label { touch-action: manipulation; }
  .app { display: block; }
  .sidebar, .scrim { display: none !important; }
  .main-wrap, .main { max-width: 100vw; min-width: 0; }
  @supports (overflow: clip) { .main { overflow-x: clip; } }
  .main { padding: 14px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 92px); }

  /* gornja traka */
  .appbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
    height: calc(var(--appbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px;
    background: var(--sidebar); color: #fff; box-shadow: 0 1px 0 rgb(0 0 0 / .1); }
  .appbar-brand { flex: 1; display: inline-flex; align-items: center; gap: 8px; padding-left: 4px; }
  .appbar-brand img { height: 24px; width: auto; display: block; }
  .appbar-brand span { font-family: var(--font-display); font-size: 19px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sidebar-highlight); }
  .appbar-title { flex: 1; min-width: 0; font-family: var(--font-display); font-size: 21px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .appbar-avatar { width: 34px; height: 34px; border: 0; background: var(--accent-red); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }

  /* donja traka s tabovima */
  .tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 4), 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgb(255 255 255 / .92); backdrop-filter: saturate(1.8) blur(14px); -webkit-backdrop-filter: saturate(1.8) blur(14px);
    border-top: 1px solid var(--border); transform: translateZ(0); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; cursor: pointer;
    font-size: 11px; font-weight: 500; color: var(--muted-foreground); padding: 6px 0 4px; }
  .tab-ic { width: 24px; height: 24px; padding: 2px 0; box-sizing: content-box; border-radius: 999px; transition: background .2s; }
  .tab.active { color: var(--primary); font-weight: 600; }
  .tab.active .tab-ic { padding: 4px 18px; margin: -2px 0; background: rgb(31 43 71 / .1); }
  .tab:active .tab-ic { background: rgb(31 43 71 / .16); }

  /* naslov stranice */
  .page-head { margin-bottom: 14px; gap: 8px; }
  .page-head .eyebrow, .page-head h1 { display: none; }
  .page-head .muted { font-size: 13px; }

  /* plutajuće dugme "+ Nova stavka" */
  .fab { position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); z-index: 39; transform: translateZ(0);
    height: 56px; padding: 0 22px; border-radius: 18px; font-size: 15px; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / .25), 0 2px 6px rgb(0 0 0 / .12); }
  .fab .ic { width: 20px; height: 20px; }

  /* KPI: vodoravni niz kartica */
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -14px 14px; padding: 2px 14px 4px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 auto; min-width: 152px; scroll-snap-align: start; padding: 12px 14px; border-radius: 16px; gap: 10px; }
  .kpi-ic { width: 34px; height: 34px; border-radius: 10px; }
  .kpi-ic .ic-lg { width: 18px; height: 18px; }
  .kpi-value { font-size: 18px; }
  .kpi-label { font-size: 10.5px; }

  /* pretraga i filteri: pretraga preko cijele širine, filteri kao pilule koje se kližu */
  .toolbar { display: grid; grid-template-columns: repeat(4, max-content); gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 14px; padding: 0 14px 2px; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .search { grid-column: 1 / -1; width: calc(100vw - 28px); }
  .toolbar .search input { height: 46px; border-radius: 14px; font-size: 16px; }
  .mf-btn { height: 36px; border-radius: 999px; padding: 0 12px 0 14px; gap: 6px; }
  .mf-val { text-align: left; }
  .mf:not(.has) .mf-val { display: none; }
  .mf.has .mf-label { color: var(--primary); }
  .mf.has .mf-label::after { content: ":"; }
  .mf.has .mf-btn { background: var(--primary); border-color: var(--primary); }
  .mf.has .mf-btn, .mf.has .mf-label, .mf.has .mf-val, .mf.has .caret { color: #fff; }
  .mf.has .mf-count { background: #fff; color: var(--primary); }
  .mf-label { font-size: 13.5px; font-weight: 500; color: var(--foreground); }
  .mf-pop { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 70; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 0 0 100vmax rgb(10 14 25 / .45), 0 -10px 40px rgb(0 0 0 / .2); max-height: 75vh; display: none; flex-direction: column; }
  .mf.open .mf-pop { display: flex; animation: sheet-up .26s cubic-bezier(.2, .9, .3, 1); }
  .mf-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 6px; position: relative; }
  .mf-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--border); }
  .mf-head b { font-size: 18px; font-family: var(--font-display); }
  .mf-done { border: 0; background: var(--primary); color: #fff; height: 34px; padding: 0 16px; border-radius: 999px; font-weight: 600; cursor: pointer; }
  .mf-search { padding: 8px 14px 10px !important; }
  .mf-search .ic { top: 50% !important; }
  .mf-items { max-height: none; flex: 1; padding: 8px 10px; }
  .mf-item { padding: 13px 12px; font-size: 15px; }
  .mf-search { padding: 18px 14px 10px; }
  .mf-search .ic { left: 26px; top: 60%; }
  .mf-search input { min-height: 44px !important; font-size: 16px !important; border-radius: 12px !important; }
  .mf-foot { padding: 12px 16px; font-size: 13px; }
  .mf-clear { font-size: 14px; padding: 8px 12px; }
  .toolbar .mf:last-child .mf-pop { left: 0; right: 0; }

  /* ostale tabele (.tbl) kao kartice */
  .table-wrap:has(> .tbl) { border: 0; background: none; box-shadow: none; overflow: visible; }
  .table-wrap > .card-title { padding: 4px 2px 10px; border: 0; }
  .tbl, .tbl tbody { display: block; }
  .tbl thead { display: none; }
  .tbl tbody { display: flex; flex-direction: column; gap: 8px; }
  .tbl tbody tr { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
  .tbl tbody td { display: flex; justify-content: space-between; width: 100%; padding: 2px 0 !important; border: 0 !important; white-space: normal; text-align: right; }
  .tbl tbody td::before { content: attr(data-label); font-size: 12.5px; color: var(--muted-foreground); text-align: left; }
  .tbl tbody td:first-child { font-weight: 600; font-size: 15px; justify-content: flex-start; padding-bottom: 6px !important; margin-bottom: 4px; border-bottom: 1px solid var(--border) !important; }
  .tbl tbody td:first-child::before { content: none; }
  .tbl tbody tr:hover td { background: none; }
  .tbl .empty { border: 1px dashed var(--border) !important; border-radius: 16px; justify-content: center; }
  .tbl .empty::before { content: none !important; }

  /* izvještaji / admin / uvoz */
  .filters { grid-template-columns: 1fr 1fr; padding: 14px; border-radius: 16px; gap: 10px; }
  .rep-btns { grid-column: 1 / -1; }
  .rep-btns .btn { flex: 1; }
  .sumgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sum { border-radius: 16px; padding: 12px 14px; }
  .sum b { font-size: 18px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 14px; padding: 0 14px; position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top)); z-index: 30; background: var(--background); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex-shrink: 0; padding: 12px; }
  .card { border-radius: 16px; }
  .pad { padding: 16px; }
  .add-row { flex-wrap: wrap; }
  .add-row input, .add-row select { flex: 1 1 160px; }
  .rows > li { flex-wrap: wrap; padding: 12px 14px; }
  .users .row-actions { width: 100%; justify-content: flex-start; padding-left: 48px; }
  .card-add { flex-wrap: wrap; padding: 12px 14px; }
  .card-add input { flex: 1 1 100%; }
  .card-add .btn { width: 100%; }
  .rename { flex: 1 1 100%; }
  .rename input { max-width: none; }
  .list li { padding: 12px; }

  /* polja: 16px da iPhone ne zumira, veći dodir */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea, .input { font-size: 16px; min-height: 44px; border-radius: 10px; }
  .btn { height: 44px; border-radius: 12px; }
  .btn-sm { height: 36px; }
  .pick-opt { height: 38px; padding: 0 16px; font-size: 14px; }

  /* prozori izlaze odozdo (bottom sheet) */
  .dlg, .dlg.wide, .form-dlg { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 94vh; max-height: 94dvh; border: 0; border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px rgb(0 0 0 / .2); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .dlg[open] { animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1); }
  .dlg::backdrop { background: rgb(10 14 25 / .45); }
  .dlg:not(.form-dlg):not(.sheet-more) { padding: 28px 18px calc(18px + env(safe-area-inset-bottom)); }
  .dlg:not(.form-dlg)::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--border); }
  .dlg-foot { gap: 10px; }
  .dlg-foot .btn { flex: 1; height: 48px; font-size: 15px; }
  .form-dlg { padding-bottom: 0; }
  .form-dlg form { max-height: 94vh; max-height: 94dvh; }
  .fd-head { position: relative; padding: 24px 16px 12px; }
  .fd-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--border); }
  .fd-head .icon-btn { width: 36px; height: 36px; border-radius: 999px; background: var(--muted); }
  .fd-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); gap: 10px; }
  .fd-foot .btn { flex: 1; height: 50px; font-size: 15px; }
  .fgrid.four { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr 1fr; }

  /* list "Više" */
  .sheet-more { padding: 0 0 calc(14px + env(safe-area-inset-bottom)) !important; }
  .sheet-more::before { display: none; }
  .sheet-handle { width: 40px; height: 5px; margin: 8px auto 0; border-radius: 99px; background: var(--border); }
  .sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 14px; }
  .avatar.lg { width: 46px; height: 46px; font-size: 18px; background: var(--primary); border: 0; color: #fff; }
  .icon-btn.round { width: 36px; height: 36px; border-radius: 999px; background: var(--muted); }
  .sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 14px 14px; }
  .sheet-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 88px; padding: 10px 6px; border-radius: 16px; background: var(--muted); text-align: center; font-size: 12.5px; font-weight: 500; }
  .sheet-grid a .ic { color: var(--primary); }
  .sheet-grid a.active { background: var(--primary); color: #fff; }
  .sheet-grid a.active .ic { color: #fff; }
  .sheet-logout { padding: 0 14px; }

  /* poruke ispod gornje trake */
  .toasts { left: 12px; right: 12px; top: calc(var(--appbar-h) + env(safe-area-inset-top) + 8px); bottom: auto; }
  .toast { min-width: 0; max-width: none; border-radius: 14px; animation: toast-down .3s ease-out; }

  /* combobox lista u formi ne smije pobjeći van ekrana */
  .combo-list { max-height: 40vh; }
}
@media (max-width: 1023px) and (prefers-reduced-motion: reduce) { .dlg[open], .toast, .mf.open .mf-pop { animation: none !important; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes toast-down { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (display-mode: standalone) and (max-width: 1023px) {
  body { user-select: none; -webkit-user-select: none; }
  input, textarea, .num, td, p { user-select: text; -webkit-user-select: text; }
}
