/* =====================================================================
   Dochádzka – dizajnový systém
   Princípy: neutrálne plochy, jedna značková farba len na hlavné akcie,
   rovnomerné číslice, jemné okraje a tiene, rýchla a tichá odozva.
   ===================================================================== */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f8f9fb;
  --panel-3: #f1f3f6;
  --line: #e7e9ee;
  --line-2: #d6dae2;
  --ink: #101318;
  --ink-2: #4b5260;
  --ink-3: #868d99;

  --brand: #1e3a8a;
  --brand-2: #2747b0;
  --brand-ink: #ffffff;
  --brand-soft: #e7ecfa;
  --brand-ring: rgba(30, 58, 138, .18);
  --hero-1: #2747b0;
  --hero-2: #1e3a8a;
  --hero-ink: #ffffff;

  --danger: #c4323a;
  --danger-soft: #fdecec;
  --ok: #18794e;
  --ok-soft: #e3f5ec;
  --warn: #a55a00;
  --warn-soft: #fdf1df;

  --k-vacation: #e08a1e;
  --k-doctor: #7b5cf5;
  --k-sick: #e5484d;
  --k-other: #8b93a1;

  --weekend: #fafbfc;
  --holiday: #fdf4f3;
  --today: #1e3a8a;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22), 0 4px 12px -4px rgba(16, 24, 40, .08);
  --glass: rgba(255, 255, 255, .78);
  --scrim: rgba(12, 15, 20, .38);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --panel: #121519;
    --panel-2: #171a1f;
    --panel-3: #1d2127;
    --line: #23272e;
    --line-2: #30353e;
    --ink: #eceef2;
    --ink-2: #a9b0bc;
    --ink-3: #6f7785;

    --brand: #8fb0ff;
    --brand-2: #6f95f5;
    --brand-ink: #0a1433;
    --brand-soft: #141f3d;
    --brand-ring: rgba(143, 176, 255, .25);
    --hero-1: #1f3a80;
    --hero-2: #142554;
    --hero-ink: #eaf0ff;

    --danger: #f2777c;
    --danger-soft: #331618;
    --ok: #4cc38a;
    --ok-soft: #11291e;
    --warn: #f1b44c;
    --warn-soft: #2e2210;

    --weekend: #14171b;
    --holiday: #1c1516;
    --today: #8fb0ff;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px -2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    --glass: rgba(18, 21, 25, .78);
    --scrim: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* ---------- základ ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -.006em;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--brand); }
h1, h2, h3 { letter-spacing: -.022em; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum', 'cv11', 'ss01'; }
.muted { color: var(--ink-3); }
.hidden { display: none !important; }
::selection { background: var(--brand-soft); }

/* ---------- horná lišta ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -.015em; white-space: nowrap; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(160deg, var(--brand-2), var(--brand));
  color: var(--brand-ink); display: grid; place-items: center; font-size: 14px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(30, 58, 138, .3);
}
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button {
  border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  color: var(--ink-2); font-weight: 500; font-size: 14px; white-space: nowrap; position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav button:hover { background: var(--panel-3); color: var(--ink); }
.nav button.active { background: var(--panel-3); color: var(--ink); font-weight: 600; }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; margin-left: 6px;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--panel);
}
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; font-weight: 500; }
.user-chip .dot { width: 8px; height: 8px; }

/* ---------- rozloženie ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 96px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; font-weight: 650; margin: 0; flex: 1; min-width: 160px; }
.hello { margin-bottom: 20px; }
.hello .date { font-size: 13.5px; color: var(--ink-3); font-weight: 500; }
.hello .date::first-letter { text-transform: uppercase; }
.hello h1 { font-size: 28px; font-weight: 650; margin: 2px 0 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card h2 { font-weight: 650; letter-spacing: -.015em; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.stack > * + * { margin-top: 14px; }

/* ---------- tlačidlá ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 550; font-size: 14px; white-space: nowrap;
  text-decoration: none; min-height: 38px; box-shadow: var(--shadow-xs);
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--panel-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { flex: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: var(--brand); color: var(--brand-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(30, 58, 138, .35);
}
.btn-primary:hover { background: var(--brand); border-color: var(--brand); filter: brightness(1.06); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn-ok { color: var(--ok); }
.btn-ok:hover { border-color: var(--ok); background: var(--ok-soft); }
.btn-sm { padding: 5px 11px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn-icon { padding: 6px 10px; min-width: 38px; }
.btn-ghost { border-color: transparent; background: none; box-shadow: none; }
.btn-ghost:hover { background: var(--panel-3); border-color: transparent; }

/* ---------- formuláre ---------- */
label.field { display: block; }
label.field > span { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=time], input[type=month], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--panel); min-height: 42px; box-shadow: var(--shadow-xs);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23868d99' stroke-width='2.5' 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;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
button:focus-visible, a:focus-visible, .cal-day:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type=color] { width: 48px; height: 42px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar input { width: auto; min-width: 150px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1px solid var(--line-2); background: var(--panel); padding: 7px 13px; border-radius: 999px;
  cursor: pointer; font-weight: 550; font-size: 14px; display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s var(--ease);
}
.seg button:hover { border-color: var(--ink-3); }
.seg button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.error-msg { color: var(--danger); font-size: 14px; min-height: 1em; }

/* ---------- prihlásenie ---------- */
.login-wrap {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    radial-gradient(700px 400px at 110% 110%, color-mix(in srgb, var(--brand-2) 10%, transparent), transparent 60%),
    var(--bg);
}
.login { width: 100%; max-width: 400px; padding: 32px; border-radius: 20px; box-shadow: var(--shadow-lg); }
.login .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 18px; }
.login h1 { font-size: 26px; font-weight: 650; margin: 22px 0 4px; }
.login .btn-primary { min-height: 46px; font-size: 15px; }

/* ---------- štatistiky ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--ink-3); font-weight: 550; }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .value small { font-size: 14px; color: var(--ink-3); font-weight: 500; letter-spacing: -.01em; }
/* hlavné číslo je zvýraznené */
.stats > .stat:first-child {
  background: linear-gradient(150deg, var(--hero-1), var(--hero-2) 70%); border-color: transparent; color: var(--hero-ink);
  box-shadow: 0 8px 24px -10px rgba(30, 58, 138, .55), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.stats > .stat:first-child .label, .stats > .stat:first-child .value small { color: currentColor; opacity: .78; }

/* ---------- kalendár ---------- */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-title { font-size: 20px; font-weight: 650; min-width: 170px; text-transform: capitalize; letter-spacing: -.02em; }
.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.cal-dow { padding: 9px 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--panel-2); }
.cal-day {
  min-height: 116px; padding: 8px; background: var(--panel); cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: background .12s var(--ease);
}
.cal-day:hover { background: var(--panel-2); }
.cal-day.weekend { background: var(--weekend); }
.cal-day.holiday { background: var(--holiday); }
.cal-day.out { background: var(--panel-2); }
.cal-day.out .dnum { color: var(--ink-3); opacity: .55; }
.cal-day .dtop { display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 24px; }
.dnum {
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  min-width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; padding: 0 4px;
}
.cal-day.today .dnum { background: var(--today); color: var(--brand-ink); }
.dhol { font-size: 10.5px; color: var(--danger); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsum { font-size: 11.5px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip {
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; line-height: 1.3; padding: 3px 7px;
  border-radius: 6px; color: var(--ink);
  background: color-mix(in srgb, var(--c, var(--brand)) 12%, var(--panel));
  box-shadow: inset 2.5px 0 0 var(--c, var(--brand));
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0;
}
.chip .t { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chip .h { font-size: 11px; color: var(--ink-2); flex: none; font-variant-numeric: tabular-nums; }
.chip.pending {
  opacity: .9;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, var(--panel)) 0 5px, var(--panel) 5px 10px);
  box-shadow: inset 2.5px 0 0 var(--c), inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.chip.rejected { text-decoration: line-through; opacity: .45; }
.more { font-size: 11px; color: var(--ink-3); padding-left: 4px; font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .dot { width: 8px; height: 8px; }

@media (max-width: 760px) {
  .cal { border-radius: 10px; }
  .cal-day { min-height: 66px; padding: 5px 3px; gap: 3px; align-items: center; }
  .cal-day .chip .t, .cal-day .chip .h, .dhol { display: none; }
  .cal-day .dtop { flex-direction: column; gap: 0; min-height: 0; }
  .dnum { font-size: 12.5px; min-width: 24px; height: 24px; }
  .dsum { font-size: 9.5px; }
  .chip { padding: 0; height: 5px; width: 100%; background: var(--c, var(--brand)); border-radius: 3px; box-shadow: none; }
  .chip.pending { background: var(--c); opacity: .35; box-shadow: none; }
  .more { display: none; }
  .cal-dow { padding: 7px 2px; text-align: center; font-size: 11px; }
  .user-chip .uname { display: none; }
}

/* ---------- tabuľky ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--ink-3); font-weight: 550; background: var(--panel-2); white-space: nowrap; }
thead th:first-child { border-top-left-radius: var(--radius); }
thead th:last-child { border-top-right-radius: var(--radius); }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 650; background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 0; }
td.r, th.r { text-align: right; }
td.num, td .num { font-variant-numeric: tabular-nums; }
tr.inactive td { opacity: .5; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6;
}
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.rejected { background: var(--danger-soft); color: var(--danger); }
.pill.k { background: var(--panel-3); color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 48px 16px; text-align: center; color: var(--ink-3); font-size: 14.5px; }
td.cell-note { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.who { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; }

/* ---------- modálne okno ---------- */
.modal-back {
  position: fixed; inset: 0; background: var(--scrim); z-index: 50;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto;
  animation: fade .16s var(--ease);
}
.modal {
  width: 100%; max-width: 560px; background: var(--panel); border-radius: 18px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: pop .2s var(--ease);
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 6px; }
.modal-head h2 { font-size: 18px; font-weight: 650; margin: 0; flex: 1; }
.modal-body { padding: 14px 22px 22px; }
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px; flex-wrap: wrap;
  border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 18px 18px;
}
.modal-foot .spacer { flex: 1; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes sheet { from { transform: translateY(100%); } }
@media (max-width: 560px) {
  .modal-back { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 20px 20px 0 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-bottom: 0;
    animation: sheet .26s var(--ease); padding-bottom: env(safe-area-inset-bottom);
  }
  .modal::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; }
  .modal-head { padding-top: 10px; }
  .modal-foot { border-radius: 0; position: sticky; bottom: 0; }
}
.day-list .item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.day-list .item:last-child { border-bottom: 0; }
.day-list .item .main { flex: 1; min-width: 0; }
.day-list .item .main b { font-weight: 600; }
.day-list .item .sub { font-size: 13px; color: var(--ink-3); margin-top: 1px; }

/* ---------- oznámenie (toast) ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(16px); opacity: 0;
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--panel);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  padding: 11px 18px; border-radius: 12px; z-index: 100; box-shadow: var(--shadow-lg);
  transition: opacity .2s var(--ease), transform .2s var(--ease); pointer-events: none; font-weight: 550; font-size: 14px; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #fff; }

/* ---------- výzva na upozornenia ---------- */
.banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px;
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); background: var(--brand-soft); box-shadow: none;
}
.banner-text { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.banner-text b { font-weight: 650; }
.banner-text span { color: var(--ink-2); }
.banner-btns { display: flex; gap: 6px; margin-left: auto; }

/* ---------- mobil: spodné menu, plávajúce tlačidlo ---------- */
.tabbar, .fab, .show-mobile { display: none; }
.sheet-list { display: flex; flex-direction: column; margin: -6px -4px; }
.sheet-list button {
  display: flex; align-items: center; gap: 14px; padding: 14px 10px; border: 0; background: none; cursor: pointer;
  font-size: 16px; font-weight: 550; text-align: left; border-radius: 12px; color: var(--ink);
}
.sheet-list button:active { background: var(--panel-3); }
.sheet-list button:last-child { color: var(--danger); margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0; }
.sheet-list button:last-child svg { color: var(--danger); }
.sheet-list svg { color: var(--ink-3); }

@media (max-width: 760px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline-flex; }
  .nav { display: none; }
  .topbar-inner { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); justify-content: space-between; }
  .brand .bname { display: inline; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
  .user-chip #logout { display: none; }
  main { padding: 18px 14px calc(170px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 24px; }
  .hello { margin-bottom: 16px; }
  .hello h1 { font-size: 25px; }
  .card-pad { padding: 16px; }

  /* iPhone nezoomuje do políčok, keď majú aspoň 16px */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
  input[type=time], input[type=month], select, textarea { font-size: 16px; min-height: 46px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .toolbar { width: 100%; }
  .toolbar select, .toolbar input { flex: 1; min-width: 0; }
  .seg button { padding: 9px 14px; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
    border: 0; background: none; padding: 4px 2px; cursor: pointer;
    color: var(--ink-3); font-size: 11px; font-weight: 600; min-width: 0; letter-spacing: 0;
  }
  .tabbar button svg { padding: 4px 16px; border-radius: 999px; box-sizing: content-box; transition: background .18s var(--ease), color .18s var(--ease); }
  .tabbar button span:not(.pending-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar button.active { color: var(--ink); }
  .tabbar button.active svg { background: var(--brand-soft); color: var(--brand); }
  .tabbar .pending-badge { position: absolute; top: 0; left: 50%; margin-left: 8px; }
  .tabbar .badge { margin: 0; }

  .fab {
    display: grid; place-items: center; position: fixed; right: 16px; z-index: 31;
    bottom: calc(84px + env(safe-area-inset-bottom));
    width: 58px; height: 58px; border-radius: 20px; border: 0; cursor: pointer;
    background: linear-gradient(160deg, var(--brand-2), var(--brand)); color: var(--brand-ink);
    font-size: 30px; font-weight: 400; line-height: 1;
    box-shadow: 0 10px 28px -6px rgba(30, 58, 138, .55), inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .15s var(--ease);
  }
  .fab:active { transform: scale(.94); }
  .fab.hidden { display: none; }
  #toast { bottom: calc(156px + env(safe-area-inset-bottom)); }

  /* kalendár */
  .cal-head { gap: 6px; margin-bottom: 12px; }
  .cal-title { font-size: 19px; min-width: 0; flex: 1 1 100%; order: -1; }
  .cal-head #cal-user { flex: 1; min-width: 0 !important; width: 100% !important; order: 5; }
  .cal-head .btn span { display: none; }
  .card-pad:has(> .cal) { padding: 14px 10px; }
  .legend { gap: 6px 12px; font-size: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .stats > .stat:first-child { grid-column: 1 / -1; }
  .stat { padding: 14px 16px; }
  .stat .label { font-size: 12.5px; }
  .stat .value { font-size: 21px; }
  .stats > .stat:first-child .value { font-size: 30px; }

  /* tabuľky → karty */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tfoot { display: block; }
  .rtable tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable tbody tr:hover { background: none; }
  .rtable tr.tap { cursor: pointer; }
  .rtable tr.tap:active { background: var(--panel-2); }
  .rtable td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 0; border: 0; text-align: right; max-width: none; white-space: normal; }
  .rtable td::before { content: attr(data-label); color: var(--ink-3); font-size: 13.5px; text-align: left; flex: none; font-weight: 450; }
  .rtable td.cell-title { font-weight: 650; font-size: 15.5px; justify-content: flex-start; text-align: left; padding-bottom: 6px; letter-spacing: -.01em; }
  .rtable td.cell-title::before, .rtable td.cell-actions::before { content: none; }
  .rtable td.cell-actions { justify-content: flex-end; padding-top: 10px; }
  .rtable td.cell-note { overflow: visible; }
  .rtable td.empty-cell { display: none; }
  .rtable tfoot tr { background: var(--panel-2); border-top: 1px solid var(--line); border-bottom: 0; }
  .rtable tfoot td { border: 0; background: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- avatar ---------- */
.avatar {
  width: 32px; height: 32px; border-radius: 999px; border: 0; cursor: pointer; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 650; letter-spacing: .02em;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--panel));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent);
}

/* ---------- formulár: rýchly výber hodín ---------- */
.flabel { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 8px; }
.flabel small { font-weight: 450; color: var(--ink-3); margin-left: 4px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.quick button {
  border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; cursor: pointer;
  padding: 6px 12px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 54px;
  transition: all .15s var(--ease);
}
.quick button:hover { border-color: var(--ink-3); }
.quick button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
input[name=work_hours] { font-size: 20px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .quick { display: grid; grid-template-columns: repeat(4, 1fr); }
  .quick button { padding: 10px 6px; font-size: 14.5px; }
  input[name=work_hours] { font-size: 22px; min-height: 52px; }
}

/* ---------- sekcie a strany ---------- */
.sec-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; }
.sec-head:first-of-type, .page-head + .sec-head { margin-top: 0; }
.sec-head h2 { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -.015em; }
.sec-head .muted { font-size: 13px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.pager b { color: var(--ink); }
@media (max-width: 760px) {
  .pager { justify-content: space-between; gap: 8px; }
  .pager .btn { flex: 1; }
  .pager span { flex: none; }
}

/* ---------- pohonné hmoty ---------- */
.fuel-box { border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--panel-2); }
.fuel-box .fuel-fields { margin-top: 12px; }
.fuel-box .fuel-note:not(:empty) { margin-top: 8px !important; }
.pill.fuel { background: var(--warn-soft); color: var(--warn); font-size: 11.5px; margin-left: 6px; vertical-align: 1px; }

[id^="pg-"] { scroll-margin-top: 84px; }

/* ---------- karty (Aktívne / Archív) ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; background: var(--panel-3); border-radius: 12px; }
.tabs button {
  border: 0; background: none; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 550; font-size: 14px;
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; transition: background .15s var(--ease), color .15s var(--ease);
}
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-xs); }
.tabs .count { font-size: 12px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .tabs { display: flex; } .tabs button { flex: 1; justify-content: center; } .rtable .actions { flex-wrap: wrap; } }

/* ---------- Záznamy na mobile: mesiac + Filtre + PDF v jednom riadku ---------- */
@media (max-width: 760px) {
  .list-toolbar { display: flex; flex-wrap: nowrap; gap: 8px; }
  .list-toolbar #ml-month { flex: 1 1 auto; min-width: 0; width: auto; }
  .list-toolbar .btn { flex: none; }
  .list-toolbar .btn-pdf span { display: none; }
  .list-toolbar .btn-pdf { width: 46px; padding: 0; }
  .filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
  .filter-chips .btn { margin-left: auto; }
}

/* ---------- zákazky: hodnota, náklady, čerpanie ---------- */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linkish:hover b { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
td .sub { font-size: 12.5px; font-weight: 400; margin-top: 2px; }
.stackv { display: inline-flex; flex-direction: column; align-items: flex-end; }
.neg { color: var(--danger) !important; }
.budget { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.budget .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.budget .bar span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.budget.warn .bar span { background: var(--k-vacation); }
.budget.over .bar span { background: var(--danger); }
.budget small { font-size: 12px; color: var(--ink-2); font-weight: 600; min-width: 44px; text-align: right; }
.budget.over small { color: var(--danger); }
h3.mini { font-size: 15px; font-weight: 650; margin: 8px 0 0; }
@media (max-width: 760px) {
  .rtable td .budget { flex: 1; max-width: 62%; }
  .rtable td.cell-title { flex-wrap: wrap; }
  .rtable td.cell-title .sub { width: 100%; }
}

/* ---------- zákazky: jednotné písmo v zozname ---------- */
.linkish {
  -webkit-appearance: none; appearance: none; border: 0; background: none; padding: 0; margin: 0;
  font: inherit; font-size: 14.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.01em;
  color: var(--ink); cursor: pointer; text-align: left;
}
.linkish:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.pj { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pj-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.pj-name .pill.fuel { margin: 0; }
td .sub, .pj .sub { font-size: 12.5px; font-weight: 400; color: var(--ink-3); line-height: 1.35; margin: 0; }
.stackv { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.money { font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.35; }
.money.strong { font-weight: 700; }
.money.muted { color: var(--ink-3); font-weight: 400; }
@media (max-width: 760px) {
  .rtable td.cell-title .pj { width: 100%; }
  .rtable td.cell-title .linkish { font-size: 15.5px; font-weight: 650; }
}
@media (max-width: 760px) {
  /* v karte na mobile jeden riadok: „65 h   925,00 €“, „nezadaná“ */
  .rtable td .stackv { flex-direction: row; align-items: baseline; gap: 8px; }
  .rtable td .stackv .sub { order: -1; }
  .rtable td .stackv .dash { display: none; }
}
