/* ============================================================
   WEBEAUT MEDIA — interni sistem
   Dizajn preuzet sa webeaut.com: monohromatsko staklo,
   Sora (naslovi) + Inter (tekst).
   ============================================================ */

/* ---------------- FONTOVI (lokalni, rade i bez interneta) ---------------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/inter-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/inter-400-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/inter-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../assets/fonts/inter-500-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/inter-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/inter-600-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/inter-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/inter-700-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: 'Sora'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/sora-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 400; font-display: swap; src: url('../assets/fonts/sora-400-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/sora-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600; font-display: swap; src: url('../assets/fonts/sora-600-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/sora-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 700; font-display: swap; src: url('../assets/fonts/sora-700-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 800; font-display: swap; src: url('../assets/fonts/sora-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 800; font-display: swap; src: url('../assets/fonts/sora-800-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }

/* ============================================================
   TOKENI
   ============================================================ */
:root {
  --bg: #050505;
  --bg-soft: #0b0b0b;

  /* Staklo: providna podloga + zamućenje onoga iza. Da bi se staklo
     uopšte vidjelo, iza njega mora nešto postojati — to je .bg-decor. */
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.088);
  --surface-3: rgba(255, 255, 255, 0.135);
  --surface-solid: #121212;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-sheen: rgba(255, 255, 255, 0.095);
  --chrome-bg: rgba(10, 10, 10, 0.55);
  --sheet-bg: rgba(24, 24, 24, 0.78);

  --border: rgba(255, 255, 255, 0.13);
  --border-strong: rgba(255, 255, 255, 0.26);
  --highlight: rgba(255, 255, 255, 0.24);
  --text: #f5f5f5;
  --text-dim: rgba(245, 245, 245, 0.64);
  --text-mute: rgba(245, 245, 245, 0.42);
  --invert: #050505;
  --on-accent: #050505;
  --accent: #ffffff;
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 8px 24px -14px rgba(0, 0, 0, 0.7);

  /* Jedno zamućenje za sve staklene površine; slabije za kartice u listi. */
  --glass: blur(26px) saturate(180%);
  --glass-card: blur(16px) saturate(150%);

  --red: #ff5a5a;
  --red-bg: rgba(255, 90, 90, 0.14);
  --amber: #ffc44d;
  --amber-bg: rgba(255, 196, 77, 0.14);
  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.14);
  --blue: #7cb8ff;
  --blue-bg: rgba(124, 184, 255, 0.14);

  --radius: 20px;
  --radius-sm: 13px;
  --radius-xs: 9px;
  --font-display: 'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.32, 1.25, 0.5, 1);
  --sidebar-w: 258px;
  --header-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --pill-h: 62px;
  color-scheme: dark;
}

html[data-theme='light'] {
  --bg: #eeeef0;
  --bg-soft: #f7f7f8;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-2: rgba(255, 255, 255, 0.78);
  --surface-3: rgba(0, 0, 0, 0.06);
  --surface-solid: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.58);
  --card-sheen: rgba(255, 255, 255, 0.55);
  --chrome-bg: rgba(250, 250, 252, 0.62);
  --sheet-bg: rgba(252, 252, 253, 0.8);

  --border: rgba(0, 0, 0, 0.075);
  --border-strong: rgba(0, 0, 0, 0.18);
  --highlight: rgba(255, 255, 255, 0.95);
  --text: #0c0c0d;
  --text-dim: rgba(12, 12, 13, 0.63);
  --text-mute: rgba(12, 12, 13, 0.43);
  --invert: #ffffff;
  --on-accent: #ffffff;
  --accent: #0c0c0d;
  --shadow-lg: 0 24px 50px -26px rgba(0, 0, 0, 0.26);
  --shadow-sm: 0 6px 20px -14px rgba(0, 0, 0, 0.22);

  --red: #d92d2d;
  --red-bg: rgba(217, 45, 45, 0.10);
  --amber: #a06d05;
  --amber-bg: rgba(176, 120, 6, 0.12);
  --green: #16803c;
  --green-bg: rgba(22, 128, 60, 0.11);
  --blue: #1d5fbf;
  --blue-bg: rgba(29, 95, 191, 0.10);
  color-scheme: light;
}

/* ============================================================
   OSNOVA
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  /* Bez ovoga browser na prevlacenje s ivice radi svoj "nazad",
     pa se prvo vratis na pocetnu umjesto da se otvori meni. */
  overscroll-behavior: none;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }

/* Ikone imaju zadanu veličinu — bez ovoga bi SVG bez atributa
   rastegao roditelja preko cijelog reda. */
svg { display: block; flex: none; width: 18px; height: 18px; }
.empty-icon { width: 44px; height: 44px; color: var(--text-mute); stroke-width: 1.4; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: var(--on-accent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); background-clip: content-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Pozadinski dekor — isti kao na sajtu */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-decor__orb { position: absolute; border-radius: 50%; opacity: 1; will-change: transform; animation: orbFloat 26s var(--ease) infinite alternate; }
.bg-decor__orb--1 { width: 64vw; height: 64vw; top: -26vw; left: -16vw; background: radial-gradient(circle, rgba(255,255,255,0.26) 0%, rgba(255,255,255,0.09) 36%, transparent 68%); }
.bg-decor__orb--2 { width: 52vw; height: 52vw; top: 26vh; right: -20vw; background: radial-gradient(circle, rgba(168,192,224,0.24) 0%, rgba(168,192,224,0.08) 36%, transparent 68%); animation-delay: -9s; }
.bg-decor__orb--3 { width: 48vw; height: 48vw; bottom: -18vw; left: 18vw; background: radial-gradient(circle, rgba(226,214,196,0.18) 0%, rgba(226,214,196,0.06) 36%, transparent 68%); animation-delay: -16s; }
html[data-theme='light'] .bg-decor__orb--1 { background: radial-gradient(circle, rgba(96,112,140,0.26) 0%, rgba(96,112,140,0.09) 36%, transparent 68%); }
html[data-theme='light'] .bg-decor__orb--2 { background: radial-gradient(circle, rgba(70,100,150,0.22) 0%, rgba(70,100,150,0.07) 36%, transparent 68%); }
html[data-theme='light'] .bg-decor__orb--3 { background: radial-gradient(circle, rgba(150,130,105,0.20) 0%, rgba(150,130,105,0.06) 36%, transparent 68%); }
.bg-decor__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 85% 65% at 50% 38%, #000 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 38%, #000 15%, transparent 78%);
  opacity: 0.75;
}
@keyframes orbFloat { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(6vw,5vh,0) scale(1.14); } }

/* ============================================================
   TIPOGRAFIJA
   ============================================================ */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.h-page { font-size: clamp(21px, 3.2vw, 29px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.16; }
.h-card { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
.eyebrow { font-family: var(--font-display); font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mute); }
.muted { color: var(--text-dim); }
.mute2 { color: var(--text-mute); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-width: 0; }
/* Dugačka imena (projekat, klijent) — lome se u više redova umjesto da se skrate. */
.wrap-any { overflow-wrap: anywhere; word-break: break-word; }
.grad-text {
  background: linear-gradient(100deg, var(--text-mute) 0%, var(--text) 30%, var(--text-dim) 55%, var(--text) 80%, var(--text-mute) 100%);
  background-size: 220% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShine 8s linear infinite;
}
@keyframes gradShine { from { background-position: 220% center; } to { background-position: -220% center; } }

/* ============================================================
   RASPORED (APP SHELL)
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 18px 12px calc(14px + var(--safe-b));
  padding-left: max(12px, var(--safe-l));
  border-right: 1px solid var(--border);
  background: var(--chrome-bg);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  z-index: 60;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 16px; flex: none; }
.sidebar__brand img { width: 126px; height: auto; }
html[data-theme='light'] .sidebar__brand img { filter: invert(1); }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; margin: 0 -4px; padding: 0 4px 4px; scrollbar-width: none; }
.sidebar__nav::-webkit-scrollbar { display: none; }
.sidebar__foot { padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; flex: none; }

.navlink {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14.5px; font-weight: 500;
  position: relative; transition: color 0.22s var(--ease), background 0.22s var(--ease);
  min-width: 0;
}
.navlink span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navlink svg { width: 19px; height: 19px; flex: none; stroke-width: 1.7; }
.navlink:hover { color: var(--text); background: var(--surface-2); }
.navlink.is-active { color: var(--text); background: var(--surface-2); font-weight: 600; }
.navlink.is-active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.navlink__badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--accent); color: var(--on-accent); flex: none;
  font-size: 11px; font-weight: 700; display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.navlink__badge--soft { background: var(--surface-3); color: var(--text); }

.conn { display: flex; align-items: center; gap: 7px; padding: 6px 13px; font-size: 11.5px; color: var(--text-mute); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--header-h); padding: 9px clamp(14px, 2.4vw, 28px);
  padding-top: calc(9px + var(--safe-t));
  padding-left: max(clamp(14px, 2.4vw, 28px), var(--safe-l));
  padding-right: max(clamp(14px, 2.4vw, 28px), var(--safe-r));
  border-bottom: 1px solid var(--border);
  background: var(--chrome-bg);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
}
.topbar__title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 4px; flex: none; }

.page {
  padding: clamp(14px, 2.2vw, 28px);
  padding-left: max(clamp(14px, 2.2vw, 28px), var(--safe-l));
  padding-right: max(clamp(14px, 2.2vw, 28px), var(--safe-r));
  padding-bottom: calc(40px + var(--safe-b));
  flex: 1; min-width: 0;
}
.page--narrow { max-width: 980px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.row--tight { gap: 6px; }
.row--nowrap { flex-wrap: nowrap; }
.row--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.row--scroll::-webkit-scrollbar { display: none; }
.row--scroll > * { flex: none; }
.spacer { flex: 1; }

.grid { display: grid; gap: 16px; min-width: 0; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }

/* Zaglavlje stranice sa detaljem — naslov se lomi, ne skraćuje. */
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.page-head__main { flex: 1 1 240px; min-width: 0; }
.page-head__title { font-family: var(--font-display); font-size: clamp(19px, 2.9vw, 26px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.18; overflow-wrap: anywhere; }
.page-head__sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; overflow-wrap: anywhere; }
.page-head__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.page-head .icon-btn.back { margin-top: 1px; }

/* ============================================================
   KARTICE
   ============================================================ */
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: var(--glass-card); -webkit-backdrop-filter: var(--glass-card);
  box-shadow:
    inset 0 1px 0 var(--highlight),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    var(--shadow-sm);
  padding: 18px; position: relative; min-width: 0; isolation: isolate;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
/* Odsjaj kao na staklenoj ploči — svjetlije uz gornji lijevi ugao. */
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background:
    linear-gradient(152deg, var(--card-sheen) 0%, transparent 44%),
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.05) 0%, transparent 55%);
}
html[data-theme='light'] .card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--shadow-sm);
}
.card--pad0 { padding: 0; overflow: hidden; }
.card--link { cursor: pointer; text-align: left; width: 100%; }
.card--link:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-lg); }
.card--link:active { transform: translateY(0) scale(0.995); }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-width: 0; }
.card__head svg { color: var(--text-mute); }
.card__title { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; min-width: 0; }

.stat { display: flex; flex-direction: column; gap: 3px; padding: 15px 17px; }
.stat__label { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mute); }
.stat__value { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 30px); font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.12; }
.stat__sub { font-size: 12.5px; color: var(--text-dim); }

/* ============================================================
   DUGMAD
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
  padding: 10px 17px; border-radius: 99px; border: 1px solid transparent;
  white-space: nowrap; cursor: pointer; position: relative; min-height: 40px;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease), color 0.22s var(--ease), opacity 0.2s;
  -webkit-user-select: none; user-select: none;
}
.btn svg { width: 17px; height: 17px; flex: none; stroke-width: 1.9; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--bg)); }
.btn--ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn--quiet { background: transparent; color: var(--text-dim); }
.btn--quiet:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 32%, transparent); }
.btn--danger:hover { background: color-mix(in srgb, var(--red) 22%, transparent); }
.btn--sm { padding: 7px 13px; font-size: 12.8px; min-height: 34px; }
.btn--sm svg { width: 15px; height: 15px; }
.btn--xs { padding: 4px 10px; font-size: 11.8px; border-radius: 99px; min-height: 28px; }
.btn--xs svg { width: 13px; height: 13px; }
.btn--lg { padding: 14px 26px; font-size: 15px; min-height: 50px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: var(--text-dim); background: transparent; flex: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; stroke-width: 1.8; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.93); }
.icon-btn--sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn--sm svg { width: 16px; height: 16px; }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg);
}



/* ============================================================
   FORME
   ============================================================ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.field__label .req { color: var(--red); font-weight: 700; }
.field__hint { font-size: 11.5px; color: var(--text-mute); }
.field__error { font-size: 12px; color: var(--red); font-weight: 500; }

.input, .select, .textarea {
  width: 100%; padding: 11px 13px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: var(--font-body);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  min-height: 44px;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.input[aria-invalid='true'], .textarea[aria-invalid='true'], .select[aria-invalid='true'] { border-color: var(--red); }
/* Polje koje je popunio CompanyWall — vlasnik odmah vidi šta da provjeri. */
.cw-filled {
  border-color: color-mix(in srgb, var(--green) 45%, transparent);
  background: color-mix(in srgb, var(--green) 9%, var(--surface-2));
}
.input:disabled, .textarea:disabled, .select:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- Vlastiti izbornik / datum / vrijeme ---- */
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 10px 12px; font-family: var(--font-body);
}
.pick__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick__label.is-empty { color: var(--text-mute); }
.pick__lead { width: 16px; height: 16px; color: var(--text-mute); flex: none; }
.pick__arrow { width: 15px; height: 15px; color: var(--text-mute); flex: none; transition: transform 0.2s var(--ease); }
.pick[aria-expanded='true'] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.pick[aria-expanded='true'] .pick__arrow { transform: rotate(180deg); }
.pick:disabled { opacity: 0.55; cursor: not-allowed; }
/* Datum i vrijeme su uži od običnog izbornika. */
.pick--date .pick__label, .pick--time .pick__label { font-variant-numeric: tabular-nums; }
.pick--time { min-width: 118px; }

/* Staklena ploča koja iskoči uz kontrolu (na telefonu je to donji list). */
.popover {
  position: fixed; z-index: 250; max-width: min(360px, calc(100vw - 16px));
  background: var(--sheet-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-lg);
  padding: 6px; animation: popIn 0.16s var(--ease); overflow: hidden;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(0.985); } to { opacity: 1; transform: none; } }

.pick__list { display: flex; flex-direction: column; gap: 2px; max-height: min(320px, 56vh); overflow-y: auto; }
.pick__opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 9px; font-size: 14px; color: var(--text-dim);
  min-height: 42px; transition: background 0.14s, color 0.14s;
}
.pick__opt:hover { background: var(--surface-2); color: var(--text); }
.pick__opt.is-on { background: var(--surface-3); color: var(--text); font-weight: 600; }
.pick__opt:disabled { opacity: 0.45; cursor: not-allowed; }
.pick__opt svg { width: 15px; height: 15px; flex: none; }
.pick__empty { padding: 14px; text-align: center; color: var(--text-mute); font-size: 13px; }

/* Vise stavki odjednom: kvadratic ispred svake i red za dopisivanje. */
.pick__multi { display: flex; flex-direction: column; gap: 6px; }
.pick__check {
  width: 19px; height: 19px; border-radius: 6px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); background: var(--surface-2);
}
.pick__check.is-on { background: var(--accent); border-color: var(--accent); }
.pick__check svg { width: 12px; height: 12px; color: var(--on-accent); stroke-width: 3; }
.pick__foot { display: flex; align-items: center; gap: 8px; padding-top: 6px; border-top: 1px solid var(--border); }
.pick--multi .pick__label { white-space: normal; overflow-wrap: anywhere; }

/* Kalendar u polju za datum. */
.dp { padding: 4px; min-width: 262px; }
.dp__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dp__title { flex: 1; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; text-transform: capitalize; }
.dp__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp__dow { text-align: center; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-mute); padding-bottom: 4px; }
.dp__d {
  aspect-ratio: 1; min-height: 34px; display: grid; place-items: center; border-radius: 9px;
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-dim);
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.dp__d:hover { background: var(--surface-2); color: var(--text); }
.dp__d.is-today { color: var(--accent); font-weight: 700; box-shadow: inset 0 0 0 1px var(--border-strong); }
.dp__d.is-on { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: none; }
.dp__foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Sat i minuta. */
.tp { padding: 4px; }
.tp__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tp__col { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.tp__opt {
  padding: 9px 6px; border-radius: 8px; font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--text-dim); min-height: 38px; transition: background 0.14s, color 0.14s;
}
.tp__opt:hover { background: var(--surface-2); color: var(--text); }
.tp__opt.is-on { background: var(--accent); color: var(--on-accent); font-weight: 700; }

@media (max-width: 1000px) {
  .dp { min-width: 0; }
  .dp__d { min-height: 40px; font-size: 14px; }
  .tp__col { max-height: 46vh; }
  .tp__opt { min-height: 44px; }
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 40px; }
.input-group__icon { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--text-mute); pointer-events: none; }

/* Grupa polja unutar panela: lagan okvir, bez sjene i stakla. */
.form-section {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 15px; background: var(--surface); min-width: 0;
}
.form-section > .eyebrow { display: block; margin-bottom: 12px; }
@media (max-width: 560px) { .form-section { padding: 13px; } }

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.col-span-2 { grid-column: span 2; }
@media (max-width: 620px) { .col-span-2 { grid-column: span 1; } }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; -webkit-user-select: none; user-select: none; min-height: 36px; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 21px; height: 21px; border-radius: 6.5px; border: 1.5px solid var(--border-strong);
  background: var(--surface-2); flex: none; display: grid; place-items: center;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.check__box svg { width: 13px; height: 13px; opacity: 0; transform: scale(0.6); transition: all 0.18s var(--ease); color: var(--on-accent); stroke-width: 3; }
.check input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check__box svg { opacity: 1; transform: scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check input:disabled + .check__box { opacity: 0.5; }
.check__text { font-size: 14px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 4px 12px; }

/* Dozvole: jedna kartica po modulu, uz kratak sažetak šta korisnik dobija. */
.perm {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 12px 14px; min-width: 0;
}
.perm__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-width: 0; }
.perm__head svg { width: 16px; height: 16px; color: var(--text-mute); }
.perm__title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; flex: 1; min-width: 0; }
.perm__scope { padding: 6px 0; border-bottom: 1px solid var(--border); }
.perm__scope:last-child { border-bottom: none; }
.perm__hint { font-size: 11.5px; color: var(--text-mute); margin-left: 31px; margin-top: 2px; line-height: 1.45; }

.perm-sum {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.perm-sum__row { display: flex; align-items: center; gap: 8px; font-size: 12.8px; color: var(--text-dim); }
.perm-sum__row svg { width: 15px; height: 15px; color: var(--text-mute); flex: none; }
.perm-sum__row.text-amber { color: var(--amber); font-weight: 600; }
.perm-sum__row.text-amber svg { color: var(--amber); }

/* Red naloga u Postavkama. */
.acct { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); min-width: 0; }
.acct:last-child { border-bottom: none; }
.acct__main { flex: 1; min-width: 0; }
.acct__name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.acct__actions { display: flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 620px) {
  .acct { flex-wrap: wrap; }
  .acct__actions { width: 100%; justify-content: flex-end; }
  .acct__actions .btn { flex: 1 1 auto; }
}

/* Izbor teme u Postavkama. */
.theme-card { text-align: left; width: 100%; padding: 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color 0.2s var(--ease); }
.theme-card:hover { border-color: var(--border-strong); }
/* Aktivnu temu bira stil prema stanju stranice — nikad zaostala oznaka. */
html[data-theme='dark'] .theme-card[data-value='dark'],
html[data-theme='light'] .theme-card[data-value='light'] {
  border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.theme-card__check { display: none; }
html[data-theme='dark'] .theme-card[data-value='dark'] .theme-card__check,
html[data-theme='light'] .theme-card[data-value='light'] .theme-card__check { display: block; }
.theme-card__prev { margin-top: 12px; height: 56px; border-radius: 10px; border: 1px solid var(--border); display: flex; align-items: center; gap: 8px; padding: 10px; }
.theme-card__bar { height: 10px; border-radius: 5px; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: 36px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: background 0.22s var(--ease); flex: none;
}
.switch__track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-dim); transition: transform 0.24s var(--spring), background 0.22s var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); background: var(--on-accent); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Izbor opcija (semafor, raspolozenje, itd.) */
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  padding: 9px 14px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13.5px; font-weight: 500; min-height: 40px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
  -webkit-user-select: none; user-select: none;
}
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice:hover { border-color: var(--border-strong); }
.choice__dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.choice.is-on { border-color: var(--accent); background: var(--surface-3); font-weight: 600; }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice--red.is-on { color: var(--red); border-color: color-mix(in srgb, var(--red) 55%, transparent); background: var(--red-bg); }
.choice--amber.is-on { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: var(--amber-bg); }
.choice--green.is-on { color: var(--green); border-color: color-mix(in srgb, var(--green) 55%, transparent); background: var(--green-bg); }
.choice--blue.is-on { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 55%, transparent); background: var(--blue-bg); }
/* Na uskom ekranu izbori idu u ravnomjerne kolone umjesto raštrkanog omotavanja. */
.choices--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }

/* ============================================================
   OZNAKE
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.02em; background: var(--surface-3); color: var(--text-dim);
  border: 1px solid transparent; white-space: nowrap; max-width: 100%;
}
.badge svg { width: 12px; height: 12px; }
.badge--red { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.badge--amber { background: var(--amber-bg); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 26%, transparent); }
.badge--green { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 26%, transparent); }
.badge--blue { background: var(--blue-bg); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 26%, transparent); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot--red { background: var(--red); } .dot--amber { background: var(--amber); }
.dot--green { background: var(--green); } .dot--blue { background: var(--blue); }
.dot--mute { background: var(--text-mute); }
.dot--live { background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: -0.02em; color: var(--text-dim);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar--lg { width: 68px; height: 68px; font-size: 23px; }
.avatar--sq { border-radius: 14px; }

.logo-box {
  width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-dim);
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

/* ============================================================
   TABELE — na širokom ekranu prava tabela, na telefonu kartice
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.8px; min-width: 560px; }
.table th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-mute);
  border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); z-index: 2;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.16s var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.is-clickable { cursor: pointer; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* Responzivna tabela: ispod 820px svaki red postane kartica sa
   natpisom kolone ispred vrijednosti (data-label). */
@media (max-width: 820px) {
  .table--cards { min-width: 0; display: block; }
  .table--cards thead { display: none; }
  .table--cards tbody { display: flex; flex-direction: column; gap: 10px; }
  .table--cards tr {
    display: block; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); padding: 4px 0;
  }
  .table--cards tbody tr:hover { background: var(--surface-2); }
  .table--cards td {
    display: flex; align-items: center; gap: 12px; justify-content: space-between;
    padding: 7px 14px; border-bottom: none; text-align: left; min-height: 0;
  }
  .table--cards td::before {
    content: attr(data-label); flex: none; font-size: 11px; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-mute);
  }
  .table--cards td:empty { display: none; }
  .table--cards td[data-label='']::before { display: none; }
  /* Prva ćelija je naslov kartice — bez natpisa, preko cijele širine. */
  .table--cards td.cell-head { display: block; padding: 10px 14px 8px; }
  .table--cards td.cell-head::before { display: none; }
  .table--cards td.num { text-align: right; }
  .table--cards td.cell-last { justify-content: flex-end; padding-bottom: 10px; }
  .table--cards td.cell-last::before { display: none; }
  .table--cards .cell-actions { justify-content: flex-end; }
  .table-wrap:has(.table--cards) { overflow-x: visible; }
}

/* ============================================================
   PANELI (modal na desktopu, donji list na telefonu)
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: max(16px, var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: color-mix(in srgb, #000 58%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s var(--ease);
  overflow-y: auto; overscroll-behavior: contain;
}
html[data-theme='light'] .modal-backdrop { background: color-mix(in srgb, #46464b 38%, transparent); }
.modal-backdrop.is-closing { animation: fadeOut 0.18s var(--ease) forwards; }

.modal {
  width: min(700px, 100%); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; margin: auto;
  background: var(--sheet-bg); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: inset 0 1px 0 var(--highlight), 0 40px 90px -30px rgba(0,0,0,0.75);
  animation: modalIn 0.28s var(--ease);
  overflow: hidden;
}
.modal::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, var(--card-sheen) 0%, transparent 38%);
}
.modal--sm { width: min(460px, 100%); }
.modal--lg { width: min(1000px, 100%); }
.modal--full { width: min(1180px, 100%); }
.modal-backdrop.is-closing .modal { animation: modalOut 0.18s var(--ease) forwards; }

.modal__grab { display: none; }
.modal__head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--border); flex: none; min-width: 0;
}
.modal__title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.modal__sub { font-size: 12.5px; color: var(--text-dim); overflow-wrap: anywhere; }
.modal__body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.modal__foot {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end;
  padding: 14px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--border); flex: none;
  background: var(--surface); flex-wrap: wrap;
}
.modal__foot .spacer { flex: 1; min-width: 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes modalOut { to { opacity: 0; transform: translateY(10px) scale(0.99); } }

/* ============================================================
   PORUKE (TOAST)
   ============================================================ */
.toasts {
  position: fixed; z-index: 300; bottom: calc(16px + var(--safe-b)); right: 16px;
  display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px;
  background: var(--sheet-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--shadow-lg); font-size: 13.8px; pointer-events: auto;
  animation: toastIn 0.28s var(--ease); border-left: 3px solid var(--text-mute);
}
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast--ok { border-left-color: var(--green); } .toast--ok svg { color: var(--green); }
.toast--err { border-left-color: var(--red); } .toast--err svg { color: var(--red); }
.toast--info { border-left-color: var(--blue); } .toast--info svg { color: var(--blue); }
.toast.is-out { animation: toastOut 0.22s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ============================================================
   OSTALO
   ============================================================ */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 42px 20px; text-align: center; color: var(--text-dim); }
.empty svg { width: 36px; height: 36px; color: var(--text-mute); stroke-width: 1.4; }
.empty__title { font-family: var(--font-display); font-weight: 600; font-size: 15.5px; color: var(--text); }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; flex: none; }
.spinner--lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.5s var(--ease); }

.card:has(> .tabs) { padding: 0 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 11px 15px; font-size: 14px; font-weight: 500; color: var(--text-dim);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

/* Segmentirani prekidač — kompaktna zamjena za redove čipova. */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg__item {
  padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--text-dim);
  white-space: nowrap; transition: background 0.2s var(--ease), color 0.2s var(--ease); flex: none; min-height: 32px;
}
.seg__item:hover { color: var(--text); }
.seg__item.is-on { background: var(--accent); color: var(--on-accent); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; min-width: 0; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.8px; font-weight: 500; color: var(--text-dim); cursor: pointer; white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease); flex: none; min-height: 32px;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

.divider { height: 1px; background: var(--border); border: none; margin: 4px 0; }

/* Alatna traka iznad liste: pretraga + filteri + radnje. */
.toolbar { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.toolbar .input-group { flex: 1 1 200px; min-width: 0; }
.daterange { display: flex; align-items: center; gap: 6px; min-width: 0; }
.daterange__sep { font-size: 12px; color: var(--text-mute); flex: none; }
.daterange .select { flex: 1 1 0; min-width: 116px; width: auto !important; }
.pick--date { min-width: 132px; }

/* Dodatni filteri: na desktopu teku u istom redu, na telefonu iza dugmeta. */
.filters { display: contents; }
.filters__btn { display: none; }
.filters__btn.is-on { background: var(--surface-3); border-color: var(--border-strong); }

.kv { display: grid; grid-template-columns: minmax(96px, 34%) 1fr; gap: 8px 14px; font-size: 13.8px; align-items: baseline; }
.kv dt { color: var(--text-mute); font-size: 12.5px; }
.kv dd { color: var(--text); word-break: break-word; }

.list { display: flex; flex-direction: column; min-width: 0; }
.list__item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); transition: background 0.16s var(--ease); min-width: 0;
  text-align: left; width: 100%;
}
.list__item:last-child { border-bottom: none; }
.list__item--link { cursor: pointer; }
.list__item--link:hover { background: var(--surface-2); }

.dropdown { position: relative; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 90; min-width: 210px;
  background: var(--sheet-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--shadow-lg); padding: 6px; animation: modalIn 0.16s var(--ease);
  max-height: min(70vh, 420px); overflow-y: auto;
}
.dropdown__item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 11px; border-radius: 9px; font-size: 13.8px; color: var(--text-dim);
  transition: background 0.14s, color 0.14s; min-height: 40px;
}
.dropdown__item svg { width: 16px; height: 16px; flex: none; }
.dropdown__item:hover { background: var(--surface-2); color: var(--text); }
.dropdown__item--danger { color: var(--red); }
.dropdown__item--danger:hover { background: var(--red-bg); }

.autocomplete { position: relative; }
.autocomplete__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 95;
  background: var(--sheet-bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; padding: 5px;
}
.autocomplete__item { padding: 10px 11px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.autocomplete__item:hover, .autocomplete__item.is-active { background: var(--surface-2); }

/* ============================================================
   KALENDAR
   ============================================================ */
.cal { display: flex; flex-direction: column; gap: 14px; }
.cal__toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.cal__month { font-family: var(--font-display); font-size: clamp(17px, 2.5vw, 23px); font-weight: 700; letter-spacing: -0.02em; text-transform: capitalize; min-width: 0; flex: 1 1 auto; }
.cal__nav { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: 3px; flex: none; }
button.cal__month { text-align: left; cursor: pointer; padding: 4px 0; border-radius: 8px; transition: color 0.2s var(--ease); }
button.cal__month:hover { color: var(--text-dim); }
.cal__jump-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal__jump-year { font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal__jump-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cal__jump-m {
  padding: 12px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); font-size: 13.5px; font-weight: 500; text-transform: capitalize;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease); min-height: 46px;
}
.cal__jump-m:hover { border-color: var(--border-strong); }
.cal__jump-m.is-now { color: var(--accent); font-weight: 700; }
.cal__jump-m.is-on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }

.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__dow {
  text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--text-mute); padding: 4px 0 2px;
}
.cal__day {
  position: relative; min-height: 104px; padding: 7px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--border); cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; overflow: hidden; text-align: left;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.cal__day:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cal__day.is-out { opacity: 0.32; }
.cal__day.is-weekend { background: color-mix(in srgb, var(--surface) 50%, transparent); }
.cal__day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal__day.is-selected { background: var(--surface-3); border-color: var(--border-strong); }
.cal__daynum { font-family: var(--font-display); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 5px; }
.cal__day.is-today .cal__daynum { color: var(--accent); }
.cal__events { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.cal__ev {
  display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 7px;
  background: var(--surface-3); font-size: 11.2px; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 2.5px solid var(--text-mute);
}
.cal__ev--uspjesno { border-left-color: var(--green); }
.cal__ev--djelomicno { border-left-color: var(--amber); }
.cal__ev--neuspjesno { border-left-color: var(--red); }
.cal__ev--high { border-left-color: var(--red); }
.cal__ev time { font-variant-numeric: tabular-nums; color: var(--text-mute); flex: none; font-size: 10.5px; }
.cal__more { font-size: 10.5px; color: var(--text-mute); padding-left: 6px; }
.cal__dots { display: none; }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week__col { display: flex; flex-direction: column; gap: 6px; min-height: 190px; }

.year-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 14px; }
.mini-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-cal__d {
  aspect-ratio: 1; display: grid; place-items: center; font-size: 11.5px; border-radius: 7px;
  cursor: pointer; position: relative; font-variant-numeric: tabular-nums;
}
.mini-cal__d:hover { background: var(--surface-2); }
.mini-cal__d.is-out { opacity: 0.25; }
.mini-cal__d.is-today { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.mini-cal__d.has-ev::after { content: ''; position: absolute; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--text-dim); }
.mini-cal__d.is-today.has-ev::after { background: var(--on-accent); }

/* ============================================================
   DASHBOARD
   ============================================================ */
/* Upozorenje na dashboardu: ikona, poruka, dugme. */
.alert { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alert__icon { flex: none; display: flex; }
.alert__main { flex: 1 1 220px; min-width: 0; }
.alert__action { flex: none; }
@media (max-width: 620px) {
  .alert__action { width: 100%; }
  .alert__action .btn, .alert__action .a { width: 100%; }
}
.hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero__logo { width: 178px; height: auto; flex: none; }
html[data-theme='light'] .hero__logo { filter: invert(1); }
.hero__main { flex: 1 1 220px; min-width: 0; }
.hero__actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .hero { gap: 14px; }
  .hero__logo { width: 128px; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* ============================================================
   DNEVNI IZVJESTAJ
   ============================================================ */
/* Dugme za slanje je uvijek nadohvat, ne treba skrolati do kraja. */
.submit-bar {
  position: sticky; bottom: 16px; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 99px; border: 1px solid var(--border);
  background: var(--sheet-bg);
  backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
  box-shadow: inset 0 1px 0 var(--highlight), 0 14px 34px -14px rgba(0,0,0,0.55);
}
.submit-bar__text { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-dim); }
.submit-bar .btn { flex: none; }

/* Kartica jednog kontakta u izvještaju — plića od obične kartice. */
.contact-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px; }
.contact-row + .contact-row { margin-top: 8px; }
.contact-row__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.contact-row__name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.contact-row .field__label { font-size: 11.5px; }

@media (max-width: 1000px) {
  .submit-bar { bottom: calc(var(--pill-h) + 16px + var(--safe-b)); }
}
@media (max-width: 560px) {
  .submit-bar { flex-direction: column; align-items: stretch; border-radius: 20px; }
  .submit-bar .btn { width: 100%; }
  .submit-bar__text { text-align: center; }
}

/* ============================================================
   VOZNI PARK
   ============================================================ */
.veh { padding: 0; overflow: hidden; }
.veh__photo { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.veh__photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); }
.card--link:hover .veh__photo img { transform: scale(1.04); }
.veh__photo .veh__ph { width: 100%; height: 100%; display: grid; place-items: center; }
.veh__photo .veh__ph svg { width: 46px; height: 46px; color: var(--text-mute); stroke-width: 1.2; }
.veh__shade {
  position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.42) 55%, transparent 100%);
  display: flex; align-items: flex-end; gap: 10px;
}
.veh__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: #fff; line-height: 1.2; }
.veh__sub { font-size: 11.5px; color: rgba(255,255,255,0.72); }
.veh__plate {
  position: absolute; top: 10px; right: 10px; padding: 4px 9px; border-radius: 7px;
  background: rgba(255,255,255,0.92); color: #111; font-family: var(--font-display);
  font-weight: 700; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
}
.veh__body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.veh__alert { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.veh__alert svg { width: 14px; height: 14px; }

/* ============================================================
   MOBILNA NAVIGACIJA — plutajuća staklena pill traka
   ============================================================ */
.pillbar { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: min(292px, 86vw); height: 100dvh;
    transform: translateX(-102%); transition: transform 0.34s var(--ease);
    background: var(--sheet-bg); z-index: 210; padding-top: calc(18px + var(--safe-t));
    will-change: transform;
  }
  body.drawer-open .sidebar { transform: none; }
  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 205;
    background: color-mix(in srgb, #000 52%, transparent); opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease); backdrop-filter: blur(3px);
  }
  body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

  .pillbar {
    display: block; position: fixed; z-index: 100;
    bottom: calc(10px + var(--safe-b));
    left: max(12px, var(--safe-l)); right: max(12px, var(--safe-r));
    pointer-events: none;
  }
  .pillbar__inner {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    /* Prevlacenje po traci bira karticu, ne pomjera stranicu. */
    touch-action: none;
    gap: 2px; padding: 5px; margin: 0 auto; max-width: 520px;
    border-radius: 26px; pointer-events: auto;
    background: var(--chrome-bg);
    backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 var(--highlight), 0 12px 34px -12px rgba(0,0,0,0.55);
  }
  .pillbar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 7px 2px; border-radius: 21px; color: var(--text-mute); font-size: 9.5px;
    font-weight: 600; position: relative; min-height: 52px; letter-spacing: 0.01em;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
  }
  .pillbar__item svg { width: 21px; height: 21px; stroke-width: 1.75; transition: stroke-width 0.15s var(--ease); }
  .pillbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pillbar__item.is-active { color: var(--text); background: var(--surface-3); }
  /* Dok prevlacis prstom po traci — ona pod prstom se podigne. */
  .pillbar__item.is-slide {
    color: var(--on-accent); background: var(--accent);
    transform: translateY(-6px) scale(1.06);
  }
  .pillbar__item.is-slide svg { stroke-width: 2.1; }
  .pillbar__item .navlink__badge {
    position: absolute; top: 4px; left: 50%; margin-left: 4px; min-width: 16px; height: 16px;
    font-size: 9.5px; padding: 0 4px;
  }

  .page { padding-bottom: calc(var(--pill-h) + 26px + var(--safe-b)); }
  .toasts { bottom: calc(var(--pill-h) + 20px + var(--safe-b)); left: 12px; right: 12px; max-width: none; }

  /* Paneli postaju donji listovi. */
  .modal-backdrop { padding: 0; display: block; }
  .modal {
    width: 100%; max-width: none; margin: 0; position: fixed; left: 0; right: 0; bottom: 0;
    max-height: min(94dvh, calc(100dvh - var(--safe-t) - 12px));
    border-radius: 26px 26px 0 0; border-bottom: none;
    animation: sheetIn 0.32s var(--ease);
    padding-bottom: 0;
  }
  .modal--sm, .modal--lg, .modal--full { width: 100%; }
  .modal-backdrop.is-closing .modal { animation: sheetOut 0.2s var(--ease) forwards; }
  .modal.is-dragging { animation: none; transition: none; }
  .modal__grab {
    display: block; width: 38px; height: 4px; border-radius: 99px; background: var(--border-strong);
    margin: 9px auto 0; flex: none; cursor: grab;
  }
  .modal__head { padding: 12px 18px 14px; touch-action: none; }
  .modal__body { padding: 16px 18px; }
  .modal__foot { padding: 12px 18px calc(12px + var(--safe-b)); }
  @keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes sheetOut { to { transform: translateY(100%); } }
}

@media (max-width: 760px) {
  body { font-size: 15px; }
  .page { padding-left: max(12px, var(--safe-l)); padding-right: max(12px, var(--safe-r)); padding-top: 12px; }
  .grid { gap: 12px; }
  .stack { gap: 12px; }
  .card { padding: 15px; border-radius: 17px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

  .modal__foot { flex-direction: column-reverse; align-items: stretch; }
  .modal__foot .btn { width: 100%; }
  .modal__foot .spacer { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }

  .page-head__actions { width: 100%; justify-content: flex-start; }
  .page-head__actions .btn { flex: 1 1 auto; }

  /* Alatne trake: sve u punu širinu umjesto stiskanja u jedan red. */
  .toolbar { flex-wrap: wrap; }
  .toolbar > .input, .toolbar > .select,
  .filters > .input, .filters > .select, .filters > .input-group {
    flex: 1 1 100%; width: 100% !important; min-width: 0;
  }
  /* Pretraga i glavno dugme dijele red; ostalo ide u punu širinu. */
  .toolbar > .input-group { flex: 1 1 150px; min-width: 0; }
  .toolbar > .btn { flex: 1 1 auto; }
  .daterange { flex: 1 1 100%; }
  .daterange .input, .daterange .select { flex: 1 1 0; min-width: 0; width: auto !important; }

  /* Filteri se otvaraju dugmetom da ne zauzmu pola ekrana. */
  .filters { display: none; }
  .filters.is-open {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    flex: 1 1 100%; width: 100%; margin-top: 2px;
  }
  .filters__btn { display: inline-flex; flex: none !important; }

  /* Brojke u traci koja se pomjera prstom — bez pola ekrana potrošenog. */
  .grid--stats {
    display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity; scrollbar-width: none; padding-bottom: 2px;
  }
  .grid--stats::-webkit-scrollbar { display: none; }
  .grid--stats > .stat {
    flex: 0 0 auto; width: 152px; scroll-snap-align: start;
    padding: 12px 14px; gap: 2px;
  }
  .stat__label { font-size: 10px; letter-spacing: 0.08em; }
  .stat__value { font-size: 22px; }
  .stat__sub { font-size: 11px; overflow-wrap: anywhere; }

  /* Alatna traka kalendara: naslov gore, strelice desno, ostalo u red ispod. */
  .cal__toolbar { gap: 8px; }
  .cal__toolbar .spacer { display: none; }
  .cal__month { order: -2; flex: 1 1 auto; min-width: 120px; }
  .cal__nav { order: -1; margin-left: auto; }
  .cal__toolbar .select { flex: 1 1 0; min-width: 92px; width: auto !important; }
  .cal__toolbar .btn { flex: 1 1 auto; }
  /* Mjesec i godina se biraju dodirom na naslov, pa padajući meniji odlaze. */
  .cal__toolbar .cal__jump { display: none; }
  .cal__month { cursor: pointer; }
  .cal__day { min-height: 74px; padding: 5px; border-radius: 11px; }
  .cal__ev { font-size: 10px; padding: 2px 4px; }
  .cal__ev time { display: none; }
  .cal__grid { gap: 4px; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-week__col { min-height: 0; }
  .year-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

@media (max-width: 480px) {
  .cal__day { min-height: 56px; justify-content: flex-start; }
  .cal__events { display: none; }
  .cal__day .cal__dots { display: flex; gap: 2px; flex-wrap: wrap; margin-top: auto; }
  .cal__more { display: none; }
  .year-grid { grid-template-columns: 1fr; }
}

/* Veliki ekrani / TV */
@media (min-width: 1800px) {
  :root { --sidebar-w: 296px; }
  body { font-size: 16px; }
  .page { max-width: 2100px; margin-inline: auto; width: 100%; }
}
@media (min-width: 2400px) {
  body { font-size: 18px; }
  :root { --radius: 24px; --sidebar-w: 336px; }
}

/* ============================================================
   PRIJAVA
   ============================================================ */
.login {
  min-height: 100dvh; display: grid; place-items: center;
  padding: max(20px, var(--safe-t)) 20px calc(20px + var(--safe-b));
}
.login__card { width: min(430px, 100%); padding: clamp(24px, 5vw, 38px); animation: modalIn 0.45s var(--ease); }
.login__logo { width: 168px; margin: 0 auto 6px; }
html[data-theme='light'] .login__logo { filter: invert(1); }
.login__sub { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-bottom: 24px; }
.login__form { display: flex; flex-direction: column; gap: 14px; }
.login__err {
  padding: 11px 14px; border-radius: var(--radius-sm); background: var(--red-bg);
  border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); color: var(--red);
  font-size: 13.2px; font-weight: 500; display: flex; align-items: center; gap: 9px;
}
.login__foot { margin-top: 20px; text-align: center; font-size: 11.5px; color: var(--text-mute); letter-spacing: 0.06em; }

/* ============================================================
   POMOCNE KLASE
   ============================================================ */
.hide { display: none !important; }
.text-red { color: var(--red); } .text-amber { color: var(--amber); }
.text-green { color: var(--green); } .text-blue { color: var(--blue); }
.flex-1 { flex: 1; min-width: 0; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400; padding: 7px 16px;
  padding-top: calc(7px + var(--safe-t));
  background: var(--amber); color: #111; font-size: 12.5px; font-weight: 600; text-align: center;
  transform: translateY(-100%); transition: transform 0.3s var(--ease);
}
body.is-offline .offline-bar { transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .bg-decor__orb { animation: none; }
}

@media print {
  .sidebar, .topbar, .pillbar, .toasts, .bg-decor, .btn, .icon-btn { display: none !important; }
  .app { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; background: #fff; }
}
