/* =====================================================================
   Rezervační portál Písek — tokeny + komponenty (viz DESIGN.md v1.0)
   Vrství se nad Bootstrap 5.3. Font Inter. Základ 16px.
   ===================================================================== */

:root {
  /* Značka — Centrum kultury města Písek (z logo.svg: #009FE3 + #191918) */
  --c-brand:        #0084BD;  /* CTA/odkazy — ztmavená azurová, AA kontrast na bílé */
  --c-brand-dark:   #006B99;  /* hover */
  --c-brand-bright: #009FE3;  /* čistá brand azurová — akcenty, zvýraznění */
  --c-brand-light:  #E5F5FC;  /* jemné pozadí */

  /* Neutrály (dle loga: ink #191918) */
  --c-ink:     #191918;
  --c-body:    #3A3A3A;
  --c-meta:    #6B6B6B;
  --c-line:    #E4E7E9;
  --c-bg:      #F6F9FB;
  --c-surface: #FFFFFF;

  /* Sémantika */
  --c-success: #1E8A5B; --c-success-bg: #E9F6EF;
  --c-warning: #C77A00; --c-warning-bg: #FBF0DD;
  --c-danger:  #C62828; --c-danger-bg:  #FDECEA;

  /* Kategorie kalendáře */
  --c-cat-skoly: #0084BD; --c-cat-skoly-bg: #E5F5FC;
  --c-cat-verejnost: #6B4FA1; --c-cat-verejnost-bg: #EFEAF7;

  /* Spacing (8px grid) */
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px;
  --space-5: 32px; --space-6: 48px; --space-7: 64px; --space-8: 96px;

  /* Rádiusy, stíny */
  --r-btn: 8px; --r-card: 12px;
  --shadow-card:  0 2px 8px rgba(0,0,0,.06);
  --shadow-hover: 0 6px 20px rgba(0,0,0,.10);
}

/* ---------- Základ ---------- */
html { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-body);
  background: var(--c-bg);
  /* Sticky footer: patička vždy u spodního okraje, i na krátkých stránkách */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; width: 100%; }
h1, h2, h3 { color: var(--c-ink); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.75rem); }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
p  { max-width: 65ch; }
a  { color: var(--c-brand); }
a:hover { color: var(--c-brand-dark); }
.meta { font-size: .875rem; color: var(--c-meta); font-weight: 500; }

/* ---------- Tlačítka ---------- */
.btn-brand {
  background: var(--c-brand); color: #fff; border: 1px solid var(--c-brand);
  border-radius: var(--r-btn); min-height: 44px; font-weight: 600;
  padding: .55rem 1.25rem; display: inline-flex; align-items: center; gap: .4rem;
}
.btn-brand:hover { background: var(--c-brand-dark); border-color: var(--c-brand-dark); color: #fff; }
.btn-brand:disabled, .btn-brand.disabled { opacity: .45; cursor: not-allowed; background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.btn-outline-brand {
  background: transparent; color: var(--c-brand); border: 1px solid var(--c-brand);
  border-radius: var(--r-btn); min-height: 44px; font-weight: 600; padding: .55rem 1.25rem;
}
.btn-outline-brand:hover { background: var(--c-brand-light); color: var(--c-brand-dark); }

/* Focus ring (a11y — nevynechat) */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; box-shadow: 0 0 0 3px rgba(0,132,189,.45);
}

/* ---------- Karty ---------- */
.card-rp {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: var(--space-4); transition: box-shadow .15s ease;
}
@media (hover: hover) { .card-rp:hover { box-shadow: var(--shadow-hover); } }

/* ---------- Rozcestník (dlaždice) ---------- */
.tile {
  display: block; text-decoration: none; color: var(--c-ink);
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: var(--space-5); height: 100%; transition: box-shadow .15s ease, transform .15s ease;
}
@media (hover: hover) { .tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); color: var(--c-ink); } }
.tile:active { transform: scale(.98); }
.tile__icon { font-size: 2.25rem; color: var(--c-brand); margin-bottom: var(--space-2); }
.tile h3 { margin-bottom: var(--space-1); }

/* ---------- Oznámení (announcement) ---------- */
.notice {
  border-left: 4px solid var(--c-warning); background: var(--c-warning-bg);
  border-radius: var(--r-btn); padding: var(--space-3); margin-bottom: var(--space-4);
}
.notice strong { color: var(--c-ink); }

/* ---------- Stavové štítky (kalendář) ---------- */
.badge-rp { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; flex: 0 0 auto; align-self: center;
  font-size: .8125rem; font-weight: 600; padding: .2rem .55rem; border-radius: var(--r-pill, 9999px); }
.st-volno    { background: var(--c-success-bg); color: var(--c-success); }
.st-castecne { background: var(--c-brand-light); color: var(--c-brand-dark); }
.st-obsazeno { background: var(--c-danger-bg);  color: var(--c-danger); }
.st-skoly    { background: var(--c-cat-skoly-bg); color: var(--c-cat-skoly); }
.st-verejnost{ background: var(--c-cat-verejnost-bg); color: var(--c-cat-verejnost); }
.st-servis   { background: var(--c-warning-bg); color: var(--c-warning); }

/* ---------- Formuláře ---------- */
.form-label { font-weight: 600; font-size: .875rem; color: var(--c-ink); }
.form-control, .form-select { min-height: 44px; border-color: var(--c-line); }
.form-control:focus, .form-select:focus { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(0,132,189,.18); }
.field-error { color: var(--c-danger); font-size: .8125rem; margin-top: .25rem; }
.is-invalid { border-color: var(--c-danger) !important; }

/* ---------- Hlavička / patička ---------- */
.site-header { background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
.site-header .brand { font-weight: 800; color: var(--c-brand); text-decoration: none; font-size: 1.15rem; }
.site-footer { background: var(--c-ink); color: #d6d6d6; margin-top: auto; flex-shrink: 0; }
.site-footer a { color: #fff; }

/* ---------- Prázdný stav ---------- */
.empty-state { text-align: center; color: var(--c-meta); padding: var(--space-6) var(--space-3); }

/* ---------- Admin: navigace ---------- */
.site-header .nav-link { color: var(--c-body); font-weight: 500; border-radius: var(--r-btn); padding: .5rem 1rem; }
.site-header .nav-link:hover { background: var(--c-bg); color: var(--c-ink); }
.site-header .nav-link.active { background: var(--c-brand-light); color: var(--c-brand-dark); font-weight: 600; }

/* Ikony v navigaci jen na velkých monitorech (PC); na NTB text, na mobilu hamburger */
.nav-ico { display: none; }
@media (min-width: 1400px) { .nav-ico { display: inline; } }
/* V rozbaleném hamburgeru (mobil) ikony zobraz — pomáhají orientaci */
@media (max-width: 991.98px) { .nav-ico { display: inline; } }

/* ---------- Admin: hlavička stránky ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); }
.page-head h1 { margin-bottom: 2px; }
.page-head .sub { color: var(--c-meta); font-size: .9rem; }


/* ---------- Sekční karta (jako Nastavení) ---------- */
.sec-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: var(--space-4); }
.sec-card__head { display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  background: var(--c-bg); border-bottom: 1px solid var(--c-line); }
.sec-card__head h3 { margin: 0; font-size: 1.05rem; }
.sec-card__head .meta { display: block; font-size: .8rem; }
.sec-card__body { padding: 0; }
.sec-card__body--pad { padding: var(--space-4); }

/* ---------- Tabulky (admin) ---------- */
.table-rp { margin: 0; }
.table-rp thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-meta); font-weight: 600; background: var(--c-bg); border-bottom: 1px solid var(--c-line);
  padding: 10px 16px; white-space: nowrap; }
.table-rp tbody td { padding: 12px 16px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table-rp tbody tr:last-child td { border-bottom: 0; }
.table-rp tbody tr:hover { background: var(--c-bg); }

/* ---------- Timeline rozvrh (styl Vinobraní schedule) ---------- */
.tl-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px;
  box-shadow: var(--shadow-card); overflow: hidden; }
.tl-wrap { overflow-x: auto; }
.tl { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1050px; }
.tl thead th { font-size: .75rem; color: var(--c-meta); font-weight: 600; padding: 14px 6px 10px;
  text-align: center; border-bottom: 1px solid var(--c-line); background: var(--c-surface); }
.tl-day { position: sticky; left: 0; background: var(--c-surface); z-index: 2; min-width: 150px;
  width: 150px; padding: 10px 14px !important; border-right: 1px solid var(--c-line); text-align: left; }
.tl-day .bar { position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 2px; background: var(--c-brand-bright); }
.tl-day.tl-today .bar { background: var(--c-success); }
.tl-day { position: sticky; }
.tl-day strong { display: block; color: var(--c-ink); font-size: .9rem; }
.tl-day small { color: var(--c-meta); font-size: .74rem; }
.tl tbody td { border-bottom: 1px solid var(--c-line); padding: 8px 5px; height: 66px;
  background-image: radial-gradient(var(--c-line) 1px, transparent 1px); background-size: 13px 13px;
  background-position: center; }
.tl tbody tr:last-child td { border-bottom: 0; }
.tl tbody td.tl-day { background-image: none; position: relative; }

/* Sloty jako pilulky */
.pill { display: flex; flex-direction: column; justify-content: center; gap: 1px;
  min-height: 48px; margin: 0 auto; max-width: 120px; border-radius: 10px; padding: 6px 9px;
  font-size: .72rem; line-height: 1.25; text-align: left; text-decoration: none;
  box-shadow: 0 1px 2px rgba(25,25,24,.10); }
.pill strong { font-size: .75rem; font-weight: 700; }
.pill small { opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.pill { transition: transform .12s ease, box-shadow .12s ease; }
@media (hover: hover) { a.pill:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(25,25,24,.18); color: inherit; } }
a.pill:active { transform: scale(.97); }
a.pill:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(0,132,189,.45); }

/* Kapacitní teploměr uvnitř pilulky */
.pill { position: relative; }
.pill .cap { display: block; height: 4px; border-radius: 2px; margin-top: 3px;
  background: rgba(25,25,24,.12); overflow: hidden; }
.pill .cap i { display: block; height: 100%; border-radius: 2px; background: currentColor; }
.pill-cast .cap { background: rgba(255,255,255,.35); }
.pill-cast .cap i { background: #fff; }

.pill-volno { background: var(--c-surface); color: var(--c-success); border: 1.5px dashed var(--c-success); box-shadow: none; }
.pill-cast  { background: var(--c-brand-bright); color: #fff; }
.pill-plno  { background: #ECECEC; color: #6B6B6B; }
.pill-mine  { background: var(--c-surface); color: var(--c-brand); border: 2px solid var(--c-brand-bright); }
.pill-verej { background: var(--c-cat-verejnost-bg); color: var(--c-cat-verejnost); box-shadow: none; }
.pill-servis{ background: repeating-linear-gradient(45deg, var(--c-warning-bg), var(--c-warning-bg) 7px, #fff 7px, #fff 14px);
  color: var(--c-warning); box-shadow: none; }

/* Přepínač týdnů (buttony) */
.tl-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--space-3); }
.tl-jump a { display: inline-block; background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: 999px; padding: .35rem 1rem; font-size: .82rem;
  color: var(--c-body); text-decoration: none; }
.tl-jump a strong { color: var(--c-brand); }
.tl-jump a:hover { background: var(--c-brand-light); }
.tl-jump a.active { background: var(--c-brand); border-color: var(--c-brand); color: #fff; }
.tl-jump a.active strong { color: #fff; }

/* Zamčený blok (vlastník nepřijímá další třídy) */
.pill-lock { background: #F1F3F4; color: #5A6B75; border: 1.5px solid #B9C4CB; box-shadow: none; }

/* Ztlumení cizích rezervací (pohled Moje) */
.pill-dim { filter: grayscale(1); opacity: .45; }

/* Plná šířka textu (přebíjí p{max-width:65ch}) */
.fullw { max-width: none !important; }

/* Lišta pravidel — celá šířka, přehledné položky */
.rules-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; width: 100%;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 10px 16px; font-size: .85rem; color: var(--c-body); }
.rules-bar i { color: var(--c-brand); margin-right: 4px; }

/* Plovoucí detail (tooltip) */
.hover-tip { position: fixed; z-index: 1050; max-width: 280px; pointer-events: none;
  background: var(--c-ink); color: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: .78rem; line-height: 1.45; box-shadow: 0 8px 24px rgba(25,25,24,.35); }
.hover-tip strong { color: #fff; }
.hover-tip em { color: #cfd8dc; font-style: normal; }
.hover-tip .tip-cta { display: inline-block; margin-top: 4px; color: #7fd4ff; font-weight: 600; }


/* ---------- Responzivní tabulka → karty (mobil) ---------- */
@media (max-width: 767.98px) {
  .table-cards thead { display: none; }
  .table-cards tr { display: block; background: var(--c-surface); border: 1px solid var(--c-line);
    border-radius: var(--r-card); margin-bottom: var(--space-3); padding: var(--space-3); }
  .table-cards td { display: flex; justify-content: space-between; gap: var(--space-3);
    border: 0; padding: .35rem 0; }
  .table-cards td::before { content: attr(data-label); font-weight: 600; color: var(--c-meta); }
}

/* =====================================================================
   App shell — mobil jako aplikace (tab bar, sheety, seznam místo tabulky)
   Breakpointy: veřejná část tab bar < md (768), admin < lg (992).
   ===================================================================== */
:root { --tabbar-h: 64px; --r-sheet: 20px; --ease-out: cubic-bezier(.2, .8, .2, 1); }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
a, button, .btn, .pill, label, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn-brand:active { background: var(--c-brand-dark); border-color: var(--c-brand-dark); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--c-surface);
  padding: 8px 12px; border-radius: var(--r-btn); box-shadow: var(--shadow-hover); }
.skip-link:focus { left: 8px; }

.app-main { padding-top: var(--space-4); padding-bottom: var(--space-5); }
.app-bar { position: sticky; top: 0; z-index: 1020; padding-top: env(safe-area-inset-top); }
.brand-logo { height: 40px; width: auto; }
.app-bar__action { margin-left: auto; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; color: var(--c-body); font-size: 1.35rem; text-decoration: none; }
.app-bar__action:active { background: var(--c-bg); }
.admin-badge { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--c-brand-dark); background: var(--c-brand-light); border-radius: 999px; padding: .15rem .55rem; }

/* ---------- Spodní tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: grid;
  grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--c-surface);
  border-top: 1px solid var(--c-line); box-shadow: 0 -2px 12px rgba(25,25,24,.06);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; padding: 0; border: 0; background: none; font: inherit; color: var(--c-meta);
  text-decoration: none; cursor: pointer; }
.tabbar__ico { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px;
  font-size: 1.25rem; transition: background-color .2s var(--ease-out), color .2s var(--ease-out); }
.tabbar__lbl { font-size: .75rem; font-weight: 600; line-height: 1.1; }
.tabbar__item.active { color: var(--c-brand-dark); }
.tabbar__item.active .tabbar__ico { background: var(--c-brand-light); }
.tabbar__item:active .tabbar__ico { background: var(--c-line); }
.tabbar__item:focus-visible { outline: none; }
.tabbar__item:focus-visible .tabbar__ico { box-shadow: 0 0 0 3px rgba(0,132,189,.45); }
/* Prostřední akce (admin: + Nová) */
.tabbar__item--fab { color: var(--c-brand-dark); }
.tabbar__item--fab .tabbar__ico { width: 50px; height: 50px; margin-top: -24px; border-radius: 16px;
  background: var(--c-brand); color: #fff; font-size: 1.45rem; box-shadow: 0 6px 16px rgba(0,132,189,.35); }
.tabbar__item--fab.active .tabbar__ico, .tabbar__item--fab:active .tabbar__ico { background: var(--c-brand-dark); }

@media (max-width: 767.98px) {
  body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}
@media (max-width: 991.98px) {
  body.has-tabbar--lg { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}

/* ---------- Spodní panely (sheet): Více v adminu, rezervační modal, detail termínu ---------- */
.sheet-grip { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--c-line); margin: 10px auto 0; }
.sheet-more { height: auto !important; max-height: 85dvh; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  padding-bottom: env(safe-area-inset-bottom); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-grid__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 80px; padding: 12px 6px; border-radius: 14px; background: var(--c-bg); color: var(--c-ink);
  text-decoration: none; font-size: .85rem; font-weight: 600; text-align: center; line-height: 1.2; }
.more-grid__item i { font-size: 1.4rem; color: var(--c-brand); }
.more-grid__item.active { background: var(--c-brand-light); color: var(--c-brand-dark); }
.more-grid__item:active { background: var(--c-line); }

.modal-sheet .sheet-grip { display: none; }
@media (max-width: 575.98px) {
  .modal-sheet .modal-dialog { margin: 0; max-width: none; min-height: 100%; display: flex; align-items: flex-end; }
  .modal-sheet.fade .modal-dialog { transform: translateY(100%); transition: transform .28s var(--ease-out); }
  .modal-sheet.show .modal-dialog { transform: none; }
  .modal-sheet .modal-content { border: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0;
    padding-bottom: env(safe-area-inset-bottom); }
  .modal-sheet .sheet-grip { display: block; }
  .modal-sheet .modal-footer { flex-wrap: nowrap; }
  .modal-sheet .modal-footer > .btn { flex: 1; justify-content: center; }
}

.tip-sheet { position: fixed; left: 8px; right: 8px; z-index: 1040;
  bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom));
  background: var(--c-ink); color: #fff; border-radius: 16px; padding: 16px;
  box-shadow: 0 12px 32px rgba(25,25,24,.35); font-size: .9rem; line-height: 1.5;
  animation: sheetIn .22s var(--ease-out); }
.tip-sheet strong { color: #fff; }
.tip-sheet em { color: #cfd8dc; font-style: normal; }
.tip-sheet .tip-cta { display: none; }
.tip-sheet .btn-outline-brand { color: #fff; border-color: rgba(255,255,255,.45); }
@media (min-width: 992px) { .tip-sheet { bottom: 16px; left: auto; right: 16px; max-width: 360px; } }
@keyframes sheetIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Úvodní dlaždice: na mobilu řádky seznamu ---------- */
.tile__chev { display: none; }

/* ---------- Kompaktní mobil ---------- */
@media (max-width: 767.98px) {
  .app-main { padding-top: var(--space-3); }
  .brand-logo { height: 34px; }
  .card-rp { padding: var(--space-3); }
  .sec-card__head { padding: 12px 16px; }
  .sec-card__body--pad { padding: var(--space-3); }
  .page-head { margin-bottom: var(--space-3); }
  .site-footer .container { padding-top: var(--space-3) !important; padding-bottom: var(--space-3) !important; font-size: .875rem; }

  .tile { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); }
  .tile__icon { flex: 0 0 52px; height: 52px; display: grid; place-items: center; margin: 0;
    font-size: 1.5rem; background: var(--c-brand-light); border-radius: 14px; }
  .tile__body { flex: 1; min-width: 0; }
  .tile h3 { font-size: 1.05rem; margin-bottom: 2px; }
  .tile__chev { display: block; color: var(--c-meta); font-size: 1.1rem; }

  .rules-bar { display: grid; gap: 6px; }

  /* Týdny: vodorovně posuvný pás čipů */
  .tl-jump { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-left: calc(var(--bs-gutter-x, 1.5rem) * -.5); margin-right: calc(var(--bs-gutter-x, 1.5rem) * -.5);
    padding: 2px calc(var(--bs-gutter-x, 1.5rem) * .5) 6px; }
  .tl-jump::-webkit-scrollbar { display: none; }
  .tl-jump a { flex: 0 0 auto; scroll-snap-align: start; min-height: 40px; display: inline-flex;
    align-items: center; gap: 4px; white-space: nowrap; }

  /* Kalendář: místo široké tabulky seznam dnů s dlaždicemi bloků */
  .tl-wrap { overflow: visible; }
  .tl, .tl tbody { display: block; width: 100%; min-width: 0 !important; }
  .tl thead { display: none; }
  .tl tbody tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
    padding: 14px 12px; border-bottom: 1px solid var(--c-line); }
  .tl tbody tr:last-child { border-bottom: 0; }
  .tl tbody td { display: block; height: auto; padding: 0 !important; border: 0 !important;
    background: none !important; text-align: left !important; }
  .tl tbody td:empty { display: none; }
  .tl tbody td.tl-day { grid-column: 1 / -1; position: relative; width: auto; min-width: 0;
    padding: 0 0 2px 12px !important; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .tl-day .bar { top: 2px; bottom: 2px; }
  .tl-day strong { font-size: 1rem; }
  .tl-day small { font-size: .8rem; text-align: right; }
  .tl .pill { max-width: none !important; width: 100%; margin: 0 !important; min-height: 56px;
    padding: 8px 12px; font-size: .8rem; border-radius: 12px; }
  .tl .pill strong { font-size: .875rem; }

  /* Tabulky → karty: přebij odsazení .table-rp */
  .table-cards tr { box-shadow: var(--shadow-card); }
  .table-cards.table-rp tbody td { padding: .35rem 0; border: 0; }
  .table-cards.table-rp tbody tr:hover { background: var(--c-surface); }
  .table-cards td::before { flex: 0 0 auto; }
}

/* ---------- Admin: nová rezervace ---------- */
.book-layout { display: grid; gap: 0 var(--space-4); }
@media (min-width: 992px) {
  .book-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
}
.step-num { flex: 0 0 28px; display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--c-brand); color: #fff; font-weight: 700; font-size: .875rem; }
.step-num.is-muted { background: var(--c-line); color: var(--c-meta); }

.seg { display: flex; gap: 4px; padding: 4px; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: 12px; }
.seg > a, .seg > label { flex: 1; min-width: 0; margin: 0; position: relative; }
.seg > a, .seg > label > span { display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 8px; border-radius: 9px; color: var(--c-body); text-decoration: none;
  font-weight: 600; font-size: .9rem; text-align: center; line-height: 1.2; cursor: pointer;
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.seg > a.active, .seg input:checked + span { background: var(--c-surface); color: var(--c-brand-dark);
  box-shadow: 0 1px 3px rgba(25,25,24,.14); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,132,189,.45); }

.day-nav { display: flex; gap: 8px; align-items: stretch; }
.day-nav .btn { flex: 0 0 48px; display: grid; place-items: center; padding: 0; }
.day-nav .form-control { flex: 1; min-width: 0; text-align: center; font-weight: 600; }

.slot-list { display: grid; gap: 8px; }
@media (min-width: 576px) and (max-width: 991.98px) { .slot-list { grid-template-columns: 1fr 1fr; } }
.slot-opt { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 4px 12px; min-height: 56px; padding: 12px 14px; overflow: hidden; border: 1.5px solid var(--c-line);
  border-radius: 12px; background: var(--c-surface); color: var(--c-ink); text-decoration: none;
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out); }
@media (hover: hover) { a.slot-opt:hover { border-color: var(--c-brand-bright); color: var(--c-ink); } }
a.slot-opt:active { background: var(--c-brand-light); }
.slot-opt__time { font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-opt__info { font-size: .875rem; color: var(--c-body); }
.slot-opt__info small { display: block; color: var(--c-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-opt__ico { color: var(--c-meta); font-size: 1.1rem; }
.slot-opt__cap { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c-line); }
.slot-opt__cap i { display: block; height: 100%; background: var(--c-brand-bright); }
.slot-opt.is-selected { border-color: var(--c-brand); background: var(--c-brand-light); }
.slot-opt.is-selected .slot-opt__ico { color: var(--c-brand); }
.slot-opt.is-disabled { background: var(--c-bg); color: var(--c-meta); border-style: dashed; }
.slot-opt.is-disabled .slot-opt__time { color: var(--c-meta); font-weight: 600; }
.slot-opt.is-disabled .slot-opt__info { color: var(--c-meta); }

.pick-summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-card);
  background: var(--c-brand); color: #fff; }
.pick-summary > i { font-size: 1.5rem; }
.pick-summary strong { display: block; color: #fff; }
.pick-summary span { font-size: .9rem; }

.form-switch .form-check-input { width: 2.6em; height: 1.4em; margin-top: .1em; cursor: pointer; }
.form-switch .form-check-input:checked { background-color: var(--c-brand); border-color: var(--c-brand); }
.form-switch .form-check-label { padding-left: .4rem; cursor: pointer; }

.sticky-actions { position: sticky; z-index: 5; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 12px 0; background: var(--c-bg); }
@media (min-width: 992px) { .sticky-actions { position: static; padding: 0; background: none; } }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Barvy škol: proužek v kalendáři, tečka v seznamech ---------- */
.pill.pill-sk { box-shadow: inset 5px 0 0 var(--sk); padding-left: 14px; }
@media (hover: hover) { a.pill.pill-sk:hover { box-shadow: inset 5px 0 0 var(--sk), 0 4px 10px rgba(25,25,24,.18); } }
.sk-dot { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%;
  background: var(--sk); box-shadow: 0 0 0 1px rgba(25,25,24,.12); vertical-align: -1px; margin-right: 6px; }
.sk-bar { display: inline-block; width: 5px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 4px;
  background: linear-gradient(#E4572E 0 33%, #1982C4 33% 66%, #6BA32E 66%); }
.color-input { width: 52px; height: 44px; padding: 4px; border-radius: var(--r-btn); cursor: pointer; }

/* ---------- Admin: detail bloku ---------- */
.cap-bar { height: 8px; border-radius: 4px; background: var(--c-line); overflow: hidden; }
.cap-bar i { display: block; height: 100%; background: var(--c-brand-bright); border-radius: 4px; }
.res-list { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .res-list { grid-template-columns: 1fr 1fr; } }
.res-item { border-left: 5px solid var(--sk); }
.res-item h3 { font-size: 1.05rem; }
.min-w-0 { min-width: 0; }

/* ---------- Admin: místa (Přehled) a odkazy u Rozvrhu ---------- */
.place-grid { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .place-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.place-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.place-card__head { display: flex; gap: 12px; align-items: flex-start; }
.place-card__ico { flex: 0 0 48px; height: 48px; display: grid; place-items: center; border-radius: 14px;
  background: var(--c-brand-light); color: var(--c-brand); font-size: 1.4rem; }
.place-card h3 { font-size: 1.1rem; margin: 0 0 4px; }
.place-url { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.place-url a { font-size: .875rem; font-weight: 600; min-width: 0; word-break: break-all; }
.place-url .btn { flex: 0 0 auto; min-height: 32px; padding: 2px 10px; font-size: .8rem; }
.place-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.place-stats > div { background: var(--c-bg); border-radius: 10px; padding: 8px 4px; }
.place-stats strong { display: block; font-size: 1.35rem; color: var(--c-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.place-stats span { font-size: .78rem; color: var(--c-meta); }
.place-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.place-actions .btn { justify-content: center; display: inline-flex; align-items: center; gap: 6px; font-size: .875rem;
  white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.place-links { display: flex; flex-wrap: wrap; gap: 8px; }
.place-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px;
  border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-surface); font-size: .875rem;
  font-weight: 600; text-decoration: none; }
.place-links a:hover { background: var(--c-brand-light); }

/* ---------- Admin: klikací dlaždice čísel (Přehled) ---------- */
.stat-link { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; padding: var(--space-3);
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  text-decoration: none; color: var(--c-meta); transition: box-shadow .15s var(--ease-out), border-color .15s var(--ease-out); }
.stat-link > i { font-size: 1.3rem; color: var(--c-brand); }
.stat-link strong { font-size: 1.75rem; font-weight: 800; color: var(--c-brand); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-link span { font-size: .875rem; font-weight: 600; }
.stat-link span i { font-size: .75rem; }
@media (hover: hover) { .stat-link:hover { border-color: var(--c-brand-bright); box-shadow: var(--shadow-hover); color: var(--c-ink); } }
.stat-link:active { background: var(--c-brand-light); }

/* ---------- Admin: Provozní doba (úpravy v řádku) ---------- */
.oh-grid { display: grid; gap: 0 var(--space-3); }
@media (min-width: 1200px) { .oh-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.oh-day { scroll-margin-top: 90px; }
.oh-day .sec-card__head { flex-wrap: wrap; }
.oh-copy { display: flex; gap: 6px; align-items: center; }
.oh-copy .form-select { width: auto; min-height: 36px; }
.oh-copy .btn { min-height: 36px; white-space: nowrap; }
.oh-body { padding: 8px 16px 12px; }
.oh-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px 8px 8px 12px; margin: 6px 0; border-radius: 10px; border: 1px solid var(--c-line);
  border-left: 5px solid var(--oh, var(--c-line)); background: var(--c-surface); }
.oh-row[data-typ="skoly"] { --oh: var(--c-cat-skoly); }
.oh-row[data-typ="verejnost"] { --oh: var(--c-cat-verejnost); }
.oh-row[data-typ="tech_prestavka"] { --oh: var(--c-warning);
  background: repeating-linear-gradient(45deg, var(--c-surface), var(--c-surface) 9px, var(--c-warning-bg) 9px, var(--c-warning-bg) 12px); }
.oh-row.is-dirty { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(0,132,189,.12); }
.oh-row.is-conflict { border-color: var(--c-danger); box-shadow: 0 0 0 3px rgba(198,40,40,.15); }
.oh-times { display: flex; align-items: center; gap: 4px; }
.oh-times .form-control { width: 104px; padding-left: 8px; padding-right: 4px; font-variant-numeric: tabular-nums; }
.oh-typ { font-weight: 600; }
.oh-row[data-typ="skoly"] .oh-typ { color: var(--c-cat-skoly); }
.oh-row[data-typ="verejnost"] .oh-typ { color: var(--c-cat-verejnost); }
.oh-row[data-typ="tech_prestavka"] .oh-typ { color: var(--c-warning); }
.oh-actions { display: flex; gap: 6px; }
.oh-actions .btn { min-height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.oh-hint { grid-column: 1 / -1; font-size: .85rem; font-weight: 600; color: var(--c-danger); }
.oh-hint.is-note { color: var(--c-meta); font-weight: 500; }
.oh-add summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 6px 12px; min-height: 40px; border-radius: 999px; color: var(--c-brand); font-weight: 600; border: 1px dashed var(--c-brand); }
.oh-add summary::-webkit-details-marker { display: none; }
.oh-add[open] summary { margin-bottom: 2px; }
.oh-row--new { border-style: dashed; }
@media (max-width: 575.98px) {
  .oh-row { grid-template-columns: 1fr auto; }
  .oh-times { grid-column: 1 / -1; }
  .oh-times .form-control { flex: 1; width: auto; }
}

/* ---------- Vypnuté místo (text z Nastavení) ---------- */
.closed-place { max-width: 560px; margin: var(--space-5) auto; text-align: center; padding: var(--space-5) var(--space-4); }
.closed-place__ico { width: 64px; height: 64px; margin: 0 auto var(--space-3); display: grid; place-items: center;
  border-radius: 18px; background: var(--c-brand-light); color: var(--c-brand); font-size: 1.8rem; }
.closed-place p { margin: var(--space-3) auto var(--space-4); font-size: 1.05rem; }

/* ---------- Kalendář: místo jen s celodenními termíny (stánek) — široké pruhy ---------- */
.tl--fullday thead th:not(.tl-day) { text-align: left; padding-left: 16px; }
.tl--fullday tbody td:not(.tl-day) { padding: 8px 16px; background-image: none; }
.tl--fullday .pill { position: relative; max-width: none; width: 100%; margin: 0; flex-direction: row; align-items: center;
  justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; font-size: .85rem; }
.tl--fullday .pill strong { font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.tl--fullday .pill small { white-space: normal; text-align: right; font-size: .85rem; }
.tl--fullday .pill.pill-sk { padding-left: 18px; }
.tl--fullday .pill .cap { position: absolute; left: 16px; right: 16px; bottom: 5px; margin: 0; }
@media (max-width: 767.98px) { .tl--fullday tbody tr { grid-template-columns: 1fr; } }

/* ---------- Registrace: „Kdo se registruje?" ---------- */
.role-cards { display: grid; gap: 8px; }
.role-card { position: relative; display: block; margin: 0; cursor: pointer; }
.role-card input { position: absolute; opacity: 0; pointer-events: none; }
.role-card__box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px;
  border: 1.5px solid var(--c-line); border-radius: 12px; background: var(--c-surface);
  transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out); }
.role-card__box > i { font-size: 1.4rem; color: var(--c-brand); flex: 0 0 auto; }
.role-card__box strong { display: block; color: var(--c-ink); font-size: .95rem; }
.role-card__box small { display: block; color: var(--c-meta); font-size: .85rem; }
.role-card input:checked + .role-card__box { border-color: var(--c-brand); background: var(--c-brand-light); box-shadow: 0 0 0 3px rgba(0,132,189,.12); }
.role-card input:focus-visible + .role-card__box { box-shadow: 0 0 0 3px rgba(0,132,189,.45); }
@media (hover: hover) { .role-card:hover .role-card__box { border-color: var(--c-brand-bright); } }

/* ---------- Admin: rezervace uživatele (rozbalení v Uživatelích) ---------- */
.res-toggle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; min-height: 36px; padding: 2px 10px; border: 1px solid var(--c-line); border-radius: 999px;
  background: var(--c-surface); font-weight: 700; color: var(--c-brand-dark); }
.res-toggle i { transition: transform .2s var(--ease-out); font-size: .75rem; }
.res-toggle[aria-expanded="true"] { background: var(--c-brand-light); border-color: var(--c-brand); }
.res-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.table-rp tbody tr.user-res td { background: var(--c-bg); padding: 8px 16px 12px; }
.user-res__list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.user-res__list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 12px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 10px; }
.user-res__list li.is-past { opacity: .6; }
.user-res__when { font-weight: 700; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.user-res__what { flex: 1; min-width: 0; font-size: .9rem; }
@media (max-width: 767.98px) {
  .table-cards tr.user-res { padding: 8px; }
  .table-cards tr.user-res td { display: block; padding: 0; }
  .table-cards tr.user-res td::before { content: none; }
  .user-res__when, .user-res__what { flex: 1 1 100%; }
}

/* ---------- Admin: odpočet do spuštění místa ---------- */
.countdown { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 10px; border-radius: 10px;
  background: var(--c-warning-bg); color: var(--c-warning); font-size: .875rem; font-weight: 600; }
.countdown strong { color: var(--c-ink); }
.countdown .js-countdown { font-variant-numeric: tabular-nums; color: var(--c-ink); }
.countdown.is-live { background: var(--c-success-bg); color: var(--c-success); }
.form-label + .meta + .countdown, .d-flex + .countdown { margin-top: 6px; }

/* ---------- Nastavení: podnadpisy v bloku místa ---------- */
.set-subhead { margin: 18px 0 2px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-brand-dark); }
.set-subhead:first-child { margin-top: 8px; }

/* ---------- Úvod: místo, které se brzy spustí ---------- */
.tile--soon { border-style: dashed; }
.tile--soon .tile__icon { opacity: .7; }
.tile .countdown { margin-top: 8px; font-size: .8rem; }

/* ---------- Úvod: spuštěné místo ---------- */
.live-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; border-radius: 999px;
  background: var(--c-success-bg); color: var(--c-success); font-size: .8rem; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-success); box-shadow: 0 0 0 0 rgba(30,138,91,.5);
  animation: livePulse 2s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(30,138,91,.5); } 70% { box-shadow: 0 0 0 7px rgba(30,138,91,0); } 100% { box-shadow: 0 0 0 0 rgba(30,138,91,0); } }
