/* Fakturace WPlite – vzhled (redesign 9u, R118): bílá + modrá WPlite, minimalisticky.
   Barvy a rozměry jen přes proměnné níže; písmo Inter (OFL) je přibalené, nic se nenačítá z internetu. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/InterVariable.woff2") format("woff2");
}
:root {
  --brand: #0062ff; --accent: #0062ff; --accent-dark: #004fd1; --accent-soft: #eef4ff; --accent-line: #c9dcff;
  --bg: #f6f8fb; --card: #fff; --text: #0f172a; --text-2: #334155; --muted: #64748b; --line: #e5e9f0; --line-strong: #cfd6e0;
  --danger: #c0262d; --danger-soft: #fef2f2; --ok: #15803d; --ok-soft: #f0fdf4; --warn: #a16207; --warn-soft: #fffbeb;
  --radius: 10px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
  --focus: 0 0 0 3px rgba(0, 98, 255, .18); --sidebar: 236px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; line-height: 1.5;
  font-feature-settings: "cv11", "ss01"; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
::selection { background: #cfe0ff; }

/* ---------------------------------------------------------------- rozvržení: boční panel */
body.app { padding-left: var(--sidebar); }
main { max-width: 1240px; margin: 0 auto; padding: 32px 40px 72px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 20; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 18px 14px 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 62px; height: auto; }
.brand span { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--text-2); padding-left: 10px; border-left: 1px solid var(--line); }
.nav-toggle, .nav-toggle-button { display: none; }
.sidebar-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; overflow-y: auto; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--text-2);
  font-weight: 500; font-size: 14.5px; position: relative; }
.side-nav a .ico { color: #94a3b8; flex: none; }
.side-nav a:hover { background: #f4f6fa; color: var(--text); text-decoration: none; } .side-nav a:hover .ico { color: var(--text-2); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.side-nav a.active .ico { color: var(--accent); }
.side-nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-sep { height: 1px; background: var(--line); margin: 10px 12px; }
.side-foot { border-top: 1px solid var(--line); padding: 14px 16px 16px; display: grid; gap: 10px; }
.company-switch label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.company-switch select { padding: 6px 10px; font-size: 14px; font-weight: 600; }
.user-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.user-name { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; min-width: 0; }
.user-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-name .ico { color: #94a3b8; flex: none; }
button.icon-button { background: none; border: 1px solid transparent; color: var(--muted); padding: 6px; border-radius: 8px; line-height: 0; }
button.icon-button:hover { background: #f4f6fa; color: var(--danger); border-color: transparent; }

@media (max-width: 900px) {
  body.app { padding-left: 0; }
  .sidebar { position: sticky; top: 0; inset: auto; width: auto; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar-head { padding: 10px 16px; }
  .brand img { width: 40px; }
  .nav-toggle-button { display: inline-flex; padding: 6px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
  .sidebar-body { display: none; max-height: calc(100vh - 60px); overflow-y: auto; }
  .nav-toggle:checked ~ .nav-toggle-button { background: var(--accent-soft); color: var(--accent); }
  .sidebar:has(.nav-toggle:checked) .sidebar-body { display: flex; }
  main { padding: 20px 16px 56px; }
}

/* ---------------------------------------------------------------- přihlášení */
body.auth { display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(1200px 500px at 50% -10%, #e7efff 0%, var(--bg) 60%); }
body.auth main { width: 100%; max-width: 420px; padding: 32px 16px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px 36px 32px;
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, .12); }
.login-logo { display: block; margin: 0 auto 14px; width: 120px; height: auto; }
.login-card h1 { text-align: center; font-size: 1.35rem; }
.login-sub { text-align: center; margin: 4px 0 24px; }
.login-foot { text-align: center; font-size: 13px; margin-top: 18px; }
button.block { width: 100%; padding: 11px 14px; margin-top: 6px; }

/* ---------------------------------------------------------------- typografie a stránka */
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -.02em; margin: 0; line-height: 1.25; }
h2 { font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; margin: 0 0 14px; }
h3 { font-size: .98rem; font-weight: 600; margin: 24px 0 8px; }
h1 .muted, h2 .muted { font-weight: 500; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.narrow { max-width: 560px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.grid.compact { align-items: start; }

/* ---------------------------------------------------------------- formuláře */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field span { font-size: .84rem; font-weight: 550; color: var(--text-2); } .field em { color: var(--danger); font-style: normal; }
.field small { color: var(--muted); font-size: .8rem; } .field small.error { color: var(--danger); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--danger); }
input, select, textarea { font: inherit; font-size: 14.5px; color: var(--text); padding: 8px 11px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #b4bfcd; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #9aa6b6; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; }
input:disabled, select:disabled, textarea:disabled { background-color: #f6f8fb; color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 18px; }
legend { font-weight: 600; padding: 0 6px; }

/* ---------------------------------------------------------------- tlačítka */
button, .button { font: inherit; font-size: 14.5px; font-weight: 550; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff;
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.35; transition: background .12s, border-color .12s, color .12s; }
button:hover, .button:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
button.secondary, .button.secondary { background: #fff; color: var(--text-2); border-color: var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: #f6f8fb; color: var(--text); border-color: #b4bfcd; }
button.danger { background: #fff; color: var(--danger); border-color: #f0c2c4; }
button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.small, .button.small { padding: 4px 10px; font-size: .84rem; }
button.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
button:disabled, button:disabled:hover { opacity: .45; cursor: not-allowed; background: #fff; color: var(--muted); border-color: var(--line-strong); }
button.warn-button { background: #fff; color: #9a3412; border-color: #fdba74; }
button.warn-button:hover { background: #fff7ed; border-color: #ea580c; }

/* ---------------------------------------------------------------- filtry a tabulky */
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; } .filters input { flex: 1; min-width: 220px; } .filters select { width: auto; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card .table-wrap, .table-wrap .table-wrap { border: none; border-radius: 0; box-shadow: none; margin: 0 -24px; padding: 0 12px; background: none; }
table { width: 100%; border-collapse: collapse; background: transparent; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; background: #fafbfd; white-space: nowrap; }
.card thead th { background: none; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; }
tbody tr:last-child > td { border-bottom: none; }
tbody tr:hover > td { background: #fafbfe; }
td a b { font-weight: 600; }
tr.inactive td { color: var(--muted); }
.row-actions { white-space: nowrap; } .row-actions > * { margin-right: 6px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; } form.inline input { width: auto; }
details { display: inline-block; } summary { cursor: pointer; color: var(--danger); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { border-bottom: none; } tfoot tr.total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid var(--text); }
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 16px; }
.empty { color: var(--muted); padding: 16px 0; }

/* Řádky dokladů: po splatnosti červeně (9h), zaplacené zeleně (9r) */
tr.overdue > td, tr.overdue:hover > td { background: #fdecec; }
tr.overdue > td:first-child { box-shadow: inset 3px 0 0 #e5484d; }
tr.paid > td, tr.paid:hover > td { background: #ecf8f0; }
tr.paid > td:first-child { box-shadow: inset 3px 0 0 #30a46c; }

/* ---------------------------------------------------------------- štítky, hlášky */
.badge, .status { display: inline-flex; align-items: center; font-size: .74rem; font-weight: 550; padding: 2px 9px; border-radius: 999px;
  border: 1px solid transparent; background: #f1f5f9; color: var(--text-2); vertical-align: middle; white-space: nowrap; line-height: 1.5; }
.badge.ok, .ok.badge { color: var(--ok); background: var(--ok-soft); border-color: #c6ecd3; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #f5e0a8; }
.badge.err { color: var(--danger); background: var(--danger-soft); border-color: #f6cfd1; }
.badge.muted { color: var(--muted); background: #f6f8fb; border-color: var(--line); }
.status-draft { color: var(--muted); } .status-sent { color: var(--accent-dark); background: var(--accent-soft); }
.status-paid { color: var(--ok); background: var(--ok-soft); } .status-partially_paid { color: var(--warn); background: var(--warn-soft); }
.status-cancelled { color: var(--danger); background: var(--danger-soft); text-decoration: line-through; }
.muted { color: var(--muted); }
.flash { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-size: 14.5px; }
.flash-ok { background: var(--ok-soft); border-color: #c6ecd3; color: #166534; }
.flash-error { background: var(--danger-soft); border-color: #f6cfd1; color: #9f1d23; }
.flash-info { background: var(--accent-soft); border-color: var(--accent-line); color: #1e3a8a; }
.flash-warn { background: var(--warn-soft); border-color: #f5e0a8; color: #854d0e; }
.flash a { color: inherit; text-decoration: underline; }
.warn-card { border-color: #f5e0a8; background: var(--warn-soft); }
.error-text { color: var(--danger); } .ok-text { color: var(--ok); } .small { font-size: .85rem; }
code { background: #f1f4f8; padding: 1px 6px; border-radius: 5px; font-size: .86em; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
pre { background: #f1f4f8; padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; }
pre code { padding: 0; background: none; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 28px; margin: 0; }
.facts dt { font-size: .78rem; color: var(--muted); font-weight: 500; } .facts dd { margin: 2px 0 0; } .facts .wide { grid-column: 1 / -1; }
.checks { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; } .checks input { width: auto; margin-right: 6px; }

/* ---------------------------------------------------------------- navigace v sekcích */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 4px; align-items: center; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.subnav a { color: var(--text-2); padding: 5px 10px; border-radius: 7px; font-size: 14px; font-weight: 500; }
.subnav a:hover { background: #eef1f6; text-decoration: none; }
.subnav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.subnav-group { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: 0 4px 0 14px; }
.subnav-group:first-child { margin-left: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent-dark); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------------------------------------------------------------- drobnosti z jednotlivých verzí */
details.add-service { display: block; margin-top: 16px; }
details.add-service > summary { list-style: none; display: inline-block; color: var(--accent); margin-bottom: 12px; font-weight: 550; }
details.add-service > summary::-webkit-details-marker { display: none; }
details.add-service[open] { background: #f8faff; border: 1px dashed var(--accent-line); border-radius: var(--radius); padding: 14px 18px 4px; }
.field.check span { font-weight: 400; display: flex; gap: 8px; align-items: center; } .field.check input { width: auto; }
.signature-preview { max-width: 240px; max-height: 100px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.logo-preview { max-width: 160px; max-height: 80px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.series-example { font-size: 1.2rem; font-weight: 700; font-family: ui-monospace, Consolas, monospace; }
/* verze 6: zákazníci, kontakty, ARES */
.ares form.inline { flex-wrap: wrap; } .ares form.inline input[type=search] { min-width: 280px; }
.price-diff { color: var(--warn); font-size: .8rem; }
form h2 { margin-top: 22px; }
.nowrap { white-space: nowrap; }

/* verze 8: nabídky */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
button.icon { background: none; border: none; padding: 4px; border-radius: 6px; color: var(--muted); cursor: pointer; vertical-align: middle; line-height: 0; }
button.icon:hover { background: var(--accent-soft); color: var(--accent); }
.icons a { display: inline-flex; vertical-align: middle; padding: 4px; border-radius: 6px; color: var(--muted); line-height: 0; }
.icons a:hover { background: var(--accent-soft); color: var(--accent); }
.icons form { display: inline-block; vertical-align: middle; }
.danger-icon, button.icon.danger-icon, .icons a.danger-icon { color: #d4878b; }
button.icon.danger-icon:hover { background: var(--danger-soft); color: var(--danger); }
.status-select { width: auto; padding: 3px 26px 3px 9px; font-size: .82rem; font-weight: 550; border-radius: 999px; background-position: right 7px center; background-size: 12px; }
.status-offer-accepted { color: var(--ok); } .status-offer-rejected, .status-offer-cancelled { color: var(--danger); }
.status-offer-expired { color: var(--muted); } .status-offer-sent { color: var(--accent); }
.status-offer-draft { color: var(--warn); }
select.status-offer-accepted { background-color: var(--ok-soft); border-color: #c6ecd3; } select.status-offer-sent { background-color: var(--accent-soft); border-color: var(--accent-line); }
select.status-offer-rejected, select.status-offer-cancelled { background-color: var(--danger-soft); border-color: #f6cfd1; }
select.status-offer-draft { background-color: var(--warn-soft); border-color: #f5e0a8; }
table.items input, table.items select { padding: 6px 8px; font-size: .9rem; }
table.items select { padding-right: 26px; background-position: right 6px center; }
table.items td { padding: 5px 4px; vertical-align: middle; }
table.items tbody tr:hover > td { background: none; }
table.items td.desc { min-width: 260px; width: 40%; }
table.items input.num { text-align: right; width: 90px; }
table.items input.unit { width: 60px; }
table.items .has-error input, table.items .has-error select { border-color: var(--danger); }
.add-item { margin: 10px 0; }
table.totals { width: auto; margin-left: auto; margin-top: 12px; }
table.totals th { text-align: right; font-weight: 400; padding: 4px 12px; border: none; background: none; }
table.totals td { text-align: right; padding: 4px 0; border: none; min-width: 140px; font-variant-numeric: tabular-nums; }
table.totals tr:hover > td { background: none; }
table.totals tr.grand th, table.totals tr.grand td { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--line); padding-top: 8px; }
table.totals th { text-transform: none; letter-spacing: 0; font-size: .95rem; color: inherit; }

/* Detail nabídky (9a): šipky listování a stav v záhlaví */
.doc-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-title h1 { margin: 0; }
.doc-nav { display: flex; gap: 4px; }
.nav-arrow { min-width: 2.25rem; text-align: center; padding-left: 8px; padding-right: 8px; font-weight: 700; }
.nav-arrow.disabled { opacity: .35; cursor: default; pointer-events: none; }

/* Verze 9b: podrobný popis položky, editor faktury */
table.items td.desc textarea.details { margin-top: 4px; font-size: .88rem; padding: 6px 8px; resize: vertical; }
table.items td.desc .toggle-details { font-size: .8rem; margin-top: 2px; display: inline-block; }
table.items tr.item td { vertical-align: top; }
.doc-meta { color: var(--muted); font-size: .9rem; margin: -10px 0 14px; }
.readonly-value { padding: 8px 0; font-weight: 600; }

/* Verze 9c: sazba DPH v položkách čitelná, výběr stavu faktury */
table.items select[data-field="vat_rate"] { min-width: 84px; width: 84px; }
.status-select.status-draft { color: var(--muted); }
.status-select.status-sent { color: var(--accent-dark); background-color: var(--accent-soft); border-color: var(--accent-line); }
.status-select.status-partially_paid { color: var(--warn); background-color: var(--warn-soft); border-color: #f5e0a8; }
.status-select.status-paid { color: var(--ok); background-color: var(--ok-soft); border-color: #c6ecd3; }
.status-select.status-cancelled { color: var(--danger); background-color: var(--danger-soft); border-color: #f6cfd1; text-decoration: none; }

/* Verze 9d: karta zákazníka, komunikace, stav zákazníka */
ul.notes { list-style: none; margin: 0; padding: 0; }
li.note { border-bottom: 1px solid var(--line); padding: 12px 0; }
li.note:last-child { border-bottom: none; }
li.note.editing { background: var(--warn-soft); margin: 0 -12px; padding: 12px; border-radius: 8px; }
.note-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.note-text { white-space: pre-line; margin-top: 4px; }
.badge.customer-status-contact { color: var(--muted); } .badge.customer-status-customer { color: var(--accent-dark); background: var(--accent-soft); }
.badge.customer-status-subscriber { color: var(--ok); background: var(--ok-soft); }
.badge.category { color: #5b3fa6; background: #f4f0ff; }
fieldset.plain { border: none; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled input, fieldset.plain:disabled select, fieldset.plain:disabled textarea { background-color: #f8fafc; color: inherit; border-color: var(--line); }
.add-row { margin-top: 12px; } table.codelist form.inline input[type=text] { width: 260px; }
.doc-chain { margin: -8px 0 14px; line-height: 1.7; } .doc-chain .chain-arrow { color: var(--muted); padding: 0 2px; }
a.plain-link { color: inherit; } a.plain-link:hover { color: var(--accent); text-decoration: underline; }
.layout-thumb { max-width: 160px; max-height: 60px; border: 1px solid var(--line); border-radius: 6px; }
.layout-preview { max-width: 100%; max-height: 220px; border: 1px solid var(--line); border-radius: 6px; }
.layout-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.row-tools .move-item { font-size: 14px; padding: 0 4px; color: var(--muted); }
.row-tools .move-item:hover { color: var(--accent); }
tr.item:first-child .move-item[data-move="up"], tr.item:last-child .move-item[data-move="down"] { visibility: hidden; }
.time-paid { display: flex; align-items: center; gap: 10px; } .time-paid input.hours { width: 90px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-weight: normal; white-space: nowrap; }
.time-summary { margin: 0; color: var(--muted); }

/* E-mail (9m), šablony e-mailů (9o) */
.mode-choice { display: grid; gap: 8px; margin-bottom: 8px; } .mail-form h2 { margin-top: 18px; }
.presets { margin: 0 0 8px; color: var(--muted); } .form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.mode-choice label.inline-check { display: flex; justify-content: flex-start; align-items: center; gap: 8px; width: auto; text-align: left; }
.mode-choice label.inline-check input { width: auto; margin: 0; }
.password-row { display: flex; gap: 6px; } .password-row input { flex: 1; min-width: 0; } .password-row button { width: auto; white-space: nowrap; }
.template-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .template-layout { grid-template-columns: 1fr; } }
.template-form textarea { width: 100%; font-family: inherit; line-height: 1.5; }
.legend-table td { vertical-align: top; padding: 5px 6px; border-bottom: 1px solid var(--line); font-size: 0.92em; }
.legend-table button.variable { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; text-decoration: none; }
.email-preview { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius-sm); font-family: inherit; margin: 8px 0; }

/* Import (9q) */
.import-kind .page-head { margin-bottom: 4px; } .import-kind h2 { margin: 0; }
.import-columns td { vertical-align: top; font-size: 0.92em; } .required { color: var(--danger); }
.import-upload { margin-top: 12px; } .import-rules ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.import-summary { display: flex; gap: 32px; margin-bottom: 12px; } .import-summary div { display: flex; flex-direction: column; }
.import-summary b { font-size: 1.6rem; font-weight: 650; }
.import-messages { margin: 0; padding-left: 20px; line-height: 1.6; } .import-messages.error li { color: var(--danger); }
.import-messages.warn li { color: var(--warn); }

/* Analýzy (9s) */
.analytics-controls { display: grid; gap: 14px; }
.dataset-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; background: #fff; font-weight: 500; font-size: 14px; color: var(--text-2); }
.chip:hover { border-color: #b4bfcd; }
.chip input { margin: 0; width: auto; } .chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.period { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.period label { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: var(--muted); }
.period .presets { font-size: .9rem; } .period-label { margin: 0; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: .82rem; font-weight: 500; } .stat b { font-size: 1.35rem; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; } .stat small { color: var(--muted); }
.stat.ok b { color: var(--ok); } .stat.warn b { color: var(--warn); } .stat.danger b { color: var(--danger); }
.months summary { cursor: pointer; font-weight: 600; color: var(--text); } .months table { margin-top: 8px; }
.bar-cell { width: 35%; } .bar { display: block; height: 8px; border-radius: 4px; background: var(--brand); opacity: .75; min-width: 2px; }
.analytics-table tr.col-filters th { padding-top: 0; font-weight: normal; text-transform: none; letter-spacing: 0; }
.analytics-table tr.col-filters input, .analytics-table tr.col-filters select { width: 100%; min-width: 80px; padding: 5px 8px; font-size: .84rem; }
.analytics-table tr.col-filters select { padding-right: 24px; background-position: right 6px center; }
.analytics-table tfoot th { border-top: 2px solid var(--line); text-align: left; } .analytics-table tfoot th.num { text-align: right; }
.analytics-table .note-text { max-width: 420px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; padding: 0; }

@media print {
  body.app { padding-left: 0; } .sidebar { display: none; } main { padding: 0; max-width: none; }
}
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child, .card > .section-head:first-child h2 { margin-top: 0; }
