:root {
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --success: #16a34a;
  --border: #e5e7eb;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Zabranenie odrazu/bounce a horizontalneho posunu len na dotykovych
   zariadeniach (telefon/tablet nainstalovany ako appka) - na pocitaci
   s mysou tieto pravidla blokovali normalne skrolovanie koleckom, preto
   su obmedzene na (pointer: coarse). */
@media (pointer: coarse) {
  body {
    overflow-x: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
  }
  html { overflow-x: hidden; overscroll-behavior: none; }

  /* Vacsie dotykove ciele na telefone/tablete - mysou sa da presne
     trafit aj mensie tlacidlo, prstom sa do 22-30px ciela casto netrafi
     napoprve. Velkost samotnej ikonky sa nemeni, len sa okolo nej pridal
     vacsi neviditelny "vankus" na klepnutie. */
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .breaks-toggle-btn {
    width: 32px;
    height: 32px;
  }
  .row-actions a {
    display: inline-block;
    padding: 6px 0;
  }
}
.topbar {
  background: #111827;
  color: #fff;
}
.topbar-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 18px; }
.brand-short { display: none; }
.topbar-inner > .brand:only-child { margin: 0 auto; }
.topbar nav { display: flex; align-items: center; gap: 8px; }
.topbar nav a {
  color: #e5e7eb;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  padding: 7px 14px;
  border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.topbar nav a:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
/* Aktualna stranka v hornej navigacii (Moja dochadzka / Dovolenka) -
   vyraznejsie "svietiaca" modra bublina namiesto len jemne sedej,
   nech je hned vidiet, kde sa pouzivatel prave nachadza. */
.topbar nav a.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.55);
}
.topbar nav a.active:hover { background: var(--primary-dark); }
.topbar .user-name { color: #9ca3af; font-size: 13px; }
.topbar .logout { color: #f87171; }
.container { max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.login-card { max-width: 360px; margin: 60px auto; }

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 18px; margin: 0 0 12px; }

label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=password], input[type=time], input[type=date], select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}
input[type=date], input[type=time] {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  min-height: 42px;
  line-height: 1.3;
}
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.checkbox-row input { width: auto; margin: 0; }
.radio-row { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); margin-right: 14px; }
.radio-row input { width: auto; margin: 0; }

.bulk-export { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  cursor: default;
}
.bulk-export #bulk-export-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
/* Bug: [hidden] atribut sam o sebe schova prvok len cez UA-styl
   "display:none", ale predosle pravidlo (vyssia specificita vdaka #id)
   ho prebilo pevnym "display:flex" - formular sa tak po kliknuti na
   "Export PDF" NIKDY neschoval, aj ked JS spravne prepinal .hidden.
   Tu sa [hidden] stav vyslovne vynuti aj s #id selektorom. */
.bulk-export #bulk-export-form[hidden] { display: none; }
.bulk-export select { width: auto; }

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { padding: 18px 24px; font-size: 18px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.flash-list { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.flash-success { background: #dcfce7; color: #14532d; }
.flash-error {
  background: #fee2e2;
  color: #7f1d1d;
  border-left: 4px solid var(--danger);
  font-weight: 600;
  font-size: 14.5px;
}

.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.status-not_started { background: #e5e7eb; color: #374151; }
.status-working { background: #dcfce7; color: #14532d; }
.status-on_break { background: #fef3c7; color: #78350f; }
.status-finished { background: #dbeafe; color: #1e3a8a; }

.diff-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}
.diff-badge.diff-negative { background: #fee2e2; color: #7f1d1d; }
.diff-badge.diff-positive { background: #dcfce7; color: #14532d; }

.clock-card { text-align: center; }
.clock-date { color: var(--muted); font-size: 15px; font-weight: 600; letter-spacing: 0.5px; margin-top: 10px; }
.clock-time { font-size: 44px; font-weight: 700; letter-spacing: 1px; margin: 4px 0 4px; }
.clock-sub { color: var(--muted); margin-bottom: 20px; }
.vacation-used-line::before { content: "\00b7"; margin: 0 4px; }
.clock-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.geo-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}
.geo-indicator .geo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.geo-indicator.geo-checking { background: #e5e7eb; color: #374151; }
.geo-indicator.geo-checking .geo-dot { background: #9ca3af; animation: geo-pulse 1s infinite; }
.geo-indicator.geo-ok { background: #dcfce7; color: #14532d; }
.geo-indicator.geo-ok .geo-dot { background: #16a34a; }
.geo-indicator.geo-fail { background: #fee2e2; color: #7f1d1d; }
.geo-indicator.geo-fail .geo-dot { background: #dc2626; }
@keyframes geo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr.weekend { background: #e2e8f0; }
tr.weekend td { color: #334155; }
tr.weekend td:first-child { font-weight: 700; }
tr.today-row { background: #eff6ff; }
tr.today-row.weekend { background: #cbd9ee; }
tr.today-row td.date-cell { box-shadow: inset 3px 0 0 0 var(--primary); padding-left: 7px; }
td.date-cell { font-weight: 700; }

.table-wrap { overflow-x: auto; }

.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.month-nav a { text-decoration: none; color: var(--primary); font-weight: 600; }
.month-nav .month-label { font-size: 18px; font-weight: 700; }

.employee-list { list-style: none; padding: 0; margin: 0; }
.employee-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.employee-row:last-child { border-bottom: none; }
.employee-name { font-weight: 600; }
.employee-meta { color: var(--muted); font-size: 13px; }
.row-actions a { margin-left: 12px; font-size: 13px; text-decoration: none; color: var(--primary); }
.inactive { opacity: .5; }

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.edit-row input { width: 90px; padding: 4px 6px; font-size: 13px; }
.edit-row form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.edit-row .note-input { width: 160px; }
.edit-row button { padding: 6px 10px; font-size: 12px; }

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-bar label { margin-bottom: 0; font-size: 13px; }
.filter-bar select { margin-top: 4px; min-width: 100px; padding: 8px 10px; }
.filter-bar button, .filter-bar a.btn { height: 38px; display: flex; align-items: center; }

.login-brand { text-align: center; margin-bottom: 18px; }
.login-logo { max-width: 140px; height: auto; margin-bottom: 8px; }
.login-logo-dark { display: none; }
.login-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; color: var(--text); text-transform: uppercase; }

.month-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
.filter-bar-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.filter-bar-inline select {
  padding: 7px 8px;
  min-width: 90px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-bar-inline button { padding: 8px 14px; font-size: 14px; }

.month-totals-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 8px 24px;
  padding: 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.month-total {
  text-align: center;
  font-size: 16px;
  white-space: nowrap;
}
.month-total.month-remaining { font-size: 14px; color: var(--muted); }
.month-total .diff-positive-text { color: #14532d; }
/* Hodnoty ako "24h 00m" alebo "25 / 25 dní" sa nikdy nesmu zalomit
   uprostred (napr. "24h" a "00m" na dvoch riadkoch) - vzdy zostanu
   pohromade na jednom riadku, aj ked sa cela veta okolo nich zalomi. */
.month-totals-row strong,
.month-totals-row .nowrap { white-space: nowrap; }

.vacation-row { background: #fffbeb; }
.vacation-cell { text-align: center; }
.holiday-row { background: #f5f3ff; }
.badge-holiday {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  /* Predtym bolo pozadie badge-u (#ede9fe) skoro rovnake ako pozadie
     celeho riadku sviatku (#f5f3ff) - odznak tak splyval s riadkom a na
     screenshote vyzeral ako obycajny text bez pozadia, na rozdiel od
     badge-vacation, ktory ma voci svojmu riadku dostatocny kontrast.
     Sytejsie pozadie + tenky okraj to opravia. */
  background: #ddd6fe;
  border: 1px solid rgba(109, 40, 217, 0.18);
  color: #5b21b6;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.holiday-worked-cell { text-align: center; }
.worked-value-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.year-summary {
  text-align: center;
  padding: 10px 14px 18px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.year-summary strong { color: var(--text); }
.diff-negative-text { color: #7f1d1d; }
.diff-positive-text { color: #14532d; }

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px 22px;
}
.year-month-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 8px;
}
.year-month-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.year-month-title:hover { color: var(--primary); }
.year-month-header .diff-badge { font-size: 11px; padding: 1px 8px; }
.year-month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}
.year-month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
}
.year-day {
  text-align: center;
  font-size: 12px;
  line-height: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--text);
}
.year-day.day-weekend { background: #e2e8f0; color: #334155; }
.year-day.day-present { background: #dcfce7; color: #14532d; font-weight: 700; }
.year-day.day-absent { background: #fee2e2; color: #7f1d1d; font-weight: 700; }
.year-day.day-vacation { background: #fef3c7; color: #92400e; font-weight: 700; }
.year-day.day-holiday { background: #ede9fe; color: #6d28d9; font-weight: 800; }
.year-day.day-today { box-shadow: 0 0 0 2px var(--primary) inset; font-weight: 700; }

.badge-vacation {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}


.top-actions { flex-wrap: wrap; }
.month-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}
.btn-arrow {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 18px;
  padding: 4px 6px;
}
.note-toggle { display: inline-block; position: relative; }
.note-toggle summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.note-toggle summary::-webkit-details-marker { display: none; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border, #d1d5db);
  background: #fff;
  color: var(--primary);
  font-size: 14px;
}
.icon-btn:hover { background: #f3f4f6; }

.breaks-toggle-btn {
  width: 22px;
  height: 22px;
  font-size: 11px;
  padding: 0;
  transition: transform .15s ease;
  flex: 0 0 auto;
}
.breaks-toggle-btn.breaks-open { transform: rotate(180deg); }
tr.breaks-detail-row { display: none; }
tr.breaks-detail-row.breaks-open { display: table-row; }
.breaks-detail-cell {
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
  padding: 6px 10px 10px 34px;
  border-bottom: 1px solid #f1f5f9;
}
.breaks-view-mode { display: flex; flex-direction: column; gap: 2px; }
.breaks-view-header { display: flex; align-items: center; gap: 8px; }
.breaks-view-header .my-breaks-toggle-btn { margin-left: auto; }
.breaks-view-list {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}
.breaks-view-list li {
  padding-left: 12px;
  position: relative;
  font-weight: 600;
  margin-bottom: 1px;
}
.breaks-view-list li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: #b45309;
}
.breaks-view-note {
  font-weight: 400;
  color: #78350f;
  font-style: italic;
}
.breaks-edit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
/* Kazde prerusenie je teraz vlastny samostatny riadok - vlastne casy,
   vlastna poznamka a vlastne tlacidlo Ulozit, rovnako ako uprava
   prichodu/odchodu pre cely den. Riadky su oddelene tenkou ciarkovanou
   ciarou, aby bolo v mobilnom pohlade jasne vidiet, kde jedno prerusenie
   konci a dalsie zacina. */
.breaks-edit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px dashed #fde68a;
}
.breaks-edit-row:last-child { padding-bottom: 0; border-bottom: none; }
.breaks-edit-label { font-weight: 600; color: #78350f; font-size: 13px; flex: 0 0 auto; }
.breaks-edit-times { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.breaks-edit-arrow { color: #b45309; font-weight: 700; }
.breaks-edit-note-group {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 140px;
}
.breaks-note-input {
  width: 100%;
  min-width: 140px;
  margin-top: 0;
}
.breaks-note-hint {
  flex: 1 1 100%;
}

/* Poznamka je povinna, ked zamestnanec naozaj zmenil cas (prichod/odchod
   alebo prerusenie) - ak ju vynecha, policko sa zvyrazni a pod nim sa
   zobrazi viditelna cervena hlaska (spolahlivejsie nez spoliehat sa na
   natívnu prehliadacovu bublinu, ktora sa na iPhone/appke casto nezobrazi). */
.note-input.input-invalid {
  border-color: var(--danger);
  background: #fef2f2;
  outline: 1px solid var(--danger);
}
.note-required-hint[hidden] { display: none; }
.note-required-hint {
  display: block;
  color: var(--danger);
  font-size: 12px;
  margin-top: 3px;
  font-weight: 600;
}

.edited-warning-icon {
  width: 16px;
  height: 16px;
  margin-left: 6px;
  vertical-align: middle;
  flex: 0 0 auto;
  cursor: pointer;
}
tr.edit-log-detail-row { display: none; }
tr.edit-log-detail-row.edit-log-open { display: table-row; }
.edit-log-detail-cell {
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 13px;
  padding: 8px 10px 10px 34px;
  border-bottom: 1px solid #f1f5f9;
}
.edit-log-list { margin: 4px 0 0; padding-left: 18px; }
.edit-log-list li { margin-bottom: 2px; }
.edit-log-entry { margin-bottom: 8px; }
.edit-log-entry:last-child { margin-bottom: 0; }
.edit-log-timestamp {
  font-weight: 700;
  color: #7f1d1d;
  font-size: 12.5px;
  margin-bottom: 2px;
}
.edit-log-fields {
  list-style: none;
  margin: 0;
  padding: 0;
}
.edit-log-fields li {
  margin-bottom: 1px;
  padding-left: 12px;
  position: relative;
  font-size: 13px;
}
.edit-log-fields li::before {
  content: '\2013';
  position: absolute;
  left: 0;
  color: #b91c1c;
}
.edit-log-field-label { font-weight: 600; margin-right: 3px; }
.edit-log-old-value { color: #9a5a5a; text-decoration: line-through; text-decoration-color: #d4a5a5; }
.edit-log-arrow { color: #b91c1c; margin: 0 4px; font-weight: 700; }
.edit-log-new-value { font-weight: 700; color: #7f1d1d; }
.note-toggle[open] summary { background: #f3f4f6; }
.note-inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  flex-wrap: wrap;
}
.note-inline-form .note-input-inline { min-width: 140px; }
.btn-note-save {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.note-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.note-input-inline {
  padding: 5px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 90px;
}
.btn-note { padding: 5px 10px; font-size: 12px; }

/* Poznamka v admin editovatelnom riadku mesacneho vykazu (siroka tabulka) -
   bez pevnej sirky by tento stlpec (width:100% z bezneho pravidla pre
   input[type=text]) natiahol celu tabulku a "Datum" stlpec s farebnym
   odznakom by sa dostal mimo obrazovky pri vodorovnom scrolovani. */
.month-table .note-input { width: 130px; }

/* Kratke zvyraznenie riadku, na ktory sa strancka po ulozeni zmeny
   (prichod/odchod/prerusenie) automaticky presunie - aby bolo hned
   jasne vidiet, ze sa zmena naozaj ulozila, aj bez rucneho hladania
   toho isteho dna v zozname. */
.month-table tr.just-edited { animation: justEditedFlash 2.5s ease; }
@keyframes justEditedFlash {
  0% { background: #dcfce7; }
  100% { background: transparent; }
}


/* --------------------------------------------------------------------- */
/* Mobilne zobrazenie                                                    */
/* --------------------------------------------------------------------- */
/* .tabbar existuje v DOM na kazdej sirke, ale zobrazuje sa len na mobile
   (viz pravidlo v @media max-width:640px nizsie, ktore prichadza AZ PO
   tomto pravidle v subore a preto ho tam prebije) - na pocitaci navigacia
   ostava v hornej liste ako doteraz. */
.tabbar { display: none; }
.period-label { display: none; }

@media (max-width: 640px) {
  /* --------------------------------------------------------------- */
  /* iOS vzhlad na mobile: farebna paleta blizka systemovym farbam    */
  /* z iOS (systemBlue, systemGroupedBackground, separator...), ktore */
  /* sa vdaka CSS premennym automaticky prejavia vo vsetkych          */
  /* existujucich pravidlach (tlacidla, odznaky, ramceky...) bez      */
  /* toho, aby sa museli prepisovat jednotlivo.                       */
  /* --------------------------------------------------------------- */
  :root {
    --bg: #f2f2f7;
    --card-bg: #ffffff;
    --text: #000000;
    --muted: #8a8a8e;
    --primary: #007aff;
    --primary-dark: #0062cc;
    --danger: #ff3b30;
    --success: #34c759;
    --border: rgba(60, 60, 67, 0.29);
    --radius: 14px;
  }
  body { -webkit-font-smoothing: antialiased; }

  .container { padding: 14px 10px 40px; }
  .card { padding: 16px; border-radius: var(--radius); border: none; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }

  .year-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
  .year-month-title { font-size: 14px; }
  .year-day { font-size: 11px; height: 20px; line-height: 20px; }
  .year-summary { font-size: 12px; }

  .month-totals-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 16px;
    padding: 10px 6px;
  }
  .month-total { font-size: 12px; }
  .month-total.month-remaining { font-size: 12px; }

  /* iOS navigacna lista: presvitne/rozmazane biele pozadie, tenka
     oddelovacia ciarka dole namiesto plnej tmavej listy, vystredeny
     tucny nazov - ako titulok v natívnej iOS navigation bar. Odkazy
     Dnes/Moja dochadzka/Dovolenka sa tu na mobile schovaju (nahradi
     ich spodna zalozkova lista .tabbar nizsie); admin (jediny odkaz
     "Zamestnanci") ostava viditelny tu, kedze pre neho ziadna zalozkova
     lista nie je. */
  .topbar {
    background: rgba(255, 255, 255, 0.88);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 0.5px solid rgba(60, 60, 67, 0.29);
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .topbar-inner {
    padding: 0 12px;
    height: auto;
    min-height: 46px;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 8px;
    justify-content: center;
    position: relative;
  }
  /* Admin ma na rozdiel od zamestnanca navigaciu (Zamestnanci/Odhlasit)
     stale viditelnu tu v hornej liste (nema spodnu zalozkovu listu) -
     vystredeny nazov aplikacie by sa mu s nou na uzkom telefone prekryval.
     Preto pre admina (pozna sa podla .topbar-nav-admin v DOM) nazov
     ostava vlavo namiesto vystredenia, rovnako ako to bolo predtym. */
  .topbar-inner:has(.topbar-nav-admin) { justify-content: space-between; }
  .brand { color: #000; font-size: 17px; font-weight: 700; }
  /* "Dochadzkovy system" sa na uzkom telefone spolu s odkazmi admina
     (Zamestnanci/Odhlasit) do jedneho riadku nezmesti a prekryvaju sa -
     preto na mobile ukaz kratky nazov "Dochadzka" namiesto plneho. */
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .topbar nav {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    gap: 10px;
  }
  .topbar-nav-employee { display: none; }
  .topbar nav a { color: var(--primary); font-size: 13px; font-weight: 600; }
  .topbar nav a:hover { color: var(--primary); }
  .topbar .user-name { display: none; }
  .topbar .logout { color: var(--danger); }

  h1 { font-size: 19px; }
  h2 { font-size: 16px; }

  .clock-time { font-size: 34px; }
  .clock-actions { flex-direction: column; }
  .clock-actions .btn-lg { width: 100%; }

  /* iOS tlacidla: zaoblenejsie rohy (plne "pilulkove" pre velke akcne
     tlacidla ako Start/Koniec pracovnej doby), jemna "stlacena" animacia
     pri klepnuti prstom - napodobuje natívnu spatnu vazbu na klepnutie
     v iOS appkach namiesto plocheho ":hover" efektu z webu. */
  .btn {
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 10px;
    transition: transform .12s ease, opacity .12s ease;
  }
  .btn:active { transform: scale(0.96); opacity: .85; }
  .btn-lg { padding: 16px 18px; font-size: 16px; border-radius: 999px; }
  .btn-secondary { background: #e5e5ea; }
  .icon-btn { border-radius: 10px; }

  table:not(.month-table) { font-size: 12.5px; }
  table:not(.month-table) th, table:not(.month-table) td { padding: 6px 6px; }

  /* Mesacny vykaz na mobile: riadky ako kartricky namiesto sirokej tabulky */
  .month-table, .month-table tbody { display: block; width: 100%; }
  .month-table .table-header-row { display: none; }
  .month-table tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
  }
  .month-table tr.weekend { background: #e2e8f0; }
  .month-table tr.today-row { background: #eff6ff; }
  .month-table tr.today-row.weekend { background: #cbd9ee; }
  .month-table tr.holiday-row { background: #f5f3ff; }
  .month-table tr.breaks-detail-row {
    display: none;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-top: -10px;
    padding: 8px 12px 10px;
    background: #fffbeb;
  }
  .month-table tr.breaks-detail-row.breaks-open { display: block; }
  .month-table tr.edit-log-detail-row {
    display: none;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-top: -10px;
    padding: 8px 12px 10px;
    background: #fef2f2;
  }
  .month-table tr.edit-log-detail-row.edit-log-open { display: block; }
  /* Vacsi dotykovy ciel pre klikatelnu ikonku vykricnika na telefone
     (na pocitaci ostava povodna 16px velkost - tam sa nemeni nic). */
  .edit-log-toggle { width: 26px; height: 26px; }
  .month-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13.5px;
  }
  .month-table td:last-child { border-bottom: none; }
  .month-table td.date-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    padding: 0 0 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
  }
  /* Pevna sirka pre datum/den - odznak potom vzdy zacina na tej istej
     pozicii vo vsetkych riadkoch (admin aj zamestnanec) a pri dlhsom
     texte sa jednoducho roztiahne doprava. */
  .month-table td.date-cell .date-text { flex: 0 0 100px; white-space: nowrap; }
  .month-table td.date-cell .diff-badge { flex: 0 0 auto; margin-left: 0; }
  .month-table tr.today-row td.date-cell { box-shadow: inset 3px 0 0 0 var(--primary); padding-left: 8px; }

  /* Zbaleny/rozbaleny riadok - na mobile sa pri datume zobrazi len sam
     datum, po klepnuti sa rozbali zvysok dna (viz skript v month.html). */
  .month-table td.date-cell { cursor: pointer; position: relative; padding-right: 20px; }
  .month-table td.date-cell::after {
    content: '\25BE';
    position: absolute; right: 0; top: 0;
    color: var(--muted);
    transition: transform .15s ease;
  }
  .month-table tr.day-open td.date-cell::after { transform: rotate(180deg); }
  .month-table tr:not(.day-open) td:not(.date-cell):not(.breaks-detail-cell):not(.edit-log-detail-cell) { display: none !important; }
  .breaks-detail-cell { display: block !important; padding: 4px 0 8px; }
  .edit-log-detail-cell { display: block !important; padding: 4px 0 8px; }

  .month-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 auto;
  }
  .month-table td.vacation-cell, .month-table td.vacation-cell-center {
    display: block;
    text-align: center;
    border-bottom: none;
    padding: 4px 0;
  }
  .month-table td.cell-action { display: block; text-align: right; padding-top: 6px; }
  .month-table td input[type=time] {
    width: auto; max-width: 130px; text-align: right; font-size: 16px; padding: 6px 8px;
  }
  /* Poznamkove policka (vsetky .note-input v mesacnom vykaze) na mobile
     nech su cez celu dostupnu sirku riadku, nie napevno 130px ako na
     sirokej tabulke pre pocitac (viz komentar vyssie pri .month-table
     .note-input) - na uzkom telefone by 130px na text odovodnenia zmeny
     bolo prilis malo. font-size 16px kvoli iOS Safari, ktory by inak pri
     kliknuti do mensieho policka automaticky priblizil cely displej. */
  .month-table .note-input {
    width: 100%;
    max-width: none;
    text-align: left;
    font-size: 16px;
    padding: 8px 10px;
  }
  .month-table .note-inline-form, .month-table .note-form { justify-content: flex-end; width: 100%; }
  .month-table .note-inline-form .note-input-inline, .month-table .note-form .note-input-inline {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    padding: 5px 6px;
    font-size: 12.5px;
  }
  .month-table .btn.btn-secondary { padding: 8px 12px; font-size: 13px; }
  .month-table .btn-note { padding: 6px 8px; font-size: 12px; flex: 0 0 auto; }

  .edit-row input { width: 68px; }
  .edit-row .note-input { width: 100px; }
  .edit-row form { gap: 4px; }

  /* Zamestnanec otvoril pero na upravu Prichodu/Odchodu/Poznamky (bezny
     den, nie dovolenka): namiesto piatich samostatnych riadkov pod sebou
     usporiadaj Prichod a Odchod pod seba v lavom stlpci a Poznamku vedla
     nich vpravo (cez vysku oboch), podobne ako kompaktny zapis v Historii
     zmien. Prestavka/Odpracovane sa v tomto rezime skryju (nie su tu
     editovatelne, vidno ich znova po ulozeni/zavreti). */
  .month-table tr.my-full-editing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 10px;
    row-gap: 0;
  }
  /* POZOR: bez vyslovne zadaneho grid-row pre kazdu bunku (aj tu, aj pre
     date-cell a tlacidlo Ulozit nizsie) by CSS Grid auto-umiestnovanie
     dalo date-cell a tlacidlo Ulozit AZ ZA/MEDZI uz explicitne umiestnene
     bunky (Prichod/Odchod/Poznamka) - t.j. nadpis dna by sa zobrazil az
     POD vstupmi a tlacidlo Ulozit este za nim, namiesto ako hlavicka
     hore a tlacidlo dole. Preto ma teraz uplne kazda bunka v tomto
     rezime svoj grid-row napevno urceny. */
  .month-table tr.my-full-editing > td.date-cell { grid-column: 1 / -1; grid-row: 1; }
  /* Poznamka: v tr zostava skryty <template> element (nezmizne, iba jeho
     .content sa sklonuje) - preto su Prichod/Odchod/... na pozicii
     nth-child 3-8, nie 2-7 (sablona je nth-child(2)). */
  .month-table tr.my-full-editing > td:nth-child(3) { grid-column: 1; grid-row: 2; }
  .month-table tr.my-full-editing > td:nth-child(4) { grid-column: 1; grid-row: 3; }
  .month-table tr.my-full-editing > td:nth-child(5),
  .month-table tr.my-full-editing > td:nth-child(6) { display: none; }
  .month-table tr.my-full-editing > td:nth-child(7) {
    grid-column: 2;
    grid-row: 2 / 4;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 4px;
    border-bottom: none;
  }
  .month-table tr.my-full-editing > td:nth-child(7) input.note-input {
    width: 100%;
    max-width: none;
    text-align: left;
  }
  .month-table tr.my-full-editing > td:nth-child(8) { grid-column: 1 / -1; grid-row: 4; }

  .top-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .top-actions h1 { text-align: center; }
  .month-controls { margin-left: 0; justify-content: center; width: 100%; }
  .filter-bar-inline {
    margin-left: 0;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    row-gap: 8px;
  }
  .filter-bar-inline select {
    min-width: 0;
    flex: 1 1 100px;
  }
  .filter-bar-inline button {
    flex: 1 1 100%;
  }
  .btn-arrow { flex: 0 0 auto; }
  .month-controls .arrow-prev { order: 1; }
  .month-controls .arrow-next { order: 2; margin-left: 0; }
  .month-controls .filter-bar-inline { order: 3; }
  .month-controls > a.btn.btn-secondary { order: 4; width: 100%; text-align: center; margin-top: 4px; }

  input[type=date], input[type=time] {
    font-size: 16px;
    padding: 10px 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  label { max-width: 100%; }

  .employee-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .row-actions a { margin-left: 0; margin-right: 12px; }

  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar select { width: 100%; }

  /* iOS "prepinac" (toggle switch) namiesto obycajneho checkboxu - len
     cistym CSS na existujuci <input type=checkbox>, ziadna zmena
     sablony netreba. */
  .checkbox-row input[type=checkbox] {
    -webkit-appearance: none;
    appearance: none;
    width: 51px;
    height: 31px;
    border-radius: 999px;
    background: #e9e9eb;
    position: relative;
    flex: 0 0 auto;
    cursor: pointer;
    transition: background .2s ease;
  }
  .checkbox-row input[type=checkbox]::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: transform .2s ease;
  }
  .checkbox-row input[type=checkbox]:checked {
    background: var(--success);
  }
  .checkbox-row input[type=checkbox]:checked::before {
    transform: translateX(20px);
  }

  /* iOS "segmentovany prepinac" vzhlad pre Mesacny/Rocny export - dve
     susediace pilulkove volby, vybrata ma modre pozadie a biely text. */
  .radio-row {
    border: 1px solid rgba(60, 60, 67, 0.29);
    border-radius: 999px;
    padding: 7px 14px;
    margin-right: 8px;
    transition: background .15s ease, border-color .15s ease;
  }
  .radio-row input[type=radio] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #c7c7cc;
    position: relative;
    flex: 0 0 auto;
  }
  .radio-row input[type=radio]:checked {
    border-color: var(--primary);
  }
  .radio-row input[type=radio]:checked::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--primary);
  }
  .radio-row:has(input[type=radio]:checked) {
    background: #e8f2ff;
    border-color: var(--primary);
  }

  /* iOS alert banner: plne zaoblena tinta bez laveho farebneho pruhu
     (namiesto webovej "toast s farebnou ciarou" konvencie). */
  .flash {
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
  }
  .flash-error {
    border-left: none;
  }

  /* --------------------------------------------------------------- */
  /* Spodna zalozkova (tab bar) navigacia - viditelna len na mobile.  */
  /* Na pocitaci ma .tabbar { display:none } (viz pravidlo mimo tejto */
  /* media query), takze tam sa nezobrazuje vobec.                   */
  /* --------------------------------------------------------------- */
  .container { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(60, 60, 67, 0.29);
    padding: 6px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 0 2px;
    text-decoration: none;
    color: #8a8a8e;
  }
  .tabbar-icon { width: 25px; height: 25px; }
  .tabbar-item span { font-size: 10px; font-weight: 500; }
  .tabbar-item.active { color: var(--primary); }
  .tabbar-item:active { opacity: .6; }
}

/* --------------------------------------------------------------------- */
/* Tmavy rezim na mobile - podla systemoveho nastavenia telefonu         */
/* (Nastavenia > Displej a jas > Tmavy rezim na iPhone). Ked ma telefon  */
/* svetly rezim, appka ostava biela presne ako doteraz (nic sa nemeni);  */
/* ked ma telefon tmavy rezim, appka sa automaticky prepne na cierne     */
/* pozadie s farbami podla systemovej tmavej palety iOS - ziadne         */
/* prepinanie v appke netreba, riadi to telefon sam.                     */
/* --------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card-bg: #1c1c1e;
    --text: #ffffff;
    --muted: #98989d;
    --primary: #0a84ff;
    --primary-dark: #409cff;
    --danger: #ff453a;
    --success: #30d158;
    --border: rgba(84, 84, 88, 0.6);
    --radius: 14px;
  }
  /* Necha natívne prvky (klávesnica, výber dátumu/času, select) použiť
     rovno tmavý systémový vzhľad namiesto vždy-svetlého default. */
  :root { color-scheme: dark; }

  body { background: var(--bg); }

  /* Karty na cierne pozadie uz nepotrebuju tieň (na cistej cierni nie je
     vidiet) - namiesto neho jemny vlasovy okraj, rovnako ako medzi
     bunkami v natívnom tmavom "grouped" zozname v iOS appkach. */
  .card {
    box-shadow: none;
    border: 0.5px solid var(--border);
  }

  input[type=text], input[type=password], input[type=time], input[type=date], select, textarea {
    background: #1c1c1e;
    color: var(--text);
    border-color: var(--border);
  }

  /* Horna a spodna lista - tmave priesvitne/rozmazane pozadie namiesto
     bieleho. */
  .topbar {
    background: rgba(20, 20, 22, 0.82);
    border-bottom-color: var(--border);
  }
  .brand { color: #fff; }
  .topbar nav a.active { box-shadow: 0 0 14px rgba(10, 132, 255, 0.5); }
  .tabbar {
    background: rgba(20, 20, 22, 0.85);
    border-top-color: var(--border);
  }
  .tabbar-item { color: #98989d; }

  .btn-secondary { background: #2c2c2e; color: var(--text); }
  .icon-btn { background: #1c1c1e; border-color: var(--border); }
  .icon-btn:hover { background: #2c2c2e; }
  .note-toggle[open] summary { background: #2c2c2e; }

  /* Farebne odznaky (stavy, rozdiely, hlasky) - na cistej bielej/pastelovej
     ploche by na cierno boli oslepujuce, preto vsade pouzitá tmava
     "tint" verzia (priesvitne farebne pozadie + svetlejsi text tej istej
     farby), rovnako ako to robia natívne iOS appky v tmavom rezime. */
  .status-not_started { background: rgba(120, 120, 128, 0.24); color: #d1d1d6; }
  .status-working { background: rgba(48, 209, 88, 0.18); color: #30d158; }
  .status-on_break { background: rgba(255, 159, 10, 0.18); color: #ffb340; }
  .status-finished { background: rgba(10, 132, 255, 0.18); color: #409cff; }

  .diff-badge.diff-negative { background: rgba(255, 69, 58, 0.18); color: #ff6961; }
  .diff-badge.diff-positive { background: rgba(48, 209, 88, 0.18); color: #30d158; }
  .diff-negative-text { color: #ff6961; }
  .diff-positive-text { color: #30d158; }
  .month-total .diff-positive-text { color: #30d158; }

  .flash-success { background: rgba(48, 209, 88, 0.18); color: #30d158; }
  .flash-error { background: rgba(255, 69, 58, 0.18); color: #ff6961; }

  .badge-vacation { background: rgba(255, 159, 10, 0.18); color: #ffb340; }
  .badge-holiday { background: rgba(191, 90, 242, 0.34); color: #e9d5ff; border-color: rgba(191, 90, 242, 0.45); }

  /* Vikend/dnesok riadky v mesacnom vykaze. */
  tr.weekend, .month-table tr.weekend { background: rgba(255, 255, 255, 0.045); }
  tr.weekend td { color: #aeaeb2; }
  tr.today-row, .month-table tr.today-row { background: rgba(10, 132, 255, 0.12); }
  tr.today-row.weekend, .month-table tr.today-row.weekend { background: rgba(10, 132, 255, 0.2); }
  .month-table tr { background: var(--card-bg); }
  .vacation-row { background: rgba(255, 159, 10, 0.08); }

  /* Prerusenia (zlty panel - farbu ako take si chcel nechat, len v
     tmavej verzii) a historia zmien (cerveny panel). */
  .breaks-detail-cell, .month-table tr.breaks-detail-row {
    background: rgba(255, 159, 10, 0.08);
    color: #ffb340;
    border-bottom-color: var(--border);
  }
  .breaks-view-list li::before { color: #ffb340; }
  .breaks-view-note { color: #e0b080; }
  .breaks-edit-row { border-bottom-color: rgba(255, 159, 10, 0.35); }
  .breaks-edit-label { color: #ffb340; }
  .breaks-edit-arrow { color: #ffb340; }

  .edit-log-detail-cell, .month-table tr.edit-log-detail-row {
    background: rgba(255, 69, 58, 0.08);
    color: #ff6961;
    border-bottom-color: var(--border);
  }
  .edit-log-timestamp { color: #ff6961; }
  .edit-log-fields li::before { color: #ff6961; }
  .edit-log-old-value { color: #98989d; text-decoration-color: rgba(152, 152, 157, 0.6); }
  .edit-log-arrow { color: #ff6961; }
  .edit-log-new-value { color: #ff6961; }

  .note-input.input-invalid { background: rgba(255, 69, 58, 0.12); }

  /* Logo na prihlasovacej obrazovke: v tmavom rezime pouzivame samostatny
     obrazok s bielou kresbou na priehladnom pozadi (logo-dark.png), aby
     logo nemalo ziadnu vlastnu farebnu podlozku a splynulo s pozadim karty. */
  .login-logo-light { display: none; }
  .login-logo-dark { display: inline-block; }

  /* iOS prepinac (toggle switch) a segmentovany vyber - vypnuty stav a
     ramceky na tmave farby, zapnuty/zvoleny stav (modra/zelena) ostava
     rovnaky, kedze uz na cierne pozadi funguje dobre. */
  .checkbox-row input[type=checkbox] { background: #39393d; }
  .radio-row { border-color: var(--border); }
  .radio-row input[type=radio] { border-color: #48484a; }
  .radio-row:has(input[type=radio]:checked) { background: rgba(10, 132, 255, 0.18); }

  /* Rocny prehlad - farebne bodky dni. */
  .year-day.day-weekend { background: rgba(255, 255, 255, 0.06); color: #aeaeb2; }
  .year-day.day-present { background: rgba(48, 209, 88, 0.18); color: #30d158; }
  .year-day.day-absent { background: rgba(255, 69, 58, 0.18); color: #ff6961; }
  .year-day.day-vacation { background: rgba(255, 159, 10, 0.18); color: #ffb340; }
  .year-day.day-holiday { background: rgba(191, 90, 242, 0.2); color: #d9a6ff; }

  .filter-bar { background: rgba(255, 255, 255, 0.04); }
}

/* --------------------------------------------------------------------- */
/* Mobilny vizualny refresh                                              */
/* --------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --mobile-gutter: 12px;
    --mobile-shadow: 0 10px 30px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.05);
  }

  html { background: var(--bg); }
  body {
    min-width: 320px;
    min-height: 100svh;
    font-size: 16px;
    line-height: 1.45;
    background:
      radial-gradient(circle at 100% 0, rgba(0, 122, 255, 0.08), transparent 240px),
      var(--bg);
  }

  .container {
    width: 100%;
    max-width: 540px;
    padding: 16px var(--mobile-gutter) calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .card {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    box-shadow: var(--mobile-shadow);
  }

  h1 {
    margin-bottom: 18px;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  h2 { font-size: 1.1rem; line-height: 1.25; }

  .topbar {
    padding-top: env(safe-area-inset-top, 0px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }
  .topbar-inner {
    min-height: 52px;
    padding: 8px 16px;
  }
  .brand {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
  }
  .topbar nav { right: 14px; }
  .topbar nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
  }
  .topbar-nav-admin { display: none; }
  .topbar-inner:has(.topbar-nav-admin) {
    justify-content: center;
  }

  label {
    margin-bottom: 16px;
    color: #636366;
    font-size: 0.875rem;
    font-weight: 600;
  }
  input[type=text], input[type=password], input[type=time], input[type=date],
  input[type=number], select, textarea {
    min-height: 48px;
    margin-top: 7px;
    padding: 11px 13px;
    border-color: rgba(60, 60, 67, 0.22);
    border-radius: 12px;
    font-size: 16px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.025);
  }
  input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(0, 122, 255, 0.16);
    border-color: var(--primary);
  }

  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.9375rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  }
  .btn-primary {
    background: linear-gradient(180deg, #1687ff 0%, var(--primary) 100%);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.24);
  }
  .btn-danger { box-shadow: 0 6px 16px rgba(255, 59, 48, 0.18); }
  .btn-secondary { box-shadow: none; }
  .btn:focus-visible, .tabbar-item:focus-visible, .icon-btn:focus-visible,
  .btn-arrow:focus-visible, .topbar a:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.28);
    outline-offset: 2px;
  }

  /* Dnes: hlavna akcia je dominantna a cas ostava citatelny na prvy pohlad. */
  .clock-card {
    position: relative;
    overflow: hidden;
    padding: 24px 18px 20px;
  }
  .clock-footer-note {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    text-align: left;
  }
  .clock-footer-note p { margin: 0 0 16px; }
  .clock-footer-note p:last-child { margin-bottom: 0; }
  .clock-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, #007aff, #5ac8fa);
  }
  .clock-card .status-pill {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
  .clock-date {
    margin-top: 18px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .clock-time {
    margin: 2px 0 8px;
    font-size: clamp(2.75rem, 15vw, 4.1rem);
    line-height: 1;
    letter-spacing: -0.055em;
    font-variant-numeric: tabular-nums;
  }
  .clock-sub {
    margin: 0 auto 18px;
    font-size: 0.875rem;
    line-height: 1.55;
  }
  .vacation-balance-text {
    line-height: 1.5;
  }
  .vacation-used-line {
    /* Na mobile radsej vetu rozdelime na dva riadky nez aby sa jeden
       dlhy riadok zalamoval nevhodne uprostred alebo musel scrollovat -
       "vycerpane: X dni" ide na vlastny riadok pod hlavny text. */
    display: block;
    margin-top: 4px;
  }
  .vacation-used-line::before {
    content: none;
  }
  .clock-actions { gap: 10px; }
  .clock-actions form { width: 100%; }
  .clock-actions .btn-lg {
    min-height: 54px;
    width: 100%;
    border-radius: 15px;
    font-size: 1rem;
  }

  /* Filtre a prepinanie obdobia maju na telefone stabilnu mriezku. */
  .top-actions { margin-bottom: 18px; }
  .top-actions h1 { text-align: left; }
  .month-controls {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    gap: 10px;
  }
  .btn-arrow {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.35rem;
    background: var(--card-bg);
    border-color: var(--border);
  }
  .month-controls .arrow-prev { grid-column: 1; grid-row: 1; }
  .month-controls .period-label {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 750;
    text-align: center;
  }
  .month-controls .filter-bar-inline {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
  }
  .month-controls .arrow-next { grid-column: 3; grid-row: 1; }
  .month-controls .filter-bar-inline select { display: block; width: 100%; }
  .month-controls .filter-bar-inline button {
    width: 100%;
    min-width: 0;
  }
  .month-controls > a.btn.btn-secondary {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
    margin: 0;
  }
  .filter-bar-inline { gap: 8px; }
  .page-dovolenka .filter-bar-inline select { display: block; }

  .month-totals-row {
    /* Ziadne skrolovacie okno - kazdy udaj je obycajny text pod sebou. */
    display: block;
    overflow-x: visible;
    margin: 14px 0 -4px;
    padding: 12px 0 4px;
  }
  .month-total {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 5px 0;
    background: none;
    border-radius: 0;
    white-space: normal;
    font-size: 0.85rem;
  }

  .month-table tr {
    border: none;
    border-radius: 15px;
    padding: 12px 14px;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 5px 18px rgba(15, 23, 42, 0.045);
  }
  .month-table td { min-height: 37px; font-size: 0.9rem; }
  .month-table td[data-label]::before { font-size: 0.78rem; }
  .month-table td.date-cell {
    min-height: 42px;
    padding-top: 2px;
    font-size: 1rem;
  }
  .month-table td.date-cell::after {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    top: -1px;
    border-radius: 50%;
    background: rgba(118, 118, 128, 0.1);
  }
  .month-table tr.today-row {
    outline: 2px solid rgba(0, 122, 255, 0.22);
  }
  .month-table tr.holiday-row {
    background: linear-gradient(135deg, #faf7ff 0%, #f3edff 100%);
    box-shadow: inset 3px 0 0 #8b5cf6, 0 5px 18px rgba(91, 33, 182, 0.08);
  }
  .month-table .badge-holiday { margin-left: 0; }

  /* Dovolenky: siroka desktopova tabulka sa meni na citatelny zoznam kariet. */
  .vacation-list-table, .vacation-list-table tbody { display: block; }
  .vacation-list-table > tbody > tr:first-child { display: none; }
  .vacation-list-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    margin-bottom: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(118, 118, 128, 0.07);
  }
  .vacation-list-table td {
    display: block;
    padding: 0;
    border: 0;
    font-size: 0.9rem;
  }
  .vacation-list-table td[data-label="Dátum"] {
    font-weight: 750;
    color: var(--text);
  }
  .vacation-list-table td[data-label="Poznámka"] {
    grid-column: 1;
    color: var(--muted);
  }
  .vacation-list-table .vacation-list-action {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }
  .vacation-list-table .vacation-list-action .btn { min-height: 38px; }
  .empty-state {
    margin: 12px 0 0;
    padding: 22px 14px;
    border-radius: 14px;
    color: var(--muted);
    background: rgba(118, 118, 128, 0.07);
    text-align: center;
    font-size: 0.9rem;
  }

  /* Zamestnanci: jednotlive osoby a ich akcie su od seba jasne oddelene. */
  .employee-list { margin: 0 -4px; }
  .employee-row {
    gap: 12px;
    margin-bottom: 8px;
    padding: 14px;
    border: 0;
    border-radius: 14px;
    background: rgba(118, 118, 128, 0.07);
  }
  .employee-row:last-child { margin-bottom: 0; }
  .employee-name { font-size: 1rem; }
  .employee-meta { margin-top: 4px; font-size: 0.78rem; line-height: 1.6; }
  .row-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .row-actions a {
    min-height: 40px;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 122, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .bulk-export #bulk-export-form { align-items: stretch; }
  .bulk-export #bulk-export-form > * { width: 100%; }
  .bulk-export select { width: 100%; }
  .radio-row { min-height: 44px; margin: 0; }

  /* Rocny kalendar ostava kompaktny, ale cita sa ako samostatne mesiace. */
  .year-summary {
    margin: 0 0 16px;
    padding: 14px;
    border: 0;
    border-radius: 14px;
    background: rgba(118, 118, 128, 0.07);
    font-size: 0.82rem;
    line-height: 1.65;
  }
  .year-grid { gap: 12px; }
  .year-month-box {
    padding: 10px;
    border-radius: 14px;
    background: rgba(118, 118, 128, 0.06);
  }
  .year-day { border-radius: 7px; }

  /* Prihlasovanie posobi ako jedna sustredena mobilna obrazovka. */
  .page-login .container {
    min-height: 100svh;
    display: grid;
    align-items: center;
    padding-top: max(24px, env(safe-area-inset-top, 0px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }
  .login-card {
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    padding: 24px 20px;
  }
  .login-brand { margin-bottom: 22px; }
  .login-logo { max-width: 126px; }
  .login-card h1 { text-align: center; }

  .flash-list { margin: 0 0 14px; }
  .flash { padding: 12px 14px; line-height: 1.4; }

  .tabbar {
    min-height: 68px;
    gap: 4px;
    padding: 7px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 26px rgba(15, 23, 42, 0.06);
  }
  .tabbar-item {
    min-height: 48px;
    gap: 3px;
    padding: 5px 4px 4px;
    border-radius: 14px;
  }
  .tabbar-item.active { background: rgba(0, 122, 255, 0.1); }
  .tabbar-icon { width: 23px; height: 23px; }
  .tabbar-item span { font-size: 0.68rem; font-weight: 650; }
}

@media (max-width: 370px) {
  .container { --mobile-gutter: 9px; }
  .card { padding: 15px; }
  .year-grid { grid-template-columns: 1fr; }
  .clock-time { font-size: 2.8rem; }
}

@media (max-width: 640px) and (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at 100% 0, rgba(10, 132, 255, 0.15), transparent 250px),
      var(--bg);
  }
  .card {
    border-color: rgba(84, 84, 88, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  }
  label { color: #aeaeb2; }
  .btn-primary { background: linear-gradient(180deg, #2993ff 0%, #0a84ff 100%); }
  .vacation-list-table tr, .employee-row,
  .year-summary, .year-month-box, .empty-state { background: rgba(255, 255, 255, 0.055); }
  .month-table tr { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
  .month-table tr.holiday-row {
    background: linear-gradient(135deg, rgba(191, 90, 242, 0.16), rgba(88, 86, 214, 0.09));
    box-shadow: inset 3px 0 0 #bf5af2, 0 6px 20px rgba(0, 0, 0, 0.18);
  }
  .month-table td { border-bottom-color: rgba(84, 84, 88, 0.45); }
  .month-table td.date-cell::after { background: rgba(255, 255, 255, 0.08); }
  .tabbar-item.active { background: rgba(10, 132, 255, 0.16); }
  .row-actions a { background: rgba(10, 132, 255, 0.14); }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ==========================================================================
   Nastavenia a GPS zony (admin)
   ========================================================================== */
.settings-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 26px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.settings-form .settings-heading:first-of-type { margin-top: 8px; padding-top: 0; border-top: 0; }

.settings-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
}

.settings-form label { margin-bottom: 18px; }
.settings-form .checkbox-row { margin-bottom: 6px; }

/* Formular zony - pridanie aj uprava */
.zone-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.zone-form label { margin-bottom: 12px; }
.zone-coords { display: flex; gap: 12px; flex-wrap: wrap; }
.zone-coords label { flex: 1 1 160px; margin-bottom: 8px; }
.zone-form .btn { margin-top: 6px; margin-right: 8px; }

.zone-add { margin-bottom: 18px; }
.zone-add > summary { cursor: pointer; list-style: none; }
.zone-add > summary::-webkit-details-marker { display: none; }

details > summary.link-btn { cursor: pointer; display: inline-block; }
details > summary.link-btn::-webkit-details-marker { display: none; }

/* Poloha ulozena k zaznamu dochadzky vo vykaze */
.geo-tag {
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
}
.geo-tag.geo-tag-out { color: #b45309; }
