/* NCMC Sales Portal — dizajn sistem */
:root {
  /* NCMC knjiga dizajna: tamno plava #121B45 (Pantone 289C), akcentno plava #0072CE (Pantone 285), nebo siva #E8ECF4 */
  --navy-900: #121B45;
  --navy-800: #18213F;
  --navy-700: #222C5C;
  --navy-600: #303B72;
  --navy-300: #8F97BC;
  --blue-600: #0072CE;
  --blue-700: #005BA6;
  --blue-50: #E8F1FB;
  --sky: #E8ECF4;
  --bg: #EEF1F7;
  --surface: #ffffff;
  --surface-2: #F5F7FB;
  --border: #DDE2EC;
  --border-strong: #C4CBDA;
  --text: #121B45;
  --text-2: #464E6E;
  --text-3: #767D99;
  --green: #148a4f;
  --green-bg: #e5f5ec;
  --red: #c4321f;
  --red-bg: #fdecea;
  --amber: #a86400;
  --amber-bg: #fff4dc;
  --violet: #6a4fd1;
  --c-plan: #9aa3bf;
  --c-actual: #0072CE;
  --c-forecast: #e0892b;
  --c-approved: #121B45;
  --radius: 4px;
  --radius-sm: 3px;
  --shadow: 0 1px 2px rgba(18, 27, 69, .05), 0 1px 3px rgba(18, 27, 69, .07);
  --shadow-lg: 0 12px 32px rgba(18, 27, 69, .22);
  --font: "Archivo", "Neue Haas Grotesk Text", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --sidebar-w: 248px;
  --tracked: .32em;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue-700); text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 23px; font-weight: 700; letter-spacing: -.005em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 620; }
.icon { flex: none; vertical-align: middle; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--navy-900); color: #cfd7e6; position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
a.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 176px; height: auto; }
.brand-app { font-size: 10px; font-weight: 600; letter-spacing: .18em; color: var(--navy-300); padding-left: 1px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 4px; background: linear-gradient(135deg, #0072CE, #005BA6);
  display: grid; place-items: center; color: #fff; font-weight: 750; font-size: 12px; letter-spacing: .04em;
}
.brand-text strong { display: block; color: #fff; font-size: 14px; font-weight: 650; }
.brand-text span { font-size: 11px; color: var(--navy-300); }
.nav { padding: 10px 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10px; text-transform: uppercase; letter-spacing: .22em; color: #6E78A3; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 3px; color: #b9c3d6;
  font-size: 13.5px; font-weight: 500; margin-bottom: 1px;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a.active { background: var(--navy-700); color: #fff; box-shadow: inset 3px 0 0 var(--blue-600); }
.nav-label-closed { margin-top: 18px; border-top: 1px solid rgba(255,255,255,.08); }
.nav a.nav-closed { opacity: .5; }
.nav a.nav-closed:hover, .nav a.nav-closed.active { opacity: .85; }
.nav a .soon { margin-left: auto; font-size: 10px; color: #6c7a96; border: 1px solid #2d3a55; padding: 0 6px; border-radius: 20px; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06); font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--navy-600); color: #fff; display: grid;
  place-items: center; font-size: 12px; font-weight: 650; flex: none;
}
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { color: var(--navy-300); font-size: 11px; }
.user-chip form button { background: none; border: 0; color: var(--navy-300); cursor: pointer; padding: 6px; border-radius: 3px; }
.user-chip form button:hover { color: #fff; background: rgba(255,255,255,.06); }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.topbar .crumbs { font-size: 13px; color: var(--text-3); display: flex; gap: 8px; align-items: center; min-width: 0; }
.topbar .crumbs a { color: var(--text-2); }
.topbar .crumbs .sep { color: var(--border-strong); }
.topbar .spacer { flex: 1; }
.env-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: var(--amber-bg); color: var(--amber); }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--text-2); }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .sub { color: var(--text-3); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.page-head .sub span { display: inline-flex; align-items: center; gap: 5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--text); border-color: #b9c1cf; }
.btn-primary { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); color: #fff; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #0f7442; color: #fff; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); color: var(--red); border-color: #f0b8b0; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eef0f4; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-icon { width: 30px; padding: 0; }
.btn-excel { background: #107c41; border-color: #107c41; color: #fff; }
.btn-excel:hover { background: #0b6534; color: #fff; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Cards & KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-head h2::before { content: ""; display: inline-block; width: 3px; height: .95em; background: var(--blue-600); margin-right: 9px; vertical-align: -1px; }
.card-head h2 { flex: 1; font-size: 14.5px; font-weight: 700; }
.card-head .hint { font-size: 12px; color: var(--text-3); }
.card-body { padding: 16px 18px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 16px; }
.grid > div > .card + .card, .grid > div > .card + .card { margin-top: 16px; }
.grid > .card, .grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); position: relative; }
.kpi .label { font-size: 12px; color: var(--text-3); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 21px; font-weight: 650; margin-top: 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.kpi.accent { border-top: 3px solid var(--blue-600); }
.kpi.bad .value { color: var(--red); }
.kpi.good .value { color: var(--green); }
.kpi .tag { position: absolute; top: 12px; right: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.kpis-main { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis-main .kpi .value { font-size: 26px; }
.kpi .value.txt-bad { color: var(--red); }
@media (max-width: 900px) { .kpis-main { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
details.more-kpis { margin: -4px 0 16px; }
details.more-kpis > summary { cursor: pointer; font-size: 13px; color: var(--text-2); font-weight: 550; padding: 6px 2px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.more-kpis > summary::before { content: "▸"; transition: transform .15s; }
details.more-kpis[open] > summary::before { transform: rotate(90deg); }
details.more-kpis > summary::-webkit-details-marker { display: none; }
details.more-kpis .kpis { margin-top: 8px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: #eef0f4; color: var(--text-2); white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-blue { background: var(--blue-50); color: var(--blue-700); }
.badge-violet { background: #efebfc; color: var(--violet); }
.badge-outline { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-3); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 550; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--blue-600); border-color: var(--blue-600); }
.tabs .count { font-size: 11px; background: #eef0f4; color: var(--text-2); padding: 0 6px; border-radius: 4px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
  font-weight: 600; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid #eef0f4; vertical-align: middle; }
table.data tbody tr:hover td { background: #fafbfd; }
table.data th.num, table.data td.num { text-align: right; }
table.data tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border-strong); border-bottom: 0; }
table.data .sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 2; }
table.data th.sticky-col { background: var(--surface-2); z-index: 3; }
table.data tfoot .sticky-col { background: var(--surface-2); }
table.data td.closed, table.data th.closed { background: #f6f7f9; color: var(--text-3); }
table.data .over { color: var(--red); font-weight: 600; }
table.data .under { color: var(--green); }
table.data td.total-col, table.data th.total-col { background: #f4f6fb; font-weight: 600; }
.row-link { color: var(--text); font-weight: 550; }
.cell-sub { display: block; font-size: 11.5px; color: var(--text-3); }

/* grid inputs */
.grid-input {
  width: 100%; min-width: 92px; height: 32px; border: 1px solid transparent; border-radius: 3px; background: transparent;
  text-align: right; font: inherit; font-variant-numeric: tabular-nums; padding: 0 8px; color: var(--text);
}
.grid-input:hover { border-color: var(--border); background: #fff; }
.grid-input:focus { outline: none; border-color: var(--blue-600); background: #fff; box-shadow: 0 0 0 3px rgba(36, 89, 214, .14); }
.grid-input.manual { color: var(--c-forecast); font-weight: 600; }
.grid-input.invalid { border-color: var(--red); background: var(--red-bg); }
.plan-table td { padding: 3px 4px; }
.plan-table td.sticky-col, .plan-table td.num { padding: 6px 12px; }

/* budžet po stavkama (izgled kao NCMC Excel) */
.budget-table th.sec-no { width: 56px; text-align: center; background: #fff; color: var(--text); font-size: 14px; }
.budget-table tr.sec-head th { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); background: #fff; border-bottom: 2px solid var(--navy-800); padding: 10px 12px; }
.budget-table tr.sec-head th.sec-name { background: var(--navy-800); color: #fff; font-size: 13.5px; font-weight: 650; text-align: center; min-width: 320px; }
.budget-table td { padding: 3px 6px; }
.budget-table td.code { width: 56px; text-align: center; color: var(--text-2); font-variant-numeric: tabular-nums; padding: 6px; }
.budget-table td.num, .budget-table td.center { padding: 6px 10px; }
.budget-table .grid-input.text { text-align: left; min-width: 460px; }
.budget-table td.total-col { background: #fff0e0; font-weight: 650; }
.budget-table tr.sec-total td { background: #f4dcdc; font-weight: 700; border-top: 1px solid #e3b5b5; }
.budget-table tr.sec-total td.total-col { background: #f0cfcf; }
.grid-select { height: 32px; border: 1px solid transparent; border-radius: 3px; background: transparent; font: inherit; font-size: 12.5px; color: var(--text-2); padding: 0 4px; }
.grid-select:hover, .grid-select:focus { border-color: var(--border); background: #fff; outline: none; }
.budget-table tr.deleted td { opacity: .45; text-decoration: line-through; }
.budget-table tr.new-row td { background: #f3f7ff; }
.budget-table th.fc-col, .budget-table td.fc-col { background: #fffaf0; }
.budget-table td.center, .budget-table th.center { text-align: center; }
table.data tr.sec-row td { background: #eef1f7; border-top: 1px solid var(--border); padding: 8px 12px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 20; box-shadow: 0 -4px 16px rgba(16,24,40,.08); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .req { color: var(--red); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .input {
  width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 11px;
  font: inherit; color: var(--text); background: #fff; transition: border-color .12s, box-shadow .12s;
}
.field textarea { height: auto; padding: 9px 11px; resize: vertical; }
.field input[type=file] { padding: 7px 10px; height: auto; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(36, 89, 214, .14); }
.field .help { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.field .error, .errorlist { color: var(--red); font-size: 12px; margin: 4px 0 0; padding: 0; list-style: none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.form-error { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 16px; margin-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.check input { margin-top: 2px; width: 16px; height: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input, .toolbar select { height: 34px; width: auto; min-width: 150px; }
.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 8px; color: var(--text-3); }
.search input { padding-left: 32px !important; }

/* ---------- Dialog ---------- */
dialog.modal {
  border: 0; border-radius: 5px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px);
  box-shadow: var(--shadow-lg); color: var(--text);
}
dialog.modal.sm { width: min(480px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(18, 27, 69, .45); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 18px 20px 20px; }
.modal-body .form-actions { margin-left: -20px; margin-right: -20px; padding: 14px 20px 0; }

/* ---------- Alerts / flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 13.5px; border: 1px solid; }
.flash.success { background: var(--green-bg); border-color: #bfe6cf; color: #0c6a3b; }
.flash.error { background: var(--red-bg); border-color: #f5c2bb; color: #9e2615; }
.flash.warning, .flash.info { background: var(--amber-bg); border-color: #f2d9a3; color: #7d4b00; }
.flash .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; }
.callout { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--blue-50); color: #23407f; font-size: 13px; margin-bottom: 16px; }
.callout.warn { background: var(--amber-bg); color: #7d4b00; }
.callout.danger { background: var(--red-bg); color: #9e2615; }
.callout.ok { background: var(--green-bg); color: #0c6a3b; }
.demo-banner { background: repeating-linear-gradient(-45deg, #fff4dc, #fff4dc 12px, #ffefcc 12px, #ffefcc 24px); color: #7d4b00; font-size: 12.5px; font-weight: 600; padding: 7px 28px; border-bottom: 1px solid #f2d9a3; display: flex; gap: 8px; align-items: center; }

/* ---------- Budget breakdown ---------- */
.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ledger td { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.ledger td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 550; white-space: nowrap; }
.ledger tr.strong td { font-weight: 700; border-bottom: 1px solid var(--border-strong); }
.ledger tr.muted-row td { color: var(--text-3); }
.ledger .tagline { font-size: 11.5px; color: var(--text-3); display: block; font-weight: 400; }

.bar { height: 7px; border-radius: 3px; background: #edf0f5; overflow: hidden; position: relative; min-width: 80px; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--blue-600); }
.bar.warn > span { background: #e0a020; }
.bar.over > span { background: var(--red); }
.util { display: flex; align-items: center; gap: 8px; }
.util .bar { flex: 1; }
.util .pct { width: 48px; text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Charts ---------- */
.chart { width: 100%; min-height: 240px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg text { font-family: var(--font); fill: var(--text-3); font-size: 11px; }
.chart .grid-line { stroke: #edf0f4; }
.chart .axis-line { stroke: var(--border-strong); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.dash { height: 0; border-top: 2px dashed; border-radius: 0; width: 16px; }
.legend i.line { height: 0; border-top: 2px solid; border-radius: 0; width: 16px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--navy-900); color: #fff; font-size: 12px; padding: 7px 10px; border-radius: 3px; white-space: nowrap; box-shadow: var(--shadow-lg); z-index: 5; transform: translate(-50%, -110%); }
.chart-tip b { font-weight: 600; }
.est-note { font-size: 11.5px; color: var(--amber); display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Empty / misc ---------- */
.empty { text-align: center; padding: 42px 20px; color: var(--text-3); }
.empty .icon { color: var(--border-strong); margin-bottom: 8px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eef0f4; font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--text-3); width: 112px; flex: none; font-size: 12px; }
.timeline .what { flex: 1; min-width: 0; }
.timeline .who { color: var(--text-3); font-size: 12px; }
.code { font-family: var(--mono); font-size: 12px; background: #f1f3f7; padding: 1px 6px; border-radius: 4px; color: var(--text-2); }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13.5px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; }
.legend-key { display: inline-flex; gap: 14px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.legend-key span { display: inline-flex; gap: 6px; align-items: center; }
.swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-strong); display: inline-block; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; overflow: hidden; isolation: isolate; background: var(--navy-900); color: #cfd7e6; padding: 48px; display: flex; flex-direction: column; gap: 32px; }
.login-photo { position: absolute; inset: 0; z-index: -2; background: var(--navy-900) url("../img/login/gradiliste.0cb2ec49dbd2.jpg") 42% center / cover no-repeat; background-image: image-set(url("../img/login/gradiliste.c63426750c38.webp") type("image/webp"), url("../img/login/gradiliste.0cb2ec49dbd2.jpg") type("image/jpeg")); animation: login-zoom 24s ease-out both; }
.login-art::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(18,27,69,.82) 0%, rgba(18,27,69,.25) 26%, rgba(18,27,69,.35) 48%, rgba(18,27,69,.88) 78%, rgba(18,27,69,.96) 100%),
    linear-gradient(90deg, rgba(18,27,69,.6) 0%, rgba(18,27,69,0) 65%); }
@keyframes login-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .login-photo { animation: none; } }
.login-art .brand-text strong { color: #fff; }
.login-art .brand-text span { color: #b8c3d8; }
.login-copy { margin-top: auto; max-width: 480px; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.login-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #f0a35e; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.login-eyebrow::before { content: ""; width: 28px; height: 2px; background: #f0a35e; border-radius: 2px; }
.login-art h1 { color: #fff; font-size: 34px; line-height: 1.18; letter-spacing: -.01em; max-width: 480px; margin: 14px 0 12px; }
.login-art p { max-width: 440px; color: #d3dae7; font-size: 15px; line-height: 1.55; margin: 0; }
.login-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 22px 0 0; text-shadow: none; }
.login-tags li { font-size: 12px; font-weight: 500; color: #eef2f8; padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.login-foot { color: #9aa8c1; }
.login-form { position: relative; display: grid; place-items: center; padding: 32px; background: #fff; }
.login-form .box { width: min(380px, 100%); }
.login-form h2 { font-size: 24px; letter-spacing: -.01em; margin-bottom: 4px; }
.login-form input:focus { outline: none; border-color: var(--primary, #0072CE); box-shadow: 0 0 0 3px rgba(36,89,214,.15); }
.login-copyright { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--text-3, #8a94a6); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(18,27,69,.4); z-index: 35; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px 40px; }
  .login-page { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-art { min-height: 220px; padding: 22px 20px; gap: 16px; }
  .login-photo { background-image: url("../img/login/gradiliste-900.7b8f303d118c.webp"); background-position: 45% 60%; animation: none; }
  .login-art h1 { font-size: 22px; margin: 8px 0 0; }
  .login-art p, .login-tags, .login-foot { display: none; }
  .login-form { padding: 28px 20px 64px; place-items: start center; }
}
@media (max-width: 640px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px; }
  .kpi .value { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  h1 { font-size: 19px; }
  .topbar .crumbs .hide-sm { display: none; }
  .demo-banner { padding: 7px 16px; }
}
@media print {
  .sidebar, .topbar, .actions, .tabs, .demo-banner { display: none !important; }
  .main { margin: 0; }
}

/* ---- Mjesečna projekcija ---- */
.subtabs { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.subtabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font-weight: 600; font-size: 13px; text-decoration: none; }
.subtabs a.active { background: var(--navy, #14254a); border-color: var(--navy, #14254a); color: #fff; }
.month-grid { font-size: 12.5px; }
.month-grid th.mcol, .month-grid td.mcol { min-width: 74px; }
.month-grid .cur { background: #E8F1FB; }
.budget-table.month-grid tr.sec-head th.cur { background: #dfe8fb; }
.budget-table.month-grid tr.sec-head th.sec-name { min-width: 240px; max-width: 260px; }
.month-grid th.sec-no, .month-grid td.code { width: 46px; min-width: 46px; }
.month-grid td b { color: var(--text); font-weight: 700; }
.cell-fc { color: #9aa3b2; }
.cell-fc.def { color: #b9c0cc; font-style: italic; }
.month-grid .grid-input { width: 74px; min-width: 0; text-align: right; padding: 3px 5px; font-weight: 700; }
.month-grid .grid-input.fc { color: #6b7385; font-weight: 500; }
.month-grid .grid-input::placeholder { color: #c3c9d3; font-style: italic; }
.month-grid .sticky-col { position: sticky; left: 0; z-index: 1; background: inherit; }
.month-grid .sticky-col2 { position: sticky; left: 46px; z-index: 1; background: inherit; min-width: 220px; }
.month-grid tbody tr { background: #fff; }
.month-grid td.desc { white-space: normal; min-width: 240px; max-width: 260px; line-height: 1.3; }
.month-grid th, .month-grid td { padding-left: 8px; padding-right: 8px; }
.month-grid tr.grand td { font-weight: 700; background: #e7c3c3; border-top: 2px solid #c98f8f; }
.month-grid .grid-input { border-color: #e3e7ee; background: #fbfcfe; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border); }
.hidden { display: none !important; }
.budget-table.month-grid { table-layout: fixed; width: max-content; }
.budget-table.month-grid tr.sec-head th.sec-no { width: 46px; }
.budget-table.month-grid tr.sec-head th.sec-name { width: 260px; min-width: 0; max-width: none; }
.month-grid th.bcol { width: 84px; } .month-grid th.mcol { width: 84px; }
.month-grid th.tcol { width: 128px; } .month-grid th.dcol { width: 118px; } .month-grid th.fcol { width: 150px; }
.month-grid td.desc { min-width: 0; max-width: none; }

/* ---- Forma projekta: dani ---- */
.day-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.day-stats .stat-cell { background: #f5f7fb; border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.day-stats .lbl { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.day-stats b { font-size: 18px; color: var(--text); }
.btn-delete { background: var(--red); border-color: var(--red); color: #fff; }
.btn-delete:hover { filter: brightness(.92); }
.btn-delete:disabled { opacity: .45; cursor: not-allowed; filter: none; }

/* ---- Dodatni troškovi: ko plaća ---- */
.payer-options { display: flex; gap: 22px; flex-wrap: wrap; padding: 4px 0; }
.payer-options .check { font-weight: 500; }

/* ---- Folderi projekata ---- */
.folder { margin-bottom: 10px; }
.folder > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 4px; background: #fff; border: 1px solid var(--border); }
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary::before { content: "▸"; color: var(--text-3); transition: transform .15s; display: inline-block; width: 10px; }
.folder[open] > summary::before { transform: rotate(90deg); }
.folder .f-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.folder .f-count { font-size: 11.5px; font-weight: 700; background: #eef1f6; color: var(--text-2); border-radius: 999px; padding: 1px 8px; }
.folder .f-totals { margin-left: auto; display: inline-flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); align-items: center; }
.folder .f-totals b { color: var(--text); }
.folder .f-totals b.txt-bad { color: var(--red); } .folder .f-totals b.txt-good { color: var(--green); }
.folder.lvl1 > summary { background: var(--navy-800, #14254a); border-color: var(--navy-800, #14254a); }
.folder.lvl1 > summary .f-name, .folder.lvl1 > summary::before, .folder.lvl1 > summary .f-totals, .folder.lvl1 > summary .f-totals b { color: #fff; }
.folder.lvl1 > summary .f-totals b.txt-bad { color: #ffb4ab; } .folder.lvl1 > summary .f-totals b.txt-good { color: #9be3b4; }
.folder.lvl1 > summary .f-count { background: rgba(255,255,255,.16); color: #fff; }
.folder.lvl2 > summary { background: #E8F1FB; border-color: #d6e2fb; }
.folder-body { padding: 10px 0 0 22px; }
.folder.lvl3 > .folder-body { padding-left: 0; }
.folder-empty { padding: 4px 6px 8px; }
@media (max-width: 720px) { .folder-body { padding-left: 8px; } .folder .f-totals { margin-left: 0; } }

/* ---- Mjesečni izvještaj (ekran + štampa A4) ---- */
.report-tools { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.report { background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 28px 32px; max-width: 1100px; margin: 0 auto; }
.report h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin: 22px 0 8px; }
.rep-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--navy-800, #14254a); padding-bottom: 14px; }
.rep-head h1 { font-size: 24px; margin: 4px 0; }
.rep-kicker { font-size: 12px; font-weight: 700; color: var(--blue-600); text-transform: uppercase; letter-spacing: .05em; }
.rep-meta { font-size: 12.5px; color: var(--text-3); }
.rep-brand { text-align: right; display: flex; flex-direction: column; font-size: 11.5px; color: var(--text-3); }
.rep-brand b { font-size: 20px; color: var(--navy-800, #14254a); letter-spacing: .06em; }
.rep-demo { margin-top: 10px; background: #fff1d6; color: #8a5a00; font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 3px; display: inline-block; }
.rep-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.rep-kpis > div { border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.rep-kpis span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.rep-kpis b { font-size: 20px; } .rep-kpis small { font-size: 11px; color: var(--text-3); }
.rep-kpis b.txt-bad, .report .txt-bad { color: var(--red); } .rep-kpis b.txt-good { color: var(--green); }
.rep-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rep-charts .chart { min-height: 240px; }
.rep-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rep-table { font-size: 12.5px; }
.rep-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.rep-note-print { border-left: 3px solid var(--blue-600); padding: 8px 12px; background: #f7f9fd; font-size: 13px; margin-top: 8px; }
.rep-foot { margin-top: 26px; font-size: 10.5px; color: var(--text-3); border-top: 1px solid var(--border); padding-top: 8px; }
.print-only { display: none; }
@media (max-width: 860px) { .rep-kpis, .rep-charts, .rep-two { grid-template-columns: 1fr; } .report { padding: 18px; } }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .no-print, .flash { display: none !important; }
  .app, .main, .content { display: block !important; margin: 0 !important; padding: 0 !important; }
  .report { border: 0; padding: 0; max-width: none; }
  .print-only { display: block; }
  .rep-kpis { grid-template-columns: repeat(3, 1fr); }
  .rep-charts, .rep-two { grid-template-columns: 1fr 1fr; }
  .rep-charts .chart { min-height: 200px; }
  section, table, tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Pogled kao (samo administrator) ---- */
.view-as { display: flex; align-items: center; gap: 8px; margin-right: 10px; }
.view-as label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.view-as select { height: 32px; padding: 0 8px; font-size: 13px; max-width: 260px; }
.preview-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 24px; background: #e8f0ff;
  border-bottom: 1px solid #c8d8fb; color: #1d3f8f; font-size: 13px; }
.preview-bar form { margin-left: auto; }
@media (max-width: 720px) { .view-as label { display: none; } .view-as select { max-width: 150px; } }
@media print { .view-as, .preview-bar { display: none !important; } }
.paste-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--navy-800, #14254a); color: #fff; padding: 10px 16px; border-radius: 4px; font-size: 13px; z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .2s, transform .2s; max-width: 90vw; }
.paste-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Tim projekta ---- */
.team-list { list-style: none; margin: 0; padding: 0; }
.team-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f4; }
.team-list li > div { flex: 1; }
.team-list .cell-sub { display: block; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e6edfb; color: var(--blue-700, #1d4fbf); font-weight: 700; flex: none; }

/* ---- Kontakt osobe i vizit karte ---- */
.contact-form { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px dashed var(--border); }
.card-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.card-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-pick { cursor: pointer; }
.card-thumb { display: block; width: 100%; max-width: 220px; aspect-ratio: 1.6; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); margin-bottom: 6px; background: #f5f7fb; }
.card-preview { width: 100%; max-width: 220px; aspect-ratio: 1.6; object-fit: cover; border-radius: 4px; border: 2px solid var(--blue-600); }
.contact-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef0f4; flex-wrap: wrap; }
.contact-info { flex: 1; min-width: 180px; }
.contact-info a { margin-right: 10px; }
.contact-cards { display: flex; gap: 8px; }
.contact-cards .card-thumb { width: 110px; margin: 0; }
@media (max-width: 720px) { .card-pair { grid-template-columns: 1fr; } }

/* Raspored koji se na mobitelu slaže u jednu kolonu */
.dash-split { grid-template-columns: minmax(0, 2.6fr) minmax(300px, 1fr); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .dash-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid-4 { grid-template-columns: 1fr 1fr; } }

/* Link „Preuzmi aplikaciju“ (sakriven kad je portal već otvoren kao aplikacija) */
.app-link { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 0 -4px 10px; border-radius: 4px; color: #cfd7e6; text-decoration: none; background: rgba(255,255,255,.04); }
.app-link:hover { background: rgba(255,255,255,.09); color: #fff; }
.app-link small { margin-left: auto; color: #6c7a96; font-size: 11px; }
.app-link-login { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 550; }
.app-link-login:hover { border-color: var(--primary, #0072CE); }
@media (display-mode: standalone) { .app-link, .app-link-login { display: none; } }
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 42px; background: #fff; color: #1f1f1f; border: 1px solid var(--border-strong); text-decoration: none; }
.btn-ms:hover { border-color: var(--primary, #0072CE); }
.login-remember { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 13px; color: var(--text-muted, #6b7280); cursor: pointer; }
.login-remember input { width: 16px; height: 16px; margin: 0; }
.login-or { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--text-muted, #6b7280); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid var(--border, #e5e7eb); }

/* Očitavanje vizit karte */
.scan-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; width: 100%; }
.scan-box .btn[disabled] { opacity: .5; cursor: not-allowed; }
.scan-status { flex: 1 1 200px; }
.scan-ok { color: #17603a; }
.scan-err { color: #b42318; }
.scan-raw { width: 100%; }
.scan-raw pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2, #f5f7fa); border-radius: 3px; padding: 8px; margin: 6px 0 0; max-height: 180px; overflow: auto; }
.contact-form input.scan-filled, .contact-form textarea.scan-filled { background: #fff8e1; border-color: #f0c36d; }
.card-upload .btn-primary.card-pick, .card-upload .btn-primary.card-pick * { color: #fff; }
.field .card-upload label.btn { display: inline-flex; margin-bottom: 0; font-size: 13px; }

/* Mapa klijenata */
.map-card { overflow: hidden; }
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.map-toolbar select { min-width: 240px; max-width: 100%; flex: 0 1 380px; }
.map-legend { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.pin-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 6px; }
.pin-dot.ok { background: #0072CE; } .pin-dot.manual { background: #12805c; } .pin-dot.approx { background: #d98a00; }
.client-map { height: calc(100vh - 260px); min-height: 420px; position: relative; background: #eef1f6; z-index: 0; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--text-2); }
.map-hint { padding: 8px 14px; border-top: 1px solid var(--border); }
.map-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #0072CE; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center; }
.map-pin span { transform: rotate(45deg); color: #fff; font: 700 9px Inter, Arial, sans-serif; }
.map-pin.manual { background: #12805c; } .map-pin.approx { background: #d98a00; } .map-pin.street { background: #4aa3df; }
.pin-dot.street { background: #4aa3df; }
.map-improve { margin: 0; }
.map-pop { min-width: 190px; font-size: 13px; line-height: 1.45; }
.map-pop b { font-size: 14px; }
.map-pop-actions { display: flex; gap: 12px; margin-top: 6px; font-weight: 600; }
@media (max-width: 640px) { .client-map { height: 62vh; min-height: 340px; } .map-legend { margin-left: 0; } .map-toolbar select { flex: 1 1 100%; } }
form input.scan-filled, form textarea.scan-filled { background: #fff8e1; border-color: #f0c36d; }

/* ===== Ponude ===== */
.offer-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.offer-tile { display: flex; flex-direction: column; gap: 4px; padding: 26px 28px; border-radius: 6px; text-decoration: none; color: #fff;
  min-height: 150px; justify-content: center; position: relative; overflow: hidden; border: 3px solid transparent;
  box-shadow: 0 6px 18px rgba(18,27,69,.12); transition: transform .12s ease, box-shadow .12s ease, opacity .12s; opacity: .62; }
.offer-tile:hover { transform: translateY(-2px); opacity: .9; }
.offer-tile.active { opacity: 1; border-color: rgba(255,255,255,.65); box-shadow: 0 10px 28px rgba(18,27,69,.25); }
.offer-tile .t-label { font-size: 30px; font-weight: 800; letter-spacing: .06em; }
.offer-tile .t-count { font-size: 46px; font-weight: 800; line-height: 1; position: absolute; right: 28px; top: 50%; transform: translateY(-50%); opacity: .95; }
.offer-tile .t-sub { font-size: 14px; opacity: .92; max-width: 70%; }
.tile-open { background: linear-gradient(135deg, #0072CE, #005BA6); }
.tile-done { background: linear-gradient(135deg, #17a36b, #0d6e47); }
@media (max-width: 640px) {
  .offer-tiles { gap: 10px; }
  .offer-tile { padding: 18px 16px; min-height: 120px; }
  .offer-tile .t-label { font-size: 19px; }
  .offer-tile .t-count { position: static; transform: none; font-size: 34px; order: -1; }
  .offer-tile .t-sub { max-width: none; font-size: 12px; }
}
.offer-filters { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.offer-filters select.input { width: auto; max-width: 100%; }
.kind-sums { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.kind-sum { background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.badge.kind-proizvodnja { background: #fdf0e3; color: #a3540b; }
.badge.kind-rack_montaza { background: var(--blue-50); color: var(--blue-700); }
.badge.kind-elektro_montaza { background: #fff7d6; color: #8a6400; }
.badge.kind-integralni { background: #efebfc; color: var(--violet); }
.due { display: inline-block; }
.due .cell-sub { font-weight: 600; }
.due-overdue, .due-overdue .cell-sub { color: var(--red); font-weight: 700; }
.due-soon, .due-soon .cell-sub { color: #b26a00; font-weight: 700; }
table.data tr.row-overdue td:first-child { box-shadow: inset 4px 0 0 var(--red); }
table.data tr.row-soon td:first-child { box-shadow: inset 4px 0 0 #e8a100; }
td.right, .right { text-align: right; }
.kind-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kind-opt { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 10px; border: 2px solid var(--border);
  border-radius: 5px; cursor: pointer; font-weight: 700; font-size: 15px; text-align: center; background: #fff; }
.kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.kind-opt:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); box-shadow: 0 0 0 3px rgba(36,89,214,.12); }
@media (max-width: 720px) { .kind-picker { grid-template-columns: 1fr 1fr; } }
.due-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: -6px; }
.static-value { padding: 8px 0; font-weight: 600; }
.big-num { font-size: 18px; }
.dash-offer { display: flex; justify-content: space-between; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13.5px; }
.dash-offer:hover { background: #f7f9fc; }
.dash-offer .due { text-align: right; white-space: nowrap; }
.offer-table .code { white-space: nowrap; }
.demo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 10px; }
.metric-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.metric { flex: 1 1 130px; background: #f6f8fc; border-radius: 4px; padding: 10px 12px; }
.metric span { display: block; font-size: 12px; color: var(--text-2); }
.metric b { font-size: 16px; }

/* Analitika ponuda */
.an-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.an-filters input[type=date], .an-filters select { width: auto; }
.an-quick { display: flex; gap: 10px; margin-left: 6px; }
.an-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.an-jump a { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--text); }
.an-note { margin: 4px 0 14px; }
.an-section { margin-bottom: 16px; scroll-margin-top: 70px; }
.an-metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.an-metric { background: #f6f8fc; border-radius: 5px; padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; }
.an-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.an-value { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.an-value small { font-size: 14px; font-weight: 600; color: var(--text-2); }
.an-range { font-size: 12.5px; color: var(--text-2); }
.an-n { font-size: 11.5px; color: var(--text-3, #8a94a6); }
.an-sub { font-size: 14px; margin: 18px 0 8px; }
.an-bars { display: flex; flex-direction: column; gap: 8px; }
.an-bar-row { display: grid; grid-template-columns: 170px 1fr 150px; gap: 12px; align-items: center; }
.an-bar-label { font-weight: 600; }
.an-bar-label small, .an-bar-val small { display: block; font-weight: 400; font-size: 11.5px; color: var(--text-2); }
.an-bar { height: 14px; background: #eef1f6; border-radius: 3px; overflow: hidden; }
.an-bar i { display: block; height: 100%; background: linear-gradient(90deg, #f0a24a, #a3540b); border-radius: 3px; }
.an-bar-val { text-align: right; font-variant-numeric: tabular-nums; }
.an-details { margin-top: 16px; }
.an-details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }
@media (max-width: 640px) { .an-bar-row { grid-template-columns: 1fr 110px; } .an-bar { grid-column: 1 / -1; order: 3; } .an-value { font-size: 20px; } }
/* Pretraga na mapi */
.map-search { position: relative; flex: 1 1 360px; max-width: 520px; display: flex; align-items: center; }
.map-search > svg { position: absolute; left: 11px; color: var(--text-3, #8a94a6); pointer-events: none; }
.map-search input { width: 100%; padding-left: 34px; padding-right: 30px; }
.map-search input::-webkit-search-cancel-button { display: none; }
.map-clear { position: absolute; right: 6px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--text-2); cursor: pointer; padding: 2px 6px; }
.map-sugg { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1000; list-style: none; margin: 0; padding: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 10px 30px rgba(18,27,69,.18); max-height: 360px; overflow: auto; }
.map-sugg li { padding: 8px 10px; border-radius: 3px; cursor: pointer; font-size: 13.5px; line-height: 1.35; }
.map-sugg li span { display: block; font-size: 12px; color: var(--text-2); }
.map-sugg li span.who { color: var(--text-3, #8a94a6); }
.map-sugg li:hover, .map-sugg li.on { background: var(--blue-50); }
.map-sugg mark { background: #ffe9a8; color: inherit; border-radius: 2px; padding: 0 1px; }
.map-sugg .map-sugg-all { color: var(--blue-700); font-weight: 600; border-top: 1px solid var(--border); border-radius: 0; margin-top: 2px; }
.map-sugg .map-sugg-empty { color: var(--text-2); cursor: default; }
@media (max-width: 640px) { .map-search { flex-basis: 100%; max-width: none; } }
.seg { display: flex; gap: 8px; }
.seg-opt { flex: 1; display: flex; justify-content: center; align-items: center; padding: 10px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; font-weight: 700; background: #fff; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:checked) { border-color: var(--blue-600); background: var(--blue-50); color: var(--blue-700); }
.badge-accepted { background: #e6f6ee; color: #0d6e47; border: 1px solid #a8dcc0; }
.badge-rejected { background: #fdecea; color: #a3261a; border: 1px solid #f3b9b1; }
.badge-waiting { background: #fff4dc; color: #8a5300; border: 1px solid #f0d49a; }
.callout.sales-phase { background: #f3effd; border-color: #d9cff7; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.callout.sales-phase .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.callout.sales-phase form { margin: 0; }
.calc-link { color: var(--blue-700); text-decoration: none; white-space: nowrap; } .calc-link:hover { text-decoration: underline; } .calc-link .icon { vertical-align: -1px; }
/* O firmi */
.about-card .card-head form { margin: 0 0 0 8px; }
.about-desc { margin: 0 0 4px; font-size: 14.5px; line-height: 1.55; }
.about-src { margin: 0 0 12px; }
.about-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 10px 0 8px; }
.about-facts div { background: #f6f8fc; border-radius: 4px; padding: 9px 12px; }
.about-facts span { display: block; font-size: 12px; color: var(--text-2); }
.about-facts b { font-size: 14.5px; }
.about-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 10px; border-top: 1px dashed var(--border); }
.user-chip .chip-btn { color: var(--navy-300); padding: 6px; border-radius: 3px; display: inline-flex; } .user-chip .chip-btn:hover { color: #fff; background: rgba(255,255,255,.06); }

/* Admin panel */
.cred-box { background: #e9f7ef; border: 1px solid #a8dcc0; border-radius: 5px; padding: 14px 16px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cred-head { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #0d6e47; }
.cred-dl { width: 100%; display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.cred-dl dt { color: var(--text-2); }
.cred-dl dd { margin: 0; }
.cred-dl code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.cred-dl code.pw { font-size: 16px; font-weight: 700; background: #fff; padding: 2px 8px; border-radius: 3px; border: 1px solid #a8dcc0; }
.nu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pw-row { display: flex; gap: 6px; }
.pw-row .input { flex: 1; }
.seg-4 { flex-wrap: wrap; }
.seg-4 .seg-opt { min-width: 90px; }
.input-sm { height: 30px; padding: 2px 8px; font-size: 13px; width: auto; }
.inline-form { display: inline-block; margin: 0 0 0 4px; vertical-align: middle; }
.users-table td { vertical-align: middle; }
tr.row-dim td { opacity: .6; }
.ustat { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.ustat-ok { background: var(--green-bg); color: var(--green); }
.ustat-temp { background: var(--amber-bg); color: var(--amber); }
.ustat-expired, .ustat-off { background: var(--red-bg); color: var(--red); }
.no-email { color: var(--red); font-weight: 600; white-space: nowrap; }
.caps-table th.center, .caps-table td.center { text-align: center; }
.caps-table th { white-space: normal; min-width: 92px; }
.caps-table tr.caps-group td { background: #f4f6fa; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.caps-table input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }
.cap-cell { display: inline-flex; padding: 4px; border-radius: 3px; }
.cap-cell.changed { background: #fff2cc; box-shadow: inset 0 0 0 1px #f0c36d; }
.cap-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #fff2cc; box-shadow: inset 0 0 0 1px #f0c36d; vertical-align: -2px; }
.caps-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.caps-actions .small { margin-right: auto; }
@media (max-width: 640px) { .nu-grid { grid-template-columns: 1fr; } .cred-dl { grid-template-columns: 1fr; } }
.avatar.pd { background: #6a4fd1; }
/* Revizije ponude */
.rev-current { border: 1px solid var(--border); border-radius: 5px; padding: 12px 14px; background: #fbfcfe; }
.rev-head { margin-bottom: 10px; }
.rev-badge { display: inline-block; background: var(--blue-600); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 3px; }
.rev-badge.old { background: #8a94a6; }
.rev-badge.sm { font-size: 10.5px; padding: 1px 6px; margin-top: 3px; }
.rev-grid { gap: 16px; }
.file-list { list-style: none; margin: 0 0 8px; padding: 0; }
.file-list li { display: flex; align-items: center; gap: 6px; padding: 3px 0; flex-wrap: wrap; }
.upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rev-dl { grid-template-columns: 130px 1fr; margin-bottom: 10px; }
.rev-new { margin-top: 14px; }
.rev-new > summary { list-style: none; display: inline-flex; }
.rev-new > summary::-webkit-details-marker { display: none; }
.rev-new-form { margin-top: 10px; display: grid; gap: 10px; max-width: 620px; }
.inline-files { display: inline-block; margin-right: 10px; text-align: left; }
.inline-files summary { cursor: pointer; color: var(--blue-700); }
/* Kalkulacija uz ponudu */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.calc-side { position: sticky; top: 70px; }
.calc-sec { margin-bottom: 14px; }
.calc-table td { padding-top: 4px; padding-bottom: 4px; }
.calc-table .grid-input { width: 100%; }
.calc-table .grid-input.text { text-align: left; }
.calc-add { padding-top: 6px; padding-bottom: 10px; }
.del-x { cursor: pointer; color: var(--red); font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.del-x input { display: none; }
.del-x:has(input:checked) { background: var(--red-bg); }
tr.row-del td { text-decoration: line-through; opacity: .5; }
.sum-dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.sum-dl dt { color: var(--text-2); }
.sum-dl dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-dl .grid-input { width: 110px; text-align: right; }
.pct-in { display: inline-flex; align-items: center; gap: 4px; }
.pct-in .grid-input { width: 70px; }
.price-dt { font-weight: 700; color: var(--text) !important; }
.price-dd { font-size: 18px; color: var(--blue-700); }
.sum-sep { border-top: 1px dashed var(--border); margin: 12px 0; }
@media (max-width: 1100px) { .calc-layout { grid-template-columns: 1fr; } .calc-side { position: static; } }
.timeline li.mine .what a b { color: #b26a00; }

/* ---------- Primopredaja ---------- */
.callout.handover-wait { background: #eef3ff; border: 1px solid #c9d8ff; align-items: flex-start; flex-wrap: wrap; }
.callout.handover-wait .actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.inline-return summary { list-style: none; }
.inline-return summary::-webkit-details-marker { display: none; }
.inline-return[open] form { display: flex; gap: 6px; margin-top: 6px; }
.inline-return input { min-width: 200px; padding: 6px 8px; border: 1px solid var(--border, #d9dee8); border-radius: 3px; font: inherit; }

/* ---------- Klijenti: stari / novi, sljedeći kontakt ---------- */
.form-sub { font-weight: 700; font-size: 13px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.client-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.ctab { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 5px; background: #fff; color: inherit; }
.ctab b { font-size: 24px; line-height: 1.1; }
.ctab span { font-weight: 600; }
.ctab small { color: #6b7385; font-size: 12px; }
.ctab:hover { border-color: #b9c6e4; }
.ctab.active { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(36, 89, 214, .12); }
.ctab-old b { color: #148a4f; }
.ctab-new b { color: var(--blue-600); }
.contact-filter { padding: 10px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.cf-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cf-label { font-weight: 700; font-size: 13px; margin-right: 4px; }
.cf-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7385; }
.cf-row .input { width: auto; min-width: 0; padding: 6px 8px; }
.chip { display: inline-flex; gap: 5px; align-items: center; padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; color: inherit; background: #fff; }
.chip:hover { border-color: #b9c6e4; }
.chip.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.chip.chip-bad b { color: var(--red); }
.chip.active b { color: #fff; }
.next-contact { font-weight: 600; white-space: nowrap; }
.next-contact.nc-overdue { color: var(--red); }
.next-contact.nc-today { color: #b45a00; }
.next-contact.nc-soon { color: var(--blue-600); }
.contact-plan .dl { margin-bottom: 10px; }
.contact-plan form.cp-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.contact-plan form.cp-form .span-2 { grid-column: 1 / -1; }
.contact-plan .cp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.followup-box { border: 1px solid #f2d9a3; background: #fff8e8; border-radius: 4px; padding: 10px 12px; margin-top: 12px; }
.followup-box form { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.followup-box input[name=note] { flex: 1; min-width: 180px; }
.offer-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; position: sticky; top: 0; z-index: 5; background: var(--bg, #f5f7fb); padding: 6px 0; }
.offer-nav a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: #fff; color: inherit; }
.offer-nav a:hover { border-color: var(--blue-600); color: var(--blue-600); }
tr.offer-more > td { background: #f8faff; padding: 0 !important; }
.om-body { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 12px 16px 14px; }
.om-body h4 { margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #6b7385; }
.om-body .file-list { margin: 0; }
.om-links { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; }
.om-toggle { border: 0; background: none; cursor: pointer; font-size: 13px; color: var(--blue-600); padding: 2px 4px; }
@media (max-width: 760px) {
  .client-tabs { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .ctab { padding: 10px; } .ctab b { font-size: 19px; } .ctab small { display: none; }
  .om-body { grid-template-columns: 1fr 1fr; }
  .contact-plan form.cp-form { grid-template-columns: 1fr; }
}
.todo-card .timeline li { display: flex; gap: 10px; align-items: flex-start; }
.todo-card .timeline li .what { flex: 1; }

/* ---------- Tehnički ured ---------- */
.tech-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.tech-table .grid-input { max-width: 140px; margin-left: auto; }
tr.row-mine td:first-child { box-shadow: inset 3px 0 0 var(--blue-600); }
.flow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.flow-step { border: 1px solid var(--border); border-radius: 4px; padding: 10px 12px; background: #fff; font-size: 13px; }
.flow-step b { display: block; font-size: 13.5px; }
.flow-step .n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e6eaf2; font-size: 11.5px; font-weight: 700; margin-right: 6px; }
.flow-step.done { border-color: #bfe6cf; background: #f2fbf6; } .flow-step.done .n { background: var(--green); color: #fff; }
.flow-step.now { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(36, 89, 214, .12); } .flow-step.now .n { background: var(--blue-600); color: #fff; }
.flow-step .small { color: #6b7385; margin-top: 3px; }
.tech-send { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.tech-send .span-2 { grid-column: 1 / -1; }
@media (max-width: 860px) { .tech-layout, .flow-steps, .tech-send { grid-template-columns: 1fr; } }

/* ---------- Status ponude + analitika ---------- */
.offer-tiles { grid-template-columns: 1fr 1fr 1fr; }
.tile-an { background: linear-gradient(135deg, #7a4fe0, #4b2aa8); }
@media (min-width: 641px) { .offer-tile .t-label { font-size: 26px; } }
.outcome-form { margin: 0; }
.outcome-select { font: inherit; font-size: 12.5px; font-weight: 600; border-radius: 999px; padding: 4px 8px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.outcome-select.oc-prihvacena { background: #e6f6ee; color: #0d6e47; border-color: #a8dcc0; }
.outcome-select.oc-odbijena { background: #fdecea; color: #a3261a; border-color: #f3b9b1; }
.outcome-select.oc-na_cekanju { background: #fff4dc; color: #8a5300; border-color: #f0d49a; }
.an-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.an-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.an-kpi { background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 12px 14px; }
.an-kpi span { display: block; font-size: 12px; color: #6b7385; }
.an-kpi b { font-size: 22px; display: block; margin-top: 2px; }
.an-kpi small { color: #6b7385; font-size: 12px; }
.an-kpi.good b { color: #0d6e47; } .an-kpi.bad b { color: #a3261a; } .an-kpi.wait b { color: #8a5300; }
.an-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.an-funnel { display: flex; height: 26px; border-radius: 4px; overflow: hidden; margin: 6px 0 10px; background: #eef1f6; }
.an-funnel span { display: block; height: 100%; }
.an-funnel .f-acc { background: #17a36b; } .an-funnel .f-rej { background: #e0574a; } .an-funnel .f-wait { background: #f0b544; } .an-funnel .f-open { background: #7aa2ff; }
.an-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #4a5263; }
.an-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.mini-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #eef1f6; min-width: 90px; }
.mini-bar span { display: block; height: 100%; }
.mini-bar .f-acc { background: #17a36b; } .mini-bar .f-rej { background: #e0574a; } .mini-bar .f-wait { background: #f0b544; }
.an-month { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 160px; padding-top: 10px; }
.an-month .col { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; gap: 2px; }
.an-month .seg { border-radius: 3px 3px 0 0; }
.an-month .lbl { font-size: 11px; color: #6b7385; text-align: center; margin-top: 4px; }
.an-month .val { font-size: 11px; text-align: center; color: #4a5263; }
@media (max-width: 1100px) { .an-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .an-grid { grid-template-columns: 1fr; } .an-kpis { grid-template-columns: 1fr 1fr; } .offer-tiles { grid-template-columns: 1fr; } }
.an-reason { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.an-reason:last-child { border-bottom: 0; }
.offer-tile .t-icon { display: flex; opacity: .9; }
@media (max-width: 640px) { .offer-tile .t-icon svg { width: 40px; height: 40px; } }
.size-badge { letter-spacing: .02em; }
.size-badge.size-mali { background: #eef3ff; color: #0072CE; border: 1px solid #c9d8ff; }
.size-badge.size-srednji { background: #f1ebff; color: #5b34c4; border: 1px solid #d6c7fb; }
.size-badge.size-veliki { background: #1c2742; color: #fff; border: 1px solid #1c2742; }
.size-hint { margin-top: 6px; }
.field input.value-mismatch:not([type=checkbox]) { border-color: #e0a63a; background: var(--amber-bg); }
.field .help.value-mismatch-hint { color: #7d4b00; background: var(--amber-bg); border: 1px solid #f2d9a3; border-radius: 6px; padding: 6px 9px; margin-top: 6px; }
.value-mismatch-hint .link-btn { background: none; border: 0; padding: 0; color: var(--primary, #0072CE); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.size-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.size-card { border: 1px solid var(--border); border-radius: 5px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.size-card .sc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.size-card .sc-n { font-size: 26px; line-height: 1.1; }
.size-card.size-veliki { border-color: #1c2742; }
.size-matrix td .cell-sub { font-weight: 400; }
@media (max-width: 760px) { .size-cards { grid-template-columns: 1fr; } }

/* ---------- Kontrolna tabla po ulogama ---------- */
.dash-tabs { margin-bottom: 14px; }
.dash-main:not(.grid) { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dk { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 12px 14px; color: inherit; text-decoration: none; }
a.dk:hover { border-color: #b9c6e4; }
.dk span { font-size: 12.5px; color: #6b7385; }
.dk b { font-size: 26px; line-height: 1.15; }
.dk small { font-size: 12px; color: #6b7385; }
.dk small em { font-style: normal; color: var(--red); font-weight: 700; }
.dk.bad { border-left: 4px solid var(--red); } .dk.warn { border-left: 4px solid #f0b544; } .dk.wait b { color: #8a5300; } .dk.good b { color: #0d6e47; }
.avatar.sm { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e6ecfb; color: #0072CE; font-size: 11px; font-weight: 700; margin-right: 4px; vertical-align: middle; }
.pd-card.pd-over { border-left: 4px solid var(--red); } .pd-card.pd-ok { border-left: 4px solid #17a36b; }
.pd-card .card-head h2 a { color: inherit; }
.pd-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(220px, 1fr); gap: 16px; align-items: start; }
.pd-chart { min-height: 220px; }
.pd-dl dt { font-size: 12.5px; } .pd-dl dd { margin-bottom: 4px; }
.ok-text { color: #0d6e47; font-weight: 600; }
.pd-extra { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip-s { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: #eef1f6; }
.chip-s.s-pending { background: #fff4dc; color: #8a5300; } .chip-s.s-approved { background: #e6f6ee; color: #0d6e47; } .chip-s.s-rejected { background: #fdecea; color: #a3261a; }
@media (max-width: 1100px) { .dash-main:not(.grid) { grid-template-columns: 1fr; } .pd-body { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .dash-kpis { grid-template-columns: 1fr 1fr; } .dk b { font-size: 21px; } }
.demo-lists h3 { margin: 0 0 4px; } .demo-lists .file-list { max-height: 220px; overflow: auto; }
.demo-delete-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ---------- Sales faza: budžet i odobrenje ---------- */
.stage { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.stage-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.stage-pill.st-draft { background: #eef1f6; color: #4a5263; }
.stage-pill.st-wait { background: #fff4dc; color: #8a5300; border: 1px solid #f0d49a; }
.stage-pill.st-ok { background: #e6f6ee; color: #0d6e47; border: 1px solid #a8dcc0; }
.stage-pill.st-returned { background: #fdecea; color: #a3261a; border: 1px solid #f3b9b1; }
.stage-pill.st-handover { background: #eef3ff; color: #005BA6; border: 1px solid #c9d8ff; }
.stage-approvers { display: flex; flex-wrap: wrap; gap: 4px; }
.appr { font-size: 11.5px; padding: 2px 7px; border-radius: 3px; background: #f4f6fa; color: #4a5263; white-space: nowrap; }
.appr.appr-approved { background: #e6f6ee; color: #0d6e47; } .appr.appr-pending { background: #fff8e8; color: #8a5300; } .appr.appr-returned { background: #fdecea; color: #a3261a; }
.stage-note { font-size: 11.5px; color: #6b7385; }
.stage-steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.stage-steps .ss { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #eef1f6; color: #6b7385; }
.stage-steps .ss.done { background: #e6f6ee; color: #0d6e47; font-weight: 600; }
.stage-steps .ss.now { background: #fff4dc; color: #8a5300; font-weight: 700; border: 1px solid #f0d49a; }
.stage-steps .ss.bad { background: #fdecea; color: #a3261a; font-weight: 700; }

/* ---------------- Plan prodaje — proizvodnja ---------------- */
.content:has(.plan-page) { max-width: none; }
.plan-year { display: inline-flex; }
.plan-year .input { width: auto; }
.seg-mini { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.seg-mini a, .seg-mini span { padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; }
.seg-mini a + a { border-left: 1px solid var(--border); }
.seg-mini .on { background: #121B45; color: #fff; }
.plan-legend { display: flex; gap: 18px; align-items: center; padding: 12px 16px; margin-bottom: 14px; flex-wrap: wrap; font-size: 13px; }
.plan-help { flex-basis: 100%; }
.lg-cell { border: 1px solid #e3e7ee; border-radius: 4px; padding: 4px 10px; min-width: 84px; text-align: right; }
.lg-c { color: #0d6e47; font-weight: 700; } .lg-p { color: #8a5300; font-weight: 700; } .lg-plan { color: #c4321f; font-weight: 700; }
.plan-card { margin-bottom: 18px; }
.plan-card .card-head { gap: 12px; flex-wrap: wrap; } .plan-card .card-head .hint { flex: 1; }
.plan-warn { margin: 10px 16px; }
.plan-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }
.plan-table th { background: #f7f8fb; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #5b6475; padding: 8px; border-bottom: 1px solid #e3e7ee; white-space: nowrap; }
.plan-table td { padding: 6px 8px; border-bottom: 1px solid #eef0f4; white-space: nowrap; vertical-align: middle; }
.plan-table .sticky { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 210px; border-right: 1px solid #e3e7ee; text-align: left; }
.plan-table thead .sticky { background: #f7f8fb; }
.plan-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.plan-table .sticky a { color: inherit; }
.plan-badge { font-size: 10px; }
.pc { text-align: right; min-width: 78px; position: relative; }
.pc-edit { cursor: pointer; outline: none; }
.pc-edit:hover { background: #f3f6fd; }
.pc-edit.sel { box-shadow: inset 0 0 0 2px var(--blue-600, #0072CE); background: #eef3ff; }
.pc-edit.busy { opacity: .45; }
.pc-flag { position: absolute; top: 3px; left: 3px; width: 6px; height: 6px; border-radius: 50%; background: #0072CE; }
.pc.no-price .pc-empty { color: #c4321f; font-size: 10.5px; }
.v-c { font-weight: 700; color: #121B45; font-variant-numeric: tabular-nums; border-right: 3px solid #17a36b; padding-right: 5px; }
.v-p { font-style: italic; color: #8a5300; font-size: 11.5px; font-variant-numeric: tabular-nums; padding: 1px 5px 1px 0; margin-top: 2px; border-right: 3px dashed #f0b544;
  background: repeating-linear-gradient(-45deg, #fff8e6 0 4px, #ffefcc 4px 8px); border-radius: 3px; }
.v-pt { font-style: italic; color: #8a5300; }
.pc-empty { color: #c3c9d4; }
.plan-table .tot { background: #f7f8fb; border-left: 1px solid #e3e7ee; }
.plan-table tfoot td { font-weight: 700; }
tr.sum-c td { background: #e9f7ef; color: #0d6e47; } tr.sum-c td.sticky { background: #e9f7ef; }
tr.sum-p td { background: repeating-linear-gradient(-45deg, #fff8e6 0 5px, #ffefcc 5px 10px); color: #8a5300; font-style: italic; } tr.sum-p td.sticky { background: #fff3d6; }
.plan-table tr.sum-t td { background: #121B45; color: #fff; } .plan-table tr.sum-t td.sticky { background: #121B45; }
.plan-table tr.sum-t td.gap-ok { color: #7fe0b2; } .plan-table tr.sum-t td.gap-bad { color: #ffb4aa; }
tr.sum-bar td { height: 64px; vertical-align: bottom; border-bottom: 0; }
.mbar { height: 56px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.mbar span { display: block; width: 26px; }
.mb-c.blue { background: #0072CE; } .mb-c.violet { background: #6a4fd1; }
.mb-p.blue { background: repeating-linear-gradient(-45deg, #dbe6ff 0 3px, #0072CE 3px 5px); opacity: .75; border-radius: 3px 3px 0 0; }
.mb-p.violet { background: repeating-linear-gradient(-45deg, #ebe4ff 0 3px, #6a4fd1 3px 5px); opacity: .75; border-radius: 3px 3px 0 0; }
.mb-plan { position: absolute; left: 50%; transform: translateX(-50%); width: 40px; border-top: 3px dashed #c4321f; z-index: 2; }
.plan-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.pk { border: 1px solid #e3e7ee; border-radius: 5px; padding: 10px 14px; background: #fff; }
.pk span { display: block; font-size: 12px; color: #6b7385; } .pk b { font-size: 22px; } .pk small { display: block; color: #6b7385; }
.pk small b { font-size: 12.5px; }
.pk.c { border-left: 5px solid #17a36b; } .pk.c b { color: #0d6e47; }
.pk.p { border-left: 5px dashed #f0b544; background: repeating-linear-gradient(-45deg, #fffaf0 0 6px, #fff3d9 6px 12px); } .pk.p > b { color: #8a5300; font-style: italic; }
.pk.plan { border-left: 5px solid #c4321f; } .pk.plan > b { color: #c4321f; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: #4a5263; margin: 4px 0 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.sw.c.blue { background: #0072CE; } .sw.c.violet { background: #6a4fd1; }
.sw.p.blue { background: repeating-linear-gradient(-45deg, #dbe6ff 0 3px, #0072CE 3px 5px); border: 1px dashed #0072CE; }
.sw.p.violet { background: repeating-linear-gradient(-45deg, #ebe4ff 0 3px, #6a4fd1 3px 5px); border: 1px dashed #6a4fd1; }
.sw.planl { width: 22px; height: 0; border-top: 3px dashed #c4321f; border-radius: 0; vertical-align: 4px; }
.plan-chart { width: 100%; height: auto; display: block; }
tr.plan-row td { background: #fff; border-top: 2px solid #c4321f; border-bottom: 2px solid #c4321f; color: #c4321f; font-weight: 700; }
.plan-sub { font-weight: 400; }
.plan-in { display: inline-block; border: 1px dashed #e6a39a; border-radius: 3px; padding: 1px 5px; background: #fff7f5; }
tr.gap-row td, tr.gap-row2 td { font-size: 11.5px; font-weight: 600; }
tr.gap-row2 td { font-style: italic; }
td.gap-ok, .gap-ok { color: #0d6e47; } td.gap-bad, .gap-bad { color: #c4321f; }
.cell-sub { display: block; font-size: 10px; font-weight: 500; opacity: .8; }
tr.r-plan td { color: #c4321f; } tr.r-p td { font-style: italic; color: #8a5300; }
.plan-col { color: #c4321f; font-weight: 600; }
.price { background: #fbfaf6; border-right: 1px solid #e3e7ee; min-width: 74px; }
.price-in { display: inline-block; border: 1px dashed #c9cfda; border-radius: 3px; padding: 1px 6px; background: #fff; font-weight: 600; }
.empty-price { color: #9aa3b5; font-weight: 400; font-style: italic; }
.plan-pastebar { position: sticky; top: 8px; z-index: 20; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px;
  background: #121B45; color: #fff; border-radius: 5px; box-shadow: 0 10px 30px rgba(18, 27, 69, .25); font-size: 13px; }
.plan-pastebar .muted { color: #b5bfd3 !important; }
.plan-pastebar .lg-c { color: #7fe0b2; } .plan-pastebar .lg-p { color: #ffd27a; }
.plan-pastebar .btn-ghost { color: #fff; }
.pb-mode label { margin-left: 8px; cursor: pointer; }
dialog .in-c { border-left: 5px solid #17a36b !important; font-weight: 700; }
dialog .in-p { border-left: 5px dashed #f0b544 !important; background: repeating-linear-gradient(-45deg, #fff 0 6px, #fff3d6 6px 12px) !important; font-style: italic; color: #8a5300; }
.plan-target-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
.plan-target-grid .field { margin: 0; }
.plan-target-grid .input { border-left: 4px solid #c4321f; }
.plan-target-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.plan-line-actions { flex-wrap: wrap; }
.plan-import-opts { display: flex; gap: 18px; flex-wrap: wrap; }
.plan-import-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 180px; }
tr.flash-row td { animation: planflash 2.4s ease-out; }
@keyframes planflash { 0% { background: #fff3b0; } 100% { } }
@media (max-width: 900px) { .plan-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plan-target-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .plan-table .sticky { min-width: 140px; max-width: 150px; white-space: normal; }
  .plan-legend { gap: 8px; } .plan-target-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plan-target-row { grid-template-columns: 1fr; }
}
.plan-pastebar[hidden] { display: none; }
.plan-chart { max-height: 380px; margin: 0 auto; }
.plan-an-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 1800px) { .plan-an-grid { grid-template-columns: 1fr 1fr; gap: 18px; } }
#dlg-cell .field, #dlg-line .field, [id^="dlg-add-"] .field { margin-top: 12px; }
.plan-target-grid .input.plan-in-input { border-left: 4px solid #c4321f !important; }
.plan-pastebar .muted { flex: 1 1 260px; }
@media (max-width: 640px) { .plan-card .card-head .hint { display: none; } .plan-card .card-head h2 { flex: 1; } .plan-table .price { min-width: 56px; } }
.plan-kpi-body { padding-bottom: 4px; border-bottom: 1px solid #eef0f4; }
.plan-scope { display: inline-flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; padding: 4px; background: #f1f3f8; border-radius: 5px; }
.plan-scope a { padding: 8px 16px; border-radius: 4px; font-weight: 700; font-size: 13.5px; color: var(--text-2); text-decoration: none; }
.plan-scope a:hover { background: #fff; }
.plan-scope a.on { background: #fff; color: #121B45; box-shadow: 0 1px 4px rgba(18, 27, 69, .15); }
.plan-scope a.ps-klijenti.on { color: #0072CE; } .plan-scope a.ps-newcold.on { color: #6a4fd1; }
.share-cell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.share-bar { flex: 1; height: 10px; background: #eef0f4; border-radius: 3px; overflow: hidden; display: flex; }
.share-bar span { height: 100%; }
.sb-c.blue { background: #0072CE; } .sb-c.violet { background: #6a4fd1; }
.sb-p.blue { background: repeating-linear-gradient(-45deg, #dbe6ff 0 3px, #0072CE 3px 5px); opacity: .7; }
.sb-p.violet { background: repeating-linear-gradient(-45deg, #ebe4ff 0 3px, #6a4fd1 3px 5px); opacity: .7; }
/* plan kg kod klijenta */
.plan-kg-cell { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; text-decoration: none; }
.plan-kg-cell .v-c, .plan-kg-cell .v-p { display: block; }
.client-plan-year + .client-plan-year { border-top: 1px solid var(--border); }
.cpy-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pill-kg { padding: 4px 10px; border-radius: 999px; font-size: 12.5px; }
.pill-kg.c { background: #e9f7ef; color: #0d6e47; border-left: 4px solid #17a36b; }
.pill-kg.p { background: repeating-linear-gradient(-45deg, #fff8e6 0 5px, #ffefcc 5px 10px); color: #8a5300; font-style: italic; border-left: 4px dashed #f0b544; }
.client-plan-table td, .client-plan-table th { min-width: 70px; }
.mbar-sm { height: 40px; }
.mbar-sm span { width: 22px; }
.client-kg { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .client-kg + .client-kg { margin-top: 6px; }
/* razvlačenje ćelija (kao u Excelu) */
.plan-table td.pc-edit { position: relative; }
.fill-handle { position: absolute; right: -4px; bottom: -4px; width: 9px; height: 9px; background: var(--blue-600, #0072CE); border: 2px solid #fff;
  border-radius: 2px; cursor: crosshair; z-index: 5; touch-action: none; }
.fill-handle::before { content: ""; position: absolute; inset: -8px; }
.pc-edit.fill { background: #e6eeff !important; box-shadow: inset 0 0 0 1px #7aa2ff; }
body.filling, body.filling * { cursor: crosshair !important; user-select: none; }
/* traka za lijepljenje ne pomjera tabelu: lebdi na dnu ekrana */
.plan-pastebar { position: fixed; top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); width: min(1100px, calc(100vw - 32px)); margin: 0; }
/* na širokom ekranu traka je centrirana u sadržaju, ne ispod bočnog menija */
@media (min-width: 981px) { .plan-pastebar { left: calc(50% + var(--sidebar-w) / 2); width: min(1100px, calc(100vw - var(--sidebar-w) - 32px)); } }
/* direktan upis u ćelije: izbor potvrđeno / potencijalno na vrhu */
.plan-entry { position: sticky; top: 64px; z-index: 15; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 14px; margin-bottom: 14px;
  background: #fff; border: 1px solid #e3e7ee; border-radius: 5px; box-shadow: 0 4px 14px rgba(18, 27, 69, .08); font-size: 13px; }
.pe-label { font-weight: 700; color: #121B45; margin-right: 4px; }
.pe-btn { padding: 8px 18px; border: 2px solid #d5dae4; border-radius: 4px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--text-2); }
.pe-btn.pe-c[aria-checked="true"] { background: #e9f7ef; border-color: #17a36b; color: #0d6e47; }
.pe-btn.pe-p[aria-checked="true"] { background: repeating-linear-gradient(-45deg, #fff8e6 0 6px, #ffefcc 6px 12px); border-color: #f0b544; border-style: dashed; color: #8a5300; font-style: italic; }
.pe-status { margin-left: auto; }
.pc-input { position: absolute; inset: 1px; width: calc(100% - 2px); z-index: 4; border: 2px solid #0072CE; border-radius: 2px; padding: 0 6px; text-align: right;
  font: inherit; font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; outline: none; }
.pc-input.in-c { border-left: 5px solid #17a36b; color: #121B45; }
.pc-input.in-p { border-left: 5px dashed #f0b544; color: #8a5300; font-style: italic; background: #fffaf0; }
.pc-edit.saving { opacity: .6; }
/* označene ćelije i zbir u donjoj traci */
.plan-table td.pc-edit[data-dlg="cell"] { user-select: none; }
.pc-edit.rsel { background: #dfe9ff !important; box-shadow: inset 0 0 0 1px #7aa2ff; }
body.ranging, body.ranging * { user-select: none; cursor: cell !important; }
.pb-sum { display: inline-flex; gap: 14px; flex-wrap: wrap; align-items: baseline; padding: 4px 10px; background: rgba(255, 255, 255, .1); border-radius: 4px; }
.pb-sum[hidden] { display: none; }
.pb-sum small { color: #b5bfd3; font-size: 11.5px; } .pb-sum b { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .pe-status { flex-basis: 100%; margin-left: 0; } }
/* KPI prodaje */
.kpi-page .card { margin-bottom: 16px; }
.kpi-wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.kpi-wbox { border: 1px solid var(--border); border-radius: 4px; padding: 10px 14px; }
.kpi-wh { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.kpi-wrow { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; border-top: 1px dashed #eef0f4; }
.kpi-wnote { grid-column: 1 / -1; line-height: 1.5; }
.kpi-table th.grp { text-align: center; border-left: 1px solid var(--border); }
.kpi-table .kpi-in { width: 105px; text-align: right; }
.kpi-table td, .kpi-table th { padding-left: 8px; padding-right: 8px; }
.kpi-table .kpi-in.sm { width: 70px; }
.kpi-table .kpi-in.act { background: #f3fbf6; border-color: #b9e3cb; }
.kpi-pct { display: inline-block; min-width: 58px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12.5px; text-align: center; }
.kpi-pct.ok { background: var(--green-bg); color: var(--green); }
.kpi-pct.mid { background: var(--amber-bg); color: var(--amber); }
.kpi-pct.low { background: var(--red-bg); color: var(--red); }
.kpi-score-row td { background: #f4f6fb !important; font-weight: 500 !important; }
.kpi-total .kpi-pct { font-size: 13.5px; }
.kpi-months td, .kpi-months th { min-width: 64px; }
@media (max-width: 760px) { .kpi-wgrid { grid-template-columns: 1fr; } }
.kpi-pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.kpi-pbox { border: 1px solid var(--border); border-radius: 4px; padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.kpi-ph { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 14.5px; }
.kpi-pline { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.kpi-status { padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12.5px; }
.kpi-status.ok { background: var(--green-bg); color: var(--green); }
.kpi-status.mid { background: var(--amber-bg); color: var(--amber); }
.kpi-status.low { background: var(--red-bg); color: var(--red); }
.kpi-neg { color: var(--red); font-weight: 600; }
.kpi-bar { height: 10px; margin: 6px 0 2px; overflow: visible; }
.kpi-bar-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #c4321f; }
.kpi-sw { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 3px solid #17a36b; }
.kpi-sw.fc { border-top: 3px dotted #17a36b; }
.kpi-more { margin-top: 8px; } .kpi-more summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); }
.kpi-annual { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.kpi-annual .field { margin: 0; } .kpi-annual .kpi-in { width: 170px; text-align: right; } .kpi-annual > .small { flex: 1 1 320px; }
@media (max-width: 760px) { .kpi-pgrid { grid-template-columns: 1fr; } }

/* Fakturisanje */
.inv-form { max-width: 820px; }
.inv-form [data-kind] + [data-kind] { margin-top: 4px; }
.inv-form .field { margin-bottom: 14px; }
.inv-form [hidden] { display: none !important; }
.inv-page .card-head .toolbar { margin-left: auto; }
.inv-page .kpi-months a { color: inherit; }
.inv-page .kpi-months a.inv-mon-active { color: var(--blue-600); text-decoration: underline; }
.inv-drop { border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); padding: 22px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.inv-drop:hover, .inv-drop:focus-visible { border-color: var(--blue-600); outline: none; }
.inv-drop.over { border-color: var(--blue-600); background: rgba(36, 89, 214, .07); }
.inv-drop.has-file { border-style: solid; padding: 12px 16px; }
.inv-drop * { pointer-events: none; } .inv-drop .inv-drop-clear { pointer-events: auto; }
.inv-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--text-2); }
.inv-drop-file { display: flex; align-items: center; gap: 10px; } .inv-drop-name { font-weight: 600; overflow-wrap: anywhere; }
.inv-att { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
#inv-od { overflow-wrap: anywhere; }

/* Projekcija poslovanja — montaža */
.fc-page .card-head { flex-wrap: wrap; gap: 10px; }
.fc-page .fc-switch a { min-width: 44px; text-align: center; cursor: pointer; }
.fc-page[data-view="pct"] .v-eur, .fc-page[data-view="eur"] .v-pct { display: none !important; }
.fc-table th.fc-m, .fc-table td.fc-cell { min-width: 78px; }
.fc-table .fc-in { width: 70px; text-align: right; }
.fc-table td.fc-end .fc-in { background: #f4f1ff; border-color: #cfc4f5; font-weight: 700; }
.fc-table td.has-error .fc-in { border-color: var(--red); background: var(--red-bg); }
.fc-table .fc-e { font-size: 10.5px; padding: 0 5px; margin-left: 2px; }
.fc-table .fc-over { color: var(--red); }
.fc-table tr.fc-row-error td { background: var(--red-bg); }
.fc-table tr.fc-row-error .error { color: var(--red); font-size: 12px; font-weight: 600; white-space: normal; max-width: 320px; }
.fc-table tfoot .fc-sum td { font-weight: 600; white-space: nowrap; }
.fc-table tfoot .fc-sum[data-sum="all"] td { font-weight: 800; border-top: 2px solid var(--border-strong); }
td.fc-cell { position: relative; }
.fc-table td.fc-sel { background: #e8f0fe; }
.fc-table td.fc-sel .fc-in { border-color: var(--blue-600); }
.fc-table td.fc-fill { outline: 1px dashed var(--blue-600); outline-offset: -3px; }
.fc-handle { position: absolute; right: 4px; bottom: 4px; width: 8px; height: 8px; background: var(--blue-600); border: 1px solid #fff; cursor: crosshair; z-index: 2; }
.fc-page[data-view="eur"] .fc-handle { display: none; }
.fc-plan .fc-plan-in { width: 96px; text-align: right; }
.fc-plan td.sticky-col { min-width: 200px; white-space: nowrap; }
.fc-plan .fc-plan-row td { background: #fff8f7; }
.fc-legend { display: flex; gap: 16px; margin-left: auto; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.fc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fc-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fc-legend i.dash { height: 0; width: 18px; border-top: 2.5px dashed #c4321f; border-radius: 0; }
.fc-chart-title { font-size: 14px; font-weight: 700; margin: 6px 0 8px; }
.fc-chart { margin-bottom: 22px; max-height: 340px; }
.fc-chart-h { max-height: 220px; max-width: 980px; margin-left: 0; }
.fc-chart .fc-hit:hover { fill: rgba(36, 89, 214, .06); }
.fc-chart-title { margin-top: 18px; }
.fc-plan-mark { display: inline-block; width: 3px; height: 14px; background: #c4321f; vertical-align: -2px; margin: 0 2px; }
.fc-heat, .fc-tree { max-height: none; }

/* Tok ponuda (Sankey) */
.sk-wrap { overflow-x: auto; padding: 0 18px; }
.sk-chart { max-height: none; min-width: 760px; margin: 4px 0 6px; }
.sk-chart .sk-link { opacity: .38; transition: opacity .12s; }
.sk-chart .sk-link:hover { opacity: .75; }
.sk-chart text { font-family: var(--font); }
.sk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }
.sk-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 18px 16px; }
.sk-note { padding: 0 18px 16px; margin: 0; }
.sk-table td.num, .sk-table th.num { white-space: nowrap; }
.sk-chart a { cursor: pointer; }
.sk-chart.sk-sel .sk-link { opacity: .16; }
.sk-chart .sk-link.on, .sk-chart.sk-sel .sk-link.on { opacity: .85; }
.sk-chart.sk-sel .sk-link:hover { opacity: .5; }
.sk-chart .sk-node.on text { text-decoration: underline; }
.sk-table a.sk-cell { color: inherit; text-decoration: none; border-bottom: 1px dashed transparent; }
.sk-table a.sk-cell:hover { color: var(--blue-600); border-bottom-color: currentColor; }
.sk-table a.sk-cell.on { color: var(--blue-600); font-weight: 700; border-bottom: 2px solid currentColor; }
.sk-list { scroll-margin-top: 16px; }

/* Ukupni pregled (plan ↔ realizacija) */
.fc-sum { font-variant-numeric: tabular-nums; }
.fc-sum td, .fc-sum th { padding: 5px 8px; white-space: nowrap; }
.fc-sum td.sticky-col, .fc-sum th.sticky-col { min-width: 170px; }
.fc-sum .fc-sb-head th { background: #222C5C; color: #fff; font-weight: 700; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.fc-sum .fc-sb-head th.sticky-col { background: #222C5C; }
.fc-sum .fc-sb-tot { background: #fff8d6; font-weight: 700; }
.fc-sum .fc-sb-head th.fc-sb-tot { background: #f5c518; color: #19212f; }
.fc-sum .fc-sb-diff td { border-bottom: 1px solid var(--border-strong); font-weight: 600; }
.fc-sum .fc-pos { color: #148a4f; }
.fc-sum .fc-neg { color: var(--red); }
.fc-sum .fc-sb-total td { background: #f5f7fb; }
.fc-sum .fc-sb-total .fc-sb-tot { background: #fff1b0; }
.fc-sum .fc-sb-company .fc-sb-head th.sticky-col { color: #ff8a7a; }
.fc-sum .fc-sb-growth td { font-weight: 800; background: #eef8f1; }
.fc-sum .fc-sb-gap td { padding: 0; height: 14px; background: transparent !important; border: 0; }
.fc-sum td.fc-man { background: #f6f8fd; }
.fc-sum .fc-sum-in { width: 92px; text-align: right; }
.fc-sum .fc-sum-in::placeholder { color: #9aa3b2; }
.fc-sum-help { background: #f4f7fd; border-bottom: 1px solid var(--border); }
.fc-sum td { position: relative; }
.fc-sum td.fc-sel { background: #e8f0fe; }
.fc-sum td.fc-sel .fc-sum-in { border-color: var(--blue-600); }
.fc-sum td.fc-fill { outline: 1px dashed var(--blue-600); outline-offset: -3px; }
.fc-sum .fc-handle { right: 6px; bottom: 6px; }
.fc-yearbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.fc-yearbar a { position: relative; padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text-2); font-weight: 700; text-decoration: none; }
.fc-yearbar a.on { background: #222C5C; border-color: #222C5C; color: #fff; }
.fc-yearbar a i { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: #148a4f; }
.fc-sum .fc-sb-subtotal td { background: #f5f7fb; font-weight: 700; border-top: 1px solid var(--border-strong); }
.fc-sum .fc-sb-company-row td { background: #fff4d6; }
.fc-insights ul { margin: 0; padding: 4px 22px 16px 38px; display: grid; gap: 6px; font-size: 14px; }
.fc-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Plaćanja i naplata: svaka faza ima svoju boju, a najteža je puna tamnocrvena */
.pay-soon { --pay: var(--blue-700); --pay-bg: var(--blue-50); }
.pay-late15 { --pay: #8a5300; --pay-bg: #fff4dc; }
.pay-late30 { --pay: #c2500a; --pay-bg: #ffe8d6; }
.pay-over30 { --pay: var(--red); --pay-bg: var(--red-bg); }
.pay-over60 { --pay: #7a1208; --pay-bg: #7a1208; }
.pay-no_due { --pay: #8a5300; --pay-bg: transparent; }
.pay-ok { --pay: var(--text-3); --pay-bg: transparent; }
.pay-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pay-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 5px; border: 1px solid var(--pay); border-left-width: 5px; background: var(--pay-bg); color: var(--pay); text-decoration: none; }
.pay-tile span { font-size: 12.5px; font-weight: 700; }
.pay-tile b { font-size: 26px; line-height: 1.15; }
.pay-tile small { font-size: 12px; }
.pay-tile.pay-over60 { color: #fff; }
.pay-tile.pay-empty { background: #fff; border-color: var(--border); color: var(--text-3); }
.pay-stage { border-left: 5px solid var(--pay); }
.pay-stage .card-head { background: var(--pay-bg); color: var(--pay); }
.pay-stage .card-head .hint { color: inherit; opacity: .85; }
.pay-stage.pay-over60 .card-head { color: #fff; }
.pay-due { display: block; font-size: 11.5px; font-weight: 700; color: var(--pay); }
.pay-cell { width: 1%; white-space: nowrap; }
.pay-table form { margin: 0; }
.pay-gauge { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.pay-gauge p { margin: 0; line-height: 1.55; }
.pay-bad { color: var(--red); } .pay-good { color: #0d6e47; }
@media (max-width: 760px) { .pay-gauge { grid-template-columns: 1fr; } }
.pay-check { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 7px; border: 1px solid var(--border-strong); border-radius: 4px; background: #fff; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.pay-check i { position: relative; width: 16px; height: 16px; border: 2px solid var(--border-strong); border-radius: 4px; background: #fff; }
.pay-check:hover, .pay-check:focus-visible { border-color: #17a36b; color: #0d6e47; background: #e6f6ee; }
.pay-check:hover i, .pay-check:focus-visible i { border-color: #17a36b; background: #17a36b; }
.pay-check:hover i::after, .pay-check:focus-visible i::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@media (max-width: 760px) { .pay-tiles { grid-template-columns: 1fr 1fr; } .pay-tile b { font-size: 21px; } }.inv-sugg { position: relative; }

/* ---------- Fakture: integrisani preglednik priloga ---------- */
dialog.modal.inv-viewer { width: min(1100px, calc(100vw - 24px)); height: calc(100vh - 40px); max-height: none; display: none; flex-direction: column; overflow: hidden; }
dialog.modal.inv-viewer[open] { display: flex; }
dialog.modal.inv-viewer.inv-viewer-small { width: min(520px, calc(100vw - 24px)); height: auto; }
.inv-viewer .modal-head { gap: 8px; flex: none; }
.inv-viewer .modal-head h2 { min-width: 0; }
.inv-viewer .modal-head h2 .cell-sub { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-viewer-body { flex: 1; min-height: 0; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: auto; }
.inv-viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.inv-viewer-body img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; margin: auto; }
.inv-viewer-body [hidden] { display: none !important; }
.inv-viewer-none { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 24px; text-align: center; color: var(--text-2); }
.inv-att-link { display: inline-flex; vertical-align: middle; }
@media (max-width: 760px) {
  dialog.modal.inv-viewer { width: 100vw; height: 100dvh; max-width: 100vw; border-radius: 0; margin: 0; }
  .inv-viewer-tab span { display: none; }
}

/* ---------- Naplata: prozorčić „Plaćena” (cijela / djelimično) ---------- */
.pay-dlg-sum { display: grid; gap: 6px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.pay-dlg-sum > div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.pay-dlg-sum > div[hidden] { display: none; }
.pay-dlg-sum span { color: var(--text-2); }
.pay-dlg-rest { padding-top: 6px; border-top: 1px dashed var(--border-strong); }
.pay-dlg-rest b { font-size: 15px; }
.pay-dlg-opts { display: grid; gap: 8px; margin-bottom: 14px; }
.pay-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.pay-opt input { margin-top: 3px; width: 16px; height: 16px; accent-color: #17a36b; }
.pay-opt span { display: grid; gap: 2px; }
.pay-opt small { color: var(--text-3); font-size: 12px; }
.pay-opt:has(input:checked) { border-color: #17a36b; background: #e6f6ee; }
.field[data-pay-amount][hidden] { display: none; }
.inv-payments { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.inv-pay-row { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.inv-pay-row:last-child { border-bottom: 0; }
.inv-pay-sum { background: var(--surface-2); }
.inv-viewer .modal-head [hidden] { display: none; }

/* ---------- Fakture: valute i kursna lista ---------- */
.inv-fx { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.inv-fx.stale { border-color: var(--amber); }
.inv-fx-head { display: grid; gap: 1px; min-width: 120px; }
.inv-fx-head span { font-size: 12px; color: var(--text-3); }
.inv-fx-items { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-fx-item { display: grid; padding: 5px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); line-height: 1.3; }
.inv-fx-item span, .inv-fx-item small { font-size: 11.5px; color: var(--text-3); }
.inv-fx-item b { font-size: 14px; white-space: nowrap; }
.inv-fx-note { flex: 1 1 240px; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.inv-amount { display: flex; gap: 8px; }
.inv-amount input { flex: 1; min-width: 0; }
.inv-amount select { width: 92px; flex: none; }
.inv-rate { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.inv-rate[hidden], #i-rate-help[hidden] { display: none; }
.inv-rate label { margin: 0; font-weight: 600; white-space: nowrap; }
.inv-rate input { width: 130px; }

/* ---------- NCMC brand (knjiga dizajna) ---------- */
.sidebar { background: var(--navy-900); }
.login-brand { border: 0 !important; padding: 0 !important; }
.login-brand .brand-logo { width: 230px; }
.login-brand .brand-app { color: #cfd5ea; font-size: 11px; }
.login-eyebrow { color: #7fb8ee !important; letter-spacing: var(--tracked) !important; }
.login-eyebrow::before { background: var(--blue-600) !important; }
.page-head h1 { font-weight: 750; }
.btn { border-radius: 3px; font-weight: 600; }

/* projekcija — plan ↔ fakturisano */
.fc-track-filter { margin: 0 0 14px; flex-wrap: wrap; }
.fc-track td.fc-tc { min-width: 84px; }
.fc-track td.fc-tc.ok { background: #eef8f1; }
.fc-track td.fc-tc.mid { background: #fff7e6; }
.fc-track td.fc-tc.low { background: #fdf0ee; }
.fc-track td.fc-tc.current { box-shadow: inset 0 0 0 2px #0072CE; }
.fc-track td.fc-tc.future b { font-weight: 400; }
.fc-track th.fc-now { background: #0072CE !important; }
.fc-track .cell-sub .kpi-status { font-size: 11px; padding: 1px 7px; }
.fc-track-proj td { vertical-align: top; }
.fc-track-proj .kpi-status, .fc-track .kpi-status { white-space: nowrap; }
.fc-unlinked { background: #fff8e6; border-top: 1px solid var(--border); font-size: 13.5px; line-height: 1.5; }
.fc-unlinked-list { margin-top: 6px; }
.inv-plan { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--blue-600); border-radius: var(--radius); font-size: 13.5px; text-decoration: none; color: inherit; }
.inv-plan:hover { border-color: #b9c6e4; border-left-color: var(--blue-600); }
.inv-plan b { font-size: 15px; }
.inv-plan .go { margin-left: auto; color: var(--blue-600); font-weight: 700; }

/* Plan proizvodnje: godišnji plan po klijentu (prikaz „Godišnji plan” i „Sve”) */
.plan-view { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: 13px; }
.plan-view a { padding: 7px 14px; border: 2px solid #d5dae4; border-radius: 4px; background: #fff; font-weight: 700; color: var(--text-2); text-decoration: none; }
.plan-view a.on { background: #121B45; border-color: #121B45; color: #fff; }
.plan-view a.pv-plan.on { background: #c4321f; border-color: #c4321f; }
.lg-pl { color: #c4321f; font-weight: 700; }
.v-pl { color: #c4321f; font-weight: 700; font-variant-numeric: tabular-nums; border-right: 3px solid #c4321f; padding-right: 5px; }
.pl-pct { display: block; font-size: 10.5px; font-weight: 700; padding-right: 8px; font-variant-numeric: tabular-nums; }
.plan-table tr.pl-row td { background: #fff7f5; border-top: 1px dashed #f0b3aa; padding-top: 3px; padding-bottom: 3px; }
.plan-table tr.pl-row td.sticky { background: #fff7f5; }
.pl-row .pl-lbl { color: #c4321f; font-weight: 700; font-size: 12px; padding-left: 10px; }
.plan-table tr.sum-pl td { color: #c4321f; font-weight: 700; background: #fff7f5; }
.pe-btn.pe-pl { background: #fff7f5; border-color: #c4321f; color: #c4321f; cursor: default; }
.pc-input.in-pl { border-left: 5px solid #c4321f; color: #c4321f; background: #fff7f5; }

/* Padajuća lista s pretragom (select[data-search]) */
.combo { position: relative; }
.combo .combo-native { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; }
.combo-input { padding-right: 30px !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23767D99' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center !important; }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 3px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.combo-list li { padding: 7px 11px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.combo-list li.active { background: var(--blue-50); }
.combo-list li[aria-selected="true"] { font-weight: 600; }
.combo-list li mark { background: none; color: var(--blue-600); font-weight: 700; padding: 0; }
.combo-list li.combo-empty { cursor: default; color: var(--text-3); font-style: italic; }
tr[data-href] { cursor: pointer; }
.inv-att-link.err, .inv-att-link.err .icon { color: var(--red); }

/* =====================================================================
   Mobilni izgled — portal na telefonu radi kao aplikacija
   (donja traka, „Više” kao list odozdo, veliki naslovi, redovi umjesto tabela).
   Desktop se ne mijenja: sve je ispod 980 px (traka/meni) i 760 px (telefon).
   ===================================================================== */
.tabbar, .m-brand, .m-title, .sheet-head, .m-only, .m-dev, .sidebar .m-view-as { display: none; }

@media (max-width: 980px) {
  :root { --m-bg: #F2F3F7; --m-sep: #E3E6EE; --m-tab-h: 58px; --safe-b: env(safe-area-inset-bottom, 0px); }
  body { background: var(--m-bg); -webkit-tap-highlight-color: transparent; }
  .menu-btn { display: none !important; }

  /* Gornja traka: logo ili „‹ Nazad”, mali naslov se pojavi kad se veliki odskrola */
  .topbar { height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0; gap: 10px;
    background: var(--m-bg); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
  .topbar.scrolled { background: #FAFBFD; border-bottom-color: var(--m-sep); }
  .m-brand { display: flex; align-items: center; gap: 8px; color: var(--navy-900); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
  .m-brand:hover { text-decoration: none; }
  .topbar:has(.crumbs a) .m-brand { display: none; }
  .topbar .crumbs { font-size: 16px; }
  .topbar .crumbs > :not(a:first-of-type) { display: none; }
  .topbar .crumbs a:first-of-type { display: inline-flex; align-items: center; gap: 4px; color: var(--blue-600); font-weight: 500; margin-left: -4px;
    max-width: 26vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .crumbs a:first-of-type::before { content: ""; width: 10px; height: 10px; flex: none; border: solid currentColor; border-width: 0 0 2.2px 2.2px; transform: rotate(45deg); margin: 0 2px 0 4px; }
  .m-title { display: block; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); height: 52px; line-height: 52px; max-width: 44vw;
    font-size: 16px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .18s; pointer-events: none; }
  .topbar.scrolled .m-title { opacity: 1; }
  .m-brand { transition: opacity .18s; }
  .topbar.scrolled .m-brand { opacity: 0; pointer-events: none; }
  .m-brand { white-space: nowrap; }
  .env-badge { font-size: 10px; padding: 2px 7px; letter-spacing: .06em; }
  .env-badge .hide-m { display: none; } .env-badge .m-dev { display: inline; }
  .topbar > .view-as { display: none; }
  .sidebar .m-view-as { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 12px; padding: 6px 6px 6px 14px; margin-bottom: 10px; }
  .sidebar .m-view-as label { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--text); white-space: nowrap; }
  .sidebar .m-view-as label .icon { color: var(--blue-600); }
  .sidebar .m-view-as select { flex: 1; min-width: 0; max-width: none; border: 0; background-color: var(--m-bg); font-size: 15px; height: 38px; }

  .content { padding: 6px 16px calc(var(--m-tab-h) + var(--safe-b) + 32px); }

  /* Donja traka */
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #FAFBFD; border-top: 1px solid var(--m-sep);
    padding: 4px max(6px, env(safe-area-inset-left, 0px)) var(--safe-b); justify-content: space-around; }
  .tabbar a, .tabbar button { flex: 1; max-width: 110px; height: var(--m-tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #8F95AC; background: none; border: 0; font: inherit; font-size: 10.5px; font-weight: 550; cursor: pointer; text-decoration: none; }
  .tabbar .icon { stroke-width: 1.7; }
  .tabbar a.active, .tabbar:not(:has(a.active)) .tab-more, body.nav-open .tabbar .tab-more { color: var(--blue-600); }
  .tabbar a:active, .tabbar button:active { opacity: .6; }

  /* „Više”: bočni meni postaje list koji izlazi odozdo */
  .sidebar { inset: auto 0 0 0; width: auto; max-height: 88vh; max-height: 88dvh; transform: translateY(104%); background: var(--m-bg); color: var(--text);
    border-radius: 16px 16px 0 0; z-index: 60; padding-bottom: var(--safe-b); visibility: hidden;
    transition: transform .32s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .32s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 -10px 40px rgba(18, 27, 69, .25); visibility: visible; transition: transform .32s cubic-bezier(.32, .72, 0, 1); }
  body.nav-open::after { z-index: 55; background: rgba(18, 27, 69, .35); }
  body.nav-open { overflow: hidden; }
  .sidebar .brand { display: none; }
  .sheet-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 18px 16px 6px; }
  .sheet-head b { font-size: 17px; font-weight: 700; }
  .sheet-grab { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 38px; height: 5px; border-radius: 3px; background: #C9CEDB; }
  .sheet-close { position: absolute; right: 14px; top: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #E4E7EF; color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
  .sidebar .nav { padding: 4px 16px 8px; }
  .sidebar .nav-label { color: var(--text-3); font-size: 12px; letter-spacing: .06em; font-weight: 600; padding: 16px 6px 6px; border: 0; margin: 0; }
  .sidebar .nav a { background: #fff; color: var(--text); font-size: 16px; font-weight: 500; padding: 0 14px; min-height: 48px; margin: 0; border-radius: 0; gap: 12px; position: relative; }
  .sidebar .nav a + a::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; border-top: 1px solid var(--m-sep); }
  .sidebar .nav a .icon { color: var(--blue-600); }
  .sidebar .nav > a:first-child, .sidebar .nav .nav-label + a { border-radius: 12px 12px 0 0; }
  .sidebar .nav a:has(+ .nav-label), .sidebar .nav a:last-child { border-radius: 0 0 12px 12px; }
  .sidebar .nav > a:first-child:has(+ .nav-label), .sidebar .nav .nav-label + a:has(+ .nav-label), .sidebar .nav .nav-label + a:last-child { border-radius: 12px; }
  .sidebar .nav a.active { background: #fff; color: var(--blue-600); box-shadow: none; font-weight: 650; }
  .sidebar .nav a:hover { background: #fff; color: var(--text); }
  .sidebar .nav a .soon { color: var(--text-3); border-color: var(--m-sep); }
  .sidebar-foot { border: 0; padding: 4px 16px 14px; }
  .sidebar .app-link { display: none; }
  .sidebar .user-chip { background: #fff; border-radius: 12px; padding: 10px 12px; }
  .sidebar .user-chip .who strong { color: var(--text); }
  .sidebar .user-chip .who span { color: var(--text-3); }
  .sidebar .user-chip .chip-btn, .sidebar .user-chip form button { color: var(--blue-600); padding: 8px; }

  .plan-pastebar { bottom: calc(var(--m-tab-h) + var(--safe-b) + 12px); }
  .paste-toast { bottom: calc(var(--m-tab-h) + var(--safe-b) + 24px); }
}

@media (max-width: 760px) {
  /* Tipografija i naslovi kao u iOS-u */
  .content h1, .m-hero h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-head .titles { min-width: 0; flex-basis: 100%; }
  .page-head .sub { font-size: 14px; margin-top: 6px; display: block; }
  .page-head .sub > span { margin-right: 10px; }
  .page-head .actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; width: calc(100% + 32px); }
  .page-head .actions::-webkit-scrollbar { display: none; }
  .page-head .actions > * { flex: none; }
  .page-head .actions:has(.search, .toolbar) { flex-wrap: wrap; overflow: visible; }
  .page-head .actions .search, .page-head .actions .toolbar { flex: 1 1 100%; }

  /* Dodirne površine: dugmad i polja ≥ 42 px, polja 16 px da iPhone ne zumira */
  .btn { height: 42px; padding: 0 16px; border-radius: 10px; font-size: 15px; }
  .btn-sm { height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; }
  .btn-icon { width: 34px; padding: 0; }
  .input, select.input, textarea.input, input.input { font-size: 16px; border-radius: 10px; min-height: 42px; }
  .toolbar { width: 100%; }
  .toolbar .input, .toolbar select { flex: 1 1 140px; min-width: 0; height: 42px; }
  .toolbar .search, .toolbar input[type=search] { flex: 1 1 100%; }
  .search .icon { top: 13px; }

  /* Kartice: bez okvira, zaobljene, na sivoj pozadini */
  .card, .kpi, .dk, .ctab { border: 0; border-radius: 14px; box-shadow: none; }
  .card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 20px; }
  .card-head { border-bottom: 1px solid var(--m-sep); padding: 14px 16px; flex-wrap: wrap; }
  .card-head h2 { font-size: 17px; }
  .card-head h2::before { display: none; }
  .card-head .hint { flex-basis: 100%; order: 3; }
  .card-body { padding: 14px 16px; }
  .flash { border-radius: 12px; border: 0; }
  .callout { border-radius: 12px; }

  /* Brojevi na vrhu: 2 kolone, prvi je istaknut preko cijele širine */
  .kpis, .dash-kpis, .an-kpis { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .kpi, .dk { padding: 13px 14px; }
  .kpi .value, .dk b { font-size: 22px; font-weight: 700; }
  .dash-kpis > .dk:first-child, .kpis > .kpi:first-child { grid-column: 1 / -1; background: var(--navy-900); color: #fff; }
  .dash-kpis > .dk:first-child b, .kpis > .kpi:first-child .value { font-size: 30px; color: #fff; }
  .dash-kpis > .dk:first-child span, .dash-kpis > .dk:first-child small, .kpis > .kpi:first-child .label, .kpis > .kpi:first-child .meta { color: #AEB6D6; }
  .dash-kpis > .dk:first-child small em { color: #FF9B8E; }
  .dk.bad, .dk.warn { border-left: 0; }
  .dk.bad b { color: var(--red); } .dk.warn b { color: var(--amber); }
  .kpi.accent { border-top: 0; }

  /* Podkartice kao „chips” koji se listaju vodoravno */
  .subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtabs a { flex: none; padding: 8px 15px; font-size: 14px; border: 0; }
  .client-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ctab { padding: 10px 12px; } .ctab b { font-size: 20px; } .ctab span { font-size: 12.5px; } .ctab small { display: none; }
  .ctab.active { box-shadow: 0 0 0 2px var(--blue-600); }
  .contact-filter { padding: 12px 14px; }
  .contact-filter .cf-row:first-child { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .contact-filter .cf-row:first-child::-webkit-scrollbar { display: none; }
  .contact-filter .cf-row:first-child > * { flex: none; }
  .contact-filter .cf-date { flex: 1 1 40%; } .contact-filter .cf-date .input { flex: 1; }
  .contact-filter select.input { flex: 1 1 100%; }

  /* Segmentirani izbor (npr. Sve / Proizvodnja / Montaža) */
  nav.m-seg { display: flex; margin: 12px 16px 2px; background: #E4E7EF; border-radius: 9px; padding: 2px; }
  .m-seg a { flex: 1; text-align: center; font-size: 13.5px; font-weight: 600; padding: 7px 4px; border-radius: 7px; color: var(--text-2); text-decoration: none; }
  .m-seg a.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(18, 27, 69, .15); }
  #evidencija select[name=vrsta] { display: none; }

  /* Liste (fakture, klijenti): redovi umjesto tabela */
  .m-only { display: block; }
  .m-hide { display: none !important; }
  .card:has(> .m-list) { background: transparent; }
  .card:has(> .m-list) > .card-head { background: transparent; border: 0; padding: 4px 0 0; }
  .card:has(> .m-list) > .m-seg { margin: 10px 0 2px; }
  .m-group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 6px 7px; }
  .m-group-head b { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
  .m-group-head span { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
  .m-group { background: #fff; border-radius: 14px; overflow: hidden; }
  .m-list > .m-group:first-child { margin-top: 10px; }
  .m-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; color: var(--text); position: relative; text-decoration: none; }
  .m-row:hover { text-decoration: none; color: var(--text); }
  a.m-row:active { background: #EEF0F5; }
  .m-row + .m-row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 1px solid var(--m-sep); }
  .m-row:has(.m-av) + .m-row::before { left: 62px; }
  .m-row[hidden] { display: none; }
  .m-main { flex: 1; min-width: 0; }
  .m-main b { display: block; font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-main span { display: block; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
  .m-side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
  .m-side b { font-size: 15px; font-weight: 650; white-space: nowrap; }
  .m-side .next-contact { font-size: 13px; }
  .m-row > .icon:last-child { color: #C3C8D6; margin-right: -4px; }
  .m-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #DDE6F6; color: var(--blue-600); font-weight: 700; font-size: 14px; }
  .m-foot { text-align: center; color: var(--text-3); font-size: 13px; padding: 14px 0 0; }
  .m-foot b { color: var(--text-2); }

  /* Kartica klijenta: krug s inicijalima, naziv, brze akcije */
  .m-hero { text-align: center; padding: 8px 8px 16px; }
  .m-av-lg { width: 76px; height: 76px; font-size: 27px; margin: 0 auto 10px; }
  .m-hero h1 { font-size: 25px; }
  .m-hero p { margin: 4px 0 0; color: var(--text-3); font-size: 14px; }
  .m-hero p:empty { display: none; }
  nav.m-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 16px; }
  .m-actions > * { background: #fff; border-radius: 13px; padding: 11px 0 9px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--blue-600); font-size: 12px; font-weight: 600; text-decoration: none; }
  .m-actions > *:hover { text-decoration: none; }
  .m-actions a:active { background: #EEF0F5; }
  .m-actions .off { color: #B9BECD; }
  .m-hero ~ .m-hero-follow .titles { display: none; }

  /* Ostale tabele: svaki red postaje kartica s „naziv kolone — vrijednost” */
  table.m-stack, table.m-stack tbody, table.m-stack tfoot { display: block; }
  table.m-stack thead { display: none; }
  table.m-stack tr { display: block; padding: 11px 16px; position: relative; }
  table.m-stack tr + tr { border-top: 1px solid var(--m-sep); }
  table.m-stack td { display: block; border: 0; padding: 3px 0 3px 42%; position: relative; text-align: right; min-height: 24px; background: none !important; font-size: 14px; }
  table.m-stack td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 40%; text-align: left; color: var(--text-3); font-size: 13px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.m-stack td:not([data-label]) { padding-left: 0; text-align: left; }
  table.m-stack td:first-child { padding: 0 0 6px; text-align: left; font-size: 15.5px; font-weight: 600; }
  table.m-stack td:first-child::before, table.m-stack td:not([data-label])::before { display: none; }
  table.m-stack td.m-empty { display: none; }
  table.m-stack td .cell-sub { display: block; }
  table.m-stack td.right .btn, table.m-stack td:last-child .btn { margin-top: 6px; }
  table.m-stack tr[data-href] { padding-right: 34px; cursor: pointer; }
  table.m-stack tr[data-href]::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border: solid #C3C8D6; border-width: 2px 2px 0 0; transform: translateY(-50%) rotate(45deg); }
  table.m-stack tr.row-overdue { box-shadow: inset 4px 0 0 var(--red); }
  table.m-stack tr.row-soon { box-shadow: inset 4px 0 0 #e8a100; }
  table.m-stack tr.row-overdue td:first-child, table.m-stack tr.row-soon td:first-child { box-shadow: none; }
  table.m-stack tfoot tr { background: var(--surface-2); border-top: 1px solid var(--m-sep); }
  table.m-stack tfoot td { padding-left: 0; text-align: left; }
  table.m-stack tr:hover td { background: none; }
  table.m-stack .empty { padding: 24px 0; }

  /* Lista događaja */
  .timeline li { padding: 12px 0; font-size: 14px; flex-wrap: wrap; }
  .timeline .when { width: 100%; }

  /* Dijalozi izlaze odozdo kao list */
  dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; max-height: 92dvh; padding-bottom: var(--safe-b); }
  dialog.modal.sm { width: 100vw; }
  dialog.modal[open] { animation: m-sheet-up .3s cubic-bezier(.32, .72, 0, 1); }
  .modal-head { border-radius: 16px 16px 0 0; }
  dialog.modal.inv-viewer { border-radius: 0; margin: 0; }
}
@keyframes m-sheet-up { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sidebar, dialog.modal[open] { transition: none; animation: none; } }
@media print { .tabbar, .m-only { display: none !important; } .m-hide { display: block !important; } }

/* ---------- Pretraga portala ---------- */
.top-search { flex: 0 1 300px; }
.top-search .search { position: relative; }
.top-search .input { height: 34px; padding-right: 30px; background: var(--surface-2); border-color: var(--border); }
.top-search .input:focus { background: #fff; }
.top-search .search .icon { top: 9px; }
.top-search kbd { position: absolute; right: 8px; top: 7px; font: 600 11px var(--font); color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 5px; line-height: 18px; }
.top-search .input:focus + kbd { display: none; }
.m-search-btn { display: none; }
.sr-form { max-width: 720px; margin-bottom: 8px; }
.sr-form .input { height: 46px; font-size: 16px; padding-left: 40px !important; border-radius: 10px; }
.sr-form .search .icon { left: 13px; top: 14px; }
#sr-results { max-width: 720px; }
.sr-count { color: var(--text-3); margin: 14px 2px 0; }
.sr-empty { padding: 56px 20px; }
.sr-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 4px 7px; }
.sr-head b { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.sr-head span { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.sr-list { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sr-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: var(--text); position: relative; }
.sr-row:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.sr-row + .sr-row { border-top: 1px solid #eef0f4; }
.sr-row .m-main { flex: 1; min-width: 0; }
.sr-row .m-main b { display: block; font-weight: 600; }
.sr-row .m-main > span { display: block; font-size: 12.5px; color: var(--text-3); }
.sr-row .m-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; }
.sr-row .m-av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #DDE6F6; color: var(--blue-600); font-weight: 700; font-size: 13px; }
.sr-row > .icon:last-child { color: #C3C8D6; }
.sr-text { margin: 4px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-row mark { background: #FFE9A8; color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-more { padding: 10px 14px; font-size: 13px; color: var(--text-3); border-top: 1px solid #eef0f4; }
@media (max-width: 980px) {
  .top-search { display: none; }
  .m-search-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--blue-600); flex: none; }
}
@media (max-width: 760px) {
  .sr-list { border: 0; border-radius: 14px; }
  .sr-row .m-main b { font-size: 15.5px; }
  .sr-row .m-main > span { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sr-row + .sr-row { border-top: 0; }
  .sr-form { position: sticky; top: calc(52px + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--m-bg); padding: 4px 0 8px; margin: 0; }
  .sr-form .input { background: #E4E7EF; border: 0; }
}

/* ---------- Početni ekran na mobitelu ---------- */
.m-plus-btn { display: none; }
@media (max-width: 980px) {
  .m-plus-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--blue-600); color: #fff; flex: none; }
  .m-plus-btn:hover { color: #fff; }
  .topbar:has(.m-plus-btn) .m-title { display: none; }
  .topbar:has(.m-plus-btn).scrolled .m-brand { opacity: 1; pointer-events: auto; }
}
@media (max-width: 760px) {
  .m-hide-home { display: none; }
  .home h1 { margin-top: 2px; }
  .home-date { margin: 4px 0 16px; color: var(--text-3); font-size: 15px; }
  .home-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-hero, .home-card { display: flex; flex-direction: column; border-radius: 14px; padding: 14px 15px; color: var(--text); text-decoration: none; background: #fff; min-width: 0; }
  .home-hero:hover, .home-card:hover { text-decoration: none; color: var(--text); }
  .home-hero { grid-column: 1 / -1; background: var(--navy-900); color: #fff; padding: 16px 17px; }
  .home-hero:hover { color: #fff; }
  .home-hero span { font-size: 14px; color: #C3CAE3; }
  .home-hero b { font-size: 34px; font-weight: 700; letter-spacing: -.01em; margin: 2px 0 2px; }
  .home-bar { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .16); margin: 10px 0 9px; overflow: hidden; }
  .home-bar i { display: block; height: 100%; border-radius: 3px; background: #4DA3F0; }
  .home-hero small { font-size: 12.5px; color: #C3CAE3; }
  .home-card span { font-size: 14px; color: var(--text-2); font-weight: 500; }
  .home-card b { font-size: 25px; font-weight: 700; margin: 3px 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .home-card small { font-size: 13px; color: var(--text-3); }
  .home-card small em { font-style: normal; color: var(--red); }
  .home .m-group-head { padding-top: 22px; }
  .home .m-group-head a { font-size: 15px; color: var(--blue-600); text-transform: none; letter-spacing: 0; }
  .home .m-group-head span { color: var(--blue-600); }
  .home .m-row:has(.home-ic) + .m-row::before { left: 62px; }
  .home-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
  .tone-blue { background: var(--blue-600); } .tone-red { background: var(--red); } .tone-green { background: var(--green); } .tone-violet { background: var(--violet); }
  .home .m-row > .icon:last-child { color: #C3C8D6; }
  .home .m-side .badge { font-size: 12px; }
  .home-classic { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 22px 0 4px; font-size: 15px; color: var(--blue-600); }
}

/* Pregled PDF fakture na telefonu (pdf.js): stranice jedna ispod druge, unutar portala */
.inv-viewer-body:has(.pdf-pages:not([hidden])) { align-items: stretch; justify-content: flex-start; }
.pdf-pages { width: 100%; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: auto; -webkit-overflow-scrolling: touch; }
.pdf-pages canvas { background: #fff; box-shadow: 0 1px 4px rgba(18, 27, 69, .18); max-width: 100%; }
.pdf-loading { margin: auto; padding: 40px 0; color: var(--text-3); }
@media (max-width: 980px) { .inv-viewer-tab { display: none !important; } }

/* Pregled fakture (samo čitanje) — grupisani redovi kao u iOS postavkama */
.inv-detail { max-width: 640px; }
.invd-hero { text-align: center; padding: 6px 8px 14px; }
.invd-client { display: block; font-size: 15px; font-weight: 600; color: var(--text-2); }
.invd-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.invd-hero p { margin: 4px 0 0; color: var(--text-3); font-size: 14px; }
.invd-hero p:empty { display: none; }
.invd-file { display: flex; justify-content: center; margin-bottom: 6px; }
.invd-file .inv-att-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-weight: 600; font-size: 15px; color: var(--blue-600); text-decoration: none; }
.invd-head { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; padding: 18px 6px 7px; }
.invd-group { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.invd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 14px; font-size: 15px; }
.invd-row + .invd-row { border-top: 1px solid var(--border); }
.invd-row > span { color: var(--text-2); flex: none; }
.invd-row > b { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.invd-note { padding: 12px 14px; font-size: 15px; }
.invd-edit { width: 100%; justify-content: center; margin-top: 20px; }
@media (max-width: 760px) {
  .inv-detail { max-width: none; }
  .invd-group { border: 0; }
  .invd-row + .invd-row { border-top-color: var(--m-sep); }
  .invd-file .inv-att-link { border: 0; }
  a.invd-edit.m-only { display: flex; align-items: center; height: 48px; }
}
.map-sugg li.sugg-recent { color: #157a3c; font-weight: 600; }
.map-sugg li.sugg-recent span { color: #3f8f5c; font-weight: 400; }
.callout[hidden] { display: none; }

/* ponude: mailovi u korespodenciji (1.RFQ, 2.…) */
.mail-row { margin-bottom: 6px; flex-wrap: nowrap; }
.mail-row .mail-no { min-width: 34px; justify-content: center; }
.mail-row .mail-title { flex: 1 1 240px; width: auto; }
.mail-row input[type=file] { flex: 1 1 240px; width: auto; }
@media (max-width: 640px) { .mail-row { flex-wrap: wrap; } }
/* prevlačenje fajlova (app.js: [data-dropzone]) */
[data-dropzone] { border-radius: var(--radius); transition: background .15s, outline-color .15s; }
[data-dropzone].drop-over { outline: 2px dashed var(--blue-600); outline-offset: 4px; background: rgba(36, 89, 214, .06); }
.drop-hint { display: flex; align-items: center; gap: 8px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
  padding: 10px 14px; margin-bottom: 10px; color: var(--text-2); font-size: 13px; }
.drop-over .drop-hint { border-color: var(--blue-600); color: var(--blue-600); }

/* brzi pregled Excela (offers/preview.py): sheetovi kao tabovi dolje, mreža kao u Excelu */
.inv-viewer-body .xl-box { align-self: stretch; width: 100%; display: flex; flex-direction: column; min-height: 0; background: #fff; }
.xl-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.xl-body { flex: 1; overflow: auto; min-height: 0; }
.xl-table { border-collapse: collapse; font-size: 12px; font-family: Calibri, Arial, sans-serif; color: #111; table-layout: auto; }
.xl-table td, .xl-table th { border: 1px solid #d9dde3; padding: 2px 6px; white-space: nowrap; max-width: 480px; overflow: hidden; text-overflow: ellipsis; height: 20px; }
.xl-table td.n { text-align: right; font-variant-numeric: tabular-nums; }
.xl-table thead th { position: sticky; top: 0; z-index: 2; background: #f1f3f6; color: #555; font-weight: 500; text-align: center; }
.xl-table th.xl-rn { position: sticky; left: 0; z-index: 1; background: #f1f3f6; color: #555; font-weight: 500; text-align: right; min-width: 34px; }
.xl-table thead th.xl-rn { z-index: 3; }
.xl-table col.xl-hidden { visibility: collapse; }
.xl-tabs { display: flex; gap: 2px; padding: 4px 8px 0; border-top: 1px solid #d9dde3; background: #f1f3f6; overflow-x: auto; flex: none; }
.xl-tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 6px 14px; font-size: 13px; cursor: pointer; color: #444; white-space: nowrap; border-radius: 6px 6px 0 0; }
.xl-tab:hover { background: #e6e9ee; }
.xl-tab.active { background: #fff; border-color: #d9dde3; color: #107c41; font-weight: 600; box-shadow: inset 0 -3px 0 #107c41; }
.xl-tab-hidden { opacity: .55; font-style: italic; }
.xl-empty, .xl-more { padding: 12px; margin: 0; }

/* MEPS indeks (proizvodnja / integralni) */
.meps-box { border: 2px solid #f0a020; background: var(--amber-bg); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px; color: #5c3800; }
.meps-box.has-error { border-color: var(--red); background: var(--red-bg); }
.meps-box-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.meps-box-head > div > b { font-size: 15px; }
.meps-box-head .icon { flex: none; color: #c77700; }
.meps-box .small { margin-top: 2px; }
.meps-box .meps-stale { margin: 0 0 10px; font-weight: 600; color: #9e2615; }
.meps-box .meps-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.meps-box label.check { font-weight: 600; margin-top: 4px; }
@media (max-width: 720px) { .meps-box .meps-fields { grid-template-columns: 1fr; } }
.meps-box .meps-missing { margin: -4px 0 8px; font-weight: 600; color: #9e2615; }
.meps-hint { color: #b26a00; font-weight: 600; }
.meps-pct { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12px; font-weight: 600; }
.meps-pct.up { color: var(--red); }
.meps-pct.down { color: var(--green); }
.meps-latest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.meps-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.meps-tile .t-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.meps-tile b { font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.meps-tile > span:last-child { font-size: 13px; color: var(--text-3); }
@media (max-width: 560px) { .meps-latest { grid-template-columns: 1fr; } }
.btn.btn-warn { border-color: #f0a020; color: #9a5b00; background: var(--amber-bg); }

/* Projekcija — plan fakturisanja i planiranje: red plana, redovi za poređenje, traka za dodavanje godina */
.fc-section { margin: 26px 0 12px; font-size: 18px; }
.fc-cmp-bar { flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.fc-cmp-bar .chip { text-decoration: none; }
.fc-sum tr.fc-plan-r td { background: #f7f9fe; }
.fc-sum tr.fc-cmp-r td { color: var(--text-2); font-style: italic; }

/* Realizacija: godine koje su još plan (crtkani okvir) i objašnjenje prelaska plan → realizacija */
.fc-yearbar a.plan { border: 1.5px dashed #e0892b; background: #fff8f0; color: #a55a12; }
.fc-yearbar a.plan.on { background: #e0892b; border-color: #e0892b; color: #fff; }
.fc-yearbar a.plan small { font-weight: 600; font-size: 11px; }
.fc-yearbar a.add { border-style: dashed; color: var(--blue-600); }
.fc-howto { margin: -4px 0 14px; color: var(--text-2); line-height: 1.6; }
.fc-howto-plan { display: inline-block; padding: 0 7px; border: 1.5px dashed #e0892b; border-radius: 4px; background: #fff8f0; color: #a55a12; font-weight: 700; }
.fc-plan-note { background: #fff8f0; border-bottom: 1px dashed #e0892b; color: #6b3d0c; }
.fc-sum th.fc-plan-col, .fc-sum td.fc-plan-col { background: #fff8f0; border-left: 1.5px dashed #e0892b; border-right: 1.5px dashed #e0892b; color: #8a4c10; }
.fc-sum thead th.fc-plan-col { background: #e0892b; color: #fff; }
.fc-close-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.fc-close-bar form { margin: 0; }
.fc-closed-bar { background: #eef8f1; border-bottom: 1px solid #b9e0c6; color: #1d5a35; }

/* MEPS grafikoni rasta */
.meps-charts { --s-hr: #d6362a; --s-cr: #0072CE; }
.meps-charts .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meps-range { display: inline-flex; gap: 4px; }
.meps-range button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text-2); font: inherit; font-weight: 600; font-size: 12px; cursor: pointer; }
.meps-range button.active { background: var(--navy, #14254a); border-color: var(--navy, #14254a); color: #fff; }
.meps-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); font-weight: 600; }
.meps-growth { display: flex; gap: 8px 22px; flex-wrap: wrap; margin: 8px 0 4px; font-size: 13px; color: var(--text); }
.meps-g { white-space: nowrap; }
@media (max-width: 560px) { .meps-g { white-space: normal; } }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw.s-hr, .chart-tip .sw.s-hr { background: var(--s-hr, #d6362a); }
.sw.s-cr, .chart-tip .sw.s-cr { background: var(--s-cr, #0072CE); }
.meps-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin-top: 10px; }
.meps-chart-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 900px) { .meps-chart-grid { grid-template-columns: 1fr; } }
.meps-ch-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 0 0 4px; }
.meps-chart { position: relative; min-height: 220px; }
.meps-svg { display: block; overflow: visible; touch-action: pan-y; }
.meps-svg .grid { stroke: var(--border); stroke-width: 1; }
.meps-svg .zero { stroke: var(--text-3); stroke-width: 1; }
.meps-svg .ax { fill: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.meps-svg .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.meps-svg .ln.s-hr { stroke: var(--s-hr); } .meps-svg .ln.s-cr { stroke: var(--s-cr); }
.meps-svg .dot { stroke: var(--surface); stroke-width: 2; }
.meps-svg .dot.s-hr, .meps-svg .bar.s-hr { fill: var(--s-hr); } .meps-svg .dot.s-cr, .meps-svg .bar.s-cr { fill: var(--s-cr); }
.meps-svg .end-lab { fill: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meps-svg .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.meps-chart .chart-tip { transform: translate(-50%, 0); }
.meps-chart .chart-tip div { margin-top: 2px; }

/* Analiza — poređenje integralnih ponuda */
.cmp-pick { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.cmp-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.cmp-tools .input { flex: 1 1 220px; width: auto; }
.cmp-list { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 5px; }
.cmp-list .cmp-item { padding: 7px 10px; border-bottom: 1px solid var(--border); }
.cmp-list .cmp-item:last-child { border-bottom: 0; }
.cmp-item { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; line-height: 1.35; }
.cmp-item[hidden] { display: none; }
.cmp-item input { width: 16px; height: 16px; margin-top: 2px; flex: none; cursor: pointer; }
.cmp-item small { display: block; font-size: 11.5px; }
.cmp-list .cmp-item:has(input:checked) { background: #f1f6ff; }
.cmp-metrics fieldset { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.cmp-metrics legend { font-weight: 700; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.cmp-metrics .cmp-item small { display: inline; }
.cmp-submit { margin: 12px 0 16px; }
.cmp-table th[scope=row] { text-align: left; white-space: nowrap; font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text); background: #fff; }
.cmp-table thead th .cell-sub { text-transform: none; letter-spacing: 0; font-size: 12px; }
.cmp-table thead th .cell-sub { display: block; font-weight: 400; max-width: 180px; margin-left: auto; white-space: normal; }
.cmp-table td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cmp-table .cmp-avg { background: #f6f8fc; }
.cmp-table td.cmp-hi { background: #fff1e6; color: #a3540b; font-weight: 600; }
.cmp-table td.cmp-lo { background: #e9f2ff; color: #1d4f9c; font-weight: 600; }
.cmp-dev { display: block; font-size: 11px; font-weight: 500; opacity: .85; }
.cmp-tag { font-size: 10px; color: var(--text-2); }
.cmp-warn { color: #a3540b; margin: 0 0 8px; }
@media (max-width: 900px) { .cmp-pick { grid-template-columns: 1fr; } }
.cmp-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cmp-list-refs { max-height: 260px; }
.cmp-table .cmp-ref { background: #f4f1fb; }
.cmp-table .cmp-ref-avg { background: #ebe6f7; }
.cmp-refs-admin { margin-top: 16px; }
.cmp-add { margin-top: 12px; }
.cmp-add summary { list-style: none; display: inline-flex; cursor: pointer; }
.cmp-add summary::-webkit-details-marker { display: none; }
.cmp-add-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 12px; align-items: end; }
.cmp-add-form .cmp-wide { grid-column: span 2; }
.cmp-add-actions { grid-column: 1 / -1; }
.cmp-refs-admin td form { display: flex; gap: 4px; justify-content: flex-end; }
.cmp-refs-admin tr.cmp-editing td { background: #fff7e6; }
