/* =====================================================================
   Globaal Elevate — Účetní systém
   Design system: profesionální finanční software, tmavý režim.
   Vychází z rešerše (fintech dashboard, data-dense, high-contrast):
   vrstvená slate paleta, tabulární číslice pro částky, SVG ikony,
   sémantické stavové barvy (zelená/jantar/červená), viditelné focus stavy.
   ===================================================================== */

:root {
  /* Povrchy — vrstvená elevace (bg → surface → raised) */
  --bg:           #0b0e14;
  --surface:      #12151d;
  --surface-2:    #171b24;
  --surface-3:    #1e2330;
  --hover:        #1c2130;

  /* Okraje */
  --border:       #242b38;
  --border-strong:#323a4b;

  /* Text */
  --text:         #e7eaf1;
  --text-dim:     #99a1b3;
  --text-faint:   #6b7488;

  /* Značka (primární akce) */
  --brand:        #4d7cfe;
  --brand-hover:  #3f6ff0;
  --brand-soft:   rgba(77, 124, 254, 0.14);
  --brand-ring:   rgba(77, 124, 254, 0.45);

  /* Sémantické stavové barvy */
  --green:        #34cf92;
  --green-soft:   rgba(52, 207, 146, 0.15);
  --amber:        #f5b544;
  --amber-soft:   rgba(245, 181, 68, 0.15);
  --red:          #f56565;
  --red-soft:     rgba(245, 101, 101, 0.15);

  --topbar-bg:    rgba(11, 14, 20, 0.85);

  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg:    0 16px 48px rgba(0, 0, 0, 0.5);

  /* Písmo: IBM Plex — pár „Financial Trust" (bankovnictví/fintech/enterprise).
     Plex Sans pro UI i nadpisy, Plex Mono pro tabulkové číslice a kódy účtů.
     Jeden grotesk font v celé appce — žádný samostatný serif, ať to působí
     jako profesionální software, ne jako kniha/publikace. */
  --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "Cascadia Mono", "Consolas", ui-monospace, monospace;

  /* Přihlašovací obrazovka — samostatný "ledger" akcent (stage-light zlatá),
     jinak nikde v appce nepoužitý; odlišný od --amber (ten je vyhrazený pro
     stavové varování DPH). Nese motiv účetních kódů/produkcí, ne branding appky. */
  --ledger-gold:      #d9a548;
  --ledger-gold-soft: rgba(217, 165, 72, 0.16);
  --auth-panel:       #0d1018;

  /* Přihlašovací obrazovka v2 (2026-07-09, po zpětné vazbě "ne knížka, jednoduché
     barvy, profesionální software font") — jednoduchá neutrální paleta + JEDNA
     akcentní barva (indigo/modrá, standard finančního softwaru), ne appka
     samotná (appka zůstává tmavě-modrá fintech, dokud nepřijde redesign
     celého systému). Levý brand panel je pevně barevný blok (stejný v obou
     režimech — běžný vzor u login obrazovek), pravý formulářový panel se
     řídí light/dark tématem. */
  --auth-bg:          #0b0d12;
  --auth-surface:     #14171d;
  --auth-border:      #232733;
  --auth-ink:         #f5f6f8;
  --auth-ink-dim:     #9aa1b0;
  --auth-ink-faint:   #656c7c;
  --auth-accent:      #4f6bff;
  --auth-accent-hover:#3f58e6;
  --auth-accent-soft: rgba(79, 107, 255, 0.16);
  --auth-panel-grad:  linear-gradient(160deg, #2d3568 0%, #171a2e 100%);

  font-size: 14px;
}

/* Světlý režim — přepíná se atributem data-theme na <html> (viz app.js /
   inline skript v index.html). Tlumené, čitelné, profesionální hodnoty. */
:root[data-theme="light"] {
  --bg:            #eef1f6;
  --surface:       #ffffff;
  --surface-2:     #f5f7fb;
  --surface-3:     #e9edf4;
  --hover:         #eef2f8;
  --border:        #dde2ec;
  --border-strong: #c5cdda;
  --text:          #1a2230;
  --text-dim:      #586274;
  --text-faint:    #8b95a7;
  --brand:         #3f6ff0;
  --brand-hover:   #3462e0;
  --brand-soft:    rgba(63, 111, 240, 0.10);
  --brand-ring:    rgba(63, 111, 240, 0.35);
  --green:         #1f9d6b; --green-soft: rgba(31, 157, 107, 0.14);
  --amber:         #c0860f; --amber-soft: rgba(192, 134, 15, 0.16);
  --red:           #d64545; --red-soft:   rgba(214, 69, 69, 0.12);
  --ledger-gold:      #b1802b;
  --ledger-gold-soft: rgba(177, 128, 43, 0.14);
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --shadow:    0 4px 16px rgba(30, 40, 60, 0.08);
  --shadow-lg: 0 20px 50px rgba(30, 40, 60, 0.14);

  --auth-bg:          #ffffff;
  --auth-surface:     #ffffff;
  --auth-border:      #e5e7eb;
  --auth-ink:         #111827;
  --auth-ink-dim:     #6b7280;
  --auth-ink-faint:   #9aa1ae;
  --auth-accent:      #3b5bfb;
  --auth-accent-hover:#2f49e0;
  --auth-accent-soft: rgba(59, 91, 251, 0.08);
  --auth-panel-grad:  linear-gradient(160deg, #3b5bfb 0%, #1e2a78 100%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tabulární číslice všude, kde jde o čísla/peníze — brání poskakování sloupců */
.num, .mono, td.num, th.num, .kpi .value, input[type="number"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.mono { font-family: var(--font-mono); }

/* Vlastní scrollbary pro tmavý režim */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #39435a; }
::-webkit-scrollbar-track { background: transparent; }

#app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------------------------------------------------------------- Top nav */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 58px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar-left { display: flex; align-items: center; gap: 26px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
/* Logo je vlastní PNG s bílým pozadím oříznutým na průhledné — funguje na
   libovolném pozadí jen s bílou "destičkou" pod sebou (nemá tmavou variantu). */
.brand-logo-plate {
  background: #fff; border-radius: 6px; padding: 5px 9px;
  display: inline-flex; align-items: center; flex-shrink: 0;
}
.brand-logo { height: 18px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-sub { font-size: 10px; color: var(--text-faint); }

.topnav { display: flex; align-items: center; gap: 2px; }
.nav-group { position: relative; }
.nav-group-btn {
  background: transparent; border: none; box-shadow: none; color: var(--text-dim);
  font-size: 13px; font-weight: 500; padding: 8px 10px; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-group-btn:hover { background: var(--hover); color: var(--text); }
.nav-group.active .nav-group-btn { color: var(--text); font-weight: 600; }
.nav-caret { width: 13px; height: 13px; flex-shrink: 0; transition: transform 0.15s ease; }
.nav-group.open .nav-caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
  display: none; flex-direction: column; gap: 1px;
}
.nav-group.open .nav-dropdown { display: flex; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  color: var(--text-dim); font-size: 13px; font-weight: 500; user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-icon svg { width: 15px; height: 15px; stroke-width: 1.75; }

.vat-badge {
  font-size: 11.5px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-dim);
  display: flex; align-items: center; gap: 7px;
}
.vat-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.vat-badge.on { color: var(--amber); }
.vat-badge.on::before { background: var(--amber); }
.app-version { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.topbar-right .theme-toggle { width: 32px; height: 32px; border-radius: 8px; padding: 0; justify-content: center; }
.topbar-right .theme-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------------------------------------------------------------- Page header + content */
.pagebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.pagebar h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -0.02em; }
.topbar-actions { display: flex; gap: 9px; }

.content { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.view { padding: 24px 30px 64px; flex: 1; width: 100%; }

/* ---------------------------------------------------------------- Panels
   Stejný restrained-glass recept jako .modal (rgba varianta --surface na
   tmavý/světlý režim + mírný blur), ať karty a modaly působí jako jeden
   systém — schváleno po ukázání na .modal, viz Rozhodnutí ve flow-state. */
.panel {
  background: rgba(18, 21, 29, 0.72);
  backdrop-filter: blur(20px) saturate(1.08); -webkit-backdrop-filter: blur(20px) saturate(1.08);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
}
:root[data-theme="light"] .panel { background: rgba(255, 255, 255, 0.75); }
.panel h2 {
  margin: 0 0 15px; font-size: 12px; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------- KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: rgba(18, 21, 29, 0.72);
  backdrop-filter: blur(20px) saturate(1.08); -webkit-backdrop-filter: blur(20px) saturate(1.08);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 20px; position: relative; overflow: hidden;
  transition: border-color 0.15s ease;
}
:root[data-theme="light"] .kpi { background: rgba(255, 255, 255, 0.75); }
.kpi:hover { border-color: var(--border-strong); }
.kpi .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; font-weight: 600; }
.kpi .value { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .sub { font-size: 12px; color: var(--text-dim); margin-top: 7px; line-height: 1.4; }
.kpi::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: 0.7; }
.kpi.warn::after { background: var(--amber); }
.kpi.bad::after { background: var(--red); }
.kpi.good::after { background: var(--green); }
.kpi.warn .value { color: var(--amber); }
.kpi.bad .value { color: var(--red); }
.kpi.good .value { color: var(--green); }

/* ---------------------------------------------------------------- Tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
thead th {
  color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: none; }
tfoot td { border-top: 2px solid var(--border-strong); font-weight: 600; padding-top: 12px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
td.num, th.num { text-align: right; }

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.koncept { background: var(--surface-3); color: var(--text-dim); }
.badge.schvaleny { background: var(--amber-soft); color: var(--amber); }
.badge.zauctovany { background: var(--green-soft); color: var(--green); }
.badge.stornovany { background: var(--red-soft); color: var(--red); }
.badge.otevrene { background: var(--green-soft); color: var(--green); }
.badge.uzavrene { background: var(--surface-3); color: var(--text-dim); }

/* ---------------------------------------------------------------- Buttons */
/* Tlačítka — přepracováno: primární zůstává plné (jasná CTA), sekundární a
   danger jsou teď "ghost" (průhledné pozadí + barevný obrys), ne plná šedá
   krabička jako předtím — vzdušnější, méně "AI generic" vzhled. */
/* Všechna tlačítka průhledná (ghost) — i primární CTA, ne jen sekundární/
   danger. Odlišují se jen barvou textu/obrysu, ne plnou výplní. */
button, .btn {
  background: transparent; color: var(--brand); border: 1px solid var(--brand); border-radius: 10px;
  padding: 9px 17px; font-size: 13px; cursor: pointer; font-weight: 600; font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
  display: inline-flex; align-items: center; gap: 7px;
}
button:hover, .btn:hover { background: var(--brand-soft); box-shadow: none; }
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
button.secondary, .btn.secondary { color: var(--text-dim); border-color: var(--border-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--hover); color: var(--text); border-color: var(--text-faint); }
button.danger { color: var(--red); border-color: rgba(245, 101, 101, 0.4); }
button.danger:hover { background: var(--red-soft); }
button.small, .btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:disabled:hover { background: transparent; box-shadow: none; }

/* ---------------------------------------------------------------- Forms */
input, select, textarea {
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13px; width: 100%; font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring);
}
input[type="checkbox"] { width: auto; accent-color: var(--brand); }
/* iOS Safari automaticky přiblíží stránku při focusu na input s font-size
   pod 16px — na mobilu proto vynutit 16px, ať se stránka neroztřese. */
@media (max-width: 820px) {
  input, select, textarea { font-size: 16px; }
}
/* Skrýt ošklivé nativní "Browse..." tlačítko file inputu — vlastní styl přes
   ::file-selector-button (moderní standard, funguje bez JS/hidden-input triku). */
input[type="file"] {
  padding: 7px 10px; font-size: 12.5px; color: var(--text-dim);
}
input[type="file"]::file-selector-button {
  background: transparent; color: var(--brand); border: 1px solid var(--brand); border-radius: var(--radius-sm);
  padding: 7px 13px; font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; margin-right: 10px; transition: background 0.15s ease;
}
input[type="file"]::file-selector-button:hover { background: var(--brand-soft); }
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; margin-top: 12px; font-weight: 500; }
/* flex (ne grid) záměrně — u řádku, který nezaplní celou šířku, grid auto-placement
   nechá políčka doleva se zbytkem prázdný (viz #settings, kde "Telefon/Logo/
   Razítko/Podpis" nebo "Kód finančního úřadu..." řádky nevyplní všechny sloupce) —
   flex + justify-content:center vycentruje i neúplný řádek. */
.form-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
.form-grid > * { flex: 1 1 210px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
.line-items-table input { min-width: 90px; }

/* ---------------------------------------------------------------- Modal
   Restrained glass — translucent surface + blur, ne barevné gradient-bloby
   (to už bylo jednou zamítnuté jako "vypadá to jako AI"). Radius/border/stín
   sladěno s .auth-card, aby karty působily jako součást stejného systému,
   ne jako bolted-on efekt. */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 5, 10, 0.66); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: rgba(18, 21, 29, 0.78);
  backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1);
  border: 1px solid var(--border-strong); border-radius: 16px;
  padding: 24px; width: 660px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
:root[data-theme="light"] .modal { background: rgba(255, 255, 255, 0.82); }
.modal h2 {
  margin: 0 0 16px; font-size: 17px; letter-spacing: -0.01em; font-weight: 700;
  text-transform: none; color: var(--text); padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.scan-box { background: var(--brand-soft); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 18px; }
.scan-box label { margin-top: 0; }
.scan-box input[type="file"] { font-size: 12px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar select, .toolbar input { width: auto; }
.toolbar .spacer { flex: 1; }

.empty-state { color: var(--text-dim); text-align: center; padding: 44px 12px; font-size: 13px; }

/* ---------------------------------------------------------------- Cashflow chart */
.cashflow-chart-wrap { display: flex; flex-direction: column; gap: 10px; position: relative; }
.cashflow-chart { width: 100%; height: 180px; overflow: visible; cursor: crosshair; }
.cashflow-chart .cashflow-label { font-size: 9px; fill: var(--text-faint); font-family: var(--font-ui); }
.cashflow-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-dim); }
.cashflow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cashflow-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.cashflow-tooltip {
  position: absolute; pointer-events: none; z-index: 10;
  background: var(--surface-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 11.5px; display: none; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow-lg); white-space: nowrap;
}
.cashflow-tooltip.show { display: flex; }
.cashflow-tooltip strong { color: var(--text); font-size: 11px; margin-bottom: 2px; }
.cashflow-tooltip .in { color: var(--green); }
.cashflow-tooltip .out { color: var(--red); }

/* ---------------------------------------------------------------- KPI delta badge */
.kpi-delta {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px;
  margin-left: 6px; vertical-align: middle; letter-spacing: 0;
}
.kpi-delta.up { background: var(--green-soft); color: var(--green); }
.kpi-delta.down { background: var(--red-soft); color: var(--red); }

/* ---------------------------------------------------------------- Next actions panel */
.next-actions { display: flex; flex-direction: column; gap: 6px; }
.next-action-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text); font-size: 13px; text-decoration: none; transition: background 0.15s ease;
}
.next-action-item:hover { background: var(--surface-3); }
.next-action-item svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; bottom: 26px; right: 26px; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 13px 18px 13px 16px;
  font-size: 13px; z-index: 100; box-shadow: var(--shadow-lg); max-width: 400px;
  border-left: 3px solid var(--brand); animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.error { border-left-color: var(--red); color: var(--red); }
.toast.success { border-left-color: var(--green); color: var(--green); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- Offline banner */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--amber); color: #1a1200; text-align: center;
  font-size: 12.5px; font-weight: 600; padding: 7px 12px;
  animation: toastIn 0.2s ease;
}
/* Update banner sdílí stejný recept jako offline-banner (fixed pruh nahoře),
   jen jinou barvou (--green, ne --amber) — vizuálně odlišit "informativní/
   akční" od "varovného" stavu. Offline/obsahová aktualizace/aktualizace
   desktop shellu jsou na sobě nezávislé a mohou nastat současně — `top` se
   nesetuje tady, ale dynamicky v JS (appendStackedBanner v app.js), aby se
   víc bannerů zobrazilo pod sebou, ne přes sebe. */
.update-banner {
  background: var(--green); color: #06231a;
}
.update-banner button {
  margin-left: 10px; padding: 3px 10px; font-size: 11.5px;
  background: #06231a; color: var(--green); border: none; border-radius: 6px;
}
.update-banner button:hover { background: #0a3427; }

/* ---------------------------------------------------------------- Auth screen */
/* =====================================================================
   PŘIHLAŠOVACÍ OBRAZOVKA — v3 (2026-07-09, po zpětné vazbě)
   Zpětná vazba: "ne knížka", jednoduchá paleta, profesionální software
   font (ne serif). Vzor: běžný fintech/SaaS split-panel login (neo-bank
   UI kity) — pevný barevný (indigo) levý panel s jemným přechodem,
   neutrální bílá/tmavá pravá strana s formulářem. Jeden grotesk font
   (Plex Sans) v celé appce, žádný serif. Zaoblené karty, měkký stín,
   žádné sklo/blur, žádné ruled-paper textury.
   ===================================================================== */
.auth-screen {
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; overflow: hidden;
  background: var(--auth-bg);
  font-family: var(--font-ui); color: var(--auth-ink);
}

.auth-theme-toggle {
  position: fixed; top: 20px; right: 22px; z-index: 20; width: 36px; height: 36px;
  background: var(--auth-surface); border: 1px solid var(--auth-border); color: var(--auth-ink-dim);
  border-radius: 10px; padding: 0; justify-content: center;
}
.auth-theme-toggle:hover { color: var(--auth-ink); border-color: var(--auth-accent); }
.auth-theme-toggle svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- Levý panel: pevný barevný blok (stejný v light/dark — běžný login vzor) --- */
.auth-brand-panel {
  position: relative; z-index: 1; width: 440px; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 30px;
  padding: 48px 44px; overflow: auto;
  background: var(--auth-panel-grad); color: #f2f4ff;
}
.auth-brand-inner { display: flex; flex-direction: column; }

.auth-brand-top { display: flex; align-items: center; gap: 12px; }
.auth-brand-top .brand-logo { height: 24px; }
.auth-brand-wordmark {
  font-family: var(--font-ui); font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em; color: #fff; line-height: 1.4;
}
.auth-brand-wordmark span { display: block; font-size: 11px; color: rgba(242, 244, 255, 0.6); font-weight: 500; letter-spacing: 0.01em; }

.auth-hero { margin-top: 40px; }
.auth-hero h2 {
  font-family: var(--font-ui); font-size: 28px; font-weight: 700;
  line-height: 1.28; letter-spacing: -0.015em; margin: 0; color: #fff;
}
.auth-hero h2 em { font-style: normal; font-weight: 700; color: #aeb9ff; }
.auth-hero p { color: rgba(242, 244, 255, 0.72); font-size: 13.5px; line-height: 1.65; margin: 16px 0 0; max-width: 320px; }

/* --- Poučky o daních a účetnictví (rotující) --- */
.tax-tip-card {
  position: relative; margin-top: 30px; border-radius: 14px; padding: 18px 20px 16px; min-height: 148px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; flex-direction: column;
}
.tax-tip-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: rgba(242, 244, 255, 0.65);
  font-weight: 600; padding-bottom: 11px; margin-bottom: 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.tax-tip-icon { display: inline-flex; color: #aeb9ff; }
.tax-tip-icon svg { width: 15px; height: 15px; }
.tax-tip-body { flex: 1; opacity: 0; transform: translateY(4px); transition: opacity 0.35s ease, transform 0.35s ease; }
.tax-tip-body.in { opacity: 1; transform: none; }
.tax-tip-tag {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
  color: #aeb9ff; margin-bottom: 8px;
}
.tax-tip-body p { margin: 0; font-size: 13px; line-height: 1.6; color: #fff; }
.tax-tip-dots { display: flex; gap: 6px; margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.tax-tip-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); opacity: 1; cursor: pointer; transition: opacity 0.2s ease, background 0.2s ease; padding: 0; border: none; }
.tax-tip-dot:hover { background: rgba(255, 255, 255, 0.55); }
.tax-tip-dot.active { background: #fff; }

.auth-brand-footer {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px;
  font-size: 11px; color: rgba(242, 244, 255, 0.55); margin-top: 8px;
}
.auth-links a { color: rgba(242, 244, 255, 0.55); text-decoration: none; }
.auth-links a:hover { color: #fff; text-decoration: underline; }
.auth-links .sep { margin: 0 7px; }

/* --- Pravý panel: neutrální, čitelný, obyčejná karta --- */
.auth-form-panel { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card {
  width: 400px; max-width: 100%; padding: 36px 34px 30px; border-radius: 16px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  box-shadow: 0 12px 32px rgba(15, 18, 30, 0.10);
  animation: authCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
:root:not([data-theme="light"]) .auth-card { box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4); }
/* Registrace firmy má víc polí — širší karta se dvěma sloupci, ne jeden
   dlouhý úzký sloupec formuláře. */
.auth-card.auth-card-wide { width: 620px; padding: 40px 44px 34px; }
@keyframes authCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 21px; margin: 0 0 6px; letter-spacing: -0.01em; font-weight: 700; text-align: center; color: var(--auth-ink); }
.auth-card .auth-sub { color: var(--auth-ink-dim); font-size: 12.5px; margin-bottom: 24px; line-height: 1.55; text-align: center; }
.auth-form-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--auth-ink-faint); margin: 22px 0 4px; padding-top: 18px; border-top: 1px solid var(--auth-border);
}
.auth-form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.auth-tabs {
  position: relative; display: flex; background: var(--auth-bg); border: 1px solid var(--auth-border);
  border-radius: 10px; padding: 3px; margin-bottom: 22px;
}
.auth-tabs-indicator {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: 0;
  background: var(--auth-surface); border: 1px solid var(--auth-border); border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-tabs button {
  position: relative; z-index: 1; flex: 1; background: transparent; border: none; box-shadow: none;
  padding: 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--auth-ink-faint); white-space: nowrap;
  transition: color 0.15s ease; justify-content: center;
}
.auth-tabs button:hover { background: transparent; color: var(--auth-ink-dim); }
.auth-tabs button.active { color: var(--auth-ink); }

.auth-card form label { font-size: 12px; color: var(--auth-ink-dim); }
.auth-card input, .auth-card select {
  background: var(--auth-bg); border: 1px solid var(--auth-border); color: var(--auth-ink); border-radius: 9px;
}
.auth-card input::placeholder { color: var(--auth-ink-faint); }
.auth-card input:focus, .auth-card select:focus {
  border-color: var(--auth-accent); box-shadow: 0 0 0 3px var(--auth-accent-soft);
}
.auth-card .form-actions { margin-top: 22px; }
.auth-card .form-actions button {
  width: 100%; justify-content: center; padding: 11px; font-size: 13.5px; border-radius: 9px;
  background: var(--auth-accent); border-color: transparent;
}
.auth-card .form-actions button:hover { background: var(--auth-accent-hover); }
.auth-card .form-actions button:focus-visible { box-shadow: 0 0 0 3px var(--auth-accent-soft); }

.auth-error { color: #e5484d; font-size: 12.5px; margin-top: 12px; text-align: center; }
.auth-hint { color: var(--auth-ink-dim); font-size: 12.5px; margin: 0 0 16px; line-height: 1.55; }
.auth-directors { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.auth-directors label { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--auth-ink); font-weight: 400; }
.auth-directors input[type="radio"] { width: auto; }

.auth-secure {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--auth-border); font-size: 11.5px; color: var(--auth-ink-faint);
}
.auth-secure svg { width: 14px; height: 14px; flex-shrink: 0; }

.auth-password-field { position: relative; }
.auth-password-field input { padding-right: 38px; }
.auth-password-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; box-shadow: none; padding: 6px; color: var(--auth-ink-faint);
}
.auth-password-toggle:hover { background: transparent; color: var(--auth-ink-dim); }
.auth-password-toggle svg { width: 16px; height: 16px; display: block; }

@media (max-width: 920px) {
  .auth-screen { flex-direction: column; overflow: auto; }
  .auth-brand-panel { width: auto; padding: 30px 24px 6px; justify-content: flex-start; }
  .auth-hero { margin-top: 24px; }
  .auth-hero h2 { font-size: 22px; }
  .auth-hero p, .tax-tip-card { display: none; }
  .auth-brand-footer { display: none; }
  .auth-form-panel { padding: 20px 24px 44px; }
}

/* ---------------------------------------------------------------- Utilities */
.text-dim { color: var(--text-dim); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* Nápověda — čitelný long-form text */
.view ol, .view ul { line-height: 1.85; }
.panel p { line-height: 1.65; color: var(--text); }
.panel p.text-dim { color: var(--text-dim); }

@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------- Splash screen (mobil/iOS boot) */
.splash-screen {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.splash-logo-plate {
  background: #fff; border-radius: 14px; padding: 18px 26px;
  animation: splashPulse 1.4s ease-in-out infinite;
}
.splash-logo { width: min(200px, 55vw); height: auto; display: block; }
@keyframes splashPulse { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.02); } }

/* ---------------------------------------------------------------- Bottom nav (mobil/iOS) */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around; align-items: stretch;
}
.bottom-nav-item {
  background: transparent; border: none; box-shadow: none; color: var(--text-faint);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border-radius: 10px; font-size: 10px; font-weight: 600; flex: 1;
  min-width: 0; font-family: inherit;
}
.bottom-nav-item.active { color: var(--brand); }
.bottom-nav-icon { display: flex; }
.bottom-nav-icon svg { width: 21px; height: 21px; stroke-width: 1.75; }
.bottom-nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.bottom-sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(3, 5, 10, 0.5);
  display: flex; align-items: flex-end; animation: fadeIn 0.15s ease;
}
.bottom-sheet {
  background: var(--surface); border-radius: 20px 20px 0 0; width: 100%;
  max-height: 75vh; padding: 10px 8px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg); animation: sheetIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.bottom-sheet-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 4px auto 10px; }
.bottom-sheet-scroll { overflow-y: auto; max-height: calc(75vh - 40px); padding: 0 8px; }
.bottom-sheet-group-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700;
  color: var(--text-faint); padding: 14px 8px 6px;
}
.bottom-sheet-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 14px; font-weight: 500;
}
.bottom-sheet-item.active { color: var(--brand); background: var(--brand-soft); }
.bottom-sheet-item .nav-icon svg { width: 18px; height: 18px; }

/* iOS/mobil breakpoint — bottom nav nahradí top dropdown navigaci, header
   se zjednoduší jen na logo + akce. */
@media (max-width: 820px) {
  .topnav { display: none; }
  .bottom-nav { display: flex; }
  .topbar { padding: 0 14px; height: 52px; }
  .brand-sub { display: none; }
  .vat-badge, .app-version { display: none; }
  .pagebar { padding: 14px 16px; }
  .view { padding: 16px 16px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- Balance hero (mobil, dashboard) */
.balance-hero { display: none; }
@media (max-width: 820px) {
  .balance-hero {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
    background: linear-gradient(160deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px;
  }
  .balance-hero-label { font-size: 12px; color: var(--text-dim); font-weight: 600; }
  .balance-hero-value { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
  .balance-hero-toggle {
    background: transparent; border: 1px solid var(--border-strong); color: var(--text-dim);
    border-radius: 2222px; padding: 5px 14px; font-size: 12px; font-weight: 600; font-family: inherit;
  }
}

/* ---------------------------------------------------------------- Section header (nadpis + pill) */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.section-header h2 { margin: 0; }
.section-header-pill {
  display: none; font-size: 11px; font-weight: 600; color: var(--text-dim);
  border: 1px solid var(--border-strong); border-radius: 2222px; padding: 5px 12px; white-space: nowrap;
}
@media (max-width: 820px) { .section-header-pill { display: inline-block; } }

/* ---------------------------------------------------------------- Favourite rows (mobil, seznamy) */
.favourite-rows { display: none; }
@media (max-width: 820px) {
  .favourite-rows { display: flex; flex-direction: column; gap: 8px; }
  .panel:has(.favourite-rows) .table-wrap { display: none; }
  .favourite-row {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  }
  .favourite-row-icon {
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 2222px; background: var(--surface-2); color: var(--text-dim);
  }
  .favourite-row-icon svg { width: 16px; height: 16px; }
  .favourite-row-text { min-width: 0; }
  .favourite-row-title { font-size: 13px; font-weight: 600; }
  .favourite-row-sub { font-size: 12px; color: var(--text-faint); }
}
