/*
 * Teamly design system - direction "C · Tim" (terra-people/docs/redesign).
 * Every colour is a token below; components never write their own. Dark theme: html[data-theme='dark'].
 * Radii: fields 14px, tiles 18px, cards 24px, intro card and dialog 28px; buttons, chips, menus, segments are pills.
 */

:root {
	--stage: #cfd8df;
	--bg: #edf2f5;
	--surface: #ffffff;
	--surface-2: #f4f7f9;
	--ink: #10202c;
	--ink-2: #33475a;
	--muted: #5a6d7e;
	--line: #dde5eb;
	--primary: #1f6fb2;
	--primary-hover: #165489;
	--on-primary: #ffffff;
	--primary-soft: #e6f0fa;
	--teal: #0e7c86;
	--teal-soft: #dff3f4;
	/* Teal text on --teal-soft (small bold labels): 5.4:1. */
	--teal-ink: #0b6b74;
	--hover: #f1f5f8;
	--danger: #c93a3f;
	--danger-hover: #a92f34;
	--holiday: #7428cc;
	--holiday-bg: #f5effd;
	--weekend: rgb(234 182 118 / 16%);
	--focus-ring: rgb(31 111 178 / 22%);
	--backdrop: rgb(16 32 44 / 40%);
	--shadow-pop: 0 12px 40px rgb(16 32 44 / 16%);
	--night: linear-gradient(183deg, #0f1b2d 0%, #123a63 60%, #0f1b2d 100%);

	--radius-field: 14px;
	--radius-tile: 18px;
	--radius-card: 24px;
	--radius-dialog: 28px;
	--space-page: 32px;

	/* The system's UI font (Segoe UI, San Francisco, Roboto, Noto Sans…): each writes Latin and Cyrillic alike, so a name
	   in Cyrillic ("Петар Петровић") sits in the same letters as the text around it, and no font is fetched from a
	   third party. A brand font, when there is one, is self-hosted under the client's wwwroot and must have Cyrillic. */
	--font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
	color-scheme: light;
}

html[data-theme='dark'] {
	--stage: #030608;
	--bg: #0a1014;
	--surface: #121a20;
	--surface-2: #18222a;
	--ink: #e6eef2;
	--ink-2: #c2d0d9;
	--muted: #8fa2b0;
	--line: #22303a;
	--primary: #6aaef0;
	--primary-hover: #9ccbf7;
	--on-primary: #0b1a2b;
	--primary-soft: #14273b;
	--teal: #4fd1d9;
	--teal-soft: #0d2a2d;
	--teal-ink: #4fd1d9;
	--hover: #17212a;
	--danger: #f26b70;
	--danger-hover: #ff8c90;
	--holiday: #b993ff;
	--holiday-bg: #1c1530;
	--weekend: rgb(234 182 118 / 7%);
	--focus-ring: rgb(106 174 240 / 30%);
	--backdrop: rgb(0 0 0 / 62%);
	--shadow-pop: 0 0 0 1px #22303a, 0 16px 48px rgb(0 0 0 / 60%);
	--night: linear-gradient(183deg, #05080a 0%, #0f1d30 62%, #05080a 100%);
	color-scheme: dark;
}

/* Tones: chips, avatars, leave types. --c is the text/mark colour, --cc its background. */
.tone-lime { --c: #36740c; --cc: #e2f6d0; }
.tone-red { --c: #c81e1e; --cc: #fde3e3; }
.tone-steel { --c: #2d6297; --cc: #dde9f5; }
.tone-gold { --c: #8a6500; --cc: #fff1b8; }
.tone-pink { --c: #c2186f; --cc: #fde4f1; }
.tone-violet { --c: #7428cc; --cc: #efe5fd; }
.tone-amber { --c: #b45309; --cc: #fef3c7; }
.tone-green { --c: #137538; --cc: #dcf5e5; }
.tone-teal { --c: #0f766e; --cc: #d5f5ef; }
.tone-blue { --c: #1d4ed8; --cc: #e0eaff; }
.tone-orange { --c: #b23a0a; --cc: #ffe8d6; }
.tone-gray { --c: #52627a; --cc: #e8edf3; }
.tone-sea { --c: #1d6e46; --cc: #d2ede0; }
.tone-turquoise { --c: #00717a; --cc: #cbf3f4; }
.tone-chocolate { --c: #a1470f; --cc: #f9e2d1; }
html[data-theme='dark'] .tone-lime { --c: #86e05e; --cc: #1b2e10; }
html[data-theme='dark'] .tone-red { --c: #ff8080; --cc: #3b1517; }
html[data-theme='dark'] .tone-steel { --c: #86b6e6; --cc: #14253a; }
html[data-theme='dark'] .tone-gold { --c: #ffd84a; --cc: #33290a; }
html[data-theme='dark'] .tone-pink { --c: #ff8ac4; --cc: #3a1229; }
html[data-theme='dark'] .tone-violet { --c: #b993ff; --cc: #25183e; }
html[data-theme='dark'] .tone-amber { --c: #fbbf24; --cc: #2c1d05; }
html[data-theme='dark'] .tone-green { --c: #34d399; --cc: #0f2a20; }
html[data-theme='dark'] .tone-teal { --c: #2dd4bf; --cc: #0b2826; }
html[data-theme='dark'] .tone-blue { --c: #60a5fa; --cc: #10192e; }
html[data-theme='dark'] .tone-orange { --c: #fb923c; --cc: #2f1a0b; }
html[data-theme='dark'] .tone-gray { --c: #a3aebf; --cc: #1f2430; }
html[data-theme='dark'] .tone-sea { --c: #56c98f; --cc: #0f2a1d; }
html[data-theme='dark'] .tone-turquoise { --c: #45dfe2; --cc: #08292b; }
html[data-theme='dark'] .tone-chocolate { --c: #f39a5e; --cc: #34200f; }

/* ---- Base ---- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
	font-family: var(--font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; overflow-wrap: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* "Preskoči na sadržaj": the first stop of Tab, shown only while it has the focus. */
.skip-link { position: absolute; left: 12px; top: -64px; z-index: 100; background: var(--ink); color: var(--surface); border-radius: 12px; padding: 10px 16px; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 12px; }
main:focus, main h1:focus { outline: none; }

/* Type scale */
.t-screen { font-size: 38px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }
.t-page { font-size: 30px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; }
.t-section { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 800; }
.t-card { font-size: 18px; line-height: 1.3; font-weight: 800; }
.t-strong { font-size: 20px; line-height: 1.2; font-weight: 800; }
.t-muted { color: var(--muted); }
.t-secondary { color: var(--ink-2); }
@media (max-width: 639px) {
	.t-screen { font-size: 28px; }
	.t-page { font-size: 24px; }
}

/* ---- Chips and avatars ---- */

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--c); background: var(--cc); white-space: nowrap; max-width: 24em; min-width: 0; }
/* A long name in a chip ends in "…" (the chip carries the whole one in its title). */
.chip-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.av { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--c); background: var(--cc); flex: none; box-shadow: 0 0 0 3px var(--surface); overflow: hidden; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 30px; height: 30px; font-size: 11.5px; }
.av-lg { width: 48px; height: 48px; font-size: 16px; }
.av-xl { width: 72px; height: 72px; font-size: 24px; }
.av.pend { background: transparent; outline: 2px dashed var(--c); outline-offset: -2px; }

/* ---- Buttons ---- */

.btn { font: inherit; font-size: 14.5px; font-weight: 700; height: 44px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn-fill { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-fill:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }
.btn-text-danger { border-color: transparent; background: transparent; color: var(--danger); height: 36px; padding: 0 12px; font-size: 14px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; }
.btn-icon { width: 44px; padding: 0; }
.btn-sm.btn-icon { width: 38px; }
.btn-block { width: 100%; }
.btn:disabled, .btn:disabled:hover { background: var(--surface-2); border-color: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.pill { font: inherit; border: 0; background: transparent; cursor: pointer; height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.pill:hover { background: var(--hover); text-decoration: none; }
.pill.on, .pill.active { background: var(--ink); color: var(--surface); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }

.linkb { font: inherit; border: 0; background: transparent; padding: 0; color: var(--ink); font-weight: 700; cursor: pointer; text-align: left; }
.linkb:hover { color: var(--primary); text-decoration: underline; }

/* ---- Segmented switches ---- */

.segw { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface); }
.segb { font: inherit; font-size: 14px; font-weight: 700; height: 36px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.segb.on { background: var(--ink); color: var(--surface); }
.segw.tabs-full { display: grid; grid-template-columns: repeat(var(--seg-count, 3), minmax(0, 1fr)); align-self: stretch; }
.segw.tabs-full .segb { padding: 0 6px; font-size: 13px; }

/* ---- Switch ---- */

.sw { font: inherit; border: 0; background: transparent; padding: 4px 0; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.sw:disabled { cursor: default; opacity: .6; }
.sw-t { width: 40px; height: 24px; border-radius: 999px; position: relative; flex: none; transition: background .15s; background: var(--line); }
.sw[aria-checked='true'] .sw-t { background: var(--primary); }
.sw-k { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 30%); transition: transform .15s; }
.sw[aria-checked='true'] .sw-k { transform: translateX(16px); }

/* ---- Fields ---- */

.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label, .fld .fld-label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.box { height: 48px; border-radius: var(--radius-field); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; padding: 0 14px; width: 100%; outline: none; }
textarea.box { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
select.box { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235a6d7e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.box::placeholder { color: var(--muted); }
.box:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--focus-ring); }
.box:disabled { background: var(--surface-2); color: var(--muted); border-color: var(--surface-2); }
.box.err, .box.invalid { border-color: var(--danger); }
.errmsg { font-size: 13px; font-weight: 600; color: var(--danger); }
.hint { font-size: 13px; color: var(--muted); }
.box-wrap { position: relative; display: flex; align-items: center; }
.box-wrap .box { padding-right: 48px; }
.box-wrap .box-action { position: absolute; right: 4px; }
.code-input { display: flex; gap: 8px; }
.code-input .box { width: 48px; padding: 0; text-align: center; font-size: 20px; font-weight: 800; }
.pselect { height: 44px; border-radius: 999px; padding: 0 38px 0 16px; background-color: var(--surface-2); border-color: var(--surface-2); font-weight: 600; }

.fgrid, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 16px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks li.ok { color: var(--c, #137538); }

/* ---- Cards, tiles, layout ---- */

.card { background: var(--surface); border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-head > h2, .card-head > h3 { flex: 1; min-width: 0; }
.card-count { font-size: 14px; font-weight: 800; color: var(--muted); }
.card.fill { overflow: hidden; }
.card.fill .card-body { overflow: auto; min-height: 0; flex: 1; }
.intro { border-radius: var(--radius-dialog); }
.tile { background: var(--surface-2); border-radius: var(--radius-tile); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.pcard { font: inherit; text-align: left; cursor: pointer; border: 0; background: var(--surface-2); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.pcard.on { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
/* Label and value side by side: a long label ("Dasselbe Paket nach dem Testzeitraum") takes at most 40% and wraps, so the value
   never reads one word a line (U-132); a value someone typed as one long word breaks rather than widening the page (T-145). */
.dl { display: grid; grid-template-columns: fit-content(40%) minmax(0, 1fr); gap: 10px 18px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.dl dd { margin: 0; color: var(--ink); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); }
.row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Text a user typed (a name, an address) that may be one long word: it breaks anywhere rather than widening its table
   or card (in a table it also lets the column shrink, so the other columns stay in view). */
.wrap-any { overflow-wrap: anywhere; min-width: 0; }

/* ---- Tables (cards on a phone) ---- */

.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { font-size: 12.5px; font-weight: 700; color: var(--muted); text-align: left; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.sortb { font: inherit; font-size: 12.5px; font-weight: 700; color: var(--muted); border: 0; background: transparent; padding: 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.sortb:hover, .sortb.on { color: var(--ink); }
.fchip { font: inherit; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 14px; border-radius: 999px; border: 0; background: var(--primary-soft); color: var(--primary); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.list-cards { display: flex; flex-direction: column; gap: 10px; }
.list-card { font: inherit; text-align: left; border: 0; cursor: pointer; background: var(--surface); border-radius: 20px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; color: var(--ink); }

/* ---- Legend ---- */

.lg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.lg i { width: 22px; height: 12px; border-radius: 4px; background: var(--cc); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 55%, transparent); display: inline-block; }

/* ---- Menu items ---- */

.mi { font: inherit; width: 100%; border: 0; background: transparent; cursor: pointer; min-height: 48px; padding: 0 14px; border-radius: 14px; display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 15px; font-weight: 600; text-align: left; text-decoration: none; }
.mi:hover { background: var(--hover); text-decoration: none; }

/* ---- Dialog, snackbar, popover ---- */

.backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .14s ease-out; }
.dialog { background: var(--surface); border-radius: var(--radius-dialog); box-shadow: var(--shadow-pop); width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.dialog.wide { max-width: 760px; }
.dialog-head { padding: 24px 24px 8px; display: flex; gap: 12px; align-items: flex-start; }
.dialog-head h2 { font-size: 21px; font-weight: 800; flex: 1; }
.dialog-lead { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; font-weight: 500; }
.dialog-body { padding: 8px 24px 16px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.dialog-actions { padding: 12px 24px 24px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@media (max-width: 639px) {
	.backdrop { place-items: end stretch; padding: 0; }
	.dialog { max-width: none; border-radius: var(--radius-dialog) var(--radius-dialog) 0 0; max-height: 92dvh; }
}
/* Centred by its margins between 16px gutters (U-104: left: 50% left it half the screen, four lines on a phone), and above
   the bottom navigation where a layout shows one. */
.snackbar { position: fixed; left: 16px; right: 16px; bottom: 24px; margin-inline: auto; width: fit-content; max-width: 560px; z-index: 60; background: var(--ink); color: var(--surface); border-radius: 18px; padding: 12px 18px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow-pop); animation: rise .2s ease-out; display: flex; gap: 12px; align-items: center; overflow-wrap: anywhere; }
@media (max-width: 1023px) {
	body:has(.bottom-nav) .snackbar { bottom: calc(64px + 12px + env(safe-area-inset-bottom)); }
}
.snackbar.error { background: var(--danger); color: #fff; }
.popover { position: absolute; z-index: 40; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-pop); padding: 10px; animation: pop .14s ease-out; }
.alert { margin: 0; border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 700; display: flex; gap: 8px; align-items: flex-start; background: var(--cc); color: var(--c); }

/* ---- Empty and loading ---- */

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 32px 16px; color: var(--muted); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); }
.empty .empty-title { color: var(--ink); font-size: 17px; line-height: 1.3; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--hover) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }

/* ---- Focus ---- */

.btn:focus-visible, .pill:focus-visible, .sortb:focus-visible, .fchip:focus-visible, .linkb:focus-visible, .mi:focus-visible,
.segb:focus-visible, .sw:focus-visible, .pcard:focus-visible, .list-card:focus-visible, a:focus-visible, button:focus-visible {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* ---- Motion (transform and opacity only; none when reduced) ---- */

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Administration screens (tipovi, praznici, zaposleni, permisije, podešavanja) ---- */

.adm-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.adm-page.tight { gap: 14px; }
.adm-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.adm-head .t-page { margin: 0; }
.adm-head-count { font-size: 15px; font-weight: 700; color: var(--muted); }
.adm-head-end { margin-left: auto; align-self: center; display: flex; gap: 8px; flex-wrap: wrap; }
.adm-lead { margin: 0; max-width: 640px; font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.adm-cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.adm-main { flex: 2 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.adm-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.adm-card { background: var(--surface); border-radius: var(--radius-card); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.adm-card.side { padding: 22px; gap: 12px; }
.adm-card h2 { margin: 0; font-size: 18px; font-weight: 800; }
.adm-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.adm-card-head span { font-size: 14px; color: var(--muted); }
.adm-note { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.adm-meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.adm-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.adm-dotline { margin: 0; display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.adm-dotline::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; margin-top: 6px; }
.adm-swatch { width: 30px; height: 16px; border-radius: 6px; background: var(--cc); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 45%, transparent); flex: none; display: inline-block; }
.adm-chip-sm { padding: 1px 8px; font-size: 11.5px; }
.adm-table-card { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.adm-table-card > div { overflow-x: auto; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.adm-item { background: var(--surface); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; min-width: 0; }
.adm-item:hover { box-shadow: inset 0 0 0 1.5px var(--line); }
.adm-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.adm-rule { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.adm-rule + .adm-rule, .adm-rule + .fld { padding-top: 18px; border-top: 1px solid var(--line); }
.adm-rule-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 220px; }
.adm-rule-text b { font-size: 15px; }
.adm-rule-text span { font-size: 13px; color: var(--muted); }
.adm-searchbar { background: var(--surface); border-radius: 24px; padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.adm-search { flex: 2 1 240px; height: 44px; border-radius: 999px; background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--muted); }
.adm-search input { font: inherit; font-size: 15px; border: 0; background: transparent; color: var(--ink); outline: none; flex: 1; min-width: 0; }
.adm-search:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.adm-filter { flex: 1 1 170px; max-width: 240px; }
.adm-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-row-link { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.adm-row-link:hover { color: var(--primary); }
.adm-only-compact { display: none; }
@media (max-width: 1023px) {
	.adm-only-wide { display: none; }
	.adm-only-compact { display: grid; }
}
@media (max-width: 639px) {
	.adm-card { padding: 18px; }
}

/* Focus moved by navigation (FocusOnNavigate) is for screen readers; no ring on the heading. */
[tabindex="-1"]:focus { outline: none; }
/* ---- Leave screens: calendar grid, filter bar, date range (prototype "Kalendar", "Zahtevi") ---- */

.cal { background: var(--surface); border-radius: var(--radius-card); overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-ch { padding: 12px 8px 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; white-space: nowrap; overflow: hidden; }
.cal-ch .ch-s { display: none; }
.cell { position: relative; user-select: none; -webkit-user-select: none; cursor: cell; display: flex; flex-direction: column; min-width: 0; padding-bottom: 6px; min-height: 118px; background: var(--surface); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cell.first { border-left: 0; }
.cell.wkend { background: var(--weekend); }
.cell.hol { background: var(--holiday-bg); }
.cell.sel { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
/* U-137: a month's day has room for its three lanes and "+N još" from the start, so the grid does not grow (and push the page
   down) when the absences arrive. */
.cal-month .cell { min-height: 140px; }
.cal-week .cell { min-height: 400px; }
.cell-head { display: flex; align-items: center; gap: 6px; padding: 6px 6px 4px; min-width: 0; }
.dnum { font: inherit; border: 0; background: transparent; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: var(--ink); cursor: pointer; flex: none; padding: 0; }
.dnum.out { color: var(--muted); font-weight: 500; }
.dnum.hol { color: var(--holiday); }
.dnum.today { background: var(--teal); color: var(--surface); }
.hol-l { font-size: 11.5px; font-weight: 700; color: var(--holiday); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lanes { display: flex; flex-direction: column; gap: 3px; }
.lane { display: block; height: 22px; flex: none; }
.cal-week .lane { height: 46px; }
.cbar { font: inherit; border: 0 dashed var(--c); cursor: pointer; padding: 0 8px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: var(--cc); color: var(--c); font-size: 12px; font-weight: 700; line-height: 1.25; overflow: hidden; white-space: nowrap; text-align: left; min-width: 0; }
.cbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cbar .cb-i { display: none; }
.cbar .cb-t { font-weight: 600; opacity: .85; }
.cbar.pending { background: color-mix(in srgb, var(--cc) 45%, transparent); }
.cbar.wfh { background: repeating-linear-gradient(135deg, var(--line) 0 5px, transparent 5px 10px); color: var(--ink-2); }
.cbar:hover { filter: brightness(.97); }
.more { font: inherit; border: 0; background: transparent; color: var(--ink-2); font-size: 12px; font-weight: 700; padding: 2px 8px; text-align: left; cursor: pointer; }
.more:hover { color: var(--primary); }
.dnum:focus-visible, .cbar:focus-visible, .more:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lg i.lg-hol { background: var(--holiday-bg); box-shadow: inset 0 0 0 1.5px var(--holiday); }
.lg i.lg-pend { background: color-mix(in srgb, var(--cc) 45%, transparent); border: 1.5px dashed var(--c); box-shadow: none; }
.lg i.lg-wfh { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 639px) {
	.cal-ch { text-align: center; padding: 10px 2px 8px; }
	.cal-ch .ch-l { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
	.cal-ch .ch-s { display: inline; }
	.cell, .cal-month .cell { min-height: 66px; }
	.cal-week .cell { min-height: 280px; }
	.hol-l { display: none; }
	.cell-head { padding: 4px 2px 3px; justify-content: center; }
	.cal-month .lane { height: 6px; }
	.cal-month .cbar { padding: 0; }
	.cal-month .cbar span { display: none; }
	.cal-week .cbar { padding: 0 4px; }
	.cal-week .cbar .cb-l, .cal-week .cbar .cb-t { display: none; }
	.cal-week .cbar .cb-i { display: inline; }
	.more { padding: 2px 2px; font-size: 11px; }
}

.filter-bar { background: var(--surface); border-radius: var(--radius-card); padding: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.searchbox { flex: 1 1 220px; height: 44px; border-radius: 999px; background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--muted); }
.searchbox:focus-within { box-shadow: 0 0 0 4px var(--focus-ring); }
.searchbox input { font: inherit; font-size: 15px; border: 0; background: transparent; color: var(--ink); outline: none; flex: 1; min-width: 0; text-overflow: ellipsis; }
.date-range { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dialog-head.with-leading { align-items: center; gap: 14px; }
.dialog-head.with-leading > .btn { align-self: flex-start; }

/* ---- Date picker (UiDatePicker): a month calendar under a date field; a bottom sheet on a phone ---- */

.dp { position: fixed; inset: auto; margin: 0; border: 0; color: var(--ink); z-index: 70; width: 328px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-pop); padding: 12px; display: flex; flex-direction: column; gap: 6px; animation: pop .14s ease-out; transform-origin: top left; }
.dp[popover]:not(:popover-open) { display: none; }
.dp::backdrop { background: transparent; }
.dp-head { display: flex; align-items: center; gap: 4px; }
.dp-title { flex: 1; text-align: center; font-size: 15.5px; font-weight: 800; }
.dp-grid { display: flex; flex-direction: column; gap: 2px; }
.dp-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 6px 0; }
.dp-day { font: inherit; font-size: 14px; font-weight: 700; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.dp-day:hover { background: var(--hover); }
.dp-day.we { color: var(--ink-2); }
.dp-day.out { color: var(--muted); font-weight: 500; }
.dp-day.today { box-shadow: inset 0 0 0 2px var(--teal); }
.dp-day.sel, .dp-day.sel:hover { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.dp-day:disabled { color: var(--line); cursor: not-allowed; background: transparent; }
.dp-day:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dp-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
@media (max-width: 639px) {
	.dp::backdrop { background: var(--backdrop); }
	.dp { width: auto; border-radius: 28px 28px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); transform-origin: bottom center; }
	.dp-day { height: 46px; font-size: 15px; }
}
