/* ---------------------------------------------------------------------------
   Portal sef.biznisoft.com — stil (Faza 4). Isti vizuelni jezik kao BizniSoft
   Ekstenzija (mfin.css): brend #29487b, akcent #1677ad, eyebrow naslovi,
   pilule dugmad, kartice. PODRAZUMEVANA tema je SVETLA; tamna se bira
   isključivo ručnim prekidačem (data-theme="dark" na <html>, pamti se u
   localStorage) — OS podešavanje se NE prati.
   --naslov je boja naslova/zaglavlja NAD površinom (ne brend traka) i mora
   biti čitljiva u tamnoj temi — zato se redefiniše za data-theme=dark.
--------------------------------------------------------------------------- */

:root {
	--bg: #eef1f5;
	--surface: #ffffff;
	--surface-2: #f6f8fb;
	--border: #d9e0ea;
	--text: #1f2430;
	--muted: #6b7280;
	--brand: #29487b;
	--brand-hover: #1f3a66;
	--naslov: #29487b;
	--accent: #1677ad;
	--ok: #1e8e3e;
	--warn: #b26a00;
	--err: #c0392b;
	--shadow: 0 1px 3px rgba(20, 30, 50, 0.08), 0 6px 20px rgba(20, 30, 50, 0.06);
}

/* tamna paleta — ručni izbor (data-theme=dark) */
:root[data-theme="dark"] {
	--bg: #1f2125;
	--surface: #2f3136;
	--surface-2: #35383e;
	--border: #4a4e55;
	--text: #dfe3e8;
	--muted: #8f97a3;
	--brand: #29487b;
	--brand-hover: #1f3a66;
	--naslov: #9db9ea;
	--accent: #3d92c9;
	--ok: #5fbf72;
	--warn: #e0a44a;
	--err: #ef6a5e;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.3);
	color-scheme: dark;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
	background: var(--bg);
	color: var(--text);
	line-height: 1.5;
	min-height: 100vh;
}

.eyebrow {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ------------------------------ topbar ---------------------------------- */
.topbar {
	background: var(--brand);
	color: #fff;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 0 20px;
	height: 56px;
	position: sticky;
	top: 0;
	z-index: 10;
}
.topbar .brand {
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.02em;
	margin-right: auto;
}
.topbar .brand small {
	font-weight: 400;
	opacity: 0.75;
	font-size: 12px;
	letter-spacing: 0.04em;
}
.topbar button {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	border: none;
	border-radius: 999px;
	height: 32px;
	padding: 0 14px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.topbar button:hover {
	background: rgba(255, 255, 255, 0.26);
}

/* ----------------------------- layout ----------------------------------- */
.container {
	max-width: 1080px;
	margin: 0 auto;
	padding: 22px 20px 60px;
}
.hidden {
	display: none !important;
}

/* kartice */
.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	box-shadow: var(--shadow);
}

/* dugmad — pilule */
.btn {
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 9px 18px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}
.btn-primary {
	background: var(--brand);
	color: #fff;
}
.btn-primary:hover {
	background: var(--brand-hover);
}
.btn-ghost {
	background: transparent;
	color: var(--naslov);
	border-color: var(--border);
}
.btn-ghost:hover {
	background: var(--surface-2);
}
.btn:disabled {
	opacity: 0.5;
	cursor: default;
}

/* ------------------------------ login ----------------------------------- */
.login-wrap {
	display: flex;
	justify-content: center;
	padding-top: 8vh;
}
.login-card {
	width: 100%;
	max-width: 400px;
	padding: 30px 30px 26px;
}
.login-card h1 {
	font-size: 21px;
	color: var(--naslov);
	margin: 4px 0 4px;
}
.login-card p.uvod {
	color: var(--muted);
	font-size: 13px;
	margin-bottom: 20px;
}
.field {
	margin-bottom: 15px;
}
.field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: 5px;
}
.field input,
.field select {
	width: 100%;
	background: var(--surface);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 9px 11px;
	font: inherit;
	font-size: 14px;
}
.field input:focus,
.field select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(22, 119, 173, 0.16);
}
.login-card .btn-primary {
	width: 100%;
	justify-content: center;
	margin-top: 6px;
}
.poruka {
	font-size: 13px;
	margin-top: 12px;
	min-height: 18px;
}
.poruka.err {
	color: var(--err);
}
.poruka.ok {
	color: var(--ok);
}
.login-card .podnozje {
	margin-top: 18px;
	font-size: 12px;
	color: var(--muted);
	text-align: center;
}
.link-btn {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	font-size: 12px;
	color: var(--accent);
	cursor: pointer;
	text-decoration: none;
}
.link-btn:hover {
	text-decoration: underline;
}
.podnozje-sep {
	margin: 0 8px;
	color: var(--muted);
}
/* istaknut link ka uputstvu — krupnije i uočljivije od podnožja (API dok.) */
.login-card .uputstvo-red {
	margin-top: 18px;
	text-align: center;
}
.login-card .uputstvo-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14.5px;
	font-weight: 600;
	color: var(--accent);
	text-decoration: none;
	padding: 9px 16px;
	border: 1px solid var(--accent);
	border-radius: 999px;
	transition: background 0.15s, color 0.15s;
}
.login-card .uputstvo-link:hover {
	background: var(--accent);
	color: #fff;
}

/* --------------------------- firma zaglavlje ---------------------------- */
.firma-card {
	padding: 18px 22px;
	margin-bottom: 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 18px 30px;
	align-items: flex-start;
}
.firma-info {
	flex: 1 1 240px;
}
.firma-info h2 {
	font-size: 19px;
	color: var(--naslov);
	margin: 2px 0 3px;
}
.firma-info .detalji {
	font-size: 13px;
	color: var(--muted);
}
.brojaci {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.stat {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 9px 14px;
	min-width: 78px;
	text-align: center;
}
.stat b {
	display: block;
	font-size: 20px;
	font-variant-numeric: tabular-nums;
	color: var(--text);
}
.stat span {
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}
.stat.obr b {
	color: var(--ok);
}
.stat.neobr b {
	color: var(--warn);
}

/* ----------------------------- filteri ---------------------------------- */
.filteri {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
	margin-bottom: 14px;
}
.filteri .field {
	margin: 0;
}
.filteri .field.rast {
	flex: 1 1 200px;
}
.filteri label {
	font-size: 11px;
}
.filteri input,
.filteri select {
	padding: 7px 10px;
	font-size: 13px;
}

/* ----------------------------- tabele ----------------------------------- */
.tabela-wrap {
	overflow-x: auto;
}
table.grid {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	font-variant-numeric: tabular-nums;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
}
table.grid thead th {
	background: var(--surface-2);
	color: var(--naslov);
	text-align: left;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}
table.grid tbody td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
}
table.grid tbody tr:last-child td {
	border-bottom: none;
}
table.grid tbody tr.klik {
	cursor: pointer;
}
table.grid tbody tr.klik:hover td {
	background: var(--surface-2);
}
td.br,
th.br {
	text-align: right;
}
td.ce,
th.ce {
	text-align: center;
}
.prazno {
	padding: 40px 16px;
	text-align: center;
	color: var(--muted);
	font-size: 14px;
}

/* badge / oznake */
.badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 999px;
	white-space: nowrap;
}
.badge.obr {
	background: rgba(30, 142, 62, 0.14);
	color: var(--ok);
}
.badge.neobr {
	background: rgba(178, 106, 0, 0.14);
	color: var(--warn);
}
.ikona-nap {
	color: var(--accent);
	font-weight: 700;
	cursor: help;
}

/* paginacija */
.paginacija {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 16px;
	font-size: 13px;
	color: var(--muted);
}
.paginacija button {
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text);
	border-radius: 8px;
	padding: 6px 12px;
	font: inherit;
	cursor: pointer;
}
.paginacija button:disabled {
	opacity: 0.45;
	cursor: default;
}

/* ------------------------------ detalj ---------------------------------- */
.detalj-zaglavlje {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 24px;
	align-items: center;
	margin-bottom: 14px;
}
.detalj-zaglavlje h2 {
	font-size: 18px;
	color: var(--naslov);
}
.detalj-zaglavlje .meta {
	color: var(--muted);
	font-size: 13px;
}
.detalj-akcije {
	margin-left: auto;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.zbir {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 26px;
	justify-content: flex-end;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 10px 16px;
	margin-top: 12px;
	font-variant-numeric: tabular-nums;
}
.zbir div {
	text-align: right;
}
.zbir span {
	display: block;
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
}
.zbir b {
	font-size: 15px;
	color: var(--naslov);
}
.napomena-box {
	margin-top: 14px;
	background: var(--surface-2);
	border-left: 3px solid var(--accent);
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 13.5px;
}
.napomena-box span {
	font-weight: 700;
	color: var(--naslov);
}
.nula {
	color: var(--muted);
}

/* ------------------------------ modal ----------------------------------- */
.modal-poz {
	position: fixed;
	inset: 0;
	background: rgba(15, 22, 38, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	z-index: 40;
}
.modal {
	width: 100%;
	max-width: 420px;
	padding: 24px;
}
.modal h3 {
	font-size: 17px;
	color: var(--naslov);
	margin-bottom: 4px;
}
.modal .modal-akcije {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 18px;
}

/* toast */
.toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	transform: translateX(-50%);
	background: var(--brand);
	color: #fff;
	padding: 11px 20px;
	border-radius: 999px;
	font-size: 13.5px;
	box-shadow: var(--shadow);
	z-index: 50;
	max-width: 90vw;
}
.toast.err {
	background: var(--err);
}

@media (max-width: 620px) {
	.firma-card {
		flex-direction: column;
	}
	.detalj-akcije {
		width: 100%;
	}
}
