/* ===== Lioned brand tokens (dle lioned.cz) ===== */
:root {
  --accent: #e0292e; --accent-dark: #b81f23; --accent-soft: #fdecec;
  --ink: #1a1a1a; --muted: #5c5c5c; --faint: #8a8a8a;
  --bg: #f4f4f5; --surface: #ffffff; --surface-alt: #f6f6f7; --wash: #fafafa;
  --line: #e7e7e9; --line-2: #d8d8db;
  --success: #2e7d32;
  --brand-dark: #1a1a1a; /* přihlašovací panel — vždy tmavý, nesmí se přepsat tmavým režimem */
  --font-head: 'Montserrat', 'Arial Black', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20,20,22,.06), 0 6px 20px rgba(20,20,22,.05);
}

* { box-sizing: border-box; }
body { font-family: var(--font-body); margin: 0; background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-head); letter-spacing: -.02em; margin: 0; }

.center { max-width: 360px; margin: 12vh auto; }
.card { background: var(--surface); padding: 28px; border-radius: 16px; box-shadow: var(--shadow); }
.card h1 { display: flex; align-items: center; gap: 8px; }
h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--accent); font-size: 13px; min-height: 18px; }

input, select, textarea, button { font: inherit; padding: 8px 11px; border: 1px solid var(--line-2);
  border-radius: 8px; background: var(--surface); color: var(--ink); }
input, textarea { width: 100%; margin: 6px 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px;
  border-color: var(--accent); }
button { cursor: pointer; background: var(--accent); color: #fff; border: none; font-weight: 600; }
button:hover { background: var(--accent-dark); }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
button:disabled { background: var(--line-2); color: var(--faint); cursor: not-allowed; }
button:disabled:hover { background: var(--line-2); }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }

header { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--surface);
  border-bottom: 1px solid var(--line); }
header strong { font-size: 16px; font-family: var(--font-head); font-weight: 900; letter-spacing: .01em; }
header .muted { margin-left: auto; }

/* hlavička – brand platformy */
.hdr-brand { font-family: var(--font-head); font-weight: 900; letter-spacing: .03em; font-size: 15px;
  display: inline-flex; align-items: center; }
.hdr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  display: inline-block; margin: 0 3px; transform: translateY(-1px); }

/* přepínač modulů (platformní úroveň) */
.modbar { display: flex; gap: 6px; padding: 8px 20px; background: var(--ink);
  border-bottom: 1px solid var(--ink); }
.modbar[hidden] { display: none; }
.modbar button { background: transparent; color: rgba(255,255,255,.72); border: none; border-radius: 8px;
  padding: 8px 16px; font-family: var(--font-head); font-weight: 700; font-size: 14px; }
.modbar button:hover { color: #fff; background: rgba(255,255,255,.09); }
.modbar button.active { color: #fff; background: var(--accent); }
.mod-none { color: rgba(255,255,255,.8); padding: 6px 8px; font-size: 13px; }
.module[hidden] { display: none; }
.module-empty { padding: 64px 24px; text-align: center; color: var(--muted); }
.module-empty h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; color: var(--ink); }

nav { display: flex; gap: 4px; padding: 6px 20px 0; background: var(--surface);
  border-bottom: 1px solid var(--line); }
nav button { background: none; color: var(--muted); border-radius: 0; font-weight: 600; font-size: 14px;
  padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
nav button:hover { background: none; color: var(--ink); }
nav button.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }

.tab { padding: 24px; max-width: 960px; }
#tab-master { max-width: 1060px; }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0; }
.row input, .row select, .row textarea { width: auto; margin: 0; }
label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 10px;
  overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--surface-alt); font-family: var(--font-head); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
tbody tr:hover { background: var(--wash); }
.num, td .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
code { background: var(--surface-alt); font-family: var(--font-mono); padding: 1px 5px; border-radius: 4px;
  font-size: .9em; }

/* ===== Číselníky — varianta A: boční menu + jedna sekce v ploše ===== */
.md-layout { display: grid; grid-template-columns: 216px 1fr; gap: 22px; align-items: start; }
.md-nav { display: flex; flex-direction: column; gap: 2px; }
.md-grp { font-family: var(--font-head); font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .12em; color: var(--faint); padding: 16px 10px 7px; }
.md-grp:first-child { padding-top: 2px; }
.md-navitem, .fmd-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; color: var(--muted); border: 1px solid transparent; border-radius: 9px;
  padding: 9px 11px; font-size: 14px; font-weight: 500; }
.md-navitem:hover, .fmd-item:hover { background: var(--surface); color: var(--ink); }
.md-navitem.active, .fmd-item.active { background: var(--surface); color: var(--ink); font-weight: 600;
  border-color: var(--line); box-shadow: var(--shadow); }
.md-ico { width: 17px; height: 17px; flex: 0 0 auto; color: var(--faint); }
.md-navitem.active .md-ico, .fmd-item.active .md-ico { color: var(--accent); }
.md-navitem span:not(.md-cnt) { flex: 1; }
.md-cnt { font-family: var(--font-mono); font-size: 11px; color: var(--faint); font-weight: 600; }
.md-navitem.active .md-cnt { color: var(--accent); }

.md-pane { min-width: 0; }
.md-pane-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.md-pane-head h3 { font-size: 20px; font-weight: 800; }
.md-badge { font-family: var(--font-mono); font-size: 11px; color: var(--muted);
  background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.md-new { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  padding: 8px 14px; border-radius: 8px; }
.md-new svg { width: 14px; height: 14px; }
.md-hint { margin: 0 0 16px; max-width: 62ch; }
.md-panel { overflow-x: auto; }
.md-panel table { min-width: 460px; }

/* jemné odlišení řádku pro přidání nového záznamu */
tr.md-add { background: var(--wash); }
tr.md-add td { border-top: 1px solid var(--line-2); }

/* --- Trasy: master–detail (seznam + formulář) --- */
.md-md { display: grid; grid-template-columns: 282px 1fr; gap: 18px; align-items: start; }
.md-list { display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.md-li { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; color: var(--ink); border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 12px 14px; cursor: pointer; }
.md-li:last-child { border-bottom: none; }
.md-li:hover { background: var(--wash); }
.md-li.sel { background: var(--accent-soft); }
.md-li .pin { width: 15px; height: 15px; color: var(--faint); flex: 0 0 auto; }
.md-li.sel .pin { color: var(--accent); }
.md-li-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.md-li .dest { font-weight: 600; font-size: 13.5px; }
.md-li.sel .dest { color: var(--accent); }
.rt-name { font-weight: 400; font-size: 12px; color: var(--faint); }
.md-li .sub { font-size: 11.5px; color: var(--faint); }
.md-li .km { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); font-weight: 600;
  flex: 0 0 auto; }
.md-li-add { justify-content: center; color: var(--accent); font-weight: 600; font-size: 13px; gap: 7px; }
.md-li-add:hover { background: var(--accent-soft); }
.route-li { cursor: grab; }
.route-li:active { cursor: grabbing; }
.route-li.dragging { opacity: .45; }
.route-li.dragover { box-shadow: inset 0 2px 0 0 var(--accent); }
.md-li .grip { width: 13px; height: 13px; color: var(--line-2); flex: 0 0 auto; }
.route-li:hover .grip { color: var(--faint); }

/* strom typů dokumentů */
.dt-tree { padding: 6px; }
.dt-row { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 8px;
  cursor: grab; position: relative; }
.dt-row:hover { background: var(--wash); }
.dt-row.sel { background: var(--accent-soft); }
.dt-row.dragging { opacity: .45; }
.dt-row.dt-inside { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dt-row.dt-before::before, .dt-row.dt-after::after { content: ""; position: absolute; left: 8px; right: 8px;
  height: 2px; background: var(--accent); border-radius: 2px; }
.dt-row.dt-before::before { top: -1px; }
.dt-row.dt-after::after { bottom: -1px; }
.dt-chev { width: 18px; height: 18px; padding: 0; border: none; background: none; color: var(--faint);
  display: grid; place-items: center; flex: 0 0 auto; cursor: pointer; }
.dt-chev svg { width: 13px; height: 13px; transition: transform .15s; }
.dt-chev.open svg { transform: rotate(90deg); }
.dt-chev-sp { width: 18px; flex: 0 0 auto; }
.dt-row .pin { width: 15px; height: 15px; color: var(--faint); flex: 0 0 auto; }
.dt-row.sel .pin { color: var(--accent); }
.dt-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.dt-row.sel .dt-name { color: var(--accent); font-weight: 600; }
.dt-cnt { font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  background: var(--surface-alt); border-radius: 999px; padding: 1px 7px; }
.dt-add { width: 22px; height: 22px; border-radius: 6px; border: 1px solid transparent; background: none;
  color: var(--faint); font-size: 15px; line-height: 1; padding: 0; opacity: 0; flex: 0 0 auto; }
.dt-row:hover .dt-add { opacity: 1; }
.dt-add:hover { color: var(--accent); border-color: var(--accent); }
.dt-empty { padding: 24px 14px; color: var(--faint); font-size: 13px; text-align: center; }

/* seznam souborů u dokumentu */
.fl-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; margin-bottom: 8px; }
.fl-row { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--line);
  font-size: 13px; }
.fl-row:last-child { border-bottom: none; }
.fl-row.fl-pending { background: var(--wash); }
.fl-ico { flex: 0 0 auto; }
.fl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.fl-size { color: var(--faint); font-family: var(--font-mono); font-size: 12px; }
.fl-new { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; }
.fl-empty { padding: 12px; color: var(--faint); font-size: 12.5px; }
.fl-add { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--accent);
  font-weight: 600; font-size: 13px; border: 1px dashed var(--line-2); border-radius: 8px; padding: 7px 12px;
  width: fit-content; }
.fl-add:hover { background: var(--accent-soft); }

/* dokumenty vybraného dne (řádkový výpis) */
.doc-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 16px; }
.doc-item { border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: none; }
.doc-item.editing { background: var(--accent-soft); }
.doc-head { display: flex; align-items: center; gap: 10px; }
.doc-head .dt-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; padding: 11px 14px;
  background: none; border: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.doc-head .dt-main:hover { background: var(--wash); }
.doc-item.editing .doc-head .dt-main:hover { background: transparent; }
.di-name { font-weight: 600; font-size: 14px; }
.di-type { color: var(--faint); font-size: 12.5px; }
.doc-head .link { margin-right: 14px; }
.di-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px 14px; }
.di-file { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 12px; color: var(--ink);
  cursor: pointer; }
.di-file:hover { border-color: var(--accent); color: var(--accent); }
.di-file .fl-size { color: var(--faint); }
.dok-newbtn { display: inline-flex; align-items: center; gap: 7px; }
.dok-newbtn svg { width: 14px; height: 14px; }

/* drop zóna pro soubory */
.fl-drop { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 10px 12px;
  border: 1.5px dashed var(--line-2); border-radius: 10px; transition: border-color .12s, background .12s; }
.fl-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.fl-drop .fl-add { border-style: solid; }
.fl-drophint { color: var(--faint); font-size: 12.5px; }

/* vyhledávací select (combobox) pro typ dokumentu */
.cb { position: relative; }
.cb-ctl { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.cb-ctl:hover { border-color: var(--faint); }
.cb-chev { width: 14px; height: 14px; color: var(--faint); flex: 0 0 auto; }
.cb-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.cb-menu[hidden] { display: none; }
.cb-search { width: 100%; margin: 0 0 6px; padding: 7px 10px; border: 1px solid var(--line-2);
  border-radius: 7px; font: inherit; font-size: 13.5px; }
.cb-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.cb-opt { text-align: left; background: none; border: none; border-radius: 6px; padding: 7px 10px;
  font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.cb-opt:hover { background: var(--wash); }
.cb-opt.sel { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cb-none { padding: 8px 10px; color: var(--faint); font-size: 13px; }
.rf-fld textarea { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 11px; font: inherit;
  resize: vertical; width: 100%; margin: 0; background: var(--field, #fff); color: var(--ink); }

.md-form { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 20px;
  background: var(--surface); box-shadow: var(--shadow); }
.rf-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.rf-head svg { width: 20px; height: 20px; color: var(--accent); flex: 0 0 auto; }
.rf-head h4 { font-size: 17px; font-weight: 800; margin-right: auto; }
.rf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 16px; }
.rf-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rf-fld label { font-family: var(--font-head); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em; color: var(--faint); }
.rf-in { display: flex; align-items: center; gap: 7px; }
.rf-in input { margin: 0; flex: 1; min-width: 0; }
.rf-in .u { color: var(--faint); font-size: 12px; flex: 0 0 auto; }
.rf-fld .hint { font-size: 11px; color: var(--faint); }
.rf-actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line); }
.rf-actions .spacer { margin-left: auto; }

/* návod v detailu trasy */
.rf-guide { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--wash); overflow: hidden; }
.rf-guide > summary { cursor: pointer; list-style: none; padding: 11px 14px; font-size: 13px;
  font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 9px; }
.rf-guide > summary::-webkit-details-marker { display: none; }
.rf-guide > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rf-guide summary .info { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.rf-guide summary .chev { width: 15px; height: 15px; margin-left: auto; color: var(--faint);
  transition: transform .2s; }
@media (prefers-reduced-motion: reduce) { .rf-guide summary .chev { transition: none; } }
.rf-guide[open] > summary .chev { transform: rotate(180deg); }
.rf-guide-body { padding: 4px 15px 15px; border-top: 1px solid var(--line); font-size: 13px;
  color: var(--muted); line-height: 1.55; display: flex; flex-direction: column; gap: 10px; }
.rf-guide-body p { margin: 0; }
.rf-guide-body b { color: var(--ink); font-weight: 600; }
.rf-guide-body ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.rf-guide-body li { padding-left: 16px; position: relative; }
.rf-guide-body li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); }
.rf-guide-ex { background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); line-height: 1.7; }
.rf-guide-ex-t { display: block; font-family: var(--font-head); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 6px; }
.rf-guide-ex b { color: var(--accent); font-weight: 600; }

@media (max-width: 720px) {
  .md-layout { grid-template-columns: 1fr; gap: 14px; }
  .md-nav { flex-flow: row wrap; }
  .md-grp { width: 100%; padding: 4px 2px; }
  .md-navitem { width: auto; }
  .md-navitem span:not(.md-cnt) { flex: 0 0 auto; }
  .md-pane-head { flex-wrap: wrap; }
  .md-new { margin-left: auto; }
  .md-md { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .rf-grid { grid-template-columns: 1fr; }
}

/* ===== Cesty — roční kalendář + panel dne ===== */
.yearpick { display: inline-flex; align-items: center; gap: 4px; }
.yearpick input { width: 78px; text-align: center; margin: 0; }
.yb { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  padding: 7px 11px; font-size: 15px; line-height: 1; border-radius: 8px; }
.yb:hover { background: var(--surface-alt); }

.cal-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow); }
table.cal { border-collapse: collapse; font-family: var(--font-mono);
  font-variant-numeric: tabular-nums; font-size: 11px; }
table.cal th, table.cal td { width: 23px; min-width: 23px; height: 22px; text-align: center;
  padding: 0; border: 1px solid var(--line); }
table.cal thead th { background: var(--surface-alt); color: var(--faint); font-weight: 700; height: 20px; }
table.cal thead th.we { color: var(--accent); }
.cal-corner { background: var(--surface-alt) !important; position: sticky; left: 0; z-index: 3; }
.cal-mon { background: var(--ink); color: #fff; font-family: var(--font-head); font-weight: 800;
  font-size: 11px; width: 30px; min-width: 30px; position: sticky; left: 0; z-index: 2; }
td.cal-x { background: var(--wash); }
td.cal-d { cursor: pointer; color: var(--ink); background: var(--surface); }
td.cal-d.we { color: var(--accent); background: #fbf4f4; }
td.cal-d:hover { background: var(--accent-soft); }
td.cal-d.has { background: #8a1519; color: #fff; font-weight: 700; }
td.cal-d.has:hover { background: #a31d22; }
td.cal-d.today { box-shadow: inset 0 0 0 2px var(--ink); }
td.cal-d.sel { box-shadow: inset 0 0 0 2px var(--accent); }
td.cal-d.sel.has { box-shadow: inset 0 0 0 2px #fff; }

.cal-legend { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 10px;
  font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px;
  vertical-align: -2px; margin-right: 5px; }
.cal-legend .lg-has { background: #8a1519; }
.cal-legend .lg-we { background: #fbf4f4; border: 1px solid var(--accent); }
.cal-legend .lg-today { background: var(--surface); box-shadow: inset 0 0 0 2px var(--ink); }

.day-panel { margin-top: 24px; }
.day-empty { padding: 22px 0; }
.day-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.day-head h3 { font-size: 18px; font-weight: 800; text-transform: capitalize; }
.day-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 16px; }
.day-trip { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.day-trip:last-child { border-bottom: none; }
.day-trip.editing { background: var(--accent-soft); }
.dt-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 11px 14px;
  background: none; border: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.dt-main:hover { background: var(--wash); }
.day-trip.editing .dt-main:hover { background: transparent; }
.day-trip .link { margin-right: 14px; }
.dt-time { color: var(--ink); font-weight: 600; }
.dt-dest { flex: 1; min-width: 0; }
.dt-veh { color: var(--faint); font-size: 12.5px; }
.dt-priv { font-size: 11px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent-soft);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.dt-km { color: var(--muted); }
.day-none { padding: 14px; margin: 0; }
.day-add { border: 1px dashed var(--line-2); border-radius: 10px; padding: 14px 16px; background: var(--wash); }
.day-add h4 { font-family: var(--font-head); font-size: 12px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint); margin: 0 0 10px; }
.day-add.editing { border-style: solid; border-color: var(--accent-soft); background: var(--surface); }
.form-err { margin: 10px 0 0; padding: 11px 16px; border-radius: 8px; background: var(--accent);
  color: #000; font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.pm { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.pm input { margin: 0; }

/* náhled vygenerované cesty */
.gp { margin-top: 14px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 10px; overflow: hidden; }
.gp-top { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center;
  padding: 13px 16px; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.gp-time { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.gp-time .gp-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); font-family: var(--font-head); }
.gp-time b { font-size: 17px; color: var(--ink); }
.gp-time .gp-arrow { color: var(--faint); margin: 0 2px; }
.gp-meta { display: flex; gap: 18px; margin-left: auto; align-items: center; font-size: 13px; color: var(--muted); }
.gp-meta b { color: var(--ink); font-weight: 600; }
.gp-in { margin: 0; padding: 5px 9px; font-family: var(--font-mono); font-size: 15px; font-weight: 600;
  width: 86px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); color: var(--ink); }
.gp-inkm { margin: 0; padding: 4px 7px; width: 60px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: right; }
.gp-note { padding: 2px 16px 0; font-size: 11.5px; color: var(--faint); }
.gp-warn { display: flex; gap: 10px; margin: 10px 16px 0; padding: 10px 12px; border-radius: 8px;
  background: #fdf0f0; border: 1px solid #f0c9c9; color: #8a1519; font-size: 12.5px; }
.gp-warn svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; color: var(--accent); }
.gp-warn b { display: block; margin-bottom: 3px; font-family: var(--font-head); font-size: 12px; }
.gp-warn ul { margin: 0; padding-left: 16px; }
.gp-warn li { margin: 2px 0; }
.gp-warn.soft { background: #fff6e0; border-color: #f0d48a; color: #6f4d00; }
.gp-warn.soft svg { color: #c56a00; }
.gp-legs { display: flex; flex-direction: column; padding: 4px 16px; border-bottom: 1px solid var(--line); }
.gp-leg { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; font-size: 13px; }
.gp-leg + .gp-leg { border-top: 1px dashed var(--line); }
.gp-dir { font-family: var(--font-head); font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent); width: 34px; flex: 0 0 auto; }
.gp-route { color: var(--ink); font-weight: 500; flex: 1; min-width: 0; }
.gp-ltime { color: var(--muted); }
.gp-lkm { display: flex; align-items: center; gap: 5px; justify-content: flex-end;
  color: var(--muted); font-size: 12px; flex: 0 0 auto; }
/* editor úseků cesty */
.gl-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.gl { border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; background: var(--wash); }
.gl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.gl-head .gp-dir { width: 44px; flex: 0 0 auto; }
.gl-arrow { color: var(--faint); }
.gl-place { flex: 1; min-width: 60px; margin: 0; padding: 4px 8px; font-size: 13px; }
.gl-del { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--muted); font-size: 15px; line-height: 1; padding: 0; }
.gl-del:hover { color: var(--accent); border-color: var(--accent); background: var(--surface); }
.gl-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gl-lab { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--faint); font-family: var(--font-head); }
.gl-date { margin: 0; padding: 4px 7px; font-size: 12.5px; width: auto; }
.gl-time { margin: 0; padding: 4px 7px; width: 62px; font-size: 13px; font-weight: 600; }
.gl-kmwrap { margin-left: auto; font-size: 12px; color: var(--faint); display: inline-flex; align-items: center; gap: 4px; }
.gl-km { margin: 0; padding: 4px 7px; width: 58px; font-size: 13px; font-weight: 600; text-align: right; }
.gl-add { align-self: flex-start; background: none; color: var(--accent); border: 1px dashed var(--line-2);
  border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
.gl-add:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.gl-multiday { font-size: 11px; font-weight: 600; color: var(--warning); border: 1px solid #f0d48a;
  background: #fff6e0; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.gp-rows { padding: 6px 16px; }
.gp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.gp-row:last-child { border-bottom: none; }
.gp-row i { color: var(--faint); font-style: normal; font-size: 12px; margin-left: 4px;
  font-family: var(--font-mono); }
.gp-row b { color: var(--ink); font-weight: 600; }
.gp-row.gp-muted span { color: var(--faint); font-size: 13px; }
.gp-row.gp-total { border-top: 2px solid var(--line-2); margin-top: 2px; padding-top: 11px; }
.gp-row.gp-total span { font-weight: 700; }
.gp-row.gp-total b { color: var(--accent); font-size: 16px; }
.gp-actions { display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: var(--wash); }
.gp-actions .spacer { margin-left: auto; }
.ghostbtn { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  font-weight: 600; }
.ghostbtn:hover { background: var(--surface-alt); }

/* ---- Co o mě vede stát (ARES) ---- */
.stat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  flex-wrap: wrap; padding: 4px 0 16px; }
.stat-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); }
.stat-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.stat-ico { display: flex; align-items: center; gap: 8px; }
.stat-ico label { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase;
  letter-spacing: .04em; }
.stat-ico input { width: 130px; }
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.stat-meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.stat-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-loading, .stat-none { color: var(--muted); font-size: 14px; padding: 6px 0; }
.stat-err { color: var(--accent); font-size: 14px; padding: 6px 0; }

.stat-out { display: flex; flex-direction: column; gap: 10px; }
.stat-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  overflow: hidden; }
.stat-card.has { border-color: var(--line-2); }
.stat-card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; font-weight: 700; color: var(--ink); user-select: none; }
.stat-card > summary::-webkit-details-marker { display: none; }
.stat-card > summary::before { content: "▸"; color: var(--faint); font-size: 11px; transition: transform .15s; }
.stat-card[open] > summary::before { transform: rotate(90deg); }
.stat-lbl { flex: 1; }
.stat-badge { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em; }
.stat-badge.ok { background: var(--accent-soft); color: var(--accent-dark); }
.stat-badge.none { background: var(--surface-alt); color: var(--faint); }
.stat-badge.err { background: #fbe6e6; color: var(--accent-dark); }
.stat-body { padding: 4px 16px 16px; border-top: 1px solid var(--line); overflow-x: auto; }

/* generický JSON strom */
.jv-obj { display: flex; flex-direction: column; }
.jv-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 12px;
  align-items: baseline; padding: 5px 0; border-bottom: 1px solid var(--wash); }
.jv-row:last-child { border-bottom: none; }
/* klíče normálním písmem, hodnoty tučně */
.jv-k { font-size: 13px; font-weight: 400; color: var(--muted); }
.jv-v { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 0; overflow-wrap: break-word; }
.jv-null { font-weight: 400; color: var(--faint); }
.jv-arr { display: flex; flex-direction: column; gap: 8px; }
.jv-item { font-weight: 700; color: var(--ink); padding-left: 12px; border-left: 2px solid var(--line); }
/* vnořený objekt/pole na celou šířku – klíč nad odsazeným obsahem */
.jv-block { padding: 6px 0; border-bottom: 1px solid var(--wash); }
.jv-block:last-child { border-bottom: none; }
.jv-block > .jv-k { margin-bottom: 4px; }
.jv-nested { padding-left: 14px; border-left: 2px solid var(--line); }
@media (max-width: 640px) {
  .jv-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---- Datovka (ISDS datové schránky) ---- */
.dz-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  flex-wrap: wrap; padding: 4px 0 16px; }
.dz-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); }
.dz-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.dz-loading, .dz-empty { color: var(--muted); font-size: 14px; padding: 10px 2px; }
.dz-err { color: var(--accent); font-size: 14px; padding: 10px 2px; }

.dz-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .dz-layout { grid-template-columns: 1fr; } }

.dz-list { display: flex; flex-direction: column; gap: 6px; }
.dz-row { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  cursor: pointer; transition: border-color .12s, background .12s; }
.dz-row:hover { border-color: var(--line-2); background: var(--wash); }
.dz-row.active { border-color: var(--accent); background: var(--accent-soft); }
.dz-row-main { min-width: 0; }
.dz-subj { font-weight: 700; color: var(--ink); font-size: 14px; display: flex; align-items: center; gap: 7px;
  overflow: hidden; text-overflow: ellipsis; }
.dz-meta-line { color: var(--muted); font-size: 12.5px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-row-side { text-align: right; flex: 0 0 auto; }
.dz-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dz-att { font-size: 12px; color: var(--faint); margin-top: 2px; }
.dz-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em; flex: 0 0 auto; }
.dz-badge.ok { background: var(--accent-soft); color: var(--accent-dark); }

.dz-detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 18px 20px; min-height: 120px; }
.dz-detail-head h3 { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.dz-meta { display: flex; flex-direction: column; }
.dz-actions { margin-top: 14px; }
.dz-saved { display: inline-block; font-size: 13px; font-weight: 700; color: var(--accent-dark);
  background: var(--accent-soft); padding: 7px 12px; border-radius: 8px; }
.dz-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.dz-h { font-size: 13px; font-weight: 700; color: var(--faint); text-transform: uppercase;
  letter-spacing: .04em; margin: 18px 0 8px; }
.dz-files { display: flex; flex-direction: column; gap: 6px; }
.dz-file { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%;
  text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 9px 12px; font-weight: 600; }
.dz-file:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.dz-file-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-file-s { flex: 0 0 auto; font-size: 12px; color: var(--faint); font-weight: 500; }
.dz-check { color: var(--faint); font-size: 12px; }
.dz-info { display: flex; gap: 12px; align-items: flex-start; margin-top: 22px; padding: 14px 16px;
  background: #eaf6ec; border: 1px solid #c3e6cb; border-radius: 10px;
  color: var(--ink); font-size: 13px; line-height: 1.5; }
.dz-info svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--success); margin-top: 1px; }
.dz-info strong { display: block; font-weight: 700; margin-bottom: 2px; }

/* ---- Náhled souboru v modálním okně ---- */
.fp-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center;
  justify-content: center; padding: 3vh 3vw; background: rgba(20, 20, 22, .55); }
.fp-modal { display: flex; flex-direction: column; width: min(1000px, 94vw); height: 90vh;
  background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.fp-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.fp-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 12px; font-weight: 600; font-size: 13px; flex: 0 0 auto; }
.fp-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.fp-close { padding: 6px 10px; }
.fp-body { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.fp-body-pdf { padding: 0; display: flex; }
.fp-frame { flex: 1; width: 100%; border: none; }
.fp-body-image { display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--surface-alt); }
.fp-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fp-text { margin: 0; padding: 16px 18px; font-family: var(--font-mono); font-size: 12.5px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.fp-none { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; height: 100%; padding: 40px; text-align: center; color: var(--muted); }
.fp-none-ico { font-size: 46px; }

/* DOCX náhled (mammoth.js → HTML) */
.fp-body-docx { background: var(--surface-alt); }
.fp-docwrap { max-width: 840px; margin: 0 auto; padding: 20px 18px 40px; }
.fp-docnote { font-size: 12px; color: #8a6d00; background: #fff6d9; border: 1px solid #f0e0a8;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; }
.fp-doc { background: #fff; color: #1a1a1a; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); padding: 40px 48px; font-family: var(--font-body); line-height: 1.6; }
.fp-doc p { margin: 0 0 10px; }
.fp-doc h1, .fp-doc h2, .fp-doc h3 { font-family: var(--font-body); line-height: 1.3; margin: 18px 0 8px; }
.fp-doc h1 { font-size: 22px; } .fp-doc h2 { font-size: 18px; } .fp-doc h3 { font-size: 15px; }
.fp-doc ul, .fp-doc ol { margin: 0 0 10px 22px; }
.fp-doc table { width: auto; border-collapse: collapse; margin: 10px 0; box-shadow: none; border-radius: 0; }
.fp-doc td, .fp-doc th { border: 1px solid var(--line-2); padding: 5px 9px; font-size: 13px; }
.fp-doc img { max-width: 100%; height: auto; }

/* Odchozí DZ — formulář nové zprávy */
.dz-compose h3 { font-size: 17px; font-weight: 800; color: var(--ink); margin-bottom: 14px; }
.dz-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.dz-field > label { font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase;
  letter-spacing: .04em; }
.dz-field input[type=text] { width: 100%; margin: 0; }
.dz-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .dz-2col { grid-template-columns: 1fr; } }
.dz-tolist { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-height: 260px;
  overflow-y: auto; background: var(--surface); }
.dz-tohint { padding: 10px 12px; color: var(--faint); font-size: 13px; }
.dz-toopt { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  text-align: left; background: none; color: var(--ink); border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 9px 12px; font-weight: 500; }
.dz-toopt:last-child { border-bottom: none; }
.dz-toopt:hover { background: var(--accent-soft); }
.dz-toname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-rid { font-family: var(--font-mono); font-size: 12px; color: var(--faint); flex: 0 0 auto; }
.dz-recipient { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--accent); background: var(--accent-soft);
  border-radius: 10px; margin-bottom: 14px; }
.dz-rname { font-weight: 700; color: var(--ink); margin-right: 8px; }
.dz-pick { display: inline; color: var(--accent); font-weight: 600; cursor: pointer; }
.dz-pick:hover { text-decoration: underline; }
.dz-pick input { display: none; }

/* Compose nad seznamem odchozích (přes celou šířku) */
.dz-compose-wrap { border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.dz-compose-wrap[hidden] { display: none; }
.dz-compose-head { display: flex; justify-content: space-between; align-items: center; }
.dz-compose-head h3 { margin-bottom: 0; }

/* ===== Tmavý režim (přepis tokenů) ===== */
:root[data-theme="dark"] {
  --accent: #ff4a4f; --accent-dark: #e0292e; --accent-soft: #3a1f22;
  --ink: #ececee; --muted: #a6a6ad; --faint: #7a7a82;
  --bg: #161619; --surface: #1f1f24; --surface-alt: #26262c; --wash: #1b1b1f;
  --line: #2e2e35; --line-2: #3b3b44;
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 8px 24px rgba(0,0,0,.4);
}
/* modbar má bg z --ink (v světle tmavá lišta) → v tmavém explicitně tmavá */
:root[data-theme="dark"] .modbar { background: #0e0e11; border-bottom-color: #0e0e11; }
/* barevné boxy s napevno danými odstíny */
:root[data-theme="dark"] .dz-info { background: #15271a; border-color: #26512f; }
:root[data-theme="dark"] .fp-docnote { background: #322a12; border-color: #57491d; color: #e6cf7a; }
:root[data-theme="dark"] .dz-badge.err,
:root[data-theme="dark"] .stat-badge.err { background: #3a1f22; color: #ff9a9d; }

/* ===== Ikony v hlavičce ===== */
.icon-btn { background: none; border: 1px solid var(--line-2); color: var(--muted); border-radius: 8px;
  padding: 6px 9px; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; }
.icon-btn:hover { color: var(--ink); border-color: var(--accent); background: var(--surface-alt); }
.icon-btn svg { width: 17px; height: 17px; display: block; }
#themeBtn { font-size: 16px; min-width: 34px; justify-content: center; }

/* ===== Modal Nastavení ===== */
.set-modal { display: flex; flex-direction: column; width: min(520px, 94vw); max-height: 88vh;
  background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.set-body { padding: 16px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.set-sec h4 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--faint); margin-bottom: 10px; }
.set-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.set-f:last-child { margin-bottom: 0; }
.set-f input, .set-f select { width: 100%; margin: 0; }
.set-check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.set-check input { width: auto; margin: 0; }
.set-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px;
  border-top: 1px solid var(--line); background: var(--surface-alt); }

/* ===== Přehled (dashboard) ===== */
.pg-title { font-size: 24px; font-weight: 800; color: var(--ink); }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.pg-card { display: block; text-align: left; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); cursor: pointer; }
.pg-card:hover { border-color: var(--accent); background: var(--surface); }
.pg-card.disabled { opacity: .6; cursor: default; box-shadow: none; }
.pg-card.disabled:hover { border-color: var(--line); }
.pg-card-h { font-family: var(--font-head); font-weight: 800; font-size: 15px; color: var(--ink);
  margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.pg-big { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1; }
.pg-muted { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.pg-over { font-size: 11px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.pg-dl { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; border-bottom: 1px solid var(--wash); }
.pg-dl:last-child { border-bottom: none; }
.pg-dl-d { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 78px; }
.pg-dl-t { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Kontakty ===== */
.kon-search { max-width: 340px; margin: 0 0 14px; }
.kon-form { display: flex; flex-direction: column; }
.kon-form textarea { min-height: 58px; }
.kon-ico { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.kon-ico .ghostbtn { margin-bottom: 10px; white-space: nowrap; }
.kon-btns { margin-top: 8px; display: flex; align-items: center; gap: 16px; }

/* ===== Termíny ===== */
.term-actions { display: flex; gap: 8px; }
.term-newform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 16px;
  padding: 12px; background: var(--wash); border: 1px solid var(--line); border-radius: 10px; }
.term-newform input[type=text] { flex: 1; min-width: 200px; margin: 0; }
.term-newform input, .term-newform select { margin: 0; }
.term-sec { font-family: var(--font-head); font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); margin: 16px 0 6px; }
.term-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--surface); margin-bottom: 6px; }
.term-check { flex: 0 0 auto; width: 22px; height: 22px; padding: 0; border-radius: 6px; background: var(--surface);
  border: 1.5px solid var(--line-2); color: var(--success); font-weight: 800; line-height: 1; }
.term-check:hover { border-color: var(--success); background: var(--surface-alt); }
.term-date { flex: 0 0 auto; min-width: 90px; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.term-title { flex: 1; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-cat { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface-alt); color: var(--muted); }
.term-cat.cat-dan { background: var(--accent-soft); color: var(--accent-dark); }
.term-del { flex: 0 0 auto; background: none; border: none; color: var(--faint); font-size: 18px; padding: 0 4px; line-height: 1; }
.term-del:hover { color: var(--accent); background: none; }
.term-row.over { border-color: var(--accent); }
.term-row.over .term-date { color: var(--accent); font-weight: 700; }
.term-row.done { opacity: .6; }
.term-row.done .term-title { text-decoration: line-through; }
.term-row.done .term-check { background: var(--success); border-color: var(--success); color: #fff; }

/* Termíny – roční kalendář (amber = termín, červená = po termínu) */
#termCal { margin-top: 6px; }
#termCal td.cal-d.has { background: #c9962a; color: #fff; font-weight: 700; }
#termCal td.cal-d.has:hover { background: #b3831f; }
#termCal td.cal-d.over { background: #8a1519; color: #fff; }
#termCal td.cal-d.over:hover { background: #a31d22; }
#termCal td.cal-d.sel.has { box-shadow: inset 0 0 0 2px #fff; }
.cal-legend .lg-term { background: #c9962a; }
.cal-legend .lg-over { background: #8a1519; }
.term-day-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.term-day-head h4 { font-size: 15px; font-weight: 800; color: var(--ink); }

/* Toolbar modulů bez nadpisu (Kontakty, Termíny) – sjednoceno */
.mod-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  justify-content: space-between; margin-bottom: 16px; }
.mod-toolbar.right { justify-content: flex-end; }
.mod-toolbar .kon-search { margin: 0; width: 340px; max-width: 100%; }
.pg-grid { margin-top: 4px; }

/* Prázdný pruh pro moduly bez submodulů (aby layout odpovídal modulům s taby) */
.tabbar-empty { cursor: default; }
.tab-ph { display: inline-block; padding: 10px 14px; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; visibility: hidden; }

/* ===== Modul Faktury ===== */
.fak-chk { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px;
  color: var(--muted); white-space: nowrap; padding-bottom: 9px; }
.fak-chk input { width: auto; margin: 0; }
.fak-sum { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 12px; font-size: 13px;
  color: var(--muted); }
.fak-sum-i b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; }
.fak-sum-i.over { color: var(--accent); font-weight: 600; }
.fak-amt { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; }
.fak-badge { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; }
.fak-badge.paid { background: #e8f3e9; color: var(--success); }
.fak-badge.open { background: var(--surface-alt); color: var(--faint); }
.fak-badge.over { background: var(--accent-soft); color: var(--accent-dark); }
.fak-dt { font-size: 12.5px; color: var(--faint); margin: -6px 0 12px; }
.fak-h { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; margin: 18px 0 8px; }
.fak-tab { width: 100%; border-collapse: collapse; font-size: 13px; }
.fak-tab th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--faint); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.fak-tab td { padding: 7px 8px; border-bottom: 1px solid var(--wash); vertical-align: top; }
.fak-tab .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
.fak-totals { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 13px; }
.fak-totals div { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); }
.fak-totals b { font-family: var(--font-mono); color: var(--ink); }
.fak-totals .fak-pay { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line);
  font-size: 15px; font-weight: 700; color: var(--ink); }
.fak-totals .fak-pay b { color: var(--accent); font-size: 16px; }

/* import ISDOC */
.fak-implist { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.fak-impfile { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 10px;
  background: var(--surface-alt); border-radius: 8px; }
.fak-impfile > span:first-child { flex: 1; font-weight: 500; }
.fak-res-head { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.fak-res { display: flex; align-items: center; gap: 10px; padding: 7px 10px; margin-bottom: 4px;
  border-radius: 8px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
.fak-res-b { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap; }
.fak-res.ok .fak-res-b { background: #e8f3e9; color: var(--success); }
.fak-res.dup .fak-res-b { background: var(--surface-alt); color: var(--faint); }
.fak-res.err { border-color: var(--accent-soft); }
.fak-res.err .fak-res-b { background: var(--accent-soft); color: var(--accent-dark); }
.fak-res-f { font-weight: 600; color: var(--ink); }
.fak-res-i { color: var(--muted); }

/* tmavý režim — barevné boxy s napevno danými odstíny */
:root[data-theme="dark"] .fak-badge.paid,
:root[data-theme="dark"] .fak-res.ok .fak-res-b { background: #15271a; color: #7ec98a; }

/* číselné řady faktur */
.fs-tab { margin-bottom: 8px; }
.fs-tab td { vertical-align: middle; }
.fs-def { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.fs-prev { color: var(--ink); font-weight: 600; }
.fs-act { text-align: right; white-space: nowrap; }
.fs-act button { margin-left: 10px; }
tr.fs-editing { background: var(--accent-soft); }
.fs-form { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); }
.fs-form .fak-h { margin-top: 0; }
.fs-grid { display: grid; grid-template-columns: 1.4fr 1.2fr .7fr; gap: 12px; }
@media (max-width: 760px) { .fs-grid { grid-template-columns: 1fr; } }
.fs-chks { display: flex; flex-wrap: wrap; gap: 20px; margin: 10px 0 4px; }
.fs-chks .fak-chk { padding-bottom: 0; }
.fs-hint { margin: 10px 0 4px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.fs-live { margin-top: 6px; font-size: 13px; color: var(--muted); }
.fs-live b { font-family: var(--font-mono); font-size: 15px; color: var(--accent); }
.fak-ev { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px;
  background: var(--surface-alt); border: 1px solid var(--line); color: var(--muted);
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.fak-ev.big { font-size: 13px; color: var(--ink); vertical-align: middle; }

/* formulář faktury (vystavení / úprava) */
.fak-form-wrap { margin-bottom: 18px; }
.fak-form-wrap[hidden] { display: none; }
.fak-form { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); padding: 18px 20px; }
.fak-form .dz-detail-head { display: flex; align-items: center; gap: 12px; }
.fak-x { margin-left: auto; background: none; color: var(--faint); font-size: 16px; padding: 2px 8px; }
.fak-x:hover { background: none; color: var(--accent); }
.fak-fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 14px; margin-bottom: 6px; }
@media (max-width: 900px) { .fak-fgrid { grid-template-columns: repeat(2, 1fr); } }
.fak-fgrid .set-f input, .fak-fgrid .set-f select { width: 100%; }
.fi-pay { grid-template-columns: 1fr 1fr 2fr; align-items: end; }
.fi-note input { width: 100%; }
.fi-tab input, .fi-tab select { width: 100%; margin: 0; padding: 6px 8px; font-size: 13px; }
.fi-tab .fi-num { text-align: right; font-family: var(--font-mono); }
.fi-tab .fi-unit { width: 60px; }
.fi-tab td { vertical-align: middle; }
.fi-tab .fi-amt { font-family: var(--font-mono); white-space: nowrap; }
.fi-del { width: 28px; text-align: center; }
.fi-add { margin: 8px 0 4px; }
.fi-totals { max-width: 320px; margin-left: auto; }

/* výběr protistrany z Kontaktů ve formuláři faktury */
.fi-partner { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start;
  margin-bottom: 6px; }
@media (max-width: 760px) { .fi-partner { grid-template-columns: 1fr; } }
.fi-pcard { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 13px; }
.fi-pname { font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.fi-pline { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.fi-phint { color: var(--muted); font-size: 12.5px; align-self: center; }
.cb-opts { max-height: 240px; overflow-y: auto; }
.cb-empty { padding: 8px 10px; color: var(--faint); font-size: 12.5px; }

/* modal Nový kontakt (z výběru odběratele na faktuře) */
.kon-modal { width: min(680px, 94vw); }
.kon-modal .set-body { gap: 10px; }
.kon-mgrid { grid-template-columns: repeat(2, 1fr); }
.kon-modal .kon-ico { display: flex; align-items: end; gap: 10px; }
.kon-modal .kon-ico .set-f { flex: 1; margin-bottom: 0; }
.cb-opt.cb-new { color: var(--accent); font-weight: 700; border-bottom: 1px solid var(--line);
  border-radius: 0; margin-bottom: 4px; }

/* ===== České datumové pole (dd.mm.rrrr) — nativní date input se řídí locale prohlížeče ===== */
.dtf { position: relative; display: inline-flex; align-items: center; width: 100%; }
.dtf .dt-txt { width: 100%; margin: 0; padding-right: 30px; font-variant-numeric: tabular-nums; }
.dt-pick { position: absolute; right: 6px; width: 1px; height: 1px; padding: 0; margin: 0;
  border: none; opacity: 0; pointer-events: none; }
.dt-btn { position: absolute; right: 5px; background: none; border: none; color: var(--faint);
  padding: 2px; display: inline-flex; align-items: center; cursor: pointer; }
.dt-btn:hover { background: none; color: var(--accent); }
.dt-btn svg { width: 15px; height: 15px; display: block; }
.row .dtf, .md-panel .dtf { width: 140px; }
.gl-row .dtf { width: 148px; }        /* úsek cesty: datum zůstává úzké vedle času */
.dtf .gl-date { font-size: 12.5px; padding: 4px 7px; padding-right: 26px; }

/* ===== Kontakt: navázané doklady (faktury / datové zprávy) ===== */
.kon-related { margin-top: 16px; }
.kon-related:empty { display: none; }
.kr-list { display: flex; flex-direction: column; gap: 6px; }
.kr-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kr-click { cursor: pointer; }
.kr-click:hover { border-color: var(--accent); background: var(--accent-soft); }
.kr-badge { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-alt); color: var(--muted); white-space: nowrap; }
.kr-badge.out { background: var(--accent-soft); color: var(--accent-dark); }
.kr-main { font-weight: 600; color: var(--ink); font-family: var(--font-mono); }
.kr-sub { color: var(--muted); font-size: 12.5px; }
.kr-amt { margin-left: auto; font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.kr-msg { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kr-msg .kr-row { border: none; }
.kr-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.kon-sub { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.kon-form-head { margin-top: 6px; }
#konFormBox:empty { display: none; }
#konEditBar[hidden] { display: none; }
.di-contact { font-size: 11.5px; color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 8px; margin-left: 8px; }
.kon-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; padding-top: 14px;
  border-top: 1px solid var(--line); }
.kon-acts button { font-size: 12.5px; padding: 7px 12px; }

/* ===== Detail kontaktu: karta + souhrn + záložky ===== */
.kd-head { display: flex; align-items: flex-start; gap: 16px; }
.kd-title { min-width: 0; }                       /* dlouhý název se smí zalomit… */
.kd-title h3 { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.kd-tools { margin-left: auto; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.kd-tools > * { white-space: nowrap; }            /* …ale tlačítka nikdy */
.kd-tools .icon-btn.active { color: var(--accent); border-color: var(--accent); }
.kd-new { position: relative; }
.kd-new > button { font-size: 13px; padding: 8px 13px; display: inline-flex; align-items: center;
  gap: 6px; white-space: nowrap; }
.kd-chev { font-size: 10px; opacity: .85; }
.kd-menu { position: absolute; right: 0; top: calc(100% + 5px); z-index: 40; min-width: 190px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: var(--shadow); padding: 5px; display: flex; flex-direction: column; }
.kd-menu[hidden] { display: none; }
.kd-menu button { background: none; color: var(--ink); text-align: left; font-weight: 500;
  font-size: 13px; padding: 8px 10px; border-radius: 7px; }
.kd-menu button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.kd-menu button:disabled { background: none; color: var(--faint); cursor: not-allowed; }

.kd-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px;
  margin: 16px 0 4px; }
.kd-stat { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; }
.kd-stat-v { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--ink);
  white-space: nowrap; }
.kd-stat-s.warn { color: var(--accent); font-weight: 600; }
.kd-stat-l { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint);
  font-weight: 700; margin-top: 3px; }
.kd-stat-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.kd-tabs { display: flex; gap: 4px; margin: 16px 0 0; border-bottom: 1px solid var(--line); }
.kd-tab { background: none; color: var(--muted); border: none; border-bottom: 2px solid transparent;
  border-radius: 0; font-size: 13.5px; font-weight: 600; padding: 9px 12px; margin-bottom: -1px; }
.kd-tab:hover { background: none; color: var(--ink); }
.kd-tab.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }
.kd-cnt { font-family: var(--font-mono); font-size: 11px; color: var(--faint); }
.kd-tab.active .kd-cnt { color: var(--accent); }
.kd-body { padding-top: 14px; }

.kd-act { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.kd-act button { font-size: 12.5px; padding: 7px 12px; }
.kd-body .dz-empty + .kd-act { border-top: none; padding-top: 0; }
#konStats[hidden], #konTabs[hidden], #konRelated[hidden], .kd-new[hidden] { display: none; }

/* vyhledání příjemce v ISDS (compose datové zprávy) */
.dz-isds-btn { width: 100%; margin-top: 8px; font-size: 12.5px; }
.dz-isds { font-size: 10px; font-weight: 700; color: var(--accent-dark); background: var(--accent-soft);
  border-radius: 999px; padding: 1px 7px; margin-left: 8px; }
.dz-toaddr { display: block; width: 100%; font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* hodiny v hlavičce */
.hdr-clock { margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hdr-clock .hdr-time { color: var(--ink); font-weight: 600; }
header #who { margin-left: 0; padding-left: 14px; border-left: 1px solid var(--line); }
@media (max-width: 700px) { .hdr-clock .hdr-date { display: none; } }
.sup-ares { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.sup-ares .set-f { width: 200px; margin-bottom: 0; }

/* ===== Vyhledávací pole s křížkem pro smazání ===== */
.srch { position: relative; display: inline-flex; align-items: center; }
.srch > input { width: 100%; padding-right: 30px; }
.srch-x { position: absolute; right: 6px; display: none; align-items: center; justify-content: center;
  width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
  background: var(--line); color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer; }
.srch.has .srch-x { display: inline-flex; }
.srch-x:hover { background: var(--accent); color: #fff; }
.srch.kon-search { width: 340px; max-width: 100%; }
.srch.kon-search > input { margin: 0; }
.mod-toolbar .srch.kon-search { margin: 0; }
.srch .cb-search { margin-bottom: 0; }
.cb-menu .srch { width: 100%; margin-bottom: 6px; }

/* ===== Modal Nápověda ===== */
.help-modal { display: flex; flex-direction: column; width: min(860px, 94vw); max-height: 88vh;
  background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.help-modal .fp-head a.fp-btn { text-decoration: none; }
.help-body { padding: 26px 30px 34px; overflow-y: auto; }
.help-body .help { max-width: none; }

/* ===== Modul Banka ===== */
.bk-amt { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.bk-amt.in { color: var(--success); }
.bk-amt.out { color: var(--ink); }
.dz-detail-head .bk-amt { font-size: 20px; }

.bk-cand { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); }
.bk-cand-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bk-cand-side { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.bk-cand-side button { font-size: 12.5px; padding: 6px 12px; margin-left: auto; }
.bk-score { font-size: 11.5px; font-weight: 700; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.bk-why { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.bk-chip { font-size: 11px; color: var(--muted); background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.bk-receipt { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  background: var(--surface-alt); }
.bk-receipt .set-f { margin-bottom: 10px; }

/* ===== Přihlášení / registrace firmy ===== */
.center { max-width: 420px; }
.lg-brand { display: flex; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--font-head); font-weight: 900; letter-spacing: .04em; font-size: 22px;
  margin-bottom: 18px; }
.lg-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.lg-tab { flex: 1; background: none; color: var(--muted); border: none; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 14px;
  padding: 10px 8px; }
.lg-tab:hover { background: none; color: var(--ink); }
.lg-tab.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }
.lg-hint { margin-bottom: 8px; }
.lg-ico { display: flex; gap: 8px; align-items: center; }
.lg-ico input { margin: 6px 0; }
.lg-ico button { white-space: nowrap; }
.lg-found { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 8px 0; font-size: 13px; }
.lg-found[hidden] { display: none; }
.lg-found-name { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.lg-noico { display: block; margin: 6px 0 12px; font-size: 13px; }
.lg-check { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 4px 0 14px;
  font-size: 13.5px; color: var(--ink); }
.lg-check input { width: auto; margin: 0; }
.lg-done { background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; margin-top: 14px;
  font-size: 14px; line-height: 1.6; }
.lg-done[hidden] { display: none; }
.lg-done p { margin: 6px 0 0; }
.lg-ok { color: var(--success); font-size: 13.5px; font-weight: 600; min-height: 18px; }
/* správa uživatelů firmy (Nastavení) */
.su-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.su-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; font-size: 13px;
  background: var(--surface-alt); border-radius: 8px; }
.su-mail { flex: 1; font-weight: 500; }
.su-role { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--faint); }
.su-new { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; align-items: center; }
.su-new input, .su-new select { margin: 0; font-size: 13px; }
.su-new button { white-space: nowrap; font-size: 13px; }
@media (max-width: 560px) { .su-new { grid-template-columns: 1fr; } }

/* ===== Vstupní obrazovka (přihlášení / registrace) ===== */
/* Formulář vlevo, brand vpravo (přání uživatele) — pořadí řeší `order`, markup zůstal. */
.auth { display: grid; grid-template-columns: 1fr 1.05fr; min-height: 100vh; }
.auth[hidden] { display: none; }
.auth__pane { order: 1; }
.auth__brand { order: 2; }

/* levý panel — brand */
.auth__brand { position: relative; overflow: hidden; background: var(--brand-dark); color: #fff;
  display: flex; align-items: center; padding: 56px; }
.auth__brand::before { content: ""; position: absolute; inset: -30% -30% 40% 40%;
  background: radial-gradient(closest-side, rgba(224, 41, 46, .38), transparent 70%); }
.auth__brand::after { content: ""; position: absolute; left: -18%; bottom: -22%;
  width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(224, 41, 46, .22), transparent 72%); }
.auth__brand-in { position: relative; max-width: 460px; }
.auth__logo { display: inline-flex; align-items: center; text-decoration: none; color: #fff;
  font-family: var(--font-head); font-weight: 900; letter-spacing: .05em; font-size: 17px;
  margin-bottom: 40px; }
.auth__claim { font-family: var(--font-head); font-weight: 900; font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.08; letter-spacing: -.02em; color: #fff; margin: 0 0 18px; }
.auth__claim-accent { color: var(--accent); }
.auth__sub { color: rgba(255, 255, 255, .72); font-size: 16px; margin: 0 0 30px; max-width: 42ch; }
.auth__list { list-style: none; margin: 0 0 34px; padding: 0; display: flex; flex-direction: column;
  gap: 14px; }
.auth__list li { display: flex; align-items: flex-start; gap: 12px; font-size: 14.5px;
  color: rgba(255, 255, 255, .78); line-height: 1.5; }
.auth__list b { color: #fff; font-weight: 600; }
.auth__list svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.auth__note { font-size: 12.5px; color: rgba(255, 255, 255, .45); margin: 0;
  letter-spacing: .02em; }

/* pravý panel — formulář */
.auth__pane { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; padding: 48px 24px; background: var(--bg); }
.auth__card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow); padding: 30px 30px 26px; }
.auth__h { font-size: 22px; font-weight: 800; margin: 22px 0 4px; }
.auth__lead { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.auth__f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted);
  margin-bottom: 14px; }
.auth__f[hidden] { display: none; }        /* jinak by [hidden] přebil display:flex */
.auth__f input { width: 100%; margin: 0; padding: 11px 13px; }
.auth__f .muted { font-weight: 400; }
.auth__btn { width: 100%; padding: 13px 16px; font-size: 15px; margin-top: 4px; }
.auth__switch { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.auth__switch .link { font-weight: 600; }
.auth__foot { font-size: 12.5px; color: var(--faint); margin: 0; text-align: center; }
.auth__hugo { white-space: nowrap; }

/* registrace uvnitř karty */
.lg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.lg-tab { flex: 1; background: none; color: var(--muted); border: none; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 14px;
  padding: 10px 8px; }
.lg-tab:hover { background: none; color: var(--ink); }
.lg-tab.active { background: none; color: var(--ink); border-bottom-color: var(--accent); }
.lg-ico { display: flex; gap: 8px; }
.lg-ico input { flex: 1; }
.lg-ico button { white-space: nowrap; padding: 11px 16px; }
.lg-found { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 13px; }
.lg-found[hidden] { display: none; }
.lg-found-name { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.lg-noico { display: block; margin: -4px 0 16px; font-size: 12.5px; }
.lg-check { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 2px 0 16px;
  font-size: 13.5px; color: var(--ink); }
.lg-check input { width: auto; margin: 0; }
.lg-done { background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; margin-top: 14px;
  font-size: 13.5px; line-height: 1.6; }
.lg-done[hidden] { display: none; }
.lg-done p { margin: 6px 0 0; }
.lg-ok { color: var(--success); font-size: 13px; font-weight: 600; min-height: 18px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { order: 1; }                        /* na mobilu brand nahoře, formulář pod ním */
  .auth__pane { order: 2; }
  .auth__brand { padding: 40px 24px 32px; }
  .auth__list, .auth__note { display: none; }        /* na mobilu jen claim, ať je formulář hned vidět */
  .auth__claim { font-size: 28px; margin-bottom: 10px; }
  .auth__sub { margin-bottom: 0; font-size: 14.5px; }
  .auth__logo { margin-bottom: 22px; }
  .auth__pane { padding: 28px 20px 40px; }
}

/* demo přístup na přihlašovací kartě */
.auth__demo { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.auth__demo-h { font-family: var(--font-head); font-weight: 800; font-size: 14px; color: var(--ink);
  margin-bottom: 4px; }
.auth__demo p { font-size: 13px; color: var(--muted); margin: 0 0 10px; line-height: 1.55; }
.auth__demo-creds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.auth__demo-creds span { font-family: var(--font-mono); font-size: 12px; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 6px; padding: 3px 9px; }
.auth__demo-btn { width: 100%; font-size: 13.5px; padding: 10px 14px; }
