/* ============================================================
   Karlix QMS — vizualni sustav
   Smjer 1b "Kontrolna soba". Tamna tema zadana, svijetla opcija.

   Redoslijed u <head>:
     bootstrap.min.css → qms.css → site.css
   Zamjenjuje qms-layout.css u cijelosti.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ------------------------------------------------------------
   1. TOKENI — tamna tema (zadana)
   ------------------------------------------------------------ */

.qms-theme,
.qms-theme-dark {
    --bg:            #101417;
    --sidebar-bg:    #0b0f11;
    --surface:       #161c20;
    --surface-2:     #1b2226;
    --surface-3:     #20272c;
    --pop:           #242c31;
    --pop-line:      #333c42;

    --line:          #232a2f;
    --line-soft:     #1c2226;
    --line-strong:   #2a3035;

    --ink:           #e8eaec;
    --ink-strong:    #eef1f3;
    --ink-2:         #aeb5ba;
    --ink-3:         #8b9298;
    --ink-4:         #8b9298;
    /* --ink-5 je UKRAS, ne tekst: točka razdjelnika, ugašena stranica, ikona
       praznog stanja. Na podlozi kartice daje omjer 2,3 : 1 — ispod 4,5 koliko
       WCAG AA traži za sitan tekst. Kad je nosio tekst, ekran se nije mogao
       pročitati: datum i broj obavijesti u popisu, oznake izvještaja („registar“,
       „razdoblje“), podnožje. Za prigušen tekst ide --ink-4 (5,5 : 1).
       Izmjereno pri klikanju sučelja 02.10.2026. (prolaz 104). */
    --ink-5:         #4d565c;

    --accent:        oklch(0.75 0.11 195);
    --accent-hover:  oklch(0.80 0.11 195);
    --accent-ink:    #08181c;
    --accent-soft:   oklch(0.75 0.11 195 / .16);
    --accent-text:   oklch(0.82 0.09 195);
    --accent-line:   oklch(0.75 0.11 195 / .40);

    --good:          oklch(0.78 0.14 150);
    --good-soft:     oklch(0.78 0.14 150 / .16);
    /* Boja za TEKST, par uz --good kao sto --bad-text stoji uz --bad.
       Nedostajala je jedina od cetiri obitelji, pa su zelene oznake uzimale
       --good, koja je ispuna: "Sukladno", "Zaposlen", "Pozitivno" davale su
       4,4 : 1 i time padale ispod AA (prolaz 104, 02.10.2026.). */
    --good-text:     oklch(0.85 0.11 150);
    --warn:          oklch(0.78 0.15 75);
    --warn-text:     oklch(0.85 0.13 75);
    --warn-soft:     oklch(0.78 0.15 75 / .16);
    --bad:           oklch(0.68 0.16 25);
    --bad-text:      oklch(0.80 0.13 25);
    --bad-soft:      oklch(0.68 0.16 25 / .16);
    --info:          oklch(0.78 0.13 200);
    --info-soft:     oklch(0.78 0.13 200 / .16);
    --neutral-soft:  #242c31;

    --track:         #20272c;
    --shadow-pop:    0 18px 44px rgba(0, 0, 0, .62);

    color-scheme: dark;
}

/* ------------------------------------------------------------
   2. TOKENI — svijetla tema
   ------------------------------------------------------------ */

.qms-theme-light {
    --bg:            #fafbfb;
    --sidebar-bg:    #e9ecee;
    --surface:       #ffffff;
    --surface-2:     #f8f9f9;
    --surface-3:     #eff1f2;
    --pop:           #ffffff;
    --pop-line:      #d7dcde;

    --line:          #e4e7e8;
    --line-soft:     #f1f3f4;
    --line-strong:   #d7dcde;

    --ink:           #10181b;
    --ink-strong:    #10181b;
    --ink-2:         #3c464a;
    --ink-3:         #5f6b70;
    --ink-4:         #5f6b70;
    --ink-5:         #a8b1b5;

    --accent:        oklch(0.52 0.10 205);
    --accent-hover:  oklch(0.46 0.10 205);
    --accent-ink:    #ffffff;
    --accent-soft:   oklch(0.52 0.10 205 / .12);
    --accent-text:   oklch(0.44 0.10 205);
    --accent-line:   oklch(0.52 0.10 205 / .38);

    --good:          oklch(0.52 0.13 150);
    --good-soft:     oklch(0.52 0.13 150 / .12);
    --good-text:     oklch(0.44 0.12 150);
    --warn:          oklch(0.68 0.14 70);
    --warn-text:     oklch(0.48 0.12 70);
    --warn-soft:     oklch(0.68 0.14 70 / .16);
    --bad:           oklch(0.55 0.18 25);
    --bad-text:      oklch(0.48 0.18 25);
    --bad-soft:      oklch(0.55 0.18 25 / .10);
    --info:          oklch(0.55 0.11 210);
    --info-soft:     oklch(0.55 0.11 210 / .12);
    --neutral-soft:  #eef0f1;

    --track:         #eceeef;
    --shadow-pop:    0 18px 40px rgba(16, 24, 27, .16);

    color-scheme: light;
}

/* ------------------------------------------------------------
   3. NEPROMJENJIVO
   ------------------------------------------------------------ */

.qms-theme,
.qms-theme-dark,
.qms-theme-light {
    --sidebar-w:      250px;
    --sidebar-w-mini: 64px;
    --topbar-h:       60px;
    --pad-x:          26px;
    --pad-y:          26px;

    --r:      12px;
    --r-sm:   9px;
    --r-xs:   6px;

    --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html { height: 100%; }

body[class*="qms-theme"] {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body[class*="qms-theme"] a { color: var(--accent-text); text-decoration: none; }
body[class*="qms-theme"] a:hover { color: var(--accent-hover); text-decoration: underline; }

body[class*="qms-theme"] h1, body[class*="qms-theme"] h2,
body[class*="qms-theme"] h3, body[class*="qms-theme"] h4 {
    color: var(--ink-strong); font-weight: 600; letter-spacing: -.02em; text-wrap: pretty; margin: 0;
}
body[class*="qms-theme"] h1 { font-size: 26px; }
body[class*="qms-theme"] h2 { font-size: 20px; }
body[class*="qms-theme"] h3 { font-size: 16px; }

.qms-mono { font-family: var(--mono); font-size: 12.5px; }
.qms-num { font-variant-numeric: tabular-nums; }

body[class*="qms-theme"] :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

/* ------------------------------------------------------------
   4. SHELL
   ------------------------------------------------------------ */

.qms-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

.qms-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.qms-content { flex: 1 1 auto; padding: var(--pad-y) var(--pad-x); min-width: 0; }
.qms-footer { padding: 8px var(--pad-x) 22px; font-size: 12px; color: var(--ink-4); }

/* ------------------------------------------------------------
   5. SIDEBAR
   ------------------------------------------------------------ */

.qms-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 22px 14px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--line-strong);
    overflow: hidden;
}

.qms-logo { display: flex; align-items: center; gap: 11px; padding: 0 6px; color: var(--ink); }
.qms-logo:hover { color: var(--ink); text-decoration: none; }
.qms-logo-mark {
    width: 28px; height: 28px; flex: 0 0 auto;
    border-radius: var(--r-sm);
    background: var(--accent); color: var(--accent-ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}
.qms-logo-text { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

/* tenant — obični tekst, nije kontrola */
.qms-tenant { display: flex; flex-direction: column; gap: 2px; padding: 0 7px; }
.qms-tenant-caption { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.qms-tenant-name {
    font-size: 13.5px; font-weight: 500; color: var(--ink-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* navigacija */
.qms-nav {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 3px;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.qms-nav-item { display: flex; flex-direction: column; gap: 3px; }

.qms-nav-link,
.qms-nav-toggle {
    display: flex; align-items: center; gap: 12px;
    width: 100%;
    padding: 9px 11px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-2);
    font: inherit; font-size: 14px; text-align: left;
    cursor: pointer;
}
.qms-nav-link:hover, .qms-nav-toggle:hover {
    background: var(--surface); color: var(--ink-strong); text-decoration: none;
}
.qms-nav-link.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.qms-nav-link.active:hover { background: var(--accent); color: var(--accent-ink); }
.qms-nav-toggle[aria-expanded="true"] { background: var(--surface); color: var(--ink-strong); font-weight: 500; }

.qms-nav-icon { width: 18px; flex: 0 0 auto; text-align: center; font-size: 15.5px; opacity: .85; }
.qms-nav-link.active .qms-nav-icon { opacity: 1; }
.qms-nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qms-nav-tail { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.qms-nav-badge {
    min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px;
    background: var(--bad); color: var(--on-bad, #fff);
    font-size: 10.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    font-variant-numeric: tabular-nums;
}
.qms-nav-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.qms-nav-item.has-active-child > .qms-nav-toggle .qms-nav-dot { background: var(--accent); }
.qms-nav-item.has-active-child > .qms-nav-toggle[aria-expanded="true"] .qms-nav-dot { background: transparent; }
.qms-nav-chevron { font-size: 11px; color: var(--ink-3); }

.qms-nav-sub {
    display: flex; flex-direction: column; gap: 2px;
    margin: 2px 0 6px 18px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}
.qms-nav-sub[hidden] { display: none; }

.qms-nav-sublink {
    display: flex; align-items: center;
    padding: 8px 10px; min-height: 36px;
    border-radius: 7px;
    color: var(--ink-2); font-size: 13.5px;
}
.qms-nav-sublink:hover { background: var(--surface); color: var(--ink-strong); text-decoration: none; }
.qms-nav-sublink.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.qms-nav-sublink.active:hover { background: var(--accent); color: var(--accent-ink); }

/* korisnik */
.qms-user {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.qms-user:hover { background: var(--surface-2); }
.qms-avatar {
    width: 27px; height: 27px; flex: 0 0 auto;
    border-radius: 50%;
    background: var(--accent); color: var(--accent-ink);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
}
.qms-user-body { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.qms-user-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qms-user-role { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------
   6. TOPBAR
   ------------------------------------------------------------ */

/* Tri stupca, ne niz: srednji je pretraga i mora stajati na sredini prozora
   bez obzira koliko je naslov ekrana dug i koliko toga stoji desno. Oba rubna
   stupca su 1fr, pa dijele preostalo na jednako — time je sredina stvarna
   sredina, a ne mjesto na koje je naslov gurnuo polje. */
.qms-topbar {
    height: var(--topbar-h); flex: 0 0 auto;
    position: sticky; top: 0; z-index: 20;
    display: grid;
    /* Srednji stupac raste s prozorom, ali ne preko širine popisa koji se ispod
       njega otvori (460 px): polje i popis tako čine jednu plohu, a ne stepenicu.
       Ispod 280 px polje prestaje biti upotrebljivo. */
    grid-template-columns: 1fr clamp(280px, 40vw, 460px) 1fr;
    align-items: center; gap: 14px;
    padding: 0 var(--pad-x);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.qms-topbar-lijevo,
.qms-topbar-desno { display: flex; align-items: center; gap: 14px; min-width: 0; }
.qms-topbar-desno { justify-content: flex-end; }

/* Dug naziv ekrana se krati, a ne gura pretragu s mjesta. */
.qms-topbar-title {
    font-size: 15px; font-weight: 600; color: var(--ink-strong);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.qms-topbar-date { font-size: 13px; color: var(--ink-3); }
.qms-topbar-period { font-size: 12.5px; color: var(--ink-4); }

.qms-burger {
    display: none;
    width: 42px; height: 42px;
    align-items: center; justify-content: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface); color: var(--ink-2);
    font-size: 19px; cursor: pointer;
}
.qms-scrim { display: none; position: fixed; inset: 0; z-index: 1035; background: rgba(0,0,0,.6); }
.qms-scrim.is-open { display: block; }

/* ------------------------------------------------------------
   7. KARTICE
   ------------------------------------------------------------ */

.qms-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}
.qms-card--alert { border-left: 3px solid var(--bad); }
.qms-card--pad { padding: 18px 22px; }

.qms-card-head {
    display: flex; align-items: center; gap: 11px;
    padding: 15px 22px;
    border-bottom: 1px solid var(--line-soft);
}
.qms-card--pad .qms-card-head { padding: 0 0 0 0; border-bottom: 0; }
.qms-card-title { font-size: 15px; font-weight: 600; color: var(--ink-strong); }
.qms-card-note { font-size: 12.5px; color: var(--ink-4); }
.qms-card-link { margin-left: auto; font-size: 13px; }
.qms-card-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 15px; }

.qms-count-pill {
    padding: 2px 8px; border-radius: 20px;
    background: var(--bad-soft); color: var(--bad-text);
    font-size: 12px; font-weight: 600;
}
.qms-count-pill--accent { background: var(--accent-soft); color: var(--accent-text); }

/* mreže */
.qms-grid { display: grid; gap: 14px; }
.qms-grid--kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.qms-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qms-grid--1-135 { grid-template-columns: 1fr 1.35fr; align-items: stretch; }
.qms-stack { display: flex; flex-direction: column; gap: 16px; }

/* ------------------------------------------------------------
   8. KPI
   ------------------------------------------------------------ */

.qms-kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 15px 16px;
    display: flex; flex-direction: column; gap: 7px;
    color: inherit;
}
a.qms-kpi:hover { border-color: var(--line-strong); text-decoration: none; color: inherit; }
.qms-kpi-label { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; min-height: 32px; }
.qms-kpi-row { display: flex; align-items: baseline; gap: 7px; }
.qms-kpi-value {
    font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1;
    font-variant-numeric: tabular-nums; color: var(--ink-strong);
}
.qms-kpi-value--bad { color: var(--bad-text); }
.qms-kpi-value--empty { color: var(--ink-4); }
.qms-kpi-delta { font-size: 12px; font-weight: 600; color: var(--ink-4); }
.qms-kpi-sub { font-size: 11.5px; color: var(--ink-4); }

.qms-bar { height: 4px; border-radius: 3px; background: var(--track); overflow: hidden; }
.qms-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.qms-bar--lg { height: 7px; border-radius: 4px; }
.qms-bar--lg > span { border-radius: 4px; }
.qms-bar .is-good { background: var(--good); }
.qms-bar .is-warn { background: var(--warn); }
.qms-bar .is-bad  { background: var(--bad); }
.qms-bar .is-info { background: var(--info); }

/* ------------------------------------------------------------
   9. OBAVIJESTI
   ------------------------------------------------------------ */

.qms-notif {
    display: flex; align-items: flex-start; gap: 13px;
    padding: 13px 22px;
    border-bottom: 1px solid var(--line-soft);
    color: inherit;
}
.qms-notif:last-child { border-bottom: 0; }
.qms-notif:hover { background: var(--surface-2); text-decoration: none; color: inherit; }
.qms-notif.is-unread { background: var(--accent-soft); }
.qms-notif.is-unread:hover { background: var(--accent-soft); }

.qms-notif-icon {
    flex: 0 0 auto; width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
    background: var(--neutral-soft); color: var(--ink-2);
}
.qms-notif-icon--bad   { background: var(--bad-soft);   color: var(--bad-text); }
.qms-notif-icon--good  { background: var(--good-soft);  color: var(--good-text); }
.qms-notif-icon--warn  { background: var(--warn-soft);  color: var(--warn-text); }
.qms-notif-icon--accent{ background: var(--accent-soft);color: var(--accent-text); }

.qms-notif-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.qms-notif-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.qms-notif-text { font-size: 13.5px; color: var(--ink-strong); line-height: 1.4; }
.qms-notif-meta { font-size: 12px; color: var(--ink-4); }
.qms-notif-time { flex: 0 0 auto; font-size: 12px; color: var(--ink-4); font-variant-numeric: tabular-nums; padding-top: 2px; }

.qms-new {
    padding: 1px 7px; border-radius: 5px;
    background: var(--accent-soft); color: var(--accent-text);
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}

/* ------------------------------------------------------------
   10. TABLICE
   ------------------------------------------------------------ */

.qms-table { width: 100%; border-collapse: collapse; font-size: 13.5px; color: var(--ink); }
.qms-table thead th {
    text-align: left; padding: 10px 12px;
    font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
    font-weight: 600; color: var(--ink-3);
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.qms-table tbody td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.qms-table tbody tr:last-child td { border-bottom: 0; }
.qms-table tbody tr:hover td { background: var(--surface-2); }
.qms-table th:first-child, .qms-table td:first-child { padding-left: 22px; }
.qms-table th:last-child, .qms-table td:last-child { padding-right: 22px; }
.qms-table .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.qms-table .t-main { color: var(--ink-strong); }
.qms-table .t-sub { font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }
.qms-table .t-muted { color: var(--ink-3); }
.qms-cellflex { display: flex; align-items: center; gap: 9px; }

/* mobilno: tablica u kartice */
@media (max-width: 900px) {
    .qms-table--stack thead { display: none; }
    .qms-table--stack, .qms-table--stack tbody,
    .qms-table--stack tr, .qms-table--stack td { display: block; width: auto; }
    .qms-table--stack tbody tr {
        border: 1px solid var(--line);
        border-radius: var(--r-sm);
        background: var(--surface);
        padding: 13px 15px;
        margin-bottom: 11px;
    }
    .qms-table--stack tbody td {
        border: 0; padding: 3px 0 !important;
        display: flex; align-items: baseline; gap: 12px;
    }
    .qms-table--stack tbody td::before {
        content: attr(data-label);
        flex: 0 0 92px;
        font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4);
    }
    .qms-table--stack tbody td[data-label=""]::before { content: none; }
    .qms-table--stack tbody td.num { text-align: left; }
    .qms-table--stack tbody tr:hover td { background: transparent; }
}

/* ------------------------------------------------------------
   11. OZNAKE
   ------------------------------------------------------------ */

.qms-tag {
    display: inline-flex; align-items: center;
    padding: 2px 6px; border-radius: 4px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
    background: var(--neutral-soft); color: var(--ink-2);
}
.qms-tag--rin { background: var(--accent-soft); color: var(--accent-text); }
.qms-tag--un  { background: var(--neutral-soft); color: var(--ink-2); }
.qms-tag--ia  { background: var(--warn-soft); color: var(--warn-text); }

.qms-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 12.5px; white-space: nowrap;
}
.qms-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--ink-5); }
.qms-dot--accent { background: var(--accent); }
.qms-dot--good { background: var(--good); }
.qms-dot--warn { background: var(--warn); }
.qms-dot--bad  { background: var(--bad); }
.qms-dot--info { background: var(--info); }

.qms-late {
    margin-left: 8px; padding: 2px 7px; border-radius: 5px;
    background: var(--bad-soft); color: var(--bad-text);
    font-size: 12px; font-weight: 600;
}

.qms-typechips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qms-typechip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 3px 9px; border-radius: 20px;
    font-size: 12px;
    background: var(--neutral-soft); color: var(--ink-2);
}
.qms-typechip b { font-weight: 700; letter-spacing: .04em; }
.qms-typechip--rin { background: var(--accent-soft); color: var(--accent-text); }
.qms-typechip--ia  { background: var(--warn-soft); color: var(--warn-text); }

/* ------------------------------------------------------------
   12. GRAF I TRAKE
   ------------------------------------------------------------ */

.qms-legend { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-3); }
.qms-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.qms-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.qms-legend i.rin { background: var(--accent); }
.qms-legend i.un  { background: var(--ink-5); }
.qms-legend i.ia  { background: var(--warn); }
.qms-legend i.closed { width: 12px; height: 2px; border-radius: 0; background: var(--good); }

.qms-chart { height: 260px; }
.qms-chart canvas { width: 100% !important; height: 100% !important; }

/* traka rokova, 14 dana */
.qms-duestrip { display: flex; align-items: flex-end; gap: 6px; height: 124px; }
.qms-duecol { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.qms-duecount { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.qms-duecol.is-today .qms-duecount { color: var(--warn-text); }
.qms-duebar { flex: 0 0 auto; width: 100%; border-radius: 4px 4px 0 0; background: var(--accent); }
.qms-duecol.is-today .qms-duebar { background: var(--warn); }
.qms-duecol.is-empty .qms-duebar { background: var(--track); }
.qms-dueday { font-size: 10px; color: var(--ink-4); font-variant-numeric: tabular-nums; }

.qms-rowlist { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid var(--line-soft); padding-top: 13px; }
.qms-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.qms-row-title { color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qms-row-tail { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* faze */
.qms-phase-row { display: flex; flex-direction: column; gap: 6px; }
.qms-phase-head { display: flex; align-items: baseline; gap: 10px; font-size: 13px; }
.qms-phase-n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px; border-radius: 50%;
    background: var(--surface-3); color: var(--ink-3);
    font-size: 10px; font-weight: 700;
}
.qms-phase-label { color: var(--ink-2); }
.qms-phase-value { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.qms-phase-pct { color: var(--ink-4); width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------
   13. GUMBI, FORME
   ------------------------------------------------------------ */

body[class*="qms-theme"] .btn {
    min-height: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 7px 14px;
    font-size: 13px; font-weight: 500;
    border-radius: var(--r-sm);
    box-shadow: none;
}
body[class*="qms-theme"] .btn-sm { min-height: 32px; padding: 5px 11px; font-size: 12.5px; }

body[class*="qms-theme"] .btn-primary {
    background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
}
body[class*="qms-theme"] .btn-primary:hover,
body[class*="qms-theme"] .btn-primary:focus {
    background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink);
}
body[class*="qms-theme"] .btn-outline-secondary {
    background: var(--surface-2); border-color: var(--pop-line); color: var(--ink-2);
}
body[class*="qms-theme"] .btn-outline-secondary:hover {
    background: var(--surface-3); border-color: var(--pop-line); color: var(--ink-strong);
}
/* Jedini član obitelji koji je ostao nepresvučen: 18 gumba kroz deset ekrana
   („Izvezi XLSX", „CSV", „PDF") crtalo se Bootstrapovom plavom usred tirkizne
   kuće, uz omjer 3,6 : 1 na tamnoj temi. Nađeno mjerenjem pri klikanju
   sučelja 02.10.2026. (prolaz 104). Oblik je isti kao kod --danger niže. */
body[class*="qms-theme"] .btn-outline-primary {
    background: transparent; border-color: var(--accent-line); color: var(--accent-text);
}
body[class*="qms-theme"] .btn-outline-primary:hover,
body[class*="qms-theme"] .btn-outline-primary:focus {
    background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text);
}
body[class*="qms-theme"] .btn-outline-danger {
    background: transparent; border-color: var(--bad); color: var(--bad-text);
}
body[class*="qms-theme"] .btn-outline-danger:hover { background: var(--bad-soft); color: var(--bad-text); }
/* Ostale vrste koje pogledi koriste, a dotad nisu bile presvučene: brisanje
   tvrtke i provedba čuvanja (danger), odustajanje na zaposlenicima (secondary),
   upozorenja i potvrde u administraciji (warning, outline-success/warning).
   Ograda `BojaTekstaTests.Svaka_vrsta_gumba_koju_pogledi_koriste_je_presvucena`
   uspoređuje ono što pogledi traže s onim što je ovdje. */
body[class*="qms-theme"] .btn-danger {
    background: var(--bad); border-color: var(--bad); color: var(--on-bad, #fff); font-weight: 600;
}
body[class*="qms-theme"] .btn-danger:hover,
body[class*="qms-theme"] .btn-danger:focus { background: var(--bad); border-color: var(--bad); color: var(--on-bad, #fff); filter: brightness(1.08); }

body[class*="qms-theme"] .btn-secondary {
    background: var(--surface-2); border-color: var(--pop-line); color: var(--ink-2);
}
body[class*="qms-theme"] .btn-secondary:hover,
body[class*="qms-theme"] .btn-secondary:focus { background: var(--surface-3); border-color: var(--pop-line); color: var(--ink-strong); }

body[class*="qms-theme"] .btn-warning {
    background: var(--warn); border-color: var(--warn); color: var(--accent-ink); font-weight: 600;
}
body[class*="qms-theme"] .btn-warning:hover,
body[class*="qms-theme"] .btn-warning:focus { background: var(--warn); border-color: var(--warn); color: var(--accent-ink); filter: brightness(1.08); }

body[class*="qms-theme"] .btn-outline-success {
    background: transparent; border-color: var(--good); color: var(--good-text);
}
body[class*="qms-theme"] .btn-outline-success:hover,
body[class*="qms-theme"] .btn-outline-success:focus { background: var(--good-soft); color: var(--good-text); }

body[class*="qms-theme"] .btn-outline-warning {
    background: transparent; border-color: var(--warn); color: var(--warn-text);
}
body[class*="qms-theme"] .btn-outline-warning:hover,
body[class*="qms-theme"] .btn-outline-warning:focus { background: var(--warn-soft); color: var(--warn-text); }

body[class*="qms-theme"] .btn-link { color: var(--accent-text); }

body[class*="qms-theme"] .form-label {
    font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
    font-weight: 600; color: var(--ink-3); margin-bottom: 6px;
}
body[class*="qms-theme"] .form-control,
body[class*="qms-theme"] .form-select {
    min-height: 38px; padding: 8px 12px;
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--r-sm); color: var(--ink);
    font-size: 13.5px; box-shadow: none;
}
body[class*="qms-theme"] .form-control::placeholder { color: var(--ink-4); }
body[class*="qms-theme"] .form-control:focus,
body[class*="qms-theme"] .form-select:focus {
    background: var(--surface); border-color: var(--accent); color: var(--ink);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* dropdown korisnika */
body[class*="qms-theme"] .dropdown-menu {
    padding: 6px;
    border-radius: 11px;
    background: var(--pop);
    border: 1px solid var(--pop-line);
    box-shadow: var(--shadow-pop);
    color: var(--ink);
    min-width: 232px;
}
body[class*="qms-theme"] .dropdown-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; min-height: 38px;
    border-radius: 8px;
    color: var(--ink-2); font-size: 13.5px;
}
body[class*="qms-theme"] .dropdown-item:hover,
body[class*="qms-theme"] .dropdown-item:focus { background: var(--surface-3); color: var(--ink-strong); }
body[class*="qms-theme"] .dropdown-item.is-danger { color: var(--bad-text); }
body[class*="qms-theme"] .dropdown-divider { border-color: var(--pop-line); margin: 4px 6px; }

.qms-menu-head {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 11px 12px;
    border-bottom: 1px solid var(--pop-line);
    margin-bottom: 4px;
}
.qms-menu-name { font-size: 13.5px; font-weight: 600; color: var(--ink-strong); }
.qms-menu-mail { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------
   14. STANJA: učitavanje, greška, prazno
   ------------------------------------------------------------ */

.qms-skel { border-radius: 4px; background: var(--track); display: block; }
.qms-skel--title { height: 14px; width: 32%; }
.qms-skel--label { height: 11px; width: 74%; }
.qms-skel--value { height: 28px; width: 52%; border-radius: 6px; }
.qms-skel--line { height: 11px; }
.qms-skel--bar { height: 6px; background: var(--line-soft); }
.qms-skel-rows { display: flex; flex-direction: column; gap: 14px; }
.qms-skel-row { display: flex; flex-direction: column; gap: 6px; }

.qms-state {
    padding: 26px 22px;
    display: flex; flex-direction: column; align-items: center; gap: 9px;
    text-align: center;
}
.qms-state i { font-size: 22px; color: var(--ink-4); }
.qms-state--error i { color: var(--bad-text); }
.qms-state-title { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.qms-state-note { font-size: 12.5px; color: var(--ink-3); max-width: 380px; line-height: 1.55; text-wrap: pretty; }

.qms-kpi-error { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--bad-text); }

body[class*="qms-theme"] .alert { border-radius: var(--r-sm); border-width: 1px; font-size: 13.5px; padding: 13px 16px; }
body[class*="qms-theme"] .alert-danger  { background: var(--bad-soft);  border-color: var(--bad);  color: var(--bad-text); }
body[class*="qms-theme"] .alert-warning { background: var(--warn-soft); border-color: var(--warn); color: var(--ink-strong); }
body[class*="qms-theme"] .alert-info    { background: var(--info-soft); border-color: var(--info); color: var(--ink-strong); }

/* ------------------------------------------------------------
   15. IZGLED I TEMA (ekran postavki)
   ------------------------------------------------------------ */

.qms-themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 640px; }
.qms-theme-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--surface); overflow: hidden; cursor: pointer;
}
.qms-theme-card.is-selected { border-color: var(--accent-line); }
.qms-theme-card input { position: absolute; opacity: 0; pointer-events: none; }

.qms-theme-preview { height: 104px; display: grid; grid-template-columns: 34px 1fr; }
.qms-theme-preview .side { border-right: 1px solid; display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; }
.qms-theme-preview .side span:first-child { height: 8px; border-radius: 3px; }
.qms-theme-preview .side span { height: 5px; border-radius: 2px; }
.qms-theme-preview .body { padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.qms-theme-preview .body .lbl { height: 6px; width: 46%; border-radius: 2px; }
.qms-theme-preview .body .cards { display: flex; gap: 5px; }
.qms-theme-preview .body .cards span { flex: 1; height: 26px; border-radius: 4px; border: 1px solid; }
.qms-theme-preview .body .bars { display: flex; align-items: flex-end; gap: 3px; height: 26px; }
.qms-theme-preview .body .bars span { flex: 1; border-radius: 2px 2px 0 0; }

/* vrijednosti prikaza — fiksne, ne prate aktivnu temu */
.qms-preview-dark { background: #101417; }
.qms-preview-dark .side { background: #0b0f11; border-color: #232a2f; }
.qms-preview-dark .side span:first-child { background: oklch(0.75 0.11 195); }
.qms-preview-dark .side span { background: #333c42; }
.qms-preview-dark .body .lbl { background: #333c42; }
.qms-preview-dark .body .cards span { background: #161c20; border-color: #232a2f; }
.qms-preview-dark .body .bars span { background: oklch(0.75 0.11 195); }

.qms-preview-light { background: #fafbfb; }
.qms-preview-light .side { background: #e9ecee; border-color: #d7dcde; }
.qms-preview-light .side span:first-child { background: oklch(0.52 0.10 205); }
.qms-preview-light .side span { background: #b4bcbf; }
.qms-preview-light .body .lbl { background: #b4bcbf; }
.qms-preview-light .body .cards span { background: #ffffff; border-color: #d7dcde; }
.qms-preview-light .body .bars span { background: oklch(0.52 0.10 205); }

.qms-theme-foot { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-top: 1px solid var(--line); }
.qms-radio {
    width: 17px; height: 17px; flex: 0 0 auto;
    border-radius: 50%; border: 1px solid var(--ink-5);
    display: inline-flex; align-items: center; justify-content: center;
}
.is-selected .qms-radio { border-color: var(--accent); background: var(--accent); }
.is-selected .qms-radio::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-ink); }
.qms-theme-name { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.is-selected .qms-theme-name { font-weight: 600; color: var(--ink-strong); }
.qms-theme-note { font-size: 11.5px; color: var(--ink-3); }

.qms-pref {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface);
}
.qms-pref-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.qms-pref-label { font-size: 13.5px; color: var(--ink-strong); }
.qms-pref-note { font-size: 12px; color: var(--ink-3); text-wrap: pretty; }
.qms-switch { flex: 0 0 auto; width: 42px; height: 24px; padding: 3px; border: 0; border-radius: 14px; background: var(--line-strong); display: flex; justify-content: flex-start; cursor: pointer; }
.qms-switch span { width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); }
.qms-switch[aria-checked="true"] { background: var(--accent); justify-content: flex-end; }
.qms-switch[aria-checked="true"] span { background: var(--accent-ink); }

/* ------------------------------------------------------------
   16. RESPONZIVNO
   ------------------------------------------------------------ */

@media (max-width: 1400px) {
    .qms-grid--kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1200px) {
    .qms-theme, .qms-theme-dark, .qms-theme-light { --pad-x: 20px; --pad-y: 20px; }
    .qms-grid--1-135, .qms-grid--2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 992px) {
    .qms-shell { grid-template-columns: minmax(0, 1fr); }
    .qms-sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 1040;
        width: min(326px, 88vw);
        transform: translateX(-100%);
        transition: transform .18s ease-out;
        box-shadow: var(--shadow-pop);
        padding: 22px 16px;
    }
    .qms-sidebar.is-open { transform: translateX(0); }
    .qms-burger { display: inline-flex; }
    .qms-nav-link, .qms-nav-toggle { min-height: 48px; }
    .qms-nav-sublink { min-height: 46px; }
    .qms-topbar-period { display: none; }

    /* Uska traka: naslov i desna strana se stisnu na svoje, a pretraga uzima
       ono što ostane — na telefonu je važnija od naziva ekrana. */
    .qms-topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

@media (max-width: 640px) {
    .qms-theme, .qms-theme-dark, .qms-theme-light { --pad-x: 14px; --pad-y: 16px; --topbar-h: 56px; }
    .qms-grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qms-kpi-value { font-size: 26px; }
    .qms-topbar-date { display: none; }
    .qms-card-head, .qms-card-body, .qms-card--pad { padding-left: 16px; padding-right: 16px; }
    .qms-nav-link, .qms-nav-toggle { min-height: 50px; }
    .qms-themes { grid-template-columns: minmax(0, 1fr); }
}

@media print {
    .qms-sidebar, .qms-topbar, .qms-footer, .qms-scrim { display: none !important; }
    .qms-shell { grid-template-columns: 1fr; }
    body[class*="qms-theme"] { background: #fff; color: #000; }
}
