/* MDM konzole: návrhový systém. Tokeny → základ → komponenty → stránky. Bez externích závislostí. */

/* ---- Tokeny ------------------------------------------------------------ */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-hover: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cdd2da;
  --text: #15181e;
  --text-2: #444b57;
  --muted: #6b7380;
  --accent: #2557d6;
  --accent-hover: #1d47b3;
  --accent-soft: #e9efff;
  --accent-text: #ffffff;
  --ok: #138a4a;      --ok-soft: #e4f6ec;
  --warn: #a95f00;    --warn-soft: #fdf1dc;
  --danger: #c9302c;  --danger-soft: #fdeceb;
  --neutral-soft: #eceff3;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05);
  --shadow-md: 0 8px 24px rgb(16 24 40 / .12);
  --pad: 18px;
  --radius: 6px;
  --radius-lg: 8px;
  --sb-w: 232px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0f13;
  --surface: #14171c;
  --surface-2: #181b21;
  --surface-hover: #1e2229;
  --border: #272c34;
  --border-strong: #363c46;
  --text: #e8eaee;
  --text-2: #b8bec8;
  --muted: #8a93a1;
  --accent: #6b93ff;
  --accent-hover: #86a5ff;
  --accent-soft: #1b2744;
  --accent-text: #0b1020;
  --ok: #4cc68a;      --ok-soft: #12291d;
  --warn: #e6a64c;    --warn-soft: #2d2210;
  --danger: #ff7a76;  --danger-soft: #331816;
  --neutral-soft: #20242b;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 8px 24px rgb(0 0 0 / .55);
  color-scheme: dark;
}
:root[data-sidebar="collapsed"] { --sb-w: 56px; }

/* ---- Základ ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 13px/1.5 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
p { margin: 0 0 .6em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12px; }
code { background: var(--neutral-soft); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--neutral-soft); padding: 10px 12px; border-radius: var(--radius); overflow-x: auto; margin: 6px 0; }
pre code { background: none; padding: 0; }
small { font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.error { color: var(--danger); }
.nowrap { white-space: nowrap; }
.i { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Rozvržení --------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .15s ease; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); padding: 10px 8px; overflow: hidden auto; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { margin: 14px 8px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.nav-group:first-child { margin-top: 0; }
.nav a, .side-btn {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; border-radius: var(--radius);
  color: var(--text-2); font-weight: 500; white-space: nowrap; border: 0; background: none; font: inherit; font-weight: 500; width: 100%; cursor: pointer; text-align: left;
}
.nav a:hover, .side-btn:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; color: var(--muted); }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.side-foot form { margin: 0; }
:root[data-sidebar="collapsed"] .label, :root[data-sidebar="collapsed"] .nav-group span { display: none; }
:root[data-sidebar="collapsed"] .nav-group { height: 1px; margin: 10px 8px; background: var(--border); font-size: 0; }
:root[data-sidebar="collapsed"] .nav a, :root[data-sidebar="collapsed"] .side-btn { justify-content: center; padding: 0; }
:root[data-sidebar="collapsed"] .nav-count { display: none; }
:root[data-sidebar="collapsed"] .brand { padding-inline: 4px; justify-content: center; }
:root[data-sidebar="collapsed"] [data-sidebar-toggle] .i { transform: scaleX(-1); }
:root:not([data-theme="dark"]) .theme-moon, :root[data-theme="dark"] .theme-sun { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; gap: 10px; height: 48px; padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.content { padding: 20px 24px 48px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); margin-top: 2px; max-width: 78ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.scrim { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-md); }
  :root[data-sidebar="collapsed"] .label, :root[data-sidebar="collapsed"] .nav-group span { display: revert; }
  :root[data-sidebar="collapsed"] .nav-group { height: auto; background: none; font-size: 11px; margin: 14px 8px 4px; }
  :root[data-sidebar="collapsed"] .nav a, :root[data-sidebar="collapsed"] .side-btn { justify-content: flex-start; padding: 0 8px; }
  :root[data-sidebar="collapsed"] .nav-count { display: revert; }
  [data-sidebar-toggle] { display: none !important; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 35; }
  .topbar { display: flex; }
  .content { padding: 16px 12px 40px; }
}

/* ---- Tlačítka ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; line-height: 1; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .1s, border-color .1s;
}
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.92); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; }
.btn-icon { width: 30px; padding: 0; }
.btn-sm.btn-icon { width: 26px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }
.stack-forms form { margin: 0; }

/* ---- Formuláře --------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > span, .field > .lbl { font-weight: 500; color: var(--text-2); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: -6px 0 12px; }
.field .hint { margin: 0; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; min-height: 30px; padding: 5px 9px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color .1s, box-shadow .1s;
}
textarea { resize: vertical; line-height: 1.45; }
textarea.code { font-family: var(--mono); font-size: 12px; min-height: 28rem; tab-size: 2; }
select { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=file] { font: inherit; color: var(--text-2); }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; margin-right: 10px; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: none; }
.check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; cursor: pointer; }
.check input { margin-top: 2px; }
.check + .hint { margin-top: -4px; padding-left: 23px; }
.grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group > :first-child { flex: 1; }
.input-group .field { margin: 0; flex: 1; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---- Karty a sekce ----------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 16px; min-width: 0; }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--pad); border-bottom: 1px solid var(--border); min-height: 46px; }
.card > header h2, .card > header h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.card > header .i { color: var(--muted); }
.card .body { padding: var(--pad); }
.card > footer, .card > form > footer { padding: 12px var(--pad); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.card.flush .body { padding: 0; }
/* oddělení od předchozího obsahu */
.card.danger-zone { margin-top: 28px; border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.card.danger-zone > header h2 { color: var(--danger); }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.cols > .card { margin: 0; }
.masonry { margin-bottom: 16px; display: block; column-width: 340px; column-gap: 16px; }
.masonry > .card { break-inside: avoid; margin: 0 0 16px; }
.split { display: grid; gap: 20px; grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
.split-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; }
.split-nav a { padding: 5px 10px; border-radius: var(--radius); color: var(--text-2); font-weight: 500; }
.split-nav a:hover { background: var(--surface-hover); text-decoration: none; }
.split-nav a.active { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 960px) { .split { grid-template-columns: minmax(0, 1fr); } .split-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.section-anchor { scroll-margin-top: 16px; }
.fields { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fcell { min-width: 0; }
.fcell .hint { margin-top: -6px; }
.fcell .check + .hint { margin-top: -4px; }
.span-all { grid-column: 1 / -1; }
.savebar { position: sticky; bottom: 12px; z-index: 10; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.form-page { max-width: 880px; }

/* Klíč–hodnota */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); margin: 0; }
.kv dt, .kv dd { margin: 0; padding: 7px var(--pad); border-top: 1px solid var(--border); min-width: 0; overflow-wrap: anywhere; }
.kv dt { color: var(--muted); }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }

/* ---- Štítky stavu ------------------------------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--neutral-soft); color: var(--text-2); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-muted { background: var(--neutral-soft); color: var(--muted); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---- Tabulky ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-hover); }
.table tr[data-href] { cursor: pointer; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.table .sub { color: var(--muted); font-size: 12px; }
.table td.break { overflow-wrap: anywhere; min-width: 160px; }
.card.flush > .table-wrap { border-radius: inherit; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px var(--pad); border-bottom: 1px solid var(--border); }
.search { position: relative; flex: 1 1 220px; max-width: 340px; }
.search .i { position: absolute; left: 9px; top: 8px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 30px !important; }
.seg { max-width: 100%; overflow-x: auto; display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg button { height: 28px; padding: 0 10px; border: 0; border-right: 1px solid var(--border); background: none; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-hover); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.seg .n { color: var(--muted); font-weight: 400; margin-left: 4px; }
.toolbar .grow { flex: 1; }
.meter { display: inline-block; width: 34px; height: 5px; border-radius: 3px; background: var(--neutral-soft); vertical-align: middle; margin-right: 6px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--ok); }
.meter.low > i { background: var(--danger); }
.meter.mid > i { background: var(--warn); }

/* ---- Statistiky -------------------------------------------------------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; box-shadow: var(--shadow-sm); color: var(--text); }
a.stat:hover { border-color: var(--border-strong); text-decoration: none; background: var(--surface-hover); }
.stat .k { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 400; }
.stat.is-ok .v { color: var(--ok); }
.stat.is-danger .v { color: var(--danger); }

/* ---- Hlášky ------------------------------------------------------------ */
.alert { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border: 1px solid var(--border); border-left-width: 3px; border-radius: var(--radius); background: var(--surface); margin-bottom: 16px; }
.alert > .i { margin-top: 2px; }
.alert-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); border-left-color: var(--danger); background: var(--danger-soft); }
.alert-danger > .i { color: var(--danger); }
.alert-warn { border-left-color: var(--warn); background: var(--warn-soft); }
.alert-info { border-left-color: var(--accent); background: var(--accent-soft); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-body { min-width: 0; }
.alert summary { cursor: pointer; }
.toasts { position: fixed; top: 14px; right: 14px; z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 28px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--ok); border-radius: var(--radius); box-shadow: var(--shadow-md); animation: toast-in .18s ease; }
.toast.error { border-left-color: var(--danger); color: var(--text); }
.toast > .i { margin-top: 2px; color: var(--ok); }
.toast.error > .i { color: var(--danger); }
.toast .msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

/* ---- Záložky, menu, dialogy ------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow: auto hidden; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .n { font-size: 11px; background: var(--neutral-soft); color: var(--muted); padding: 0 6px; border-radius: 8px; }

.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 280px; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 4px; }
.menu-list form { margin: 0; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 9px; border: 0; border-radius: var(--radius); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--surface-hover); }
.menu-item .i { color: var(--muted); }
.menu-item.danger, .menu-item.danger .i { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }

dialog { padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; }
dialog::backdrop { background: rgb(8 10 14 / .55); }
dialog[open] { animation: toast-in .14s ease; }
dialog form { margin: 0; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.dlg-head h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dlg-body { padding: 12px 20px 6px; }
.dlg-body .hint { margin-top: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); margin-top: 8px; }
dialog.danger .dlg-head h2 { color: var(--danger); }

/* ---- Přihlášení a samostatné stránky ----------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-box { width: min(420px, 100%); }
.auth-box.wide { width: min(520px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; font-size: 16px; font-weight: 700; }
.auth-box .card .body { padding: 18px; }
.auth-box h1 { font-size: 17px; margin-bottom: 4px; }
.auth-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.auth-actions .btn { height: 34px; }
.auth .toasts { position: static; width: 100%; margin-bottom: 12px; }

/* ---- Konkrétní stránky ------------------------------------------------- */
.qr { display: inline-block; line-height: 0; padding: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.qr svg { width: 260px; height: 260px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.steps li::marker { color: var(--muted); font-weight: 600; }
.enroll-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 960px) { .enroll-grid { grid-template-columns: minmax(0, 1fr); } }
.device-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.label-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; max-width: 900px; }
.label-form input { flex: 1 1 140px; width: auto; min-width: 0; }
.label-form input { min-height: 28px !important; }
.attention li { display: flex; align-items: center; gap: 10px; padding: 10px var(--pad); border-top: 1px solid var(--border); }
.attention li:first-child { border-top: 0; }
.attention ul { list-style: none; margin: 0; padding: 0; }
.attention .grow { flex: 1; min-width: 0; }
.attention .grow small { display: block; color: var(--muted); }
.empty-state { color: var(--muted); padding: 28px 14px; text-align: center; }
.remote { display: grid; grid-template-columns: minmax(0, 400px) minmax(240px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .remote { grid-template-columns: minmax(0, 1fr); } }
.screen-wrap { position: relative; }
#screen { display: block; width: 100%; height: auto; background: #0b0d11; border-radius: 14px; border: 1px solid var(--border-strong); touch-action: none; cursor: crosshair; user-select: none; }
.skeleton { position: absolute; inset: 0; border-radius: 14px; background: linear-gradient(100deg, #151922 30%, #232a37 50%, #151922 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.idle { animation: none; opacity: .85; }
.skeleton[hidden], .spinner[hidden] { display: none; }
.spinner { flex: none; width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .skeleton, .spinner { animation-duration: 4s; } }
.live { display: inline-flex; align-items: center; gap: 6px; }
.apps-list { max-height: 480px; overflow: auto; }
.pol-row select { min-width: 150px; }
.source-url { max-width: 320px; overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

@media print { .sidebar, .topbar, .toasts, .page-actions { display: none !important; } .shell { display: block; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.table th:first-child, .table td:first-child { padding-left: var(--pad); }
.table th:last-child, .table td:last-child { padding-right: var(--pad); }
.card > .btn-row, .alert .btn { flex: none; }

/* Mapa historie polohy (Leaflet); isolation drží jeho vrstvy pod nabídkami konzole. */
.loc-map { height: 440px; border-radius: var(--radius, 8px); border: 1px solid var(--border); isolation: isolate; background: var(--surface-2, transparent); }
.loc-map .leaflet-container { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Seznam vlevo, detail vpravo (kontakty, SMS) a seznam hovorů. */
.master { display: grid; gap: 16px; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); align-items: start; }
.master-list { display: flex; flex-direction: column; max-height: 75vh; overflow-y: auto; }
.master-item { display: flex; flex-direction: column; gap: 2px; padding: 9px 14px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer; }
.master-item:hover { background: var(--surface-hover); }
.master-item[aria-selected="true"] { background: var(--accent-soft); }
.master-item .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.master-detail { padding: var(--pad); min-height: 200px; max-height: 75vh; overflow-y: auto; }
.master-detail header { display: flex; gap: 10px; align-items: baseline; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--border); }
.msg-mine { align-self: flex-end; background: var(--accent-soft); }
.msg-head { font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.call { display: grid; grid-template-columns: 140px minmax(0, 1fr) 130px 60px; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.call-len { text-align: right; }
@media (max-width: 860px) { .master { grid-template-columns: minmax(0, 1fr); } .master-list { max-height: 40vh; } .call { grid-template-columns: 1fr auto; } }
