/* =========================================================
   3E Finansije – Evidencija rada · dizajn sistem
   (boje, fontovi i oblici preuzeti sa 3efinansije.rs)
   ========================================================= */
:root {
  --bg: #f6f3ec;
  --bg-deep: #efeade;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --surface-3: #f1ede3;
  --border: rgba(17, 66, 50, .12);
  --border-strong: rgba(17, 66, 50, .22);
  --text: #252a28;
  --text-2: #3e4642;
  --muted: #5c635f;
  --primary: #114232;
  --primary-2: #16523e;
  --primary-dark: #0b2b21;
  --primary-ink: #f6f3ec;
  --primary-soft: #e4ece7;
  --primary-soft-2: #d2e0d8;
  --accent: #b59a6a;
  --accent-dark: #836a3e;
  --accent-light: #d4be8f;
  --accent-soft: #f4eddd;
  --secondary: #789486;
  --success: #2c7a52;
  --success-soft: #e2f0e7;
  --warning: #a66a12;
  --warning-soft: #fbf0d9;
  --danger: #b3261e;
  --danger-soft: #f9e4e1;
  --info: #35698a;
  --info-soft: #e3eef5;
  /* vrste odsustva */
  --t-annual: #b59a6a;
  --t-sick: #b5523b;
  --t-paid: #789486;
  --t-unpaid: #7d8380;
  --t-remote: #35698a;
  --t-trip: #6d5c99;
  --t-comp: #2f8a7e;
  --t-absent: #8a8f8c;
  --t-work: #114232;
  --t-holiday: #16523e;
  --shadow-sm: 0 1px 2px rgba(17, 66, 50, .06);
  --shadow: 0 4px 16px rgba(17, 66, 50, .08);
  --shadow-lg: 0 18px 48px rgba(17, 66, 50, .16);
  --r: 10px 0;
  --r-lg: 16px 0;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --sidebar: 260px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --hatch: repeating-linear-gradient(135deg, rgba(17, 66, 50, .08) 0 5px, rgba(17, 66, 50, .02) 5px 10px);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui: 'League Spartan', 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1813;
  --bg-deep: #0e1f19;
  --surface: #11231c;
  --surface-2: #142a21;
  --surface-3: #1a3329;
  --border: rgba(246, 243, 236, .09);
  --border-strong: rgba(246, 243, 236, .17);
  --text: #f1ede3;
  --text-2: #d3d9d3;
  --muted: #9aa89f;
  --primary: #2e7a5c;
  --primary-2: #379170;
  --primary-ink: #f6f3ec;
  --primary-soft: #173a2e;
  --primary-soft-2: #1e4a3b;
  --accent: #c9ad7a;
  --accent-dark: #d4be8f;
  --accent-soft: #2c2619;
  --success: #5cbf8a;
  --success-soft: #15301f;
  --warning: #e0a94a;
  --warning-soft: #2e2412;
  --danger: #ef7a6e;
  --danger-soft: #36191a;
  --info: #7fb2d6;
  --info-soft: #152938;
  --t-work: #3f9a75;
  --t-holiday: #2e7a5c;
  --t-remote: #6aa3c8;
  --t-trip: #9b8ad0;
  --t-comp: #5bbfb0;
  --t-sick: #d9775f;
  --t-unpaid: #9aa19d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --hatch: repeating-linear-gradient(135deg, rgba(246, 243, 236, .07) 0 5px, rgba(246, 243, 236, .02) 5px 10px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
:root[data-theme="dark"] a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.spacer { flex: 1; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-dark); }

/* ---------- Okvir ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; position: sticky; top: 0; height: 100vh; z-index: 40;
  display: flex; flex-direction: column;
  background: radial-gradient(circle at 0 100%, transparent 179px, rgba(181, 154, 106, .2) 180px, transparent 181px), var(--primary-dark); color: #b9c6bd;
  transition: width .22s ease, transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 20px; border-bottom: 1px solid rgba(246, 243, 236, .08); }
.brand img { width: 38px; height: 38px; flex: none; }
.brand-text { min-width: 0; overflow: hidden; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .1em; color: #f6f3ec; white-space: nowrap; line-height: 1.2; }
.brand-tag { font-size: 9.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.nav { padding: 10px 12px; overflow-y: auto; overflow-x: hidden; flex: 1; scrollbar-width: thin; position: relative; z-index: 1; }
.nav-group { font-family: var(--font-ui); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .16em; color: rgba(185, 198, 189, .6); padding: 18px 12px 6px; white-space: nowrap; overflow: hidden; }
.nav a {
  display: flex; align-items: center; gap: 12px; position: relative;
  padding: 10px 12px; border-radius: var(--r); margin: 2px 0;
  color: #b9c6bd; font-family: var(--font-ui); font-weight: 500; font-size: 15px;
  transition: background .15s, color .15s;
}
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav a:hover { background: rgba(246, 243, 236, .06); color: #f6f3ec; }
.nav a.active { background: rgba(246, 243, 236, .1); color: #f6f3ec; }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav a.active svg { color: var(--accent); }
.nav .nav-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--primary-dark); font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--font); }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(246, 243, 236, .08); position: relative; z-index: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r); cursor: pointer; width: 100%; background: none; border: 0; text-align: left; color: #f6f3ec; }
.user-chip:hover { background: rgba(246, 243, 236, .06); }
.user-chip .meta { flex: 1; min-width: 0; }
.user-chip .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .role { font-size: 11.5px; color: var(--accent); }
.user-chip .avatar { box-shadow: 0 0 0 2px rgba(181, 154, 106, .55); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 32px; position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.crumbs { font-family: var(--font-ui); font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; }
.crumbs b { color: var(--text); font-weight: 600; }
.clock-mini { font-variant-numeric: tabular-nums; font-family: var(--font-ui); font-weight: 600; color: var(--text-2); padding: 0 10px; white-space: nowrap; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r); display: inline-grid; place-items: center; position: relative;
  border: 0; background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.ring svg { animation: bell-ring .9s ease; transform-origin: 50% 10%; }
@keyframes bell-ring { 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }
.icon-btn .dot-count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.icon-btn.menu-btn { display: none; }

/* Zeleni „hero“ pojas kao na sajtu */
.hero {
  position: relative; overflow: hidden; overflow: clip; background: var(--primary); color: #f6f3ec;
  padding: 34px 32px 38px; isolation: isolate;
}
:root[data-theme="dark"] .hero { background: #0f2e23; }
.hero::before, .hero::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid rgba(246, 243, 236, .1); z-index: -1; pointer-events: none; }
.hero::before { width: 460px; height: 460px; right: -80px; top: -260px; }
.hero::after { width: 260px; height: 260px; right: 220px; bottom: -200px; border-color: rgba(181, 154, 106, .22); }
.hero .eyebrow { color: var(--accent-light); display: flex; gap: 8px; align-items: center; }
.hero .eyebrow a { color: var(--accent-light); }
.hero h1 { font-size: 34px; line-height: 1.15; margin-top: 8px; color: #f6f3ec; }
.hero .sub { color: #b9c6bd; margin-top: 6px; max-width: 720px; font-size: 15px; }
.hero-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero-row .spacer { flex: 1; }
.hero .btn:not(.primary):not(.gold) { background: rgba(246, 243, 236, .08); border-color: rgba(246, 243, 236, .2); color: #f6f3ec; }
.hero .btn:not(.primary):not(.gold):hover { background: rgba(246, 243, 236, .16); }
.content { padding: 26px 32px 48px; flex: 1; min-width: 0; }

/* ---------- Avatari ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: #f6f3ec; background: var(--primary); letter-spacing: .02em;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }

/* ---------- Dugmad ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-family: var(--font-ui); font-weight: 500; font-size: 15px; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), border-color .2s, color .2s, transform .05s, box-shadow .2s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-2); box-shadow: var(--shadow); }
.btn.gold { background: var(--accent); border-color: var(--accent); color: #0b2b21; }
.btn.gold:hover { background: var(--accent-light); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
:root[data-theme="dark"] .btn.soft { color: var(--text); }
.btn.soft:hover { background: var(--primary-soft-2); }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.lg { height: 52px; padding: 0 28px; font-size: 17px; }
.btn svg.i { width: 17px; height: 17px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: var(--r); font-family: var(--font-ui); font-weight: 500; font-size: 14px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Kartice ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 18px; color: var(--primary); }
:root[data-theme="dark"] .card-head h3 { color: var(--text); }
.card-head .spacer { flex: 1; }
.card-body { padding: 20px 22px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.ico-circle {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--primary); color: var(--accent);
}
.ico-circle svg.i { width: 20px; height: 20px; stroke-width: 1.6; }

.kpi { padding: 20px 22px; display: flex; gap: 14px; align-items: flex-start; }
.kpi .k-main { min-width: 0; flex: 1; }
.kpi .label { color: var(--muted); font-family: var(--font-ui); font-size: 14px; font-weight: 500; }
.kpi .value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.15; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .kpi .value { color: var(--text); }
.kpi .value small { font-size: 15px; color: var(--muted); font-weight: 600; }
.kpi .hint { font-size: 12.5px; color: var(--muted); }
.kpi .value.pos { color: var(--success); }
.clock-times b.pos { color: var(--accent-light); }
.clock-times b.neg { color: #ffb4a6; }
.as-days { font-size: .78em; font-weight: 500; opacity: .75; white-space: nowrap; }
.round-note { font-size: 11.5px; opacity: .7; margin-top: 6px; }
.live-dot.warn { background: #f3c062; box-shadow: none; }
.check.no-return { align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; }
.check.no-return input { margin-top: 3px; }
.kpi .value.neg { color: var(--danger); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .spacer { flex: 1; }
.month-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 3px; }
.month-nav .icon-btn { width: 34px; height: 34px; }
.month-nav .m-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; min-width: 150px; text-align: center; text-transform: capitalize; }
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r); min-width: 240px;
}
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.search svg { color: var(--muted); }

/* ---------- Forme ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label-s { font-family: var(--font-ui); font-size: 14px; font-weight: 500; color: var(--text-2); }
.input, .field input:not([type=checkbox]):not([type=color]):not([type=radio]), .field select, .field textarea, select.input {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field input:disabled, .field select:disabled { background: var(--surface-3); color: var(--muted); }
.field .help { font-size: 12.5px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
input[type=color] { width: 46px; height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 3px; background: var(--surface); cursor: pointer; }
.form-section { grid-column: 1 / -1; padding-top: 6px; margin-top: 4px; border-top: 1px dashed var(--border-strong); }
.form-section .eyebrow { display: block; margin-top: 10px; }

/* Izbor vrste odsustva – pločice */
.type-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-tile { position: relative; cursor: pointer; }
.type-tile input { position: absolute; opacity: 0; pointer-events: none; }
.type-tile .tt {
  display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r);
  background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; height: 100%;
}
.type-tile .tt b { font-family: var(--font-ui); font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.type-tile .tt small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.type-tile .tt .code { width: 34px; height: 24px; border-radius: 4px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--tc); letter-spacing: .04em; }
.type-tile:hover .tt { border-color: var(--tc); }
.type-tile input:checked + .tt { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, var(--surface)); box-shadow: 0 0 0 1px var(--tc); }
.type-tile input:focus-visible + .tt { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 40%, transparent); }

/* ---------- Tabele ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-family: var(--font-ui); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table .strong { font-weight: 600; }
.table .sub { font-size: 12.5px; color: var(--muted); }
.table tr.weekend td { background: var(--surface-2); color: var(--muted); }
.table tr.is-today td { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cell-person { display: flex; align-items: center; gap: 10px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 38px; height: 38px; stroke-width: 1.4; margin-bottom: 8px; color: var(--accent); }

/* ---------- Bedževi ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.pending { background: var(--warning-soft); color: var(--warning); }
.badge.approved, .badge.success { background: var(--success-soft); color: var(--success); }
.badge.rejected, .badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.cancelled, .badge.void { background: var(--surface-3); color: var(--muted); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--accent-soft); color: var(--accent-dark); }
.badge.type { background: color-mix(in srgb, var(--tc) 14%, var(--surface)); color: color-mix(in srgb, var(--tc) 80%, var(--text)); }
.badge.type::before { background: var(--tc); }
.code-chip { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 5px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; background: var(--tc, var(--muted)); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px 16px; background: rgba(11, 43, 33, .5); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .18s; overflow-y: auto;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  width: 100%; max-width: 580px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.985); transition: transform .2s; display: flex; flex-direction: column; overflow: hidden;
}
.modal-backdrop.open .modal { transform: none; }
.modal.lg { max-width: 780px; }
.modal.xl { max-width: 960px; }
.modal.sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 21px; flex: 1; color: var(--primary); }
:root[data-theme="dark"] .modal-head h3 { color: var(--text); }
.modal-body { padding: 18px 24px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* ---------- Toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px; min-width: 260px; max-width: 440px;
  background: var(--primary-dark); color: #f6f3ec; border-radius: var(--r); box-shadow: var(--shadow-lg); font-weight: 500;
  animation: toast-in .25s ease-out; border-left: 3px solid var(--accent);
}
.toast.error { background: var(--danger); border-left-color: #fff; }
.toast.success svg { color: var(--accent); }
.toast-action { margin-left: auto; background: none; border: 1px solid rgba(246, 243, 236, .4); color: inherit; border-radius: 4px; padding: 3px 10px; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Prijava ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.login-art {
  position: relative; overflow: hidden; background: var(--primary); color: #f6f3ec; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
}
.login-art .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(246, 243, 236, .1); z-index: -1; }
.login-art .ring.r1 { width: 640px; height: 640px; right: -260px; top: -200px; }
.login-art .ring.r2 { width: 380px; height: 380px; right: -130px; top: -70px; border-color: rgba(181, 154, 106, .25); }
.login-art .ring.r3 { width: 420px; height: 420px; left: -200px; bottom: -220px; }
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo img { width: 44px; height: 44px; }
.login-art h2 { font-size: 44px; line-height: 1.12; max-width: 520px; margin: 14px 0 16px; color: #f6f3ec; }
.login-art p { color: #b9c6bd; max-width: 460px; font-size: 16px; margin: 0; }
.login-feats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; max-width: 480px; }
.login-feats li { display: flex; gap: 12px; align-items: flex-start; color: #e4e9e3; }
.login-feats li svg { color: var(--accent); margin-top: 2px; }
.login-art .foot { font-size: 12.5px; color: rgba(185, 198, 189, .7); }
.login-form { display: grid; place-items: center; padding: 32px; position: relative; }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 32px; color: var(--primary); margin: 10px 0 4px; }
:root[data-theme="dark"] .login-card h1 { color: var(--text); }
.login-card .stack { gap: 14px; margin-top: 26px; }
.login-input { position: relative; display: flex; align-items: center; }
.login-input > svg.i { position: absolute; left: 13px; color: var(--muted); pointer-events: none; z-index: 1; }
.login-card .login-input input { padding-left: 42px !important; height: 48px; }
.login-card .login-input input#lp { padding-right: 48px !important; }
.login-input:focus-within > svg.i { color: var(--accent-dark); }
.login-eye { position: absolute; right: 4px; width: 40px; height: 40px; }
.login-btn { width: 100%; height: 50px; }
.login-btn svg.i { transition: transform .25s; }
.login-btn:hover svg.i { transform: translateX(4px); }
.login-err { color: var(--danger); font-weight: 500; min-height: 20px; font-size: 13px; }
.demo-hint { margin-top: 22px; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); font-size: 12.5px; color: var(--text-2); border-left: 3px solid var(--accent); }
.login-card.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }

/* ---------- Sat za prijavu dolaska ---------- */
.clock-card {
  position: relative; overflow: hidden; overflow: clip; isolation: isolate; color: #f6f3ec;
  background: var(--primary); border-radius: var(--r-lg); padding: 26px 28px; display: flex; gap: 28px; align-items: center;
}
:root[data-theme="dark"] .clock-card { background: #0f2e23; border: 1px solid var(--border); }
.clock-card::before { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; border: 1px solid rgba(246, 243, 236, .1); right: -120px; top: -150px; z-index: -1; }
.clock-card::after { content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(181, 154, 106, .25); right: 40px; bottom: -150px; z-index: -1; }
.ring-wrap { position: relative; width: 150px; height: 150px; flex: none; }
.ring-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-wrap .track { stroke: rgba(246, 243, 236, .12); }
.ring-wrap .fill { stroke: var(--accent); transition: stroke-dashoffset .8s var(--ease); }
.ring-wrap .ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-wrap .rc-time { font-family: var(--font-display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-wrap .rc-lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #b9c6bd; margin-top: 6px; }
.clock-info { flex: 1; min-width: 0; }
.clock-info .eyebrow { color: var(--accent-light); }
.clock-info h2 { font-size: 26px; margin: 6px 0 4px; color: #f6f3ec; }
.clock-info .ci-sub { color: #b9c6bd; font-size: 14.5px; }
.clock-times { display: flex; gap: 22px; margin: 16px 0 18px; flex-wrap: wrap; }
.clock-times div { font-size: 12px; color: #b9c6bd; letter-spacing: .08em; text-transform: uppercase; }
.clock-times b { display: block; font-family: var(--font-display); font-size: 20px; color: #f6f3ec; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.clock-card .btn.ghost { color: #f6f3ec; }
.clock-card .btn.ghost:hover { background: rgba(246, 243, 236, .1); }
.clock-card .btn:not(.gold):not(.ghost) { background: rgba(246, 243, 236, .1); border-color: rgba(246, 243, 236, .25); color: #f6f3ec; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #6fd39b; display: inline-block; box-shadow: 0 0 0 0 rgba(111, 211, 155, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(0, 0, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); } }

/* ---------- Liste ---------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 13px 22px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover { background: var(--surface-2); }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-side { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

/* Stanje godišnjeg fonda */
.bal-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.bal-bar i { display: block; height: 100%; }
.bal-bar .b-taken { background: var(--primary); }
.bal-bar .b-planned { background: var(--accent); }
.bal-bar .b-pending { background: repeating-linear-gradient(135deg, var(--accent) 0 4px, var(--accent-light) 4px 8px); opacity: .7; }
.bal-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.bal-legend span { display: inline-flex; gap: 6px; align-items: center; }
.bal-legend i { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }
.bal-big { font-family: var(--font-display); font-size: 54px; font-weight: 700; line-height: 1; color: var(--primary); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .bal-big { color: var(--accent); }
.bal-big small { font-size: 18px; color: var(--muted); }
.mini-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- Mesečni kalendar zaposlenog ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day {
  min-height: 96px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); padding: 8px 9px;
  display: flex; flex-direction: column; gap: 4px; position: relative; transition: box-shadow .15s, border-color .15s; overflow: hidden;
}
.cal-day.blank { background: transparent; border-style: dashed; opacity: .4; }
.cal-day.editable { cursor: pointer; }
.cal-day.editable:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cal-day .cd-num { font-family: var(--font-display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.cal-day .cd-num .late { margin-left: auto; }
.cal-day .cd-t { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.cal-day .cd-h { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--primary); margin-top: auto; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .cal-day .cd-h { color: var(--text); }
.cal-day .cd-h small { font-size: 11px; color: var(--muted); font-weight: 600; }
.cal-day .cd-lbl { font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.cal-day.weekend, .cal-day.holiday { background: var(--surface-2); }
.cal-day.weekend { background-image: var(--hatch); }
.cal-day.holiday .cd-lbl { color: var(--t-holiday); }
:root[data-theme="dark"] .cal-day.holiday .cd-lbl { color: var(--success); }
.cal-day.leave { background: color-mix(in srgb, var(--tc) 11%, var(--surface)); border-color: color-mix(in srgb, var(--tc) 40%, transparent); }
.cal-day.leave .cd-lbl { color: color-mix(in srgb, var(--tc) 80%, var(--text)); }
.cal-day.leave::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc); }
.cal-day.absent { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 5%, var(--surface)); }
.cal-day.absent .cd-lbl { color: var(--danger); }
.cal-day.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-day.future { opacity: .75; }
.cal-day.none { opacity: .4; }
.cal-day .cd-pend { font-size: 10.5px; font-weight: 600; color: var(--warning); }
.cal-day .cd-note { position: absolute; top: 8px; right: 8px; color: var(--accent); }
.cal-day .cd-note svg { width: 13px; height: 13px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 10px; border-radius: 2px; background: var(--tc); }

/* ---------- Mesečna tabela svih zaposlenih ---------- */
.sheet-wrap { overflow: auto; max-height: calc(100vh - 230px); }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.sheet th, .sheet td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: center; padding: 0; height: 40px; min-width: 34px; }
.sheet thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-family: var(--font-ui); font-weight: 600; font-size: 12px; color: var(--muted); height: 46px; line-height: 1.1; }
.sheet thead th small { display: block; font-size: 10px; font-weight: 500; letter-spacing: .05em; }
.sheet thead th.we { color: var(--accent-dark); }
.sheet .name-col { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; padding: 0 14px; min-width: 210px; max-width: 230px; }
.sheet thead .name-col { z-index: 4; background: var(--surface-2); }
.sheet .name-col .cell-person { cursor: pointer; }
.sheet .name-col .cell-person:hover .strong { color: var(--accent-dark); text-decoration: underline; }
.sheet td.c { cursor: pointer; font-variant-numeric: tabular-nums; font-weight: 600; }
.sheet td.c:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet td.we { background: var(--surface-2); background-image: var(--hatch); }
.sheet td.hol { background: color-mix(in srgb, var(--t-holiday) 10%, var(--surface)); color: var(--t-holiday); font-size: 10.5px; }
:root[data-theme="dark"] .sheet td.hol { color: var(--success); }
.sheet td.lv { background: color-mix(in srgb, var(--tc) 16%, var(--surface)); color: color-mix(in srgb, var(--tc) 85%, var(--text)); font-size: 11px; font-weight: 700; }
.sheet td.ab { color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.sheet td.wk.ot { color: var(--accent-dark); }
.sheet td.wk.lt { box-shadow: inset 0 -3px 0 var(--warning); }
.sheet td.open { color: var(--success); }
.sheet td.today-col, .sheet th.today-col { background-color: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.sheet .tot { background: var(--surface-2); font-weight: 700; min-width: 54px; padding: 0 8px; }
.sheet thead .tot { color: var(--primary); }

/* ---------- Kalendar odsustva tima ---------- */
.team-cal { overflow: auto; }
.tc-grid { display: grid; min-width: max-content; }
.tc-cell { height: 46px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); position: relative; }
.tc-head { height: 52px; position: sticky; top: 0; z-index: 3; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: var(--muted); line-height: 1.1; }
.tc-head small { font-size: 10px; font-weight: 500; }
.tc-head.we { color: var(--accent-dark); }
.tc-head.today { background: var(--accent); color: #0b2b21; }
.tc-name { position: sticky; left: 0; z-index: 2; background: var(--surface); display: flex; align-items: center; gap: 10px; padding: 0 14px; min-width: 220px; }
.tc-name .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-name .ps { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-corner { position: sticky; left: 0; top: 0; z-index: 4; background: var(--surface-2); }
.tc-cell.we { background: var(--surface-2); background-image: var(--hatch); }
.tc-cell.hol { background: color-mix(in srgb, var(--t-holiday) 9%, var(--surface)); }
.tc-cell.today { background-color: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.tc-bar {
  position: absolute; top: 9px; bottom: 9px; left: 2px; right: 2px; z-index: 1; border-radius: 4px;
  background: var(--tc); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer;
  letter-spacing: .03em;
}
.tc-bar.cont-l { left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tc-bar.cont-r { right: -1px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tc-bar.pending { background: repeating-linear-gradient(135deg, var(--tc) 0 5px, color-mix(in srgb, var(--tc) 55%, var(--surface)) 5px 10px); color: #fff; }
.tc-bar:hover { filter: brightness(1.08); box-shadow: var(--shadow); }
.tc-count { font-size: 11px; font-weight: 700; color: var(--muted); display: grid; place-items: center; height: 100%; }
.tc-count.hi { color: var(--danger); }

/* ---------- Zahtevi za odobravanje ---------- */
.req-card { padding: 20px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; border-bottom: 1px solid var(--border); }
.req-card:last-child { border-bottom: 0; }
.req-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.req-top .nm { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.req-period { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--primary); margin: 10px 0 2px; }
:root[data-theme="dark"] .req-period { color: var(--text); }
.req-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.req-meta span { display: inline-flex; gap: 6px; align-items: center; }
.req-meta svg { width: 15px; height: 15px; color: var(--accent-dark); }
.req-note { margin-top: 10px; padding: 10px 14px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13.5px; color: var(--text-2); }
.req-warn { margin-top: 10px; font-size: 12.5px; color: var(--warning); display: flex; gap: 6px; align-items: flex-start; }
.req-warn svg { width: 15px; height: 15px; margin-top: 2px; }
.req-actions { display: flex; flex-direction: column; gap: 8px; min-width: 150px; }

/* ---------- Kartice zaposlenih ---------- */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.entity { padding: 20px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: box-shadow .2s, transform .2s, border-color .2s; }
.entity:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--border-strong); }
.entity.inactive { opacity: .55; }
.entity .e-top { display: flex; gap: 12px; align-items: center; }
.entity .e-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; }
.entity .e-sub { font-size: 13px; color: var(--muted); }
.entity .e-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.entity .e-meta span { display: flex; align-items: center; gap: 7px; }
.entity .e-meta svg { width: 14px; height: 14px; color: var(--accent-dark); }
.entity .e-bal { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.entity .e-bal b { color: var(--text); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-family: var(--font-ui); font-weight: 500; font-size: 15px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--accent); }
:root[data-theme="dark"] .tabs button.on { color: var(--text); }
.tabs .count { background: var(--accent-soft); color: var(--accent-dark); border-radius: 999px; padding: 0 8px; font-size: 12px; font-family: var(--font); font-weight: 600; }

.state-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.state-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state-present { color: var(--success); }
.state-left { color: var(--muted); }
.state-missing { color: var(--danger); }
.state-expected { color: var(--warning); }
.state-off { color: var(--muted); }
.state-leave { color: var(--accent-dark); }
.state-remote { color: var(--t-remote); }
.state-trip { color: var(--t-trip); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.info-box { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 13.5px; background: var(--surface-3); color: var(--text-2); }
.info-box svg { margin-top: 1px; color: var(--accent-dark); }
.info-box.ok { background: var(--success-soft); color: var(--success); }
.info-box.ok svg { color: var(--success); }
.info-box.err { background: var(--danger-soft); color: var(--danger); }
.info-box.err svg { color: var(--danger); }
.info-box.warn { background: var(--warning-soft); color: var(--warning); }
.info-box.warn svg { color: var(--warning); }

/* ---------- Obaveštenja ---------- */
.notif-panel {
  position: fixed; top: 60px; right: 24px; z-index: 90; width: 380px; max-width: calc(100vw - 32px); max-height: 70vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease-out;
}
.notif-panel .np-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.notif-panel .np-head h4 { font-size: 16px; flex: 1; }
.notif-panel, .sidebar { overscroll-behavior: contain; }
.notif-panel .np-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; font-size: 13px; font-weight: 600; color: var(--primary); position: sticky; bottom: 0; background: var(--surface); }
.notif-panel .np-foot svg { width: 14px; height: 14px; }
.notif-panel .np-foot:hover { background: var(--surface-2); }
.notif { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.notif .n-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--primary); color: var(--accent); }
.notif .n-ico svg { width: 15px; height: 15px; }
.notif .n-ico.approved { background: var(--success); color: #fff; }
.notif .n-ico.rejected { background: var(--danger); color: #fff; }
.notif .n-t { font-size: 13px; line-height: 1.4; }
.notif .n-d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ---------- Animacije ---------- */
.page-enter > * { animation: rise .5s var(--ease) both; }
.page-enter > *:nth-child(2) { animation-delay: .05s; }
.page-enter > *:nth-child(3) { animation-delay: .1s; }
.page-enter > *:nth-child(4) { animation-delay: .15s; }
.page-enter > *:nth-child(n+5) { animation-delay: .2s; }
.page-enter .grid > .card { animation: rise .5s var(--ease) both; }
.page-enter .grid > .card:nth-child(2) { animation-delay: .06s; }
.page-enter .grid > .card:nth-child(3) { animation-delay: .12s; }
.page-enter .grid > .card:nth-child(4) { animation-delay: .18s; }
.page-enter .entity-grid > * { animation: rise .5s var(--ease) both; }
.page-enter .cal-day { animation: fade .5s var(--ease) both; }
.page-enter .ring-wrap .fill { animation: ring-in 1s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes ring-in { from { stroke-dashoffset: var(--circ); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Štampa ---------- */
#print-root { display: none; }
.report { font-family: var(--font); color: #252a28; font-size: 10.5px; line-height: 1.45; background: #fff; }
.rp-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 12px; border-bottom: 3px solid #114232; align-items: flex-end; }
.rp-brand { display: flex; gap: 10px; align-items: center; }
.rp-brand img { width: 34px; height: 34px; }
.rp-brand b { font-family: var(--font-display); font-size: 16px; letter-spacing: .1em; color: #114232; display: block; }
.rp-brand small { font-size: 8.5px; letter-spacing: .18em; text-transform: uppercase; color: #836a3e; }
.rp-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; text-align: right; }
.rp-muted { color: #5c635f; font-size: 9.5px; }
.rp-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.rp-kpi { border: 1px solid #e3ddcf; border-top: 3px solid #b59a6a; padding: 8px 10px; }
.rp-kpi .l { font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: #5c635f; }
.rp-kpi .v { font-size: 15px; font-weight: 700; color: #114232; }
.rp-table { width: 100%; border-collapse: collapse; }
.rp-table th { background: #114232; color: #f6f3ec; text-align: left; padding: 5px 7px; font-size: 9.5px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-table td { padding: 4px 7px; border-bottom: 1px solid #ece6d8; }
.rp-table tr.we td { background: #f6f3ec; color: #8a8f8c; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.rp-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-table.grid-sheet { font-size: 8px; }
.rp-table.grid-sheet th, .rp-table.grid-sheet td { padding: 3px 2px; text-align: center; border: 1px solid #e3ddcf; }
.rp-table.grid-sheet td:first-child, .rp-table.grid-sheet th:first-child { text-align: left; padding-left: 5px; white-space: nowrap; }
.rp-sign { display: flex; justify-content: space-between; margin-top: 36px; font-size: 10px; }
.rp-sign div { width: 220px; border-top: 1px solid #252a28; padding-top: 4px; text-align: center; }
@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing { background: #fff; }
  @page { margin: 12mm; }
  body.printing.landscape { }
}

/* ---------- Uvlačenje menija ---------- */
.sb-toggle {
  position: absolute; top: 32px; right: -13px; z-index: 45;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); border: 2px solid var(--bg); color: var(--primary-dark);
  transition: transform .22s;
}
.sb-toggle svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.sb-close, .sb-backdrop { display: none; }
@media (min-width: 768px) {
  .app.collapsed { --sidebar: 78px; }
  .app.collapsed .sb-toggle { transform: rotate(180deg); }
  .app.collapsed .brand { justify-content: center; padding: 24px 0 20px; }
  .app.collapsed .brand-text, .app.collapsed .nav a span, .app.collapsed .user-chip .meta, .app.collapsed .user-chip > svg.i { display: none; }
  .app.collapsed .nav { padding: 10px; }
  .app.collapsed .nav a { justify-content: center; padding: 11px 0; }
  .app.collapsed .nav a.active::before { left: -10px; }
  .app.collapsed .nav .nav-badge { position: absolute; top: 2px; right: 4px; min-width: 17px; height: 17px; font-size: 10px; padding: 0 4px; }
  .app.collapsed .nav-group { padding: 0; margin: 12px 8px; height: 1px; background: rgba(246, 243, 236, .1); }
  .app.collapsed .nav-group span { display: none; }
  .app.collapsed .sidebar-foot { padding: 14px 10px; }
  .app.collapsed .user-chip { justify-content: center; padding: 8px 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .type-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; transform: translateX(-100%); box-shadow: var(--shadow-lg); z-index: 60; }
  .app.nav-open .sidebar { transform: none; }
  .sb-toggle { display: none; }
  .sb-close { display: inline-grid; margin-left: auto; color: #f6f3ec; }
  .sb-close:hover { background: rgba(246, 243, 236, .1); color: #fff; }
  .app.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11, 43, 33, .5); backdrop-filter: blur(2px); }
  .icon-btn.menu-btn { display: inline-grid; }
  .clock-mini { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 18px 16px 32px; }
  .topbar { padding: 0 10px 0 8px; height: 58px; }
  .hero { padding: 24px 16px 28px; }
  .hero h1 { font-size: 26px; }
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .search { min-width: 0; flex: 1; }
  .kpi { padding: 16px; flex-direction: column; gap: 8px; }
  .kpi .ico-circle { width: 36px; height: 36px; }
  .kpi .value { font-size: 22px; }
  .clock-card { flex-direction: column; align-items: stretch; text-align: center; padding: 22px 18px; gap: 16px; }
  .ring-wrap { margin: 0 auto; }
  .clock-times { justify-content: center; }
  .clock-card .btn-row { justify-content: center; }
  .cal { gap: 3px; }
  .cal-head { font-size: 10px; letter-spacing: .05em; }
  .cal-day { min-height: 64px; padding: 5px; }
  .cal-day .cd-t, .cal-day .cd-lbl, .cal-day .cd-pend { display: none; }
  .cal-day .cd-h { font-size: 12.5px; }
  .cal-day .cd-num { font-size: 13px; }
  .cal-day.leave .cd-code { display: inline-grid; }
  .req-card { grid-template-columns: 1fr; }
  .req-actions { flex-direction: row; }
  .req-actions .btn { flex: 1; }
  .type-tiles { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .list-item { padding: 12px 16px; }
  .card-head { padding: 14px 16px; }
  .card-body { padding: 16px; }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal { border-radius: 0; min-height: 100%; }
  .toolbar > .btn { flex: 1; }
  .notif-panel { right: 16px; }
}
.cal-day .cd-code { display: none; font-size: 10px; height: 18px; min-width: 24px; margin-top: auto; }
/* 24h izbor vremena */
.time24 { display: flex; align-items: center; gap: 2px; height: 42px; padding: 0 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.time24:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.field .time24 select, .time24 select { flex: 1; height: 36px; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 4px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; cursor: pointer; outline: none; }
.time24 span { font-weight: 700; color: var(--muted); }
.quick-times { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }
.grid-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 960px) { .grid-21 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .crumbs { display: none; }
  #quickReq span { display: none; }
  #quickReq { padding: 0 12px; }
}
@media (max-width: 640px) {
  .cal-day .cd-num .late { font-size: 0; width: 8px; height: 8px !important; padding: 0 !important; background: var(--warning); }
  .cal-day .cd-h small { display: none; }
}

/* ---------- Automatsko radno vreme, izlasci i prekovremeni rad ---------- */
.type-tiles.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dur-input { display: flex; align-items: center; gap: 6px; }
.dur-input input { width: 76px !important; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.dur-input select { width: 76px !important; text-align: center; font-weight: 600; }
.dur-input span { color: var(--muted); font-weight: 600; font-size: 13px; }
.cal-day .cd-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-day .cd-tag { font-size: 10.5px; font-weight: 700; line-height: 1; padding: 3px 5px; border-radius: 3px; background: color-mix(in srgb, var(--tc) 14%, var(--surface)); color: color-mix(in srgb, var(--tc) 85%, var(--text)); white-space: nowrap; }
.cal-day .cd-tag.pend { background: transparent; border: 1px dashed var(--tc); }
.cal-day.work.auto .cd-t { color: var(--muted); }
.day-extra { display: flex; flex-direction: column; gap: 8px; }
.day-extra .de-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); font-size: 13.5px; }
.day-extra .de-row.clickable { cursor: pointer; }
.day-extra .de-row.clickable:hover { border-color: var(--accent); }
.day-extra .de-row .spacer { flex: 1; }
.work-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.work-today { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-size: 13px; }
.work-today .wt-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: #f6f3ec; opacity: .92; }
.work-today .badge { background: rgba(255, 255, 255, .14); color: #f6f3ec; }
.state-pill.state-out { color: var(--warning); }
.sheet td.wk.ex { box-shadow: inset 0 -3px 0 var(--warning); }
.sheet td.wk.auto { color: var(--text-2); font-weight: 500; }
.sheet td.wk.auto.ot, .sheet td.wk.auto.ex { font-weight: 700; }
.quick-acts { flex-wrap: nowrap; gap: 2px; }
.quick-acts .btn { padding: 0 8px; }
@media (max-width: 640px) {
  .list-item:has(.quick-acts) .li-main { min-width: 96px; }
  .list-item:has(.quick-acts) .li-side { min-width: 0; }
  .quick-acts .btn { padding: 0 5px; }
}
/* Raspored rada */
.sheet.sched td.sc { background: color-mix(in srgb, var(--sc) 16%, var(--surface)); color: color-mix(in srgb, var(--sc) 85%, var(--text)); font-weight: 700; font-size: 13px; line-height: 1.05; }
.sheet.sched td.sc small { display: block; font-size: 9.5px; font-weight: 700; }
.sheet.sched td.sc.ov { box-shadow: inset 0 0 0 2px var(--sc); background: color-mix(in srgb, var(--sc) 30%, var(--surface)); }
.sheet.sched td.today-col.sc { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day .cd-sched { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day .cd-sched.ov { color: var(--info); font-weight: 700; }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.push-card { margin-bottom: 24px; }
.push-card.hidden { display: none; }

/* ================= Telefon ================= */
.bottom-nav { display: none; }
.login-mlogo { display: none; }
@media (max-width: 767px) {
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border: 0; background: none;
    color: var(--muted); font: 600 10.5px/1.1 var(--font-ui); letter-spacing: .02em; cursor: pointer; border-radius: 10px; -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav svg.i { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  :root[data-theme="dark"] .bottom-nav a.active { color: var(--accent-light); }
  .bottom-nav a.active svg.i { stroke-width: 2.4; }
  .bottom-nav .nav-badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; }
  .bottom-nav .nav-badge.hidden { display: none; }
  .content { padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
  .toasts { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  .topbar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  #quickReq { display: none; }
}
@media (max-width: 640px) {
  .login-mlogo { display: block; margin-bottom: 18px; }
  /* zaglavlje stranice */
  .hero { padding: 16px 16px 18px; }
  .hero h1 { font-size: 22px; margin-top: 4px; }
  .hero .sub { font-size: 13px; margin-top: 4px; }
  .hero-row { gap: 12px; }
  .hero-row .btn-row { width: 100%; }
  .hero-row .btn-row .btn { flex: 1 1 auto; height: 38px; font-size: 13px; padding: 0 10px; }
  /* kartica „danas“ */
  .clock-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); column-gap: 14px; row-gap: 0; text-align: left; padding: 18px 16px; align-items: start; }
  .clock-card .ring-wrap { width: 82px; height: 82px; grid-row: span 3; margin: 0; }
  .ring-wrap .rc-time { font-size: 19px; }
  .ring-wrap .rc-lbl { font-size: 8.5px; letter-spacing: .08em; margin-top: 3px; }
  .clock-info { display: contents; }
  .clock-info .eyebrow { font-size: 10.5px; }
  .clock-info h2 { font-size: 17px; margin: 3px 0 2px; line-height: 1.25; }
  .clock-info .ci-sub { font-size: 12.5px; }
  .clock-card .work-today, .clock-card .clock-times, .clock-card .btn-row { grid-column: 1 / -1; }
  .clock-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 14px 0 14px; justify-content: stretch; }
  .clock-times div { font-size: 10.5px; }
  .clock-times b { font-size: 16px; }
  .clock-card .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .clock-card .btn-row .btn { width: 100%; justify-content: center; font-size: 13px; padding: 0 8px; }
  .clock-card .btn-row .btn:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
  .work-today { margin-top: 10px; }
  /* tabele preko celog meseca */
  .sheet .name-col { min-width: 128px; max-width: 128px; padding: 0 8px; }
  .sheet .name-col .avatar, .sheet .name-col .sub, .sheet.sched .name-col svg.i { display: none; }
  .sheet .name-col .strong { font-size: 12px; }
  .sheet th, .sheet td { min-width: 30px; height: 38px; }
  .sheet-wrap { max-height: calc(100vh - 200px); }
  /* kalendar meseca */
  .cal-day .cd-tags { gap: 2px; }
  .cal-day .cd-tag { font-size: 9px; padding: 2px 3px; }
  .cal-day .cd-sched { font-size: 9.5px; }
  /* prozori: preko celog ekrana, dugmad uvek pri dnu */
  .modal { display: flex; flex-direction: column; max-height: 100%; height: 100%; }
  .modal-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
  .modal-head { padding-top: max(14px, env(safe-area-inset-top)); }
  .modal-foot { flex-wrap: wrap; gap: 8px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .modal-foot .spacer { display: none; }
  .modal-foot > span.muted { flex-basis: 100%; }
  /* liste i alati */
  .toolbar { gap: 8px; }
  .toolbar .month-nav { flex: 1 1 100%; justify-content: space-between; }
  .toolbar .legend { flex-basis: 100%; }
  .toolbar select.input { flex: 1 1 140px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs button { white-space: nowrap; flex: none; }
  .notif-panel { left: 8px; right: 8px; width: auto; max-height: 70vh; }
  .dur-input input, .dur-input select { width: 68px !important; }
  input, select, textarea { font-size: 16px !important; } /* iPhone ne zumira pri unosu */
  .time24 select { font-size: 16px !important; }
}
@media (max-width: 640px) {
  .kpi { padding: 12px 14px; gap: 4px; }
  .kpi .ico-circle { display: none; }
  .kpi .label { font-size: 11px; }
  .kpi .value { font-size: 20px; }
  .kpi .hint { font-size: 11.5px; line-height: 1.35; }
  .grid-4 { gap: 10px; margin-bottom: 16px !important; }
  #pmPrint, #shPrint { display: none; }
  .cal-day .cd-tag { font-size: 0; width: 7px; height: 7px; padding: 0; border-radius: 50%; background: var(--tc); border: 0; }
  .cal-day .cd-tag.pend { background: transparent; border: 1.5px solid var(--tc); }
  .cal-day .cd-sched { font-size: 9px; line-height: 1.1; }
}
@media (max-width: 640px) {
  .cal-day .cd-num .late { font-size: 0 !important; width: 8px; min-width: 8px; height: 8px !important; padding: 0 !important; border-radius: 50%; overflow: hidden; }
  .cal-day .cd-num .late::before { display: none; }
}
@media (max-width: 640px) { .form-grid > .field:empty { display: none; } }
@media (max-width: 640px) {
  .req-meta { flex-direction: column; align-items: flex-start; gap: 6px; }
  .req-meta span { display: block; line-height: 1.4; }
  .req-meta span svg.i { vertical-align: -3px; margin-right: 4px; }
  .req-meta span b { display: inline; }
  .req-top { flex-wrap: wrap; row-gap: 6px; }
  .card-head h3 { font-size: 17px; }
  .card-head { flex-wrap: wrap; row-gap: 6px; }
}
@media (max-width: 640px) {
  .sheet.sched td.sc { font-size: 12px; letter-spacing: -.02em; }
  .sheet td.c { font-size: 11px; }
}
/* tabele kao kartice na telefonu */
@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  table.table, table.table tbody, table.table tfoot { display: block; width: 100%; }
  table.table thead { display: none; }
  table.table tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); }
  table.table tr:last-child { border-bottom: 0; }
  table.table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0 !important; border: 0 !important; text-align: right; white-space: normal !important; min-height: 26px; }
  table.table td:empty { display: none; }
  table.table td[data-label]::before { content: attr(data-label); flex: none; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  table.table td:first-child { font-size: 15px; justify-content: flex-start; text-align: left; }
  table.table td:first-child::before { display: none; }
  table.table td .cell-person { justify-content: flex-end; }
  table.table td:first-child .cell-person { justify-content: flex-start; }
  table.table tr.clickable:active { background: var(--surface-2); }
  table.table tfoot tr { background: var(--surface-2); }
}
@media (max-width: 640px) {
  table.table td { display: block; overflow: hidden; line-height: 1.5; }
  table.table td[data-label]::before { float: left; margin-right: 12px; line-height: 2; }
  table.table td:first-child { display: block; }
  table.table td .cell-person { display: inline-flex; }
}
/* iPhone: statusna traka / „notch“ */
@media (max-width: 767px) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
  .login-form { padding-top: calc(28px + env(safe-area-inset-top)) !important; }
  .sidebar .brand { padding-top: calc(20px + env(safe-area-inset-top)); }
  .sidebar-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .login-mlogo { display: block; margin-bottom: 18px; }
}
