/* Hlídač SVJ – základní vzhled, den / noc */

:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --text: #1c2330;
    --muted: #667085;
    --border: #e3e6eb;
    --primary: #2563eb;
    --primary-text: #ffffff;
    --po: #d92d20;       --po-bg: #fde8e7;
    --blizi: #b54708;    --blizi-bg: #fef0c7;
    --ok: #067647;       --ok-bg: #dcfae6;
    --none: #98a2b3;     --none-bg: #eef0f3;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f141b; --surface: #171d26; --surface-2: #1f2732; --text: #e6e9ef; --muted: #98a2b3;
        --border: #2a3441; --primary: #4f8cff; --primary-text: #0b1220;
        --po: #ff7a70; --po-bg: #3b1715; --blizi: #fdb022; --blizi-bg: #3a2a0c;
        --ok: #47cd89; --ok-bg: #0f2e1f; --none: #7d8898; --none-bg: #232b36;
        --shadow: none; color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0f141b; --surface: #171d26; --surface-2: #1f2732; --text: #e6e9ef; --muted: #98a2b3;
    --border: #2a3441; --primary: #4f8cff; --primary-text: #0b1220;
    --po: #ff7a70; --po-bg: #3b1715; --blizi: #fdb022; --blizi-bg: #3a2a0c;
    --ok: #47cd89; --ok-bg: #0f2e1f; --none: #7d8898; --none-bg: #232b36;
    --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg); color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small, small { font-size: .85em; }

/* Horní lišta */
.topbar {
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
    padding: .6rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.mainnav { display: flex; gap: 1rem; }
.mainnav a { color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.user-link { color: var(--text); font-weight: 500; }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px;
    border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer;
}
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .i-sun { display: none; }
    :root:not([data-theme="light"]) .i-moon { display: block; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head p { margin: 0; }

/* Karty a mřížka */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card.narrow { max-width: 480px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 2rem 1rem; }
.empty.small { padding: 1rem; }

/* Statistiky */
.stats { display: flex; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.stat {
    flex: 1 1 140px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .8rem 1rem; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.stat-num { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }
.stat-po .stat-num { color: var(--po); }
.stat-blizi .stat-num { color: var(--blizi); }

/* Seznam domů */
.house-list { display: flex; flex-direction: column; gap: .6rem; }
.house { display: flex; align-items: center; gap: .9rem; margin: 0; color: var(--text); }
.house:hover { text-decoration: none; border-color: var(--primary); }
.house-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.house-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot-po { background: var(--po); } .dot-blizi { background: var(--blizi); }
.dot-ok { background: var(--ok); } .dot-none { background: var(--none); }

/* Štítky */
.badge {
    display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: var(--none-bg); color: var(--none); white-space: nowrap;
}
.badge-po { background: var(--po-bg); color: var(--po); }
.badge-blizi { background: var(--blizi-bg); color: var(--blizi); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }

/* Záložky */
.tabs { display: flex; flex-wrap: wrap; gap: 0 .1rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; }
.tabs a { padding: .55rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Tabulky */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.table tr:last-child td { border-bottom: 0; }
.actions { white-space: nowrap; text-align: right; }

/* Definiční seznam */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
@media (max-width: 560px) { .dl { grid-template-columns: 1fr; } .dl dd { margin-bottom: .5rem; } }

/* Formuláře */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
.form .row > label, .form-inline > label { flex: 1 1 180px; }
.form .row { display: flex; gap: .8rem; flex-wrap: wrap; }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
input, select, textarea {
    font: inherit; color: var(--text); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 8px; padding: .5rem .65rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
input[disabled] { opacity: .7; }
form.inline { display: inline; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .5rem 1rem; border-radius: 8px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; align-self: flex-start;
}
.btn:hover { text-decoration: none; border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-small { padding: .25rem .6rem; font-size: .85rem; }
.btn-link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0 .25rem; }
.btn-link.danger { color: var(--po); }

/* Rozbalovací formulář v tabulce */
.popover { display: inline-block; position: relative; }
.popover summary { list-style: none; }
.popover summary::-webkit-details-marker { display: none; }
.popover-body {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 300px; text-align: left;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

/* Hlášky */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--po-bg); color: var(--po); }
.flash-info { background: var(--blizi-bg); color: var(--blizi); }

.auth-box { max-width: 400px; margin: 3rem auto; }

/* Zaškrtávací seznamy */
.checks { border: 1px solid var(--border); border-radius: 8px; padding: .6rem .9rem .8rem; margin: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem 1rem; }
.checks legend { padding: 0 .3rem; font-size: .9rem; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); font-size: .92rem; }
.check input { width: auto; margin: 0; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.navrh { margin-top: .5rem; border-top: 1px solid var(--border); }

/* Hlídací přehled */
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.section-title { margin: 1.5rem 0 .75rem; }
.stat-none .stat-num { color: var(--none); }
.stat-ok .stat-num { color: var(--ok); }
.c-po { color: var(--po); } .c-blizi { color: var(--blizi); } .c-ok { color: var(--ok); }
.num { text-align: right; white-space: nowrap; }
.table th.num { text-align: right; }

.toolbar { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .75rem; align-items: center; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { font: inherit; font-size: .88rem; padding: .35rem .85rem; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.search { max-width: 280px; }

.dum-link { display: flex; gap: .7rem; align-items: center; color: var(--text); }
.dum-link:hover { text-decoration: none; }
.dum-link:hover strong { color: var(--primary); }
.table-domy td { vertical-align: middle; }

.matrix th.rot { vertical-align: bottom; height: 150px; padding: 0 .2rem .5rem; min-width: 64px; }
.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-transform: none;
    letter-spacing: 0; font-size: .8rem; max-height: 140px; overflow: hidden; text-overflow: ellipsis; }
.matrix td { vertical-align: middle; white-space: nowrap; }
.matrix .cell { text-align: center; font-size: .78rem; font-weight: 600; border: 2px solid var(--surface); border-radius: 6px; padding: .45rem .25rem; }
.cell-po { background: var(--po-bg); color: var(--po); }
.cell-blizi { background: var(--blizi-bg); color: var(--blizi); }
.cell-ok { background: var(--ok-bg); color: var(--ok); }
.cell-none { background: var(--none-bg); color: var(--none); }
.cell-empty { color: var(--border); }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: .75rem 0 0; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border); }
tr.hidden { display: none; }

/* Jednotky */
.owner { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .1rem 0; }
.popover-body .row { gap: .5rem; }

/* Import z LV */
.lv-table input[type=text], .lv-table select { padding: .3rem .45rem; font-size: .9rem; }
.lv-table input[type=checkbox] { width: auto; }
.lv-table input.missing { border-color: var(--blizi); background: var(--blizi-bg); }
details > summary { cursor: pointer; }

/* Dokumenty u revizí */
.tag { display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-2);
    border: 1px solid var(--border); color: var(--text); margin: .25rem .25rem 0 0; }
.tag:hover { text-decoration: none; border-color: var(--primary); }
.rev-docs { margin-top: .2rem; }
.revize-extra { border: 1px dashed var(--border); border-radius: 8px; padding: .6rem .8rem; }

/* Technici */
.input-btn { display: flex; gap: .4rem; }
.input-btn input { flex: 1; }
tr.inactive td { opacity: .55; }

/* Stav revizí v detailu domu */
.rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.rev-card { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; border-radius: 8px; border: 1px solid var(--border); color: inherit; }
.rev-card:hover { text-decoration: none; border-color: var(--primary); }
.rev-name { font-weight: 600; font-size: .9rem; color: var(--text); }
.rev-date { font-size: 1.05rem; font-weight: 700; }
.rev-meta { font-size: .78rem; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Zpráva o stavu domu */
.report { max-width: 900px; margin: 0 auto; }
.report-actions { display: flex; gap: .5rem; margin-bottom: 1rem; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--text); padding-bottom: .75rem; margin-bottom: 1rem; gap: 1rem; }
.report-head p { margin: .25rem 0 0; }
.report-date { font-weight: 600; white-space: nowrap; }
.report section { margin-bottom: 1.5rem; }
.report-summary { margin: 0; padding-left: 1.2rem; }
.report-foot { font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: .5rem; }

@media print {
    :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; --muted: #444; --border: #bbb; color-scheme: light; }
    .topbar, .footer, .no-print, .flash { display: none !important; }
    body { background: #fff; font-size: 11pt; }
    .container { padding: 0; max-width: none; }
    .table th, .table td { padding: .3rem .4rem; }
    .badge { border: 1px solid #999; }
    section { break-inside: avoid-page; }
    a { color: #000; text-decoration: none; }
}

/* ===== v1.0 moduly ===== */
.popover-wide { width: 560px; max-width: 90vw; }
.month-row td { background: var(--surface-2); font-weight: 700; font-size: .85rem; text-transform: capitalize; }
.row-selected td { background: var(--ok-bg); }
.oznameni-item { border-bottom: 1px solid var(--border); padding: .7rem 0; }
.oznameni-item:last-child { border-bottom: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.odecet-bar { align-items: flex-end; justify-content: flex-end; margin-top: .75rem; gap: .75rem; }
.odecet-bar label { flex: 0 0 180px; }
.odecet-input { width: 110px; }

/* hlasování */
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); margin-bottom: .25rem; }
.bar span { display: block; height: 100%; }
.bar-ok { background: var(--ok); } .bar-po { background: var(--po); } .bar-none { background: var(--none); }
fieldset.vote { border: 1px solid var(--border); border-radius: 8px; padding: .5rem .9rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
fieldset.vote legend { font-weight: 600; padding: 0 .3rem; }
.vote-grid select { padding: .2rem .3rem; font-size: .85rem; min-width: 90px; }
.vote-pro { background: var(--ok-bg); } .vote-proti { background: var(--po-bg); } .vote-zdrzel { background: var(--none-bg); }
.print-grid td, .print-grid th { border: 1px solid var(--border); }
.ballot { page-break-after: always; margin-bottom: 2rem; }

/* veřejná stránka a plakát */
.public-page { max-width: 640px; margin: 0 auto; }
.havarie { border-color: var(--po); }
.havarie h2 { color: var(--po); }
.havarie-text { font-size: 1.05rem; line-height: 1.6; margin-bottom: .75rem; }
.poster { max-width: 700px; margin: 0 auto; text-align: center; padding: 2rem; border: 3px solid var(--text); border-radius: 16px; background: var(--surface); }
.poster h1 { font-size: 2.6rem; margin-bottom: .25rem; }
.poster-sub { font-size: 1.3rem; }
.poster-qr { width: 320px; height: 320px; margin: 1.5rem auto; background: #fff; padding: 8px; border-radius: 8px; }
.poster-qr svg { width: 100%; height: 100%; }
.poster-url { font-size: .8rem; word-break: break-all; color: var(--muted); }
.poster-havarie { font-size: 1.2rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 2px dashed var(--border); }
.poster-foot { margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }

/* plán oprav */
.fond-chart { display: flex; gap: .5rem; align-items: stretch; height: 220px; padding-top: .5rem; }
.fond-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.fond-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.fond-bar { width: 38%; border-radius: 4px 4px 0 0; min-height: 2px; }
.fond-bar.pos, .sw.fond-pos { background: var(--ok); }
.fond-bar.neg, .sw.fond-neg { background: var(--po); }
.fond-bar.exp, .sw.fond-exp { background: var(--blizi); }
.fond-val { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.fond-year { font-size: .8rem; font-weight: 600; }

@media print {
    .poster { border-width: 4px; }
    .ballot { page-break-after: always; }
}

/* ===== pozvánka (v1.1) ===== */
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.poz-wrap { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 1.25rem; align-items: start; }
.poz-form h2 { font-size: 1rem; margin: .75rem 0 .25rem; }
.poz-form h2:first-of-type { margin-top: 0; }
.poz-preview { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.poz-sheet {
    background: #fff; color: #000; color-scheme: light;
    width: 100%; max-width: 210mm; min-height: 270mm; margin: 0 auto; padding: 16mm 18mm;
    box-shadow: 0 2px 14px rgba(0,0,0,.18); border-radius: 2px;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-style: italic; font-size: 10.5pt; line-height: 1.35;
    display: flex; flex-direction: column;
}
.poz-sheet strong { font-weight: 700; }
.poz-hlavicka { font-weight: 700; font-size: 13.5pt; margin-bottom: 1.1em; }
.poz-sidlo { text-align: center; font-size: 8pt; margin-bottom: 2.4em; }
.poz-titul span { letter-spacing: .35em; }
.poz-titul { text-align: center; font-size: 17pt; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; margin: 0 0 1.2em; }
.poz-uvod { margin: 0 0 2em; }
.poz-program ol { margin: .1em 0 0; padding: 0 0 .15em 0; list-style: none; counter-reset: bod; border-bottom: 1px solid #000; margin-left: 5%; }
.poz-program li { counter-increment: bod; display: flex; gap: 0; }
.poz-program li::before { content: counter(bod) ")"; flex: 0 0 4.2em; text-align: right; padding-right: 3em; box-sizing: content-box; }
.poz-zaver { font-size: 8.5pt; margin: 4em 0 1.6em; }
.poz-datum { margin: 0 0 2em; }
.poz-podpis { margin: 1em 0 0 55%; text-align: center; }
.poz-pata { margin-top: auto; padding-top: 3em; text-align: center; font-weight: 700; font-size: 8.5pt; }
@media (max-width: 1000px) {
    .poz-wrap { grid-template-columns: 1fr; }
    .poz-sheet { padding: 8mm; min-height: 0; }
}
@media print {
    .poz-wrap { display: block; }
    .poz-sheet { box-shadow: none; padding: 0; max-width: none; min-height: 263mm; border-radius: 0; }
    .poz-sheet + .poz-sheet { break-before: page; }
    .poz-preview { gap: 0; }
}

/* ===== plná moc (v1.2) ===== */
.pm-sheet { font-size: 11pt; line-height: 1.45; }
.pm-titul { text-align: center; font-size: 17pt; font-weight: 700; margin: 1.2em 0 2.4em; }
.pm-titul span, .pm-zmocnuji span { letter-spacing: .4em; }
.pm-radek { margin: 0 0 2.1em; }
.pm-fill { display: inline-block; border-bottom: 1px dotted #000; height: 1.15em; vertical-align: baseline; }
.pm-val { height: auto; padding: 0 .3em; font-weight: 700; }
.pm-zmocnuji { text-align: center; font-weight: 700; font-size: 9.5pt; margin: 0 0 3em; }
.pm-text { text-align: justify; margin: 1.2em 0 2.8em; }
.pm-podpis { margin: 3.2em 0 0 42%; text-align: center; }
.pm-podpis span { display: block; border-bottom: 1px dotted #000; margin-bottom: .25em; }
.pm-prijimam { margin: 4.5em 0 0; }

/* kompaktní prezence */
.table-compact th, .table-compact td { padding: .25rem .5rem; font-size: .88rem; vertical-align: middle; }
.table-compact td.c, .table-compact th.c { width: 3.2rem; text-align: center; }
.table-compact label { cursor: pointer; margin: 0; display: inline; font-size: inherit; color: inherit; }
.table-compact input[type=text] { padding: .2rem .45rem; font-size: .85rem; height: auto; min-height: 0; }
.table-compact input[type=checkbox] { width: 1.05rem; height: 1.05rem; margin: 0; }
.prezence .card-head h2 small { font-weight: 400; font-size: .85rem; }
.prezence .card-head { margin-bottom: .4rem; }

/* ===== hlasovací listiny per rollam (v1.3) ===== */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg a { padding: .45rem .8rem; color: var(--muted); font-size: .9rem; }
.seg a.active { background: var(--primary); color: #fff; }
.pr-nastaveni summary { cursor: pointer; }
.pr-nastaveni form { margin-top: .75rem; }
.pr-cisla { display: flex; flex-wrap: wrap; gap: .75rem; }
.pr-cisla label { flex: 0 0 180px; }
.pr-preview { display: flex; flex-direction: column; gap: 1.25rem; }
.pr-sheet {
    background: #fff; color: #000; color-scheme: light; width: 100%; max-width: 297mm; margin: 0 auto; padding: 10mm;
    box-shadow: 0 2px 14px rgba(0,0,0,.18); font-family: "Century Gothic", Arial, Helvetica, sans-serif; font-style: italic; font-size: 9pt; line-height: 1.3;
}
.pr-box { border: 1px solid #000; text-align: center; }
.pr-head { padding: .5em 1em .6em; margin-bottom: 4px; }
.pr-t1 { font-weight: 700; font-size: 11.5pt; }
.pr-t1 span { letter-spacing: .38em; }
.pr-t2 { font-weight: 700; font-size: 11.5pt; }
.pr-svj { font-size: 10.5pt; padding: .45em 1em 1.6em; border-bottom: 3px double #000; }
.pr-bod { border: 1px solid #000; border-top: 0; text-align: center; font-weight: 700; padding: .5em 1.5em .3em; }
.pr-bod-c { margin-bottom: 1.3em; }
.pr-sheet .pr-table { width: 100%; border-collapse: collapse; margin-bottom: 1.2em; table-layout: fixed; }
.pr-table th, .pr-table td { border: 1px solid #000; padding: .35em .3em; text-align: center; vertical-align: middle; font-weight: 400; font-size: 8.5pt; }
.pr-table thead th { background: none; color: #000; text-transform: none; letter-spacing: 0; }
.pr-table td { height: 3.8em; }
.pr-table td.pr-clen { font-size: 8pt; }
.pr-bod + .pr-table + .pr-bod { border-top: 1px solid #000; }
@media print {
    .pr-sheet { box-shadow: none; padding: 0; max-width: none; }
    .pr-sheet + .pr-sheet { break-before: page; }
    .pr-preview { gap: 0; }
    .pr-table tr { break-inside: avoid; }
    .pr-table thead { display: table-header-group; }
}

/* ===== zápis (v1.4) ===== */
.zapis-sheet { min-height: 0; text-align: justify; font-size: 10.5pt; }
.zapis-titul { text-align: center; font-size: 15pt; font-weight: 700; margin: 0 0 .2em; }
.zapis-hlava { text-align: center; margin-bottom: 1.4em; }
.zapis-pritomni { margin: 0 0 1.2em; text-align: left; }
.zapis-program { margin-bottom: 1.4em; text-align: left; }
.zapis-program ol { margin-left: 0; }
.zapis-odstavec { margin: 0 0 1.1em; break-inside: avoid; }
.zapis-misto { margin: 1.6em 0 0; }
.zapis-podpisy { margin-top: 2.2em; display: flex; flex-direction: column; gap: 1.9em; break-inside: avoid; }
.zapis-podpis { display: grid; grid-template-columns: 9.5em 1fr 16em; align-items: end; gap: .6em; text-align: left; }
.zp-cara { border-top: 1px dotted #000; font-size: 7.5pt; text-align: center; padding-top: .15em; color: #444; }
mark.doplnit { background: #fde68a; color: inherit; padding: 0 .1em; }
.zapis-form textarea { font-size: .88rem; }
.zapis-odst { border-top: 1px solid var(--border); padding-top: .6rem; display: flex; flex-direction: column; gap: .35rem; }
.zapis-odst-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
.zapis-odst-head select { max-width: 55%; font-size: .8rem; padding: .2rem .35rem; }
@media print { mark.doplnit { background: none; } }

/* dokumenty k hlasování, přehled shromáždění (v1.5) */
.card-hint { border-color: var(--blizi, #d97706); }
.dok-upload { border-top: 1px solid var(--border); padding-top: .75rem; margin-top: .5rem; }
.shr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .75rem; }
.shr-item { border: 1px solid var(--border); border-radius: 10px; padding: .7rem .9rem; background: var(--surface-2); display: flex; flex-direction: column; gap: .15rem; color: inherit; }
.shr-item:hover { border-color: var(--primary); text-decoration: none; }
.shr-lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.shr-date { font-size: 1.15rem; font-weight: 700; }
.shr-meta { font-size: .82rem; color: var(--muted); }

/* =====================================================================
   v2.0 – nový vzhled: postranní menu, jemnější karty, den / noc podle zařízení
   ===================================================================== */
:root {
    --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f1f3f7; --surface-3: #e9edf3;
    --text: #141a24; --muted: #5f6b7d; --border: #e2e6ee; --border-strong: #cfd6e2;
    --primary: #2f5bea; --primary-text: #ffffff; --primary-soft: #e8eeff;
    --po: #d4271b; --po-bg: #fde8e6; --blizi: #b45309; --blizi-bg: #fff1d6;
    --ok: #0a7a47; --ok-bg: #dcf7e8; --none: #8a95a6; --none-bg: #eef0f4;
    --info: #1f62c9; --info-bg: #e3eeff;
    --radius: 14px; --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .05);
    --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
    --sidebar: #ffffff; --sidebar-text: #3b4658; --sidebar-active: #eef2ff;
    --sidebar-w: 248px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1117; --surface: #151b23; --surface-2: #1b222c; --surface-3: #232b37;
        --text: #e7ebf1; --muted: #9aa5b5; --border: #263040; --border-strong: #344155;
        --primary: #6c8cff; --primary-text: #0b1020; --primary-soft: #1d2747;
        --po: #ff7b72; --po-bg: #3a1714; --blizi: #f5b14a; --blizi-bg: #36270d;
        --ok: #4cd58f; --ok-bg: #0f2c1e; --none: #7e8a9b; --none-bg: #202835;
        --info: #79a8ff; --info-bg: #15264a;
        --shadow: none; --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
        --sidebar: #11161d; --sidebar-text: #b9c2cf; --sidebar-active: #1d2747;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0d1117; --surface: #151b23; --surface-2: #1b222c; --surface-3: #232b37;
    --text: #e7ebf1; --muted: #9aa5b5; --border: #263040; --border-strong: #344155;
    --primary: #6c8cff; --primary-text: #0b1020; --primary-soft: #1d2747;
    --po: #ff7b72; --po-bg: #3a1714; --blizi: #f5b14a; --blizi-bg: #36270d;
    --ok: #4cd58f; --ok-bg: #0f2c1e; --none: #7e8a9b; --none-bg: #202835;
    --info: #79a8ff; --info-bg: #15264a;
    --shadow: none; --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    --sidebar: #11161d; --sidebar-text: #b9c2cf; --sidebar-active: #1d2747;
    color-scheme: dark;
}

body { font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; letter-spacing: -.005em; }
.ic { flex: none; }

/* --- Rozložení s postranním menu --- */
.layout-app .main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 30; overflow-y: auto;
}
.sidebar .brand { padding: 1.05rem 1.1rem .9rem; font-size: 1.02rem; gap: .6rem; }
.brand-logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--primary); color: var(--primary-text); }
.nav { display: flex; flex-direction: column; gap: 1rem; padding: .25rem .7rem 1rem; flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: .3rem .65rem; font-weight: 600; }
.nav-item {
    display: flex; align-items: center; gap: .7rem; padding: .52rem .65rem; border-radius: 10px; color: var(--sidebar-text);
    font: inherit; font-size: .93rem; font-weight: 500; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--sidebar-active); color: var(--primary); }
.nav-item span:first-of-type { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge { margin-left: auto; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: var(--surface-3); color: var(--text); }
.nav-badge.is-po { background: var(--po); color: #fff; }
.nav-badge.is-blizi { background: var(--blizi-bg); color: var(--blizi); }
.nav-badge.is-info { background: var(--info-bg); color: var(--info); }
.sidebar-foot { border-top: 1px solid var(--border); padding: .6rem .7rem .8rem; }
.sidebar-foot form { margin: 0; }
.sidebar-ver { font-size: .72rem; color: var(--muted); padding: .4rem .65rem 0; }
.sidebar-backdrop { display: none; }

.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-title { font-weight: 600; color: var(--muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); color: var(--text); }
.icon-btn:hover { border-color: var(--primary); text-decoration: none; }
.bell.has-po { color: var(--po); border-color: var(--po); }
.bell.has-blizi { color: var(--blizi); }
.dot-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--po); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.bell.has-blizi .dot-count { background: var(--blizi); }
.menu-btn { display: none; }
.layout-public .main { min-height: 100vh; }
.brand-public { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); }
.container { max-width: 1280px; width: 100%; padding: 1.5rem 1.5rem 3rem; }

@media (max-width: 980px) {
    .layout-app .main { margin-left: 0; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
    .menu-btn { display: inline-grid; }
    .container { padding: 1rem 1rem 3rem; }
    .topbar { padding: .55rem 1rem; }
    .hide-sm { display: none !important; }
}

/* --- Výrazný pruh pro kritické závady --- */
.crit-bar {
    display: flex; gap: .75rem; align-items: flex-start; padding: .7rem 1.5rem; background: #c4291c; color: #fff; font-size: .93rem;
}
.crit-bar a { color: #fff; text-decoration: underline; }
.crit-bar .ic { margin-top: 2px; }

/* --- Karty, statistiky --- */
.card { border-radius: var(--radius); padding: 1.15rem 1.3rem; box-shadow: var(--shadow); }
.card-flat { box-shadow: none; }
.card-head h2 { display: flex; align-items: center; gap: .5rem; }
.stat { border-radius: var(--radius); padding: .9rem 1.05rem; gap: .1rem; }
a.stat { color: var(--text); transition: border-color .15s, transform .15s; }
a.stat:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.stat-num { font-size: 1.85rem; letter-spacing: -.02em; }
.stat-info .stat-num { color: var(--info); }
.stat .stat-hint { font-size: .78rem; color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }

/* --- Tlačítka, formuláře --- */
.btn { border-radius: var(--radius-sm); padding: .5rem .95rem; background: var(--surface); transition: border-color .15s, background .15s; white-space: nowrap; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--po); border-color: var(--po); color: #fff; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-small { padding: .28rem .65rem; font-size: .84rem; }
input, select, textarea { border-radius: var(--radius-sm); background: var(--surface); border-color: var(--border-strong); padding: .52rem .7rem; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; }
.form label { color: var(--muted); font-weight: 500; font-size: .86rem; }
.form .hint { font-size: .8rem; color: var(--muted); margin: -.4rem 0 0; }
fieldset.box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem 1rem; margin: 0; display: flex; flex-direction: column; gap: .7rem; }
fieldset.box legend { font-weight: 600; padding: 0 .35rem; font-size: .9rem; }

/* --- Štítky --- */
.badge { font-weight: 600; font-size: .76rem; padding: .14rem .55rem; letter-spacing: .01em; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-ok-soft { background: var(--ok-bg); color: var(--ok); opacity: .85; }
.badge-blizi-soft { background: var(--blizi-bg); color: var(--blizi); opacity: .8; }
.badge-po-soft { background: var(--po-bg); color: var(--po); }
.badge-none { background: var(--none-bg); color: var(--none); }
.badge-krit { background: var(--po); color: #fff; }
.badge-lg { font-size: .85rem; padding: .25rem .7rem; }

/* --- Záložky domu (pilulky, posuvné) --- */
.tabs { flex-wrap: nowrap; overflow-x: auto; gap: .25rem; border-bottom: 0; padding: .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; scrollbar-width: thin; }
.tabs a { border-radius: 9px; border-bottom: 0; padding: .42rem .8rem; font-size: .9rem; font-weight: 500; display: inline-flex; gap: .35rem; align-items: center; }
.tabs a.active { background: var(--primary-soft); color: var(--primary); border-bottom: 0; }
.tabs a:hover { background: var(--surface-2); }

/* --- Tabulky --- */
.table th { font-size: .72rem; letter-spacing: .05em; padding-top: .45rem; padding-bottom: .45rem; }
.table td { padding: .65rem .55rem; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table tr.row-krit td { background: var(--po-bg); }
.table tr.row-krit td:first-child { box-shadow: inset 4px 0 0 var(--po); }

/* --- Filtry (čipy) --- */
.chip { display: inline-flex; gap: .4rem; align-items: center; background: var(--surface); color: var(--text); }
a.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip .n { font-weight: 700; font-size: .78rem; padding: 0 .4rem; border-radius: 999px; background: var(--surface-3); }
.chip.active .n { background: rgba(255, 255, 255, .25); }
.chip.c-po .n { background: var(--po); color: #fff; }
.chip.c-blizi .n { background: var(--blizi-bg); color: var(--blizi); }

/* --- Upozornění --- */
.alert-list { display: flex; flex-direction: column; gap: .5rem; }
.alert-item {
    display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center; padding: .75rem 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; border-left: 4px solid var(--none);
}
.alert-item.u-kriticke { border-left-color: var(--po); background: color-mix(in srgb, var(--po-bg) 45%, var(--surface)); }
.alert-item.u-varovani { border-left-color: var(--blizi); }
.alert-item.u-info { border-left-color: var(--info); }
.alert-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.u-kriticke .alert-ic { background: var(--po); color: #fff; }
.u-varovani .alert-ic { background: var(--blizi-bg); color: var(--blizi); }
.u-info .alert-ic { background: var(--info-bg); color: var(--info); }
.alert-title { font-weight: 600; color: var(--text); }
.alert-title:hover { color: var(--primary); }
.alert-meta { font-size: .85rem; color: var(--muted); }
.alert-actions { display: flex; gap: .35rem; align-items: center; }
@media (max-width: 640px) { .alert-item { grid-template-columns: auto 1fr; } .alert-actions { grid-column: 1 / -1; } }

/* --- Průběh (kroky) objednávky --- */
.steps { display: flex; gap: 0; margin: .25rem 0 1.25rem; overflow-x: auto; }
.step { flex: 1; min-width: 110px; position: relative; text-align: center; font-size: .8rem; color: var(--muted); padding-top: 26px; }
.step::before { content: ''; position: absolute; top: 9px; left: 0; right: 0; height: 3px; background: var(--border); }
.step:first-child::before { left: 50%; } .step:last-child::before { right: 50%; }
.step i { position: absolute; top: 2px; left: calc(50% - 9px); width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); z-index: 1; }
.step.done { color: var(--text); } .step.done::before { background: var(--ok); } .step.done i { background: var(--ok); border-color: var(--ok); }
.step.current { color: var(--primary); font-weight: 600; } .step.current i { border-color: var(--primary); background: var(--primary-soft); }
.step small { display: block; color: var(--muted); font-weight: 400; }

/* --- Závady --- */
.krit-label { display: inline-flex; align-items: center; gap: .3rem; color: #fff; background: var(--po); border-radius: 6px; padding: .1rem .45rem; font-size: .76rem; font-weight: 700; }
.zavady-rows { display: flex; flex-direction: column; gap: .5rem; }
.zavada-row { display: grid; grid-template-columns: 1fr 150px auto; gap: .5rem; align-items: center; }
.zavada-row label.check { white-space: nowrap; }
@media (max-width: 640px) { .zavada-row { grid-template-columns: 1fr; } }

/* --- Pošta --- */
.mail-body { white-space: pre-wrap; font: inherit; background: var(--surface-2); border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 0; max-height: 520px; overflow: auto; }
.mail-preview { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mail-preview-head { background: var(--surface-2); padding: .7rem 1rem; font-size: .88rem; display: grid; grid-template-columns: 90px 1fr; gap: .2rem .8rem; }
.mail-preview-head span:nth-child(odd) { color: var(--muted); }
.mail-preview .mail-body { border-radius: 0; background: var(--surface); max-height: 360px; }
.recip-list { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.recip-list .table td, .recip-list .table th { padding: .4rem .55rem; }
.recip-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .5rem; }
.recip-tools input[type=search] { max-width: 240px; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .compose { grid-template-columns: 1fr; } }
.thread-item { border-left: 3px solid var(--border); padding: .3rem 0 .3rem .8rem; margin-bottom: .6rem; }
.thread-item.in { border-left-color: var(--info); }
.thread-item.current { border-left-color: var(--primary); }

/* --- Zařízení --- */
.equip { display: flex; flex-direction: column; gap: .45rem; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.equip-head { display: flex; gap: .7rem; align-items: center; }
.equip-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.equip-meta { font-size: .84rem; color: var(--muted); }
.equip.inactive { opacity: .55; }

/* --- Kontakty domu --- */
.contact-list { display: flex; flex-direction: column; gap: .55rem; }
.contact { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.contact:last-child { border-bottom: 0; }
.contact small { color: var(--muted); }

/* --- Rychlé akce na přehledu --- */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.todo { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.todo:hover { text-decoration: none; border-color: var(--primary); }
.todo .n { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.todo .l { font-size: .85rem; color: var(--muted); }
.todo.t-po .n { color: var(--po); } .todo.t-blizi .n { color: var(--blizi); } .todo.t-info .n { color: var(--info); } .todo.t-ok .n { color: var(--ok); }
.todo.t-po { border-color: color-mix(in srgb, var(--po) 40%, var(--border)); }
.todo.zero { opacity: .55; box-shadow: none; }

.subnav { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.empty-ok { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-ok .ic { color: var(--ok); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .35rem .9rem; font-size: .92rem; }
.kv > :nth-child(odd) { color: var(--muted); }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; } }
.text-pre { white-space: pre-wrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; }
.flash { border-radius: 12px; }
.flash-info { background: var(--info-bg); color: var(--info); }
.public-box { max-width: 640px; margin: 2rem auto; }

@media print {
    .sidebar, .sidebar-backdrop, .topbar, .crit-bar { display: none !important; }
    .layout-app .main { margin-left: 0; }
    .card { box-shadow: none; }
}

/* v2.0.1 – chybějící termín není „v klidu“: revizi je potřeba zjistit nebo objednat */
.cell-none { background: var(--blizi-bg); color: var(--blizi); }
.dot-none { background: var(--blizi); }
.stat-none .stat-num { color: var(--blizi); }
.badge-chybi { background: var(--blizi-bg); color: var(--blizi); }

/* v2.0.1 – záložky domu bez posuvníku (zalomí se pod sebe) */
.tabs { flex-wrap: wrap; overflow: visible; }

/* v2.0.1 – režim nástěnky (monitor na zdi) */
.tv-mode .main { margin-left: 0 !important; }
.tv-mode { font-size: 17px; }
.tv-mode .container { max-width: none; padding: 1.25rem 2rem 2rem; }
.tv-head { display: flex; align-items: center; gap: 1.5rem; padding: .9rem 2rem; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.tv-head .brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; }
.tv-clock { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; margin-left: auto; }
.tv-head .btn { margin-left: .5rem; }
.tv-mode .tv-hide, .tv-mode .toolbar, .tv-mode .head-actions { display: none !important; }
.tv-mode .todo .n { font-size: 2.4rem; }
.tv-mode .todo .l { font-size: 1rem; }
.tv-mode .alert-title { font-size: 1.1rem; }
.tv-mode .alert-meta { font-size: 1rem; }
.tv-alerts { margin-bottom: 1.5rem; }
.tv-mode .table td { font-size: 1rem; }

/* v2.1 – přehled pro desítky domů */
.filterbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; position: sticky; top: 57px; z-index: 5; background: var(--bg); padding: .5rem 0; }
.filterbar input[type=search] { max-width: 300px; }
.filterbar select { width: auto; }
.table-sticky thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table-domy td { padding-top: .55rem; padding-bottom: .55rem; }
.dot-info { background: var(--info); }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.tv-dum { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--none); border-radius: 12px; padding: .7rem .9rem; display: flex; flex-direction: column; gap: .35rem; }
.tv-dum strong { font-size: 1.05rem; }
.tv-dum.u-po { border-left-color: var(--po); }
.tv-dum.u-objednat { border-left-color: var(--blizi); }
.tv-dum.u-probiha { border-left-color: var(--info); }
.tv-mode .alert-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: .5rem; }

/* v2.1 – formuláře „Zapsat zprávu / Upravit …“ jako okno uprostřed obrazovky (nic se neschová, nic se neposouvá) */
details.popover[open] > summary::before {
    content: ''; position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 90; cursor: default;
}
details.popover[open] > .popover-body {
    position: fixed; z-index: 100; top: 50% !important; left: 50% !important; right: auto !important; bottom: auto !important; transform: translate(-50%, -50%);
    width: min(640px, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); overflow-y: auto;
    border-radius: 16px; padding: 1.25rem 1.4rem; box-shadow: var(--shadow-lg); text-align: left; white-space: normal;
}
details.popover[open] > .popover-body.popover-wide { width: min(760px, calc(100vw - 2rem)); }
.popover-close { position: sticky; top: -.5rem; float: right; margin: -.4rem -.6rem 0 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: var(--text); font-size: 1.1rem; line-height: 1; z-index: 2; }
.zavada-row { grid-template-columns: minmax(0, 1fr) 140px auto; }
body.modal-open { overflow: hidden; }
.group-row td { background: var(--surface-2) !important; padding-top: .55rem; padding-bottom: .55rem; border-top: 2px solid var(--border-strong); }
.group-row a { color: var(--text); display: inline-flex; gap: .4rem; align-items: center; }
.group-row a.btn { color: var(--text); }

/* v2.1.2 – termíny: řádky bez zbytečného zalamování */
.terminy-table td.nowrap { white-space: nowrap; }
.terminy-table td.actions .flex { flex-wrap: nowrap; }
.terminy-table td { vertical-align: middle; }
.terminy-seznam td:nth-child(3) small.muted { white-space: nowrap; }

/* v2.1.3 – nic nesmí přetékat do šířky stránky */
.layout-app .main { min-width: 0; overflow-x: clip; }
.layout-app .container { min-width: 0; max-width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; }

/* v2.1.6 */
#nastaveni-domu { scroll-margin-top: 80px; }
#nastaveni-domu:target { box-shadow: 0 0 0 3px var(--primary, #2f5bea); }

/* v2.1.7 – skryté prvky musí být skryté i u .form label { display:flex } */
[hidden] { display: none !important; }
.equip-rev { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .6rem; align-items: center; padding: .2rem 0; border-top: 1px dashed var(--border); }
.equip-rev:first-child { border-top: 0; }
.equip-rev > span { white-space: nowrap; }

/* v2.1.8 – kalendář domu */
.k-rev { --k: #2563eb; } .k-real { --k: #7c3aed; } .k-ukol { --k: #ea580c; } .k-pov { --k: #0d9488; }
.k-sml { --k: #c026d3; } .k-mer { --k: #64748b; } .k-shr { --k: #16a34a; } .k-po { --k: #dc2626; }
.kal-akce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .6rem; }
.kal-akce-item { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border); border-left: 4px solid #d97706; background: var(--surface-2); color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.kal-akce-item.is-po { border-left-color: #dc2626; }
.kal-akce-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kal-akce-k { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.kal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.kal-head h2 { margin: 0; font-size: 1.35rem; }
.kal-nav { display: flex; gap: .35rem; }
.kal-nav .btn { min-width: 2.2rem; justify-content: center; }
.kal-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); margin-bottom: .8rem; }
.kal-legend i, .agenda-k i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--k); margin-right: .35rem; vertical-align: 0; }
.kal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--border); gap: 1px; }
.kal-dow { background: var(--surface-2); padding: .45rem .6rem; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kal-day { background: var(--surface); min-height: 104px; padding: .4rem .45rem; display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.kal-day.is-we { background: color-mix(in srgb, var(--surface) 94%, var(--text)); }
.kal-day.is-out { opacity: .45; }
.kal-num { font-size: .8rem; font-weight: 600; color: var(--muted); width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center; border-radius: 50%; }
.kal-day.is-today .kal-num { background: var(--primary); color: #fff; }
.kal-ev { display: block; font-size: .74rem; line-height: 1.25; padding: .18rem .4rem; border-radius: 6px; color: var(--k); background: color-mix(in srgb, var(--k) 13%, transparent); border-left: 3px solid var(--k); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kal-ev:hover { background: color-mix(in srgb, var(--k) 22%, transparent); }
.kal-more { font-size: .72rem; color: var(--muted); padding-left: .3rem; }
.agenda { display: flex; flex-direction: column; }
.agenda-month { font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: .9rem 0 .35rem; }
.agenda-month:first-child { padding-top: 0; }
.agenda-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .55rem .5rem; border-radius: 12px; color: var(--text); text-decoration: none; }
.agenda-item:hover { background: var(--surface-2); }
.agenda-date { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: color-mix(in srgb, var(--k) 12%, transparent); color: var(--k); line-height: 1; }
.agenda-date b { font-size: 1.25rem; } .agenda-date small { font-size: .7rem; text-transform: uppercase; margin-top: -.6rem; }
.agenda-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.agenda-k { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.agenda-kdy { white-space: nowrap; }
@media (max-width: 760px) {
  .kal-day { min-height: 54px; padding: .25rem; }
  .kal-ev { font-size: 0; height: 6px; padding: 0; border: 0; background: var(--k); border-radius: 3px; }
  .kal-more { display: none; }
  .agenda-kdy { display: none; }
  .agenda-item { grid-template-columns: 46px minmax(0, 1fr); }
}

/* v2.2 – kdo právě pracuje */
.avatars { display: inline-flex; margin-left: .45rem; vertical-align: middle; }
.avatar { --av: #2563eb; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--av); color: #fff; font-size: .66rem; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 2px var(--surface); flex: none; }
.avatars .avatar + .avatar { margin-left: -6px; }
.avatar-more { background: var(--surface-2); color: var(--muted); }
.presence { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.presence-item { display: flex; align-items: center; gap: .55rem; padding: .55rem .85rem; border-radius: 12px; background: color-mix(in srgb, #7c3aed 9%, var(--surface)); border: 1px solid color-mix(in srgb, #7c3aed 25%, var(--border)); font-size: .92rem; }
.presence-item.is-edit { background: color-mix(in srgb, #d97706 12%, var(--surface)); border-color: color-mix(in srgb, #d97706 40%, var(--border)); }
.presence-item.is-edit::after { content: 'pozor – stejná záložka, domluvte se'; margin-left: auto; font-size: .78rem; color: #b45309; font-weight: 600; }
.online-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .9rem; padding: .6rem .9rem; margin: 0 0 1.1rem; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.online-bar #onlineList { display: contents; }
.online-item { display: inline-flex; align-items: center; gap: .4rem; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 25%, transparent); }
.tv-online { display: inline-flex; align-items: center; gap: .2rem; }
.tv-online .avatar { width: 30px; height: 30px; font-size: .75rem; }
.tv-online .muted { margin-left: .4rem; }
a.tv-dum { color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.tv-dum:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tv-dum .flex-between { gap: .5rem; }
.tv-ok { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.tv-ok-item { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .92rem; }
.tv-ok-item:hover { border-color: var(--primary); }
.tv-ok-item .avatars { margin-left: .2rem; }
.tv-ok-item .avatar { width: 20px; height: 20px; font-size: .58rem; }

/* v2.2.3 – nástěnka: uživatel a odhlášení */
.tv-user { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; padding: .3rem .6rem; border-radius: 8px; }
.tv-user:hover { background: var(--surface-2); }
.tv-head form.inline { margin: 0; }
.tv-head .btn-ghost { margin-left: 0; }

/* v2.2.4 – barvy hlídání termínů: po termínu / nutno objednat / blíží se / objednáno / potvrzeno / čeká na zprávu / v pořádku */
:root {
    --objednat: #c2410c; --objednat-bg: #ffedd5;
    --blizise: #8a6100;  --blizise-bg: #fef6c3;
    --potvrzeno: #0f766e; --potvrzeno-bg: #d5f7f0;
    --zprava: #6d28d9;   --zprava-bg: #ede9fe;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --objednat: #fb923c; --objednat-bg: #3b1e0b;
        --blizise: #f3d04a;  --blizise-bg: #2f2a0b;
        --potvrzeno: #5eead4; --potvrzeno-bg: #0d2c29;
        --zprava: #c4b5fd;   --zprava-bg: #241c45;
    }
}
:root[data-theme="dark"] {
    --objednat: #fb923c; --objednat-bg: #3b1e0b;
    --blizise: #f3d04a;  --blizise-bg: #2f2a0b;
    --potvrzeno: #5eead4; --potvrzeno-bg: #0d2c29;
    --zprava: #c4b5fd;   --zprava-bg: #241c45;
}
.badge-objednat { background: var(--objednat-bg); color: var(--objednat); }
.badge-blizise { background: var(--blizise-bg); color: var(--blizise); }
.badge-potvrzeno { background: var(--potvrzeno-bg); color: var(--potvrzeno); }
.badge-zprava { background: var(--zprava-bg); color: var(--zprava); }

.rev-card { --k: var(--none); --kbg: var(--surface-2); background: var(--kbg); border: 1px solid color-mix(in srgb, var(--k) 25%, var(--border)); border-left: 5px solid var(--k); border-radius: 10px; color: var(--text); gap: .3rem; }
.rev-card .rev-date { color: var(--k); font-weight: 700; }
.rev-card .rev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .8rem; }
.rev-card .rev-stav { color: var(--k); font-weight: 600; }
.rev-card .rev-zav { font-size: .76rem; color: var(--po); font-weight: 600; }
.rc-po { --k: var(--po); --kbg: var(--po-bg); }
.rc-objednat { --k: var(--objednat); --kbg: var(--objednat-bg); }
.rc-blizise { --k: var(--blizise); --kbg: var(--blizise-bg); }
.rc-info { --k: var(--info); --kbg: var(--info-bg); }
.rc-potvrzeno { --k: var(--potvrzeno); --kbg: var(--potvrzeno-bg); }
.rc-zprava { --k: var(--zprava); --kbg: var(--zprava-bg); }
.rc-ok { --k: var(--ok); --kbg: var(--ok-bg); }
.rc-none { --k: var(--none); --kbg: var(--none-bg); }
.rev-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; color: var(--muted); margin-left: auto; margin-right: .8rem; }
.rev-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--k); margin-left: .35rem; }
.zbyva { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.zbyva-po { background: var(--po); color: #fff; border-color: transparent; }
.zbyva-objednat { background: var(--objednat); color: #fff; border-color: transparent; }
.zbyva-blizise { background: var(--blizise-bg); color: var(--blizise); border-color: color-mix(in srgb, var(--blizise) 45%, transparent); }
.zbyva-info, .zbyva-potvrzeno, .zbyva-zprava { color: var(--info); }
.zbyva-ok { color: var(--ok); }
:root[data-theme="dark"] .zbyva-po, :root[data-theme="dark"] .zbyva-objednat { color: #1a0f08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .zbyva-po, :root:not([data-theme="light"]) .zbyva-objednat { color: #1a0f08; } }

/* v2.3 – značka Spravitel */
.logo-mark { flex: none; display: block; filter: drop-shadow(0 3px 8px rgba(79, 70, 229, .28)); }
.brand .brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand .brand-name { font-weight: 800; font-size: 1.22rem; letter-spacing: -.03em; background: linear-gradient(90deg, #7c3aed, #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .brand-tag { font-size: .66rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-top: .15rem; white-space: nowrap; }
.tv-head .brand, .brand-public { font-weight: 800; letter-spacing: -.02em; }
.auth-brand { display: flex; align-items: center; gap: .9rem; margin-bottom: 1.4rem; }
.auth-name { font-size: 2rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; background: linear-gradient(90deg, #7c3aed, #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tag { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: .3rem; }
:root[data-theme="dark"] .brand .brand-name, :root[data-theme="dark"] .auth-name { background-image: linear-gradient(90deg, #a78bfa, #60a5fa); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .brand-name, :root:not([data-theme="light"]) .auth-name { background-image: linear-gradient(90deg, #a78bfa, #60a5fa); } }

/* v2.3.3 – patička */
.app-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2rem .5rem; padding: 1.4rem 1rem 1.6rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 1.5rem; }
.app-foot strong { color: var(--text); font-weight: 600; }
.app-foot-sep { opacity: .5; }
.tv-mode .app-foot { margin-top: .5rem; padding: .8rem; }
@media print { .app-foot { display: none; } }
