/* CRM Luhačovské Zálesí – vizuální styl podle manuálu Luhačovského Zálesí (zelená zálesí, modrá prameny, šedá kopce, Raleway). */

/* Raleway (SIL OFL 1.1, viz fonts/OFL-LICENSE.txt) – jen latin + latin-ext, řezy 400/500/600/800 */
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/raleway-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/raleway-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/raleway-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/raleway-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/raleway-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/raleway-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/raleway-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/raleway-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    /* paleta z loga a manuálu */
    --zelena: #3C8F3A;        /* zelená zálesí (soubory loga) */
    --zelena-tmava: #2D6A2E;  /* hlavička – bílý text 6.5 : 1 */
    --zelena-svetla: #EAF3E9;
    --modra: #0A74B4;         /* modrá prameny (soubory loga) – primární tlačítka, bílý text 5 : 1 */
    --modra-tmava: #085C8F;
    --modra-svetla: #E7F1F8;
    --seda: #404545;          /* šedá kopce */
    --bg: #F3F5F3;
    --surface: #fff;
    --text: #1C2120;
    --muted: #5A6360;
    --line: #DCE2DE;
    --line-strong: #AEB8B2;
    --danger: #B42318;
    --danger-bg: #FDECEA;
    --warn-bg: #FFF6DB;
    --focus: #253848;         /* navy ENERKOM – na bílé i světle šedé ≥ 3 : 1 */
    --radius: 8px;
    --radius-sm: 6px;
    --font-brand: "Raleway", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: 1.55;
    min-height: 100vh;
}
main { max-width: 1120px; margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; }
main.narrow { max-width: 640px; }
h1, h2, h3, .topnav, button, .button, legend, thead th, .org-label, .count {
    font-family: var(--font-brand);
    font-variant-numeric: lining-nums;
}
h1 { font-size: 1.85rem; font-weight: 800; line-height: 1.2; margin: 0 0 1rem; letter-spacing: -.005em; color: #172019; }
h2 { font-size: 1.2rem; font-weight: 800; margin: 2.2rem 0 .7rem; color: #172019; }
h3 { font-size: 1rem; font-weight: 800; margin: 1.2rem 0 .4rem; }
p { margin: .5rem 0 1rem; }
a { color: var(--modra); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--modra-tmava); text-decoration-thickness: 2px; }
small, .muted { color: var(--muted); }
code { background: var(--zelena-svetla); padding: .1em .35em; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* piktogramy (Lucide, sprite) */
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; stroke: currentColor; }
.type-icon { color: var(--muted); }

/* viditelný fokus */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible,
.nav-toggle:focus-visible + .nav-burger, .kind-choice input:focus-visible + span {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* ---------- hlavička ---------- */
.topbar { background: var(--zelena-tmava); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar::after {
    /* pás vnořených horských krokví – podpis vizuálního stylu Zálesí */
    content: ""; display: block; height: 12px;
    background: var(--zelena-tmava) url(img/pas-hory.svg) repeat-x 0 0 / auto 12px;
    opacity: 1; border-bottom: 3px solid var(--zelena-tmava);
}
.topbar a { color: #fff; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: .55rem 1.25rem 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .4rem 1.25rem; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; }
.brand-mark { height: 30px; width: auto; display: block; flex: none; }
/* slovní značka „Zálesí CRM“: Raleway 800 + 500, prostrkání 0.04em */
.wordmark { font-family: var(--font-brand); letter-spacing: .04em; line-height: 1; white-space: nowrap; display: inline-flex; align-items: baseline; gap: .3em; }
.wordmark b { font-weight: 800; }
.wordmark > span { font-weight: 500; }
.wordmark .wm-full { font-weight: inherit; color: inherit; }
.topbar .wordmark { font-size: 1.3rem; color: #fff; }
.topbar .wordmark > span { color: #D7E6D4; }
.wordmark-light b { color: #1C2120; }
.wordmark-light > span { color: #404545; }
.topnav { grid-column: 1 / -1; display: flex; align-items: center; gap: .15rem 1.1rem; font-size: .95rem; font-weight: 600; flex-wrap: wrap; padding: .15rem 0 .1rem; }
.topnav a { text-decoration: none; padding: .45rem 0; display: inline-flex; gap: .4rem; align-items: center; border-bottom: 2px solid transparent; white-space: nowrap; }
.topnav a:hover { border-bottom-color: rgba(255, 255, 255, .7); color: #fff; }
.topnav a[aria-current="page"] { border-bottom-color: #fff; }
.topnav .icon { opacity: .9; }
.topnav .nav-spacer { flex: 1 1 auto; }
.topnav .nav-minor { font-weight: 400; opacity: .92; }
.nav-tools { display: flex; align-items: center; gap: .8rem; justify-self: end; font-size: .9rem; }
.nav-search { position: relative; margin: 0; }
.nav-search .icon { position: absolute; left: .55rem; top: 50%; transform: translateY(-50%); color: #5A6360; pointer-events: none; }
.topbar .nav-search input { background: #fff; border: 0; border-radius: 999px; padding: .35rem .8rem .35rem 2rem; width: 13rem; margin: 0; font-size: .9rem; }
.nav-user { opacity: .9; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { margin: 0; }
.topbar .nav-logout button { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; display: inline-flex; gap: .35rem; align-items: center; }
.topbar .nav-logout button:hover { background: rgba(255, 255, 255, .14); }
.nav-add { justify-self: end; }
.topbar .button-primary { background: #fff; color: var(--zelena-tmava); border-color: #fff; }
.topbar .button-primary:hover { background: var(--zelena-svetla); color: var(--zelena-tmava); }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; padding: .35rem .55rem; border: 1px solid rgba(255, 255, 255, .55); border-radius: var(--radius-sm); cursor: pointer; line-height: 1; }
.nav-burger .icon { width: 1.4rem; height: 1.4rem; vertical-align: middle; }

/* ---------- tlačítka ---------- */
button, .button {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .95rem; font-weight: 600;
    padding: .5rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
}
button:hover, .button:hover { background: var(--zelena-svetla); color: var(--text); text-decoration: none; }
.button-primary, button.button-primary { background: var(--modra); border-color: var(--modra); color: #fff; }
.button-primary:hover, button.button-primary:hover { background: var(--modra-tmava); border-color: var(--modra-tmava); color: #fff; }
button.small, .button.small { padding: .2rem .65rem; font-size: .85rem; }
.button-quiet { border-color: transparent; background: transparent; color: var(--modra); padding-left: .4rem; padding-right: .4rem; }
.button-quiet:hover { background: var(--modra-svetla); color: var(--modra-tmava); }
.button-danger { color: var(--danger); border-color: #E3B0AB; }
.button-danger:hover { background: var(--danger-bg); color: var(--danger); }
form.inline { display: inline; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- formuláře ---------- */
label { display: block; font-weight: 600; margin: 0 0 .9rem; }
label.check { font-weight: 400; display: flex; gap: .5rem; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=url],
select, textarea {
    display: block; width: 100%; max-width: 40rem; margin-top: .25rem;
    padding: .5rem .65rem; font: inherit; font-weight: 400; color: var(--text);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
input[type=file] { display: block; margin-top: .35rem; font: inherit; font-weight: 400; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--modra); }
input.wide { max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--zelena); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1rem 1rem .25rem; margin: 0 0 1.2rem; }
legend { font-weight: 800; padding: 0 .4rem; }
form.stack .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0 1rem; }
form.stack select, form.stack input, form.stack textarea { max-width: none; }
form.stack { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; max-width: 48rem; }
form.stack fieldset { background: var(--bg); }
.actions { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
form.filters { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .4rem; margin-bottom: 1.4rem; }
form.filters label { margin-bottom: .5rem; flex: 1 1 11rem; font-size: .9rem; }
form.filters button { margin-bottom: .5rem; }
main > form:not(.inline):not(.filters):not(.stack):not(.org-card):not(.ispz-confirm) { max-width: 36rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem .6rem; margin-bottom: 1rem; }
main.narrow > form { max-width: none; }
.hint { font-size: .875rem; color: var(--muted); font-weight: 400; margin: .3rem 0 .8rem; }

/* typ zápisu – volba s piktogramy */
.kind-choice { border: 0; padding: 0; margin: 0 0 .9rem; background: none; }
.kind-choice legend { font-family: var(--font-text); font-weight: 600; padding: 0; margin-bottom: .3rem; }
.kind-options { display: flex; flex-wrap: wrap; gap: .4rem; }
.kind-choice label { margin: 0; font-weight: 400; }
.kind-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-choice span { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; }
.kind-choice span:hover { border-color: var(--zelena); }
.kind-choice input:checked + span { background: var(--zelena-svetla); border-color: var(--zelena); color: #1F4E20; font-weight: 600; box-shadow: inset 0 0 0 1px var(--zelena); }

/* ---------- hlášky ---------- */
.error, .notice, .warning { padding: .7rem 1rem; border-radius: var(--radius-sm); border: 1px solid; margin: 0 0 1rem; }
.error { background: var(--danger-bg); border-color: #E6B3AF; color: #7A1B15; }
.error p { margin: .2rem 0; }
.notice { background: var(--zelena-svetla); border-color: #B9D6B7; }
.warning { background: var(--warn-bg); border-color: #ECD58F; }

/* ---------- tabulky ---------- */
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table-wrap { overflow-x: auto; max-width: 100%; margin-bottom: 1rem; }
.table-wrap > table { display: table; width: 100%; margin: 0; }
th, td { padding: .6rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: #F7F9F7; font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FAFCFA; }
.name-cell { display: flex; gap: .55rem; align-items: center; }

/* ---------- štítky organizací ---------- */
.org-label {
    --org: #888;
    display: inline-flex; align-items: center; gap: .35rem;
    background: color-mix(in srgb, var(--org) 14%, #fff);
    color: #1C2120;
    border: 1px solid color-mix(in srgb, var(--org) 45%, #fff);
    padding: 0 .55rem 0 .45rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; line-height: 1.6; white-space: nowrap; vertical-align: middle;
}
.org-label::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--org); flex: none; }

/* ---------- znaky obcí, piktogramy subjektů ---------- */
.crest { object-fit: contain; flex: none; }
.crest-sm { width: 18px; height: 18px; vertical-align: -.2em; }
.crest-lg { width: 48px; height: 48px; }
.subject-mark { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: var(--radius); background: var(--zelena-svetla); color: var(--zelena-tmava); }
.subject-mark .icon { width: 26px; height: 26px; color: inherit; }
.subject-mark.has-crest { background: transparent; }

/* ---------- hlavička detailu ---------- */
.page-head { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.2rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: .15rem 0 0; color: var(--muted); }
.page-head .head-text { flex: 1 1 18rem; min-width: 0; }
.page-head .button-row { margin-left: auto; }
.head-date { color: var(--muted); margin: -.6rem 0 1.4rem; }

/* ---------- seznamy, detail ---------- */
dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1rem; }
dt { color: var(--muted); font-weight: 600; font-size: .92rem; }
dd { margin: 0; }
.plain-list, .tasks ul, .recent-cases ul, .pick-list, .result-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plain-list li, .tasks li, .recent-cases li, .pick-list li, .result-list li { padding: .65rem .95rem; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; }
.plain-list li:last-child, .tasks li:last-child, .recent-cases li:last-child, .pick-list li:last-child, .result-list li:last-child { border-bottom: 0; }
main > ul { padding-left: 1.2rem; }

/* ---------- přehled: úkoly ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 0 2rem; align-items: start; }
.tasks h2, .recent-cases h2 { display: flex; align-items: center; gap: .5rem; margin-top: 1.6rem; }
.tasks h2 .icon, .recent-cases h2 .icon { color: var(--zelena); }
.count { font-size: .8rem; font-weight: 600; background: #E4E9E5; color: var(--seda); border-radius: 999px; padding: .05rem .55rem; }
.tasks-overdue h2 { color: var(--danger); }
.tasks-overdue h2 .icon { color: var(--danger); }
.tasks-overdue .count { background: var(--danger-bg); color: var(--danger); }
.tasks-overdue li { box-shadow: inset 4px 0 0 var(--danger); }
.task-title { font-weight: 600; }
.task-meta { display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: center; font-size: .9rem; flex: 1 1 100%; }
.task-main { flex: 1 1 14rem; display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: center; min-width: 0; }
.due { color: var(--muted); font-size: .9rem; display: inline-flex; gap: .3rem; align-items: center; }
.tasks-overdue .due { color: var(--danger); font-weight: 600; }
.tasks li form { margin-left: auto; }
.empty-line { color: var(--muted); margin: .3rem 0 0; }
.recent-cases li { display: block; }
.recent-cases .case-sub { display: block; color: var(--muted); font-size: .9rem; }

/* ---------- prázdné stavy ---------- */
.empty { text-align: center; padding: 1.6rem 1rem 1.4rem; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); margin: 1rem 0; }
.empty img { width: 200px; max-width: 70%; height: auto; display: block; margin: 0 auto .6rem; }
.empty h2, .empty h3 { margin: .2rem 0 .3rem; font-size: 1.1rem; }
.empty p { color: var(--muted); margin: .2rem auto .8rem; max-width: 34rem; }

/* ---------- časová osa ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-top: 2.2rem; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.section-head h2 .icon { color: var(--zelena); }
.timeline-list { list-style: none; margin: 1rem 0 0; padding: 0 0 0 0; position: relative; }
.timeline-list::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-list li { position: relative; padding-left: 50px; margin-bottom: .8rem; }
.tl-dot { --org: #888; position: absolute; left: 0; top: .55rem; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--org) 16%, #fff); border: 2px solid var(--org); color: #1C2120; }
.tl-dot .icon { width: 17px; height: 17px; }
.tl-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem .6rem; }
.timeline-list p { margin: .35rem 0; }
.tl-head { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: center; }
.tl-head time { color: var(--muted); font-size: .92rem; }
.tl-kind { font-weight: 700; }
.tl-foot { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: center; font-size: .9rem; color: var(--muted); }
.tl-foot a { display: inline-flex; gap: .3rem; align-items: center; }
.tl-done .tl-card { background: #FAFBFA; }
.tl-agreed { background: var(--zelena-svetla); border-radius: var(--radius-sm); padding: .35rem .6rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }
.subnav { display: flex; gap: .4rem; flex-wrap: wrap; margin: -.2rem 0 1.4rem; }
.subnav a { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; text-decoration: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: .92rem; }
.subnav a[aria-current="page"] { background: var(--zelena-tmava); border-color: var(--zelena-tmava); color: #fff; }

/* panely (soukromí, GDPR, znak) */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1rem 0; }
.panel h2 { margin: 0 0 .5rem; font-size: 1.05rem; display: flex; gap: .45rem; align-items: center; }
.panel h2 .icon { color: var(--muted); }
details.panel > summary { cursor: pointer; font-weight: 600; display: flex; gap: .45rem; align-items: center; list-style: none; color: var(--modra); }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel[open] > summary { margin-bottom: .7rem; }
.panel form { margin: 0; }
.side-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 1rem; }

/* správa organizací */
.org-card { display: grid; grid-template-columns: 220px 1fr; gap: 1rem 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0 0 1rem; box-shadow: inset 4px 0 0 var(--org, #888); }
.org-card .logo-box { display: grid; place-items: center; align-content: center; gap: .8rem; background: #F7F9F7; border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 110px; padding: .8rem; }
.org-card .logo-box img { max-width: 100%; max-height: 72px; }
.org-card .logo-fallback { font-family: var(--font-brand); font-weight: 800; color: var(--muted); }
.org-card .fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 1rem; }
.org-card .fields label { margin-bottom: .7rem; }
.color-field { display: flex; gap: .4rem; align-items: center; }
.color-field input { margin-top: 0; }
.swatch { width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: none; border: 1px solid rgba(0, 0, 0, .15); }

/* ---------- přihlášení ---------- */
body.page-auth { display: flex; flex-direction: column; background: #F6F8F6; }
body.page-auth main { flex: 1 0 auto; width: 100%; max-width: 30rem; padding-top: 2.5rem; padding-bottom: 1rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: .55rem; margin: 0 auto 1.3rem; }
.auth-brand img { width: 84px; height: auto; display: block; }
.auth-brand .wordmark { font-size: 1.75rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem 1.6rem .9rem; }
.auth-card h1 { font-size: 1.45rem; text-align: center; margin-bottom: 1.1rem; }
main .auth-card form { max-width: none; border: 0; padding: 0; margin: 0; background: none; }
.auth-card button.button-primary { width: 100%; justify-content: center; padding: .65rem 1rem; }
.auth-card .auth-links { text-align: center; margin: .9rem 0 .4rem; font-size: .95rem; }
.org-logos { margin: 2rem 0 0; text-align: center; width: min(60rem, calc(100vw - 2rem)); position: relative; left: 50%; transform: translateX(-50%); }
.org-logos p { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }
.org-logos ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.2rem 2rem; }
.org-logos img { width: 170px; height: auto; max-height: 34px; object-fit: contain; display: block; } /* loga stejně široká, nejvýš 34 px vysoká (min. 120 px dle manuálu ENERKOM) */
.org-logos .logo-text { font-family: var(--font-brand); font-weight: 800; color: var(--seda); }
.landscape { flex: none; height: 170px; background: url(img/krajina.svg) center bottom / cover no-repeat; margin-top: 1.5rem; }
body.page-auth.wide main { max-width: 64rem; }

/* chybová stránka */
.error-page { text-align: center; padding-top: 1.5rem; }
.error-page img { width: 240px; max-width: 80%; height: auto; }

@media (min-width: 1121px) { .topnav { flex-wrap: nowrap; } }

/* tablet */
@media (max-width: 980px) {
    .dash-grid { grid-template-columns: 1fr; }
    .nav-search input { width: 9rem; }
    .org-card { grid-template-columns: minmax(0, 1fr); }
}

/* mobil: sbalená navigace */
@media (max-width: 760px) {
    html { font-size: 106%; }
    .topbar-inner { grid-template-columns: auto 1fr auto; padding: .5rem .8rem 0; gap: .4rem .6rem; }
    .brand-mark { height: 26px; }
    .topbar .wordmark { font-size: 1.12rem; }
    .hide-sm { display: none; }
    .nav-add { white-space: nowrap; }
    .nav-add { justify-self: end; padding: .4rem .7rem; }
    .nav-burger { display: inline-flex; }
    .nav-tools, .topnav { display: none; grid-column: 1 / -1; }
    .nav-toggle:checked ~ .topnav { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 0; }
    .nav-toggle:checked ~ .nav-tools { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; padding: .5rem 0 .6rem; justify-self: stretch; }
    .topnav a { padding: .65rem .2rem; border-bottom: 1px solid rgba(255, 255, 255, .18); }
    .topnav a[aria-current="page"] { border-bottom-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1); }
    .topnav .nav-spacer { display: none; }
    .nav-search, .topbar .nav-search input { width: 100%; }
    .page-head { flex-wrap: wrap; gap: .8rem; }
    .page-head .head-text { flex: 1 1 0; }
    .page-head .button-row { flex: 1 1 100%; }
    .nav-user { max-width: none; }
    main { padding: 1.1rem .85rem 2.5rem; }
    h1 { font-size: 1.5rem; }
    dl { grid-template-columns: 1fr; gap: 0; }
    dt { margin-top: .5rem; }
    form.stack { padding: 1rem; }
    .tasks li form { margin-left: 0; order: 3; }
    .org-card .fields { grid-template-columns: minmax(0, 1fr); }
    .org-card { padding: 1rem; }
    .org-card input[type=text] { max-width: none; }
    .table-wrap > table { min-width: 42rem; }
    .page-head .button-row { margin-left: 0; }
    .org-logos ul { flex-direction: column; gap: 1rem; }
    .landscape { height: 110px; }
    .auth-card { padding: 1.2rem 1.1rem .6rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
    .topbar, .nav-add { display: none; }
    body { background: #fff; }
}
.anon-form { margin: .6rem 0 0; }
.anon-form label { margin-bottom: .5rem; }
.side-panels { margin-top: 2rem; }
form.stack fieldset.kind-choice { background: none; border: 0; padding: 0; }
details.crest-panel:not([open]) { background: none; border: 0; padding: 0; margin: .2rem 0 1rem; }

.button-row label.check { margin: 0; }
form.filters input, form.filters select { height: 2.5rem; }
.tasks-overdue.is-empty h2, .tasks-overdue.is-empty h2 .icon { color: inherit; }
.tasks-overdue.is-empty h2 .icon { color: var(--zelena); }
.tasks-overdue.is-empty .count { background: #E4E9E5; color: var(--seda); }
.org-card > * { min-width: 0; }
/* na tmavé hlavičce je navy fokus neviditelný – tam bílý */
.topbar a:focus-visible, .topbar button:focus-visible, .topbar input:focus-visible, .topbar .nav-toggle:focus-visible + .nav-burger { outline-color: #fff; }
/* velmi úzké displeje: značka + „CRM“ */
@media (max-width: 350px) { .topbar .wordmark b { display: none; } }
/* celý název „Luhačovské Zálesí CRM“ v hlavičce jen na širokých displejích */
@media (max-width: 899px) { .topbar .wm-full { display: none; } }
/* přihlášení na úzkém displeji: název na dva řádky */
@media (max-width: 480px) { .auth-wordmark { flex-direction: column; align-items: center; gap: .25em; } }
/* 900–1099 px: celý název se vejde jen bez jména uživatele (jméno je v title tlačítka Odhlásit) */
@media (min-width: 900px) and (max-width: 1099px) { .nav-user { display: none; } .topbar .nav-search input { width: 8.5rem; } }

/* Patička s verzí a přehled změn */
.app-footer { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem 2rem; font-size: .85rem; color: var(--muted); }
.app-footer a { color: inherit; }
.changelog-entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.changelog-entry h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.changelog-entry ul { margin: 0; padding-left: 1.2rem; line-height: 1.55; }

/* Import a export ISPZ */
.ispz-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 0 1.2rem; align-items: start; }
.ispz-grid .panel { margin-top: 0; }
.ispz-grid .panel h2 .icon { color: var(--zelena); }
.upload-form { margin: .4rem 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: flex-end; }
.upload-form label { margin: 0; flex: 1 1 16rem; }
.steps { margin: 0; padding-left: 1.2rem; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.steps strong { color: var(--text); }
.red-text { color: #D00000; font-weight: 600; }
.result-summary { margin: .2rem 0 .4rem; padding-left: 1.2rem; }
.notice p { margin: .2rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .6rem; margin: 0 0 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .85rem .6rem; display: flex; flex-direction: column; gap: .15rem; box-shadow: inset 0 3px 0 var(--stat, var(--line)); }
.stat-num { font-family: var(--font-brand); font-weight: 800; font-size: 1.55rem; line-height: 1.1; color: #172019; }
.stat-label { font-size: .85rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; }
.stat.is-new { --stat: var(--zelena); }
.stat.is-changed { --stat: var(--modra); }
.stat.is-retired { --stat: #9AA39E; }
.stat.is-warn { --stat: #E0A800; }
.detail-list > summary { color: var(--text); font-size: 1rem; }
.detail-list > summary .icon { color: var(--zelena); }
.detail-list > summary .muted { font-weight: 400; font-size: .9rem; }
.detail-list .table-wrap { margin: 0; }
.warn-panel { background: var(--warn-bg); border-color: #ECD58F; }
.warn-panel > summary, .warn-panel > summary .icon { color: #6B4E00; }
.warn-list { margin: 0; padding-left: 1.2rem; font-size: .92rem; line-height: 1.5; max-height: 22rem; overflow-y: auto; }
.change-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.change-field { color: var(--muted); font-size: .9rem; }
del { background: var(--danger-bg); color: #7A1B15; text-decoration-thickness: 1px; padding: 0 .2em; border-radius: 3px; }
ins { background: var(--zelena-svetla); color: #1F4E20; text-decoration: none; padding: 0 .2em; border-radius: 3px; }
.changes .arrow { color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.is-retired td { color: var(--muted); }
.plain-list.compact li { padding: .35rem .95rem; font-size: .92rem; }
.confirm-bar { position: sticky; bottom: 0; background: var(--bg); padding: .8rem 0; border-top: 1px solid var(--line); margin-top: 1.2rem; z-index: 2; }
.ispz-panel dl { margin: 0; border: 0; padding: 0; background: none; }
.readiness-table { margin: .2rem 0 0; }
.readiness-table th, .readiness-table td { padding: .3rem .6rem; font-size: .9rem; }
.crm-changed { color: #B3261E; font-size: .9rem; }
@media (max-width: 980px) { .ispz-grid { grid-template-columns: minmax(0, 1fr); } }
.stats { grid-template-columns: repeat(auto-fit, minmax(8.4rem, 1fr)); }
details.detail-list > summary { flex-wrap: wrap; }
.panel .upload-form { margin: .4rem 0 1.1rem; }
.ispz-panel table.readiness-table { display: table; width: auto; }
.confirm-bar .button-primary { white-space: nowrap; }
.conflict-panel { border-color: #ECD58F; box-shadow: inset 4px 0 0 #E0A800; }
.conflict-panel h2 .icon { color: #B07D00; }
td.choice label.check { margin: 0 0 .2rem; font-size: .92rem; white-space: nowrap; }
.stats { grid-template-columns: repeat(auto-fit, minmax(7.8rem, 1fr)); }
