/* ==========================================================================
   Tenis Žabovřesky · app.css · v2
   Design systém pro Django šablony (bez buildu, bez JS frameworku).
   Návrh: plátno „Monitoring tréninku“ – artboard „Design systém“.

   Obsah
   1.  Tokeny
   2.  Základ
   3.  Typografie
   4.  Rozvržení mobilu (screen, header, back, tabbar)
   5.  Karty a seznamy
   6.  Tlačítka
   7.  Štítky stavů
   8.  Události (datebox, timebox)
   9.  Čísla a grafy (stat, bars, hbar, legend)
   10. Segmentový přepínač
   11. Formuláře
   12. Docházka byl/nebyl (čisté CSS přes radio)
   13. Upozornění, toast, prázdný stav
   14. Spodní panel / dialog (<dialog>)
   15. Kalendář docházky
   16. Desktop správa (env-bar, topbar, sidebar, page)
   17. Tabulky, filtry, chipy, stránkování
   18. Django admin – napojení na stejné styly
   19. Utility
   ========================================================================== */

/* 1. Tokeny ---------------------------------------------------------------- */
:root {
  /* značka – motiv kurtu */
  --green-900: #14532d;   /* horní lišta, tmavé plochy */
  --green-800: #166534;   /* primární akce */
  --green-700: #15803d;
  --green-200: #BBD7C3;   /* text na tmavě zelené */
  --green-50:  #EAF3EC;   /* tónované plochy, sekundární tlačítko */
  --clay:      #ea580c;   /* antuka – testovací pruh, výplně */
  --clay-ink:  #c2410c;   /* antuka pro text (AA na bílé i --bg) */
  --clay-100:  #FFF1E6;
  --ball:      #d4f04a;   /* tenisák – jen dekor / text na tmavé zelené */

  /* neutrální */
  --ink:    #18181b;
  --muted:  #63636b;      /* 4,9:1 na --bg (původní #71717a nesplňoval AA) */
  --subtle: #a1a1aa;      /* jen ikony/chevrony, nikdy text */
  --line:   #e4e4e7;
  --border: #d4d4d8;      /* okraje polí */
  --bg:     #f5f6f3;
  --fill:   #ebece8;      /* podklad segmentů, prázdné části grafů */
  --card:   #ffffff;
  --row-hover: #fafaf8;
  --chart: #8DBF9C;       /* sloupce grafu, legenda */
  --chart-cost: #FDBA74;  /* náklady v grafu, legenda */

  /* stavy – vždy s textem nebo ikonou */
  --ok-bg: #DCFCE7;    --ok-fg: #166534;    --ok-solid: #16A34A;
  --warn-bg: #FFEDD5;  --warn-fg: #9A3412;  --warn-soft: #FFF1E6; --warn-ink: #7C2D12;
  --err-bg: #FEE2E2;   --err-fg: #B91C1C;   --err-soft: #FEF2F2;  --err-solid: #B91C1C; --err-ring: #DC2626;
  --info-bg: #DBEAFE;  --info-fg: #1D4ED8;  --info-soft: #EAF1FE; --info-ink: #1E3A8A;
  --neutral-bg: #F0F0F1; --neutral-fg: #52525B;

  /* tvar */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-btn: 12px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-pill: 999px;

  --shadow: 0 1px 2px rgba(24,24,27,.04), 0 6px 20px rgba(24,24,27,.06);
  --shadow-float: 0 8px 30px rgba(24,24,27,.12), inset 0 0 0 .5px rgba(24,24,27,.08);
  --focus: 0 0 0 3px #86b89a;

  /* písmo */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  /* rozměry */
  --tap: 44px;
  --gutter: 16px;
  --tabbar-h: 64px;
}

/* 2. Základ ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-800); }
a:hover { color: var(--green-900); }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* 3. Typografie ------------------------------------------------------------ */
.display     { margin: 0; font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.03em; }
.large-title { margin: 0; font-size: 32px; line-height: 38px; font-weight: 700; letter-spacing: -.022em; }
.title       { margin: 0; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.015em; }
.title-2     { margin: 0; font-size: 26px; line-height: 31px; font-weight: 700; letter-spacing: -.02em; }
.headline    { font-size: 17px; line-height: 22px; font-weight: 600; }
.body        { font-size: 16px; line-height: 22px; }
.subhead     { font-size: 15px; line-height: 20px; color: var(--muted); }
.caption     { font-size: 13px; line-height: 18px; color: var(--muted); }
.eyebrow     { margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.num         { font-variant-numeric: tabular-nums; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-ok   { color: var(--ok-fg); }
.text-warn { color: var(--warn-fg); }
.text-err  { color: var(--err-fg); }
.text-muted{ color: var(--muted); }
.strike    { text-decoration: line-through; color: var(--muted); }
.text-on-dark { color: var(--green-200); }   /* popisky na .card--dark / .hero */

/* 4. Rozvržení mobilu ------------------------------------------------------ */
.screen {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px var(--gutter) calc(var(--tabbar-h) + 48px);
  display: flex; flex-direction: column; gap: 20px;
}
.screen--no-tabbar { padding-bottom: 32px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 4px; }
.page-header__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section__title { padding: 0 4px; }           /* + .eyebrow */
.section__head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }

.back {
  display: inline-flex; align-items: center; gap: 2px;
  min-height: var(--tap); align-self: flex-start;
  color: var(--green-800); font-size: 17px; text-decoration: none;
}
.back .icon { width: 22px; height: 22px; stroke-width: 2.4; }

/* Tmavě zelená hlavička (detail tréninku trenéra, přihlášení) */
.hero {
  background: var(--green-900); color: #fff;
  padding: 24px max(var(--gutter), calc((100% - 560px) / 2 + var(--gutter))) 20px;   /* vnitřek zarovnaný se sloupcem .screen */
  display: flex; flex-direction: column; gap: 12px;
}
.hero .eyebrow { color: var(--green-200); }
.hero .back { color: var(--ball); }
.hero__pill {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: var(--r-pill); background: rgba(255,255,255,.14);
  font-size: 13px; font-weight: 600;
}

/* Hlavička přihlašovacích stránek (logo + nadpis na střed) */
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 4px; }
.auth-head .brand-mark { margin-bottom: 4px; }
.auth-foot { text-align: center; }

/* Plovoucí spodní lišta */
.tabbar {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 528px; margin: 0 auto;
  height: var(--tabbar-h); border-radius: 32px;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-float);
  display: flex; align-items: center; justify-content: space-around; padding: 0 6px;
  z-index: 50;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 0 1 72px; min-width: 0; padding: 6px 0; border-radius: 26px; white-space: nowrap;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none;
}
.tab .icon { width: 24px; height: 24px; }
.tab.is-active, .tab[aria-current="page"] { color: var(--green-800); background: rgba(22,101,52,.10); }

/* Ukotvená akce dole (Uložit docházku) */
.sticky-action {
  position: sticky; bottom: 0; margin: 0 calc(var(--gutter) * -1);
  padding: 12px var(--gutter) max(20px, env(safe-area-inset-bottom));
  background: rgba(245,246,243,.85);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 .5px 0 rgba(24,24,27,.1);
}

/* 5. Karty a seznamy ------------------------------------------------------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card--pad { padding: 16px; }
.card--pad-lg { padding: 20px; }
.card--stack { display: flex; flex-direction: column; gap: 14px; }
.card--dark { background: var(--green-900); color: #fff; border-radius: var(--r-xl); }
.card--dark .eyebrow { color: var(--green-200); }
.card--alert { box-shadow: 0 0 0 1.5px #FDBA74, 0 6px 20px rgba(194,65,12,.10); }
.card__divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.list {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden; margin: 0; padding: 0; list-style: none;
}
.list--alert { box-shadow: 0 0 0 1.5px #FDBA74, 0 6px 20px rgba(194,65,12,.10); }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-height: 52px;
  color: inherit; text-decoration: none;
}
.row--top { align-items: flex-start; }
.row--tall { min-height: 60px; }
.row--total { background: var(--row-hover); font-weight: 700; }
.row--highlight { background: var(--green-50); }
.list > .row + .row, .list > li + li { border-top: 1px solid var(--line); }
a.row:hover { background: var(--row-hover); }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row__title { font-size: 16px; line-height: 21px; font-weight: 600; }
.row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.row__actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.chev { width: 16px; height: 16px; color: var(--subtle); flex: none; stroke-width: 2.4; }

.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; background: var(--fill); color: var(--ink);
  border: 0; text-decoration: none;
}
.avatar--sm { width: 40px; height: 40px; font-size: 15px; }
.avatar--lg { width: 60px; height: 60px; font-size: 22px; }
.avatar--green { background: var(--green-800); color: #fff; }
.avatar--ball  { background: var(--ball); color: var(--green-900); }

.icon-tile {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--green-50); color: var(--green-800);
}

/* Rozbalovací karta: <details class="card details"><summary>…</summary>…</details> */
.details > summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 16px; cursor: pointer; list-style: none; }
.details > summary::-webkit-details-marker { display: none; }
.details > summary::after { content: "▾"; color: var(--muted); }
.details[open] > summary { border-bottom: 1px solid var(--line); }
.details[open] > summary::after { content: "▴"; }

/* 6. Tlačítka -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border: 0; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn:focus-visible { box-shadow: var(--focus); border-radius: var(--r-btn); }
.btn-primary   { background: var(--green-800); color: #fff; }
.btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-secondary { background: var(--green-50); color: var(--green-800); }
.btn-secondary:hover { background: #DDEBE0; color: var(--green-900); }
.btn-ghost     { background: transparent; color: var(--green-800); }
.btn-ghost:hover { background: var(--green-50); }
.btn-outline   { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger    { background: #FEECEC; color: var(--err-fg); }
.btn-danger-solid { background: var(--err-solid); color: #fff; }
.btn-danger-text  { background: transparent; color: var(--err-fg); }
.btn-clay      { background: var(--clay-ink); color: #fff; }
.btn-ball      { background: var(--ball); color: var(--green-900); }
.btn[disabled], .btn.is-disabled { background: var(--fill); color: #8a8a92; cursor: not-allowed; }

.btn-lg    { min-height: 52px; border-radius: var(--r-md); font-size: 17px; }
.btn-sm    { min-height: 36px; padding: 0 14px; font-size: 15px; border-radius: 10px; } /* jen vedle jiného cíle ≥44 px */
.btn-block { display: flex; width: 100%; }
.btn-inline { padding: 0 4px; }                 /* textové tlačítko v řádku */
.btn-icon  { width: var(--tap); padding: 0; }

.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }

.copy-btn {
  flex: none; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--r-btn);
  background: var(--green-50); color: var(--green-800);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.copy-btn.is-copied { background: var(--ok-bg); color: var(--ok-fg); }

/* 7. Štítky stavů ---------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge .icon { width: 12px; height: 12px; stroke-width: 3; }
.badge-ok      { background: var(--ok-bg);      color: var(--ok-fg); }      /* Přihlášen, Zaplaceno, Proběhl */
.badge-info    { background: var(--info-bg);    color: var(--info-fg); }    /* Náhradník, Odesláno, Dnes, Probíhá */
.badge-warn    { background: var(--warn-bg);    color: var(--warn-fg); }    /* Odhlášen pozdě, Částečně, Po termínu, Nezapsáno */
.badge-error   { background: var(--err-bg);     color: var(--err-fg); }     /* Po splatnosti */
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-fg); } /* Zrušen, Neodesláno, Průběžně */
.badge-on-dark { background: rgba(212,240,74,.18); color: var(--ball); }

/* 8. Události -------------------------------------------------------------- */
.event { display: flex; align-items: center; gap: 12px; }
.datebox {
  flex: none; width: 48px; height: 52px; border-radius: 12px;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.datebox__dow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--clay-ink); }
.datebox__day { font-size: 20px; line-height: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.datebox--today { background: var(--clay-100); }
.datebox--past .datebox__dow, .datebox--past .datebox__day { color: var(--muted); }
.timebox { flex: none; width: 56px; display: flex; flex-direction: column; gap: 1px; }
.timebox__from { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timebox__to   { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.event--cancelled .row__title { text-decoration: line-through; color: var(--muted); }

/* 9. Čísla a grafy --------------------------------------------------------- */
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.stat__value { font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__value--sm { font-size: 22px; line-height: 26px; }
.stat__label { font-size: 13px; color: var(--muted); }
.stat__delta { font-size: 13px; font-weight: 600; }
.amount { font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid > .stat { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-grid > .stat:nth-child(2n) { border-right: 0; }
.stat-grid > .stat:nth-last-child(-n+2) { border-bottom: 0; }
.stat-grid--3 > .stat, .stat-grid--3 > .stat:nth-child(2n) { border-bottom: 0; border-right: 1px solid var(--line); }
.stat-grid--3 > .stat:last-child { border-right: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }

/* Sloupcový graf: výšku sloupce nastavte inline přes --h (0–100) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; border-bottom: 1px solid var(--line); }
.bars__col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bars__bar { width: 100%; max-width: 22px; height: calc(var(--h, 0) * 1%); border-radius: 5px 5px 2px 2px; background: #8DBF9C; }
.bars__bar.is-current { background: var(--green-800); }
.bars__bar.is-partial { background: #D9E8DD; }
.bars__bar.is-cost { background: #FDBA74; }
.bars__value { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars-labels { display: flex; gap: 6px; }
.bars-labels > span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }
.bars-labels > .is-current { color: var(--ink); font-weight: 700; }
.bars__pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bars__pair > .bars__bar { max-width: 12px; }
a.bars__col { text-decoration: none; border-radius: var(--r-sm); }
a.bars__col:hover { background: var(--row-hover); }
.legend__swatch--chart { background: var(--chart); }
.legend__swatch--cost { background: var(--chart-cost); }

.hbar { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.hbar > i { display: block; height: 100%; width: calc(var(--v, 0) * 1%); border-radius: 4px; background: var(--green-800); }
.hbar--ok > i { background: var(--ok-solid); }
.hbar--clay > i { background: var(--clay); }

.legend { display: flex; flex-wrap: wrap; gap: 12px 16px; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend__swatch { width: 10px; height: 10px; border-radius: 3px; }

/* 10. Segmentový přepínač -------------------------------------------------- */
/* Funguje s odkazy (?obdobi=rok) i s radio inputy. */
.segmented { display: flex; padding: 2px; border-radius: var(--r-btn); background: var(--fill); }
.segmented > a, .segmented > button, .segmented > label {
  flex: 1; min-height: 40px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer;
}
.segmented > input { position: absolute; opacity: 0; pointer-events: none; }
.segmented > .is-active, .segmented > [aria-current], .segmented > [aria-pressed="true"],
.segmented > input:checked + label { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.segmented > input:focus-visible + label { box-shadow: var(--focus); }
.segmented--sm > * { min-height: 36px; font-size: 13px; padding: 0 14px; }
.segmented--inline { display: inline-flex; }

.period-nav { display: flex; align-items: center; justify-content: space-between; }

/* 11. Formuláře ------------------------------------------------------------ */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 6px; }
.label { font-size: 14px; font-weight: 600; }
.label__opt { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--r-btn);
  background: #fff; font-size: 16px; color: var(--ink);
}
.textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--green-800); box-shadow: var(--focus); border-radius: var(--r-btn); }
.input.is-error, .select.is-error, .textarea.is-error,
.input[aria-invalid="true"] { border-color: var(--err-ring); box-shadow: 0 0 0 3px var(--err-bg); }
.help { font-size: 13px; color: var(--muted); }
.help-error { font-size: 13px; color: var(--err-fg); font-weight: 500; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.check { display: flex; gap: 12px; align-items: flex-start; min-height: var(--tap); padding: 10px 0; font-size: 14px; line-height: 20px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--green-800); }

.radio-card {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--r-btn); background: #fff;
  font-size: 15px; cursor: pointer;
}
.radio-card input { width: 20px; height: 20px; margin: 0; accent-color: var(--green-800); }
.radio-card:has(input:checked) { border-color: var(--green-800); box-shadow: 0 0 0 3px var(--green-50); font-weight: 600; }
.radio-card--danger:has(input:checked) { border-color: var(--err-solid); box-shadow: 0 0 0 3px var(--err-bg); }
.radio-card--danger input { accent-color: var(--err-solid); }

/* iOS přepínač: <label class="switch"><input type="checkbox"><span></span></label> */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: #D4D4D8; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: #34C759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

.meter { display: flex; gap: 4px; }
.meter > span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.meter > span.is-on { background: var(--ok-solid); }

/* 12. Docházka byl/nebyl --------------------------------------------------- */
/* <div class="att" role="radiogroup">
     <input type="radio" id="a12-1" name="att_12" value="1"><label for="a12-1" class="att__yes">Byl</label>
     <input type="radio" id="a12-0" name="att_12" value="0"><label for="a12-0" class="att__no">Nebyl</label>
   </div> */
.att { display: flex; gap: 4px; padding: 3px; border-radius: var(--r-md); background: var(--fill); flex: none; }
.att > input { position: absolute; opacity: 0; pointer-events: none; }
.att > label {
  min-width: 62px; padding: 0 12px; height: var(--tap); border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.att > input:checked + .att__yes { background: var(--green-800); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.att > input:checked + .att__no  { background: var(--err-solid); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.att > input:focus-visible + label { box-shadow: var(--focus); }
.kid-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; min-height: 64px; }
.list > .kid-row + .kid-row { border-top: 1px solid var(--line); }

/* 13. Upozornění, toast, prázdný stav ------------------------------------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); font-size: 14px; line-height: 19px; text-decoration: none; }
.notice .icon { flex: none; }
.notice__title { display: block; font-weight: 600; font-size: 15px; }
.notice-warn  { background: var(--warn-soft); color: var(--warn-ink); }
.notice-warn .icon { color: var(--clay-ink); }
.notice-info  { background: var(--info-soft); color: var(--info-ink); }
.notice-info .icon { color: var(--info-fg); }
.notice-error { background: var(--err-soft); color: #991B1B; }
.notice-error .icon { color: var(--err-fg); }
.notice-ok    { background: #F0FDF4; color: var(--ok-fg); }

.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: 16px; background: rgba(24,24,27,.92); color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 15px;
}
.toast .icon { color: #86EFAC; }
.toast__action { margin-left: auto; background: transparent; border: 0; color: var(--ball); font-weight: 600; min-height: 36px; cursor: pointer; }
.toast-region { position: fixed; left: var(--gutter); right: var(--gutter); bottom: calc(var(--tabbar-h) + 32px); max-width: 528px; margin: 0 auto; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast--auto { animation: toast-out .3s ease-in 6s forwards; }
.toast--warn .icon { color: var(--warn-bg); }
.toast--error .icon { color: var(--err-bg); }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
.admin-main > .notice + .notice { margin-top: -12px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 24px 28px; }
.empty__icon { width: 88px; height: 88px; border-radius: 50%; background: var(--green-50); color: var(--green-800); display: flex; align-items: center; justify-content: center; }
.empty__icon .icon { width: 40px; height: 40px; stroke-width: 1.6; }
.empty__text { margin: 0; max-width: 300px; }

.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 20px; }
.step__n { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--green-50); color: var(--green-800); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* 14. Spodní panel / dialog ----------------------------------------------- */
/* <dialog class="sheet"> … </dialog>, otevřít: dialog.showModal() */
.sheet {
  border: 0; padding: 10px 20px max(28px, env(safe-area-inset-bottom));
  width: 100%; max-width: 560px; margin: auto auto 0;
  border-radius: 28px 28px 0 0; background: #fff; color: var(--ink);
}
.sheet::backdrop { background: rgba(24,24,27,.4); }
.sheet__grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 12px; }
.sheet__body { display: flex; flex-direction: column; gap: 16px; }
.sheet__nav { display: flex; justify-content: space-between; align-items: center; }
.sheet:target:not([open]) {
  display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  max-height: 92vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
@media (min-width: 768px) { .sheet { margin: auto; border-radius: var(--r-xl); max-width: 480px; padding-bottom: 24px; } }

/* 15. Kalendář docházky --------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal__head { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal__cell { height: var(--tap); display: flex; align-items: center; justify-content: center; }
.cal__day {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; font-variant-numeric: tabular-nums;
}
.cal__day.is-present   { background: var(--green-800); color: #fff; font-weight: 600; }
.cal__day.is-absent    { background: var(--err-bg); color: var(--err-fg); box-shadow: inset 0 0 0 1.5px var(--err-ring); font-weight: 600; }
.cal__day.is-planned   { box-shadow: inset 0 0 0 1.5px var(--green-800); color: var(--green-800); font-weight: 600; }
.cal__day.is-cancelled { background: var(--neutral-bg); color: var(--neutral-fg); text-decoration: line-through; }
.cal__day.is-today     { outline: 2px solid var(--clay-ink); outline-offset: 2px; }
.legend__dot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }

/* QR box */
.qr { width: 196px; height: 196px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center; padding: 16px; }
.qr img, .qr svg { width: 100%; height: 100%; }
.card--stack > .qr { align-self: center; }

/* 16. Desktop správa ------------------------------------------------------ */
.env-bar { background: var(--clay); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 6px 16px; }
.env-bar--local { background: var(--ink); font-weight: 500; }
.topbar {
  background: var(--green-900); color: #fff;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 56px; padding: 0 24px;
}
.topbar__brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.topbar__brand b { font-size: 15px; }
.topbar__brand span { font-size: 13px; color: var(--green-200); }
.topbar__logo { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--ball); }
.topbar__nav { display: flex; gap: 4px; }
.topbar__nav a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 10px; color: rgba(255,255,255,.85); font-size: 14px; font-weight: 600; text-decoration: none; }
.topbar__nav a:hover, .topbar__nav a[aria-current] { background: rgba(255,255,255,.14); color: #fff; }
.topbar__end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar__search + .topbar__end { margin-left: 0; }
.topbar__avatar { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.topbar__icon-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: rgba(255,255,255,.85); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.topbar__icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
.topbar__search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.12); min-width: 220px; margin-left: auto; }
.topbar__search input { flex: 1; border: 0; background: transparent; color: #fff; font-size: 14px; outline: none; }
.topbar__search input::placeholder { color: #D1E3D6; }
@media (max-width: 1099px) { .topbar__search { display: none; } .topbar__search + .topbar__end { margin-left: auto; } }
@media (max-width: 767px) { .topbar { padding: 0 16px; } .topbar__nav, .topbar__brand span { display: none; } }
.topbar__avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 13px; font-weight: 700; }

.admin { display: flex; flex-wrap: nowrap; align-items: flex-start; }
.sidenav { flex: 1 1 220px; max-width: 260px; padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidenav__group { padding: 16px 12px 6px; }      /* + .eyebrow */
.sidenav__group:first-child { padding-top: 8px; }
.sidenav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.sidenav a .icon { width: 18px; height: 18px; }
.sidenav a:hover { background: var(--fill); }
.sidenav a.is-active, .sidenav a[aria-current="page"] { background: var(--green-50); color: var(--green-800); font-weight: 600; }
.sidenav a .badge { margin-left: auto; }
.admin-main { flex: 999 1 0; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }
.admin-main--form { max-width: 1120px; padding-bottom: 120px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head__title { margin: 0; font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
.admin-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumbs { font-size: 13px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.split { display: flex; gap: 24px; flex-wrap: wrap; align-items: stretch; }
.split > .split__main { flex: 2 1 520px; min-width: 0; }
.split > .split__side { flex: 1 1 280px; min-width: 0; }

/* Menu správy na telefonu: vodorovné čipy místo bočního panelu */
.admin-chips { display: none; gap: 8px; overflow-x: auto; padding: 12px 16px 0; scrollbar-width: none; }
@media (max-width: 767px) {
  .sidenav { display: none; }
  .admin-chips { display: flex; }
  .admin-main { padding: 20px 16px 120px; }
}
.admin-main .table-scroll + .table-footer { border-top: 1px solid var(--line); }

/* Desktop tlačítka jsou nižší */
.admin .btn { min-height: 40px; padding: 0 16px; font-size: 14px; border-radius: 10px; }

/* 17. Tabulky, filtry, chipy, stránkování -------------------------------- */
.table-card { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 12px 16px; background: var(--row-hover); border-bottom: 1px solid var(--line);
}
.table th a { color: inherit; text-decoration: none; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--row-hover); }
.table tr.is-selected td { background: #F3F8F4; }
.table .r { text-align: right; }
.table tfoot td { font-weight: 700; background: var(--row-hover); border-top: 1px solid var(--line); }
.table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green-800); }
.table--compact td { padding: 8px 12px; }
.table--compact th { padding: 10px 12px; }
.table--compact .input, .table--compact .select { height: 36px; font-size: 14px; }

.capacity { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.capacity__bar { width: 56px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.capacity__bar > i { display: block; height: 100%; width: calc(var(--v, 0) * 1%); background: var(--ok-solid); }
.capacity__bar.is-low > i { background: var(--clay); }

.search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; cursor: pointer;
}
.chip.is-active, .chip[aria-current] { background: var(--ink); color: #fff; box-shadow: none; }

.filter-panel { flex: 1 1 220px; max-width: 280px; padding: 18px 14px; }
.filter-panel h3 { margin: 0 0 6px; padding: 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.filter-panel ul { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.filter-panel a { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink); font-size: 14px; text-decoration: none; }
.filter-panel a:hover { background: var(--fill); }
.filter-panel .selected a, .filter-panel a.is-active { background: var(--green-50); color: var(--green-800); font-weight: 600; }

.pager { display: flex; gap: 4px; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink); text-decoration: none; }
.pager a:hover { background: var(--fill); }
.pager .is-active, .pager .this-page { background: var(--ink); color: #fff; font-weight: 600; }

.fieldset { padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.fieldset__title { margin: 0; font-size: 17px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: span 2; }
.admin .input, .admin .select { height: 42px; font-size: 14px; border-radius: 10px; }
.admin .label { font-size: 13px; }
.add-row { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--green-800); text-decoration: none; }

.submit-bar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 32px;
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 -1px 0 var(--line);
}
.submit-bar__spacer { flex: 1; }

/* 18. Django admin – napojení ------------------------------------------- */
/* Přestylovaný Django admin používá stejné tokeny. Tyto selektory pokrývají
   výchozí markup changelistu a change formu, aby nebylo nutné přepisovat šablony.
   Vše je omezené na body.tm-admin, aby pravidla neovlivnila formuláře aplikace. */
.tm-admin #header { background: var(--green-900); color: #fff; }
.tm-admin #header a:link, .tm-admin #header a:visited { color: #fff; }
.tm-admin #branding h1, .tm-admin #branding h1 a { color: #fff; font-weight: 700; }
.tm-admin div.breadcrumbs { background: transparent; color: var(--muted); padding: 12px 32px 0; }
.tm-admin div.breadcrumbs a { color: var(--muted); }
.tm-admin #content { padding: 20px 32px 48px; }
.tm-admin #content h1 { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.tm-admin .module, .tm-admin #changelist .results, .tm-admin .inline-group {
  background: var(--card); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
}
.tm-admin .module h2, .tm-admin .module caption, .tm-admin .inline-group h2 {
  background: transparent; color: var(--ink); font-size: 17px; font-weight: 600;
  text-transform: none; letter-spacing: 0; padding: 18px 24px 12px;
}
.tm-admin #result_list, .tm-admin .inline-group table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tm-admin #result_list thead th, .tm-admin .inline-group thead th {
  background: var(--row-hover); border-bottom: 1px solid var(--line); color: var(--muted);
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 12px 16px;
}
.tm-admin #result_list thead th a { color: inherit; }
.tm-admin #result_list td, .tm-admin #result_list th, .tm-admin .inline-group td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tm-admin #result_list tbody tr:hover td { background: var(--row-hover); }
.tm-admin #result_list tr.selected td { background: #F3F8F4; }
.tm-admin #changelist #toolbar { background: transparent; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tm-admin #changelist #toolbar #searchbar { height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; }
.tm-admin #changelist .actions { background: transparent; border: 0; padding: 12px 16px; color: var(--muted); }
.tm-admin #changelist .actions select { height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.tm-admin #changelist-filter {
  background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 14px;
}
.tm-admin #changelist-filter h2 { background: transparent; color: var(--ink); font-size: 15px; font-weight: 600; text-transform: none; padding: 0 4px 12px; }
.tm-admin #changelist-filter h3 { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 0 4px; margin: 12px 0 6px; }
.tm-admin #changelist-filter li { list-style: none; }
.tm-admin #changelist-filter li a { display: flex; min-height: 34px; align-items: center; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink); }
.tm-admin #changelist-filter li a:hover { background: var(--fill); }
.tm-admin #changelist-filter li.selected a { background: var(--green-50); color: var(--green-800); font-weight: 600; border: 0; }
.tm-admin .paginator { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.tm-admin .paginator .this-page { background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 6px 10px; }
.tm-admin .paginator a:link, .tm-admin .paginator a:visited { color: var(--ink); border-radius: var(--r-sm); padding: 6px 10px; background: transparent; }
.tm-admin form .form-row { border-bottom: 1px solid var(--line); padding: 14px 24px; }
.tm-admin form .form-row label { font-size: 13px; font-weight: 600; color: var(--ink); }
.tm-admin form input[type="text"], .tm-admin form input[type="number"], .tm-admin form input[type="email"], .tm-admin form input[type="date"],
.tm-admin form input[type="time"], .tm-admin form select, .tm-admin form textarea, .tm-admin .vTextField {
  height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font-size: 14px;
}
.tm-admin form textarea { height: auto; min-height: 88px; padding: 10px 12px; }
.tm-admin .errornote { background: var(--err-soft); color: #991B1B; border: 0; border-radius: var(--r-md); padding: 12px 14px; font-size: 14px; }
.tm-admin ul.errorlist { list-style: none; margin: 6px 0 0; padding: 0; color: var(--err-fg); font-size: 12px; font-weight: 500; background: transparent; }
.tm-admin .errors input, .tm-admin .errors select, .tm-admin .errors textarea { border-color: var(--err-ring); box-shadow: 0 0 0 3px var(--err-bg); }
.tm-admin .help, .tm-admin div.help, .tm-admin p.help { color: var(--muted); font-size: 12px; }
.tm-admin .inline-group .add-row td, .tm-admin .inline-group .add-row a { padding: 12px 16px; color: var(--green-800); font-weight: 600; background: transparent; }
.tm-admin .submit-row {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  margin: 0; padding: 12px 32px; border: 0; border-radius: 0;
  background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 -1px 0 var(--line);
}
.tm-admin .submit-row input, .tm-admin .submit-row a.button, .tm-admin input[type="submit"], .tm-admin .button, .tm-admin a.button {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--green-50); color: var(--green-800); font-size: 14px; font-weight: 600; cursor: pointer;
}
.tm-admin .submit-row input.default, .tm-admin input[type="submit"].default { background: var(--green-800); color: #fff; }
.tm-admin .submit-row a.deletelink, .tm-admin a.deletelink { background: transparent; color: var(--err-fg); margin-right: auto; min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 10px; }
.tm-admin ul.messagelist li { border-radius: var(--r-md); padding: 12px 16px 12px 44px; font-size: 14px; margin-bottom: 8px; }
.tm-admin ul.messagelist li.success { background-color: #F0FDF4; color: var(--ok-fg); }
.tm-admin ul.messagelist li.warning { background-color: var(--warn-soft); color: var(--warn-ink); }
.tm-admin ul.messagelist li.error { background-color: var(--err-soft); color: #991B1B; }

/* 19. Utility ------------------------------------------------------------- */
.stack    { display: flex; flex-direction: column; gap: var(--gap, 12px); }
.cluster  { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, 8px); }
.between  { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grow     { flex: 1; min-width: 0; }
.center   { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.hide-mobile { }
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
@media (min-width: 768px) { .hide-desktop { display: none !important; } }

/* Viditelný focus i u prvků, které mají vlastní box-shadow nebo zrušený outline */
.chip:focus-visible, .fchip:focus-visible, .dchip:focus-visible,
.segmented > a:focus-visible, .segmented > button:focus-visible,
.topbar__search:focus-within, .search:focus-within,
.tm-admin .button:focus-visible, .tm-admin button:focus-visible, .tm-admin input[type="submit"]:focus-visible { box-shadow: var(--focus) !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .tabbar, .topbar, .env-bar, .sidenav, .submit-bar, .submit-row { display: none !important; }
  body { background: #fff; }
  .card, .list, .module { box-shadow: none; border: 1px solid var(--line); }
}

/* 20. Tabulky v2 (Tréninky, Série, Přihlášky) ------------------------------ */
/* Funguje s běžnou <table> i s tabulkou Django adminu (#result_list). */

/* Filtry jako rozbalovací čipy (list_filter) */
.fchip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 0; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--border);
  font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: none;
}
.fchip b { color: var(--ink); font-weight: 600; }
.fchip.is-on { background: var(--green-50); box-shadow: inset 0 0 0 1px #A7CDB2; color: var(--green-800); }
.fchip.is-on b { color: var(--green-800); }
.fchip--warn { background: var(--warn-soft); box-shadow: inset 0 0 0 1px #FDBA74; color: var(--warn-fg); }
.fchip--warn b { color: var(--warn-fg); }

/* date_hierarchy jako čipy */
.dchips { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.dchip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.dchip:hover { background: var(--fill); }
.dchip.is-active { background: var(--ink); color: #fff; }

/* Skupinový řádek (týden / termín tréninku) */
.table .group-row th, .table .group-row td {
  background: #F7F8F5; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 10px 16px; text-align: left; font-size: 14px; font-weight: 700; color: var(--ink);
  text-transform: none; letter-spacing: 0;
}
.table .group-row.is-cancelled th { background: #F4F4F5; }
.group-row__inner { display: flex; align-items: center; gap: 14px; }
.group-row__meta { font-size: 13px; font-weight: 400; color: var(--muted); }
.group-row__sum { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Stavy řádků */
.table tr.is-muted td { color: var(--muted); }
.table tr.is-muted .cell-title { color: var(--muted); text-decoration: line-through; }
.table tr.is-flag td { background: #FFFBF5; }
.table td.nowrap, .table th.nowrap { white-space: nowrap; }

/* Buňky */
.cell-title { font-weight: 600; color: var(--green-800); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 320px; }
.cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.datebox--sm { width: 44px; height: 48px; border-radius: 11px; }
.datebox--sm .datebox__dow { font-size: 10px; }
.datebox--sm .datebox__day { font-size: 18px; line-height: 20px; }
.datebox--outline { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.day-pill { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 28px; border-radius: var(--r-sm); background: var(--fill); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--clay-ink); }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--fill); color: var(--ink); box-shadow: 0 0 0 2px #fff; flex: none; }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -8px; }
.series-dot { width: 10px; height: 36px; border-radius: 5px; flex: none; }
.price-old { text-decoration: line-through; color: var(--muted); font-weight: 400; margin-right: 6px; }
.att-dots { display: inline-flex; gap: 3px; }
.att-dots i { width: 8px; height: 8px; border-radius: 50%; background: #D4D4D8; }
.att-dots i.is-present { background: var(--ok-solid); }
.att-dots i.is-absent { background: var(--err-ring); }

/* Týdenní rozvrh sérií */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-strip__day { display: flex; flex-direction: column; gap: 6px; min-height: 112px; }
.week-strip__head { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.week-strip__empty { flex: 1; border: 1px dashed var(--line); border-radius: 12px; }
.week-block { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--green-50); box-shadow: inset 3px 0 0 var(--block, var(--green-800)); color: var(--ink); text-decoration: none; }
.week-block b { font-size: 14px; }
@media (max-width: 900px) { .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Plovoucí panel hromadných akcí (nahrazuje řádek „Operace“) */
.bulk-bar {
  position: sticky; bottom: 16px; z-index: 30;
  display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 16px 16px; padding: 10px 10px 10px 18px; border-radius: 16px;
  background: rgba(24,24,27,.94); color: #fff; box-shadow: 0 12px 32px rgba(0,0,0,.25);
}
.bulk-bar.is-visible { display: flex; }
.bulk-bar__count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: auto; }
.bulk-bar .btn { background: rgba(255,255,255,.12); color: #fff; }
.bulk-bar .btn-danger-solid { background: var(--err-solid); }
.bulk-bar .btn-link { background: transparent; color: var(--ball); }
