/* Spárováno — administrace. Jednotný tmavý vizuál s pokladní
   appkou: neutrální šeď, korálový akcent, Archivo (nadpisy condensed), pill tlačítka,
   tenké separátory, uppercase popisky sekcí. */

:root {
  --bg: #161616;
  --panel: #1c1c1c;
  --card: #1f1f1f;
  --control: #262626;
  --card-2: #2a2a2a; /* světlejší plocha inputů na přihlášení — jako v PWA */
  /* Kontrast laděný pro slabší notebookové panely (audit 29. 8.):
     muted >= 4.5:1 i na žlutém podkladu fronty, border o stupeň
     viditelnější — na vymlácené TN matrici jinak karty splývají. */
  --border: #363636;
  --text: #f0f0f0;
  --muted: #a0a0a6;
  --accent: #f4503c;
  --accent-soft: rgba(244, 80, 60, .16);
  --green: #35c759;
  --green-soft: rgba(53, 199, 89, .16);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, .14);
  --indigo-soft: rgba(122, 134, 255, .18);
  --radius: 12px;
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Archivo', -apple-system, sans-serif; /* condensed přes font-stretch */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

/* vlastní scrollbary — tenké, tmavé, ať neruší (WebKit + Firefox) */
* { scrollbar-width: thin; scrollbar-color: #4d4d4d transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #4d4d4d; border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #5d5d5d; }
body.admin {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font);
}

main { max-width: 1280px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
h1 { font-family: var(--font-head); font-stretch: 84%; font-weight: 760; font-size: 1.85rem; margin-bottom: 1rem; }
h2 { font-family: var(--font-head); font-stretch: 84%; font-weight: 760; font-size: 1.25rem; margin-bottom: .6rem; }
h3 { font-family: var(--font-head); font-stretch: 84%; font-weight: 760; font-size: 1.05rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); }
a { color: inherit; }
code { background: var(--control); border-radius: 4px; padding: .1rem .35rem; font-size: .85em; }

/* Inline SVG ikony (Font Awesome light) — barvu dědí z textu. */
svg.icon { width: 1em; height: 1em; vertical-align: -0.12em; }

/* ---------- instalační lišta Spárováno (jen mobil, řídí admin.js) ---------- */
.install-bar {
  display: flex; align-items: center; gap: .8rem;
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: .65rem .9rem;
  padding-top: calc(.65rem + env(safe-area-inset-top, 0px));
}
.ib-appicon {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.45rem;
}
.ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ib-text strong { font-weight: 500; font-size: .95rem; }
.ib-sub { color: var(--muted); font-size: .8rem; }
.ib-action {
  flex: none; border: none; border-radius: 999px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 500; padding: .45rem 1.1rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ib-close {
  flex: none; background: none; border: none; color: var(--muted);
  font-size: 1.35rem; line-height: 1; padding: .2rem .35rem; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- horní lišta ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.6rem;
  background: var(--panel); border-bottom: 1px solid var(--border);
  color: var(--text); padding: 0 1.2rem; height: 60px;
}
.topbar .brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-head); font-stretch: 84%; font-weight: 760; text-decoration: none; color: var(--text);
}
.topbar .brand img { height: 20px; display: block; }
.topbar .brand span { color: var(--accent); }
.topbar nav { display: flex; gap: .25rem; flex: 1; }
.topbar nav a {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--text); text-decoration: none; padding: .5rem 1rem;
  border-radius: 999px; font-weight: 500;
}
.topbar nav a .icon { opacity: .85; }
.topbar nav a:hover { background: var(--control); }
.topbar nav a.active { color: var(--accent); }
.topbar .logout { display: flex; align-items: center; gap: 1.1rem; }
.topbar .logout button {
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: .45rem;
}
.topbar .logout button:hover, .topbar .pwd-link:hover { color: var(--accent); }
.topbar .pwd-link {
  color: var(--text); text-decoration: none; font-weight: 500;
  display: inline-flex; align-items: center; gap: .45rem;
}

/* ---------- obecné ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; margin-bottom: 1rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 1.3rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--control); color: var(--text);
  font-family: var(--font); font-weight: 500; font-size: .95rem; cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: #4d4d4d; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-warn { background: var(--yellow-soft); border-color: rgba(234, 179, 8, .4); color: var(--yellow); }
/* Destruktivní akce — vizuálně odlišená od běžných i výstražných tlačítek. */
.btn-danger { background: transparent; border: 1.5px solid #e5484d; color: #ff6b70; }
.btn-danger:hover { background: rgba(229, 72, 77, .12); border-color: #ff6b70; }
.btn-ghost { background: none; }
.linklike { background: none; border: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.linklike.danger { color: var(--accent); }

label { display: block; font-size: .9rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="file"], select {
  display: block; width: 100%; margin-top: .25rem;
  border: 1px solid var(--border); border-radius: 8px;
  padding: .55rem .7rem; font: inherit; color: var(--text); background: var(--control);
  /* pole NEDĚDÍ zmenšené písmo labelu — vždy plná velikost */
  font-size: 1rem;
  color-scheme: dark;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.row label { flex: 1; min-width: 180px; }
.checkbox { display: flex; align-items: center; gap: .55rem; font-size: 1rem; color: var(--text); cursor: pointer; }
/* Vlastní checkbox — jednotný vzhled napříč prohlížeči. */
.checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 21px; height: 21px; margin: 0; flex: none;
  border: 1.5px solid #7a7a7a; border-radius: 6px;
  background: var(--control); cursor: pointer;
  display: grid; place-content: center;
  transition: background .12s, border-color .12s;
}
.checkbox input::before {
  content: ''; width: 11px; height: 11px; transform: scale(0);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 82% 2%, 43% 66%);
  background: #fff; transition: transform .12s;
}
.checkbox input:checked { background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::before { transform: scale(1); }
.checkbox input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Vlastní radio — stejný jazyk jako checkbox (kruh, tečka v akcentu). */
input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 21px; height: 21px; margin: 0; flex: none;
  border: 1.5px solid #7a7a7a; border-radius: 50%;
  background: var(--control); cursor: pointer;
  display: inline-grid; place-content: center; vertical-align: middle;
  transition: background .12s, border-color .12s;
}
input[type="radio"]::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%;
  transform: scale(0); background: #fff; transition: transform .12s;
}
input[type="radio"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="radio"]:checked::before { transform: scale(1); }
input[type="radio"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- flash ---------- */
.flash { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: var(--green-soft); color: var(--green); }
.flash-warning { background: var(--yellow-soft); color: var(--yellow); }
.flash-error { background: var(--accent-soft); color: #ff7a69; }

/* ---------- vlajky ---------- */
.flag {
  display: inline-block; font-size: .75rem; font-weight: 500;
  padding: .14rem .55rem; border-radius: 999px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .03em;
}
.flag-warn { background: var(--yellow-soft); color: var(--yellow); }
.flag-superseded { background: var(--accent-soft); color: #ff7a69; }
.flag-correction { background: var(--indigo-soft); color: #9aa4ff; }
.flag-draft { background: var(--yellow-soft); color: var(--yellow); }
.flag-live { background: var(--green-soft); color: var(--green); }

/* ---------- login ---------- */
/* Stejné jako přihlášení skeneru: žádná obalová karta — obsah přímo
   na pozadí, světlejší velké inputy, sloupec 480 px svisle vycentrovaný
   (dvojice margin-top:auto jako v .screen-pad), podpis Spárováno dole. */
/* Sloupec loginu vyplní výšku okna POD instalační lištou (flex na body
   místo min-height na main — jinak by lišta přidala scroll). */
body.page-admin-login {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
}
body.page-admin-login main {
  display: flex; flex-direction: column; flex: 1; width: 100%;
  max-width: 480px; padding: 2.2rem 1.4rem 1.4rem;
  transition: transform .25s ease; /* měkké zvednutí nad klávesnici (admin.js) */
}
.login-card { margin-top: auto; }
.login-logo { width: 88px; display: block; margin-bottom: .8rem; }
.login-sub { font-family: var(--font-head); font-stretch: 84%; font-size: 1.05rem; margin-bottom: 2.6rem; }
.login-card h1 { font-size: 1.75rem; margin-bottom: .5rem; }
.login-card form { margin-top: 1.4rem; }
.login-card label { margin-bottom: .9rem; }
.login-card input {
  min-height: 52px; padding: .6rem .9rem; border-radius: 12px;
  background: var(--card-2); font-size: 1.02rem;
}
.login-card .btn { width: 100%; min-height: 52px; margin-top: .6rem; font-size: 1.02rem; }
.eats-brand { margin-top: auto; text-align: center; padding-top: 2rem; color: var(--muted); opacity: .55; }
.eats-brand svg { height: 13px; width: auto; display: inline-block; }
.login-links { margin-top: 1.1rem; text-align: center; }
.login-links a { color: var(--muted); font-size: .92rem; }
.login-links a:hover { color: var(--text); }

/* ---------- logy naskladnění ---------- */
.logy-sub { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: -.2rem 0 1rem; }
.logy-sub .linklike { color: var(--muted); font-size: .9rem; }
.log-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.log-table th {
  text-align: left; font-size: .76rem; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding: .55rem .7rem; border-bottom: 1px solid var(--border);
}
.log-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); }
.log-table tbody tr:last-child td { border-bottom: none; }
.log-table tr.superseded td { opacity: .55; }
.log-table .lt-doc a { font-weight: 500; }
@media (max-width: 640px) {
  /* karta na mobilu: doklad + stáří, pod tím časy, pod tím zařízení/IP */
  .log-table { min-width: 0; }
  .log-table thead { display: none; }
  .log-table, .log-table tbody { display: block; }
  .log-table tbody tr {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .7rem; row-gap: .25rem;
    padding: .7rem .2rem; border-bottom: 1px solid var(--border);
  }
  .log-table tbody tr:last-child { border-bottom: none; }
  .log-table tr td { display: block; padding: 0; border: none; }
  .log-table td.lt-doc { order: 1; flex: 1 1 auto; min-width: 55%; }
  /* bez hlavičky sloupce potřebuje štítek stáří popisek */
  .log-table td.lt-age { order: 2; margin-left: auto; }
  .log-table td.lt-age::before { content: 'stáří '; color: var(--muted); font-size: .85rem; }
  .log-table td.lt-when { order: 3; font-size: .88rem; color: var(--muted); }
  .log-table td.lt-duzp { order: 4; font-size: .88rem; }
  .log-table td.lt-duzp::before { content: '· nákup '; }
  .log-table td.lt-dev { order: 5; flex-basis: 100%; font-size: .85rem; }
  .log-table td.lt-ip { order: 6; font-size: .85rem; }
}

/* fronta K vyřízení — podbarvená, ať se nepřehlédne */
.review-queue {
  background: rgba(234, 179, 8, .07);
  border-color: rgba(234, 179, 8, .45);
}
/* štítek provozovny ladí do žlutého podkladu — šedá bublinka rušila */
.review-queue .store-badge { background: var(--yellow-soft); color: var(--yellow); }
.review-queue h2 { display: flex; align-items: center; gap: .5rem; }
.review-queue .day-table th { border-bottom-color: rgba(234, 179, 8, .25); }
.review-queue .day-table td { border-bottom-color: rgba(234, 179, 8, .15); }

/* ---------- měsíční přehled ---------- */
.page-title { margin-bottom: .4rem; }
/* výběr měsíce sedí vlevo pod nadpisem stránky — vycentrovaný „levitoval" */
.month-nav { display: flex; align-items: center; justify-content: flex-start; gap: 1rem; margin-bottom: .9rem; }
.month-name { font-family: var(--font-head); font-stretch: 84%; font-weight: 760; font-size: 1.55rem; }

/* chipy aktivních filtrů */
.active-filters { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: -0.2rem 0 1rem; }
.af-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent-soft); border: 1px solid rgba(244, 80, 60, .45);
  color: #ff8a7c; border-radius: 999px; padding: .3rem .85rem;
  text-decoration: none; font-weight: 500;
}
.af-chip b { font-weight: 500; opacity: .8; }
.af-chip:hover { border-color: var(--accent); }
.af-clear { color: var(--muted); font-size: .9rem; }

.push-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.push-warn { color: var(--yellow); font-size: .92rem; margin-top: .3rem; }
/* Všechny .devices tabulky (správci, zařízení provozoven, push odběry)
   na mobilu stohují: první buňka přes celou šířku, zbytek pod ní —
   šest sloupců vedle sebe roztahovalo celou stránku do šířky. */
@media (max-width: 640px) {
  .devices thead { display: none; }
  .devices, .devices tbody { display: block; }
  .devices tbody tr, .devices > tr {
    display: flex; flex-wrap: wrap; gap: .15rem .9rem; align-items: baseline;
    padding: .6rem 0; border-top: 1px solid var(--border);
  }
  /* vyšší specificita než pozdější základní .devices td (border-top) */
  .devices tr td { display: block; width: auto; padding: 0; border: none; }
  .devices tr td:first-child { flex-basis: 100%; font-weight: 500; overflow-wrap: anywhere; }
  .devices tr td.muted { font-size: .85rem; font-weight: 400; }
  .devices tr.user-edit-row { display: block; }
  .devices tr.user-edit-row td { width: 100%; }

  /* radia rozsahu upozornění pod sebe — vyšší specificita, základní
     pravidla .notify-scope/.scope-stores jsou v souboru až POZDĚJI */
  .notify-prefs .notify-scope { flex-direction: column; gap: .65rem; align-items: flex-start; margin-bottom: .6rem; }
  .notify-prefs .scope-stores { padding-left: 0; }

  /* Editace položek (K vyřízení / Upravit doklad) jako karty: název
     přes celou šířku a POD NÍM částka + sazba + odebrat — čtyři úzké
     sloupce vedle sebe se na telefonu nedaly číst ani vyplňovat. */
  .items-edit thead { display: none; }
  .items-edit, .items-edit tbody { display: block; }
  .items-edit tbody tr {
    display: grid; grid-template-columns: 1fr auto auto;
    gap: .45rem .55rem; align-items: center;
    padding: .7rem 0; border-bottom: 1px solid var(--border);
  }
  .items-edit tbody tr:last-child { border-bottom: none; }
  .items-edit tr td { display: block; padding: 0; }
  /* 1. řádek karty: název + odebrat (křížek u názvu, ne sirotek dole);
     2. řádek: částka + sazba + skupina. */
  .items-edit tr td:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .items-edit tr td:nth-child(5) { grid-column: 3; grid-row: 1; justify-self: end; }
  .items-edit tr td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .items-edit tr td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .items-edit tr td:nth-child(4) { grid-column: 3; grid-row: 2; }
  .items-edit input[type="text"] { width: 100%; }

  /* hlavní akce dokladu přes celou šířku — palec je najde bez mířění */
  .confirm-form .btn-primary { width: 100%; min-height: 52px; }
  .doc-actions-card .row { flex-direction: column; align-items: stretch; }
  .doc-actions-card .row .btn { width: 100%; min-height: 48px; }
  .doc-actions-card .row form { width: 100%; }
  .doc-actions-card .row form .btn { width: 100%; }

  /* pojistka: nic nesmí roztáhnout stránku do vodorovného scrollu */
  body.admin { overflow-x: hidden; }
}
.push-row h3 { margin: 0 0 .2rem; }

/* ⓘ nápověda -> mini-modal (žádné rozepsané věty v UI) */
.info-tip {
  background: none; border: none; padding: .15rem; cursor: pointer;
  color: var(--muted); font-size: 1rem; line-height: 1; vertical-align: -0.05em;
}
.info-tip:hover { color: var(--text); }
/* .modal.modal-mini — vyšší specificita: obecné .modal (1240px) je v CSS
   až níž a jinak by šířku mini-modalu přepsalo. */
.modal.modal-mini { width: min(400px, 100%); }
.modal-mini .modal-body { padding: 1.5rem 3.6rem 1.5rem 1.6rem; font-size: 1rem; line-height: 1.55; }
@media (max-width: 900px) {
  .tip-backdrop .modal-mini { width: 100%; height: 100%; border-radius: 0; display: flex; align-items: center; }
}
.month-nav .arrow {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 1.2rem;
}
.month-nav .arrow:hover { border-color: #4d4d4d; }
.month-title h1 { display: inline; margin-right: .5rem; }
.year-form { display: inline-flex; align-items: baseline; gap: .5rem; }
.year-form select {
  display: inline-block; width: auto; font-family: var(--font-head); font-stretch: 84%;
  font-size: 1.1rem; font-weight: 500;
  border: none; background: none; color: var(--muted); cursor: pointer; margin: 0;
}
.store-filter { text-align: center; margin-bottom: 1.2rem; }
.store-filter select { display: inline-block; width: auto; min-width: 220px; border-radius: 999px; padding: .5rem 1rem; }

.month-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .8rem; }
.month-summary .sum-main { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
.month-summary .sum-main strong { font-family: var(--font-head); font-stretch: 84%; font-size: 1.6rem; font-weight: 760; }
.month-summary .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.sum-rates { display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; font-size: .95rem; color: var(--muted); }
.sum-rates strong { color: var(--text); }

.day { margin-top: 2.2rem; }
.day-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem 1.2rem;
  padding-bottom: .55rem; margin-bottom: .7rem;
}
.day-head h2 { margin: 0; font-size: 1.4rem; }
/* svislá mezera při zalomení malá — rozskákané řádky působily chaoticky */
.day-totals { display: flex; gap: .3rem 1.1rem; flex-wrap: wrap; font-size: .92rem; color: var(--muted); align-items: baseline; }
.day-totals strong { color: var(--text); font-size: 1.05rem; }
.day .table-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .2rem .6rem;
}

/* lišta filtrů a akcí nad tabulkou */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.toolbar-filters { display: flex; gap: .7rem; flex-wrap: wrap; }
.toolbar-filters .lp-select { display: inline-block; min-width: 230px; margin: 0; }
.toolbar-actions { display: flex; gap: .7rem; flex-wrap: wrap; }
.toolbar-actions .icon { margin-right: .5rem; }
.file-btn .icon { margin-right: .45rem; }
.add-doc { margin-bottom: 1rem; }
.add-doc .row { align-items: flex-end; }
.add-doc .lp-select { min-width: 230px; }

/* vysvětlivky — menší písmo s ⓘ */
.hint {
  display: flex; gap: .45rem; align-items: baseline;
  color: var(--muted); font-size: .85rem; line-height: 1.45;
  margin: .7rem 0 0;
}
.hint .icon { flex: none; transform: translateY(1px); }

/* denní tabulky naskladnění — pevný layout, aby sloupce VŠECH dnů
   seděly přesně pod sebou (každý den je vlastní <table>). */
.table-wrap { overflow-x: auto; }
.table-card { padding: .4rem .6rem; }
.day-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 860px; }
.doklady .day .day-table th:nth-child(1) { width: 14%; }
.doklady .day .day-table th:nth-child(2) { width: 17%; }
.doklady .day .day-table th:nth-child(3) { width: 6%; }
.doklady .day .day-table th:nth-child(4) { width: 8%; }
.doklady .day .day-table th:nth-child(5) { width: 19%; }
.doklady .day .day-table th:nth-child(6) { width: 12%; }
.doklady .day .day-table th:nth-child(7) { width: 12%; }
.doklady .day .day-table th:nth-child(8) { width: 12%; }
.review-table th:nth-child(1) { width: 14%; }
.review-table th:nth-child(2) { width: 17%; }
.review-table th:nth-child(3) { width: 10%; }
.review-table th:nth-child(4) { width: 16%; }
.day-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-table th {
  text-align: left; font-size: .76rem; font-weight: 500;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  padding: .55rem .7rem; border-bottom: 1px solid var(--border);
}
.day-table td { padding: .65rem .7rem; border-bottom: 1px solid var(--border); }
.day-table tbody tr:last-child td { border-bottom: none; }
.day-table .num { text-align: right; white-space: nowrap; }
.day-table .amount { font-weight: 500; }
.day-table .cell-supplier { font-weight: 500; }
.day-table .col-flags { text-align: right; white-space: normal; }
.day-table .col-flags .flag { margin-left: .3rem; margin-bottom: .15rem; }
tr.row-link { cursor: pointer; }
tr.row-link:hover td { background: rgba(255, 255, 255, .03); }
tr.row-link.superseded td { opacity: .55; }
tr.row-link.superseded .cell-supplier, tr.row-link.superseded .amount { text-decoration: line-through; }

/* Na telefonu se řádky tabulek zalamují do karet pod sebe — žádné
   tečkování názvů ani vodorovné scrollování za roh. Pořadí přes flex:
   dodavatel + částka na prvním řádku, provozovna/čas/platba pod tím,
   vlajky nakonec; DPH sloupce se schovávají (jsou v součtech dne
   a v detailu dokladu). */
@media (max-width: 640px) {
  .day-table { min-width: 0; }
  .day-table thead { display: none; }
  .day-table, .day-table tbody { display: block; }
  .day-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline;
    column-gap: .55rem;
    padding: .75rem .2rem; border-bottom: 1px solid var(--border);
  }
  .day-table tbody tr:last-child { border-bottom: none; }
  .day-table td {
    display: block; width: auto; padding: 0; border: none;
    overflow: visible; text-overflow: clip; white-space: normal;
  }
  /* svislý rytmus dělají marginy položek, ne row-gap — prázdný
     vlajkový řádek tak nepřidává žádnou mezeru */
  .day-table td:first-child { order: 3; margin-top: .4rem; }
  /* min-width 55 % drží dodavatele s částkou o samotě na prvním řádku
     karty — meta řádek se zalomí pod ně i u krátkých názvů */
  .day-table td.cell-supplier { order: 1; flex: 1 1 auto; min-width: 55%; font-size: 1.02rem; margin-top: 0; }
  .day-table td.num { order: 2; margin-left: auto; font-weight: 500; font-size: 1.02rem; }
  .day-table td.muted { order: 4; margin-left: 0; font-weight: 400; font-size: .88rem; margin-top: .4rem; }
  /* Meta řádek jedním hlasem: provozovna BEZ bublinky, položky oddělené
     tečkou — bublinka vedle plného textu působila rozlítaně. Jediný
     barevný akcent karty zůstávají vlajky, vždy na vlastním řádku. */
  .day-table .store-badge {
    background: none; border-radius: 0; padding: 0;
    font-size: .88rem; font-weight: 400; color: var(--muted);
  }
  .day-table td.muted::before { content: '·'; margin-right: .55rem; }
  .day-table td.col-flags { order: 6; text-align: left; flex-basis: 100%; }
  .day-table .col-flags .flag { margin: .55rem .3rem 0 0; }
  /* Fronta K vyřízení má pevný počet buněk — mřížka drží tvar karty
     i s krátkými hodnotami („bez částky"): dodavatel + částka nahoře,
     provozovna vlevo a datum vpravo pod tím, poznámka přes šířku. */
  .review-table tr { display: grid; grid-template-columns: 1fr auto; row-gap: .4rem; column-gap: .7rem; }
  .review-table td:first-child { grid-row: 2; grid-column: 1; margin-top: 0; }
  .review-table td.cell-supplier { grid-row: 1; grid-column: 1; }
  .review-table td.num { grid-row: 1; grid-column: 2; justify-self: end; margin-left: 0; }
  .review-table td:nth-child(4) { grid-row: 2; grid-column: 2; justify-self: end; margin-top: 0; }
  .review-table td:nth-child(4)::before { content: none; }
  .review-table td:nth-child(5) { grid-row: 3; grid-column: 1 / -1; font-size: .88rem; color: var(--muted); margin-top: 0; }
  /* DPH sloupce: doklady 6+7, dodavatelé 3+4 */
  .doklady .day-table:not(.review-table) td:nth-child(6),
  .doklady .day-table:not(.review-table) td:nth-child(7),
  .dodavatele .day-table td:nth-child(3),
  .dodavatele .day-table td:nth-child(4) { display: none; }
}

.store-badge {
  background: var(--control); border-radius: 999px; padding: .25rem .8rem;
  font-size: .92rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* zelený puntík = doklad půjde do exportu účetnímu (škrtnuté ho nemají) */
.dot-export {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); margin-right: .5rem; vertical-align: 1px; flex: none;
}

.empty { color: var(--muted); text-align: center; padding: 3rem 0; }

.section-title { margin: 2rem 0 .8rem; }
.section-title .icon { color: var(--accent); margin-right: .3rem; }

/* ---------- detail dokladu ---------- */
.detail-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.detail-head h1 { margin: 0; }
/* štítky vedle nadpisu mají jednotnou výšku */
.detail-head .store-badge, .detail-head .flag {
  display: inline-flex; align-items: center; height: 30px; padding: 0 .8rem;
}
.detail-grid { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
/* Náhled dokladu: pořád na očích (sticky), zvětšení na fullscreen. */
.preview { position: sticky; top: 0; align-self: start; }
.preview iframe { width: 100%; height: 520px; border: none; border-radius: 8px; background: var(--control); }
.preview img { width: 100%; border-radius: 8px; cursor: zoom-in; display: block; }
/* stránky potvrzeného skenu jako obrázky — vlastní tenký scrollbar,
   žádný PDF viewer prohlížeče */
.preview-pages { max-height: 560px; overflow-y: auto; border-radius: 8px; display: grid; gap: .5rem; }
.preview-expand {
  position: absolute; top: .8rem; right: .8rem; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); border: 1px solid var(--border);
  color: #fff; font-size: 1.05rem; cursor: pointer;
}
.preview-expand:hover { background: rgba(0, 0, 0, .8); }
@media (max-width: 900px) {
  /* relative (ne static): tlačítko zvětšení se musí kotvit k náhledu,
     jinak uletí do rohu modalu pod zavírací křížek */
  .preview { position: relative; }
  .preview img { max-height: 38vh; width: auto; max-width: 100%; margin: 0 auto; }
  .preview iframe { height: 38vh; }
  .preview-pages { max-height: 42vh; }
  .preview-pages img { max-height: none; }
}

/* fullscreen prohlížeč dokladu (zoom kolečkem/gestem, tažení) */
.viewer-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .88);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
.viewer-backdrop img {
  max-width: 92vw; max-height: 92vh;
  transform-origin: center center; cursor: grab; user-select: none;
}
.viewer-backdrop img.dragging { cursor: grabbing; }
.viewer-backdrop iframe { width: 94vw; height: 94vh; border: none; border-radius: 8px; background: #fff; }
.viewer-close {
  position: fixed; top: 1rem; right: 1.2rem; z-index: 201;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--control); border: 1px solid var(--border);
  color: var(--text); font-size: 1.4rem; cursor: pointer;
}
.viewer-hint { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); color: #9a9aa3; font-size: .85rem; }
/* mini-náhledy stránek draftu — kolečko: aktivní červené, jinak bílé */
.page-thumbs { display: flex; gap: .55rem; flex-wrap: wrap; margin: .7rem 0 .2rem; }
.page-thumb {
  position: relative; width: 58px; height: 76px; padding: 0;
  border: 2px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--control); cursor: pointer;
}
.page-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-thumb span {
  position: absolute; right: 4px; bottom: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--bg);
  font-size: .75rem; font-weight: 500;
}
.page-thumb:hover { border-color: #5d5d5d; }
.page-thumb.active { border-color: var(--accent); }
.page-thumb.active span { background: var(--accent); color: #fff; }

.fields dl { display: grid; grid-template-columns: 130px 1fr; row-gap: .45rem; }
.fields dt { color: var(--muted); }
.amount-big { font-family: var(--font-head); font-stretch: 84%; font-size: 1.3rem; font-weight: 760; }
.items-view { width: 100%; border-collapse: collapse; }
.items-view td { padding: .35rem .4rem; border-bottom: 1px solid var(--border); }
.items-view .num { text-align: right; white-space: nowrap; }
.items-view tr.uncertain td { background: var(--yellow-soft); }
.chain ol { padding-left: 1.2rem; }
.chain li { margin: .35rem 0; }
.chain li.current { font-weight: 500; }
.chain li.superseded a { text-decoration: line-through; }
.correction-form input[type="file"] { margin: .6rem 0; }
.doc-actions-card .row { align-items: center; }

/* potvrzovací / editační formulář */
.confirm-form label { margin-bottom: .8rem; }
.js-fill-totals { color: var(--muted); font-size: .85rem; margin-left: .6rem; font-family: var(--font); font-weight: 400; }
.js-fill-totals:hover { color: var(--text); }
.items-edit { width: 100%; border-collapse: collapse; margin-bottom: .5rem; }
.items-edit th { text-align: left; font-size: .76rem; color: var(--muted); padding: .2rem .3rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.items-edit td { padding: .3rem .3rem; vertical-align: middle; }
.items-edit input, .items-edit select { margin-top: 0; }
/* custom select v řádku položky — stejná výška jako inputy vedle */
.items-edit .lp-select { margin: 0; min-width: 108px; }
.items-edit .lp-select-toggle { min-height: 42px; padding: .45rem .8rem; }
.items-edit input[type="text"] { height: 42px; }
/* nejisté pole = jen decentní žlutý rámeček, žádná špinavá výplň */
.items-edit tr.uncertain input, .items-edit tr.uncertain select,
.items-edit tr.uncertain .lp-select-toggle { border-color: rgba(234, 179, 8, .55); }
/* Odebrání položky: destruktivní akce = červený obrys už v klidu,
   ne až na hover — křížek nesmí vypadat jako dekorace. */
.items-edit .remove-item {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(229, 72, 77, .45);
  color: #ff8a8e; font-size: 1.15rem; line-height: 1; cursor: pointer;
  text-decoration: none;
}
.items-edit .remove-item:hover { color: #ff6b70; border-color: rgba(229, 72, 77, .9); background: rgba(229, 72, 77, .08); }
/* K platbě: menší tlačítko, ať řádek tabulky nenafoukne. */
.pay-table .btn-pay { min-height: 34px; padding: .35rem .8rem; font-size: .85rem; }
.pay-table form { margin: 0; display: inline-block; }

.totals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
@media (max-width: 640px) { .totals-grid { grid-template-columns: repeat(2, 1fr); } }
/* Celkem = hlavní číslo formuláře — výrazně větší. */
.total-gross input { font-weight: 500; font-size: 1.35rem !important; }
.payment { border: none; margin-bottom: .9rem; }
.payment legend { font-size: .88rem; color: var(--muted); margin-bottom: .3rem; }
.payment label { display: inline-flex; align-items: center; gap: .45rem; margin-right: 1.2rem; color: var(--text); }
/* POZOR: žádné width:auto — přepisovalo by rozměr custom radia (ovál). */
.payment input { margin: 0; }
.confirm-form .btn-primary { margin-top: 1rem; }

/* ---------- provozovny ---------- */
/* Karta appky Spárováno — korálová dlaždice jako ikona na ploše
   (stejný jazyk jako instalační lišta), jemně korálový rámeček karty.
   Nesmí ale vypadat jako výstraha — žádné plošné červené podbarvení. */
.app-url-banner {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  border-color: rgba(244, 80, 60, .45);
}
.app-tile {
  width: 52px; height: 52px; border-radius: 14px; flex: none;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}
.app-url-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.app-url-name { font-family: var(--font-head); font-stretch: 84%; font-weight: 760; font-size: 1.05rem; }
.app-url-label {
  color: var(--muted); font-size: .8rem; font-family: var(--font);
  text-transform: uppercase; letter-spacing: .05em;
}
.app-url-sub { color: var(--muted); font-size: .88rem; }
.app-url-value {
  font-family: var(--font-head); font-stretch: 84%; font-weight: 760; font-size: 1.3rem;
  color: var(--text); text-decoration: none; overflow-wrap: anywhere;
}
.app-url-value:hover { color: var(--accent); }
.app-url-actions { display: flex; align-items: center; gap: 1rem; margin-left: auto; flex-wrap: wrap; }
.app-url-actions .linklike { color: var(--muted); font-size: .9rem; }
.app-url-actions .linklike:hover { color: var(--text); }
@media (max-width: 640px) {
  .app-url-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
}

.new-store .btn { margin-bottom: .1rem; }
.store-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
/* decentní odkaz na Logy naskladnění dole v kartě u zařízení —
   vedle „Upravit" v hlavičce splýval na „Upravit logy" */
.store-logs-row { margin-top: .7rem; }
.store-logs-row a { color: var(--muted); font-size: .88rem; }
.store-logs-row a:hover { color: var(--text); }
.store-head h2 { margin: 0; }
.store-head .store-edit-toggle { margin-left: auto; color: var(--muted); text-decoration: none; }
.store-head .store-edit-toggle:hover { color: var(--text); text-decoration: underline; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-dot.on { background: var(--green); }

.store-info { margin: .9rem 0 .3rem; display: grid; gap: .55rem; }
.info-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.info-label { color: var(--muted); font-size: .85rem; width: 120px; flex: none; }
.code-chip {
  background: var(--control); border: 1px solid var(--border); border-radius: 10px;
  padding: .35rem .85rem; font-weight: 500; font-size: 1.05rem; letter-spacing: .08em;
}
.pin-dots { font-size: 1.05rem; padding: .35rem 0; letter-spacing: .08em; }
/* odhalený PIN běžným písmem — žádný roztahaný „kódový" styl */
.pin-value { font-size: 1rem; font-weight: 500; padding: .35rem 0; }
.pin-eye {
  display: inline-flex; align-items: center;
  background: none; border: none; cursor: pointer; padding: .2rem;
  color: var(--muted); font-size: 1.1rem;
}
.pin-eye:hover { color: var(--text); }
.info-row .linklike { color: var(--muted); font-size: .88rem; }
.info-row .linklike:hover { color: var(--text); }
.hint-inline {
  display: inline-flex; gap: .4rem; align-items: baseline;
  color: var(--muted); font-size: .82rem;
}
.hint-inline .icon { transform: translateY(1px); }

.store-form {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.1rem; margin: .8rem 0;
}
.store-form .row { align-items: flex-end; }
.store.inactive { opacity: .6; }
.devices { width: 100%; border-collapse: collapse; margin-top: .5rem; }
/* akce v posledním sloupci k pravému okraji — nelítají v prostoru
   (:not — editační panel správce je taky poslední td a patří vlevo) */
.devices tr:not(.user-edit-row) td:last-child { text-align: right; }
.devices td:last-child form { display: inline-block; }
.devices .linklike .icon { margin-right: .25rem; }
.devices th { text-align: left; font-size: .76rem; color: var(--muted); padding: .3rem .4rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.devices td { padding: .45rem .4rem; border-top: 1px solid var(--border); }
.devices tr.superseded { opacity: .55; }

/* ---------- export, notifikace ---------- */
/* Checkboxy provozoven v zarovnané mřížce — flex wrap dělal „klikatou"
   cikcak sazbu; na úzkém displeji mřížka sama spadne do jednoho sloupce. */
.store-checks { border: none; margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem 1.4rem; }
.store-checks legend { margin-bottom: .5rem; }
.store-checks legend { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .05em; }

/* Platby z banky (párovací symboly, migrace 012) — volitelný krok
   nad stažením exportu; žádný wizard, jen sekce ve stejné kartě. */
.bank-box { border: 1px dashed var(--border); border-radius: 12px; padding: .9rem 1rem 1rem; margin: 1rem 0; }
.bank-box legend { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 .4rem; }
.bank-state { font-size: .9rem; margin: .2rem 0 .6rem; }
.bank-state.ok b { color: var(--green); }
.bank-row { align-items: center; }
.bank-row input[type="file"] { flex: 1; min-width: 0; }
.bank-report { margin-top: .8rem; font-size: .88rem; border-top: 1px dashed var(--border); padding-top: .7rem; }
.bank-report ul { margin: .3rem 0 .8rem 1.2rem; }
.bank-report li { margin-bottom: .25rem; }
.symbol-form { display: flex; gap: .4rem; align-items: center; }
.symbol-form input { max-width: 190px; }

/* nastavení notifikací: rozsah (radia) -> pobočky -> kanály */
.notify-prefs { border: none; margin: 1rem 0; }
.notify-prefs legend { font-size: .8rem; color: var(--muted); margin-bottom: .6rem; text-transform: uppercase; letter-spacing: .05em; }
.notify-scope { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-bottom: .7rem; }
.notify-scope label { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-size: 1rem; cursor: pointer; }
.scope-stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem 1.4rem; padding: .2rem 0 .2rem 1.9rem; margin-bottom: .5rem; }
/* Kanály: popisek na vlastním řádku, checkboxy POD SEBOU — půl vedle
   a půl pod popiskem působilo rozbitě. */
.notify-channels {
  display: flex; flex-direction: column; align-items: flex-start; gap: .55rem;
  border-top: 1px solid var(--border); padding-top: .7rem; margin-top: .5rem;
}
.mini-legend { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.notifikace .checkbox { margin: .6rem 0 1rem; }
.notify-on { color: var(--green); font-weight: 500; }

/* ---------- dodavatelé (měsíční přehled) ---------- */
.suppliers-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .7rem; }
.suppliers .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.supplier-clear { color: var(--accent); text-decoration: none; font-size: .92rem; }
.supplier-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.supplier-chip {
  display: inline-flex; align-items: baseline; gap: .55rem;
  background: var(--control); border: 1px solid var(--border);
  border-radius: 999px; padding: .45rem 1rem;
  text-decoration: none; font-size: .95rem;
}
.supplier-chip:hover { border-color: #4d4d4d; }
.supplier-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.supplier-chip .s-name { font-weight: 500; }
.supplier-chip .s-cnt { color: var(--muted); font-size: .82rem; }

/* ---------- vlastní select (lp-select) ---------- */
.lp-select { position: relative; display: block; margin-top: .25rem; }
.lp-select > select { display: none; }
.lp-select-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: .7rem;
  width: 100%; min-height: 44px; padding: .5rem .9rem;
  background: var(--control); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; text-align: left;
}
.lp-select-toggle::after {
  content: ''; width: 9px; height: 9px; flex: none;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
}
.lp-select.open .lp-select-toggle { border-color: var(--accent); }
.lp-select-panel {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  padding: .4rem; max-height: 320px; display: flex; flex-direction: column;
}
.lp-select-search {
  width: 100%; margin: 0 0 .4rem; padding: .5rem .7rem;
  background: var(--control); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font: inherit;
}
.lp-select-list { overflow-y: auto; }
.lp-select-option {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  width: 100%; padding: .5rem .7rem; border: none; border-radius: 8px;
  background: none; color: var(--text); font: inherit; cursor: pointer; text-align: left;
  white-space: nowrap;
}
.lp-select-option:hover { background: var(--control); }
.lp-select-option.selected { color: var(--accent); }
.lp-select-option.selected::after { content: '✓'; }
.lp-select-empty { color: var(--muted); padding: .5rem .7rem; font-size: .92rem; }
/* select ve formulářích v řádku (filtr provozoven) */
.store-filter .lp-select { display: inline-block; min-width: 240px; margin: 0; }
.year-form .lp-select { display: inline-block; margin: 0; }
.year-form .lp-select-toggle { min-height: 36px; background: none; border: none; color: var(--muted); font-family: var(--font-head); font-stretch: 84%; font-size: 1.1rem; padding: .2rem .4rem; }

/* ---------- modal detailu dokladu ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  display: flex; align-items: center; justify-content: center;
  padding: 3vh 1.2rem;
}
.modal {
  position: relative;
  width: min(1240px, 100%);
  max-height: 94vh;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  display: flex; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.modal-body { width: 100%; overflow-y: auto; padding: 1.6rem 1.8rem; }
.modal-close {
  position: absolute; top: .9rem; right: 1rem; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--control); border: 1px solid var(--border);
  color: var(--text); font-size: 1.35rem; line-height: 1; cursor: pointer;
}
.modal-close:hover { border-color: #4d4d4d; }
.modal .detail-head { padding-right: 3rem; }
.modal h1 { font-size: 1.5rem; }

/* jednotná typografie detailu — žádné poskakování velikostí */
.fields dl { display: grid; grid-template-columns: 130px 1fr; row-gap: .5rem; align-items: baseline; }
.fields dt { color: var(--muted); font-size: .92rem; }
.fields dd { font-size: 1.02rem; }
.amount-big { font-size: 1.3rem; }
.preview .muted { font-size: .88rem; }
.doc-actions-card h3, .correction-form h3, .chain h3 { margin-top: 0; }

/* vlastní vybíratko souboru */
.file-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .8rem; }
.file-field { position: relative; display: inline-flex; align-items: center; gap: .8rem; }
.file-field input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0; padding: 0; border: 0;
}
.file-field .file-btn { pointer-events: none; }
.file-field .file-name { font-size: .92rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-field .file-name.picked { color: var(--text); }
.file-field-wrap > .file-field { display: flex; margin-top: .35rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- mobil (admin na telefonu) ---------- */
@media (max-width: 900px) {
  .topbar { gap: .8rem; padding: 0 .8rem; overflow-x: auto; scrollbar-width: none; }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar .brand span { display: none; }
  .topbar nav { flex: none; }
  .topbar nav a { padding: .45rem .7rem; white-space: nowrap; }
  .topbar .logout { margin-left: auto; flex: none; }
  main { padding: 1.2rem .8rem 3rem; }
  h1 { font-size: 1.5rem; }
  .month-summary { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .day-head { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .toolbar-filters .lp-select { min-width: 100%; }
  .toolbar-filters { width: 100%; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }

  /* modal na mobilu = celá obrazovka */
  .modal-backdrop { padding: 0; }
  .modal { width: 100%; height: 100%; max-height: none; border-radius: 0; border: none; }
  .modal-body { padding: 1.1rem .9rem; }
}

/* ---------- potvrzovací dialog (náhrada confirm()) ---------- */
.dialog-backdrop { z-index: 130; } /* nad modalem detailu dokladu */
.modal.modal-dialog {
  width: min(420px, 100%); display: block; overflow: visible;
  text-align: center; padding: 2rem 1.8rem 1.6rem;
}
.dialog-icon {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 1.1rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--yellow-soft); color: var(--yellow);
}
.dialog-icon.danger { background: var(--accent-soft); color: #ff7a69; }
.dialog-icon svg { width: 28px; height: 28px; }
.modal-dialog h3 { margin: 0 0 .4rem; font-size: 1.25rem; }
/* pre-line: exportní souhrn skládá text po řádcích (\n) */
.modal-dialog p { line-height: 1.5; white-space: pre-line; }
.dialog-actions { display: flex; gap: .7rem; justify-content: center; margin-top: 1.5rem; }
.dialog-actions .btn { min-width: 132px; }
@media (max-width: 640px) {
  /* na mobilu dialog přes celou obrazovku */
  .dialog-backdrop { padding: 0; }
  .modal.modal-dialog {
    width: 100%; height: 100%; max-height: none; border-radius: 0; border: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 1.4rem;
  }
  .dialog-actions { flex-direction: column-reverse; width: 100%; margin-top: 2rem; }
  .dialog-actions .btn { width: 100%; min-height: 52px; }
}

/* ---------- chybová stránka ---------- */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 { font-size: 4rem; color: var(--muted); }
