/* ==========================================================================
   IS Paběnický Mlýn – centrální styly
   Pravidla: žádné inline styly ani skripty (vynucuje CSP + test), vše přes tokeny
   a komponenty níže. Světlý i tmavý režim podle systému.
   ========================================================================== */

/* ---------- 1. Tokeny ---------- */
:root {
  color-scheme: light dark;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1c211e;
  --text-muted: #5f6963;
  --border: #dedad0;
  --border-strong: #c5c0b3;

  --accent: #2d6a4f;
  --accent-hover: #245a42;
  --accent-soft: #e2efe8;
  --on-accent: #ffffff;

  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warning: #8a5a00;
  --warning-soft: #fff4d6;
  --success: #1e6b3c;
  --success-soft: #e3f3e8;
  --info-soft: #e8f0fb;

  --focus: #1f6feb;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgb(20 30 25 / 6%);
  --shadow: 0 1px 3px rgb(20 30 25 / 8%), 0 4px 16px rgb(20 30 25 / 6%);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --sidebar-width: 232px;
  --content-max: 1120px;
  --control-height: 42px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121513;
    --surface: #1a1e1c;
    --surface-2: #222724;
    --text: #e7eae8;
    --text-muted: #9ba59f;
    --border: #2e3431;
    --border-strong: #3d4541;

    --accent: #5fb38a;
    --accent-hover: #74c49c;
    --accent-soft: #1d3329;
    --on-accent: #0c120f;

    --danger: #ef7d73;
    --danger-soft: #3a1f1c;
    --warning: #e8b84f;
    --warning-soft: #352b14;
    --success: #6fcf97;
    --success-soft: #183022;
    --info-soft: #1b2636;

    --focus: #6ea8fe;
    --shadow-sm: none;
    --shadow: 0 1px 0 rgb(255 255 255 / 3%);
  }
}

/* ---------- 2. Základ ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Atribut hidden má vždy přednost před display z komponent (.form, .card…) */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 15px/1.55 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 var(--space-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

code, kbd { font-family: var(--font-mono); font-size: 0.92em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.skip-link:focus { top: var(--space-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- 3. Rozvržení aplikace ---------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-3);
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand__mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.85rem;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__section {
  margin: var(--space-4) var(--space-3) var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.nav__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}
.nav__link:hover { background: var(--surface-2); color: var(--text); }
.nav__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.sidebar__user {
  margin-top: auto;
  padding: var(--space-3);
  border-top: 1px solid var(--border);
  display: grid;
  gap: var(--space-2);
}
.sidebar__user-name { font-weight: 600; }
.sidebar__user-role { font-size: 0.85rem; color: var(--text-muted); }

.topbar { display: none; }

.content {
  min-width: 0;
  padding: var(--space-6) var(--space-5) var(--space-7);
}
.content__inner { max-width: var(--content-max); margin: 0 auto; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; align-content: start; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: min(85vw, 300px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .app[data-nav-open] .sidebar { transform: none; }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgb(0 0 0 / 35%);
  }
  .content { padding: var(--space-5) var(--space-4) var(--space-7); }
}

/* Stránky bez přihlášení (přihlášení, obnova hesla) */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5) var(--space-4);
}
.auth__box { width: 100%; max-width: 400px; }
.auth__brand { justify-content: center; margin-bottom: var(--space-5); font-size: 1.1rem; }
.auth__title { margin-bottom: var(--space-2); }
.auth__lead { color: var(--text-muted); margin-bottom: var(--space-5); }

/* ---------- 4. Hlavička stránky ---------- */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
}
.page-header__lead { margin: var(--space-1) 0 0; color: var(--text-muted); max-width: 60ch; }

/* ---------- 5. Karty a mřížky ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.card + .card, .card + .stack, .stack + .card { margin-top: var(--space-4); }
.card__header { margin-bottom: var(--space-4); }
.card__title { margin-bottom: var(--space-1); }
.card__lead { color: var(--text-muted); margin: 0; }
.card--flush { padding: 0; overflow: hidden; }

.stack { display: grid; gap: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }

.tiles {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.tile {
  display: grid;
  gap: var(--space-2);
  align-content: start;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
}
.tile--link { transition: border-color 0.15s, box-shadow 0.15s; }
.tile--link:hover { border-color: var(--accent); box-shadow: var(--shadow); color: var(--text); }
.tile__title { font-weight: 650; }
.tile__text { color: var(--text-muted); font-size: 0.93rem; }

.muted { color: var(--text-muted); }
.text-small { font-size: 0.88rem; }

/* ---------- 6. Formuláře ---------- */
.form { display: grid; gap: var(--space-4); }
.form-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
/* fieldset s legendou – legenda jako běžný nadpis oddílu (float trik), oddíl oddělený čarou */
.form-section { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-section__title {
  float: left;
  width: 100%;
  padding: var(--space-4) 0 0;
  margin-bottom: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 650;
}
.form-section__title ~ * { clear: both; }
.form-section > * + * { margin-top: var(--space-4); }
.form-section > .form-section__title + * { margin-top: 0; }
/* první viditelný prvek za nadpisem oddílu (skryté skupiny se přeskočí) */
.form-section > .form-section__title + [hidden] + * { margin-top: 0; }

.field { display: grid; gap: var(--space-1); align-content: start; }
.field__label { font-weight: 600; }
.field__optional { font-weight: 400; color: var(--text-muted); }
.field__hint { font-size: 0.86rem; color: var(--text-muted); }
.field__error { font-size: 0.88rem; color: var(--danger); font-weight: 500; }

.input, .select {
  width: 100%;
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:hover, .select:hover { border-color: var(--text-muted); }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input[aria-invalid="true"] { border-color: var(--danger); }
.input--short { max-width: 220px; }
.input--code { max-width: 200px; font-family: var(--font-mono); font-size: 1.15rem; letter-spacing: 0.15em; }

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }

.inline-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; }
.inline-form .input { flex: 1 1 240px; max-width: 360px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

details.disclosure > summary { cursor: pointer; color: var(--accent); }
details.disclosure[open] > summary { margin-bottom: var(--space-3); }

/* ---------- 7. Tlačítka ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:disabled, .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }

.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn--ghost { background: transparent; color: var(--accent); padding-inline: var(--space-2); }
.btn--ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn--small { min-height: 34px; padding: var(--space-1) var(--space-3); font-size: 0.9rem; }
.btn--block { width: 100%; }

/* ---------- 8. Hlášky ---------- */
.alert {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
}
.alert__title { font-weight: 650; }
.alert--success { background: var(--success-soft); border-color: var(--success); }
.alert--warning { background: var(--warning-soft); border-color: var(--warning); }
.alert--danger { background: var(--danger-soft); border-color: var(--danger); }
.alert--info { background: var(--info-soft); border-color: var(--border-strong); }
.alert ul { margin: 0; padding-left: 1.2em; }

/* ---------- 9. Tabulky (na mobilu jako karty) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--space-3) var(--space-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.table th { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table__actions { text-align: right; white-space: nowrap; }
.table__actions .cluster { justify-content: flex-end; flex-wrap: nowrap; }
.table__primary { font-weight: 600; }

@media (max-width: 720px) {
  .table--responsive thead { display: none; }
  .table--responsive tr { display: grid; gap: var(--space-1); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
  .table--responsive td { display: grid; grid-template-columns: 40% 1fr; gap: var(--space-2); padding: 0; border: 0; }
  .table--responsive td::before { content: attr(data-label); color: var(--text-muted); font-size: 0.85rem; }
  .table--responsive td > * { justify-self: start; }
  .table--responsive td.table__actions { display: flex; justify-content: flex-start; padding-top: var(--space-2); }
  .table--responsive td.table__actions::before { content: none; }
  .table--responsive td.table__primary { grid-template-columns: 1fr; }
  .table--responsive td.table__primary::before { content: none; }
}

.empty {
  padding: var(--space-7) var(--space-5);
  text-align: center;
  color: var(--text-muted);
}
.empty__title { color: var(--text); font-weight: 600; margin-bottom: var(--space-1); }

/* ---------- 10. Drobné prvky ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--warning { background: var(--warning-soft); color: var(--warning); }

.secret {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}
.secret__value {
  flex: 1 1 280px;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  word-break: break-all;
}

.steps { margin: 0; padding-left: 1.3em; display: grid; gap: var(--space-4); }
.steps > li::marker { font-weight: 700; color: var(--accent); }

.qr { display: inline-block; padding: var(--space-3); background: #fff; border-radius: var(--radius); border: 1px solid var(--border); line-height: 0; }

.codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-1) var(--space-4);
  font-family: var(--font-mono);
}

/* ---------- 11. Potvrzovací dialog (public/js/app.js) ---------- */
.dialog {
  width: min(92vw, 440px);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgb(0 0 0 / 25%);
}
.dialog::backdrop { background: rgb(0 0 0 / 40%); }
.dialog__title { margin-bottom: var(--space-2); }
.dialog__text { color: var(--text-muted); }
.dialog__actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-5); }

/* ---------- 12. Další komponenty ---------- */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.textarea { min-height: 90px; resize: vertical; }
.field__hint--indent { padding-left: 26px; }
.form-grid__wide { grid-column: 1 / -1; }

/* Nastavení: záložky sekcí vlevo, formulář vpravo */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.settings__nav { position: sticky; top: var(--space-4); display: grid; gap: 2px; }
.settings__link { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.settings__link:hover { background: var(--surface-2); color: var(--text); }
.settings__link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; }
  .settings__nav { position: static; display: flex; overflow-x: auto; gap: var(--space-1); padding-bottom: var(--space-1); }
  .settings__link { white-space: nowrap; border: 1px solid var(--border); }
}

/* Řádkové formuláře (provozovny, kategorie) */
.row-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.row-form--new { border-bottom: 0; }
.row-form--service { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) auto; }
.row-form__actions { display: flex; gap: var(--space-3); align-items: center; min-height: var(--control-height); }
.row-form__value { display: flex; align-items: center; min-height: var(--control-height); font-weight: 600; }
@media (max-width: 720px) { .row-form { grid-template-columns: 1fr; } }

/* Údaje „název: hodnota“ */
.facts { display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); }
.facts > div { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: var(--space-3); }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; word-break: break-word; }

.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: var(--space-4); align-items: start; margin-top: var(--space-4); }
.split > *, .stack > * { margin-top: 0 !important; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }

.stats { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: var(--space-4); }
.stat { display: grid; gap: 2px; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.stat__label { font-size: 0.85rem; color: var(--text-muted); }
.stat__value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat__note { font-size: 0.85rem; color: var(--text-muted); }

.filter { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; }
.filter .field { min-width: 150px; }
.filter__actions { padding-bottom: 1px; }
.filter__quick { flex-basis: 100%; }

.card__header--padded { padding: var(--space-4) var(--space-4) 0; }
.table--compact th, .table--compact td { padding: var(--space-2) var(--space-1); }
.table__total th, .table__total td { font-weight: 700; border-top: 2px solid var(--border-strong); background: var(--surface-2); }
.list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.list li { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.pager { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }

/* Barvy kategorií (dlaždice pokladny) – jen tyto třídy, žádné inline barvy */
.tone--neutral { --tone: var(--border-strong); --tone-soft: var(--surface-2); }
.tone--green { --tone: #2d6a4f; --tone-soft: #e2efe8; }
.tone--brown { --tone: #8b5a2b; --tone-soft: #f3e8dc; }
.tone--blue { --tone: #2f5d9b; --tone-soft: #e3ecf8; }
.tone--amber { --tone: #b7791f; --tone-soft: #fdf1d8; }
.tone--rose { --tone: #a8466b; --tone-soft: #f8e4ec; }
@media (prefers-color-scheme: dark) {
  .tone--green { --tone: #5fb38a; --tone-soft: #1d3329; }
  .tone--brown { --tone: #c9965f; --tone-soft: #33271b; }
  .tone--blue { --tone: #7aa7e0; --tone-soft: #1c2738; }
  .tone--amber { --tone: #e2b04f; --tone-soft: #352b14; }
  .tone--rose { --tone: #e08aab; --tone-soft: #36202a; }
}
.tone-dot { display: inline-block; width: 10px; height: 10px; margin-right: var(--space-2); border-radius: 50%; background: var(--tone); }

.dialog--wide { width: min(96vw, 640px); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }

/* ---------- 13. Prodejka (zjednodušený daňový doklad) ---------- */
.receipt {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  background: #fff;
  color: #111;
  font: 13px/1.45 var(--font-mono);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.receipt__head { text-align: center; margin-bottom: var(--space-3); }
.receipt__trade { font-weight: 700; font-size: 1.15em; }
.receipt__title { text-align: center; font-weight: 700; padding: var(--space-2) 0; border-top: 1px dashed #999; border-bottom: 1px dashed #999; margin-bottom: var(--space-2); }
.receipt__meta { display: flex; justify-content: space-between; gap: var(--space-2); }
.receipt__items, .receipt__vat { width: 100%; border-collapse: collapse; margin: var(--space-2) 0; }
.receipt__items td { padding: 3px 0; vertical-align: top; }
.receipt__small { color: #555; font-size: 0.9em; }
.receipt__total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.2em; padding: var(--space-2) 0; border-top: 1px dashed #999; }
.receipt__vat th { font-weight: 600; text-align: left; border-bottom: 1px solid #ccc; }
.receipt__vat th.num { text-align: right; }
.receipt__eet { margin-top: var(--space-3); font-size: 0.85em; word-break: break-all; }
.receipt__foot { margin-top: var(--space-3); text-align: center; }

.receipt-page { padding: var(--space-5) var(--space-4); }
.receipt-page__actions { justify-content: center; margin-bottom: var(--space-4); }

/* ---------- 14. Pokladní obrazovka ---------- */
.pos-body { overscroll-behavior: none; }
.pos-screen[hidden] { display: none; }
.pos-center { min-height: 100vh; display: grid; place-items: center; padding: var(--space-5) var(--space-4); }
.pos-card { width: 100%; max-width: 420px; }

.pos-staff { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.pos-staff__btn {
  min-height: 72px; padding: var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 1.05rem; cursor: pointer;
}
.pos-staff__btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.pos-pin__who { font-weight: 650; font-size: 1.1rem; text-align: center; margin: 0; }
.pos-pin__input { max-width: none; text-align: center; }
.pos-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.pos-key {
  min-height: 60px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 1.4rem; font-weight: 600; cursor: pointer;
}
.pos-key:active { background: var(--accent-soft); }
.pos-key--muted { color: var(--text-muted); }
.pos-key--ok { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.pos-main { min-height: 100vh; display: flex; flex-direction: column; }
.pos-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--border);
}
.pos-top__info { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; }
.pos-banner { margin: var(--space-3) var(--space-4) 0; }

.pos-layout { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.pos-catalog { padding: var(--space-3) var(--space-4) var(--space-5); overflow-y: auto; }
.pos-tabs { display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-3); }
.pos-tab {
  flex-shrink: 0; min-height: 44px; padding: var(--space-2) var(--space-4); border: 2px solid var(--tone); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.pos-tab[aria-pressed="true"] { background: var(--tone); color: #fff; }
.pos-tab.tone--neutral[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pos-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.pos-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-2);
  min-height: 104px; padding: var(--space-3); text-align: left; cursor: pointer;
  background: var(--tone-soft); border: 1px solid var(--border); border-left: 6px solid var(--tone); border-radius: var(--radius-lg);
  color: var(--text); font: inherit; transition: transform 0.08s;
}
.pos-tile:active { transform: scale(0.97); }
.pos-tile__name { font-weight: 650; font-size: 1.02rem; line-height: 1.25; }
.pos-tile__price { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.pos-cart {
  display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4);
  background: var(--surface); border-left: 1px solid var(--border); min-height: 0;
}
.pos-cart__head { display: flex; justify-content: space-between; align-items: center; }
.pos-cart__head h2 { font-size: 1.05rem; }
.pos-cart__items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; display: grid; align-content: start; gap: var(--space-1); }
.pos-cart__empty { text-align: center; padding: var(--space-5) 0; }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-2); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.pos-line__info { display: grid; min-width: 0; }
.pos-line__name { font-weight: 600; overflow-wrap: anywhere; }
.pos-line__price { font-size: 0.85rem; }
.pos-line__qty { display: flex; align-items: center; gap: var(--space-1); }
.pos-line__count { min-width: 2ch; text-align: center; font-weight: 600; }
.pos-line__total { min-width: 88px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pos-qty {
  width: 36px; height: 36px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer;
}
.pos-cart__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--space-2); border-top: 2px solid var(--border-strong); font-size: 1.2rem; }
.pos-cart__total strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.pos-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: var(--space-2); }
.pos-pay__btn { min-height: 56px; font-size: 1.05rem; }
.pos-pay__amount { font-size: 2rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 0; }
.pos-pay__change { font-size: 1.2rem; font-weight: 650; color: var(--success); margin: 0; }
.pos-qr { display: grid; place-items: center; min-height: 120px; }
.pos-qr svg { width: 220px; height: 220px; }

.pos-history { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.pos-history__row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.pos-history__row .badge { margin-left: var(--space-2); }
.pos-history__total { font-variant-numeric: tabular-nums; font-weight: 600; }
.pos-history__sum { font-weight: 650; }

@media (max-width: 820px) {
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart { border-left: 0; border-top: 1px solid var(--border); position: sticky; bottom: 0; max-height: 55vh; box-shadow: 0 -6px 20px rgb(0 0 0 / 8%); }
  .pos-tiles { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .pos-tile { min-height: 84px; }
}

.print-area { display: none; }

/* ---------- 15. Veřejný poptávkový formulář ---------- */
.public { min-height: 100vh; padding: var(--space-5) var(--space-4) var(--space-7); }
.public--embedded { min-height: 0; padding: 0; background: transparent; }
.public__header { display: flex; justify-content: center; margin-bottom: var(--space-5); }
.public__box { max-width: 760px; margin: 0 auto; }
.public__intro { margin-bottom: var(--space-4); }
.public__intro h1 { margin-bottom: var(--space-2); }
.public__done h1 { margin-bottom: var(--space-3); }
.public__done:focus { outline: none; }

/* Skupina polí řízená typem akce – bez rámečku fieldsetu */
.group { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-4); }

/* Volby jako dlaždice (radio) */
.choices { display: grid; gap: var(--space-2); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choices--inline { grid-template-columns: repeat(auto-fit, minmax(160px, max-content)); }
.choice { position: relative; display: flex; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__label {
  flex: 1; display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--control-height); padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.choice__label::before {
  content: ""; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--surface);
}
.choice:hover .choice__label { border-color: var(--text-muted); }
.choice input:checked + .choice__label { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.choice input:checked + .choice__label::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--surface); }
.choice input:focus-visible + .choice__label { outline: 3px solid var(--focus); outline-offset: 2px; }

.input-row { display: flex; gap: var(--space-2); }
.input-row .input { flex: 1 1 auto; min-width: 0; }
.input-row .btn { flex-shrink: 0; }
.input--time { flex: 0 0 120px !important; }

/* Počty osob */
.stepper-group { display: grid; gap: var(--space-2); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.stepper-group:last-child { border-bottom: 0; }
.stepper-group__title { font-weight: 650; }
.stepper-group__items { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.stepper-field { display: grid; gap: var(--space-1); align-content: start; }
.stepper-field__label { font-weight: 600; }
.stepper-field__sub { display: block; font-weight: 400; font-size: 0.86rem; color: var(--text-muted); }
.stepper { display: flex; align-items: stretch; max-width: 180px; }
.stepper__btn {
  width: 44px; flex-shrink: 0; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 1.2rem; font-weight: 600; cursor: pointer;
}
.stepper__btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper__btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper__btn:hover { background: var(--accent-soft); }
.stepper__input { border-radius: 0; border-left: 0; border-right: 0; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper__input::-webkit-outer-spin-button, .stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.estimate { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius); background: var(--accent-soft); }
.estimate__label { font-weight: 600; }
.estimate__value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.estimate__note { font-size: 0.88rem; color: var(--text-muted); }

.consent { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); }
.consent__text { font-size: 0.92rem; color: var(--text-muted); margin: 0; }

/* ---------- 16. Rezervace v administraci ---------- */
.tabs { display: flex; gap: var(--space-1); margin-bottom: var(--space-4); overflow-x: auto; border-bottom: 1px solid var(--border); }
.tabs__link { padding: var(--space-2) var(--space-3); color: var(--text-muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs__link:hover { color: var(--text); }
.tabs__link[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.filter.card { margin-bottom: var(--space-4); }
.badge--info { background: var(--info-soft); color: var(--focus); }
.badge--neutral { background: var(--surface-2); color: var(--text-muted); }

.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-4); align-items: start; }
.layout-aside__side { position: sticky; top: var(--space-4); display: grid; gap: var(--space-4); }
@media (max-width: 1060px) { .layout-aside { grid-template-columns: 1fr; } .layout-aside__side { position: static; } }

.price-panel[aria-busy="true"] .price-panel__value { opacity: 0.5; }
.price-panel__rows { display: grid; gap: var(--space-1); margin: 0 0 var(--space-3); }
.price-panel__rows > div { display: flex; justify-content: space-between; gap: var(--space-3); }
.price-panel__rows dt { color: var(--text-muted); }
.price-panel__rows dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.price-panel__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: var(--space-2); border-top: 2px solid var(--border-strong); }
.price-panel__value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-panel__official { margin-top: var(--space-2); font-size: 0.92rem; }

.lodging-grid { display: grid; grid-template-columns: minmax(140px, 1.4fr) repeat(3, minmax(70px, 1fr)); gap: var(--space-2) var(--space-3); align-items: center; }
.lodging-grid__head { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.lodging-grid .input { text-align: center; }
@media (max-width: 640px) { .lodging-grid { grid-template-columns: minmax(100px, 1.2fr) repeat(3, minmax(56px, 1fr)); } }

.service-list { display: grid; gap: var(--space-2); }
.service-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: var(--space-3); align-items: center; }
.service-row__price { font-size: 0.86rem; color: var(--text-muted); }

.conflicts { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }

/* Kalendář obsazenosti */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.calendar__dow { padding: var(--space-2); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar__day { min-height: 104px; padding: var(--space-1); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: grid; align-content: start; gap: 2px; min-width: 0; }
.calendar__day--other { background: var(--surface-2); color: var(--text-muted); }
.calendar__day--today .calendar__num { background: var(--accent); color: var(--on-accent); }
.calendar__num { justify-self: start; min-width: 24px; padding: 0 6px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.calendar__event {
  display: block; padding: 1px 6px; border-radius: var(--radius-sm); font-size: 0.8rem; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: var(--text);
  background: var(--surface-2); border-left: 3px solid var(--border-strong);
}
.calendar__event--poptavka { background: var(--warning-soft); border-left-color: var(--warning); }
.calendar__event--predrezervace { background: var(--info-soft); border-left-color: var(--focus); }
.calendar__event--potvrzeno { background: var(--success-soft); border-left-color: var(--success); }
.calendar__event:hover { color: var(--text); filter: brightness(0.97); }
.calendar-nav { display: flex; align-items: center; gap: var(--space-3); }
.calendar-legend { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-3); font-size: 0.86rem; }
@media (max-width: 720px) {
  .calendar { grid-template-columns: 1fr; }
  .calendar__dow, .calendar__day--other { display: none; }
  .calendar__day { min-height: 0; grid-template-columns: 48px 1fr; padding: var(--space-2); }
  .calendar__day:not(:has(.calendar__event)) { display: none; }
  .calendar__event { grid-column: 2; }
}

/* ---------- 17. Doklady ---------- */
/* tři sloupce jen na širokém displeji (vedle formuláře je postranní panel) */
@media (min-width: 1280px) { .form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.doc-items { display: grid; gap: var(--space-2); }
.doc-item {
  display: grid;
  grid-template-columns: minmax(0, 2.6fr) minmax(64px, 0.7fr) minmax(56px, 0.6fr) minmax(90px, 1fr) minmax(120px, 1.2fr) minmax(76px, 0.7fr) minmax(100px, 1fr) auto;
  gap: var(--space-2);
  align-items: end;
  padding: var(--space-2);
  border-radius: var(--radius);
}
.doc-item--deduction { background: var(--info-soft); }
.doc-item__name { display: grid; gap: var(--space-1); grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.doc-item__name .input { grid-column: 1 / -1; }
.doc-item__label { display: block; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: var(--space-1); }
.doc-item__value { display: flex; align-items: center; justify-content: flex-end; min-height: var(--control-height); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-item__remove { display: flex; align-items: center; min-height: var(--control-height); }
.doc-item__errors { grid-column: 1 / -1; }
/* popisky sloupců jen u prvního řádku; u dalších zůstávají pro čtečky obrazovky */
@media (min-width: 901px) {
  .doc-item:not(:first-child) .doc-item__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}
@media (max-width: 900px) {
  .doc-item { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); }
  .doc-item__name { grid-column: 1 / -1; }
  .doc-item__total .doc-item__value { justify-content: flex-start; }
}

.advance-pick { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.advance-pick__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); }
.doc-recap { margin-top: var(--space-3); font-size: 0.9rem; }

.doc-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: grid; gap: var(--space-2); }
.doc-list__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-2); align-items: center; padding-bottom: var(--space-2); border-bottom: 1px solid var(--border); }
.doc-list__row--cancelled .doc-list__number { text-decoration: line-through; color: var(--text-muted); }
.doc-list__meta { grid-column: 1 / -1; font-size: 0.86rem; color: var(--text-muted); }

.payment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-2); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }

/* Tisková podoba dokladu (A4) */
.invoice-page { padding: var(--space-5) var(--space-4); background: var(--surface-2); min-height: 100vh; }
.invoice-page__actions { justify-content: center; margin-bottom: var(--space-4); }
.invoice {
  position: relative;
  max-width: 210mm;
  margin: 0 auto;
  padding: 14mm 14mm 12mm;
  background: #fff;
  color: #111;
  border: 1px solid var(--border);
  font-size: 10pt;
  line-height: 1.4;
}
.invoice__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding-bottom: var(--space-3); border-bottom: 2px solid #111; }
.invoice__title { margin: 0; font-size: 16pt; }
.invoice__number { font-size: 13pt; font-weight: 700; }
.invoice__parties { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); margin: var(--space-4) 0; }
.invoice__party-label { font-size: 8pt; text-transform: uppercase; letter-spacing: 0.06em; color: #555; margin-bottom: var(--space-1); }
.invoice__party-name { font-weight: 700; font-size: 11pt; }
.invoice__box { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); padding: var(--space-3); background: #f4f4f2; border-radius: 4px; }
.invoice__facts { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); margin: 0; }
.invoice__facts dt { color: #555; }
.invoice__facts dd { margin: 0; font-weight: 600; }
.invoice__table { overflow-x: auto; margin-top: var(--space-4); }
.invoice__items { width: 100%; border-collapse: collapse; }
.invoice__items th { font-size: 8pt; text-transform: uppercase; letter-spacing: 0.04em; color: #555; text-align: left; border-bottom: 1px solid #111; padding: var(--space-1); }
.invoice__items td { padding: var(--space-1); border-bottom: 1px solid #ddd; vertical-align: top; }
.invoice__items .num, .invoice__recap .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invoice__bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-4); align-items: start; }
.invoice__recap { width: 100%; border-collapse: collapse; font-size: 9pt; }
.invoice__recap th, .invoice__recap td { padding: 2px var(--space-1); border-bottom: 1px solid #ddd; text-align: left; }
.invoice__totals { display: grid; gap: var(--space-1); }
.invoice__total-row { display: flex; justify-content: space-between; gap: var(--space-3); }
.invoice__due { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); margin-top: var(--space-1); background: #111; color: #fff; font-size: 13pt; font-weight: 700; border-radius: 4px; }
.invoice__qr { display: flex; gap: var(--space-3); align-items: center; margin-top: var(--space-3); font-size: 8.5pt; color: #555; }
.invoice__qr svg { width: 34mm; height: 34mm; }
.invoice__note { margin-top: var(--space-4); white-space: pre-line; }
.invoice__foot { margin-top: var(--space-5); padding-top: var(--space-2); border-top: 1px solid #ddd; font-size: 8pt; color: #555; display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.invoice__stamp {
  position: absolute; top: 38mm; right: 18mm; transform: rotate(-12deg);
  padding: var(--space-1) var(--space-3); border: 3px solid currentColor; border-radius: 6px;
  font-size: 18pt; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75;
}
.invoice__stamp--paid { color: #2d6a4f; }
.invoice__stamp--cancelled { color: #b42318; }
@media (max-width: 720px) {
  .invoice { padding: var(--space-4); }
  .invoice__parties, .invoice__box, .invoice__bottom { grid-template-columns: 1fr; }
}

/* Banka */
.bank-meta { margin-bottom: var(--space-3); }
.bank-tools { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.bank-tools .card { padding: var(--space-3) var(--space-4); }
.bank-tools details[open] > summary { margin-bottom: var(--space-3); }
.bank-list { list-style: none; margin: 0; padding: 0; }
.bank-row { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.bank-row:last-child { border-bottom: 0; }
.bank-row__main { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; }
.bank-row__amount { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bank-row__info { min-width: 0; display: grid; gap: 2px; }
.bank-row__message { overflow-wrap: anywhere; }
.bank-row__status { display: grid; gap: var(--space-1); justify-items: end; text-align: right; }
.bank-row__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding-left: calc(130px + var(--space-3)); }
.bank-row__actions .inline-form .input { flex: 0 1 180px; }
@media (max-width: 720px) {
  .bank-row__main { grid-template-columns: 1fr auto; }
  .bank-row__info { grid-column: 1 / -1; grid-row: 2; }
  .bank-row__actions { padding-left: 0; }
}

/* Komunikace */
.mail-history { margin-top: var(--space-3); }
.var-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-1); }
.var-list code { font-size: 0.8rem; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-2); }
.template-add { padding-bottom: var(--space-4); border-top: 1px solid var(--border); }

/* ---------- 18. Tisk ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  .sidebar, .topbar, .btn, .form-actions, .receipt-page__actions, .invoice-page__actions { display: none !important; }
  .invoice-page { padding: 0; background: #fff; }
  .invoice { border: 0; padding: 0; max-width: none; }
  .app { display: block; }
  .card { border: 0; box-shadow: none; }
  body { background: #fff; }
  .receipt { border: 0; max-width: 80mm; padding: 0; }
  body.is-printing > *:not(.print-area) { display: none !important; }
  body.is-printing .print-area { display: block; }
}
