/* Uspon — design system v2
   Typeface: Inter (self-hosted, obična nula; nema mono fonta: natpisi su Inter u verzalu, šifre tabelarne cifre).
   Brand mark: the red-and-white trail marker ("markacija") — you are on the right path (samo znak Uspona dolje).
   Per-company accent comes from --accent (set in base.html from company settings). Glavno dugme je grafit (--primary). */

@font-face { font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.ad4eb06671be.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.8e433c0592f7.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* tekst */
  --ink: #111113;
  --ink-2: #3A3A42;
  --ink-3: #55555E;
  --ink-4: #63636C;
  --ink-inverse: #FFFFFF;

  /* površine */
  --frame: #F1F1F3;
  --paper: var(--frame);
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --sunken: #EFEFF2;
  --bezel: #F6F6F8;
  --bezel-line: #E9E9EC;
  --line: #E6E6EA;
  --line-2: #F0F0F2;
  --line-strong: #84848E;
  --tick: #DADAE0;

  /* bočna traka (svijetla, na podlozi) */
  --sidebar-bg: var(--frame);
  --sidebar-ink: var(--ink-2);
  --sidebar-line: transparent;
  --sidebar-hover: #E7E7EB;
  --sidebar-active: #D6D6DD;

  /* primarna radnja: grafit (D69). Ako treba boja firme: --primary: var(--accent) */
  --primary: #18181B;
  --primary-top: #2C2C31;
  --primary-ink: #FFFFFF;

  /* stare tamne vrijednosti: prijava (lijeva ilustracija) i traka „gledaš kao“ */
  --night: #16202A;
  --night-2: #1E2A36;
  --night-line: rgba(255,255,255,.08);
  --night-ink: #C9D2DB;
  --marker: #D3242F;         /* trail-marker red: samo znak Uspona */

  --accent: #1F5F7A;
  --accent-hover: #194E65;
  --accent-soft: #E9F0F3;
  --accent-line: #BCD0D9;
  --accent-ink: #FFFFFF;
  --brand-bar: var(--accent);  /* obična traka napretka; neutralna kad je boja firme blizu statusne (base.html) */

  /* status: tekst na -soft ≥ 5,2:1; -bar je grafički znak (crtica, kvadratić, tačka) */
  --ok: #067647;     --ok-soft: #ECF8EF;    --ok-line: #B7E4C4;
  --warn: #8A5300;   --warn-soft: #FFF7E8;  --warn-line: #F3D9A4;  --warn-bar: #B87708;
  --bad: #B42318;    --bad-soft: #FEF1F1;   --bad-line: #F6C9C6;   --bad-bar: #C8342A;
  --info: #2F54A8;   --info-soft: #EEF3FF;  --info-line: #C9D7F7;
  --neutral-soft: #F1F1F3; --neutral-line: #E2E2E6;
  --done-cell: #D4D4DA;

  /* grafikoni (prva serija je uvijek boja firme) */
  --chart-1: var(--accent); --chart-2: #4E5BA6; --chart-3: #B87708; --chart-4: #7A5AF8; --chart-5: #0E9384; --chart-6: #667085;

  /* pomoćni tokeni (isti u obje teme gdje nije drugačije navedeno u tamnom bloku niže) */
  --avatar-ink: #3A3A42;  /* inicijali na pastelnoj pozadini avatara */
  --on-bad-bar: #FFFFFF;  /* broj na crvenoj znački */
  --on-fill: #FFFFFF;  /* tekst na zasićenoj ispuni (marker, status) */
  --scrim: rgba(15,22,29,.45);
  --edge-shadow: rgba(23,33,43,.12);
  --edge-shadow-strong: rgba(23,33,43,.35);
  --scroll-shadow: rgba(0,0,0,.22);
  --surface-glass: rgba(255,255,255,.96);
  --nav-open: rgba(233,233,237,.55);
  --ghost-hover: rgba(17,17,19,.06);
  --toast-hover: rgba(255,255,255,.12);
  --skeleton: #D6DDE3; --skeleton-2: #B6C1CB;
  --bad-faint: #FEF7F6; --warn-faint: #FFFEF8;
  --tone-ok-bg: #F1F8F4; --tone-warn-bg: #FFF9EC; --tone-bad-bg: #FEF4F3;
  --warn-hover: #FFEFD0; --info-hover: #E1EAFF; --bad-hover: #8F1D16;
  --why-bad: #8F1F15; --why-warn: #6E4200; --why-info: #24427F;
  --warm: #C98A12; --muted-fill: #B8C1CA; --self: #6B7785;
  --sv-1: #B3261E; --sv-2: #E7A39B; --sv-3: #C9D1D9; --sv-4: #8FCBA8; --sv-5: #1D7A4C; --sv-bad: #C4453C;
  --rv-d2: #E08A5A; --rv-d3: #A7B1BB; --rv-d4: #6FA77B;
  --heat-1-bg: #F9D6D3; --heat-1-ink: #9B1C14; --heat-2-bg: #FBE2D5; --heat-2-ink: #A2461B; --heat-3-bg: #FCF0D7; --heat-3-ink: #8F5B00;
  --heat-4-bg: #E3F2E8; --heat-4-ink: #1D7A4C; --heat-5-bg: #CDEBD9; --heat-5-ink: #145A37;

  /* radijusi */
  --r-xs: 6px;
  --r-s: 10px;
  --r-m: 14px;
  --r-l: 18px;
  --r-xl: 20px;
  --r-full: 999px;

  /* sjene */
  --shadow-1: 0 1px 2px rgba(17,17,19,.05);
  --shadow-2: 0 1px 2px rgba(17,17,19,.06), 0 2px 6px rgba(17,17,19,.04);
  --shadow-btn: 0 1px 2px rgba(17,17,19,.25), 0 3px 8px -2px rgba(17,17,19,.35), inset 0 1px 0 rgba(255,255,255,.12);
  --pop: 0 12px 32px rgba(17,17,19,.16), 0 2px 6px rgba(17,17,19,.08);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);

  /* tipografija (Inter) */
  --font: "Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-xs: .75rem;      /* 12 — najmanje: natpisi, oznake */
  --t-s: .8125rem;     /* 13 */
  --t-m: .875rem;      /* 14 — tijelo */
  --t-l: 1rem;         /* 16 */
  --t-xl: 1.25rem;     /* 20 */
  --t-2xl: 1.5rem;     /* 24 — h1 */
  --t-3xl: 2rem;
  --t-4xl: 3.25rem;
  --t-greet: 2.125rem; /* 34 */
  --t-num: 1.875rem;   /* 30 */
  --t-num-xl: 3.75rem; /* 60 */
  --ls-tight: -.022em; --ls-num: -.04em; --ls-caps: .08em;

  /* dodir i raspored */
  --tap: 44px;
  --control-h: 40px;
  --block-gap: 20px; /* razmak između susjednih blokova sadržaja (traka, kartica, mreža) */
  --pop-pad: 6px; /* razmak unutar menija: radius stavke = radius menija − razmak */
  --sidebar-w: 248px;
  --content-max: 1240px;
  --content-pad: 28px;
  --panel-gap: 20px;
  --aside-w: 360px;
  --topbar-h: 62px;
}

/* ---- tamna tema (N22): izbor osobe data-theme="dark", ili data-theme="system" kad uređaj traži tamno; u štampi uvijek svijetla ---- */
@media screen { :root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ECECF0;
  --ink-2: #CFCFD7;
  --ink-3: #A9A9B4;
  --ink-4: #9797A3;
  --ink-inverse: #111113;

  --frame: #121215;
  --surface: #1B1B20;
  --surface-2: #222228;
  --sunken: #0E0E11;
  --bezel: #18181C;
  --bezel-line: #2A2A31;
  --line: #2F2F37;
  --line-2: #26262D;
  --line-strong: #6B6B77;
  --tick: #3A3A43;

  --sidebar-hover: #25252C;
  --sidebar-active: #31313A;

  --primary: #ECECF0;
  --primary-top: #FFFFFF;
  --primary-ink: #111113;

  --accent: var(--accent-d, #7FB5CB);
  --accent-hover: var(--accent-d-hover, #9AC6D7);
  --accent-soft: var(--accent-d-soft, #1B2B33);
  --accent-line: var(--accent-d-line, #2F5362);
  --accent-ink: var(--accent-d-ink, #111113);
  --brand-bar: var(--brand-bar-d, #7FB5CB);

  --ok: #5FD38D;     --ok-soft: #12281D;    --ok-line: #24533A;
  --warn: #F2B24D;   --warn-soft: #2D2310;  --warn-line: #5E4719;  --warn-bar: #D99A2B;
  --bad: #FF8F86;    --bad-soft: #321717;   --bad-line: #6E2D2A;   --bad-bar: #E5534B;
  --avatar-ink: #2A2A31;
  --on-bad-bar: #111113;
  --info: #94B2F7;   --info-soft: #172138;  --info-line: #30467C;
  --neutral-soft: #26262D; --neutral-line: #34343C;
  --done-cell: #4A4A54;

  --chart-2: #8F9BE3; --chart-3: #E0A23A; --chart-4: #A68CFA; --chart-5: #2DC4B2; --chart-6: #98A2B3;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 1px 2px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
  --shadow-btn: 0 1px 2px rgba(0,0,0,.5), 0 3px 8px -2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.5);
  --pop: 0 12px 32px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);

  --scrim: rgba(0,0,0,.6);
  --edge-shadow: rgba(0,0,0,.5);
  --edge-shadow-strong: rgba(0,0,0,.7);
  --scroll-shadow: rgba(0,0,0,.6);
  --surface-glass: rgba(27,27,32,.96);
  --nav-open: rgba(255,255,255,.05);
  --ghost-hover: rgba(255,255,255,.08);
  --toast-hover: rgba(0,0,0,.1);
  --skeleton: #2A2A32; --skeleton-2: #3A3A44;
  --bad-faint: #2A1A1B; --warn-faint: #262012;
  --tone-ok-bg: #13241B; --tone-warn-bg: #272010; --tone-bad-bg: #2B1818;
  --warn-hover: #3A2D12; --info-hover: #1F2D4D; --bad-hover: #FFB1AB;
  --why-bad: #FFB3AD; --why-warn: #F7CE8A; --why-info: #BBD0FA;
  --warm: #D99A2B; --muted-fill: #4A4A54; --self: #8F9AA8;
  --sv-1: #D2554D; --sv-2: #8A4540; --sv-3: #4A4F58; --sv-4: #3F8460; --sv-5: #43B27C; --sv-bad: #D2554D;
  --rv-d2: #D8794A; --rv-d3: #6B7480; --rv-d4: #4F9060;
  --heat-1-bg: #4A1D1A; --heat-1-ink: #FFB3AD; --heat-2-bg: #4A2A1A; --heat-2-ink: #FFC3A3; --heat-3-bg: #46361A; --heat-3-ink: #F7D58A;
  --heat-4-bg: #1D3B2A; --heat-4-ink: #8FE0B0; --heat-5-bg: #1F4D33; --heat-5-ink: #B4F0CB;
} }
@media screen and (prefers-color-scheme: dark) { :root[data-theme="system"] {
  color-scheme: dark;
  --ink: #ECECF0;
  --ink-2: #CFCFD7;
  --ink-3: #A9A9B4;
  --ink-4: #9797A3;
  --ink-inverse: #111113;

  --frame: #121215;
  --surface: #1B1B20;
  --surface-2: #222228;
  --sunken: #0E0E11;
  --bezel: #18181C;
  --bezel-line: #2A2A31;
  --line: #2F2F37;
  --line-2: #26262D;
  --line-strong: #6B6B77;
  --tick: #3A3A43;

  --sidebar-hover: #25252C;
  --sidebar-active: #31313A;

  --primary: #ECECF0;
  --primary-top: #FFFFFF;
  --primary-ink: #111113;

  --accent: var(--accent-d, #7FB5CB);
  --accent-hover: var(--accent-d-hover, #9AC6D7);
  --accent-soft: var(--accent-d-soft, #1B2B33);
  --accent-line: var(--accent-d-line, #2F5362);
  --accent-ink: var(--accent-d-ink, #111113);
  --brand-bar: var(--brand-bar-d, #7FB5CB);

  --ok: #5FD38D;     --ok-soft: #12281D;    --ok-line: #24533A;
  --warn: #F2B24D;   --warn-soft: #2D2310;  --warn-line: #5E4719;  --warn-bar: #D99A2B;
  --bad: #FF8F86;    --bad-soft: #321717;   --bad-line: #6E2D2A;   --bad-bar: #E5534B;
  --avatar-ink: #2A2A31;
  --on-bad-bar: #111113;
  --info: #94B2F7;   --info-soft: #172138;  --info-line: #30467C;
  --neutral-soft: #26262D; --neutral-line: #34343C;
  --done-cell: #4A4A54;

  --chart-2: #8F9BE3; --chart-3: #E0A23A; --chart-4: #A68CFA; --chart-5: #2DC4B2; --chart-6: #98A2B3;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 1px 2px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3);
  --shadow-btn: 0 1px 2px rgba(0,0,0,.5), 0 3px 8px -2px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.5);
  --pop: 0 12px 32px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);

  --scrim: rgba(0,0,0,.6);
  --edge-shadow: rgba(0,0,0,.5);
  --edge-shadow-strong: rgba(0,0,0,.7);
  --scroll-shadow: rgba(0,0,0,.6);
  --surface-glass: rgba(27,27,32,.96);
  --nav-open: rgba(255,255,255,.05);
  --ghost-hover: rgba(255,255,255,.08);
  --toast-hover: rgba(0,0,0,.1);
  --skeleton: #2A2A32; --skeleton-2: #3A3A44;
  --bad-faint: #2A1A1B; --warn-faint: #262012;
  --tone-ok-bg: #13241B; --tone-warn-bg: #272010; --tone-bad-bg: #2B1818;
  --warn-hover: #3A2D12; --info-hover: #1F2D4D; --bad-hover: #FFB1AB;
  --why-bad: #FFB3AD; --why-warn: #F7CE8A; --why-info: #BBD0FA;
  --warm: #D99A2B; --muted-fill: #4A4A54; --self: #8F9AA8;
  --sv-1: #D2554D; --sv-2: #8A4540; --sv-3: #4A4F58; --sv-4: #3F8460; --sv-5: #43B27C; --sv-bad: #D2554D;
  --rv-d2: #D8794A; --rv-d3: #6B7480; --rv-d4: #4F9060;
  --heat-1-bg: #4A1D1A; --heat-1-ink: #FFB3AD; --heat-2-bg: #4A2A1A; --heat-2-ink: #FFC3A3; --heat-3-bg: #46361A; --heat-3-ink: #F7D58A;
  --heat-4-bg: #1D3B2A; --heat-4-ink: #8FE0B0; --heat-5-bg: #1F4D33; --heat-5-ink: #B4F0CB;
} }

*, *::before, *::after { box-sizing: border-box; }
/* skrolbar uvijek rezerviše mjesto: stranica bez skrola i ona sa skrolom imaju istu širinu, pa se srednji dio ne miče pri prelasku */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; background: var(--frame); }

/* Pun prelaz (stranice s no-store: odgovori na ankete, lični podaci) bez bljeska: preglednik drži staru sliku dok nova ne
   stigne, a meni i gornja traka se ne animiraju jer su na istom mjestu (isti naziv na staroj i novoj stranici). */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: uspon-sidebar; }
.topbar { view-transition-name: uspon-topbar; }
::view-transition-group(uspon-sidebar), ::view-transition-group(uspon-topbar) { animation-duration: 0s; }
::view-transition-old(uspon-sidebar), ::view-transition-new(uspon-sidebar),
::view-transition-old(uspon-topbar), ::view-transition-new(uspon-topbar) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
body {
  margin: 0; font-family: var(--font); font-size: var(--t-m); line-height: 1.5; color: var(--ink);
  background: var(--frame);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--t-2xl); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-l); }
h4 { font-size: var(--t-m); }
p { margin: 0 0 .75em; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: var(--t-s); }
hr { border: 0; border-top: 1px solid var(--line-2); margin: 1.25rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[x-cloak] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon-s { width: 15px; height: 15px; vertical-align: -2px; }
.icon-l { width: 22px; height: 22px; }
.icon-xl { width: 28px; height: 28px; }

/* ---------- brand mark ---------- */
.mark { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 6px solid var(--marker); flex: none; }
.mark-l { width: 44px; height: 44px; border-width: 12px; }
.wordmark { font-weight: 700; font-size: 1.25rem; letter-spacing: -.03em; }

/* ---------- app shell (okvir v2: siva podloga, bočna traka na njoj, sadržaj u bijeloj ploči) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; align-items: start; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  padding: 14px 12px 12px; background: var(--sidebar-bg); color: var(--sidebar-ink);
}
.sidebar > * { flex: none; }
.btn.drawer-close { display: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; color: var(--ink); }
.brand:hover { text-decoration: none; }

/* kartica firme gore (D60): znak ili logo + ime */
.company-switch { position: relative; }
.company-switch > button, .company-switch > div.company-current, .company-current {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-s);
  background: none; border: 1px solid transparent; box-shadow: none; color: var(--ink); font: inherit; text-align: left;
}
.company-switch > button { cursor: pointer; }
.company-switch > button:hover { background: var(--sidebar-hover); }
.company-switch .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex: none; }
.company-switch .name, .company-current .name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-switch .icon { color: var(--ink-3); }
.company-logo {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 9px; overflow: hidden;
  background: transparent; color: var(--accent-ink);
}
.company-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.company-logo.is-initials { background: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
/* logo slabog kontrasta prema bijeloj kartici dobija ploču (app.js initLogoPlate) */
.company-logo.has-plate { background: var(--ink); padding: 4px; }
.company-logo.no-plate { background: transparent; }
.company-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--pop); padding: 6px; z-index: 30; }
.company-menu button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; font: inherit; border-radius: calc(var(--r-m) - var(--pop-pad)); cursor: pointer; text-align: left; color: var(--ink); }
.company-menu button:hover { background: var(--surface-2); }

/* pretraga u bočnoj traci (D01, D60): lupa i „Ctrl K“ unutar polja */
.search { position: relative; flex: 1; max-width: none; }
.sidebar .search { flex: none; }
.search input { display: block; width: 100%; height: 40px; padding: 0 64px 0 36px !important; background: var(--bezel) !important; border-color: var(--line) !important; }
.search > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); pointer-events: none; }
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; height: 22px; padding: 0 6px;
  border: 1px solid var(--line); border-radius: var(--r-xs); background: var(--surface); color: var(--ink-3); font: 600 var(--t-xs)/1 var(--font); cursor: pointer;
}
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--pop); padding: 6px; z-index: 40; max-height: 60vh; overflow: auto; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: calc(var(--r-m) - var(--pop-pad)); color: var(--ink); }
.search-results a:hover, .search-results a:focus { background: var(--surface-2); text-decoration: none; }
.search-results a.is-active { background: var(--accent-soft); }
.search-results .search-more { justify-content: center; gap: 8px; margin-top: 4px; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--r-s) var(--r-s); color: var(--accent); font-weight: 600; font-size: var(--t-s); }
.search-results .search-empty { padding: 10px; }

/* mali natpisi: Inter u verzalu (nema mono fonta, nula ostaje obična) */
.eyebrow { font-size: var(--t-xs); font-weight: 600; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--ink-3); line-height: 1.3; }
.code { white-space: nowrap; font-size: var(--t-s); font-weight: 500; color: var(--ink-4); font-variant-numeric: tabular-nums; margin-left: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 10px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px 0 12px; border-radius: var(--r-s); border: 1px solid transparent;
  color: var(--sidebar-ink); font-weight: 500; font-size: var(--t-m); position: relative;
}
.nav a .icon { color: var(--ink-3); }
.nav a:hover { background: var(--sidebar-hover); text-decoration: none; }
.nav a.is-active { background: var(--sidebar-active); border-color: transparent; color: var(--ink); }
.nav a.is-active .icon { color: var(--ink); }
.nav .count { margin-left: auto; font-size: var(--t-s); font-weight: 500; color: var(--ink-3); }
/* podmeniji u bočnoj traci: grupa (details) = radius --r-m i razmak 4 px, pa stavka unutra ima --r-m − 4 px = --r-s (10 px) */
.nav-group { --group-pad: 4px; border-radius: var(--r-m); padding: var(--group-pad); margin: 0 calc(-1 * var(--group-pad)); border: 1px solid transparent; }
.nav-group { transition: background-color 160ms ease; }
.nav-group[open]:not(.is-closing) { background: var(--nav-open); }
/* glatka harmonika (sidebar.js): visinu animira JS, ovo samo skriva višak */
.nav .branch-wrap { overflow: hidden; }
/* omot za dno trake (Podešavanja + profil) ne mijenja raspored: stavke se slažu kao prije */
.sidebar-bottom { display: contents; }
.nav-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px 0 12px; border-radius: calc(var(--r-m) - var(--group-pad));
  color: var(--sidebar-ink); font-weight: 500; font-size: var(--t-m); border: 1px solid transparent;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary > span:not(.tag):not(.count):not(.nav-dot):not(.nav-badge) { flex: 1; min-width: 0; }
/* polje brojača (core:nav_counters dopunjava u pozadini) ne mijenja raspored: značke se slažu kao da su direktno u stavci */
.nav-badge { display: contents; }
.nav-group > summary .icon { color: var(--ink-3); }
.nav-group > summary:hover { background: var(--sidebar-hover); }
.nav-group.is-active > summary { color: var(--ink); }
.nav-group.is-active > summary .icon:first-child { color: var(--accent); }
.nav-group > summary .nav-chevron { margin-left: auto; width: 14px; height: 14px; transition: transform 160ms ease; }
.nav-group[open]:not(.is-closing) > summary .nav-chevron { transform: rotate(90deg); }
.nav-group > summary .count, .nav-group > summary .nav-new, .nav-group > summary .nav-dot, .nav-group > summary .nav-feature { margin-left: auto; }
.nav-group > summary .nav-badge:has(*) + .nav-chevron, .nav-group > summary .nav-feature ~ .nav-chevron { margin-left: 8px; }
.nav-group > summary:focus-visible, .nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav .branch { position: relative; margin: 0 0 2px 21px; padding: 1px 0 1px 13px; display: flex; flex-direction: column; gap: 2px; }
.nav .branch::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 4px; width: 1px; background: var(--line); }
.nav .branch a { height: auto; min-height: 38px; padding: 6px 10px 6px 12px; }
.nav .branch a > span:first-child { flex: 1; min-width: 0; }
.nav .nav-feature { margin-left: 8px; height: 20px; padding: 0 6px; font-size: 11px; letter-spacing: .04em; }
.nav .branch .nav-feature, .nav > a .nav-feature { margin-left: auto; }
.nav .nav-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); flex: none; }
.nav-admin { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.nav-admin + .sidebar-foot { margin-top: 0; }
.sidebar-foot { margin-top: auto; padding-top: 4px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 4px; padding: 0 0 0 6px; }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); border-radius: var(--r-s); }
.me-link:hover { text-decoration: none; }
.me .who { min-width: 0; }
.me .who strong { display: block; font-size: var(--t-m); font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { display: block; font-size: var(--t-s); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .menu-up { top: auto; bottom: calc(100% + 6px); }

/* bijela radna ploča (D59): na desktopu je .main ploča, a zaglavlje i traka stranice su unutar nje */
.main { min-width: 0; display: flex; flex-direction: column; position: relative; margin: 10px 10px 10px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-1); min-height: calc(100vh - 20px); }
.demo-banner {
  background: #b42318; color: #fff; padding: 6px 14px; text-align: center; font-weight: 700; font-size: var(--t-s); letter-spacing: .02em;
  border-radius: 0;
}
.topbar { display: flex; align-items: center; gap: 4px; }
.topbar .menu-btn, .topbar .mobile-brand, .topbar .search-toggle, .topbar .account-menu { display: none; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
/* desktop: zvono (i odjava PIN radnika) stoje u traci stranice, desno gore */
.topbar { position: absolute; top: 22px; right: var(--content-pad); height: 40px; z-index: 20; }
.demo-banner + .topbar { top: 53px; }
.sidebar-demo { background: #b42318; color: #fff; padding: 6px 10px; text-align: center; font-weight: 700; font-size: var(--t-s); letter-spacing: .02em; border-radius: var(--r-s); }
@media (min-width: 901px) {
  .main > .demo-banner { display: none; }
  .demo-banner + .topbar { top: 22px; }
}
@media (max-width: 900px) { .sidebar-demo { display: none; } }
.pagebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; margin: 22px var(--content-pad) 0; padding-right: 54px; }
.pagebar-pin { padding-right: 190px; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: var(--t-m); color: var(--ink-2); min-width: 0; }
.crumb .icon { color: var(--ink-3); }
.pagedate { font-size: var(--t-s); color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bell { position: relative; }
.bell > .btn { gap: 0; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink-2); }
.bell > .btn:hover { background: var(--surface-2); }
.bell .dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--bad-bar); color: var(--on-bad-bar); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); box-sizing: content-box; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--pop); z-index: 40; overflow: hidden; }
@media (max-width: 640px) { .bell .dropdown { position: fixed; left: 8px; right: 8px; top: 64px; width: auto; } }
.dropdown-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.dropdown-body { max-height: 60vh; overflow: auto; }

.content { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 8px var(--content-pad) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 14px 0 22px; }
.page-head .crumbs { font-size: var(--t-s); color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-head .crumbs a { color: var(--ink-3); }
.page-head .lead { color: var(--ink-3); margin-top: 6px; max-width: 70ch; }
/* opis stranice rezerviše dva reda (širi stupac): tabovi i sadržaj ispod ostaju na istom mjestu bez obzira na dužinu opisa */
@media (min-width: 901px) { .page-head .lead { max-width: 100ch; min-height: 3em; } }
@media (min-width: 1200px) { .page-head > :first-child { flex: 1 1 0; min-width: 0; } }
.page-head + .page-note, .page-head ~ .page-note { margin: -8px 0 20px; }
.page-count { margin: -12px 0 14px; }
.page-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- layout helpers ---------- */
/* vertikalni ritam: susjedni blokovi sadržaja imaju razmak sami (nula specifičnosti, pa .stack i .mt-* i dalje odlučuju) */
:where(.stats, .statstrip, .bezel, .panel, .grid-2, .grid-3, .grid-main, .grid-main-l) + :where(.stats, .statstrip, .bezel, .panel, .grid-2, .grid-3, .grid-main, .grid-main-l) { margin-top: var(--block-gap); }
:where(.grid-2, .grid-3, .grid-main, .grid-main-l, .row, .stats, .statstrip) > * { margin-top: 0; }
.stack > * + * { margin-top: 16px; }
.stack-l > * + * { margin-top: 28px; }
.stack-s > * + * { margin-top: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.grid-main-l { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.muted { color: var(--ink-3); }
.faint { color: var(--ink-4); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-s { margin-top: 8px; }
.mt-m { margin-top: 16px; }
.mt-l { margin-top: 28px; }
.mb-m { margin-bottom: 16px; }
.pre { white-space: pre-line; }
/* Tabelarne cifre samo gdje se brojevi poravnavaju (kolone, kartice, procenti); u tekstu bi nula bila precrtana. */
.num, .table td.right, .table th.right, .stat .value, .big-num, .stat-value, .progress-label .pct, .nav .count, .tabs .count, .pagedate, .ring-num, .daybox, .right-num { font-variant-numeric: tabular-nums; }
.big-num { font-size: var(--t-3xl); font-weight: 600; letter-spacing: var(--ls-num); line-height: 1; }

/* ---------- home: Hitno / Kasnije ---------- */
.page-head-home h1 { font-size: var(--t-xl); }
.list-label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 18px 6px; font-size: var(--t-s); font-weight: 600; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.list-label-urgent { color: var(--bad); }
.list-label .count { font-size: var(--t-xs); background: var(--neutral-soft); color: var(--ink-2); border-radius: 999px; padding: 0 7px; }
.list-label + .list + .list-label { border-top: 1px solid var(--line-2); }
.task-icon { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--r-m); border: 1px solid; }
.task-bad { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.task-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.task-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* ---------- fold: sklopiva sekcija ({% fold %}) ---------- */
.fold > summary { cursor: pointer; list-style: none; min-height: 48px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary h3 { flex: 1; }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary:focus-visible { outline-offset: -2px; }
.fold:not([open]) > summary { border-bottom: 0; }
.fold-count { font-size: var(--t-s); color: var(--ink-3); white-space: nowrap; }
.fold-count.is-done { color: var(--ok); font-weight: 600; }
.fold-count .icon { margin-right: 4px; display: none; }
.fold-count.is-done .icon { display: inline-block; }
.fold-chevron { display: inline-flex; color: var(--ink-3); transition: transform .15s; flex: none; }
.fold[open] > summary .fold-chevron { transform: rotate(180deg); }
.fold-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fold-title h3 { margin: 0; }
/* flush=True: sekcija unutar postojećeg panela (npr. grupe pitanja u obrascu ocjene) */
.fold-flush { border-top: 1px solid var(--line-2); }
.fold-flush:first-child { border-top: 0; }
.fold-flush > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; }
.fold-flush > summary h3 { font-size: var(--t-l); }
@media (max-width: 640px) {
  .fold-flush > summary { padding-left: 14px; padding-right: 14px; }
}

/* ---------- panels & lists ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
/* D06: obojeno dijete na uglu nasljeđuje radijus kartice (ne overflow:hidden — siječe fokus i menije) */
.panel > :first-child, .panel > .list:first-child > :first-child, .panel > div:first-child > :first-child { border-top-left-radius: calc(var(--r-m) - 1px); border-top-right-radius: calc(var(--r-m) - 1px); }
.panel > :last-child, .panel > .list:last-child > :last-child, .panel > div:last-child > :last-child { border-bottom-left-radius: calc(var(--r-m) - 1px); border-bottom-right-radius: calc(var(--r-m) - 1px); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head h2, .panel-head h3 { font-size: var(--t-l); font-weight: 600; }
.panel-head .hint { font-size: var(--t-s); color: var(--ink-3); }
.panel-body { padding: 18px; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-m) var(--r-m); }
.panel.flush .panel-body { padding: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.section-title h2 { font-size: var(--t-l); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > .item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-2); }
.list > li:first-child, .list > .item:first-child { border-top: 0; }
a.item { color: inherit; }
a.item:hover { background: var(--surface-2); text-decoration: none; }
.item-title { font-weight: 600; }
.item-meta { font-size: var(--t-s); color: var(--ink-3); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); }
.stat { padding: 16px 18px; border-left: 1px solid var(--line-2); }
.stat:first-child { border-left: 0; }
.stat .label { font-size: var(--t-s); color: var(--ink-3); }
.stat .value { font-size: var(--t-2xl); font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .sub { font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; position: relative; } /* relative: visually hidden labels stay inside */
.table { width: 100%; border-collapse: collapse; font-size: var(--t-m); }
.table th { text-align: left; font-weight: 600; font-size: var(--t-xs); letter-spacing: .04em; color: var(--ink-3); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; height: 48px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .actions { text-align: right; white-space: nowrap; }
.table th.right { text-align: right; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.panel > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--r-m); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; min-height: var(--control-h);
  border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: var(--t-m); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  box-shadow: var(--shadow-1); transition: background-color .12s, border-color .12s;
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-primary { background-color: var(--primary); background-image: none; border-color: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-btn); }
.btn-primary:hover { background-color: var(--primary-top); background-image: none; border-color: var(--primary-top); }
.btn-l { min-height: var(--tap); padding: 0 18px; }
.btn-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); box-shadow: none; }
.btn-warn:hover { background: var(--warn-hover); border-color: var(--warn-line); }
.btn-soft { background: var(--info-soft); border-color: var(--info-line); color: var(--info); box-shadow: none; }
.btn-soft:hover { background: var(--info-hover); border-color: var(--info-line); }
.btn-danger { color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-soft); border-color: var(--bad-line); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--ghost-hover); border-color: transparent; }
.btn-s { min-height: 32px; padding: 0 10px; font-size: var(--t-s); }
.btn-icon { padding: 0; width: var(--control-h); flex: none; }
.btn-s.btn-icon { width: 32px; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; cursor: not-allowed; }
/* aria-disabled: izgleda kao onemogućeno, ali ostaje u redoslijedu tastature i pokazuje objašnjenje (title) */
.btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.small { padding: 2px 6px; border-radius: var(--r-xs); }
form.inline { display: inline; }

/* ---------- forms ---------- */
label { font-weight: 600; font-size: var(--t-s); color: var(--ink-2); }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), select, textarea {
  width: 100%; padding: 9px 12px; min-height: var(--control-h); border: 1px solid var(--line-strong); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-m); transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; padding: 10px 14px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2355555E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
select[multiple] { background-image: none; padding-right: 12px; min-height: 140px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
input[type=color] { width: 48px; height: var(--control-h); padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--surface); cursor: pointer; }
/* uzorak prati radijus polja: unutra = vani − okvir (1px) − razmak (3px); bez drugog okvira */
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; border-radius: calc(var(--r-s) - 4px); }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: calc(var(--r-s) - 4px); }
input[type=color]::-moz-color-swatch { border: 0; border-radius: calc(var(--r-s) - 4px); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field, .field + .field-row, .field-row + .field, .field-row + .field-row { margin-top: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.field-row > .field + .field { margin-top: 0; }
.field .help { font-size: var(--t-s); color: var(--ink-3); margin: 0; }
.field .error, .form-error { font-size: var(--t-s); color: var(--bad); margin: 0; font-weight: 600; }
.field.has-error :is(input, select, textarea, .picker-box),
.field:has(> .error) :is(input:not([type=checkbox]):not([type=radio]), select, textarea, .picker-box),
.field:has(> .form-error) :is(input:not([type=checkbox]):not([type=radio]), select, textarea, .picker-box),
[aria-invalid="true"] { border-color: var(--bad) !important; }
.field:has(> .error) :is(input, select, textarea):focus { box-shadow: 0 0 0 3px var(--bad-soft); }
.panel.has-error { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.field .req { color: var(--bad); margin-left: 2px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: var(--t-m); color: var(--ink); cursor: pointer; }
.check:has(.help) { align-items: flex-start; }
.check:has(.help) input { margin-top: 2px; }
.check .help { display: block; font-weight: 400; font-size: var(--t-s); color: var(--ink-3); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.form-card { max-width: 760px; }
.panel-form-open { background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.value-emoji { font-size: 1.4rem; width: 32px; text-align: center; }
.field-row-values { grid-template-columns: 96px minmax(0, 1fr) 120px; align-items: start; }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset + .fieldset { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.fieldset legend { font-weight: 700; font-size: var(--t-l); margin-bottom: 4px; padding: 0; }
.fieldset .legend-help { color: var(--ink-3); font-size: var(--t-s); margin: 0 0 14px; }

/* segmented choice (ratings 1–5, levels 0–4) */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: var(--control-h); padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--surface); font-weight: 700; font-size: var(--t-m); color: var(--ink-2);
}
.segmented label:hover span { border-color: var(--line-strong); background: var(--surface-2); }
.segmented input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* traka s jednom podlogom (podešavanja): aktivna opcija je podignuta, radius unutra = vani − razmak */
.segmented-bar { gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); flex-wrap: nowrap; }
.segmented-bar span { height: calc(var(--control-h) - 8px); min-width: 0; padding: 0 12px; border: 0; background: transparent; border-radius: calc(var(--r-s) - 4px); font-weight: 600; }
.segmented-bar label:hover span { background: var(--surface); }
.segmented-bar input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line-strong); }
.scale-legend { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--ink-3); margin-top: 6px; max-width: 290px; }

/* ---------- badges, chips ---------- */
.badge, .tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid var(--neutral-line); font-size: var(--t-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--neutral-soft); color: var(--ink-3); white-space: nowrap; line-height: 1; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok, .tag-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.badge-warn, .tag-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.badge-bad, .tag-bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.badge-info, .tag-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.badge-neutral, .tag-neutral { background: var(--neutral-soft); border-color: var(--neutral-line); color: var(--ink-3); }
.badge-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge-ink { background: var(--ink); border-color: var(--ink); color: var(--ink-inverse); }
.delta { height: 22px; padding: 0 7px; }

.avatar {
  --size: 32px; width: var(--size); height: var(--size); border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: max(11px, calc(var(--size) * .38)); font-weight: 600; color: var(--ink-2); letter-spacing: .01em; overflow: hidden; background: var(--sunken); user-select: none;
}
.avatar[style] { color: var(--avatar-ink); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --size: 22px; }
.avatar-s { --size: 28px; }
.avatar-l { --size: 48px; }
.avatar-xl { --size: 84px; }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar + .avatar { margin-left: -8px; }
.person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; color: inherit; }
a.person:hover { text-decoration: none; }
a.person:hover .person-name { text-decoration: underline; text-underline-offset: 2px; }
.person-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-sub { font-size: var(--t-s); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person > div { min-width: 0; }

/* ---------- progress ---------- */
.progress { height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.progress > span { display: block; height: 100%; border-radius: 4px; background: var(--brand-bar); }
.progress.ok > span { background: var(--ok); }
.progress.warn > span { background: var(--warm); }
.progress.bad > span { background: var(--bad); }
.progress-thin { height: 5px; }
.progress-label { display: flex; align-items: center; gap: 10px; }
.progress-label .progress { flex: 1; }
.progress-label .pct { font-weight: 700; font-size: var(--t-s); min-width: 40px; text-align: right; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 12px; color: var(--ink-3); font-weight: 600; border: 0; background: none; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs.is-scrollable { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { font-size: var(--t-xs); background: var(--neutral-soft); color: var(--ink-2); border-radius: 999px; padding: 0 7px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { width: auto; min-width: 160px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.filters .search-input { min-width: 240px; flex: 1 1 240px; max-width: 420px; }

/* ---------- empty, notices, toasts ---------- */
.empty { text-align: center; padding: 40px 24px; color: var(--ink-3); }
.empty .empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 14px; }
.notice { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink); }
.notice .icon { color: var(--accent); margin-top: 2px; }
.notice-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.notice-warn .icon { color: var(--warn); }
.notice-bad { background: var(--bad-soft); border-color: var(--bad-line); }
.notice-bad .icon { color: var(--bad); }
.notice-ok { background: var(--ok-soft); border-color: var(--ok-line); }
.notice-ok .icon { color: var(--ok); }
.toasts { position: fixed; right: 20px; top: calc(var(--topbar-h) + 12px); z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); pointer-events: none; }
.toasts .toast { pointer-events: auto; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: var(--r-m); background: var(--ink); color: var(--ink-inverse); box-shadow: var(--pop); font-weight: 500; }
.toast .icon { margin-top: 0; flex: none; }
.toast.error { background: var(--bad); }
.toast button { margin: 0 0 0 auto; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-s); background: none; border: 0; color: var(--ink-inverse); cursor: pointer; padding: 0; flex: none; }
.toast button:hover { background: var(--toast-hover); }
/* „Poništi“ u toastu (core/undo.py): tekstualno dugme, meta ≥ 40 px */
.toast .toast-undo { margin-left: auto; flex: none; }
.toast .toast-undo + button { margin-left: 0; }
.toast button.toast-undo-btn { width: auto; min-height: 40px; height: auto; padding: 0 12px; gap: 6px; font: inherit; font-weight: 600; border: 1px solid rgba(255,255,255,.4); }
.toast button.toast-undo-btn:hover, .toast button.toast-undo-btn:focus-visible { background: rgba(255,255,255,.18); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { width: min(560px, 100%); background: var(--surface); border-radius: var(--r-l); box-shadow: var(--pop); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--r-l) var(--r-l); }

/* ---------- dropdown menu ---------- */
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--pop); padding: var(--pop-pad); z-index: 40; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(var(--r-m) - var(--pop-pad)); color: var(--ink); background: none; border: 0; font: inherit; text-align: left; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--surface-2); text-decoration: none; }
.menu-list .danger { color: var(--bad); }
.theme-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--sunken); border-radius: var(--r-s); }
.theme-switch button { padding: 6px 12px; border: 0; border-radius: calc(var(--r-s) - 3px); background: none; color: var(--ink-2); font: inherit; font-size: var(--t-s); font-weight: 600; cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.menu-list .menu-theme { padding: 6px 10px 4px; display: grid; gap: 6px; }
.menu-list .menu-theme .theme-switch { display: flex; }
.menu-list .menu-theme .theme-switch button { flex: 1; width: auto; padding: 6px 4px; justify-content: center; font-size: var(--t-xs); display: block; text-align: center; min-height: 0; }
.menu-version { font-size: var(--t-s); padding: 6px 0 2px; text-align: center; user-select: all; }
.menu-sep { height: 1px; background: var(--line-2); margin: 6px calc(-1 * var(--pop-pad)); }
.menu-list .menu-note { display: flex; gap: 8px; align-items: flex-start; margin: 4px calc(-1 * var(--pop-pad)) 0; padding: 8px calc(10px + var(--pop-pad)) 4px; max-width: 280px; white-space: normal; font-size: var(--t-s); color: var(--ink-3); border-top: 1px solid var(--line-2); }
.menu-list .menu-note .icon { margin-top: 2px; }

/* ---------- notifications ---------- */
.note { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.note:hover { background: var(--surface-2); text-decoration: none; }
.note.unread .note-title { font-weight: 700; }
.note.unread::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.note .note-title { font-weight: 600; font-size: var(--t-s); }
.note .note-meta { font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- org chart ---------- */
.orgtree, .orgtree ul { list-style: none; margin: 0; padding: 0; }
.orgtree ul { margin-left: 22px; padding-left: 18px; border-left: 1px solid var(--line); }
.orgtree li { position: relative; padding: 6px 0; }
.orgtree ul > li::before { content: ""; position: absolute; left: -18px; top: 26px; width: 14px; border-top: 1px solid var(--line); }
.org-node { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); max-width: 100%; }
.org-node .toggle { border: 0; background: var(--surface-2); border-radius: var(--r-s); width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-3); }
.org-node .reports { font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- profile header ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { font-size: var(--t-2xl); }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.meta-list dt { color: var(--ink-3); font-size: var(--t-s); }
.meta-list dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- heatmap & nine-box ---------- */
.heat { border-radius: var(--r-s); padding: 6px 8px; font-weight: 700; text-align: center; font-size: var(--t-s); min-width: 52px; }
.heat-1 { background: var(--heat-1-bg); color: var(--heat-1-ink); } .heat-2 { background: var(--heat-2-bg); color: var(--heat-2-ink); }
.heat-3 { background: var(--heat-3-bg); color: var(--heat-3-ink); } .heat-4 { background: var(--heat-4-bg); color: var(--heat-4-ink); }
.heat-5 { background: var(--heat-5-bg); color: var(--heat-5-ink); }
.heat-na { color: var(--ink-4); background: var(--surface-2); font-weight: 500; }
.ninebox { display: grid; grid-template-columns: 34px repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(130px, auto)) 30px; gap: 6px; }
.ninebox .axis-y { grid-row: 1 / 4; writing-mode: vertical-rl; transform: rotate(180deg); display: flex; align-items: center; justify-content: center; font-size: var(--t-s); color: var(--ink-3); font-weight: 600; }
.ninebox .axis-x { grid-column: 2 / 5; display: flex; align-items: center; justify-content: center; font-size: var(--t-s); color: var(--ink-3); font-weight: 600; }
.box { border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); padding: 10px; min-width: 0; }
.box h4 { font-size: var(--t-s); display: flex; justify-content: space-between; gap: 8px; }
.box .box-sub { font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 8px; }
.box.tone-ok { background: var(--tone-ok-bg); border-color: var(--ok-line); }
.box.tone-warn { background: var(--tone-warn-bg); border-color: var(--warn-line); }
.box.tone-bad { background: var(--tone-bad-bg); border-color: var(--bad-line); }
.box .people { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- misc components ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); font-size: var(--t-s); }
.kv:last-child { border-bottom: 0; }
.chart-box { position: relative; height: 260px; }
.chart-box.s { height: 180px; }
.dist { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-2); }
.dist > span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.quote { border-left: 3px solid var(--line); padding: 2px 0 2px 14px; color: var(--ink-2); }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; border-left: 1px solid var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--t-s); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px; word-break: break-all; }
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.saved-flag { font-size: var(--t-xs); color: var(--ok); font-weight: 700; }
.drawer-backdrop { display: none; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-art { position: relative; background: var(--night); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background-image: url("../img/contours.bf79b9c075f1.svg"); background-size: 1100px auto; background-position: center; }
.auth-art h1 { font-size: var(--t-4xl); line-height: 1.02; letter-spacing: -.035em; max-width: 12ch; }
.auth-art .auth-art-foot { color: var(--night-ink); }
.auth-art p { color: var(--night-ink); max-width: 40ch; font-size: var(--t-l); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: min(420px, 100%); }
.auth-card h2 { font-size: var(--t-2xl); margin-bottom: 6px; }
.auth-card .lead { color: var(--ink-3); margin-bottom: 24px; }
.pin-input { letter-spacing: .5em; font-size: var(--t-xl) !important; text-align: center; font-weight: 700; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-main, .grid-main-l { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; max-width: 86vw; z-index: 70; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s; background: var(--frame); padding-top: 62px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); height: 100vh; height: 100dvh; bottom: auto; }
  .sidebar.open { transform: translateX(0); visibility: visible; transition-delay: 0s; box-shadow: var(--pop); }
  /* kartica korisnika uvijek vidljiva na dnu menija; navigacija se skroluje iznad nje */
  .sidebar-foot { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin-bottom: calc(-20px - env(safe-area-inset-bottom)); padding: 8px 0 calc(16px + env(safe-area-inset-bottom)); background: var(--frame); z-index: 1; }
  .sidebar .nav-admin { padding-bottom: 32px; }
  .btn.drawer-close { display: inline-flex; position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; }
  /* telefon: mete za dodir najmanje 44 px */
  .nav a, .nav-group > summary { min-height: 44px; height: auto; }
  .nav .branch a { min-height: 44px; }
  body.nav-locked { overflow: hidden; }
  .drawer-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(17,17,19,.72); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); z-index: 65; }
  /* zaglavlje: traka od 56 px; zvono i odjava više nisu apsolutno u uglu ploče */
  .topbar { position: sticky; top: 0; right: auto; height: 56px; padding: 0 8px; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; gap: 4px; }
  .demo-banner + .topbar { top: 31px; }
  .demo-banner { position: sticky; top: 0; z-index: 25; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar .mobile-brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; min-height: 44px; color: var(--ink); font-weight: 600; font-size: 15px; }
  .topbar .mobile-brand:hover { text-decoration: none; }
  .topbar .mobile-brand .company-logo { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
  .topbar .mobile-brand .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .search-toggle, .topbar .account-menu { display: inline-flex; }
  .topbar-actions { gap: 2px; }
  .topbar .btn { min-width: 44px; min-height: 44px; }
  .topbar .account-menu .btn { padding: 0; }
  .pagebar, .pagebar-pin { margin: 14px 16px 0; padding-right: 0; }
  .content { padding: 4px 16px 48px; }
  .search.is-open { box-shadow: var(--pop); }
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-art { padding: 28px 24px; min-height: 0; }
  .auth-art h1 { font-size: var(--t-2xl); }
  .auth-art .auth-art-foot { display: none; }
}
@media (max-width: 640px) {
  body { background: var(--surface); }
  .main { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .topbar, .demo-banner { border-radius: 0; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: var(--t-xl); }
  .stat { border-left: 0; border-top: 1px solid var(--line-2); }
  .stat:first-child { border-top: 0; }
  .list > li, .list > .item { padding: 12px 14px; }
  .panel-body { padding: 14px; }
  .panel-head { padding: 12px 14px; }
  .ninebox { grid-template-columns: 24px repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(100px, auto)) 26px; gap: 4px; }
  .box { padding: 6px; }
  /* Phones: toasts drop in under the topbar, never over sticky submit bars at the bottom. */
  .toasts { left: 12px; right: 12px; top: 68px; bottom: auto; max-width: none; }
  /* Sign-in on a small phone: a slim brand bar, so the form is visible without scrolling. */
  .auth-art { padding: 14px 20px; }
  .auth-art .auth-art-copy { display: none; }
  .auth-form { align-items: flex-start; padding: 24px 20px 40px; }
  .auth-card h2 { font-size: var(--t-xl); }
  .auth-card .lead { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .page-actions, .toasts, .no-print { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .panel { border-color: #ccc; }
}
.page-head .crumbs:empty, .page-head .lead:empty { display: none; }
@media (max-width: 640px) {
  .hide-s { display: none !important; }
  .btn .hide-s, a .hide-s { display: inline !important; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .btn .hide-s.search-kbd { display: none !important; }
}

/* ---------- people picker ---------- */
.picker { position: relative; }
.picker-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: var(--control-h); padding: 4px 6px; border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--surface); }
.picker-box.is-open, .picker-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.picker-box .picker-input { flex: 1; min-width: 160px; border: 0 !important; border-radius: calc(var(--r-s) - 4px) !important; box-shadow: none !important; padding: 0 8px !important; min-height: calc(var(--control-h) - 10px) !important; height: calc(var(--control-h) - 10px); background: transparent !important; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 4px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: var(--t-s); font-weight: 600; }
.chip button { border: 0; background: none; padding: 0 2px; display: inline-flex; color: var(--ink-3); cursor: pointer; }
.chip button:hover { color: var(--bad); }
.chip button { border-radius: 999px; min-width: 22px; min-height: 22px; align-items: center; justify-content: center; }
.chip button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; background: var(--surface); color: var(--bad); }
.picker-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border-radius: var(--r-m); box-shadow: var(--pop); padding: 6px; z-index: 50; max-height: 320px; overflow: auto; }
.picker-option { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px; border: 0; background: none; border-radius: calc(var(--r-m) - var(--pop-pad)); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.picker-option:hover, .picker-option:focus { background: var(--surface-2); }
.picker-option.is-active { background: var(--accent-soft); }
.picker-empty { padding: 10px 12px; }
.picker-count { margin: 6px 0 0; font-size: var(--t-xs); color: var(--ink-3); text-align: right; }
input:disabled, select:disabled, textarea:disabled, fieldset:disabled input, fieldset:disabled select, fieldset:disabled textarea {
  background: var(--surface-2) !important; color: var(--ink-3); cursor: not-allowed; }
@media print { .main { display: block; margin: 0; border: 0; box-shadow: none; } }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: var(--ink-inverse); }
.btn-danger-solid:hover { background: var(--bad-hover); border-color: var(--bad-hover); }
.confirm-text { font-size: var(--t-l); font-weight: 600; margin: 0; }
.confirm-body { display: flex; gap: 14px; align-items: center; }
.confirm-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.confirm-icon.is-danger { background: var(--bad-soft); color: var(--bad); }

/* ---------- image upload ---------- */
.file-pick { display: flex; flex-direction: column; gap: 10px; }
.file-current { display: flex; align-items: center; gap: 14px; }
.file-thumb { max-height: 48px; max-width: 160px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface-2); padding: 4px; }
.file-btn { cursor: pointer; }
.file-pick .row { align-items: center; }
.file-pick input:focus-visible + span, .file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=file] { font: inherit; font-size: var(--t-s); color: var(--ink-3); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; padding: 7px 12px; margin-right: 10px; border: 1px solid var(--line); border-radius: calc(var(--r-s) - 2px); background: var(--surface); color: var(--ink); cursor: pointer; }

/* ---------- accessibility ---------- */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 10px 14px; border-radius: var(--r-s); background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--pop); }
.skip-link:focus { top: 12px; text-decoration: none; }
.content:focus { outline: none; }

/* ---------- dates: the chosen date in words under a native date input (app.js) ---------- */
.date-echo { font-size: var(--t-s); color: var(--ink-3); }
.date-echo:empty { display: none; }
.date-echo.is-hint { color: var(--ink-3); }

/* ---------- error pages inside the app ---------- */
.error-page { margin-top: 24px; }
.error-page .empty { padding: 56px 24px; }
.error-title { font-size: var(--t-xl); margin-bottom: 8px; color: var(--ink); }

/* ---------- people admin, directory ---------- */
.results-count { margin: 0 0 8px; }
.newcomer { align-items: center; flex-wrap: wrap; }
.newcomer form { margin-left: auto; }

/* ---------- import preview ---------- */
.import-errors { margin: 6px 0 0; padding-left: 18px; }
.create-group + .create-group { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.create-list { list-style: none; margin: 8px 0 0 27px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.create-list .icon { vertical-align: -2px; }
.import-rows > li.import-row { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); gap: 6px 20px; align-items: start; }
.import-who { min-width: 0; }
.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--t-s); min-width: 0; }
.changes .old { color: var(--ink-3); }
.changes .warn { display: flex; gap: 6px; align-items: flex-start; color: var(--warn); }
.changes .warn .icon { margin-top: 2px; }
.changes li.planned { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.changes li.planned .badge { flex: none; }
@media (max-width: 640px) {
  .import-rows > li.import-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .changes { gap: 8px; }
  .changes li.planned { padding: 4px 0; }
  .newcomer form { margin-left: 0; }
}

.people-table .btn-icon { min-width: 40px; min-height: 40px; }

/* People admin on a phone: the row menu must stay on screen; long names are shortened instead. */
@media (max-width: 640px) {
  .people-table { table-layout: fixed; }
  .people-table th, .people-table td { padding-left: 8px; padding-right: 8px; }
  .people-table .col-access { width: 112px; }
  .people-table .col-actions { width: 46px; }
  .people-table td:first-child .person { max-width: 100%; }
  .people-table .badge { white-space: normal; }
  .menu-list a, .menu-list button { min-height: 40px; }
}

@media (max-width: 640px) {
  /* Touch targets: text links in headers and breadcrumbs get a taller hit area without changing the layout. */
  .page-head .crumbs a, .panel-head a.small { display: inline-block; padding: 8px 0; margin: -8px 0; }
}

/* V06: masovne radnje iz liste ljudi (bar iznad liste, kolona izbora, 40 px mete dodira). */
.bulk-bar { margin-bottom: 16px; }
.bulk-bar-body { gap: 8px 16px; align-items: center; justify-content: space-between; }
.bulk-bar-body > .strong, .bulk-all { flex: none; }
.bulk-all { gap: 8px; min-height: 40px; }
.bulk-actions { gap: 8px; flex: 1 1 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bulk-actions .btn { justify-content: center; }
.bulk-all input { margin: 0; }
.people-table .col-check { width: 48px; padding-left: 4px; padding-right: 4px; text-align: center; }
.bulk-check-label { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  .people-table .col-check { width: 44px; }
  .bulk-actions { grid-template-columns: minmax(0, 1fr); }
  .bulk-actions .btn { min-height: 40px; }
}

/* =====================================================================
   v2 komponente (uzor): pozdrav, kartica u okviru, traka brojeva, crtice, segmentirani tabovi, prsten,
   proces, „Zašto“, matrica kvadratića, stog avatara, lista s brojem u kutiji. Nove klase; postojeće se ne diraju.
   ===================================================================== */
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 39px 0 24px; } /* 39 = razmak zaglavlja stranice (14) + red krušnih mrvica (25): naslov Početne stoji na istoj visini kao naslovi ostalih stranica */
.greet h1 { font-size: var(--t-greet); line-height: 1.15; font-weight: 600; letter-spacing: var(--ls-tight); }
.greet p { margin: 10px 0 0; font-size: var(--t-l); color: var(--ink-3); max-width: 72ch; }
.greet p strong { color: var(--ink); font-weight: 600; }
.greet-actions { display: flex; gap: 10px; flex: none; }

.bezel { background: var(--bezel); border: 1px solid var(--bezel-line); border-radius: var(--r-l); padding: 5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.pad { padding: 18px 20px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--aside-w); gap: var(--panel-gap); margin-top: var(--panel-gap); align-items: start; }
.col-r { display: flex; flex-direction: column; gap: var(--panel-gap); }

.statstrip { display: grid; grid-template-columns: 300px minmax(0, 1fr); padding: 22px 26px 20px; }
.statstrip-lead { padding-right: 26px; border-right: 1px solid var(--line); }
.statstrip .big-num { font-size: var(--t-num-xl); font-weight: 500; letter-spacing: var(--ls-num); line-height: 1; margin: 18px 0 14px; }
.big-num small { font-size: 32px; color: var(--ink-4); font-weight: 400; letter-spacing: -.02em; margin-left: 4px; }
.since { display: flex; align-items: center; gap: 10px; font-size: var(--t-m); color: var(--ink-3); }
.statstrip-rest { padding-left: 32px; min-width: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-value { font-size: var(--t-num); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; }
.c-warn { color: var(--warn); } .c-bad { color: var(--bad); } .c-ok { color: var(--ok); }
.ticks { display: flex; gap: 2px; height: 46px; margin: 16px 0 12px; }
.ticks span { flex: 1 1 0; min-width: 1px; background: var(--ink); border-radius: 1px; }
.ticks .t-w { background: var(--warn-bar); } .ticks .t-b { background: var(--bad-bar); }
.statstrip .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font-size: var(--t-s); color: var(--ink-2); }
.statstrip .legend i { display: inline-block; width: 3px; height: 13px; border-radius: 1px; background: var(--ink); margin-right: 7px; vertical-align: -2px; }
.statstrip .legend .l-w { background: var(--warn-bar); } .statstrip .legend .l-b { background: var(--bad-bar); }
.statstrip .legend .note { margin-left: auto; color: var(--ink-3); }

.seg { display: inline-flex; padding: 4px; gap: 2px; background: var(--neutral-soft); border: 1px solid var(--neutral-line); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.seg a, .seg button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 0; background: none; font: inherit; font-size: var(--t-m); font-weight: 500; color: var(--ink-3); white-space: nowrap; cursor: pointer; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.seg b { font-weight: 600; color: var(--ink-4); }
.seg [aria-current="true"], .seg .is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.seg [aria-current="true"] b, .seg .is-active b { color: var(--ink-3); }
.seg .is-urgent[aria-current="true"] b, .seg .is-urgent.is-active b { color: var(--bad); }
.listhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }

.ring { position: relative; width: 52px; height: 52px; flex: none; }
.ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--t-s); font-weight: 600; }
.ring-empty { width: 52px; height: 52px; border-radius: 50%; border: 1.5px dashed var(--tick); display: grid; place-items: center; color: var(--ink-4); flex: none; }

.proc { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-2); }
.proc-head { display: flex; align-items: center; gap: 16px; }
.proc-head .grow { flex: 1; min-width: 0; }
.proc-title { font-size: var(--t-l); font-weight: 600; }
.proc-sub { font-size: var(--t-m); color: var(--ink-3); }
.right-num { text-align: right; flex: none; white-space: nowrap; }
.right-num b { display: block; font-size: var(--t-l); font-weight: 600; }
.right-num span { font-size: var(--t-m); color: var(--ink-3); }
.right-num .due-bad { color: var(--bad); font-weight: 500; }
.tickrule { height: 8px; margin: 18px 0; background: repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 5px); }
.proc-body { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; }
.miss { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.miss li { position: relative; padding-left: 18px; font-size: var(--t-m); line-height: 1.35; }
.miss li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--bad-bar); }
.miss small { display: block; color: var(--ink-3); font-size: var(--t-s); margin-top: 2px; }
.mini { margin-top: 12px; display: grid; grid-template-columns: auto minmax(36px, 1fr) 14px; align-items: center; gap: 12px 14px; font-size: var(--t-m); }
.mini .bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.mini .bar span { display: block; height: 100%; border-radius: 3px; background: var(--ink); }
.mini .bar .w { background: var(--warn-bar); } .mini .bar .b { background: var(--bad-bar); }
.mini .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.proc-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.proc-actions .avatar-stack { margin-left: auto; }

.why { background: var(--bad-soft); border: 1px solid var(--bad-line); border-radius: var(--r-m); padding: 16px 18px; color: var(--bad); }
.why h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.why p { margin: 0; font-size: var(--t-m); line-height: 1.5; color: var(--why-bad); }
.why .why-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bad-line); font-size: var(--t-m); }
.why .why-foot b { font-weight: 600; color: var(--why-bad); }
.why-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.why-warn p, .why-warn .why-foot b { color: var(--why-warn); } .why-warn .why-foot { border-color: var(--warn-line); }
.why-info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.why-info p, .why-info .why-foot b { color: var(--why-info); } .why-info .why-foot { border-color: var(--info-line); }

/* redovi procesa i liste ciklusa (ne dira stari .row) */
.prow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 80px minmax(96px, auto); align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); color: inherit; }
a.prow:hover { text-decoration: none; }
.prow .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .s { font-size: var(--t-m); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .mid { font-size: var(--t-m); color: var(--ink-3); white-space: nowrap; }
.prow .avatar-stack { justify-content: flex-end; }
.listfoot { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; font-size: var(--t-m); color: var(--ink-3); }
.listfoot a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 600; }

.card-head { display: flex; justify-content: space-between; gap: 12px; }
.card-head h2 { font-size: var(--t-l); font-weight: 600; }
.card-head p { margin: 2px 0 0; font-size: var(--t-s); color: var(--ink-3); }
.mx { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.mx-row-h { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-m); margin-bottom: 7px; }
.mx-row-h .r { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mx-row-h .r em { font-style: normal; color: var(--bad); margin-right: 8px; }
.cells { display: flex; flex-wrap: wrap; gap: 3px; }
.cells span { width: 12px; height: 12px; border-radius: 3px; background: var(--done-cell); }
.cells .w { background: var(--warn-bar); } .cells .b { background: var(--bad-bar); } .cells .g1 { background: var(--ink-2); }
.cells-l { gap: 4px; }
.cells-l span { width: 22px; height: 22px; border-radius: 5px; }
.mx-hidden { font-size: var(--t-s); color: var(--ink-3); padding: 7px 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-2); }
.mx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 16px; font-size: var(--t-s); color: var(--ink-3); }
.mx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--done-cell); margin-right: 6px; vertical-align: -1px; }
.mx-legend .w { background: var(--warn-bar); } .mx-legend .b { background: var(--bad-bar); } .mx-legend .g1 { background: var(--ink-2); }

.avatar-stack { display: flex; }
.avatar-stack .avatar { --size: 36px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -10px; }
.avatar-stack .avatar-more { background: var(--neutral-soft) !important; color: var(--ink-3); }

.eyebrow-i { display: flex; align-items: center; gap: 8px; color: var(--info); }
.eyebrow-i .icon { width: 16px; height: 16px; }
.blist { margin-top: 6px; }
.bitem { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; }
a.bitem:hover { text-decoration: none; }
.daybox { width: 48px; height: 48px; border-radius: 10px; border: 1px solid; display: grid; place-items: center; font-size: var(--t-l); font-weight: 600; flex: none; line-height: 1; text-align: center; }
.daybox small { display: block; font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; margin-top: 2px; }
.db-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.db-n { background: var(--neutral-soft); border-color: var(--neutral-line); color: var(--ink-2); }
.bitem .grow { flex: 1; min-width: 0; }
.bitem .t { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bitem .s { font-size: var(--t-s); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bitem .rt { text-align: right; flex: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bitem .rt span { display: block; font-size: var(--t-s); font-weight: 400; color: var(--ink-3); }
.bactions { display: flex; gap: 10px; margin-top: 16px; }
.bactions .btn-block { flex: 1; }

@media (max-width: 1100px) {
  .proc-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .proc-body .why { grid-column: 1 / -1; }
  .cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- telefon (≤ 640 px): mete 44 px, v2 komponente u jednoj koloni ---------- */
@media (max-width: 640px) {
  :root { --control-h: var(--tap); }
  .bezel { border-radius: 16px; padding: 4px; }
  .btn-s { min-height: var(--tap); padding: 0 12px; }
  .btn-s.btn-icon { width: var(--tap); }
  .me .btn-icon { width: var(--tap); height: var(--tap); }
  .filters select, .filters input, .tabs a, .tabs button, .segmented span { min-height: var(--tap); }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]), select { min-height: var(--tap); font-size: 16px; }
  .check, label:has(> input[type=radio]), label:has(> input[type=checkbox]) { min-height: 44px; align-items: center; }
  .greet { flex-direction: column; align-items: stretch; margin: 14px 0 18px; gap: 16px; }
  .greet h1 { font-size: 27px; }
  .greet p { font-size: var(--t-m); }
  .greet-actions { flex-direction: column-reverse; }
  .greet-actions .btn { width: 100%; min-height: var(--tap); }
  .statstrip { grid-template-columns: 1fr; padding: 18px 16px 16px; }
  .statstrip-lead { border-right: 0; padding: 0 0 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 16px; }
  .statstrip-lead .eyebrow { grid-column: 1 / -1; }
  .statstrip .big-num { font-size: 48px; margin: 10px 0 0; }
  .big-num small { font-size: 26px; }
  .since { flex-direction: column; align-items: flex-start; gap: 4px; padding-bottom: 4px; }
  /* Telefon: brojevi su u mreži 2×2 (glavni broj + tri) ili glavni broj preko cijele širine pa 2×2 (četiri); nema usamljene ćelije */
  .statstrip { grid-template-columns: 1fr 1fr; gap: 16px 12px; }
  .statstrip-lead { grid-column: 1 / -1; }
  .statstrip-rest, .stat-row { display: contents; }
  .statstrip-rest > .ticks, .statstrip-rest > .legend { grid-column: 1 / -1; }
  .statstrip:has(.stat-row > :nth-child(3):last-child) .statstrip-lead { grid-column: auto; display: block; padding: 0; border-bottom: 0; }
  .statstrip:has(.stat-row > :nth-child(3):last-child) .big-num { font-size: 26px; margin: 8px 0 0; letter-spacing: -.02em; line-height: 1.1; font-weight: 500; }
  .statstrip:has(.stat-row > :nth-child(3):last-child) .big-num small { font-size: 16px; }
  .statstrip:has(.stat-row > :nth-child(3):last-child) .since { margin-top: 6px; padding-bottom: 0; }
  .stat-row > :last-child:nth-child(odd):not(:nth-child(3)) { grid-column: 1 / -1; }
  .stat-value { font-size: 26px; }
  .ticks { height: 40px; gap: 1px; }
  .statstrip .legend .note { margin-left: 0; flex-basis: 100%; }
  .pad, .proc { padding: 16px; }
  .listhead { flex-direction: column; align-items: stretch; }
  .seg { display: flex; }
  .seg a, .seg button { height: 44px; flex: 1 1 auto; justify-content: center; padding: 0 8px; }
  .prow .code { display: none; }
  .prow .t, .prow .s, .bitem .s { white-space: normal; }
  .listfoot a { min-height: 44px; }
  .proc-head { flex-wrap: wrap; gap: 12px; }
  .proc-body { grid-template-columns: 1fr; gap: 20px; }
  .proc-actions { flex-direction: column; align-items: stretch; }
  .proc-actions .btn { min-height: var(--tap); }
  .proc-actions .avatar-stack { margin-left: 0; }
  .prow { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "ring main right" "ring meta meta"; gap: 4px 12px; padding: 14px 0; }
  .prow > .ring, .prow > .ring-empty { grid-area: ring; width: 44px; height: 44px; align-self: start; }
  .prow .ring svg { width: 44px; height: 44px; }
  .prow > .main-c { grid-area: main; min-width: 0; }
  .prow > .mid, .prow > .avatar-stack { display: none; }
  .prow > .metawrap { grid-area: meta; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .prow > .right-num { grid-area: right; align-self: start; }
  .why .why-foot { flex-direction: column; gap: 2px; }
  .bactions .btn-icon { width: 44px; flex: none; }
  .bactions .btn-block { min-width: 0; padding: 0 10px; }
}
@media (min-width: 641px) { .prow > .metawrap { display: contents; } }

/* ---------- dugačka imena (D10): „…“ umjesto preliva ---------- */
.person > div, .person-name, .person-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.timeline li, .list > li, .list > .item, td { min-width: 0; }
.profile-head h1 { overflow-wrap: anywhere; }

/* ---------- datum i vrijeme: tekstualna polja dd.mm.gggg / HH:MM + dugme kalendara (app.js initDateText) ---------- */
.date-text-row { display: flex; align-items: center; gap: 8px; position: relative; }
.date-text-box { position: relative; flex: 1 1 140px; min-width: 0; }
input.date-native { position: absolute !important; right: 0; top: 0; opacity: 0; width: var(--control-h) !important; height: var(--control-h) !important; min-height: var(--control-h) !important; padding: 0 !important; border: 0 !important; pointer-events: none; }
.date-hint { font-size: var(--t-s); color: var(--bad); font-weight: 600; }
.date-hint:empty { display: none; }
.field input.date-text-date { width: 100%; padding-right: calc(var(--control-h) + 2px); }
.field input.date-text-time { width: 96px !important; flex: none; } /* !important: pravilo „input:not(…)“ za polja ima veću specifičnost */
/* dugme kalendara je unutar polja: radius unutra = vani − okvir */
.date-pick { position: absolute; right: 1px; top: 1px; bottom: 1px; width: calc(var(--control-h) - 2px); min-height: 0; padding: 0; border: 0; box-shadow: none; border-radius: calc(var(--r-s) - 1px); }
@media (max-width: 640px) { .date-pick { top: 0; bottom: 0; right: 0; width: var(--tap); height: var(--tap); border-radius: var(--r-s); } }

/* ---------- uredi profil: avatar i izbor slike u jednom redu (D04) ---------- */
.avatar-pick { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.avatar-pick .field .help, .avatar-pick > .grow > .help { margin: 4px 0 0; font-size: var(--t-s); color: var(--ink-3); }

/* D22: meni reda u tabeli ne širi područje skrola (pozicionira ga placeMenu) */
.people-table .menu-list { position: fixed; }

@media (max-width: 640px) {
  .picker-box .picker-input { min-height: 44px !important; }
  .meta-list dd a, .meta-list dd .person { display: inline-flex; align-items: center; min-height: 32px; }
}

.people-table th, .people-table td { padding-left: 10px; padding-right: 10px; }
.people-table td .person { max-width: 300px; }
.people-table td:nth-child(5) { white-space: normal; }

/* Početna v2 */
.home-v2 + * { margin-top: 0; }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 14px; }
@media (max-width: 640px) { .home-quick { margin-top: 20px; } .home-quick .btn { flex: 1 1 auto; } }
.home-v2 .rows { margin-top: 6px; }
.home-v2 .proc { margin-bottom: 4px; }
.home-v2 [x-cloak] { display: none !important; }
.ticks span { max-width: 14px; }
.ticks { min-width: 0; overflow: hidden; }  /* mnogo kvadratića na uskom ekranu ne smije raširiti stranicu (A13 smoke, 360 px) */
@media (max-width: 640px) {
  .proc-head { flex-wrap: wrap; gap: 12px; }
  .proc-head .grow { flex-basis: calc(100% - 68px); }
  .proc-head .tag { order: 3; }
  .proc-head .right-num { order: 4; margin-left: auto; }
}

/* kartica firme: podnaslov; kartica stanja podsjetnika (HR) */
.company-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.company-text .name { flex: none; }
.company-text .sub { display: block; font-size: var(--t-s); font-weight: 400; color: var(--ink-3); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-status { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; box-shadow: var(--shadow-1); }
.sb-status b { display: flex; align-items: center; gap: 8px; font-size: var(--t-m); font-weight: 600; }
.sb-status .dot-ok { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.sb-status p { margin: 4px 0 0; font-size: var(--t-s); color: var(--ink-3); line-height: 1.4; }
.cyc-row { grid-template-columns: 52px minmax(0, 1fr) auto 200px minmax(88px, auto); }
.prow:last-child { border-bottom: 0; }
@media (max-width: 640px) { .cyc-row { grid-template-columns: 44px minmax(0, 1fr) auto; } }
.menu-list button[disabled], .menu-list button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.nav .nav-new { margin-left: auto; height: 20px; padding: 0 6px; font-size: 11px; letter-spacing: .04em; }

/* P11: prazna stanja — ikona u krugu, naslov, jedna rečenica, jedno dugme */
.empty .empty-icon { background: var(--neutral-soft); border: 1px solid var(--neutral-line); color: var(--ink-4); }
.empty h3 { font-size: var(--t-l); font-weight: 600; }
.panel .empty, .card .empty { padding: 32px 24px; }

/* P12: mikro-interakcije (uz prefers-reduced-motion se gase na kraju fajla) */
.btn, .nav a, .seg a, .seg button, a.item, a.prow, a.bitem, .tabs a, .tabs button, .table tbody tr td { transition: background-color 120ms cubic-bezier(.2,.8,.2,1), border-color 120ms cubic-bezier(.2,.8,.2,1), box-shadow 120ms cubic-bezier(.2,.8,.2,1), transform 120ms cubic-bezier(.2,.8,.2,1); }
.btn:active { transform: scale(.985); }
a.prow:hover, a.bitem:hover, a.item:hover { background: var(--surface-2); }
.btn .icon[class*="icon"] { transition: transform 120ms cubic-bezier(.2,.8,.2,1); }
.btn:hover .icon-arrow, .btn-primary:hover > svg:last-child { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } .btn:hover svg { transform: none !important; } }
.stat-row-auto { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-row-auto .sv-stat-text { font-size: var(--t-xl); line-height: 1.25; }
.sv-strip .big-num small { font-size: var(--t-xl); }
.stat-row .value { font-size: var(--t-num); font-weight: 500; letter-spacing: -.02em; line-height: 1.1; margin-top: 8px; }
@media (max-width: 640px) { .stat-row .value { font-size: 26px; } }
.stat-row .label { font-size: var(--t-xs); font-weight: 600; letter-spacing: var(--ls-caps); text-transform: uppercase; color: var(--ink-3); line-height: 1.3; }

/* D41: jedna 9-box komponenta (talenti i kalibracija): isti okvir, boje iz tokena, avatari + broj u pilulji */
.box { border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.box.tone-ok { background: var(--ok-soft); border-color: var(--ok-line); }
.box.tone-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.box.tone-bad { background: var(--bad-soft); border-color: var(--bad-line); }
.ninebox .box h4 { font-weight: 600; }
.ninebox .box h4 .count, .tl-count { flex: none; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; min-width: 24px; text-align: center; line-height: 1.6; }
.cells .hidden-cell { background: transparent; border: 1px dashed var(--tick); }
.cells .g2 { background: var(--done-cell); }
.sv-heat-details { margin-top: 12px; }
.sv-heat-details > summary { cursor: pointer; padding: 8px 4px; }
.sv-heat-details[open] > summary { margin-bottom: 8px; }

/* Početna: sklopljena lista „Za tebe“ (HR, rukovodilac), izbor perioda, prazno stanje probnog rada */
.home-fold > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; cursor: pointer; list-style: none; font-weight: 600; font-size: var(--t-l); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-1); }
.home-fold > summary::-webkit-details-marker { display: none; }
.home-fold > summary .icon { margin-left: auto; color: var(--ink-3); transition: transform 120ms; }
.home-fold[open] > summary .icon { transform: rotate(180deg); }
.home-fold[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.home-fold > .panel { border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.home-fold > .panel > :first-child { border-top-left-radius: 0; border-top-right-radius: 0; }
.home-grid .panel, .home-v2 + * .panel { box-shadow: var(--shadow-1); }
.period-pick { position: relative; display: inline-flex; align-items: center; }
.period-pick .icon { position: absolute; left: 12px; pointer-events: none; color: var(--ink-3); }
.period-pick select { width: auto; min-height: var(--tap); padding-left: 34px; font-weight: 600; box-shadow: var(--shadow-1); }
.empty-compact { display: flex; gap: 12px; align-items: flex-start; padding: 18px 0 4px; color: var(--ink-4); }
.empty-compact b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; }
.empty-compact span { font-size: var(--t-s); }
@media (max-width: 640px) { .period-pick, .period-pick select { width: 100%; } }

/* Analitika: prikvačene sekcije */
.an-sec { position: relative; }
.an-tools { display: flex; justify-content: flex-end; gap: 4px; margin: 0 0 4px; }
.an-tools form { margin: 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--surface-2); color: var(--ink); }
.icon-btn[aria-disabled="true"] { opacity: .35; cursor: default; }
.an-pin[aria-pressed="true"] { color: var(--ink); background: var(--line-2); }
.an-pin[aria-pressed="true"] .icon { fill: currentColor; }
@media (max-width: 720px) { .icon-btn { width: 44px; height: 44px; } }

/* Pravni tekstovi (Zaštita podataka): oznake „provjeriti“ i neispunjena polja */
.legal-check { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--warn-line); padding: 0 2px; border-radius: 2px; }
.legal-blank { background: var(--bad-soft); color: var(--bad); padding: 0 2px; border-radius: 2px; }
.legal-text { max-width: 760px; line-height: 1.6; }
.legal-text :is(h2, h3, h4) { margin: 1.4em 0 .5em; }
.legal-text :is(ul, ol) { padding-left: 1.4em; }
.legal-table :is(th, td) { vertical-align: top; }
@media print { .legal-check, .legal-blank { background: none; } }
.notice-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--info-line); background: var(--info-soft); color: var(--info); border-radius: var(--r-s, 8px); }
.notice-banner-text { flex: 1 1 240px; font-weight: 600; }
@media (max-width: 640px) { .notice-banner .btn { width: 100%; } .notice-sticky { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0; border-top: 1px solid var(--line); } }
@media print { .notice-banner, .notice-sticky { display: none; } }

/* Evidencija obrade: tabela na širokom ekranu, kartice na telefonu, A4 položeno za štampu */
.record-cards { display: none; }
.record-card { padding: 14px 16px; border-top: 1px solid var(--line); }
.record-card h3 { margin: 0 0 8px; font-size: 1rem; }
.record-off { opacity: .6; }
.record-table th, .record-table td { min-width: 120px; }
@media (max-width: 640px) { .record-table { display: none; } .record-cards { display: block; } }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  .record-cards { display: none !important; }
  .record-table { display: block !important; }
  .record-table thead { display: table-header-group; }
  .record-table th, .record-table td { min-width: 0; font-size: 9pt; }
}

/* ---------- incidenti ---------- */
.incident-phase { border-left: 3px solid var(--line); padding-left: 12px; }
.incident-phase.is-current { border-left-color: var(--accent); }
.incident-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.incident-step { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 40px; }
.incident-step-form { margin-left: auto; }
.incident-mark { width: 20px; display: inline-flex; justify-content: center; color: var(--ink-3); }
.incident-step.is-done .incident-mark { color: var(--ok); }
.incident-template { width: 100%; font-family: inherit; line-height: 1.5; }
@media print { .incident-template { border: 0; } }

/* ---------- UI popravke (13. 10.): zvono, traka obavještenja, trag, tabele i tabovi na telefonu ---------- */
.bell .dot { top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 3px; font-size: 10px; line-height: 1; }
.notice-line { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: var(--t-s); color: var(--ink-3); }
.notice-line .icon { color: var(--ink-3); flex: none; }
.notice-line a { font-weight: 600; white-space: nowrap; }
@media print { .notice-line { display: none; } }
.pagebar { justify-content: flex-start; }
.page-head .lead .badge { margin-left: 8px; }
.me .who strong, .me .who span { max-width: 100%; }
/* Tabele i matrice koje se skroluju sa strane: sjena na rubu pokazuje da ima još (bez JS-a) */
.table-wrap, .sk-matrix-wrap {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 36px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shadow), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shadow), transparent) right center / 12px 100% no-repeat scroll;
}
.sk-matrix-wrap .sk-matrix thead th { background-clip: padding-box; }
.tabs.is-scrollable::after { content: "›"; position: sticky; right: 0; flex: none; align-self: center; padding: 0 6px; color: var(--ink-3); font-weight: 700; background: linear-gradient(to right, transparent, var(--surface) 60%); }
@media (max-width: 640px) {
  .filters select, .filters input:not([type=checkbox]):not([type=radio]) { width: 100%; min-width: 0; flex: 1 1 100%; }
  .filters label { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .filters label input { width: 100%; }
  .filters .btn { flex: 1 1 100%; }
  .pagedate { font-size: var(--t-xs); }
}
.sv-blank { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sv-blank { min-width: 0; }
.sv-blank input[type=text] { flex: 1 1 180px; width: auto; min-width: 0; min-height: 36px; }
.row-wrap { flex-wrap: wrap; }
@media (max-width: 640px) { .row-wrap-s { flex-wrap: wrap; } .row-wrap .btn { flex: 1 1 auto; } }

/* ---------- UX paket (N29): slika povuci-i-pusti, upozorenje prije odjave ---------- */
.file-pick.is-droppable { border: 1px dashed var(--line-strong); border-radius: var(--r-m); padding: 12px; }
.file-pick.is-dragover { border-color: var(--accent); background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 2px; }
.file-pick .file-preview { align-self: flex-start; max-height: 96px; max-width: 240px; }
.file-pick-tip { margin: 0; }
.session-guard { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: var(--r-l); box-shadow: var(--pop); background: var(--surface); color: var(--ink); }
.session-guard::backdrop { background: var(--scrim); }
.session-guard-title { font-size: var(--t-l); margin: 0 0 8px; }
.session-guard p { margin: 0 0 12px; }
.session-guard-time { color: var(--ink-3); }
.session-guard-time strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.session-guard-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.session-guard-actions form { display: contents; }
.session-guard [hidden], .file-pick [hidden] { display: none !important; }
.file-pick:focus { outline: none; }

/* ---------- „Nedavno“ u meniju (navigation/recent.py) ---------- */
.nav-recent:empty { display: none; }
.nav-recent .nav-label { padding-top: 4px; }
.nav-recent a { height: 36px; }
.nav-recent a > span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- meni sklopljen na ikone (samo računar; <html class="nav-rail">, kolačić uspon_nav) ---------- */
.nav-rail-toggle { display: none; }
.nav-tip {
  position: fixed; z-index: 90; transform: translateY(-50%); padding: 5px 9px; border-radius: var(--r-s); background: var(--ink); color: var(--surface);
  font-size: var(--t-s); font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 100ms ease;
}
.nav-tip.is-on { opacity: 1; }
@media (min-width: 901px) {
  .nav-rail-toggle { display: inline-flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: 36px; padding: 0 10px; color: var(--ink-3); font-weight: 500; }
  .nav-rail-toggle:hover { background: var(--sidebar-hover); }
  html.nav-rail { --sidebar-w: 64px; }
  /* izbornik grupe (flyout) je u .sidebar; bez svog sloja ga .main (kasnije u DOM-u) prekriva. 50 < modal 60 < toasti 100 */
  html.nav-rail .sidebar { z-index: 50; }
  html.nav-rail .sidebar { padding-left: 10px; padding-right: 10px; overflow-x: hidden; align-items: stretch; }
  /* natpisi ostaju za čitače ekrana, samo se ne vide */
  html.nav-rail .nav a > span:not(.nav-badge), html.nav-rail .nav-group > summary > span:not(.nav-badge), html.nav-rail .nav-rail-toggle > span,
  html.nav-rail .company-text, html.nav-rail .me .who, html.nav-rail .nav-label, html.nav-rail .search-kbd {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  html.nav-rail .nav a, html.nav-rail .nav-group > summary { justify-content: center; padding: 0; gap: 0; }
  html.nav-rail .nav-group { margin: 0; padding: 0; border-color: transparent; }
  html.nav-rail .nav-group[open]:not(.is-closing) { background: none; }
  html.nav-rail .nav-group > summary .nav-chevron { display: none; }
  /* značke postaju tačka */
  html.nav-rail .nav a, html.nav-rail .nav-group > summary { position: relative; }
  html.nav-rail .nav .nav-badge:has(*)::after { content: ""; position: absolute; top: 7px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
  html.nav-rail .nav-badge > *, html.nav-rail .nav-dot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  html.nav-rail .nav-label { display: block; }
  html.nav-rail .nav-recent { display: none; }
  html.nav-rail .nav-admin { padding-top: 8px; }
  /* kartica firme: samo znak */
  html.nav-rail .company-switch > button, html.nav-rail .company-current { justify-content: center; padding: 8px 0; background: none; border-color: transparent; box-shadow: none; }
  html.nav-rail .company-switch > button > .icon { display: none; }
  html.nav-rail .company-menu { position: fixed; left: 72px; right: auto; top: 12px; min-width: 220px; }
  html.nav-rail .sidebar-demo { font-size: 0; padding: 4px 0; }
  html.nav-rail .sidebar-demo::before { content: "DEMO"; font-size: 10px; }
  /* pretraga: samo lupa, cijela ploha otvara pretragu */
  html.nav-rail .sidebar .search { width: 100%; height: 40px; }
  html.nav-rail .search input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0 !important; opacity: 0; cursor: pointer; }
  html.nav-rail .sidebar .search:focus-within { box-shadow: var(--focus); border-radius: var(--r-s); }
  html.nav-rail .search > .icon { left: 50%; transform: translate(-50%, -50%); }
  html.nav-rail .sb-status { display: none; }
  html.nav-rail .me { flex-direction: column; padding: 0; gap: 6px; }
  html.nav-rail .me .menu-up { position: fixed; left: 72px; right: auto; bottom: 12px; top: auto; }
  html.nav-rail .nav-rail-toggle { justify-content: center; padding: 0; }
  /* grupa: podstavke u panelu pored ikone (otvara klik ili Enter; Escape zatvara) */
  html.nav-rail .nav .branch-wrap { display: none; }
  html.nav-rail .nav-group.is-fly[open] .branch-wrap {
    display: block; position: fixed; left: 72px; top: var(--fly-top, 8px); width: 224px; padding: 6px; z-index: 80; overflow: visible;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--pop);
  }
  html.nav-rail .nav .branch { margin: 0; padding: 0; }
  html.nav-rail .nav .branch::before { display: none; }
  html.nav-rail .nav .branch a { justify-content: flex-start; padding: 6px 10px; gap: 10px; }
  html.nav-rail .nav .branch a > span:not(.nav-badge) { position: static; width: auto; height: auto; margin: 0; clip: auto; overflow: visible; white-space: normal; }
  html.nav-rail .nav .branch .nav-badge > * { position: static; width: auto; height: auto; clip: auto; }
  html.nav-rail .nav .branch .nav-badge:has(*)::after { display: none; }
  html.nav-rail .nav-group.is-active > summary { background: var(--sidebar-active); }
}
@media (max-width: 900px) { .nav-rail-toggle { display: none; } }
/* Telefon: ljepljive trake ne zaklanjaju polje koje dobije fokus; traka na dnu poštuje sigurno područje (zarez/home traka) */
@media (max-width: 640px) {
  html { scroll-padding-top: 76px; scroll-padding-bottom: 120px; }
  .rv-actionbar, .sv-submitbar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
