:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-border: #e2e4e9;
  --color-text: #1c1f26;
  --color-text-muted: #6b7280;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-danger: #dc2626;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--color-primary);
}

header.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

header.app-header h1 {
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
}

/* one login, several companies: the switcher beside the title */
header.app-header .company-switch {
  max-width: 220px;
  font-weight: 600;
}

nav.app-nav {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

nav.app-nav a {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 14px;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
}

nav.app-nav a.active,
nav.app-nav a:hover {
  color: var(--color-primary);
  background: #eef2ff;
}

/* Drop-down groups in the top navigation */
.nav-group {
  position: relative;
}

.nav-group-btn {
  background: none;
  border: 0;
  color: var(--color-text-muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.5;
  min-height: 0;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-group-btn.active,
.nav-group-btn:hover,
.nav-group.open .nav-group-btn {
  color: var(--color-primary);
  background: #eef2ff;
}

.nav-group-btn:focus-visible,
nav.app-nav a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 180px;
  padding: var(--space-1);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.nav-menu a {
  display: block;
  white-space: nowrap;
}

.nav-group.open .nav-menu {
  display: block;
}

/* The phone's "Menu" button — see the max-width: 640px block */
header.app-header .nav-toggle {
  display: none;
}

@media (hover: hover) {
  .nav-group:hover .nav-menu {
    display: block;
  }
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-4);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

select, input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="password"], input[type="search"], textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}

textarea {
  width: 100%;
  resize: vertical;
}

label {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.field {
  margin-bottom: var(--space-3);
}

.field-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.field-row > .field {
  flex: 1;
  min-width: 160px;
}

button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  cursor: pointer;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover, .btn:hover { background: var(--color-primary-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-secondary:hover { background: #f0f1f3; }

.btn-danger { background: var(--color-danger); }
.btn-warning { background: var(--color-warning); }
.btn-success { background: var(--color-success); }
.btn-sm { padding: 5px 10px; font-size: 13px; }

/* the line deducting a paid advance invoice — filled in by the server */
.advance-row input { background: #f4f5f7; color: var(--color-text); }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}
th { color: var(--color-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:hover td { background: #fafafa; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-unpaid { background: #eef0f3; color: #475569; }
.badge-partial { background: #fef3c7; color: #92400e; }
.badge-paid { background: #dcfce7; color: #166534; }
.badge-overdue { background: #fee2e2; color: #991b1b; }

.brand-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
}

.muted { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }

/* the bank link's state on its card in Settings */
.bank-status { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--color-border); }
.bank-status p { margin: 6px 0 0; }
.bank-status-ok { background: #dcfce7; border-color: #86efac; color: #166534; }
.bank-status-bad { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.bank-status-none { background: var(--color-surface); }
.right { text-align: right; }
.flex-end { display:flex; justify-content:flex-end; gap: var(--space-2); }

.items-table input { width: 100%; }
.items-table .itLineTotalIn { text-align: right; font-weight: 600; }
.items-table .itLineTotalIn[readonly] { background: transparent; border-color: transparent; }
.items-table td { vertical-align: top; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--color-text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 100;
}
.toast.error { background: var(--color-danger); }

.empty-state {
  text-align: center;
  padding: var(--space-5);
  color: var(--color-text-muted);
}

.autocomplete {
  position: relative;
}
.autocomplete-list {
  position: absolute;
  z-index: 20;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.autocomplete-list div {
  padding: 8px 10px;
  cursor: pointer;
}
.autocomplete-list div:hover { background: #eef2ff; }

.dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-primary);
  background: #eef2ff;
}
.dropzone.has-file {
  border-style: solid;
  border-color: var(--color-success);
  color: var(--color-text);
}
.scan-status {
  margin-top: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
}
.scan-status.scanning { background: #eef2ff; color: var(--color-primary); }
.scan-status.ok { background: #dcfce7; color: #166534; }
.scan-status.fail { background: #fef3c7; color: #92400e; }

.internal-note-card {
  background: #fffbea;
  border-color: #fde68a;
}

.attachment-preview {
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

/* Invoice list: filterable list on the left, PDF preview on the right */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}
.split-list,
.split-preview {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-width: 0;
}
.split-preview { display: none; }

.filter-panel {
  padding: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.filter-panel input[type="search"] {
  font: inherit;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
}
.filter-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
#filterToggle.is-active,
#itemsLaterBtn.is-active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #eef2ff;
}
.filter-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.filter-row > select,
.filter-row > input {
  flex: 1;
  min-width: 0;
}
.filter-row > span { color: var(--color-text-muted); }

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}
.chip:hover { background: #f0f1f3; }
.chip[aria-pressed="true"] {
  background: #eef2ff;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.list-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

/* the start page's VAT estimate (lib/vatEstimate.js) */
.vat-estimate {
  display: grid;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  border-bottom: 1px solid var(--color-border);
  background: #f5f7ff;
}
.vat-estimate a { color: inherit; text-decoration: none; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.vat-estimate a:hover strong, .vat-estimate a:focus-visible strong { text-decoration: underline; }
.vat-estimate .vat-due { color: #92400e; }
.vat-estimate .vat-due.soon { color: var(--color-danger); font-weight: 600; }

.invoice-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.invoice-list a {
  display: block;
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid transparent;
  color: inherit;
  text-decoration: none;
}
.invoice-list a:hover { background: #fafafa; }
.invoice-list a[aria-current="true"] {
  background: #eef2ff;
  border-left-color: var(--color-primary);
}
.invoice-list .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}
.invoice-list .number { font-weight: 700; }
.invoice-list .total { font-weight: 700; white-space: nowrap; }
.invoice-list .customer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.invoice-list .meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Role-aware UI — mirrors the server's rules in middleware/auth.js.
   Accountant (read-only): every button is hidden unless marked .ro (filters,
   menus, "show details" — things that change nothing), plus links into the
   edit forms. Whitelisting means a forgotten mark hides a harmless control
   rather than showing one that would only answer "no permission". */
html[data-role="uctovnicka"] button:not(.ro),
html[data-role="uctovnicka"] a[href^="faktura-nova.html"],
html[data-role="uctovnicka"] a[href^="vydavok-novy.html"],
html[data-role="uctovnicka"] .write-only:not(.accountant-ok),
html[data-role="uctovnicka"] .dropzone {
  display: none !important;
}
/* Salesperson (docs/rola-predajca.md): the same whitelist as the accountant,
   except on the pages made for them (body.seller-page: the invoice form,
   drafts) and for controls marked .seller-ok (e.g. sending their invoice). */
html[data-role="predajca"] body:not(.seller-page) button:not(.ro):not(.seller-ok),
html[data-role="predajca"] a[href^="faktura-nova.html?id="],
html[data-role="predajca"] a[href^="faktura-nova.html?advance="],
html[data-role="predajca"] a[href^="faktura-nova.html?quote="],
html[data-role="predajca"] a[href^="vydavok-novy.html"],
html[data-role="predajca"] body:not(.seller-page) .write-only:not(.seller-ok),
html[data-role="predajca"] .owner-only,
html[data-role="predajca"] .unlock-only,
html[data-role="predajca"] .not-seller {
  display: none !important;
}
html:not([data-role="predajca"]) .seller-only {
  display: none !important;
}
/* Unlocking a booked document is for the owner and the accountant. */
html[data-role="fakturant"] .unlock-only {
  display: none !important;
}
/* Settings, backups and accounts belong to the owner. */
html[data-role="fakturant"] .owner-only,
html[data-role="uctovnicka"] .owner-only {
  display: none !important;
}

/* Incoming-document line that still needs a stock decision */
tr.needs-decision td:first-child { box-shadow: inset 3px 0 0 var(--color-warning); }
tr.needs-decision select { border-color: var(--color-warning); }
/* items still to decide: yellow rows, a count above the table */
tr.needs-decision, tr.needs-decision td { background: #fef3c7; }
tr.decide-later, tr.decide-later td { background: #fffbeb; }
.decide-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: #fef3c7; color: #78350f; border: 1px solid #f59e0b; border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; }
@media (prefers-color-scheme: dark) {
  tr.needs-decision, tr.needs-decision td { background: #3a2f12; }
  tr.decide-later, tr.decide-later td { background: #2a2414; }
  .decide-box { background: #3a2f12; color: #f3dca3; border-color: #7a5d1e; }
}
.candidate-btn {
  background: #fef3c7;
  color: #92400e;
  border-color: transparent;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 0 0;
}
.candidate-btn:hover { background: #fde68a; }
/* stock units per invoiced unit (public/js/expenseItems.js) */
.eiPack.needs-check { border-color: var(--color-warning); }
.eiPackBox[hidden], .eiPackOpen[hidden] { display: none !important; }
.eiPackOpen { background: none; border: 0; padding: 0; min-height: 0; color: var(--color-primary, #2563eb); text-decoration: underline; cursor: pointer; }

/* Per-row "⋯" actions menu */
.invoice-list li { position: relative; }
/* Selecting several documents at once (bulk actions) */
.invoice-list .pick { display: none; position: absolute; left: 12px; top: 13px; width: 18px; height: 18px; margin: 0; }
.invoice-list.selecting .pick { display: block; }
.invoice-list.selecting a { padding-left: 40px; }
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: #eef2ff;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}
.bulk-bar[hidden] { display: none; }
.row-menu-btn {
  position: absolute;
  right: var(--space-2);
  bottom: 6px;
  padding: 0 8px;
  font-size: 18px;
  line-height: 22px;
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.row-menu-btn:hover,
.row-menu-btn[aria-expanded="true"] {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

.menu {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  padding: var(--space-1) 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.menu [role="menuitem"] {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu [role="menuitem"]:hover,
.menu [role="menuitem"]:focus-visible {
  background: #eef2ff;
  outline: none;
}
.menu [role="menuitem"].danger { color: var(--color-danger); }
.menu hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-1) 0;
}

.dialog {
  width: min(440px, calc(100vw - 32px));
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  box-shadow: 0 12px 32px rgba(0,0,0,.2);
}
.dialog::backdrop { background: rgba(0,0,0,.35); }

/* "✨ Novinky" (js/whatsNew.js): the dot says there's news not seen yet */
#newsLink.has-news::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: #e5484d; vertical-align: middle; }
.whats-new { width: min(560px, calc(100vw - 32px)); max-height: min(80vh, 720px); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius); color: var(--color-text); background: var(--color-surface, #fff); box-shadow: 0 12px 32px rgba(0,0,0,.2); }
.whats-new::backdrop { background: rgba(0,0,0,.35); }
.whats-new-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: var(--space-3); }
.whats-new-list { list-style: none; margin: 0; padding: 0; }
.whats-new-list li { padding: 10px 0; border-top: 1px solid var(--color-border); }
.whats-new-list p { margin: 4px 0; font-size: 14px; }
.whats-new-date { font-size: 12px; color: var(--color-text-muted); margin-bottom: 2px; }
.dialog h2 { margin: 0 0 var(--space-3); font-size: 17px; }
.dialog input,
.dialog textarea { width: 100%; }

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.preview-header h2 { margin: 0; font-size: 16px; }
/* the invoice's data in the list's preview — the PDF only when asked for */
.preview-body { flex: 1; overflow-y: auto; padding: var(--space-3); }
.preview-body h3 { font-size: 14px; margin: var(--space-3) 0 var(--space-1); }
.preview-body ul { margin: 0; padding-left: 18px; }
.preview-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); }
.preview-facts dt { color: var(--color-text-muted); font-size: 12px; }
.preview-facts dd { margin: 0; }
.preview-items td, .preview-items th { padding: 6px 8px; }
.preview-totals { margin: var(--space-2) 0 0 auto; max-width: 280px; }
.preview-totals > div { display: flex; justify-content: space-between; gap: var(--space-3); padding: 2px 0; }
.preview-totals .grand { font-weight: 700; font-size: 16px; border-top: 1px solid var(--color-border); margin-top: 4px; padding-top: 6px; }
.preview-frame {
  flex: 1;
  width: 100%;
  border: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #e5e7eb;
}

@media (min-width: 900px) {
  /* Both panes fill the viewport and scroll on their own */
  body.page-split {
    height: 100vh;
    display: flex;
    flex-direction: column;
  }
  body.page-split main {
    flex: 1;
    min-height: 0;
    max-width: none;
    width: 100%;
    display: flex;
    flex-direction: column;
  }
  .split {
    flex: 1;
    min-height: 0;
    grid-template-columns: minmax(340px, 420px) 1fr;
  }
  .split-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .invoice-list { overflow-y: auto; flex: 1; }
  .split-preview {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  /* Incoming-document items: one card per item instead of a six-column row */
  .items-stack thead { display: none; }
  .items-stack tr {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 6px;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
  }
  .items-stack td { padding: 0; border: 0; }
  .items-stack td:nth-child(1) { grid-column: 1 / 4; }
  .items-stack td:nth-child(6) { grid-column: 4; grid-row: 1; }
  .items-stack td:nth-child(5) { grid-column: 1 / -1; }
  .items-stack td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
  }
  .items-stack tr.needs-decision td:first-child { box-shadow: none; }
  .items-stack tr.needs-decision { box-shadow: inset 3px 0 0 var(--color-warning); padding-left: 8px; }
  button, .btn { min-height: 40px; }
  .btn-sm, .chip, .candidate-btn, .row-menu-btn { min-height: 0; }

  main { padding: var(--space-3); }
  /* The menu folds behind a "Menu" button and opens as one column */
  header.app-header { gap: var(--space-2); justify-content: space-between; }
  header.app-header h1 { white-space: normal; flex: 1; min-width: 0; }
  header.app-header .nav-toggle { display: inline-flex; align-items: center; }
  nav.app-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 2px; }
  nav.app-nav.open { display: flex; }
  nav.app-nav a, .nav-group-btn { display: block; width: 100%; text-align: left; padding: 10px 12px; font-size: 15px; }
  .nav-menu { position: static; min-width: 0; border: 0; box-shadow: none; padding: 0 0 0 16px; }
}

/* "Vaše údaje sú vaše" — the data promise on the public pages */
.data-promise { border: 1px solid var(--color-border); border-left: 4px solid var(--color-success); border-radius: var(--radius); padding: 12px 14px; margin: 16px 0; background: var(--color-surface); }
.data-promise h2 { font-size: 15px; margin: 0 0 8px; }
.data-promise ul { margin: 0 0 6px; padding-left: 18px; font-size: 14px; }
.data-promise li { margin-bottom: 4px; }
.data-promise a { font-size: 13px; }

/* Labels (štítky): coloured chips; --label is the label's colour */
.label-chip{display:inline-block;border:1px solid var(--label,#2563eb);background:color-mix(in srgb,var(--label,#2563eb) 14%,transparent);color:var(--color-text);border-radius:999px;padding:0 8px;font-size:12px;line-height:1.6;margin:2px 4px 0 0;white-space:nowrap}
.label-group{display:flex;flex-wrap:wrap;align-items:center;gap:2px 4px;margin:2px 0}
.label-pick{display:inline-flex;align-items:center;gap:2px;font-weight:400;cursor:pointer;margin:0 6px 0 0}
.label-pick input{margin:0}
.label-pick input:not(:checked)+.label-chip{background:transparent;opacity:.7}

/* an item's description in the invoice form: one line to start, growing with what's typed */
/* a long list in Settings scrolls inside its card, its header staying in view */
.saved-scroll { max-height: 420px; overflow-y: auto; }
.saved-scroll thead th { position: sticky; top: 0; background: var(--color-surface); z-index: 1; }

.items-table textarea.auto-grow { min-height: 0; overflow: hidden; resize: none; }

/* month header rows of a list split into months (js/monthGroups.js) */
.month-row td, tr.month-row:hover td { background: var(--color-bg); padding: 0; }
.month-toggle {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  width: 100%; padding: 10px 8px; text-align: left;
  background: none; color: var(--color-text); border: 0; border-radius: 0; font-size: 14px;
}
.month-toggle:hover { background: var(--color-border); }
.month-caret { width: 1em; color: var(--color-text-muted); }

/* a step to take shown in place of a status badge (Faktúry: check a payment, issue the final invoice) */
.badge-step {
  background: #fde68a; color: #78350f; box-shadow: inset 0 0 0 1px #f59e0b;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.badge-step:hover, .badge-step:focus-visible { background: #fcd34d; color: #78350f; text-decoration: none; }

/* the payment a link pointed to (Platby?payment=…) */
tr.payment-focus td { background: #fef3c7; }

/* read by screen readers, not shown */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* reordering an invoice's lines (faktura-nova.html) */
.items-table .row-tools { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.items-table .drag-handle { cursor: grab; color: var(--color-text-muted); font-size: 18px; padding: 0 4px; user-select: none; }
.items-table tr.dragging { opacity: .5; }
.items-table tr.dragging td { background: #eef2ff; }
@media (hover: none) { .items-table .drag-handle { display: none; } }

/* prices typed with VAT (the header's choice, faktura-nova.html): one price field per line, as in KROS */
.items-table.price-gross .itPrice { display: none; }
.items-table:not(.price-gross) .itGross { display: none !important; }
.items-table.price-gross .itGross { margin-top: 0 !important; }
.items-table .head-select { width: 100%; font-size: 12px; font-weight: 600; padding: 4px; text-transform: none; }

/* The envelope of an invoice sent by e-mail (js/app.js mailEnvelope): grey
   sent, blue opened, green the invoice viewed; hover tells the details. */
.mail-env { display: inline-flex; align-items: center; gap: 1px; margin-left: 6px; font-size: 0.95em; font-weight: 400; line-height: 1; cursor: help; vertical-align: baseline; }
.mail-env small { font-size: 0.7em; font-weight: 700; }
.mail-env-sent { color: #6b7280; }
.mail-env-opened { color: #2563eb; }
.mail-env-viewed { color: #16a34a; }
.mail-env-pop { position: absolute; z-index: 1000; max-width: min(420px, calc(100vw - 16px)); white-space: pre-wrap; background: #111827; color: #fff; font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* ================================================================
   Look 2026-11: a navy top bar with the logo, soft rounded panels,
   gradient buttons — the app as a product, not a text editor.
   Only appearance; every page keeps its markup.
   ================================================================ */
:root {
  --color-bg: #f2f4f9;
  --color-border: #e3e7ef;
  --color-text: #141a2e;
  --color-text-muted: #667085;
  --color-primary: #2557e8;
  --color-primary-hover: #1d47c9;
  --navy: #0d1640;
  --navy-2: #18245e;
  --grad: linear-gradient(135deg, #2563eb 0%, #6d3be6 100%);
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);
}
body { background: var(--color-bg); -webkit-font-smoothing: antialiased; }

/* the top bar */
header.app-header {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 100%);
  border-bottom: 0;
  box-shadow: 0 2px 12px rgba(13, 22, 64, 0.25);
  padding: 10px 20px;
  gap: 18px;
  color: #fff;
}
header.app-header h1 {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -0.01em;
}
header.app-header h1::before {
  content: "v"; display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad); color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(109, 59, 230, 0.45);
}
header.app-header .company-switch { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
header.app-header .company-switch option { color: var(--color-text); }
nav.app-nav { gap: 2px; }
nav.app-nav > a, nav.app-nav .nav-group-btn {
  color: rgba(226, 232, 255, 0.78); font-weight: 600; font-size: 14px;
  padding: 7px 11px; border-radius: 8px; background: none; box-shadow: none;
}
nav.app-nav > a:hover, nav.app-nav .nav-group-btn:hover, nav.app-nav .nav-group.open .nav-group-btn {
  color: #fff; background: rgba(255, 255, 255, 0.1);
}
nav.app-nav > a.active, nav.app-nav .nav-group-btn.active {
  color: var(--navy); background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
nav.app-nav a:focus-visible, .nav-group-btn:focus-visible { outline-color: #a5b4fc; }
/* "Nová faktúra" stands out as the main action */
nav.app-nav > a[href="faktura-nova.html"]:not(.active) { color: #fff; background: var(--grad); box-shadow: 0 4px 12px rgba(109, 59, 230, 0.35); }
nav.app-nav > a[href="faktura-nova.html"]:not(.active):hover { filter: brightness(1.08); }
nav.app-nav > #logoutLink, nav.app-nav > #reportLink { color: rgba(226, 232, 255, 0.6); font-weight: 500; }
.nav-menu { border: 0; border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(13, 22, 64, 0.25); margin-top: 6px; }
/* a bridge over the gap, so the menu stays open on the way to it */
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-menu a { color: var(--color-text); font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 8px; }
.nav-menu a:hover { background: #eef2ff; color: var(--color-primary); }
.nav-menu a.active { background: #eef2ff; color: var(--color-primary); font-weight: 700; }
header.app-header .nav-toggle { background: rgba(255, 255, 255, 0.1); color: #fff; border-color: rgba(255, 255, 255, 0.25); box-shadow: none; }

/* panels */
.card, .split-list, .split-preview { border: 1px solid #e6e9f1; border-radius: 14px; box-shadow: var(--shadow-1); }
main > h1, main > h2:first-child { font-weight: 800; letter-spacing: -0.015em; }

/* buttons: the main action in the brand gradient */
button, .btn { border-radius: 9px; transition: background .15s, box-shadow .15s, filter .15s; }
button:not([class]), button.btn, button.btn-sm:not(.btn-secondary):not(.btn-danger):not(.btn-warning):not(.btn-success), a.btn:not(.btn-secondary):not(.btn-danger):not(.btn-warning):not(.btn-success) {
  background: var(--grad); box-shadow: 0 3px 10px rgba(37, 87, 232, 0.28);
}
button:not([class]):hover:not(:disabled), button.btn:hover:not(:disabled), a.btn:not(.btn-secondary):not(.btn-danger):not(.btn-warning):not(.btn-success):hover {
  filter: brightness(1.07); box-shadow: 0 6px 16px rgba(109, 59, 230, 0.32);
}
.btn-secondary { background: #fff; border-color: #d9deea; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05); }
.btn-secondary:hover { background: #f5f7ff; border-color: #c7d2fe; color: var(--color-primary); }

/* fields */
select, input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], textarea {
  border-color: #d9deea; border-radius: 9px; transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37, 87, 232, 0.15); }
label { color: #4b5565; }

/* tables */
th { background: #f7f8fc; color: #6b7590; font-weight: 700; font-size: 11.5px; letter-spacing: .05em; }
th, td { border-bottom-color: #eef0f5; }
tr:hover td { background: #f8f9ff; }
.month-row td, tr.month-row:hover td { background: #f2f4fb; }

/* status badges: soft pills with a dot */
.badge { padding: 3px 10px 3px 8px; display: inline-flex; align-items: center; gap: 5px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; flex: none; }
.badge-unpaid { background: #eef1f6; color: #4a5875; }
.badge-partial { background: #fff4d6; color: #8a5a00; }
.badge-paid { background: #dcf7e8; color: #13693b; }
.badge-overdue { background: #ffe4e4; color: #a01d1d; }
.brand-tag { background: #ece9ff; color: #4c2bb8; }

/* the invoice list (left pane) */
.filter-panel, .list-summary, .preview-header { background: #fbfcff; }
.filter-panel, .preview-header { border-top-left-radius: 14px; border-top-right-radius: 14px; }
.invoice-list a { transition: background .12s; }
.invoice-list a:hover { background: #f6f8ff; }
.invoice-list a[aria-current="true"] { background: linear-gradient(90deg, #eef2ff 0%, #f6f4ff 100%); border-left-color: #5b45e0; }
.chip[aria-pressed="true"] { background: var(--grad); border-color: transparent; color: #fff; }

/* small things */
.toast { border-radius: 12px; background: var(--navy); box-shadow: 0 12px 30px rgba(13, 22, 64, 0.35); }
.toast.error { background: var(--color-danger); }
.dialog { border-radius: 16px; box-shadow: 0 24px 60px rgba(13, 22, 64, 0.35); }
.dialog::backdrop { background: rgba(13, 22, 64, 0.45); }
.menu { border-radius: 12px; box-shadow: 0 18px 40px rgba(13, 22, 64, 0.2); }
.dropzone { border-radius: 14px; background: #fbfcff; }

/* On a phone nothing is wider than the screen: an invoice's items are cards,
   one under another (labels from data-label), never a row to scroll sideways. */
@media (max-width: 640px) {
  html, body { overflow-x: hidden; }
  main { padding: 12px; }
  .flex-end, .toolbar, .filters, .field-row { flex-wrap: wrap; }
  .flex-end > button, .flex-end > .btn { flex: 1 1 auto; justify-content: center; }
  .card { padding: 16px; }
  /* any other wide table scrolls inside its own card, not the page */
  .card table:not(.items-view):not(.items-table):not(.items-stack) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* the invoice detail */
  table.items-view thead { display: none; }
  table.items-view, table.items-view tbody { display: block; }
  table.items-view tr { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid #eef0f5; }
  table.items-view td { border: 0; padding: 0; font-size: 14px; }
  table.items-view td:first-child { flex-basis: 100%; }
  table.items-view td[data-label] { text-align: left; }
  table.items-view td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--color-text-muted); font-weight: 600; }
  table.items-view td[data-label]:empty { display: none; }
  table.items-view td:last-child { margin-left: auto; text-align: right; font-weight: 700; }
  table.items-view tr:hover td { background: none; }

  /* the invoice form: each item a small card */
  .items-table, .items-table tbody { display: block; }
  .items-table thead, .items-table thead tr { display: block; }
  .items-table thead th { display: none; }
  .items-table thead th:has(select) { display: inline-block; background: none; padding: 0 8px 8px 0; border: 0; width: auto !important; }
  .items-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; margin-bottom: 10px; border: 1px solid #e6e9f1; border-radius: 12px; background: #fbfcff; }
  .items-table tbody td { display: block; padding: 0; border: 0; min-width: 0; }
  .items-table tbody td:first-child { grid-column: 1 / -1; }
  .items-table tbody td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--color-text-muted); font-weight: 600; margin-bottom: 2px; }
  .items-table tbody td.itLineTotal { align-self: end; font-weight: 700; font-size: 16px; text-align: left; }
  .items-table tbody td:last-child { grid-column: 1 / -1; }
  .items-table tbody tr:hover td { background: none; }
  .items-table input, .items-table select, .items-table textarea { min-width: 0; max-width: 100%; }
  .items-table .row-tools { justify-content: flex-end; }
}

@media (max-width: 640px) {
  header.app-header { padding: 10px 14px; }
  nav.app-nav > a, nav.app-nav .nav-group-btn { color: rgba(226, 232, 255, 0.9); }
  .nav-menu { background: transparent; box-shadow: none; margin: 0; }
  .nav-menu a { color: rgba(226, 232, 255, 0.85); }
  .nav-menu a:hover, .nav-menu a.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  button, .btn { transition: none; }
}

/* the "Zásielka" card under an invoice in the list's preview (js/shipCard.js) */
.preview-body .ship-card { margin-top: 20px; padding: 16px; border: 1px solid #e6e9f1; border-radius: 12px; background: #fbfcff; }
.preview-body .ship-card h3 { font-size: 15px; }

/* ---- Delivery note: the customer's signature and the visit's photos ---- */
.proof-dialog { width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
.proof-part { margin-top: 14px; }
.proof-part h3 { font-size: 14px; margin: 0 0 8px; }
.sign-pad {
  display: block; width: 100%; height: 200px; margin: 6px 0 8px;
  background: #fff; border: 2px dashed #b8c0dc; border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.proof-sign-img { display: block; max-width: 100%; max-height: 140px; background: #fff; border: 1px solid #e3e6f0; border-radius: 10px; padding: 6px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 10px; }
.photo-grid figure { position: relative; margin: 0; }
.photo-grid > p { grid-column: 1 / -1; }
.photo-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #eef0f6; }
.photo-grid .photo-del {
  position: absolute; top: 4px; right: 4px; min-width: 28px; height: 28px; padding: 0 8px;
  border-radius: 14px; background: rgba(13, 22, 64, .75); color: #fff; border: 0; font-size: 13px; line-height: 28px;
}
#proofAdd { cursor: pointer; }
#proofAdd.busy { opacity: .6; pointer-events: none; }
@media (max-width: 640px) {
  .proof-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .sign-pad { height: 46vh; }
}

/* ---- A document's file beside the form typing it in (js/docViewer.js) ---- */
main.with-doc {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(540px, 1fr) minmax(440px, 1.05fr);
  gap: var(--space-4);
  align-items: start;
}
main.with-doc > :not(.doc-form):not(.doc-viewer) { grid-column: 1; }
.doc-viewer {
  position: sticky; top: 72px;
  height: calc(100vh - 88px);
  display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden;
}
main.with-doc > .doc-viewer { grid-column: 2; grid-row: 1 / span 20; }
.doc-viewer-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--color-border); font-size: 13px; }
.doc-viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.doc-viewer-body { flex: 1; min-height: 0; }
.doc-viewer-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.doc-viewer-img { height: 100%; overflow: auto; cursor: zoom-in; background: #eef0f6; }
.doc-viewer-img img { display: block; width: 100%; height: auto; }
.doc-viewer-img.zoomed { cursor: zoom-out; }
.doc-viewer-img.zoomed img { width: auto; max-width: none; }
.doc-viewer-reopen {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  box-shadow: 0 8px 24px rgba(13, 22, 64, .25);
}
/* beside the document the form is narrower: an item takes two lines, as on a phone */
main.with-doc .items-stack thead { display: none; }
main.with-doc .items-stack tr {
  display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px;
  padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border);
}
main.with-doc .items-stack td { padding: 0; border: 0; }
main.with-doc .items-stack td:nth-child(1) { grid-column: 1 / 4; }
main.with-doc .items-stack td:nth-child(6) { grid-column: 4; grid-row: 1; }
main.with-doc .items-stack td:nth-child(5) { grid-column: 1 / -1; }
main.with-doc .items-stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--color-text-muted); }
main.with-doc .items-stack tr.needs-decision td:first-child { box-shadow: none; }
main.with-doc .items-stack tr.needs-decision { box-shadow: inset 3px 0 0 var(--color-warning); padding-left: 8px; }
main.with-doc .doc-form .field-row { flex-wrap: wrap; }

/* the incoming document's lines added up, against its base (js/expenseItems.js) */
.items-sum { margin-top: 8px; font-size: 13px; color: var(--color-text-muted); }
.items-sum strong { color: var(--color-text); }
.items-sum.items-sum-off { color: #b42318; }
.items-sum.items-sum-off strong { color: #b42318; }

/* the VAT rate picked from 23/19/5/0/N, typed only for a rate of one's own (js/vatRate.js) */
.vat-pick { display: inline-flex; gap: 4px; align-items: center; width: 100%; }
.vat-pick .vat-pick-select { flex: 1 1 auto; min-width: 0; }
.vat-pick .vat-pick-own { flex: 0 1 70px; min-width: 52px; }
.vat-pick .vat-pick-own[hidden] { display: none; }

/* sums at the top of the received documents (vydavky.html) */
.exp-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.exp-sum { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 12px 16px; }
.exp-sum-label { font-size: 13px; color: var(--color-text-muted); }
.exp-sum-value { font-size: 22px; font-weight: 700; margin: 2px 0; }
.exp-sum-note { font-size: 12px; color: var(--color-text-muted); }
.take-out-total { font-weight: 600; color: var(--color-text-muted); font-size: 15px; }

/* "paid by card after all?" on the received documents (vydavky.html) */
.card-hint { border-left: 4px solid var(--color-warning, #f5a524); }
.card-hint-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--color-border); margin-top: 8px; }

/* an outgoing payment paired with a received document (platby.html) */
.pair-dialog { width: min(680px, calc(100vw - 24px)); }
.pair-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--color-border); }
.pair-row.pair-same { background: rgba(16, 185, 129, .06); }

/* received documents' export (vydavky.html) */
.export-dialog { width: min(640px, calc(100vw - 24px)); }
.export-dialog a.btn.disabled { opacity: .5; pointer-events: auto; }
.export-dialog input[type="checkbox"] { width: auto; flex: none; }

/* a gateway's payout paired with many invoices (platby.html) */
.payout-sum { margin: 10px 0; padding: 10px 12px; background: #f4f6fb; border-radius: 10px; font-size: 14px; }

/* the delivery date (DUZP) — what VAT goes by — stands out among the dates */
.duzp-field label { font-weight: 700; color: var(--color-primary); }

/* a received invoice: its supplier's paid advance offered in one click (vydavok.html) */
.advance-hint { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #eef4ff; border: 1px solid #c7d7fe; }

/* "Zaplatené ▾" — one click for today, the arrow for the other ways (vydavky.html) */
.split-btn { display: inline-flex; }
.split-btn > button:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-btn > button:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; padding-left: 8px; padding-right: 8px; }
.pay-menu { position: absolute; z-index: 50; width: 300px; max-width: calc(100vw - 16px); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.pay-menu > button { display: block; width: 100%; line-height: 1.35; text-align: left; background: transparent; color: var(--color-text); border: 0; padding: 8px 10px; border-radius: 8px; font-weight: 400; }
.pay-menu > button:hover, .pay-menu > button:focus-visible { background: var(--color-bg); }
.pay-menu-date { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-top: 1px solid var(--color-border); }
.pay-menu-date label { margin: 0; font-weight: 400; white-space: nowrap; }
.pay-menu-date input { flex: 1; min-width: 0; }
.split-btn > button.pay-more { border-left: 1px solid rgba(255,255,255,.35); }

/* the invoice list's status filter: tick boxes to combine (index.html) */
.status-multi { position: relative; }
.status-multi > summary { list-style: none; cursor: pointer; padding: 8px 32px 8px 12px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; min-width: 180px; }
.status-multi > summary::-webkit-details-marker { display: none; }
.status-multi > summary::after { content: "▾"; position: absolute; right: 12px; color: var(--color-text-muted); }
.status-multi-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 260px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 6px; }
.status-multi-list label { display: flex; gap: 8px; align-items: center; margin: 0; padding: 7px 8px; border-radius: 8px; font-weight: 400; cursor: pointer; }
.status-multi-list label:hover { background: var(--color-bg); }
.status-multi-list input { width: auto; margin: 0; }

/* purchase contract: two finger signatures side by side, stacked on a phone */
.kz-pad { height: 160px; }

/* photos with a report or an idea (the dialog, chyby.html) */
.report-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.report-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-bg); }

/* Settings → Moduly */
.modules-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }
.module-switch { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; padding: 6px 0; }
.module-switch input { width: auto; margin: 0; }

/* the database is down — read-only from the local copy (js/app.js) */
.readonly-banner { background: #fff3cd; color: #664d03; border-bottom: 1px solid #f0c36d; padding: 10px 16px; text-align: center; font-size: 14px; }
@media (prefers-color-scheme: dark) { .readonly-banner { background: #3a2f12; color: #f3dca3; border-color: #7a5d1e; } }

/* Platby: each of the company's accounts in its own colour (chip, row stripe, filter) */
.acc-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--acc-bg); color: var(--acc-fg); border: 1px solid var(--acc-line); }
tr.acc-row > td:first-child { box-shadow: inset 4px 0 0 var(--acc-line); }
.acc-filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.acc-filter button { padding: 4px 12px; border-radius: 999px; font-size: 13px; background: var(--acc-bg, transparent); color: var(--acc-fg, inherit); border: 1px solid var(--acc-line, var(--color-border)); }
.acc-filter button[aria-pressed="true"] { outline: 2px solid var(--acc-line, var(--color-primary)); outline-offset: 1px; font-weight: 700; }
.acc-0 { --acc-bg: #dbeafe; --acc-fg: #1e40af; --acc-line: #3b82f6; }
.acc-1 { --acc-bg: #d1fae5; --acc-fg: #065f46; --acc-line: #10b981; }
.acc-2 { --acc-bg: #fef3c7; --acc-fg: #92400e; --acc-line: #f59e0b; }
.acc-3 { --acc-bg: #ede9fe; --acc-fg: #5b21b6; --acc-line: #8b5cf6; }
.acc-4 { --acc-bg: #fce7f3; --acc-fg: #9d174d; --acc-line: #ec4899; }
.acc-5 { --acc-bg: #cffafe; --acc-fg: #155e75; --acc-line: #06b6d4; }
.acc-none { --acc-bg: #f1f5f9; --acc-fg: #475569; --acc-line: #cbd5e1; }

/* Platby: how many payments are paired / not, with their sums; a tile filters the list */
.pay-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.pay-stats button { text-align: left; padding: 8px 12px; border-radius: 10px; background: var(--color-surface); color: inherit; border: 1px solid var(--color-border); border-left: 4px solid var(--st-line, var(--color-border)); font-weight: 400; }
.pay-stats button[aria-pressed="true"] { outline: 2px solid var(--st-line, var(--color-primary)); outline-offset: 1px; }
.pay-stats .st-label { font-size: 12px; opacity: .8; }
.pay-stats .st-count { font-size: 20px; font-weight: 700; line-height: 1.2; }
.pay-stats .st-sum { font-size: 13px; }
.pay-stats .st-ok { --st-line: var(--color-success); }
.pay-stats .st-warn { --st-line: var(--color-warning); }
.pay-stats .st-bad { --st-line: var(--color-danger); }
.pay-stats .st-none { --st-line: #94a3b8; }

/* the app on the home screen of a phone (js/app.js showInstallBar) */
.install-bar {
  position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 10px 12px; font-size: 14px;
}
.install-bar-actions { display: flex; gap: 6px; margin-left: auto; }
