:root {
  --accent: #006fff;
  --accent-soft: rgba(0, 111, 255, .12);
  --green: #2fbf58;
  --green-strong: #23a94a;
  --green-soft: rgba(47, 191, 88, .14);
  --red: #f0433f;
  --red-strong: #c0483c;
  --red-soft: rgba(240, 67, 63, .12);
  --bg-soft: transparent;
  --accent-text: #fff;
  --accent-fill: var(--accent);
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-2: 0 6px 18px -4px rgba(16, 24, 40, .16);
  --font: "IBM Plex Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Nadpisy obrazovek a karet nese Archivo – stejný rukopis jako úvodní stránka. */
  --display: "Archivo", "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  /* Šířka obsahu podle toho, co obrazovka ukazuje: data potřebují plochu,
     formuláře úzký sloupec, ať oko nepřebíhá přes celou obrazovku. */
  --sirka-data: 1360px;
  --sirka-text: 760px;
  --nav-h: 62px;
}

[data-theme="light"] {
  --bg: #f4f5f7;
  --bg-card: #ffffff;
  --bg-elev: #f8f9fb;
  --border: #e3e6ea;
  --border-strong: #d3d8de;
  --text: #21252b;
  --text-2: #6b7684;
  --text-3: #98a1ad;
  --accent-ink: #005ad6;
  --surface: #ffffff;
  --muted: #6b7684;
  color-scheme: light;
}

[data-theme="dark"] {
  --red-strong: #ff6b63;
  --bg-soft: rgba(255, 255, 255, .03);
  --bg: #101417;
  --bg-card: #1a2026;
  --bg-elev: #212930;
  --border: #2a323b;
  --border-strong: #38424d;
  --text: #eef1f4;
  --text-2: #9aa5b1;
  --text-3: #67717d;
  --accent: #2e8eff;
  --accent-soft: rgba(46, 142, 255, .16);
  --accent-ink: #6fb0ff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 10px 24px -6px rgba(0, 0, 0, .5);
  --surface: #212930;
  --muted: #9aa5b1;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
h4 { font-size: 14px; }
p { margin: 0; }
.muted { color: var(--text-2); font-size: 12.5px; }
.hidden { display: none !important; }

.ico { fill: currentColor; flex: none; }
.ico.dim { color: var(--text-3); }

/* ------------------------------ Tlačítka ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 13.5px var(--font);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  background: var(--bg-elev);
  transition: transform .12s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease, filter .18s ease;
  user-select: none;
}
.btn:hover { filter: brightness(1.04); box-shadow: var(--shadow-1); }
.btn:active { transform: scale(.97); }
/* Barva textu se dopočítává z akcentu (viz pouzijMotiv) – bílá na světlém
   akcentu dávala kontrast 2,4 : 1. Záloha #fff platí, než skript doběhne.
   Stejná dvojice --accent-fill/--accent-text patří na KAŽDOU plochu, kde na
   akcentu leží text: avatar, vybraný den v mini-kalendáři, bloky časové osy,
   měsíc v přehledu a značka volna. Jinak vypadá tlačítko jinak než zbytek. */
.btn.primary { background: var(--accent-fill, var(--accent)); color: var(--accent-text, #fff); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: var(--border-strong); }
.btn.ghost:hover { background: var(--bg-elev); }
.btn.danger-ghost { background: transparent; border-color: var(--border-strong); color: var(--red); }
.btn.danger-ghost:hover { background: var(--red-soft); border-color: var(--red); }
.btn.danger { background: var(--red); color: #fff; }
.btn.green { background: var(--green-strong); color: #fff; }
.btn.small { padding: 6px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; transform: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent; color: var(--text-2);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.icon-btn:hover { background: var(--bg-elev); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .day:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------ Formuláře ----------------------------- */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
/* Jen přímý potomek – vnořené .check-row si nechávají vlastní písmo. */
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  font: 400 14px var(--font);
  color: var(--text);
  /* background-color, ne zkratka background: ta by selectu smazala šipku,
     kterou kreslí pravidlo `select` níž přes background-image. */
  background-color: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .2s ease;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 64px; }
/* Místo pro šipku – zkratka padding výš by ji jinak posadila na text. */
.field select { padding-right: 30px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--red); font-size: 12.5px; margin: -4px 0 10px; }

/* ------------------------------ Přihlášení ---------------------------- */

.auth-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; gap: 18px;
}
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-2);
  padding: 28px 26px 24px;
  animation: rise var(--dur-in) cubic-bezier(.2, .9, .3, 1) both;
}
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo h1 { font-size: 22px; margin-top: 10px; }
.auth-foot { font-size: 12px; }

/* ------------------------------ Layout -------------------------------- */

.app { display: flex; min-height: 100dvh; }

.sidebar {
  width: 218px; flex: none;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh;
  transition: background-color .25s ease, border-color .25s ease;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px; letter-spacing: -.01em;
  padding: 18px 18px 14px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: none; background: transparent;
  color: var(--text-2);
  font: 500 13.5px var(--font);
  cursor: pointer; text-align: left;
  transition: background-color .15s ease, color .15s ease;
  position: relative;
}
.nav-item:hover { background: var(--bg-elev); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--accent);
}
.side-foot { padding: 10px; border-top: 1px solid var(--border); }
.side-user {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text); font: 500 13px var(--font);
  transition: background-color .15s ease;
}
.side-user:hover { background: var(--bg-elev); }
.side-user-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-fill, var(--accent)); color: var(--accent-text, #fff);
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 12px var(--font); flex: none;
}

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
  transition: background-color .25s ease, border-color .25s ease;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.running-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green-soft); color: var(--green-strong);
  border: 1px solid transparent; border-radius: 999px;
  padding: 6px 13px; cursor: pointer;
  font: 600 12.5px var(--mono);
  transition: filter .15s ease, transform .12s ease;
}
[data-theme="dark"] .running-pill { color: #58d97e; }
.running-pill:hover { filter: brightness(1.06); }
.running-pill:active { transform: scale(.96); }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 191, 88, .5); }
  70% { box-shadow: 0 0 0 8px rgba(47, 191, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 191, 88, 0); }
}

[data-theme="light"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: none; }

.content {
  flex: 1;
  width: 100%; max-width: 980px;
  margin: 0 auto;
  padding: 20px 22px calc(var(--nav-h) + 26px);
}
/* Data chtějí šířku, formuláře klid. Přepíná se podle otevřené obrazovky,
   takže Nastavení zůstává úzké i na velkém monitoru. */
body.rozlozeni-data .content { max-width: var(--sirka-data); }
body.rozlozeni-text .content { max-width: var(--sirka-text); }

h1, h2, h3, h4, .card-head h4, .stat-value { font-family: var(--display); letter-spacing: -.02em; }
/* Číslo, které se porovnává nebo mění, patří do neproporcionálního písma –
   jinak při každé sekundě poskočí a ve sloupci se nezarovná. */
.cislo, .stat-value, .entry-nums .n1, .entry-nums .n2, .day-total b, .time-chip,
.breakdown-row .amount, .sheet td.num, .sheet th.num, .tl-tick b, .price .amt {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

.view { display: none; }
.view.active {
  display: block;
  animation-name: var(--prechod-jmeno);
  animation-duration: var(--prechod-dur);
  animation-timing-function: var(--prechod-ease);
  animation-fill-mode: both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------ Karty --------------------------------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 16px;
  margin-bottom: 14px;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .2s ease, transform .2s ease;
}
.card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; flex-wrap: wrap;
}

/* ------------------------------ Přehled ------------------------------- */

.month-nav {
  display: flex; align-items: center; gap: 6px;
  margin: 0;
}
.month-nav h3 { min-width: 150px; text-align: center; text-transform: capitalize; font: 700 19px var(--display); letter-spacing: -.02em; }
.lista-obrazovky .month-nav { margin: 0; }
.month-nav.inline { margin: 0; justify-content: flex-start; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-bottom: 14px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px 16px;
  transition: transform .18s ease, box-shadow .18s ease, background-color .25s ease, border-color .25s ease;
  animation: rise var(--dur-in) ease both;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stat .stat-label { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.stat .stat-value { font: 500 28px/1.2 var(--mono); letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .stat-value small { font: 500 14px var(--font); color: var(--text-3); margin-left: 1px; }
.stat.highlight .stat-value small { color: inherit; opacity: .7; }
.stat .stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.stat.highlight { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.stat.highlight .stat-value { color: var(--accent-ink); }

.chart-card { padding-bottom: 10px; }
.bar-chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 120px; padding-top: 6px;
}
.bar {
  flex: 1; min-width: 0;
  background: var(--accent);
  opacity: .85;
  border-radius: 3px 3px 0 0;
  position: relative;
  transform-origin: bottom;
  animation: growBar calc(var(--dur-in) * 1.6) cubic-bezier(.2, .8, .3, 1) both;
  transition: opacity .15s ease;
}
.bar:hover { opacity: 1; }
.bar.empty { background: var(--border); opacity: .6; height: 3px !important; animation: none; }
.bar.weekend:not(.empty) { background: var(--green); }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 2px; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.breakdown-row:last-child { border-bottom: none; font-weight: 700; font-size: 14.5px; }
.breakdown-row .amount { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---- Lišta obrazovky: pohyb v čase vlevo, akce vpravo ----
   Jedna komponenta pro Můj den, Přehled i Tým – dřív měla každá obrazovka
   vlastní podobu a paměť prstů si nemohla zvyknout. */
.lista-obrazovky {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 16px;
}
.lista-obrazovky .vpravo { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lista-obrazovky .souhrn {
  font: 500 12.5px var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; background: var(--bg-card);
}

/* ------------------------------ Můj den ------------------------------- */

.day-nav {
  display: flex; align-items: center; gap: 6px;
  padding: 0; background: transparent; border: 0; box-shadow: none; margin: 0;
}
.day-label {
  position: relative;
  border: none; background: transparent; cursor: pointer;
  font: 700 19px var(--display); letter-spacing: -.02em; color: var(--text);
  padding: 6px 10px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background-color .15s ease;
}
.day-label:hover { background: var(--bg-elev); }
.day-label input[type="date"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ---- Časovač jako panel ----
   Velký čas v neproporcionálním písmu, zákazník a popis rovnou v panelu,
   jedno zelené tlačítko. Lesklá koule s kroužícím obloukem je pryč – nic
   neměřila a byla to nejstarší věc na nejpoužívanější obrazovce. */
.timer-stage { padding: 16px 18px 18px; }
.timer-idle, .timer-running { display: flex; flex-direction: column; gap: 10px; animation: rise var(--dur-in) ease both; }
.timer-hlava { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.timer-stav {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 11px var(--mono); letter-spacing: .12em; color: var(--text-3);
}
.timer-stav.bezi { color: var(--green-strong); }
[data-theme="dark"] .timer-stav.bezi { color: #58d97e; }
.timer-od { font: 500 12px var(--mono); color: var(--text-3); font-variant-numeric: tabular-nums; }
.timer-cas {
  font: 500 clamp(40px, 6vw, 52px)/1 var(--mono); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; margin: 2px 0 4px;
}
.timer-cas.klid { color: var(--text-3); }
.timer-pole { display: flex; flex-direction: column; gap: 4px; }
.mini-label { font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.timer-pole input {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  font: 500 14.5px var(--font); outline: none;
}
.timer-pole input:focus { border-color: var(--accent); box-shadow: var(--glow); }
.timer-meta .cust { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.timer-meta .desc { color: var(--text-2); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.timer-btns { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.timer-btns .btn { flex: 1 1 auto; min-width: 120px; justify-content: center; }
.timer-btns > .btn.block { flex: 1 0 100%; width: 100%; min-width: 0; }

/* Nahoře vlevo se zapisuje, vpravo se dívá – seznam záznamů se tím dostane
   nad okraj obrazovky i na notebooku. Pod 1100 px zůstává vše pod sebou. */
.den-mrizka { display: grid; gap: 14px; align-items: start; }
@media (min-width: 1100px) {
  .den-mrizka { grid-template-columns: minmax(320px, 400px) 1fr; }
  .den-vlevo, .den-vpravo { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
  .den-mrizka .card, .den-mrizka .timeline { margin-bottom: 0; }
}
.quick-actions { display: flex; gap: 8px; margin: 0 0 4px; flex-wrap: wrap; }
.quick-actions .btn { flex: 1; min-width: 140px; }

.entry-list { display: flex; flex-direction: column; gap: 8px; }
.entry {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  box-shadow: var(--shadow-1);
  animation: rise .3s ease both;
  transition: border-color .15s ease, transform .15s ease, background-color .25s ease;
}
.entry:hover { border-color: var(--border-strong); }
.entry-ico {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.entry-ico.work { background: var(--accent-soft); color: var(--accent-ink); }
.entry-ico.km { background: var(--green-soft); color: var(--green-strong); }
.entry-main { flex: 1; min-width: 0; }
.entry-main .t1 { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-main .t2 { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-nums { text-align: right; flex: none; }
.entry-nums .n1 { font: 600 14px var(--font); font-variant-numeric: tabular-nums; }
.entry-nums .n2 { color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.entry-actions { display: flex; gap: 2px; flex: none; }
.entry-actions .icon-btn { width: 32px; height: 32px; }
.entry-actions .icon-btn:hover { color: var(--accent-ink); }
.entry-actions .icon-btn.del:hover { color: var(--red); background: var(--red-soft); }

.day-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; margin-top: 4px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--text-2); font-size: 13px;
}
.day-total b { color: var(--text); font-variant-numeric: tabular-nums; }

.empty-state {
  text-align: center; color: var(--text-2);
  padding: 26px 12px; font-size: 13px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}

/* ------------------------------ Kalendář ------------------------------ */

.cal-card { padding: 14px; }
/* minmax(0,1fr): bez toho má stopa spodní hranici na min-content obsahu
   buňky a mřížka se na mobilu roztáhne přes šířku obrazovky. */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head-row { margin-bottom: 8px; }
.cal-head-row span {
  text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .06em;
}
.day {
  aspect-ratio: 1 / .92;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font: 500 13.5px var(--font); color: var(--text);
  transition: background-color .15s ease, border-color .15s ease, transform .12s ease;
  position: relative;
}
.day:hover { background: var(--bg-elev); }
.day:active { transform: scale(.93); }
.day.other { color: var(--text-3); }
.day.today { border-color: var(--accent); font-weight: 700; color: var(--accent-ink); }
.day .dot {
  width: 6.5px; height: 6.5px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.day .dot.none { background: transparent; box-shadow: none; }
.day .mini { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; position: absolute; bottom: 5px; }
.cal-legend { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 12px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }

/* ------------------------------ Export -------------------------------- */


/* --------------------------- Export builder --------------------------- */
.export-builder { display: block; }
.export-builder-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.export-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.export-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); }
.export-checks .check-row { margin: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; }
.card, .view, .main, .content { min-width: 0; }
.autocomplete-wrap { position: relative; }
.autocomplete-menu { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); padding: 5px; }
.autocomplete-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--accent-soft); }
.autocomplete-item small { color: var(--text-2); font-size: 11px; }
.autocomplete-empty { padding: 10px; color: var(--text-2); font-size: 12px; }
@media (max-width: 900px) { .export-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); } .export-builder-head { flex-direction: column; align-items: stretch; } }
@media (max-width: 620px) { .export-grid { grid-template-columns: 1fr; } .export-checks { flex-direction: column; } }

.export-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.inline-field { margin: 0; min-width: 170px; }
.export-btns { display: flex; gap: 8px; margin-left: auto; }

.table-card { padding: 0; overflow: hidden; }
.table-card .card-head { padding: 14px 16px 0; }
.sheet { width: 100%; border-collapse: collapse; font-size: 13px; }
.sheet th, .sheet td {
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.sheet th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-2); background: var(--bg-elev);
  position: sticky; top: 0;
}
.sheet td.num, .sheet th.num { text-align: right; }
.sheet tr.sum td { font-weight: 700; border-top: 2px solid var(--border-strong); background: var(--bg-elev); }
.sheet tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
.sheet tr.sum:hover td { background: var(--bg-elev); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 9px 10px; text-align: left; font-variant-numeric: tabular-nums; }
.data-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.data-table td.num, .data-table th.num { text-align: right; }
.data-table tr.click { cursor: pointer; transition: background-color .12s ease; }
.data-table tr.click:hover { background: var(--bg-elev); }
.data-table tr.total td { font-weight: 700; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.badge.admin { background: var(--accent-soft); color: var(--accent-ink); }
.badge.off { background: var(--red-soft); color: var(--red); }
.badge.run { background: var(--green-soft); color: var(--green-strong); }
[data-theme="dark"] .badge.run { color: #58d97e; }

/* ------------------------------ Nastavení ----------------------------- */

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.settings-grid .card { margin-bottom: 0; }

/* ------------------------------ Modal --------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 14, 18, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn calc(var(--dur-in) * .6) ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-2);
  animation: modalIn calc(var(--dur-in) * .9) cubic-bezier(.2, .9, .3, 1.2) both;
  max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px 0;
}
.modal-body { padding: 14px 18px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; margin-top: 4px; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

/* ------------------------------ Toast --------------------------------- */

.toast {
  pointer-events: none;
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%);
  z-index: 80;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-2);
  animation: toastIn var(--dur-in) cubic-bezier(.2, .9, .3, 1.2) both;
  max-width: min(92vw, 480px); text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------ Bottom nav ---------------------------- */

.bottom-nav { display: none; }
.only-mobile { display: none; }

@media (max-width: 820px) {
  .sidebar { display: none; }
  .only-mobile { display: inline-flex; }
  .content { padding: 16px 14px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 22px); }
  .topbar { padding: 10px 14px; }

  /* Pruh s hlavní akcí drží nad navigací – palec ho má vždy pod sebou. */
  .mobilni-pruh {
    display: block;
    position: fixed; left: 0; right: 0; z-index: 41;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding: 8px 12px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
  }
  .mobilni-pruh.hidden { display: none; }
  .mobilni-pruh .btn { width: 100%; justify-content: center; min-height: 48px; font-size: 15px; gap: 10px; }
  .mobilni-pruh .cislo { margin-left: auto; font-size: 14px; opacity: .9; }
  body.ma-pruh .content { padding-bottom: calc(var(--nav-h) + 78px + env(safe-area-inset-bottom, 0px)); }

  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--bg-card) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav { overflow-x: auto; scrollbar-width: none; }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bnav-item {
    flex: 0 0 auto; min-width: 62px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    border: none; background: transparent;
    color: var(--text-3);
    font: 600 10px var(--font);
    padding: 6px 2px;
    border-radius: 10px;
    cursor: pointer;
    transition: color .15s ease, transform .12s ease;
  }
  .bnav-item:active { transform: scale(.9); }
  .bnav-item.active { color: var(--accent-ink); }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .export-controls { flex-direction: column; align-items: stretch; }
  .export-btns { margin-left: 0; }
  .export-btns .btn { flex: 1; }
  .month-nav.inline { justify-content: center; }
  /* Lišta obrazovky se na telefonu nesmí lámat do tří řádků – šipky ke krajům,
     datum doprostřed, souhrn pod ně jen když je co ukázat. */
  .lista-obrazovky { flex-wrap: nowrap; gap: 4px; margin-bottom: 12px; }
  .lista-obrazovky .day-nav, .lista-obrazovky .month-nav { flex: 1; justify-content: space-between; min-width: 0; }
  .lista-obrazovky .day-label { font-size: 15.5px; padding: 6px 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lista-obrazovky .month-nav h3 { min-width: 0; font-size: 16px; }
  .lista-obrazovky > .btn.small { padding: 6px 10px; flex: 0 0 auto; }
  .lista-obrazovky .vpravo { flex: 0 0 auto; margin-left: 2px; }
  .lista-obrazovky .souhrn { padding: 5px 9px; font-size: 11.5px; }
  .day .mini { display: none; }
  /* Na telefonu se seznam záznamů musí vejít nad okraj: časovač je kompaktní,
     druhé akce jsou ikony vedle rychlého zápisu a osa dne je až pod seznamem. */
  .timer-stage { padding: 10px 14px 12px; }
  .timer-idle, .timer-running { gap: 7px; }
  .timer-cas { font-size: 34px; margin: 0; }
  .timer-pole { gap: 2px; }
  .timer-pole input { padding: 8px 11px; font-size: 14px; }
  .mini-label { font-size: 10px; }
  .timer-btns { margin-top: 2px; }
  .pichacka { padding: 9px 12px; }
  .quick-add { padding: 9px 12px; }
  .quick-add-preview { min-height: 0; margin-top: 3px; }
  .quick-actions { margin: 7px 0 0; gap: 6px; }
  .quick-actions .btn { flex: 1; min-width: 0; padding: 8px 6px; font-size: 12.5px; }
  /* Karty jdou do jedné řady, aby šlo pořadí určit podle důležitosti:
     časovač, zápis, záznamy – a teprve pak píchačka a osa dne. */
  .den-vlevo, .den-vpravo { display: contents; }
  .den-mrizka { display: flex; flex-direction: column; gap: 10px; }
  .den-mrizka > * { margin-bottom: 0; }
  #timerStage { order: 1; }
  #pozvankaPrace { order: 2; }
  .quick-add { order: 3; }
  #dayTools { order: 4; }
  #dayList { order: 5; }
  #pichackaCard { order: 6; }
  #dayTimeline { order: 7; }
  /* Filtry dne zabíraly na telefonu 135 px před seznamem – jeden řádek stačí. */
  .day-tools { gap: 6px; padding: 8px 10px; align-items: center; }
  .day-tools .day-tool { flex: 1 1 110px; }
  .day-tools .day-tool label { display: none; }
  .day-tools select { padding: 7px 9px; font-size: 12.5px; min-height: 36px; }
  .day-tools .sort-toggle { padding: 7px 9px; font-size: 12.5px; }
  .sheet { font-size: 12px; }
  .sheet th, .sheet td { padding: 7px 8px; }
  /* Akce zůstávají v řádku; když se s textem nevejdou, spadnou pod něj.
     Sloupec tří tlačítek dělal z řádku 134 px – tři záznamy na obrazovku. */
  .entry { flex-wrap: wrap; }
  .entry-main { flex: 1 1 150px; }
  .entry-actions { flex-direction: row; margin-left: auto; }
}

@media (min-width: 821px) {
  .mobilni-pruh { display: none !important; }
  .toast { bottom: 26px; }
  .content { padding-bottom: 30px; }
  #teamShortcut { display: none; }
}

/* --------------------------- Reduced motion --------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    /* Viz poznámka u „klidne": zkrácení na .01ms nechá prvek na prvním
       snímku, takže by se karta s příchodem z opacity 0 vůbec neukázala. */
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

.lang-select {
  height: 34px;
  min-width: 54px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
}
.check-row input { margin-top: 2px; }
@media (max-width: 650px) {
  .permission-grid { grid-template-columns: 1fr; }
}


/* v1.2 modules */
.inline-actions { display:flex; gap:8px; align-items:center; }
.compact-input { min-width: 200px; padding:8px 10px; border:1px solid var(--border); border-radius:9px; background:var(--bg-elev); color:var(--text); }
.task-list { display:flex; flex-direction:column; gap:9px; }
.task-item { display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--bg-elev); }
.task-item.done { opacity:.65; }
.task-title { font-weight:650; }
.task-meta { display:flex; flex-wrap:wrap; gap:7px; margin-top:4px; color:var(--text-2); font-size:12px; }
.task-priority-high { color: var(--red); }
.task-priority-low { color: var(--text-3); }
.att-stage { display:flex; gap:16px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.att-clock { font-size:32px; font-variant-numeric:tabular-nums; font-weight:700; }
.status-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; }
.status-person { padding:11px 12px; border:1px solid var(--border); border-radius:12px; background:var(--bg-elev); }
.status-person .name { font-weight:600; }
.status-person .state { margin-top:3px; font-size:12px; color:var(--text-2); }
.audit-action { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:11px; }
@media (max-width: 680px) { .task-item { grid-template-columns:auto 1fr; } .task-item .task-actions { grid-column:1 / -1; justify-self:end; } .compact-input { width:100%; min-width:0; } }

/* ---- 1.6: časová posloupnost, nástroje dne, mini kalendář, zabezpečení ---- */

.day-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px;
}
.day-tools .day-tool { flex: 1 1 150px; min-width: 0; margin: 0; }
.day-tools .day-tool label { font-size: 12px; }
.day-tools .btn { flex: 0 0 auto; }

.time-chip {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  font-variant-numeric: tabular-nums; padding: 1px 6px; margin-right: 2px;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent);
}

.mini-cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mini-cal-grid .mc-day {
  position: relative; aspect-ratio: 1 / 1; display: flex;
  align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--bg-soft, transparent); color: var(--text);
  font-size: 14px; cursor: pointer;
}
.mini-cal-grid .mc-day:hover { border-color: var(--accent); }
.mini-cal-grid .mc-day.has::after {
  content: ''; position: absolute; bottom: 5px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--accent);
}
.mini-cal-grid .mc-day.today { border-color: var(--border-strong, var(--border)); font-weight: 700; }
.mini-cal-grid .mc-day.sel { background: var(--accent-fill, var(--accent)); color: var(--accent-text, #fff); }
.mini-cal-grid .mc-day.sel::after { background: var(--accent-text, #fff); }

#sessionList .entry { cursor: default; }

/* ========================================================================
   1.7: pohybová vrstva — jemné pružiny (Apple) a přesné odezvy (Ubiquiti)
   Animuje se jen transform / opacity / stín, aby to bylo plynulé i na mobilu.
   ======================================================================== */

:root {
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);   /* lehký přesah, „pružina" */
  --ease-out:    cubic-bezier(.22, .9, .3, 1);      /* rychlý start, měkký dojezd */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-1: .14s;   /* dotek, stisk */
  --dur-2: .24s;   /* běžný přechod */
  --dur-3: .38s;   /* příchod prvku */
  --dur-in: .3s;   /* naskočení karty, seznamu, okna */
  /* Přechod mezi sekcemi. Povaha se mění podle volby pohybu, proto je to
     proměnná – jinak by nastavení měnilo jen hovery a přepnutí stránky
     by vypadalo pořád stejně. */
  --prechod-jmeno: viewIn;
  --prechod-dur: .28s;
  --prechod-ease: cubic-bezier(.2, .8, .3, 1);
  --glow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ---- Tlačítka: stisk se propíše okamžitě, návrat pruží ---- */
.btn {
  transition:
    transform var(--dur-1) var(--ease-spring),
    box-shadow var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    filter var(--dur-2) var(--ease-out);
  will-change: transform;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.965); transition-duration: .06s; }
.btn.primary:hover { box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--accent) 55%, transparent); }
.btn.danger:hover,
.btn.danger-ghost:hover { box-shadow: 0 4px 16px -6px color-mix(in srgb, var(--red) 45%, transparent); }
.btn:disabled { transform: none !important; box-shadow: none; }

.icon-btn { transition: transform var(--dur-1) var(--ease-spring), background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
.icon-btn:hover  { transform: scale(1.12); }
.icon-btn:active { transform: scale(.9); transition-duration: .06s; }
.icon-btn.del:hover { color: var(--red); }

/* ---- Karty a dlaždice: zvednutí se stínem, ne skokem ---- */
.card, .stat {
  transition:
    transform var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    border-color var(--dur-2) var(--ease-out),
    background-color var(--dur-2) var(--ease-out);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

/* ---- Seznam záznamů: postupné vynoření, ať je vidět pořadí dne ---- */
.entry {
  animation: entryIn var(--dur-3) var(--ease-out) both;
  transition: transform var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.entry:hover { transform: translateX(3px); box-shadow: var(--shadow-1); }
@keyframes entryIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.entry-list .entry:nth-child(1) { animation-delay: .02s }
.entry-list .entry:nth-child(2) { animation-delay: .05s }
.entry-list .entry:nth-child(3) { animation-delay: .08s }
.entry-list .entry:nth-child(4) { animation-delay: .11s }
.entry-list .entry:nth-child(5) { animation-delay: .14s }
.entry-list .entry:nth-child(6) { animation-delay: .17s }
.entry-list .entry:nth-child(7) { animation-delay: .20s }
.entry-list .entry:nth-child(8) { animation-delay: .23s }
/* delší seznamy už nečekají, jinak by konec naskakoval pozdě */
.entry-list .entry:nth-child(n+9) { animation-delay: .25s }

/* Ikony u záznamu byly ztlumené na 55 % – ve světlém motivu skoro neviditelné
   a „spustit znovu" je přitom nejužitečnější akce dne. */
.entry-actions { opacity: 1; }
.entry-actions .icon-btn { color: var(--text-3); }
.entry-actions .icon-btn.play { color: var(--green-strong); background: var(--green-soft); }
[data-theme="dark"] .entry-actions .icon-btn.play { color: #58d97e; }
.entry-actions .icon-btn.play:hover { filter: brightness(1.08); color: var(--green-strong); }
.entry:hover .entry-actions,
.entry:focus-within .entry-actions { opacity: 1; }
@media (hover: none) { .entry-actions { opacity: 1; } }

/* ---- Časový štítek: dovnitř s lehkým nádechem ---- */
.time-chip {
  animation: chipIn var(--dur-2) var(--ease-spring) both;
  transition: background-color var(--dur-2) var(--ease-out);
}
@keyframes chipIn { from { opacity: 0; transform: scale(.86); } to { opacity: 1; transform: none; } }

/* ---- Navigace: aktivní pruh dojede, nepřeskočí ---- */
.nav-item { transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.nav-item:hover  { transform: translateX(2px); }
.nav-item:active { transform: translateX(2px) scale(.985); }
.nav-item::before { transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease-out); }
.nav-item:not(.active)::before { transform: scaleY(0); opacity: 0; }
.nav-item.active::before { transform: scaleY(1); opacity: 1; }
.nav-item .ico { transition: transform var(--dur-2) var(--ease-spring); }
.nav-item.active .ico { transform: scale(1.1); }

/* ---- Dialog: podklad se rozostří, okno přijede zdola s pružinou ---- */
.modal-backdrop {
  animation: backdropIn var(--dur-2) var(--ease-out) both;
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop .modal { animation: modalIn var(--dur-3) var(--ease-spring) both; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.965); }
  to   { opacity: 1; transform: none; }
}
.modal-backdrop.hidden { animation: none; }

/* ---- Hlášky: vyjedou zdola a zmizí bez upoutávání ---- */
.toast { animation: toastIn var(--dur-3) var(--ease-spring) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.hidden { animation: none; }

/* ---- Pole: prstenec kolem aktivního pole se rozsvítí ---- */
.field input, .field select, .field textarea {
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: var(--glow); }

/* ---- Kalendář: den se nadzvedne, vybraný dosedne s pružinou ---- */
.day, .mc-day {
  transition: transform var(--dur-1) var(--ease-spring), background-color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.day:hover, .mc-day:hover { transform: translateY(-2px) scale(1.06); }
.day:active, .mc-day:active { transform: scale(.92); transition-duration: .06s; }
.mc-day.sel { animation: pop var(--dur-3) var(--ease-spring) both; }
@keyframes pop { from { transform: scale(.8); } to { transform: none; } }
.mini-cal-grid .mc-day { animation: entryIn var(--dur-in) var(--ease-out) both; }
.mc-day::after { transition: transform var(--dur-2) var(--ease-spring); }

/* ---- Časovač: v klidu dýchá, za běhu svítí ---- */
.timer-idle .big-btn, #bigStartBtnStary {
  transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-3) var(--ease-out), filter var(--dur-2) var(--ease-out);
}
.timer-idle #bigStartBtn { animation: breathe 3.6s var(--ease-in-out) infinite; }
.timer-idle #bigStartBtn:hover { animation-play-state: paused; transform: scale(1.06); }
.timer-idle #bigStartBtn:active { transform: scale(.96); }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 40%, transparent); }
  50%      { box-shadow: 0 0 0 16px color-mix(in srgb, var(--green) 0%, transparent); }
}

/* ---- Lišta řazení a filtrů: přijede shora ---- */
.day-tools { animation: toolsIn var(--dur-3) var(--ease-out) both; }
@keyframes toolsIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- Běžící ukazatel: tep, ne blikání ---- */
.running-pill { transition: transform var(--dur-1) var(--ease-spring), filter var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.running-pill:hover { transform: scale(1.04); box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--green) 55%, transparent); }
.pulse-dot { animation: dot 1.8s var(--ease-in-out) infinite; }
@keyframes dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }

/* ---- Tabulky a našeptávač ---- */
.data-table tbody tr { transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.data-table tbody tr.click:hover { transform: translateX(2px); }
.autocomplete-menu { animation: menuIn var(--dur-2) var(--ease-out) both; transform-origin: top center; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.autocomplete-item { transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.autocomplete-item:hover, .autocomplete-item.active { transform: translateX(3px); }

/* ---- Přepínač vzhledu ---- */
.icon-btn#themeBtn:active { transform: rotate(-25deg) scale(.9); }

/* ---- Načítání: jemný přeliv místo prázdna ---- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--bg-elev); border-radius: var(--radius-sm); color: transparent !important;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 8%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---- Kdo si nepřeje pohyb, ten ho nedostane ---- */
@media (prefers-reduced-motion: reduce) {
  .entry, .time-chip, .modal-backdrop, .modal-backdrop .modal, .toast,
  .day-tools, .mini-cal-grid .mc-day, .mc-day.sel, .autocomplete-menu { animation: none !important; }
  .timer-idle #bigStartBtn, .pulse-dot, .skeleton::after { animation: none !important; }
  .btn:hover, .icon-btn:hover, .entry:hover, .nav-item:hover,
  .day:hover, .mc-day:hover, .stat:hover, .data-table tbody tr.click:hover { transform: none !important; }
}

/* Tlačítko „spustit znovu" u záznamu */
.icon-btn.play { color: var(--green-strong); }
.icon-btn.play:hover { background: var(--green-soft); transform: scale(1.15); }

/* Přepínač řazení dne — klik mění směr, šipka se otočí */
.sort-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-elev);
  color: var(--text); font: 600 13px var(--font); cursor: pointer;
  transition: transform var(--dur-1) var(--ease-spring),
              border-color var(--dur-2) var(--ease-out),
              background-color var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.sort-toggle:hover { border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.sort-toggle:active { transform: scale(.96); transition-duration: .06s; }
.sort-toggle .ico { opacity: .7; }
.sort-arrow {
  font-size: 15px; line-height: 1; color: var(--accent);
  transition: transform var(--dur-3) var(--ease-spring);
}
.sort-arrow.desc { transform: rotate(180deg); }

/* ---- Rychlý zápis jedním řádkem ---- */
.quick-add { padding: 12px 14px; margin-bottom: 12px; }
.quick-add-row { display: flex; align-items: center; gap: 10px; }
.quick-add-row .ico { opacity: .5; flex: 0 0 auto; }
.quick-add-row input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: 500 14.5px var(--font); padding: 6px 0; outline: none;
}
.quick-add-row input::placeholder { color: var(--text-3); }
.quick-add-preview {
  font-size: 12.5px; margin-top: 6px; min-height: 17px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.quick-add-preview.chyba { color: var(--red); }
.quick-add:focus-within { border-color: var(--accent); box-shadow: var(--glow); }

/* ---- Časová osa dne ---- */
.timeline { padding: 14px; margin-bottom: 12px; }
.tl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tl-head h4 { font: 600 14px var(--font); }
.tl-head .muted { font-size: 12px; }
.tl-track {
  position: relative; height: 40px; border-radius: var(--radius-sm);
  background: var(--bg-elev); overflow: hidden;
}
.tl-block {
  position: absolute; top: 4px; bottom: 4px; min-width: 3px;
  border: 0; border-radius: 6px; cursor: pointer; overflow: hidden;
  background: var(--accent-fill, var(--accent)); color: var(--accent-text, #fff);
  font: 600 11.5px var(--font); white-space: nowrap; text-overflow: ellipsis;
  padding: 0 7px; text-align: left;
  animation: tlIn var(--dur-in) var(--ease-out) both;
  transition: filter var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-spring);
}
.tl-block:hover { filter: brightness(1.12); transform: translateY(-1px); }
.tl-block:active { transform: scale(.98); }
@keyframes tlIn { from { opacity: 0; transform: scaleX(.6); } to { opacity: 1; transform: none; } }
.tl-gap {
  position: absolute; top: 4px; bottom: 4px;
  display: flex; align-items: center; justify-content: center;
  font: 600 10.5px var(--font); color: var(--text-3);
  background: repeating-linear-gradient(45deg, transparent, transparent 4px,
    color-mix(in srgb, var(--text) 7%, transparent) 4px, color-mix(in srgb, var(--text) 7%, transparent) 8px);
}
.tl-axis { position: relative; height: 16px; margin-top: 4px; }
.tl-tick { position: absolute; transform: translateX(-50%); text-align: center; }
.tl-tick i { display: block; width: 1px; height: 4px; background: var(--border-strong); margin: 0 auto; }
.tl-tick b { font: 500 10px var(--mono); color: var(--text-3); }
.entry.zvyraznen { border-color: var(--accent); box-shadow: var(--glow); }

/* ---- Nápověda ke zkratkám ---- */
.shortcut-list { display: flex; flex-direction: column; gap: 2px; }
.shortcut-row { display: flex; align-items: center; gap: 12px; padding: 7px 2px; }
.shortcut-row + .shortcut-row { border-top: 1px solid var(--border); }
.shortcut-row kbd {
  flex: 0 0 78px; text-align: center;
  font: 600 12px var(--mono); color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 6px; padding: 4px 6px;
}
.shortcut-row span { font-size: 13.5px; }

@media (max-width: 640px) {
  .tl-head { flex-direction: column; gap: 2px; }
  .shortcut-row kbd { flex-basis: 64px; }
}

/* Příplatky za víkend a svátky */
.bonus-chip {
  display: inline-block; font: 700 11px var(--font); letter-spacing: .01em;
  padding: 1px 7px; border-radius: 999px; margin-right: 2px;
  background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-strong);
}
.bonus-notice {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 14px; margin-bottom: 12px; font-size: 13px;
  border: 1px solid color-mix(in srgb, var(--green) 35%, var(--border));
  border-radius: var(--radius); background: var(--green-soft); color: var(--text);
  animation: entryIn var(--dur-3) var(--ease-out) both;
}

/* Atribut hidden musí přebít display z .field / .field-row */
[hidden] { display: none !important; }

/* Superadmin: zámek účtu a předvyplněná oprávnění */
.badge.lock { background: var(--red-soft); color: var(--red); }
.lock-row {
  align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 4px 0 12px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--border));
  border-radius: var(--radius-sm); background: var(--red-soft);
}
.permission-grid.zamlzeno { opacity: .5; pointer-events: none; }

/* Přetahování bezčasových záznamů */
.drag-handle {
  display: flex; align-items: center; justify-content: center;
  width: 22px; align-self: stretch; margin: -4px 0 -4px -6px;
  color: var(--text-3); cursor: grab; touch-action: none;
  border-radius: 6px; transition: color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.drag-handle:hover { color: var(--accent); background: var(--accent-soft); }
.entry.dragging {
  opacity: .92; transform: scale(1.015);
  box-shadow: var(--shadow-2); border-color: var(--accent);
  cursor: grabbing; z-index: 5; position: relative;
}
.entry.dragging .drag-handle { cursor: grabbing; }

/* ==================== Úvodní obrazovka: výběr kategorie =================== */

.auth-screen { position: relative; overflow: hidden; transition: background 1s var(--ease-in-out); }
/* jemné zabarvení pozadí podle zvolené kategorie */
body[data-auth-space="osvc"] .auth-screen {
  background: radial-gradient(120% 90% at 15% 50%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%);
}
body[data-auth-space="firma"] .auth-screen {
  background: radial-gradient(120% 90% at 15% 50%, color-mix(in srgb, var(--green) 13%, transparent), transparent 70%);
}

.auth-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise .4s var(--ease-out) both; }
.pick-hint { margin: 10px 0 14px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; max-width: 720px; }
.pick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  width: 210px; padding: 18px; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur-2) var(--ease-spring), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  animation: rise .45s var(--ease-out) both;
}
.pick-card:nth-child(2) { animation-delay: .06s } .pick-card:nth-child(3) { animation-delay: .12s }
.pick-card:nth-child(4) { animation-delay: .18s } .pick-card:nth-child(n+5) { animation-delay: .24s }
.pick-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-2); }
.pick-card:active { transform: scale(.97); }
.pick-ico {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.pick-ico.firm { background: var(--green-soft); color: var(--green-strong); }
.pick-name { font-weight: 700; font-size: 15.5px; }
.pick-sub { font-size: 12px; }

/* Krok 2: vlevo velký název kategorie, vpravo přihlášení */
.auth-stage {
  display: flex; align-items: center; justify-content: center; gap: 6vw;
  width: 100%; max-width: 1040px;
}
.stage-left { flex: 1; max-width: 440px; position: relative; padding: 20px 0; }
.stage-back { position: absolute; top: -34px; left: 0; }
.stage-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; opacity: .75; margin-bottom: 14px; }
.stage-title { font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 10px; overflow-wrap: anywhere; }
.stage-sub { font-size: 15px; }
.stage-right { width: 100%; max-width: 380px; }

/* přílet: název zleva, panel s formulářem „přeletí" doprava */
.auth-stage.stage-in .stage-left { animation: stageLeft .55s var(--ease-out) both; }
.auth-stage.stage-in .stage-right { animation: stageRight .6s var(--ease-spring) both; }
@keyframes stageLeft { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes stageRight { from { opacity: 0; transform: translateX(min(18vw, 160px)) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .auth-stage { flex-direction: column; gap: 18px; }
  .stage-left { text-align: center; max-width: none; padding-top: 26px; }
  .stage-back { position: static; margin-bottom: 8px; }
  .stage-brand { justify-content: center; }
  .stage-title { font-size: 30px; }
  .auth-stage.stage-in .stage-right { animation-name: stageLeft; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-pick, .pick-card, .auth-stage.stage-in .stage-left, .auth-stage.stage-in .stage-right { animation: none !important; }
}

/* Podokno nahlédnutí a správa prostorů */
/* Šířku řídí okno, ne obsah – min-width uvnitř úzkého modálu dělal posuvník. */
.modal.siroky { max-width: min(760px, 94vw); }
.peek-body { min-width: 0; }
.peek-meta { font-size: 12.5px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---- Úvodní obrazovka: značka, pozadí, hravé detaily ---- */

.auth-brand {
  position: absolute; top: 22px; left: 26px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 19px; letter-spacing: -.01em;
  animation: brandIn .6s var(--ease-spring) both;
}
.auth-brand small { font-weight: 500; font-size: 12px; margin-left: 4px; }
@media (max-width: 600px) { .auth-brand small { display: none; } }
@keyframes brandIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.auth-brand .ico { animation: brandTick 6s var(--ease-in-out) infinite; transform-origin: 50% 55%; }
@keyframes brandTick { 0%, 88%, 100% { transform: rotate(0); } 92% { transform: rotate(-8deg); } 96% { transform: rotate(6deg); } }

/* plovoucí barevné skvrny na pozadí */
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45;
  will-change: transform;
}
.b1 { width: 46vmax; height: 46vmax; left: -14vmax; top: -16vmax;
  background: color-mix(in srgb, var(--accent) 26%, transparent); animation: drift1 21s ease-in-out infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; right: -12vmax; bottom: -14vmax;
  background: color-mix(in srgb, var(--green) 22%, transparent); animation: drift2 26s ease-in-out infinite alternate; }
.b3 { width: 22vmax; height: 22vmax; right: 18vmax; top: -10vmax;
  background: color-mix(in srgb, var(--accent) 14%, transparent); animation: drift3 17s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(9vmax, 7vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vmax, -6vmax) scale(1.08); } }
@keyframes drift3 { to { transform: translate(-6vmax, 8vmax) scale(.92); } }
/* po výběru kategorie se skvrny přebarví */
body[data-auth-space="osvc"] .b2 { background: color-mix(in srgb, var(--accent) 24%, transparent); }
body[data-auth-space="firma"] .b1 { background: color-mix(in srgb, var(--green) 26%, transparent); }

.pick-title { font-size: clamp(26px, 4vw, 40px); letter-spacing: -.02em; margin: 0 0 26px; text-align: center; }
.auth-pick, .auth-stage { position: relative; z-index: 1; }

/* lesk přes kartu při najetí */
.pick-card { position: relative; overflow: hidden; }
.pick-card::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-130%) skewX(-18deg);
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--text) 9%, transparent) 50%, transparent 70%);
}
.pick-card:hover::after { animation: shine .8s var(--ease-out); }
@keyframes shine { to { transform: translateX(130%) skewX(-18deg); } }

/* písmena názvu kategorie naskakují zdola */
.stage-title .tl { display: inline-block; animation: letterIn .5s var(--ease-spring) both; }
@keyframes letterIn { from { opacity: 0; transform: translateY(24px) rotate(3deg); } to { opacity: 1; transform: none; } }

/* pole formuláře přijdou kaskádou za panelem */
.auth-stage.stage-in .auth-card .field,
.auth-stage.stage-in .auth-card .btn { animation: rise .45s var(--ease-out) both; }
.auth-stage.stage-in .auth-card .field:nth-child(1) { animation-delay: .18s }
.auth-stage.stage-in .auth-card .field:nth-child(2) { animation-delay: .24s }
.auth-stage.stage-in .auth-card .field:nth-child(3) { animation-delay: .30s }
.auth-stage.stage-in .auth-card .field:nth-child(4) { animation-delay: .36s }
.auth-stage.stage-in .auth-card .btn { animation-delay: .42s }

@media (prefers-reduced-motion: reduce) {
  .auth-brand, .auth-brand .ico, .blob, .pick-card::after, .stage-title .tl,
  .auth-stage.stage-in .auth-card .field, .auth-stage.stage-in .auth-card .btn { animation: none !important; }
}

/* ===================== Nastavení: kategorie v záložkách ==================== */

.set-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.set-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  font: 600 13.5px var(--font);
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-spring);
}
.set-tab:hover { background: var(--bg-elev); color: var(--text); }
.set-tab:active { transform: scale(.97); }
.set-tab.active { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.set-tab .ico { opacity: .8; }

.set-panel { display: none; }
.set-panel.active {
  display: block;
  animation-name: var(--prechod-jmeno);
  animation-duration: var(--prechod-dur);
  animation-timing-function: var(--prechod-ease);
  animation-fill-mode: both;
}
/* jedna karta = jedna věc, konzistentní šířka, žádné díry v mřížce */
.set-panel > .card { max-width: 680px; margin-bottom: 14px; }
.settings-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; max-width: 680px; }
.settings-cols > .card { margin-bottom: 0; }
.card-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.hint { font-size: 12.5px; line-height: 1.45; margin: 6px 0 0; }

/* výběr motivu */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.theme-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px; cursor: pointer; font: 600 12.5px var(--font); color: var(--text);
  background: var(--bg-elev); border: 2px solid transparent; border-radius: var(--radius-sm);
  transition: transform var(--dur-2) var(--ease-spring), border-color var(--dur-2) var(--ease-out);
}
.theme-card:hover:not(:disabled) { transform: translateY(-3px); }
.theme-card:disabled { opacity: .5; cursor: default; }
.theme-card.sel { border-color: var(--accent); }
.theme-preview { width: 100%; height: 46px; border-radius: 8px; box-shadow: var(--shadow-1); }

/* jazyk na úvodní obrazovce */
.auth-lang { position: absolute; top: 20px; right: 24px; z-index: 3; }

/* barvy pozadí podle motivu prostoru */
:root { --theme-a: #006fff; --theme-b: #00c2ff; }
.auth-screen .blob { opacity: .62; }
.auth-screen .b1 { background: color-mix(in srgb, var(--theme-a) 62%, transparent); }
.auth-screen .b2 { background: color-mix(in srgb, var(--theme-b) 55%, transparent); }
.auth-screen .b3 { background: color-mix(in srgb, var(--theme-a) 38%, transparent); }
/* v tmavém režimu stačí míň, jinak by to zářilo */
[data-theme="dark"] .auth-screen .blob { opacity: .40; }
body[data-auth-space] .auth-screen {
  background: radial-gradient(130% 100% at 12% 45%, color-mix(in srgb, var(--theme-a) 22%, transparent), transparent 72%);
}

/* Odhlášení v horní liště */
.icon-btn.danger { color: var(--text-2); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); }

/* Odkazová tlačítka na přihlašovací obrazovce */
.link-btn {
  display: block; width: 100%; margin-top: 12px; padding: 4px;
  background: none; border: 0; cursor: pointer;
  color: var(--text-2); font: 500 13px var(--font); text-align: center;
  transition: color var(--dur-2) var(--ease-out);
}
.link-btn:hover { color: var(--accent-ink); text-decoration: underline; }
.form-note {
  margin: 10px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.45;
  border-radius: var(--radius-sm); background: var(--green-soft); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--green) 30%, transparent);
}

/* Skupiny duplicitních zákazníků */
.dupe-group { margin-bottom: 12px; padding: 12px 14px; }
.dupe-group .card-head { margin-bottom: 8px; }
.dupe-group .check-row { padding: 6px 0; }
.dupe-group .btn { margin-top: 8px; }

/* Skenování čárového kódu */
.scan-box { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4/3; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-line {
  position: absolute; left: 8%; right: 8%; top: 50%; height: 2px;
  background: var(--red); box-shadow: 0 0 10px var(--red); animation: scanSweep 2s var(--ease-in-out) infinite;
}
@keyframes scanSweep { 0%,100% { top: 25%; } 50% { top: 75%; } }

/* Předplatné */
.sub-warn { padding: 11px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); font-size: 14px;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.sub-warn.danger { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.sub-toggle { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 14px; cursor: pointer; }
.tiers-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tier-mini { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); }
.tier-mini.sel { border-color: var(--accent); }
.tier-mini h4 { font-size: 15px; margin-bottom: 6px; }
.tier-price { font-size: 20px; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.tier-price .muted { font-size: 12.5px; font-weight: 400; }

/* -------------------------------- Pomoc ---------------------------------- */
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-step { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); }
.guide-step.done { opacity: .68; }
.guide-step.done .guide-text strong { text-decoration: line-through; }
.guide-mark { flex: 0 0 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); font-variant-numeric: tabular-nums; }
.guide-step.done .guide-mark { background: var(--green-soft); color: var(--green-strong); }
.guide-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.guide-text .muted { font-size: 13px; }
.btn.btn-sm { padding: 6px 12px; font-size: 13px; }
.help-topic { border-bottom: 1px solid var(--border); }
.help-topic:last-child { border-bottom: 0; }
.help-topic summary { cursor: pointer; padding: 11px 2px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.help-topic summary::before { content: '▸'; font-size: 11px; color: var(--muted); transition: transform var(--dur-2, .2s) var(--ease-out, ease); }
.help-topic[open] summary::before { transform: rotate(90deg); }
.help-topic summary::-webkit-details-marker { display: none; }
.help-body { padding: 0 2px 14px 21px; color: var(--muted); font-size: 13.5px; line-height: 1.55; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.support-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.support-row .ico { color: var(--muted); flex: 0 0 auto; }
#supportForm { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.view.guide-flash { animation: guideFlash 1.6s var(--ease-out, ease); }
@keyframes guideFlash {
  0%, 100% { box-shadow: none; }
  25% { box-shadow: inset 0 0 0 2px var(--accent), 0 0 24px var(--accent-soft); border-radius: var(--radius); }
}
@media (prefers-reduced-motion: reduce) { .view.guide-flash { animation: none; } }

/* --------------------- hledání v zakázkách a nápovědy polí ---------------- */
.search-input {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text); font: 400 14px var(--font); min-width: 210px;
}
.search-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
@media (max-width: 560px) { .search-input { min-width: 0; flex: 1 1 100%; } }
.field-hint { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }

/* ------------------------- ruční položky na faktuře ----------------------- */
.extra-items { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.extra-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 14.5px; }
.extra-row { display: grid; grid-template-columns: 1fr 92px 76px 116px auto; gap: 8px; align-items: center; margin-top: 10px; }
.extra-row input { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--text); font: 400 14px var(--font); min-width: 0; }
.extra-row input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.invoice-item-row { align-items: end; }
.invoice-item-row label { display: grid; gap: 6px; min-width: 0; }
.invoice-item-row label span { color: var(--muted); font-size: 12px; }
.invoice-item-row input { width: 100%; box-sizing: border-box; }
@media (max-width: 620px) {
  /* Pět dětí do tří sloupců nešlo: `auto` pro křížek dostalo pole Cena.
     Název přes celý řádek, pod ním množství, jednotka, cena a křížek. */
  .extra-row { grid-template-columns: 1fr 1fr 1fr auto; }
  .extra-row .ei-name { grid-column: 1 / -1; }
  .invoice-item-row .invoice-item-name { grid-column: 1 / -1; }
}

/* Značka je odkaz na úvodní stránku – nesmí ale vypadat jako odkaz. */
a.side-brand, a.auth-brand { color: inherit; text-decoration: none; }
a.side-brand:hover, a.auth-brand:hover { opacity: .8; }
a.side-brand:focus-visible, a.auth-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* Pomoc má vlastní tlačítko dole v postranním panelu, nad jménem. */
.side-help {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; margin-bottom: 8px;
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--muted); font: 500 14.5px var(--font); text-align: left; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.side-help:hover { background: var(--bg-elev); color: var(--text); }
.side-help.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-help:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ------------------ vlastní rozbalovací seznam (místo <select>) ----------- */
/* Nativní select si na Windows kreslí systém a názvy skupin v něm nejsou
   v tmavém motivu vidět. Tenhle vypadá všude stejně. */
.picker { position: relative; }
.picker-btn {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px;
  cursor: pointer; white-space: nowrap;
}
.picker-btn:hover { border-color: var(--border-strong); }
.picker-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.picker-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 232px; max-height: 60vh; overflow-y: auto;
  padding: 6px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); box-shadow: 0 18px 40px -16px rgba(0,0,0,.45);
}
.picker-group {
  padding: 9px 10px 5px; font: 600 11px var(--font);
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.picker-group:first-child { padding-top: 4px; }
.picker-item {
  display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font: inherit; font-size: 14px;
  text-align: left; cursor: pointer;
}
.picker-item:hover { background: var(--accent-soft); color: var(--accent); }
.picker-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.picker-item.off { color: var(--muted); }
@media (max-width: 560px) { .picker-menu { min-width: 200px; } }

/* ----------------- sjednocení nativních prvků napříč systémy -------------- */
/* Windows kreslí formulářové prvky jinak než macOS. Tohle je srovná. */
:root { accent-color: var(--accent); }

select, .lang-select {
  appearance: none; -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b96a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 15px;
}
select::-ms-expand { display: none; }

/* Šipky u čísel ukrajují z úzkých polí – hodnota se stejně píše z klávesnice. */
/* Zaškrtávátko ani přepínač není textové pole: nemá se roztahovat na šířku
   řádku, ani dostávat výplň a rámeček z .field input. Platí globálně — tuhle
   chybu jsme dvakrát opravili jen v jednom kontejneru a potřetí vyskočila
   v mřížce výchozích oprávnění, kde popisky přetekly mimo rámečky. */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
input[type="range"] { padding: 0; border: 0; background: none; }

input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Křížek u hledání si Windows kreslí sám a překrývá text. */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Datum a čas: ať se ovládací ikony vejdou a mají barvu motivu. */
input[type="date"], input[type="time"] { min-height: 38px; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }

/* Výběr barvy je na Windows nativní tlačítko – ohraničíme ho jako ostatní pole. */
input[type="color"] {
  width: 100%; min-height: 38px; padding: 3px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }

/* ------------------------------ pozadí aplikace --------------------------- */
/* Kreslí se pod obsah, takže nikde nepřekáží ani nemění čitelnost. */
body[data-pozadi]::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
}
body[data-pozadi="zadne"]::before { content: none; }
body[data-pozadi="zare"]::before {
  background:
    radial-gradient(58% 44% at 8% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 68%),
    radial-gradient(50% 40% at 100% 100%, color-mix(in srgb, var(--accent-ink, var(--accent)) 14%, transparent), transparent 66%);
}
body[data-pozadi="prechod"]::before {
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 46%, color-mix(in srgb, var(--accent-ink, var(--accent)) 10%, transparent));
}
body[data-pozadi="mrizka"]::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(72% 62% at 50% 0%, #000 30%, transparent 78%);
}
body[data-pozadi="vlny"]::before {
  background:
    radial-gradient(120% 58% at 50% -22%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 62%),
    radial-gradient(90% 44% at 50% 118%, color-mix(in srgb, var(--accent-ink, var(--accent)) 13%, transparent), transparent 60%);
}

/* náhledy v nastavení */
.bg-nahled { background: var(--bg-elev); position: relative; overflow: hidden; }
.bg-nahled[data-nahled="zare"] { background: radial-gradient(80% 70% at 10% 0%, color-mix(in srgb, var(--accent) 55%, transparent), var(--bg-elev) 70%); }
.bg-nahled[data-nahled="prechod"] { background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 45%, transparent), var(--bg-elev) 60%); }
.bg-nahled[data-nahled="mrizka"] {
  background-image:
    linear-gradient(var(--border-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-strong) 1px, transparent 1px);
  background-size: 9px 9px; background-color: var(--bg-elev);
}
.bg-nahled[data-nahled="vlny"] { background: radial-gradient(120% 60% at 50% -20%, color-mix(in srgb, var(--accent) 50%, transparent), var(--bg-elev) 68%); }

/* ============================ styly rozhraní =============================
   Styl mění tvar a náladu (zaoblení, stíny, kontrast, popisky), motiv mění
   barvu. Výchozí „Evido" je to, co bylo odjakživa. */

/* Rubric – tmavý minimalismus s ostrým akcentem a kapitálkovými popisky. */
body[data-styl="rubric"] {
  --radius: 8px; --radius-sm: 6px;
  --shadow-1: none;
  --shadow-2: 0 12px 32px -14px rgba(0, 0, 0, .7);
  --accent: #c9f31d; --accent-soft: rgba(201, 243, 29, .14); --accent-ink: #dcff5e;
}
body[data-styl="rubric"][data-theme="dark"] { --bg: #07090b; --bg-card: #0f1316; --bg-elev: #14191d; --border: #1e252b; --border-strong: #2c353d; }
body[data-styl="rubric"] .card-head h4,
body[data-styl="rubric"] .stat-label,
body[data-styl="rubric"] .side-brand,
body[data-styl="rubric"] th {
  text-transform: uppercase; letter-spacing: .09em; font-size: .84em;
}
body[data-styl="rubric"] .btn.primary { color: #0d1200; font-weight: 700; }
body[data-styl="rubric"] .card { border-width: 1px; }

/* Papír – světlá, klidná plocha bez stínů; sedne k dokladům. */
body[data-styl="papir"] {
  --radius: 6px; --radius-sm: 4px;
  --shadow-1: none; --shadow-2: none;
}
body[data-styl="papir"] .card { border: 1px solid var(--border); background: var(--bg-card); }
body[data-styl="papir"] .btn { border-radius: 4px; }
body[data-styl="papir"][data-theme="light"] { --bg: #f7f6f2; --bg-card: #fffdf9; --bg-elev: #f2f0ea; --border: #e2ded3; }

/* Kontrast – silné okraje, žádné stíny, maximální čitelnost. */
body[data-styl="kontrast"] {
  --radius: 4px; --radius-sm: 3px;
  --shadow-1: none; --shadow-2: none;
  --border: var(--border-strong);
}
body[data-styl="kontrast"] .card,
body[data-styl="kontrast"] .btn,
body[data-styl="kontrast"] input,
body[data-styl="kontrast"] select,
body[data-styl="kontrast"] textarea { border-width: 2px; }
body[data-styl="kontrast"] .nav-item.active,
body[data-styl="kontrast"] .side-help.active { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Měkký – hodně zaoblené plochy a výraznější hloubka. */
body[data-styl="mekky"] {
  --radius: 20px; --radius-sm: 14px;
  --shadow-1: 0 2px 6px rgba(16, 24, 40, .08);
  --shadow-2: 0 18px 40px -12px rgba(16, 24, 40, .28);
}
body[data-styl="mekky"] .btn { border-radius: 999px; padding-inline: 18px; }
body[data-styl="mekky"] .card { box-shadow: var(--shadow-2); border-color: transparent; }

/* náhledy stylů v nastavení */
.styl-nahled { display: grid; gap: 3px; padding: 7px; background: var(--bg-elev); }
.styl-nahled i { display: block; height: 5px; border-radius: 3px; background: var(--border-strong); }
.styl-nahled i:first-child { background: var(--accent); width: 60%; }
.styl-nahled[data-n="rubric"] { background: #0f1316; border-radius: 6px; }
.styl-nahled[data-n="rubric"] i:first-child { background: #c9f31d; }
.styl-nahled[data-n="rubric"] i { background: #2c353d; border-radius: 2px; }
.styl-nahled[data-n="papir"] { background: #fffdf9; border-radius: 3px; }
.styl-nahled[data-n="papir"] i { background: #d9d4c7; border-radius: 1px; }
.styl-nahled[data-n="papir"] i:first-child { background: var(--accent); }
.styl-nahled[data-n="kontrast"] { border: 2px solid var(--text); border-radius: 2px; }
.styl-nahled[data-n="kontrast"] i { border-radius: 0; }
.styl-nahled[data-n="mekky"] { border-radius: 16px; }
.styl-nahled[data-n="mekky"] i { border-radius: 999px; height: 6px; }

/* -------------------------------- oznámení -------------------------------- */
.notif-btn { position: relative; }
.notif-btn.ztlumeno { opacity: .6; }
.notif-dot {
  position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; background: var(--red); color: #fff;
  font: 700 9.5px/15px var(--font); text-align: center;
}
.notif-menu { width: 320px; padding: 0; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px;
}
.notif-akce { display: flex; align-items: center; gap: 6px; }
.notif-akce .icon-btn.aktivni { color: var(--accent); background: var(--accent-soft); }
.notif-list { max-height: min(60vh, 420px); overflow-y: auto; }
/* Oznámení do telefonu – řádek ve zvonečku a seznam zařízení v profilu. */
.notif-push { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-push span { flex: 1; opacity: .85; }
.push-zarizeni { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.push-zarizeni span:first-child { flex: 1; font-weight: 600; }
.pododdil { margin: 14px 0 4px; font-size: 14px; }
/* Hlídač zapomenutého časovače: pruh v Můj den a červená pilulka v hlavičce. */
.timer-dlouho { margin: 10px auto 0; max-width: 420px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); font-weight: 600; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.timer-dlouho .btn { color: inherit; border-color: currentColor; }
.running-pill.dlouho { color: var(--red); }
[data-theme="dark"] .running-pill.dlouho { color: #ff7b7b; }
.notif-item { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.nova { background: var(--accent-soft); }
.notif-t1 { font-weight: 600; font-size: 13.5px; }
.notif-t2 { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.notif-cas { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.notif-prazdno { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ============================ mobil ====================================== */
@media (max-width: 700px) {
  /* Sedm záložek nastavení se do tří řádků nevejde rozumně – radši se
     posunují do strany, jako karty v prohlížeči. */
  .set-tabs {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 10px;
  }
  .set-tabs::-webkit-scrollbar { display: none; }
  .set-tab { flex: none; }

  /* Dotykové cíle musí jít trefit prstem. */
  .icon-btn { width: 42px; height: 42px; }
  .entry-actions { gap: 4px; }
  .picker-item { padding: 11px 12px; }
  .set-tab, .btn.small { min-height: 40px; }

  /* iOS přibližuje stránku, když má pole písmo menší než 16 px. */
  input, select, textarea,
  .field input, .field select, .field textarea,
  .quick-add-row input, .extra-row input, .op-row input { font-size: 16px; }
  .compact-input, .search-input { min-width: 0; width: 100%; font-size: 16px; }

  /* Nabídky u hlavičky se vejdou na šířku obrazovky. */
  /* Na telefonu se nabídka kotví k oknu, ne k tlačítku: zvoneček není úplně
     vpravo, takže kotva right: 0 na něm nechala 67 px nabídky za levým
     okrajem (a dřívější left: 0 zase 200 px za pravým). Hlavička je sticky
     a měří 63 px – nabídka se posadí pod ni. */
  .picker-menu, .notif-menu {
    position: fixed; top: 69px; left: 10px; right: 10px;
    width: auto; min-width: 0; max-width: none;
  }
  .notif-list { max-height: 60vh; }

  /* Ruční položky faktury a nabídky: jméno přes celou šířku, čísla pod ním. */
  /* Pět dětí do tří sloupců nešlo: `auto` pro křížek dostalo pole Cena.
     Název přes celý řádek, pod ním množství, jednotka, cena a křížek. */
  .extra-row { grid-template-columns: 1fr 1fr 1fr auto; }
  .extra-row .ei-name { grid-column: 1 / -1; }

  /* Volby vzhledu ať nejsou moc drobné. */
  .theme-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }

  /* Průvodce v Pomoci: tlačítko pod text, ne vedle. */
  .guide-step { flex-wrap: wrap; }
  .guide-step .btn { margin-left: 46px; }
}

@media (max-width: 420px) {
  .set-tab { padding-inline: 10px; font-size: 13.5px; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 24px; }
}

/* Hlavička na mobilu: prvky se musí vejít na šířku telefonu. */
@media (max-width: 700px) {
  .topbar { gap: 8px; }
  .topbar-left { min-width: 0; }
  .topbar-left h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-right { gap: 2px; flex: none; }
  /* Jazyk se přepíná i v Nastavení → tady zabírá místo, které potřebují ikony. */
  .topbar-right :is(#languageSelect, .jm:has(#languageSelect)) { display: none; }
  .topbar-right .picker-btn { padding: 0 8px; }
  .topbar-right #userPeekBtn span:not(.picker-label) { font-size: 0; }
  .topbar-right #userPeekBtn { min-width: 42px; justify-content: center; }
  .running-pill { max-width: 40vw; overflow: hidden; }

  /* Tabulky patří do vlastního posuvníku, ne aby tlačily celou stránku. */
  .table-scroll, .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table-scroll .data-table, .table-scroll .sheet { min-width: 520px; }

  /* Záložky nastavení se posouvají, ale nesmí roztáhnout stránku. */
  .set-tabs { max-width: 100%; }
  .view, .content { min-width: 0; }
}

/* ------------------------- Výběr měsíce v hlavičce ------------------------ */
.month-title { cursor: pointer; border-radius: 8px; padding: 2px 10px; transition: background var(--dur-1) var(--ease-out); }
.month-title:hover { background: var(--bg-elev); }
.month-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.month-pop {
  position: fixed; z-index: 90; width: 300px; padding: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  animation: rise .16s var(--ease-out) both;
}
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mp-head strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp-m {
  padding: 9px 2px; font: inherit; font-size: 12.5px; color: inherit; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
}
.mp-m:hover { background: var(--bg-elev); }
.mp-m.dnes { border-color: var(--border); }
.mp-m.je { background: var(--accent-fill, var(--accent)); color: var(--accent-text, #fff); font-weight: 700; }
.mp-dnes {
  width: 100%; margin-top: 10px; padding: 8px 0; font: inherit; font-size: 12.5px;
  color: var(--muted); background: transparent; border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer;
}
.mp-dnes:hover { color: var(--text); background: var(--bg-elev); }
tr.vybrany > td { background: var(--accent-soft); }

/* ------------------------- Přepínač typu dokladu -------------------------- */
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; }
.seg-btn {
  padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-radius: 7px; cursor: pointer;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-1); }
/* Uvnitř .field roztahuje pravidlo `.field input { width: 100% }` i zaškrtávátko,
   takže se text odsune až k pravému okraji. Dřív to bylo opravené jen pro
   .spolu-pole, a rozsypalo se to znovu v dialogu skupiny – patří to sem,
   k .check-list, ne k jednomu konkrétnímu použití. */
/* Samostatné zaškrtávátko s popiskem. Třída se v HTML používala, ale pravidlo
   k ní chybělo – label byl neupravený řádek a dotykový cíl měl 19 px. */
label.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; padding: 6px 0; }

.check-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.check-list label { justify-content: flex-start; }
.check-list label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check-list .muted { font-size: 12.5px; }
.badge.zaloha { background: var(--accent-soft); color: var(--accent-ink); }

/* ------------------------------- Agendy ----------------------------------- */
.agenda-pick { position: relative; margin-bottom: 6px; }
.agenda-btn {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px;
  font: inherit; font-size: 13.5px; color: var(--text); text-align: left; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px;
}
.agenda-btn:hover { border-color: var(--accent); }
.agenda-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.agenda-btn .chev { transform: rotate(90deg); opacity: .6; flex: 0 0 auto; }
.agenda-pick.open .agenda-btn .chev { transform: rotate(-90deg); }
.agenda-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  padding: 6px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-2); animation: rise .14s var(--ease-out) both;
}
.agenda-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px;
  font: inherit; font-size: 13.5px; color: inherit; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px;
}
.agenda-item:hover { background: var(--bg-elev); }
.agenda-item.je { color: var(--accent); font-weight: 700; }
.agenda-item .tag { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }

/* --------------------- Sekce, které se teprve připravují ------------------- */
.nav-item.chystane { opacity: .72; }
.chip-brzy {
  margin-left: auto; padding: 2px 7px; font-size: 10px; font-weight: 700;
  letter-spacing: .02em; text-transform: lowercase; white-space: nowrap;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px;
}
/* Na zvýrazněném řádku by štítek splynul s pozadím – dáme mu plnou podložku. */
.nav-item.active .chip-brzy { background: var(--bg-card); color: var(--accent-ink); }
.chystane-karta { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 46px 24px; text-align: center; }
.chystane-karta h3 { font-size: 19px; }
.chystane-karta p { max-width: 46ch; }
.chystane-ico {
  display: flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; margin-bottom: 4px; border-radius: 18px;
  color: var(--accent-ink); background: var(--accent-soft);
}

/* ---------------------------- Podpis a razítko ---------------------------- */
.podpis-blok { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.podpis-blok h5 { font-size: 14px; margin-bottom: 2px; }
.podpis-radek { display: flex; gap: 16px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.podpis-nahled {
  display: flex; align-items: center; justify-content: center;
  width: 200px; height: 84px; flex: 0 0 auto; padding: 6px;
  background: #fff; border: 1px dashed var(--border); border-radius: 10px;
}
.podpis-nahled img { max-width: 100%; max-height: 100%; object-fit: contain; }
.podpis-akce { flex: 1 1 220px; min-width: 0; }
@media (max-width: 700px) { .podpis-nahled { width: 100%; } }

/* ---------------------------- Volno v kalendáři --------------------------- */
.day.volno { background: var(--accent-soft); }
.day.volno-tym { box-shadow: inset 0 -3px 0 var(--accent-soft); }
.volno-znak {
  position: absolute; top: 4px; right: 5px;
  min-width: 15px; height: 15px; padding: 0 3px;
  font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
  color: var(--accent-ink); background: var(--accent-soft); border-radius: 5px;
}
.day.volno .volno-znak { color: var(--accent-text, #fff); background: var(--accent-fill, var(--accent)); }

/* ------------------------- Nárok na volno v účtu -------------------------- */
.narok-blok { margin: 12px 0 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.narok-blok legend { padding: 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.narok-mrizka { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
@media (max-width: 700px) { .narok-mrizka { grid-template-columns: 1fr 1fr; } }

/* ========================================================================
   POVAHA POHYBU
   Animace stojí na proměnných, takže varianta je jen jiná sada hodnot.
   „Utlumené" nechává zpětnou vazbu na dotek, ale ruší příchody prvků –
   pro toho, komu pohyb vadí nebo kdo pracuje na slabším stroji.
   ======================================================================== */

/* Každá volba má vlastní povahu přechodu mezi sekcemi, ne jen jinak rychlé
   hovery – jinak by se po přepnutí volby zdánlivě nic nezměnilo. */
@keyframes viewIn      { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes viewSvizne  { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes viewVyrazne { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }

body[data-animace="svizne"] {
  --dur-1: .08s; --dur-2: .14s; --dur-3: .2s; --dur-in: .16s;
  --ease-spring: var(--ease-out);
  --prechod-jmeno: viewSvizne; --prechod-dur: .16s;
  --prechod-ease: cubic-bezier(.3, .9, .2, 1);
}
body[data-animace="vyrazne"] {
  --dur-1: .18s; --dur-2: .34s; --dur-3: .55s; --dur-in: .5s;
  --ease-spring: cubic-bezier(.3, 1.8, .5, 1);
  --prechod-jmeno: viewVyrazne; --prechod-dur: .5s;
  --prechod-ease: cubic-bezier(.2, .9, .25, 1.06);
}

/* Utlumené = pro toho, komu pohyb vadí nebo kdo jede na slabším stroji.
   Ruší se všechny příchody a smyčky (i ty, na které by se v seznamu
   zapomnělo); zpětná vazba na dotek zůstává, jen krátká. */
body[data-animace="klidne"] {
  --dur-1: .1s; --dur-2: .12s; --dur-3: .12s; --dur-in: .12s;
  --ease-spring: linear; --ease-out: linear;
  --prechod-jmeno: none; --prechod-dur: 0s;
}
body[data-animace="klidne"] *,
body[data-animace="klidne"] *::before,
body[data-animace="klidne"] *::after {
  /* Ne zkrácení na nulu, ale úplné vypnutí. Skoro nulová délka je pod
     rozlišením prohlížeče a prvek pak uvízne na PRVNÍM snímku – u příchodů
     typu „rise" (z opacity 0) by karta zůstala neviditelná. */
  animation: none !important;
}
/* Kruh u časovače bez otáčení vypadá jako nedotočený – dokresli ho celý. */
body[data-animace="klidne"] .btn:active,
body[data-animace="klidne"] .nav-item:active,
body[data-animace="klidne"] .day:active { transform: none; }

/* ---------------------------- Vlastní pozadí ------------------------------ */
body[data-pozadi="vlastni"]::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background-image: var(--vlastni-pozadi);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  opacity: var(--vlastni-pozadi-sila, .18);
}

/* --------------------------- Vlastní pozadí (volba) ----------------------- */
.vlastni-pozadi { display: flex; gap: 16px; align-items: flex-start; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.vlastni-pozadi .podpis-nahled { height: 96px; background: var(--bg-elev); }
@media (max-width: 700px) { .vlastni-pozadi .podpis-nahled { width: 100%; } }

/* Náhled povahy pohybu v nastavení – čtvereček, který se hýbe podle volby. */
.animace-nahled { display: flex; align-items: center; justify-content: flex-start; padding: 0 10px; }
.animace-nahled i {
  width: 14px; height: 14px; border-radius: 4px; background: var(--accent);
  animation: nahledPohyb 1.6s var(--ease-out) infinite alternate;
}
.animace-nahled[data-a="svizne"] i { animation-duration: .9s; }
.animace-nahled[data-a="vyrazne"] i { animation-duration: 2s; animation-timing-function: cubic-bezier(.3, 1.8, .5, 1); }
.animace-nahled[data-a="klidne"] i { animation: none; opacity: .6; }
@keyframes nahledPohyb { from { transform: translateX(0); } to { transform: translateX(46px); } }
@media (prefers-reduced-motion: reduce) { .animace-nahled i { animation: none !important; } }

/* ============================== Průvodce aplikací ========================= */
.pruvodce-uvod { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pruvodce-ico {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; flex: 0 0 auto; border-radius: 16px;
  color: var(--accent-ink); background: var(--accent-soft);
}
.pruvodce-text { flex: 1 1 240px; min-width: 0; }
.pruvodce-text h4 { margin-bottom: 3px; }

.pruvodce { position: fixed; inset: 0; z-index: 120; }
.pruvodce-svetlo {
  position: absolute; border-radius: 12px; pointer-events: none;
  /* Stín kolem dokola ztmaví celou stránku a vykrojí jen zvýrazněné místo. */
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .58);
  outline: 2px solid var(--accent);
  transition: left var(--dur-2) var(--ease-out), top var(--dur-2) var(--ease-out),
              width var(--dur-2) var(--ease-out), height var(--dur-2) var(--ease-out);
}
.pruvodce-bublina {
  position: absolute; padding: 16px 18px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-2);
  animation: rise .2s var(--ease-out) both;
}
.pruvodce-bublina h4 { font-size: 16px; margin-bottom: 6px; }
.pruvodce-bublina p { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.pruvodce-krok { font-size: 11px; font-weight: 700; letter-spacing: .04em; margin-bottom: 4px; }
.pruvodce-tlacitka { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
body[data-animace="klidne"] .pruvodce-svetlo { transition: none; }
body[data-animace="klidne"] .pruvodce-bublina { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .pruvodce-svetlo { transition: none; }
  .pruvodce-bublina { animation: none; }
}

/* --------------------------- Cloudové zálohy ------------------------------ */
.cloud-stav { padding: 10px 12px; margin-bottom: 12px; font-size: 13.5px; background: var(--bg-elev); border-radius: 10px; }
.cloud-stav.pripojeno { background: var(--accent-soft); color: var(--accent-ink); }
.cloud-navod { margin-bottom: 14px; font-size: 13px; }
.cloud-navod summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; }
.cloud-navod ol { margin: 10px 0 0 18px; color: var(--text-2); line-height: 1.65; }
.cloud-navod code {
  padding: 2px 6px; font-size: 12px; word-break: break-all;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px;
}

/* --------------------------------- Píchačka ------------------------------- */
.pichacka { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
.pichacka-stav { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pichacka .t1 { font-size: 13.5px; }
.pichacka .t2 { font-size: 12px; }
.pichacka-ico {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px;
  color: var(--muted); background: var(--bg-elev);
}
.pichacka.bezi .pichacka-ico { color: var(--accent-ink); background: var(--accent-soft); }
.pichacka .t1 { font-weight: 600; }
.abs-tabs { margin-bottom: 14px; }

/* ------------------------------ Upozornění -------------------------------- */
.upozorneni {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px 14px;
  font-size: 13.5px; color: var(--red-strong, #c0483c);
  background: var(--red-soft, rgba(192, 72, 60, .12)); border-radius: 10px;
}
.badge.ok { background: var(--green-soft); color: var(--green-strong); }
.icon-btn.ok { color: var(--green-strong); }

/* ---------------------------- Žádost o volno ------------------------------ */
.notif-item.klikaci { cursor: pointer; }
.notif-item.klikaci:hover { background: var(--bg-elev); }
.zadost-hlavni { padding: 14px 16px; margin-bottom: 14px; background: var(--bg-elev); border-radius: 12px; text-align: center; }
.zadost-typ { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink); }
.zadost-termin { font-size: 19px; font-weight: 700; margin: 2px 0; }
.zadost-tabulka td:first-child { width: 38%; color: var(--muted); }
.zadost-soubeh { margin-top: 12px; padding: 11px 14px; font-size: 13px; background: var(--bg-elev); border-radius: 10px; }
.zadost-soubeh ul { margin: 6px 0 0 18px; color: var(--text-2); line-height: 1.6; }

.icon-btn.upominka { color: var(--red-strong, #c0483c); }
.op-row { grid-template-columns: 1fr 140px auto; }

/* Na úzkém displeji se čtyři tlačítka nevejdou vedle sebe – ať se srovnají
   do dvojic, ne tři a jedno osamocené. */
@media (max-width: 460px) {
  .timer-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .timer-btns .btn { width: 100%; justify-content: center; }
}

/* ---------------------------- Práce ve dvou ------------------------------- */
.pozvanka-prace {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-color: var(--accent);
}
.pozvanka-text .t1 { font-weight: 600; }
.timer-spolu { margin-top: 6px; font-size: 12.5px; color: var(--text-2); text-align: center; }

/* Vysvětlení, čím se docházka liší od záznamů práce. */
.doch-vysvetleni { margin: 0 0 14px; max-width: 62ch; line-height: 1.55; }
#dochNavrhy .card-head { align-items: center; }

/* Kdo právě měří čas – odlišený od pouhého „je odpíchnutý". */
.badge.meri { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-ink, var(--accent)); }
.badge.meri .pulse-dot { background: var(--accent); }
.meri-co { color: var(--text-2); }

/* Přepnutí do uživatele – pruh musí být vidět na první pohled a nepřekrývat obsah. */
.prepnuti-pruh {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 16px; font-size: 13px;
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-card));
  border-bottom: 1px solid var(--accent);
}
.peek-hlava { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Kdo na tom dělal se mnou – v okně záznamu. Zaškrtávátko je uvnitř .field,
   kde platí width:100 % pro textová pole – bez tohohle by se roztáhlo přes
   celý řádek a jméno by odskočilo na druhý konec. */
.spolu-pole { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.spolu-pole .check-list { max-height: 132px; overflow-y: auto; }
.spolu-pole .check-list label { justify-content: flex-start; }

/* V LOGu je u akcí provedených po přepnutí vidět, za koho se dělaly. */
.audit-jako { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* Doplňující řádek u dlaždice nároku – převod, čekající žádosti, jiná agenda. */
.stat-pozn { margin-top: 4px; font-size: 12px; line-height: 1.5; }

/* Naplánované úkoly v kalendáři. Značka je vlevo nahoře, ať se nepere
   se značkou volna vpravo. Hotové jsou tiché, po termínu červené. */
.ukol-znak {
  position: absolute; top: 4px; left: 5px;
  min-width: 15px; height: 15px; padding: 0 3px;
  font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
  color: var(--text); background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: 5px;
}
.ukol-znak.hotovo { opacity: .5; font-weight: 500; }
.ukol-znak.pozde { color: #fff; background: var(--red, #c0483c); border-color: transparent; }

/* Na mobilu má buňka jen ~40 px – číslovaná značka by ležela přes datum.
   Zmenší se proto na tečku k tečce záznamu; počet zůstává v bublině. */
@media (max-width: 560px) {
  .ukol-znak {
    position: static; order: 3;
    width: 6.5px; min-width: 0; height: 6.5px; padding: 0;
    font-size: 0; line-height: 0; border-radius: 50%;
    background: var(--text-2); border: none;
  }
  .ukol-znak.pozde { background: var(--red, #c0483c); }
  .ukol-znak.hotovo { background: var(--text-3); opacity: .55; }
  /* Značka volna překrývala na úzké buňce číslo dne – „20" se četlo jako
     „2 D". Písmeno druhu volna zůstává, jen se zařadí k tečkám pod datum. */
  .volno-znak {
    position: static; order: 4;
    min-width: 12px; height: 12px; padding: 0 2px;
    font-size: 8.5px; line-height: 12px; border-radius: 4px;
  }
  /* tečky vedle sebe, ne pod sebou */
  .day { flex-flow: row wrap; align-content: center; min-width: 0; overflow: hidden; }
  .day .dot, .ukol-znak, .volno-znak { flex: 0 0 auto; }
  .day > :first-child, .day .mini { flex-basis: 100%; text-align: center; }
}

/* Legenda kalendáře – značka naplánovaného úkolu. */
.legend-ukol {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-2); vertical-align: middle;
}

/* =========================================================================
   Styl „Jako web" – rozhraní ve stejné řeči jako úvodní stránka.
   Archivo na nadpisy, IBM Plex Sans na text, IBM Plex Mono na čísla;
   ploché karty s vlasovým okrajem místo stínů, střídmé rádiusy.
   Písmo se dotahuje, až když je styl zapnutý (viz dotahniPismo).
   ========================================================================= */
body[data-styl="web"] {
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px; --radius-sm: 8px;
  --shadow-1: none;
  --shadow-2: 0 12px 32px -16px rgba(16, 20, 23, .28);
}
body[data-styl="web"] h1,
body[data-styl="web"] h2,
body[data-styl="web"] h3,
body[data-styl="web"] h4,
body[data-styl="web"] .stat-value,
body[data-styl="web"] .side-brand {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: -.02em;
}
body[data-styl="web"] .stat-value { font-weight: 800; }
body[data-styl="web"] .card { box-shadow: none; border: 1px solid var(--border); }
body[data-styl="web"] .btn { border-radius: 10px; font-weight: 600; }
body[data-styl="web"] .eyebrow,
body[data-styl="web"] .stat-head,
body[data-styl="web"] th {
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .08em; text-transform: uppercase;
}
body[data-styl="web"][data-theme="light"] { --bg: #ffffff; --bg-card: #ffffff; --bg-elev: #f4f5f7; --border: #e6e8eb; }
body[data-styl="web"][data-theme="dark"]  { --bg: #101417; --bg-card: #171d23; --bg-elev: #1d242b; --border: #262e37; }

/* náhled stylu v nastavení */
.styl-nahled[data-n="web"] { background: #101417; border-radius: 10px; }
.styl-nahled[data-n="web"] i { background: #262e37; border-radius: 2px; }
.styl-nahled[data-n="web"] i:first-child { background: #2e8eff; }

/* Během přepnutí tématu nebo stylu se přebarvuje všechno naráz – přechod na
   barvě se u hodnot z var() umí zaseknout na staré barvě (viz bezPrechodu). */
body.bez-prechodu, body.bez-prechodu *, body.bez-prechodu *::before, body.bez-prechodu *::after {
  transition: none !important;
}

/* Seznam měsíců, které správce odemkl konkrétním lidem (uzávěrka). */
.odemceny-radek {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.odemceny-radek:last-child { border-bottom: 0; }
hr.jemna { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* --------------------- Sekce v menu a rozcestník „Více" ------------------- */

/* Skupina v postranním panelu se rozbaluje. Na monitoru je místo, takže se
   nikam nezanořuje – na to je na telefonu rozcestník „Více". */
.nav-sekce {
  width: 100%; display: flex; align-items: center; gap: 7px;
  padding: 13px 12px 6px; background: none; border: 0; cursor: pointer;
  font: 600 10.5px var(--font);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3, var(--text-2));
  text-align: left;
}
.nav-sekce:first-child { padding-top: 4px; }
.nav-sekce:hover { color: var(--text); }
.nav-sekce .sip { flex: none; transition: transform var(--dur-2, .2s) var(--ease-out, ease); }
.nav-sekce[aria-expanded="true"] .sip { transform: rotate(90deg); }
.nav-sekce .pocet {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0; opacity: .75;
}
.nav-obsah { display: none; }
.nav-obsah.je { display: block; }

/* Vyjíždí zespodu – tam dosáhne palec. Na širokých obrazovkách se nepoužívá. */
.vice-vrstva {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity .18s ease;
  display: flex; align-items: flex-end;
}
.vice-vrstva.je { opacity: 1; }
.vice-panel {
  width: 100%; max-height: 78vh; overflow-y: auto;
  background: var(--bg-card); color: var(--text);
  border-top-left-radius: 18px; border-top-right-radius: 18px;
  padding: 8px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(14px); transition: transform .18s ease;
  box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .5);
}
.vice-vrstva.je .vice-panel { transform: translateY(0); }
.vice-uchyt {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--border-strong); margin: 6px auto 10px;
}
.vice-sekce {
  padding: 12px 4px 6px;
  font: 600 10.5px var(--font);
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-3, var(--text-2));
}
.vice-mrizka { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* Dlaždice skupin jsou větší – jsou to hlavní cíle a je jich málo. */
.vice-skupiny { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vice-skupiny .vice-polozka { min-height: 92px; font-size: 13px; }
.vice-pocet {
  font-family: var(--mono); font-size: 10.5px; opacity: .7;
}
.vice-zpet {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  color: var(--accent-ink, var(--accent));
  font: 600 13.5px var(--font); padding: 6px 2px 12px;
}
.vice-telo { min-height: 180px; }
.vice-polozka {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  /* 76 px na výšku: pohodlný cíl pro palec i za jízdy v autě. */
  min-height: 76px; padding: 12px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elev); color: var(--text);
  font: 500 12px var(--font); text-align: center; cursor: pointer;
}
.vice-polozka:active { transform: scale(.97); }
.vice-polozka.chystane { opacity: .55; }
@media (max-width: 360px) { .vice-mrizka { grid-template-columns: repeat(2, 1fr); } }

/* Účtenka u dokladu o tankování – volba mezi fotoaparátem a souborem. */
.uctenka-volby { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 4px; }
.uctenka-je { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --------------------------- Oblíbené sekce ------------------------------- */
/* Hvězdička sedí na konci řádku vedle položky menu; oblíbené se pak
   vykreslují nad celým seznamem, v pořadí, v jakém je člověk přidal. */
.nav-radek { display: flex; align-items: stretch; gap: 2px; }
.nav-radek .nav-item { flex: 1; min-width: 0; }
.hvezda {
  flex: none; width: 30px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; border-radius: var(--radius-sm);
  color: var(--border-strong);
  opacity: 0; transition: opacity var(--dur-2, .2s) ease, color var(--dur-2, .2s) ease;
}
/* Na dotykovém zařízení není kurzor, takže se hvězdy nesmí schovávat za hover. */
.nav-radek:hover .hvezda, .hvezda:focus-visible { opacity: 1; }
.hvezda.je { opacity: 1; color: #f0a92b; }
.hvezda:hover { color: #f0a92b; }
@media (hover: none) { .hvezda { opacity: .55; } }

.nav-oblibene { margin-bottom: 2px; }
.nav-cara { height: 1px; background: var(--border); margin: 8px 10px 4px; }
.vice-cara { height: 1px; background: var(--border); margin: 14px 2px 4px; }

/* Dopočet DPH u částek. Tiše, aby nepřebíjel číslo, které je hlavní. */
.dph-pripis { font-size: .82em; color: var(--text-2); font-weight: 400; white-space: nowrap; }
.dph-radek {
  display: block; font: 400 11.5px var(--font); color: var(--text-2);
  margin-top: 2px; letter-spacing: 0; text-transform: none;
}

/* ------------------------------------------------------------ dotykové cíle
   Na dotykovém zařízení nerozhoduje šířka okna, ale čím se ovládá: tablet
   na šířku má 1024 px a prst je stejně velký. Průchod všemi obrazovkami na
   768 a 375 px našel tlačítka .ghost 31 px, .icon-btn 32 px, .seg-btn 31 px
   a klikací nadpis měsíce 26 px. Myš tohle nepotřebuje, proto (pointer: coarse)
   a ne max-width. */
@media (pointer: coarse) {
  .btn, .btn.small, .btn.btn-sm, .seg-btn, .set-tab { min-height: 42px; }
  /* .entry-actions .icon-btn má vyšší specificitu než .icon-btn – bez
     výslovného zápisu tu ikonky v seznamech zůstávaly na 32 px i na mobilu. */
  .icon-btn, .entry-actions .icon-btn { width: 42px; height: 42px; }
  .check-row, .check-list label, label.check { min-height: 42px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  /* Zaškrtávátko úkolu stojí v mřížce bez labelu, takže je samo celým cílem. */
  .task-item .task-check { width: 26px; height: 26px; }
  /* Políčko kalendáře drží poměr stran a na 375 px vychází 37 px. */
  .day { min-height: 42px; }
  .month-nav h3, h3[id$="MonthLabel"] { min-height: 42px; display: inline-flex; align-items: center; }
  .support-row a, .picker-menu button, select { min-height: 42px; }
  .picker-btn { height: 42px; }
}

/* Řádek položky opravného dokladu se choval jako na počítači: .op-row je
   v souboru až za mobilními bloky a při stejné specificitě vyhrálo. Tabulka
   zákazníků se místo posunutí mačkala do 113 px vysokých řádků. */
@media (max-width: 700px) {
  .op-row { grid-template-columns: 1fr auto; }
  .op-row .op-nazev { grid-column: 1 / -1; }
  #customersTable { min-width: 560px; }
}

/* Přehled měsíce pod kalendářem – volno a úkoly ve dvou sloupcích. Řádek je
   jméno (nebo název) vlevo a datum vpravo, jako v docházkových rastrech. */
.rastr-ovladani { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rastr-ovladani .compact-input { min-width: 0; }
.rastr-sloupce { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
/* Bez min-width: 0 si sloupec drží šířku nejdelšího řádku (nowrap) a na 375 px přetéká. */
.rastr-sloupec { min-width: 0; }
.rastr-nadpis { font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.rastr-radek { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rastr-radek:last-child { border-bottom: 0; }
.rastr-kdo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rastr-kdo.hotovo { color: var(--text-3); text-decoration: line-through; }
.rastr-kdo.pozde { color: var(--red); }
.rastr-kdo .muted { font-weight: 400; }
.rastr-kdy { flex: none; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.rastr-prazdno { color: var(--text-3); font-size: 13px; padding: 6px 0; }
@media (max-width: 700px) { .rastr-sloupce { grid-template-columns: 1fr; } }

/* Stav připojení v hlavičce. Ukazuje se jen když je co říct: bez signálu,
   zápisy čekající ve frontě, nebo zápis, který se nepodařilo odeslat. */
.site-stav { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-elev);
  color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.site-stav.offline { border-color: var(--text-3); }
.site-stav.chyba { color: var(--red); border-color: var(--red); }
.site-stav .tecka { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.site-stav.offline .tecka { background: var(--red); }
.site-stav.odesilam .tecka { background: var(--green); animation: pulse 1.2s ease-in-out infinite; }
/* Záznam, který čeká ve frontě – vidět je, ale nejde na něj sáhnout, dokud
   nedorazí na server a nedostane pravé id. */
.entry.ceka { opacity: .65; border-style: dashed; }
.entry.ceka .entry-actions, .entry.ceka .drag-handle { display: none; }
@media (max-width: 700px) { .site-stav { padding: 0 9px; } .site-stav .text-dlouhy { display: none; } }

/* Verze aplikace dole v panelu a v rozcestníku – proklik do changelogu. */
.side-verze, .vice-verze { display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font: 500 11.5px var(--font); color: var(--text-3); }
.side-verze { padding: 4px 14px 12px; }
.side-verze:hover, .vice-verze:hover { color: var(--accent-ink); }
.vice-verze { justify-content: center; width: 100%; min-height: 44px; padding: 10px 0 6px; }
.verze-tecka { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* Fotky k záznamu a zakázce – před a po. */
.fotky-mrizka { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 6px; }
.fotka { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-elev); display: block; }
.fotka img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotka-popis { position: absolute; left: 6px; top: 6px; font: 600 10.5px var(--font); letter-spacing: .04em; text-transform: uppercase;
  background: rgba(0,0,0,.6); color: #fff; padding: 2px 7px; border-radius: 6px; }
.fotka-smazat { position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border-radius: 8px; border: 0; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.fotka-smazat:hover { background: var(--red); }
.fotky-akce { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.fotky-akce select { min-height: 38px; }
.icon-btn .pocet { font: 600 10.5px var(--font); margin-left: 2px; }

/* Režim údržby – databáze se nenačetla. */
.udrzba { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 20px; background: var(--bg, #0f1216); color: var(--text, #e8ecf1); }
.udrzba-box { max-width: 560px; padding: 28px; border-radius: 16px; border: 1px solid var(--border, #2a3140); background: var(--card, #161b22); line-height: 1.5; }
.udrzba-box h2 { margin: 0 0 10px; }

/* Platby a materiál: zůstatek je čitelný i bez otevření dokladu. */
#invoiceRegister .invoice-balance { display: grid; gap: 4px; margin-top: 7px; font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
#invoiceRegister .invoice-balance span { color: var(--muted); }
#invoiceRegister .invoice-balance strong { color: var(--text); font-weight: 600; }
#invoiceRegister .invoice-partial { color: var(--accent); background: var(--accent-soft); }
#invoiceRegister .invoice-pay-button { min-height: 40px; }
#invoiceEditor .invoice-material-picker { margin: 18px 0; border-block: 1px solid var(--border); }
#invoiceEditor .invoice-material-picker > summary { display: flex; gap: 12px; align-items: center; min-height: 56px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
#invoiceEditor .invoice-material-picker > summary::-webkit-details-marker { display: none; }
#invoiceEditor .invoice-material-picker > summary::before { content: '›'; font-size: 23px; color: var(--muted); transform: rotate(0); }
#invoiceEditor .invoice-material-picker[open] > summary::before { transform: rotate(90deg); }
#invMaterialCount { margin-left: auto; font-weight: 400; font-size: 12px; font-variant-numeric: tabular-nums; }
#invoiceEditor .invoice-material-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#invoiceEditor .invoice-material-head .hint { margin: 0; }
#invoiceEditor .invoice-material-head button { flex-shrink: 0; }
#invoiceEditor .invoice-material-list { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; margin-top: 8px; }
#invoiceEditor .invoice-material-row { padding-inline: 8px; border-radius: 7px; }
#invoiceEditor .invoice-material-row:has(input:checked) { background: var(--accent-soft); }
#invoiceEditor .invoice-material-row:has(input:disabled) { opacity: .55; cursor: default; }
#invoiceEditor .invoice-material-error { color: var(--red); }
#invoiceEditor .invoice-material-picker summary:focus-visible, #invoiceEditor .invoice-material-row:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
#invPaymentForm .invoice-payment-customer { margin: 0 0 20px; overflow-wrap: anywhere; }
#invPaymentForm .invoice-payment-total, #invPaymentForm .invoice-payment-remaining { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-variant-numeric: tabular-nums; }
#invPaymentForm .invoice-payment-total { margin-bottom: 24px; color: var(--muted); font-size: 13px; }
#invPaymentForm .invoice-payment-total strong { color: var(--text); }
#invPaidAmount { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
#invPaymentForm .invoice-payment-remaining { padding-block: 14px; border-block: 1px solid var(--border); font-size: 14px; }
#invPaymentForm .invoice-payment-remaining strong { font-size: 23px; letter-spacing: -.025em; }
#invPaymentFull { margin: 8px 0 22px; }
@media (max-width: 700px) {
  #invoiceRegister .invoice-balance { text-align: left; }
  #invPaymentForm .invoice-payment-remaining { flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  #invoiceEditor .invoice-material-picker > summary::before { transition: transform 160ms ease; }
  #invoiceEditor .invoice-material-row { transition: background-color 160ms ease; }
}

/* Ukázka: tlačítko na přihlášení a pruh nahoře v aplikaci. */
.auth-ukazka { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
.auth-ukazka .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.auth-ukazka .hint { margin: 8px 0 0; }
.auth-pick > .auth-ukazka { max-width: 360px; margin-inline: auto; border-top: 0; }
.ukazka-pruh {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 0 0 14px; padding: 9px 12px 9px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 12px; background: var(--accent-soft); font-size: 13px;
}
.ukazka-pruh.hidden { display: none; }
.ukazka-znak { color: var(--accent-ink); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.ukazka-pruh .btn { margin-left: auto; }
