/* ENP Prinudna naplata - zajednički stilovi.
   Komponente: .card, .grid-2/3/4, .stat, .table, .btn(.btn-primary/.btn-danger/.btn-light/.btn-sm), .badge-*, .form-grid, .field,
   .tabs/.tab-panel, .timeline, .flash-*, .filters, .muted, .text-right, .kv (key/value lista), .modal, .empty
   Novi pomocni stilovi (UI polish, blok "Polish" na kraju fajla):
   .badge-stack  - vertikalni flex, razmak 4px, align-items:flex-start (vise bedzeva u jednoj celiji)
   .badge-row    - horizontalni flex sa razmakom 4px, wrap
   .btn-group    - dugmad jedno do drugog, razmak 6px
   .cell-form    - input + dugme u celiji tabele, kompaktno u liniji (isto vazi za .table td form / .inline-form)
   .col-msg / td.msg / .wrap-text - kolona poruke, overflow-wrap:anywhere
   .filters .checkbox - checkbox iste visine (34px) kao input; .tabs wrapuje umesto skrola */
:root {
  /* Paleta: papir + mastilo + jedan akcent (tamni bor zeleni, "pečat") */
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #f3f5f2;
  --border: #e3e6e1;
  --border-2: #d3d8d1;
  --text: #18212b;
  --text-2: #5b6573;
  --primary: #2f5d50;
  --primary-2: #234a3f;
  --primary-soft: #e6efeb;
  --link: #18212b;
  --danger: #c62828;
  --danger-soft: #fdecea;
  --warning: #b45309;
  --warning-soft: #fdf3e1;
  --success: #2e7d4f;
  --success-soft: #e5f3ea;
  --sidebar: #fbfcfa;
  --sidebar-2: #eef2ee;
  --sidebar-text: #3a4450;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(24, 33, 43, .04);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.red { color: var(--danger); } .green { color: var(--success); } .orange { color: var(--warning); }
.strong { font-weight: 600; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 244px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; }
.brand-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 12px; letter-spacing: .02em; }
.brand-name { color: var(--text); font-weight: 700; font-size: 14.5px; }
.brand-sub { font-size: 12px; color: var(--text-2); }
.nav { padding: 4px 10px 24px; }
.nav-group { font-size: 12px; font-weight: 600; color: #8a929c; padding: 16px 10px 6px; }
.nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin: 1px 0; color: var(--sidebar-text); font-size: 13.5px; font-weight: 500; border-radius: 7px; text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
.nav a:hover { background: var(--sidebar-2); color: var(--text); }
.nav a.active { background: var(--primary-soft); color: var(--primary-2); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav svg { width: 18px; height: 18px; fill: #7b8591; flex-shrink: 0; transition: fill .15s var(--ease); }
.nav a:hover svg { fill: var(--text-2); }
.nav a.active svg { fill: var(--primary); }
.nav-count { margin-left: auto; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; font-weight: 600; line-height: 18px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); padding: 10px 24px; position: sticky; top: 0; z-index: 20; }
.global-search { flex: 1; max-width: 460px; }
.global-search input { width: 100%; background: var(--surface-2); border-color: transparent; }
.global-search input:focus { background: #fff; border-color: var(--primary); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menu-toggle { display: none; }
.content { padding: 20px 24px 40px; flex: 1; }
.footer { padding: 12px 24px; color: var(--text-2); font-size: 12px; border-top: 1px solid var(--border); background: var(--surface); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner { padding: 8px 24px; font-size: 13px; }
.banner-warning { background: var(--warning-soft); color: #92400e; }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.p0 { padding: 0; }
.card.p0 .card-head { padding: 14px 18px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* Stat tiles */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-label { color: var(--text-2); font-size: 13px; }
.stat-value { font-size: 22px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stat.danger { border-left: 4px solid var(--danger); }
.stat.warning { border-left: 4px solid var(--warning); }
.stat.success { border-left: 4px solid var(--success); }
.stat.primary { border-left: 4px solid var(--primary); }
a.stat { display: block; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--primary); }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.table tbody tr:hover { background: #f7f9f6; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); }
.table .actions { white-space: nowrap; text-align: right; }
.table tr.row-danger td { background: #fff5f5; }
.table tr.row-warning td { background: #fffbeb; }
.table tr.row-muted td { color: var(--text-2); }
.empty { padding: 24px; text-align: center; color: var(--text-2); }

/* Key-value list */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--text-2); font-size: 13px; }
.kv dd { margin: 0; font-weight: 500; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none !important; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-light { background: var(--surface-2); }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }
.btn-icon { background: none; border: 0; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge-gray { background: #e5e7eb; color: #374151; }
.badge-gray-dark { background: #4b5563; color: #fff; }
.badge-dark { background: #1f2937; color: #fff; }
.badge-blue { background: #e4ecf5; color: #24476b; }
.badge-indigo { background: #e0e7ff; color: #3730a3; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-teal { background: #ccfbf1; color: #115e59; }
.badge-green { background: #16a34a; color: #fff; }
.badge-green-light { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-red { background: #dc2626; color: #fff; }

/* Forms */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input[type=file], select, textarea {
  font: inherit; font-size: 13.5px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: var(--text); width: 100%; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
textarea { min-height: 80px; resize: vertical; }
label { font-size: 12.5px; font-weight: 600; color: #334155; display: block; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 12px; color: var(--text-2); margin-top: 3px; font-weight: normal; }
.req::after { content: " *"; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.checkbox { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.checkbox input { width: auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 140px; }
.filters input, .filters select { width: auto; min-width: 140px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; border: 1px solid; font-size: 13.5px; }
.flash-success { background: var(--success-soft); border-color: #86efac; color: #166534; }
.flash-error { background: var(--danger-soft); border-color: #fca5a5; color: #991b1b; }
.flash-warning { background: var(--warning-soft); border-color: #fcd34d; color: #92400e; }
.flash-info { background: var(--primary-soft); border-color: #c4d8cf; color: var(--primary-2); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 9px 14px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.timeline li.t-status::before { background: #7c3aed; }
.timeline li.t-uplata::before, .timeline li.t-prenos::before, .timeline li.t-naplata::before { background: var(--success); }
.timeline li.t-trosak::before, .timeline li.t-predujam::before { background: var(--warning); }
.timeline li.t-zatvaranje::before { background: #111827; }
.timeline .t-time { font-size: 12px; color: var(--text-2); }
.timeline .t-title { font-weight: 600; }
.timeline .t-desc { font-size: 13px; color: #475569; white-space: pre-line; }

/* Next action box (§32) */
.next-action { border: 1px solid #b9cfc6; border-left: 4px solid var(--primary); background: #f7faf8; }
.next-action.missing { border-color: var(--danger); background: #fff5f5; }

/* Pagination */
.pagination { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; font-size: 13px; }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: none; align-items: flex-start; justify-content: center; z-index: 100; padding: 60px 16px; overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 10px; width: 100%; max-width: 640px; padding: 20px 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-box.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }

/* Bars (jednostavni grafikoni) */
.bar-row { display: grid; grid-template-columns: 180px 1fr 120px; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: var(--primary); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; }
.login-box { background: #fff; border-radius: 12px; padding: 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-box h1 { font-size: 20px; text-align: center; }
.login-box .brand-logo { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 16px; }

/* Print / PDF */
@media print {
  .sidebar, .topbar, .footer, .page-actions, .filters, .no-print, .form-actions, .pagination, .banner { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .tab-panel { display: block !important; }
  a { color: inherit; }
}

/* Responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .user-role { display: none; }
  .kv { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
}

/* ===== Polish (shared utilities) ===== */
.badge + .badge { margin-left: 4px; }
.badge-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.badge-stack .badge + .badge, .badge-row .badge + .badge { margin-left: 0; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-sm { padding: 4px 10px; }
.btn:focus-visible, a:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
select, input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel] { height: 34px; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.checkbox { margin: 0; cursor: pointer; }
.form-actions { flex-wrap: wrap; align-items: center; margin-top: 14px; }
.modal-box .form-actions { justify-content: flex-end; }
.modal-head { gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.page-actions { align-items: center; }
.filters { gap: 10px 12px; }
.filters .field { min-width: 150px; }
.filters .field input, .filters .field select { width: 100%; min-width: 0; }
.filters .btn { height: 34px; }
.filters .field.field-actions { display: flex; gap: 8px; align-items: flex-end; }
.filters .field .checkbox, .filters label.checkbox { height: 34px; padding: 0 4px; margin: 0; }
.kv { grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; }
.kv dd { overflow-wrap: anywhere; }
.table td.msg, .table td.col-msg, .wrap-text { overflow-wrap: anywhere; }
.table td.col-msg { min-width: 220px; }
.table td.date { white-space: nowrap; }
.table td form { margin: 0; }
.table td form.inline-form, .cell-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.table td input[type=text], .table td input[type=number], .table td input[type=date], .table td input[type=search], .table td select { height: 30px; padding: 4px 8px; font-size: 12.5px; width: auto; min-width: 0; }
.table td .btn + .btn, .table td .btn + form, .table td form + .btn, .table td form + form { margin-left: 6px; }
.tabs { flex-wrap: wrap; overflow: visible; }
@media (max-width: 800px) {
  html, body { overflow-x: hidden; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .page-head { align-items: flex-start; }
  .filters .field { flex: 1 1 100%; min-width: 0; }
  .card { padding: 14px; }
  .modal { padding: 24px 10px; }
  .tabs a, .tabs button { padding: 8px 10px; }
}
.filters input[type=checkbox], .filters .field input[type=checkbox], .table td input[type=checkbox] { width: 15px; min-width: 0; height: 15px; }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .card, .stat { min-width: 0; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}
.table a + .badge, .table td > .badge:not(:first-child) { margin-left: 6px; } .badge-stack > .badge { margin-left: 0 !important; }
.daily-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; } @media (max-width: 800px) { .daily-grid { grid-template-columns: minmax(0, 1fr); } }
.cell-form.wrap { flex-wrap: wrap; max-width: 300px; justify-content: flex-end; } .table .actions .cell-form.wrap { white-space: normal; }
.filters .field:has(> .checkbox), .filters .field:has(> .btn) { min-width: 0; } .filters .field:has(> .btn) { display: flex; gap: 8px; align-items: flex-end; }
.kv.mt { margin-top: 16px; } .kv.mb { margin-bottom: 16px; }
.cell-form.wrap { max-width: 240px; } .cell-form.wrap input[type=text] { flex: 1 1 100%; width: 100% !important; }

/* Jedinstveno dugme za zatvaranje modala (×) bez obzira na klasu u markupu */
.modal-head [data-modal-close] {
  width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  font-size: 22px; line-height: 1; font-weight: 400; flex-shrink: 0;
}
.modal-head [data-modal-close]:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }

/* Kompaktnija polja za datum/iznos u filterima */
.filters .field:has(input[type=date]), .filters .field:has(input[data-money]), .filters .field:has(input[type=number]) { min-width: 120px; }
.filters input[type=date], .filters input[type=number], .filters input[data-money] { min-width: 120px; }

/* ---------------------------------------------------------------
   Topbar: ikonica alarma i korisnički meni
   --------------------------------------------------------------- */
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; fill: currentColor; }
.icon-btn .count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.user-menu { position: relative; font-size: 13px; }
.user-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 8px; cursor: pointer; user-select: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--surface-2); }
.user-menu .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sidebar); color: #fff; font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .02em; }
.user-menu .user-id { display: flex; flex-direction: column; line-height: 1.2; }
.user-menu .user-name { font-weight: 600; }
.user-menu .user-role { background: none; border: 0; padding: 0; font-size: 12px; color: var(--text-2); }
.user-menu .chev { width: 18px; height: 18px; fill: var(--text-2); }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); padding: 6px; z-index: 60; }
.user-dropdown .ud-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.user-dropdown .ud-head strong { display: block; font-size: 13.5px; }
.user-dropdown .ud-head span { font-size: 12px; color: var(--text-2); }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.user-dropdown a:hover { background: var(--surface-2); }
.user-dropdown a svg { width: 18px; height: 18px; fill: var(--text-2); flex-shrink: 0; }
.user-dropdown a em { margin-left: auto; font-style: normal; font-size: 11.5px; color: #92400e; background: var(--warning-soft); padding: 1px 7px; border-radius: 9px; }
.user-dropdown a.logout { color: var(--danger); border-top: 1px solid var(--border); border-radius: 0 0 6px 6px; margin-top: 4px; }
.user-dropdown a.logout svg { fill: var(--danger); }
.topbar-right { gap: 6px; }
@media (max-width: 800px) { .user-menu .user-id { display: none; } }

/* Mirniji izgled kartica i naslova */
body { -webkit-font-smoothing: antialiased; }
.card, .stat { border-radius: 10px; box-shadow: none; }
h1 { font-weight: 600; letter-spacing: -.01em; }
.card-head h2 { font-size: 15px; }

/* =================================================================
   Tema v2: papir + mastilo + bor zeleni akcent, mirni linkovi, pokret
   ================================================================= */
body { background: var(--bg); }
::selection { background: #cfe0d8; }

/* Linkovi u sadržaju: mastilo, na hover akcent + linija koja se "iscrta" */
.table a:not(.btn):not(.badge), .kv a, .timeline a, .card-head a:not(.btn), .content p a, .attn a .t, .muted a {
  color: var(--text); font-weight: 500; text-decoration: none !important;
  background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat;
  transition: background-size .22s var(--ease), color .15s var(--ease);
}
.table a:not(.btn):not(.badge):hover, .kv a:hover, .timeline a:hover, .card-head a:not(.btn):hover, .content p a:hover, .muted a:hover {
  color: var(--primary); background-size: 100% 1px;
}
.card-head a:not(.btn) { font-size: 13px; color: var(--text-2); }
.table td .muted, .table td .small { font-weight: 400; }

/* Dugmad */
.btn { border-radius: 7px; border-color: var(--border-2); transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease); }
.btn:hover { background: var(--surface-2); border-color: #bfc6bd; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); border-color: var(--primary-2); color: #fff; }
.btn-danger:hover, .btn-success:hover { filter: brightness(.95); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #9cc0b2; outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #dbe9e2; border-color: var(--primary); }

/* Kartice, tabele, tabovi */
.card, .stat, .summary, .set-list { border-color: var(--border); }
.table th { background: #f7f8f6; color: var(--text-2); font-weight: 600; }
.table td, .table th { border-bottom-color: #eceee9; }
.tabs { border-bottom-color: var(--border); }
.tabs a, .tabs button { transition: color .15s var(--ease), border-color .2s var(--ease); }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active { color: var(--primary-2); border-bottom-color: var(--primary); }
.timeline { border-left-color: var(--border); }
.timeline li::before { background: var(--primary); }
.user-menu .avatar { background: var(--primary); }
.login-box { box-shadow: 0 1px 2px rgba(24, 33, 43, .05); border: 1px solid var(--border); }
.banner-warning { background: #fdf6e8; color: #7c4a03; border-bottom: 1px solid #f3e2bf; }
.banner-warning a { color: #7c4a03; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pagination a.active { background: var(--primary); border-color: var(--primary); }
.bar > span { background: var(--primary); }

/* ---- Pokret: kratak ulazak stranice + odgovor na radnju korisnika ---- */
@keyframes enp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes enp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes enp-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.content > .page-head { animation: enp-fade .25s var(--ease) both; }
.content > :not(.page-head):not(.flash) { animation: enp-rise .32s var(--ease) both; }
.content > :nth-child(3) { animation-delay: .03s; }
.content > :nth-child(4) { animation-delay: .06s; }
.content > :nth-child(5) { animation-delay: .09s; }
.content > :nth-child(n+6) { animation-delay: .12s; }
.flash { animation: enp-pop .25s var(--ease) both; }
.user-menu[open] .user-dropdown { animation: enp-pop .16s var(--ease) both; transform-origin: top right; }
.modal.open { animation: enp-fade .16s var(--ease) both; }
.modal.open .modal-box { animation: enp-pop .2s var(--ease) both; }
.tab-panel.active { animation: enp-fade .2s var(--ease) both; }
.nav-count, .icon-btn .count { animation: enp-pop .3s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Mobilni meni: svetla bočna traka preko sadržaja */
@media (max-width: 800px) {
  .sidebar { box-shadow: 0 10px 40px rgba(24, 33, 43, .18); }
}

/* Tabele: identifikatori, linkovi i bedževi u jednom redu; široka tabela se skroluje u kartici */
.table th, .table td { vertical-align: middle; }
.table td:first-child, .table td a, .table td .badge, .table td.date { white-space: nowrap; }
.table td.col-msg a, .table td.msg a, .table td.wrap-text a { white-space: normal; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.card > .table-wrap:last-child { border-radius: 0 0 10px 10px; }
/* Kašnjenje/upozorenje: tanka oznaka levo umesto obojenog reda */
.table tr.row-danger td, .table tr.row-warning td { background: transparent; }
.table tr.row-danger td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.table tr.row-warning td:first-child { box-shadow: inset 3px 0 0 #e0a42a; }
.table tr.row-danger:hover td, .table tr.row-warning:hover td { background: #f7f9f6; }
/* Nazivi (ćelija koja je samo link) prelamaju se po rečima, ali ne uže od 150px */
.table td:not(:first-child) > a:only-child:not(.btn) { white-space: normal; display: inline-block; min-width: 150px; max-width: 260px; }
.table th, .table td { padding: 9px 10px; }

/* Brojčane pločice: bez obojenih levih ivica; boja samo kada nešto zahteva pažnju */
.stat, .stat.primary, .stat.success, .stat.warning { border: 1px solid var(--border); border-left-width: 1px; }
.stat.danger { border: 1px solid #f1c9c5; background: #fffaf9; }
.stat.danger .stat-value { color: var(--danger); }
.stat.warning .stat-value { color: var(--warning); }
.stat-value { font-weight: 600; letter-spacing: -.01em; }
a.stat:hover { border-color: var(--border-2); background: #fcfdfc; }
.next-action h2, .next-action h3 { text-transform: none; letter-spacing: 0; }
