/* ==========================================================================
   ALEA Partners — tamna tema
   Pozadinska slika: public/img/pozadina.jpg (zamjenjiva bez diranja koda)
   ========================================================================== */

:root {
  color-scheme: dark;   /* checkbox, select, datum i skrol traka u tamnoj varijanti */
  --bg: #0d0e10;
  --surface: rgba(28, 30, 34, .78);
  --surface-solid: #1c1e22;
  --surface-2: rgba(255, 255, 255, .045);
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .20);
  --text: #e9ebee;
  --text-soft: #c2c7ce;
  --muted: #949aa3;
  --accent: #cfd4da;          /* srebro — glavni akcenat */
  --accent-dark: #9fb6cc;     /* linkovi */
  --focus: #7fa9cd;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 14px 34px -14px rgba(0,0,0,.85);
  --silver: linear-gradient(180deg, #ffffff 0%, #dfe3e8 45%, #a7aeb7 55%, #e9ecef 100%);

  --st-pregovori-bg: rgba(148,163,184,.16);   --st-pregovori-fg: #cbd5e1;   --st-pregovori-bd: rgba(203,213,225,.28);
  --st-potpis-bg: rgba(59,130,246,.16);       --st-potpis-fg: #93c5fd;      --st-potpis-bd: rgba(147,197,253,.30);
  --st-dokumentacija-bg: rgba(34,197,94,.15); --st-dokumentacija-fg: #86efac; --st-dokumentacija-bd: rgba(134,239,172,.28);
  --st-partner-bg: rgba(234,179,8,.16);       --st-partner-fg: #fbdc63;      --st-partner-bd: rgba(250,204,21,.30);
  --st-nas-bg: rgba(249,115,22,.16);          --st-nas-fg: #fdba74;         --st-nas-bd: rgba(253,186,116,.30);
  --st-extra-bg: rgba(239,68,68,.16);         --st-extra-fg: #fca5a5;       --st-extra-bd: rgba(252,165,165,.30);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 48px;
  min-height: 100vh;
}

/* fiksna ALEA pozadina — u aplikaciji je jako prigušena da podaci ostanu čitljivi */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background: #0d0e10 url("img/pozadina.jpg") center center / cover no-repeat;
  opacity: .38;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(13,14,16,.55) 0%, rgba(13,14,16,.86) 55%, rgba(8,9,10,.96) 100%);
}

a { color: var(--accent-dark); }

::selection { background: rgba(159,182,204,.35); }

/* ---------- ALEA logo ---------- */
.alea-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.alea-mark { flex: none; display: block; }
.alea-word { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.alea-word .w1 {
  font-size: 22px; font-weight: 350; letter-spacing: .01em;
  background: var(--silver); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.alea-word .w2 {
  font-size: 9.5px; letter-spacing: .42em; color: #b6bcc4; margin-top: 3px; font-weight: 500;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(12, 13, 15, .88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.09);
  color: var(--text);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 11px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; font-weight: 600; letter-spacing: -.01em; min-width: 0; font-size: 14.5px; }
.brand-text small { font-weight: 400; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }
.brand-sep { width: 1px; align-self: stretch; background: rgba(255,255,255,.14); margin: 2px 2px; flex: none; }

.topnav { display: flex; gap: 4px; margin-left: 14px; flex-wrap: wrap; min-width: 0; }
.topnav a {
  color: #9aa1aa; text-decoration: none; font-size: 14px; font-weight: 550;
  padding: 7px 13px; border-radius: 9px; white-space: nowrap;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.topnav a.active { color: #fff; background: rgba(255,255,255,.13); box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); }
.nav-count {
  display: inline-block; margin-left: 6px; padding: 1px 7px;
  border-radius: 999px; background: #d8dce1; color: #14161a;
  font-size: 11.5px; font-weight: 700; line-height: 1.5;
}

.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.user-chip {
  color: var(--text-soft); font-size: 13px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.13); white-space: nowrap;
}

/* ---------- zaglavlje na užim ekranima ---------- */
@media (max-width: 980px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; padding: 10px 14px; }
  .brand-text small { display: none; }
  .user-chip { display: none; }
  .topnav { order: 3; width: 100%; margin-left: 0; }
  .topnav a { flex: 1; text-align: center; padding: 7px 10px; font-size: 13px; }
  .topbar-actions { margin-left: auto; }
  .topbar-actions .btn { padding: 7px 11px; font-size: 13px; }
}

@media (max-width: 660px) {
  .brand-text, .brand-sep { display: none; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .topbar-actions .btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 400px) {
  .alea-word .w1 { font-size: 18px; }
  .alea-word .w2 { font-size: 8.5px; letter-spacing: .3em; }
  .brand-mark { width: 28px; height: 28px; }
  .topbar-inner { padding: 9px 10px; }
  .wrap { padding: 14px 10px; }
  .topbar-actions .btn { padding: 7px 9px; font-size: 12.5px; }
  .topnav a { padding: 6px 8px; font-size: 12.5px; }
}

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 550; font-size: 14px;
  border-radius: 9px; padding: 8px 14px;
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
}
.btn-primary {
  background: linear-gradient(180deg, #f2f4f6, #c9ced5);
  color: #15171a; border-color: rgba(255,255,255,.5);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 4px 14px -6px rgba(0,0,0,.7);
}
.btn-primary:hover { background: linear-gradient(180deg, #ffffff, #dde1e6); }
.btn-ghost { background: rgba(255,255,255,.07); color: var(--text-soft); border-color: rgba(255,255,255,.15); }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-light { background: rgba(255,255,255,.08); color: var(--text); border-color: var(--border-strong); }
.btn-light:hover { background: rgba(255,255,255,.15); }
.btn-danger { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(252,165,165,.32); }
.btn-danger:hover { background: rgba(239,68,68,.28); color: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px; border-radius: 8px;
}
.icon-btn:hover { color: #fff; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 20px; }

.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; font-weight: 600; }
.page-head .sub { color: var(--muted); font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  border-left: 4px solid var(--border-strong); transition: box-shadow .12s, background .12s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.stat:hover { box-shadow: var(--shadow); background: rgba(40,43,48,.82); }
.stat.active { outline: 2px solid var(--accent); outline-offset: -1px; }
a.stat { display: block; text-decoration: none; color: inherit; }
.stat b { display: block; font-size: 22px; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12.5px; }

/* ---------- filters ---------- */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.filters input[type=search], .filters select {
  font: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: rgba(0,0,0,.34); color: var(--text);
  min-width: 0;
}
.filters input[type=search] { flex: 1 1 220px; }
.filters select { flex: 0 1 190px; }
.filters .clear { margin-left: auto; }
.filters select option { background: #1c1e22; color: var(--text); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.st-pregovori { background: var(--st-pregovori-bg); color: var(--st-pregovori-fg); border-color: var(--st-pregovori-bd); }
.st-potpis_ugovora { background: var(--st-potpis-bg); color: var(--st-potpis-fg); border-color: var(--st-potpis-bd); }
.st-poslata_dokumentacija { background: var(--st-dokumentacija-bg); color: var(--st-dokumentacija-fg); border-color: var(--st-dokumentacija-bd); }
.st-cekanje_partner { background: var(--st-partner-bg); color: var(--st-partner-fg); border-color: var(--st-partner-bd); }
.st-cekanje_nas { background: var(--st-nas-bg); color: var(--st-nas-fg); border-color: var(--st-nas-bd); }
.st-extra_zahtjev { background: var(--st-extra-bg); color: var(--st-extra-fg); border-color: var(--st-extra-bd); }

.bar-pregovori { border-left-color: var(--st-pregovori-fg); }
.bar-potpis_ugovora { border-left-color: var(--st-potpis-fg); }
.bar-poslata_dokumentacija { border-left-color: var(--st-dokumentacija-fg); }
.bar-cekanje_partner { border-left-color: var(--st-partner-fg); }
.bar-cekanje_nas { border-left-color: var(--st-nas-fg); }
.bar-extra_zahtjev { border-left-color: var(--st-extra-fg); }
.bar-all { border-left-color: var(--accent); }

.chip {
  display: inline-block; padding: 2px 9px; border-radius: 7px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-soft); white-space: nowrap;
}
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* faze instalacija i featura */
.ph-u_razvoju { background: rgba(148,163,184,.15); color: #c7ced8; border-color: rgba(203,213,225,.26); }
.ph-integracija { background: rgba(59,130,246,.16); color: #93c5fd; border-color: rgba(147,197,253,.30); }
.ph-testiranje { background: rgba(234,179,8,.16); color: #fbdc63; border-color: rgba(250,204,21,.30); }
.ph-produkcija { background: rgba(34,197,94,.15); color: #86efac; border-color: rgba(134,239,172,.28); }

.bar-u_razvoju { border-left-color: #94a3b8; }
.bar-integracija { border-left-color: #60a5fa; }
.bar-testiranje { border-left-color: #eab308; }
.bar-produkcija { border-left-color: #22c55e; }

.ch-online { background: rgba(56,189,248,.15); color: #7dd3fc; border-color: rgba(125,211,252,.28); }
.ch-landbase { background: rgba(168,85,247,.16); color: #d8b4fe; border-color: rgba(216,180,254,.28); }

/* ko blokira integraciju */
.wt-partner { background: rgba(234,179,8,.16); color: #fbdc63; border-color: rgba(250,204,21,.30); }
.wt-klijent { background: rgba(234,179,8,.16); color: #fbdc63; border-color: rgba(250,204,21,.30); }
.wt-mi { background: rgba(249,115,22,.16); color: #fdba74; border-color: rgba(253,186,116,.30); }

.pri-visok { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(252,165,165,.30); }
.pri-srednji { background: rgba(234,179,8,.16); color: #fbdc63; border-color: rgba(250,204,21,.30); }
.pri-nizak { background: rgba(148,163,184,.15); color: #c7ced8; border-color: rgba(203,213,225,.26); }
.rs-otvoren { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(252,165,165,.30); }
.rs-u_toku { background: rgba(234,179,8,.16); color: #fbdc63; border-color: rgba(250,204,21,.30); }
.rs-rijesen { background: rgba(34,197,94,.15); color: #86efac; border-color: rgba(134,239,172,.28); }

.dir { background: rgba(56,189,248,.14); color: #7dd3fc; border-color: rgba(125,211,252,.26); }

/* ---------- table (desktop) ---------- */
.table-wrap { overflow-x: auto; }
table.clients { width: 100%; border-collapse: collapse; background: transparent; }
table.clients th, table.clients td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.clients th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); background: rgba(18,19,22,.94); font-weight: 650;
  position: sticky; top: 0; backdrop-filter: blur(6px);
}
table.clients tbody tr { cursor: pointer; }
table.clients tbody tr:hover { background: rgba(255,255,255,.05); }
table.clients tbody tr:last-child td { border-bottom: none; }
table.clients td:first-child { min-width: 158px; }
.cell-name { font-weight: 600; }
.cell-name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cell-note { color: var(--muted); font-size: 13px; max-width: 340px; }

.cards { display: none; }

.dash { color: #6f767f; }
.warn-inline { color: #f87171; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; }
.empty-guide {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px; margin: 26px auto 0; max-width: 760px; text-align: left;
}
.empty-guide div {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 11px 13px;
}
.empty-guide strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.empty-guide span { font-size: 13px; line-height: 1.45; }

/* ---------- detail ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 12px; }
.back-link:hover { color: #fff; }

.detail-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.detail-head h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.02em; font-weight: 600; }
.detail-head .meta { color: var(--muted); font-size: 14px; display: flex; gap: 12px; flex-wrap: wrap; }
.detail-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.callout {
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid; font-size: 14.5px;
}
.callout b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; margin-bottom: 3px; }

.grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

section.panel { margin-bottom: 16px; }
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; font-weight: 600; }
.panel-head .count { color: var(--muted); font-size: 13px; font-weight: 500; }
.panel-head .btn { margin-left: auto; }
.panel-body { padding: 6px 16px 14px; }
.panel-body.tight { padding: 0; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; padding: 14px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.item { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: none; }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-head strong { font-size: 14.5px; }
.item-head .spacer { margin-left: auto; }
.item p { margin: 6px 0 0; color: var(--text-soft); font-size: 14px; white-space: pre-wrap; }
.item .when { color: var(--muted); font-size: 12.5px; }
.item.resolved { opacity: .55; }
.item-actions { display: flex; gap: 4px; }

.timeline { padding: 6px 16px 14px; margin: 0; list-style: none; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid var(--border); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong);
  border: 2px solid #16181b;
}
.timeline li.latest::before { background: var(--accent); }
.timeline .when { color: var(--muted); font-size: 12.5px; display: block; margin-top: 3px; }
.timeline p { margin: 5px 0 0; font-size: 13.5px; color: var(--text-soft); white-space: pre-wrap; }

.link-out { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; word-break: break-all; }

.muted-empty { color: var(--muted); font-size: 14px; padding: 14px 16px; }

/* ---------- instalacije ---------- */
.subhead {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px 6px; font-size: 11.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: rgba(255,255,255,.035); border-bottom: 1px solid var(--border);
}
.inst { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.inst:last-child { border-bottom: none; }
.inst-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inst-head strong { font-size: 15px; }
.inst-head .spacer { margin-left: auto; }
.inst-meta { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.inst-note { margin: 6px 0 0; color: var(--text-soft); font-size: 13.5px; white-space: pre-wrap; }

.feat-list { margin: 9px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.feat {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 10px; font-size: 13.5px;
}
.feat .spacer { margin-left: auto; }
.feat-note { color: var(--muted); font-size: 12.5px; flex-basis: 100%; }
.feat-add { margin-top: 8px; }

/* ---------- nalozi i lozinke ---------- */
.account {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px; margin-top: 7px;
}
.account-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; }
.account-row .spacer { margin-left: auto; }
.cred {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; background: rgba(0,0,0,.4); border: 1px solid var(--border-strong);
  border-radius: 7px; padding: 3px 8px; word-break: break-all; color: #dfe3e8;
}
.pw-hidden { letter-spacing: .18em; color: var(--muted); }

.site-block { padding: 13px 16px; border-bottom: 1px solid var(--border); }
.site-block:last-child { border-bottom: none; }

/* ---------- početna ---------- */
.home-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }

.mini { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.mini:last-child { border-bottom: none; }
.mini-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-head strong { font-size: 14.5px; }
.mini-head .spacer { margin-left: auto; }
.mini p { margin: 5px 0 0; color: var(--text-soft); font-size: 13.5px; }
.mini .when { color: var(--muted); font-size: 12.5px; }
.mini a { color: inherit; text-decoration: none; }
.mini a:hover { text-decoration: underline; }

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px; }
.pill {
  display: flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-size: 13px; background: rgba(255,255,255,.04);
}
.pill b { font-size: 15px; }

/* ---------- certifikati ---------- */
.cs-nedostaje { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(252,165,165,.30); }

/* ---------- oznake uz igru ---------- */
.game-chip { display: inline-flex; align-items: center; gap: 6px; }
.game-chip.is-live { background: rgba(34,197,94,.12); border-color: rgba(134,239,172,.30); }
[data-toggle-live] { cursor: pointer; }
[data-toggle-live]:hover { border-color: var(--accent); }

/* tačkica: puštena kod partnera */
.ic-live { font-size: 11px; line-height: 1; font-weight: 700; }
.ic-live.on { color: #4ade80; font-size: 13px; }
.ic-live.off { color: #f87171; }

/* slovo C: certifikat za zemlje tog klijenta */
.ic-cert {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 4px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0;
}
.ic-cert.ok { background: #dfe3e8; color: #15171a; }
.ic-cert.no { background: #dc2626; color: #fff; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; align-items: center; }
.legend span.item { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: none; }

/* matrica igra × zemlja — ostaje vidljiva i na telefonu, samo se skroluje */
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.cert-matrix { width: 100%; border-collapse: collapse; background: transparent; }
table.cert-matrix th, table.cert-matrix td {
  padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--border);
}
table.cert-matrix th {
  font-size: 11.5px; letter-spacing: .05em; color: var(--muted);
  background: rgba(18,19,22,.96); font-weight: 650; position: sticky; top: 0;
}
table.cert-matrix td:first-child, table.cert-matrix th:first-child {
  text-align: left; min-width: 160px; position: sticky; left: 0; background: #1a1c20;
}
table.cert-matrix th:first-child { background: #121316; }
table.cert-matrix tbody tr:hover td { background: rgba(255,255,255,.05); }
table.cert-matrix tbody tr:hover td:first-child { background: #24272c; }

.cert-cell {
  width: 34px; height: 30px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: rgba(0,0,0,.3);
  color: var(--muted); font-size: 15px; font-weight: 700; line-height: 1;
}
.cert-cell:hover { border-color: var(--accent); color: #fff; }
.cert-cell.has { background: rgba(34,197,94,.20); border-color: rgba(134,239,172,.45); color: #86efac; }
.cell-warn { font-size: 10.5px; color: #fca5a5; margin-top: 2px; }

/* ---------- koraci integracije ---------- */
.progress-bar {
  height: 7px; border-radius: 999px; background: rgba(255,255,255,.10);
  overflow: hidden; margin: 9px 0 2px;
}
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, #4ade80, #22c55e); border-radius: 999px; }
.step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.step:last-child { border-bottom: none; }
.step.done .step-name { text-decoration: line-through; color: var(--muted); }
.step-name { flex: 1; min-width: 0; }
.step .when { color: var(--muted); font-size: 12px; }

/* ---------- upozorenje o certifikatima u modalu ---------- */
.warn-box {
  background: rgba(234,179,8,.13); border: 1px solid rgba(250,204,21,.32); color: #fde68a;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: 14px;
}
.warn-box ul { margin: 8px 0 0; padding-left: 20px; }
.warn-box li { margin-bottom: 3px; }

/* ---------- izvještaj ---------- */
.report {
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 30px; box-shadow: var(--shadow);
}
.report h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.report .rep-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.report h2 { font-size: 15px; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--border); font-weight: 600; }
.report table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report th, .report td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
.report th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.report .rep-note { color: var(--muted); font-size: 12.5px; }

@media (max-width: 760px) {
  table.cert-matrix th, table.cert-matrix td { padding: 7px 6px; }
  table.cert-matrix td:first-child, table.cert-matrix th:first-child { min-width: 132px; font-size: 13px; }
  .cert-cell { width: 30px; height: 28px; }

  .report { padding: 16px 14px; }
  .report table { display: block; overflow-x: auto; font-size: 12.5px; }
  .report th, .report td { padding: 6px 7px; }
}

/* ---------- štampa: uvijek na bijelom ---------- */
@media print {
  .topbar, .quick-add, .daybar, .filters, .btn, .toast, .modal-backdrop { display: none !important; }
  body { background: #fff !important; padding: 0; }
  body, body * { color: #0f172a !important; }
  body::before, body::after { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .report {
    border: none; box-shadow: none; padding: 0;
    background: #fff !important;
  }
  .report h2, .report th, .report td, .report table { border-color: #cbd5e1 !important; }
  .report .rep-sub, .report .rep-note, .report th,
  .page-head .sub, .cell-note, .muted-empty, .when { color: #52606d !important; }
  .badge, .chip, .pill {
    border-color: #cbd5e1 !important; color: #0f172a !important; background: #f1f5f9 !important;
  }
  .badge::before { background: #64748b !important; }
  .report h2 { break-after: avoid; }
  .report tr { break-inside: avoid; }
}

/* ---------- obaveze ---------- */
.daybar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.daybar .today-label { font-weight: 650; font-size: 15px; }
.daybar .today-sub { color: var(--muted); font-size: 13px; }
.daybar input[type=date] {
  font: inherit; font-size: 14px; padding: 7px 9px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: rgba(0,0,0,.34); color: var(--text);
}
.daybar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.quick-add { display: flex; gap: 8px; margin-bottom: 16px; }
.quick-add input {
  flex: 1; font: inherit; font-size: 15px; padding: 12px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: rgba(0,0,0,.4); color: var(--text); box-shadow: var(--shadow);
}
.quick-add input::placeholder { color: #7e858e; }
.quick-add input:focus { outline: 2px solid var(--focus); outline-offset: -1px; }

.task {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.task:last-child { border-bottom: none; }
.task-check {
  width: 21px; height: 21px; flex: none; margin-top: 1px;
  border: 2px solid var(--border-strong); border-radius: 6px;
  background: rgba(0,0,0,.3); cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; color: #0d0e10;
}
.task-check:hover { border-color: var(--accent); }
.task-check.done { background: #4ade80; border-color: #4ade80; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14.5px; font-weight: 550; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.task-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.task-note { margin: 5px 0 0; font-size: 13.5px; color: var(--text-soft); white-space: pre-wrap; }
.task-actions { display: flex; gap: 4px; flex: none; }

.carried { background: rgba(239,68,68,.16); color: #fca5a5; border-color: rgba(252,165,165,.30); }
.carried-soft { background: rgba(249,115,22,.16); color: #fdba74; border-color: rgba(253,186,116,.30); }

@media (max-width: 760px) {
  .task { flex-wrap: wrap; }
  .task-actions { width: 100%; justify-content: flex-end; }
  .daybar .right { width: 100%; margin-left: 0; }
  .daybar .right .btn { flex: 1; justify-content: center; }
}

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 7, 8, .72);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: #1c1e22; border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; width: 100%; max-width: 620px;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 30px 70px -14px rgba(0,0,0,.85);
}
.modal-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot {
  border-top: 1px solid var(--border); padding: 12px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.modal-foot-btns { margin-left: auto; display: flex; gap: 8px; }
.modal-error { color: #fca5a5; font-size: 13.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-soft); }
.field label .req { color: #f87171; }
.field input[type=text], .field input[type=date], .field input[type=url], .field input[type=email],
.field input[type=password], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 14.5px; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: rgba(0,0,0,.38); color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: #7e858e; }
.field select option { background: #1c1e22; color: var(--text); }
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 6px; }
.game-opt {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: 9px; cursor: pointer;
  font-size: 14px; background: rgba(0,0,0,.28); user-select: none; color: var(--text);
}
.game-opt:hover { background: rgba(255,255,255,.07); }
.game-opt input { margin: 0; accent-color: #cfd4da; }
.game-opt.checked { border-color: var(--accent); background: rgba(255,255,255,.10); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #e9ebee; color: #14161a; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 550; z-index: 80; box-shadow: 0 12px 34px -10px rgba(0,0,0,.9);
}
.toast.err { background: #dc2626; color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .wrap { padding: 16px 14px; }
  .topbar-inner { padding: 10px 14px; }
  .inst-head .spacer, .feat .spacer, .account-row .spacer { flex-basis: 100%; margin: 0; height: 0; }
  .inst-head .item-actions, .feat .item-actions, .account-row .item-actions { margin-left: auto; }
  .table-wrap { display: none; }
  .cards { display: grid; gap: 10px; }

  .client-card {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
    border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow);
    cursor: pointer; display: block; text-align: left; font: inherit; width: 100%; color: var(--text);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .client-card h3 { margin: 0 0 2px; font-size: 16px; letter-spacing: -.01em; }
  .client-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 9px; }
  .client-card .note { color: var(--muted); font-size: 13px; margin-top: 9px; }
  .client-card .chips { margin-top: 9px; }

  .item-head { row-gap: 6px; }
  .item-head .spacer { flex-basis: 100%; margin: 0; height: 0; }
  .item-head .item-actions { margin-left: auto; }

  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 9px 10px; border-left-width: 3px; }
  .stat b { font-size: 18px; }
  .stat span { font-size: 11.5px; line-height: 1.35; display: block; }

  .filters select, .filters input[type=search] { flex: 1 1 100%; }
  .filters .clear { margin-left: 0; width: 100%; justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { font-size: 12.5px; margin-top: 8px; }
  .detail-actions { margin-left: 0; width: 100%; }
  .detail-actions .btn { flex: 1; justify-content: center; }
  .modal { max-width: none; max-height: 100vh; height: 100%; border-radius: 0; }
  .modal-backdrop { padding: 0; }
  .page-head h1 { font-size: 20px; }
}

/* ---------- login ---------- */
body.login-page {
  padding: 0; display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh;
}
/* na loginu pozadina ide punom snagom */
body.login-page::before { opacity: 1; }
body.login-page::after {
  background: radial-gradient(70% 55% at 50% 45%, rgba(10,11,13,.30) 0%, rgba(9,10,12,.72) 60%, rgba(6,7,8,.92) 100%);
}

.login-box {
  width: 100%; max-width: 400px; margin: 24px auto; padding: 0 18px;
  text-align: center;
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 6px; }
.login-logo .alea-mark { width: 92px; height: 92px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.7)); }
.login-logo .w1 {
  font-size: 46px; font-weight: 300; letter-spacing: .01em; line-height: 1;
  background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-logo .w2 { font-size: 15px; letter-spacing: .46em; color: #c3c9d1; margin-top: 8px; }
.login-logo .w3 {
  font-size: 11.5px; letter-spacing: .5em; color: #8e959e; margin-top: 12px;
  display: flex; align-items: center; gap: 12px; justify-content: center; width: 100%;
}
.login-logo .w3::before, .login-logo .w3::after {
  content: ""; height: 1px; flex: 1; max-width: 70px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}

.login-app-title {
  margin: 26px 0 18px; font-size: 15px; font-weight: 500; color: #aeb5bd; letter-spacing: .01em;
}

.login-card {
  background: rgba(20, 22, 25, .72);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 22px 20px 20px;
  box-shadow: 0 30px 70px -18px rgba(0,0,0,.9);
  text-align: left;
}
.login-card .field:last-of-type { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px 14px; font-size: 15px; }
.login-err {
  color: #fca5a5; font-size: 13.5px; margin-bottom: 12px;
  background: rgba(239,68,68,.13); border: 1px solid rgba(252,165,165,.28);
  border-radius: 9px; padding: 9px 11px;
}
.login-foot { margin-top: 18px; font-size: 12px; color: #767d86; letter-spacing: .02em; }

@media (max-width: 420px) {
  .login-logo .alea-mark { width: 72px; height: 72px; }
  .login-logo .w1 { font-size: 36px; }
  .login-logo .w2 { font-size: 13px; letter-spacing: .38em; }
  .login-logo .w3 { font-size: 10.5px; letter-spacing: .38em; }
}
