/* Inter (rsms.me/inter), SIL Open Font License 1.1, vidi fonts/Inter-LICENSE.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable.woff2") format("woff2");
}

:root {
  --paper: #f3f5f8;
  --surface: #ffffff;
  --sunken: #f0f3f6;
  --ink: #0f1c2b;
  --muted: #5b6878;
  --line: #e2e7ed;
  --line-strong: #cbd3dc;
  --accent: #0e7c72;
  --accent-hover: #0a6a61;
  --accent-ink: #ffffff;
  --accent-soft: #e2f3f0;
  --nav: #0c1a26;
  --nav-2: #13293a;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #177245;
  --ok-soft: #e1f4e8;
  --blue: #2557a3;
  --blue-soft: #e5edfa;
  --violet: #5b3da0;
  --violet-soft: #eee8fa;
  --grey-soft: #edf0f3;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 28, 43, 0.06);
  --shadow: 0 1px 2px rgba(15, 28, 43, 0.05), 0 4px 14px rgba(15, 28, 43, 0.06);
  --shadow-lg: 0 18px 48px rgba(15, 28, 43, 0.18);
  --ring: 0 0 0 3px rgba(14, 124, 114, 0.22);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14.5px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover { color: var(--ink); background: var(--sunken); }

label.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 400;
  color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }

.auth { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.auth form { width: min(380px, 100%); display: grid; gap: 14px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.brand { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.hint { color: var(--muted); font-size: 14px; }
.error { color: var(--danger); font-size: 14px; font-weight: 600; }
.error:empty { display: none; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.top nav button { padding: 8px 12px; border: 0; border-radius: 6px; background: none; cursor: pointer; color: var(--muted); font-weight: 600; white-space: nowrap; }
.top nav button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.who { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; white-space: nowrap; }

main { max-width: 1240px; margin: 0 auto; padding: 22px 24px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.01em; }

.access-section { display: grid; gap: 6px; margin-top: 22px; }
.access-section h2 { font-size: 17px; }
.access-section .table-wrap { margin-top: 6px; }
.mode { padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; }
.mode-uzivo { background: var(--ok-soft); color: var(--ok); }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric { display: grid; gap: 2px; padding: 12px 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.metric:hover { border-color: var(--accent); }
.metric[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.metric b { font-size: 26px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 13px; }

.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.tools input { flex: 1 1 240px; width: auto; }
.tools select { flex: 0 1 200px; width: auto; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: 12px; color: var(--muted); background: var(--sunken); white-space: nowrap; }
td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover { background: #faf9f5; }
.name-btn { padding: 0; border: 0; background: none; font-weight: 700; text-align: left; cursor: pointer; color: var(--ink); }
.sub { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.flag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 700; }
.late { color: var(--danger); font-weight: 700; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-novi { background: var(--blue-soft); color: var(--blue); }
.st-kontaktiran { background: var(--accent-soft); color: var(--accent); }
.st-poziv { background: var(--violet-soft); color: var(--violet); }
.st-probni { background: var(--warn-soft); color: var(--warn); }
.st-kupio { background: var(--ok-soft); color: var(--ok); }
.st-odustao, .st-odbijen { background: var(--grey-soft); color: var(--muted); }

dialog { padding: 0; border: 0; color: var(--ink); }
dialog::backdrop { background: rgba(20, 30, 30, 0.42); }
dialog.drawer { width: min(680px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0 0 0 auto; background: var(--paper); }
dialog.modal { width: min(480px, calc(100vw - 32px)); border-radius: 12px; background: var(--surface); }
.modal-body { display: grid; gap: 12px; padding: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.secret { padding: 10px; background: var(--sunken); border-radius: 6px; font-family: Consolas, monospace; overflow-wrap: anywhere; user-select: all; }

.drawer-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 19px; overflow-wrap: anywhere; }
.saved { min-width: 72px; color: var(--ok); font-size: 13px; font-weight: 600; text-align: right; }
.saved.bad { color: var(--danger); }
.drawer-body { display: grid; gap: 14px; padding: 16px 20px 32px; }
.panel { display: grid; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h3 { font-size: 13px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.review { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.review .btn { flex: none; }
.quick { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; }
.message { white-space: pre-wrap; overflow-wrap: anywhere; }

.panel-form { display: grid; gap: 10px; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13px; }
.timeline .meta b { color: var(--ink); }
.timeline .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline .system .body { color: var(--muted); font-size: 14px; }

.danger-zone { display: flex; justify-content: flex-end; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr 140px auto; gap: 10px; align-items: end; padding: 14px; border-bottom: 1px solid var(--line); }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Raširen kontakt u listi */
tbody tr.row.open { background: var(--accent-soft); }
tbody tr.row.open:hover { background: var(--accent-soft); }
tbody tr.row.open td { border-top: 2px solid var(--accent); }
tr.detail-row > td.detail-cell { padding: 0; border-top: 0; background: var(--paper); }
.detail { margin: 0 0 14px; border-left: 3px solid var(--accent); background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }
.detail-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.detail-head .saved { margin-left: auto; }
.tabs { display: flex; gap: 2px; overflow-x: auto; }
.tabs button { position: relative; padding: 12px 14px; border: 0; background: none; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.tabs .count { margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--sunken); color: var(--muted); font-size: 12px; }
.detail-body { display: grid; gap: 14px; padding: 16px 18px 20px; max-width: 900px; }
.detail-loading { padding: 16px 18px; }
.panel-actions { display: flex; justify-content: flex-end; }
.activity-form { padding: 14px; background: var(--sunken); border-radius: var(--radius); }
.activity-form h3 { font-size: 13px; color: var(--muted); }
.last-activity { padding: 10px 12px; background: var(--sunken); border-radius: 6px; }
.last-activity .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 13px; }
.last-activity .meta b { color: var(--ink); }
.last-activity .body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Finansije */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.kpi { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi b { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpis.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.small .kpi b { font-size: 18px; }
.kpi.pos { background: var(--ok-soft); border-color: transparent; }
.kpi.pos b { color: var(--ok); }
.kpi.neg { background: var(--danger-soft); border-color: transparent; }
.kpi.neg b { color: var(--danger); }
.fin-section { display: grid; gap: 6px; margin-top: 22px; min-width: 0; }
.fin-section h2 { font-size: 17px; }
.fin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
label.check input { width: 18px; min-height: 18px; flex: none; }
[hidden] { display: none !important; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fin-settings { margin-top: 28px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fin-settings summary { cursor: pointer; font-weight: 700; }
.fin-settings form { margin-top: 12px; }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.spaced { margin-bottom: 12px; }
tr.muted td { color: var(--muted); }
.kpi.warn { background: var(--warn-soft); border-color: transparent; }
.kpi.warn b { color: var(--warn); }
.pending { color: var(--warn); font-weight: 700; }
fieldset.bank-box, fieldset.plain-box { display: grid; gap: 10px; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
fieldset.bank-box { border-color: var(--accent); background: var(--accent-soft); }
fieldset legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
fieldset.bank-box legend { color: var(--accent); }
.kind-prodaja { background: var(--ok-soft); color: var(--ok); }
.kind-produzenje { background: var(--blue-soft); color: var(--blue); }
.kind-povracaj { background: var(--danger-soft); color: var(--danger); }
.tools .hint { white-space: nowrap; }
.tools input[type="date"] { flex: 0 1 180px; }

@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-grid, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  table.cards td.num { text-align: right; }
  table.cards tr.detail-row { margin-top: -10px; padding: 0; border: 0; background: none; }
  table.cards td.detail-cell { display: block; text-align: left; }
  table.cards td.detail-cell::before { content: none; }
  table.cards tr.row.open { border-color: var(--accent); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  table.cards tr.row.open td { border-top: 0; }
  .detail { border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
  .detail-head { padding: 0 6px; }
  .detail-body { padding: 14px; }
  .top { flex-wrap: wrap; gap: 6px 12px; padding: 8px 16px; }
  .top nav { order: 3; flex-basis: 100%; }
  .who { margin-left: auto; }
  main { padding: 16px 16px 40px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools input, .tools select { flex: 1 1 100%; width: 100%; }
  .table-wrap { background: none; border: 0; overflow: visible; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { margin-bottom: 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
  table.cards td { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border: 0; text-align: right; }
  table.cards td > * { min-width: 0; }
  table.cards td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 13px; text-align: left; }
  table.cards td.primary { display: block; text-align: left; }
  table.cards td.primary::before { content: none; }
  .grid-2, .inline-form { grid-template-columns: minmax(0, 1fr); }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .review { align-items: stretch; flex-direction: column; }
}

/* Banka na kupovini */
.btn.small { padding: 4px 10px; font-size: 13px; min-height: 0; }
.bank-btn { white-space: nowrap; border-color: var(--warn); color: var(--warn); }
.bank-done { display: inline-flex; align-items: center; gap: 10px; justify-content: flex-end; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.bank-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Početna */
.brand-btn { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; font: inherit; font-size: 18px; font-weight: 700; }
.crumbs { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.crumbs .back { padding: 6px 10px; }
.crumb { font-weight: 700; color: var(--ink, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-section { margin-bottom: 22px; }
.home-section h2 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.home-section .kpis { margin-bottom: 0; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi-link { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.kpi-link:hover { border-color: var(--accent); }
.kpi-link:focus-visible, .page-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.page-card { display: grid; gap: 4px; padding: 14px 16px; text-align: left; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.page-card:hover { border-color: var(--accent); }
.page-card b { font-size: 16px; color: var(--accent); }
.page-card span { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) {
  .page-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-section .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .crumbs { order: 3; flex-basis: 100%; }
}

.home-section .kpi b { font-size: clamp(17px, 2vw, 22px); }

.forgot { margin-top: 4px; font-size: 14px; }
.forgot summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.forgot p { margin-top: 8px; }
.forgot code { font-size: 12px; background: var(--accent-soft); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }

/* Prilozi na aktivnostima */
.attach-field input[type=file] { padding: 6px 0; border: 0; background: none; font-size: 13px; max-width: 100%; }
.attachments { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.timeline .attachments li { padding: 0; border-top: 0; }
.att { position: relative; display: flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--sunken); }
.att-open { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; color: var(--ink); text-decoration: none; font-size: 13px; }
.att-open:hover .att-name { text-decoration: underline; }
.att-ext { flex: none; padding: 2px 5px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.att-size { flex: none; color: var(--muted); }
.att.has-thumb .att-open { flex-direction: column; align-items: flex-start; gap: 4px; padding: 6px; width: 140px; }
.att.has-thumb img { display: block; width: 128px; height: 96px; object-fit: cover; border-radius: 4px; background: var(--line); }
.att.has-thumb .att-name { max-width: 128px; }
.att-del { flex: none; width: 28px; min-height: 30px; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); font-size: 16px; cursor: pointer; border-radius: 0 6px 6px 0; }
.att.has-thumb .att-del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; line-height: 1; }
.att-del:hover { color: var(--danger, #b42318); }
.att.has-thumb .att-del:hover { color: #fff; background: rgba(180,35,24,.9); }
.att-add { margin-top: 6px; }

/* ===================== Dizajn v2: ozbiljniji CRM izgled ===================== */
h1, h2, .page-head h1 { font-family: var(--font-display); letter-spacing: -0.02em; }
.icon { flex: none; display: block; }
::selection { background: rgba(14, 124, 114, 0.18); }

/* Dugmad i polja */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 7px 14px; border-color: var(--line-strong); border-radius: 8px; box-shadow: var(--shadow-sm); font-weight: 600; font-size: 14px; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: var(--line-strong); background: var(--sunken); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); box-shadow: 0 1px 2px rgba(10, 106, 97, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.quiet { box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
:focus-visible { outline: none; box-shadow: var(--ring); }
input, select, textarea { border-color: var(--line-strong); border-radius: 8px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #b6c0cb; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #8a96a3; }
label.field { font-size: 12.5px; color: #44505e; }

/* Zaglavlje */
.top { gap: 20px; min-height: 58px; padding: 0 24px; background: linear-gradient(180deg, var(--nav-2), var(--nav)); border-bottom: 0; box-shadow: 0 6px 18px rgba(12, 26, 38, .18); color: #e6edf3; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #19a596, #0b6b62); color: #fff; font-family: var(--font-display); font-size: 16px; font-weight: 800; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.25); }
.brand-btn { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; }
.brand-btn .brand-name span { color: #5fd6c8; font-weight: 600; }
.crumbs { gap: 6px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.12); }
.crumb-link, .crumb { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 0; border-radius: 7px; background: none; color: #a9b8c6; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; }
.crumb-link { cursor: pointer; transition: background-color .15s, color .15s; }
.crumb-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.crumb-link.here, .crumb { color: #fff; background: rgba(255,255,255,.08); }
.crumb-sep { color: #5d7183; }
.who { gap: 10px; color: #c7d3de; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #23455c; color: #dff5f1; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px rgba(95, 214, 200, .35); }
.who-name { display: grid; line-height: 1.2; color: #fff; font-size: 13.5px; font-weight: 600; margin-right: 6px; }
.who-name small { color: #8ea1b3; font-size: 11.5px; font-weight: 500; }
.top .btn.quiet { min-height: 34px; padding: 6px 10px; color: #b9c7d4; }
.top .btn.quiet:hover { background: rgba(255,255,255,.08); color: #fff; }

/* Strana */
main { padding-top: 28px; animation: rise .28s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.eyebrow { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; margin-bottom: 2px; }
.eyebrow::first-letter { text-transform: uppercase; }
.home-section { margin-bottom: 28px; }
.home-section h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .07em; color: #6b7886; }
.home-section h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.access-section h2, .fin-section h2 { font-size: 16px; font-weight: 700; }

/* Kartice sa brojevima: oznaka iznad, broj ispod */
.kpis, .metrics { gap: 12px; }
.kpi, .metric { position: relative; gap: 4px; padding: 14px 16px 15px; border-color: var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi span, .metric span { order: -1; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi b, .metric b { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.metric b { font-size: 26px; }
.kpi-link:hover, .metric:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.metric[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); }
.kpi::before, .metric::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.kpi.pos, .kpi.neg, .kpi.warn { background: var(--surface); border-color: var(--line); }
.kpi.pos::before { background: var(--ok); }
.kpi.neg::before { background: var(--danger); }
.kpi.warn::before { background: #d98a0b; }
.kpi.pos b { color: var(--ok); }
.kpi.neg b { color: var(--danger); }
.kpi.warn b { color: var(--warn); }

/* Kartice stranica */
.page-grid { gap: 12px; }
.page-card { grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: center; padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.page-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.page-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); transition: background-color .15s, color .15s; }
.page-card:hover .page-icon { background: var(--accent); color: #fff; }
.page-card b { font-size: 15px; color: var(--ink); }
.page-card span:not(.page-icon) { grid-column: 2; font-size: 12.5px; line-height: 1.4; }

/* Tabele */
.table-wrap { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
th { padding: 10px 14px; background: #f7f9fb; border-bottom: 1px solid var(--line); color: #6b7886; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
td { padding: 12px 14px; border-top-color: #edf0f4; }
tbody tr:first-child td { border-top: 0; }
tbody tr.row { transition: background-color .12s; }
tbody tr.row:hover { background: #f6f9fb; }
.name-btn { font-weight: 650; }
.tools { gap: 10px; margin-bottom: 14px; }
.empty { padding: 44px 16px; }

/* Oznake faze */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; font-size: 12.5px; font-weight: 600; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.flag { padding: 1px 6px; border-radius: 5px; font-size: 11.5px; }

/* Raširen kontakt */
tbody tr.row.open, tbody tr.row.open:hover { background: #eef7f5; }
.detail { margin: 0 0 16px; box-shadow: inset 0 -1px 0 var(--line), 0 8px 18px -12px rgba(15, 28, 43, .25); }
.tabs button { padding: 13px 14px 12px; font-size: 14px; transition: color .15s; }
.tabs button[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--accent); }
.tabs .count { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.timeline li { padding: 12px 0; }
.activity-form, .last-activity { background: #f6f8fa; border: 1px solid var(--line); }

/* Prozori */
dialog::backdrop { background: rgba(10, 22, 33, .45); backdrop-filter: blur(3px); }
dialog.modal { border-radius: 14px; box-shadow: var(--shadow-lg); }
dialog.drawer { box-shadow: var(--shadow-lg); }
dialog.modal[open] { animation: pop .18s ease-out; }
dialog.drawer[open] { animation: slide .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.panel, .fin-settings { border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Prijava */
.auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); place-items: stretch; padding: 0; }
.auth-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 40px 48px; color: #dbe6ee; overflow: hidden;
  background: radial-gradient(900px 500px at 110% -10%, rgba(25, 165, 150, .35), transparent 60%), radial-gradient(700px 420px at -20% 120%, rgba(37, 87, 163, .35), transparent 60%), linear-gradient(160deg, #13293a, #0b1823); }
.auth-brand::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 32px 32px; -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); pointer-events: none; }
.auth-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.auth-logo b { color: #5fd6c8; font-weight: 600; }
.auth-copy { position: relative; z-index: 1; max-width: 460px; }
.auth-copy h1 { color: #fff; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; font-weight: 700; }
.auth-copy p { margin-top: 14px; color: #a9bccb; font-size: 15.5px; }
.auth-foot { position: relative; z-index: 1; color: #6f8597; font-size: 13px; }
.auth form { align-self: center; justify-self: center; width: min(400px, calc(100% - 32px)); margin: 40px 0; gap: 16px; padding: 32px; border-color: var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: rise .3s ease-out both; }
.auth-head h2 { font-size: 22px; font-weight: 700; }
.auth-head .hint { margin-top: 4px; }
.auth form .btn.primary { min-height: 42px; }

/* Prilozi */
.att { border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.att:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.att-ext { background: #3b5266; }

@media (max-width: 760px) {
  .top { min-height: 0; padding: 10px 16px; gap: 8px 12px; }
  .crumbs { padding-left: 0; border-left: 0; }
  .who-name, .icon-btn span { display: none; }
  .top .btn.quiet { padding: 6px 8px; }
  main { padding-top: 20px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 22px 20px; gap: 14px; }
  .auth-copy h1 { font-size: 22px; }
  .auth-copy p, .auth-foot { display: none; }
  .auth form { margin: 20px 0 32px; padding: 24px 20px; }
  table.cards tr { box-shadow: var(--shadow-sm); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Stari stilovi navigacije ne smeju da boje novo zaglavlje */
.brand .logo, .brand-btn .logo { color: #fff; }
.top .crumbs button[aria-current="page"], .top .crumbs .crumb-link.here { color: #fff; background: rgba(255,255,255,.08); }
.top .crumbs button { color: #a9b8c6; }
.top .crumbs button:hover { color: #fff; background: rgba(255,255,255,.08); }
.brand-btn .brand-name { color: #fff; }
.page-head .btn { white-space: nowrap; flex: none; }
@media (max-width: 760px) { .page-head h1 { font-size: 21px; } }
