/* Projekty Viagem — vlastni styl (bez frameworku). Design refresh 2026-07. */

:root {
    --bg:            #f4f6f9;
    --surface:       #ffffff;
    --surface-2:     #f7f9fc;
    --border:        #e6e9ef;
    --border-strong: #d3d9e3;
    --text:          #1e2734;
    /* ztmaveno z #6b7789 — svetle sede popisky byly na bilem podkladu spatne citelne
       (kontrast ~4,5:1 na hranici WCAG AA; #5b6678 dava ~5,8:1 i pro maly text) */
    --muted:         #5b6678;
    --primary:       #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft:  #eaf1fe;
    --danger:        #dc2626;
    --topbar:        #151d2c;
    --radius:        12px;
    --radius-sm:     8px;
    --radius-xs:     6px;
    --shadow-sm:     0 1px 2px rgba(16, 24, 40, .06);
    --shadow:        0 2px 10px rgba(16, 24, 40, .07);
    --shadow-lg:     0 10px 30px rgba(16, 24, 40, .18);
    --surface-3:     #f7f8fa;
    --border-soft:   #eef1f5;
    --text-soft:     #46516a;
    --muted-2:       #9aa1b5;
}

/* dochazka — bilance nadcasu z pipaku (sloupec ±) */
.att-bal  { white-space: nowrap; }
.ot-plus  { color: #15803d; font-weight: 600; }
.ot-minus { color: var(--danger); font-weight: 600; }
.ot-zero  { color: var(--muted); }
/* .stat-card .n ma vyssi specificitu — barvu bilance je potreba vynutit */
.stat-card .n.ot-plus  { color: #15803d; }
.stat-card .n.ot-minus { color: var(--danger); }
.stat-card .n.ot-zero  { color: var(--muted); }
/* dochazka — vlajecka nesmyslneho pipani na konci radku */
.att-flag { text-align: center; cursor: help; }
/* dochazka — klikaci bunka dne pro opravu pipaku (jen s pravem attendance.fix) */
.att-fix-link { display: block; min-height: 1em; color: inherit; text-decoration: none; }
.att-fix-link:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--primary); border-radius: 3px; }
/* oprava pipaku — barevne chipy zaznamu a editor radku */
.beep-chip {
    display: inline-block; padding: .1rem .55rem; border-radius: 999px;
    font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.bc-prace   { background: #e5f5ec; color: #17794a; }
.bc-obed    { background: #fdf0e0; color: #b45309; }
.bc-odchod  { background: #e8effd; color: #1d4ed8; }
.bc-koureni { background: #eef0f4; color: #5b6678; }
.beep-list td, .beep-edit td { vertical-align: middle; }
.beep-edit input[type="time"] { width: 6.8rem; }
.beep-edit .beep-del { padding: .15rem .5rem; }
.beep-edit .beep-typ { width: 7.5rem; }
.beep-time { white-space: nowrap; }
.beep-orig { color: #b45309; font-size: .82rem; margin-right: .25rem; }
/* barevne odliseni zmenenych radku (prefix table.issues, at prezije i :hover) */
table.issues tr.beep-removed td { background: #fdf1f1; }
table.issues tr.beep-added td   { background: #eefaf3; }
table.issues tr.beep-changed td { background: #fdf6e9; }
table.issues tr.beep-new td     { background: #eefaf3; }
/* rozpracovane (neulozene) zmeny v editoru zaznamu */
table.issues tr.js-del td { background: #fdf1f1; }
table.issues tr.js-chg td { background: #fdf6e9; }
tr.js-del select, tr.js-del input { opacity: .55; text-decoration: line-through; }
.beep-actions { white-space: nowrap; }
.beep-actions .btn { padding: .15rem .5rem; }
/* detail dne — formular pro rucni HO log */
.ho-form { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; margin-top: .4rem; }
.ho-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .85rem; color: var(--muted); }
/* rozpis dochazky jednoho cloveka po dnech */
.att-month-link { text-decoration: none; opacity: .55; }
.att-month-link:hover { opacity: 1; text-decoration: none; }
.osoba-table td { vertical-align: top; }
table.issues tr.os-free td { background: var(--surface-3); }
table.issues tr.os-today td { box-shadow: inset 0 2px 0 var(--primary); }
.beep-removed .beep-chip { filter: grayscale(.5); opacity: .75; }
.beep-removed s { color: #b91c1c; }
.beep-why { cursor: help; font-size: .85rem; }
.bw-removed { color: #b91c1c; }
.bw-added   { color: #15803d; }
.bw-changed { color: #b45309; }
/* dochazka — mala cervena vlajecka primo na bunce dne s nesmyslem */
.att-cell .cell-flag { position: absolute; top: 0; left: 1px; font-size: .55rem; line-height: 1; }
/* dochazka — prehledna legenda: kazdy symbol na vlastnim radku, 2 sloupce na sirokem okne */
.att-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr)); gap: .35rem 2rem; padding: .8rem 1rem; }
.att-legend .lg-item { display: flex; gap: .7rem; align-items: baseline; font-size: .84rem; color: var(--muted); }
.att-legend .lg-sym { flex: 0 0 9rem; text-align: right; color: var(--text); white-space: nowrap; }
/* dochazka — spolecna lista: pravidla + auto-opravy + filtr jmen v jednom ramecku */
.att-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem .9rem; }
.att-tools > .btn { white-space: nowrap; }
.att-refresh { display: inline-flex; align-items: center; gap: .5rem; margin: 0; }
/* varovani, ze synchronizace pipaku stoji (cron nebo terminal nejede) */
.pipak-stale {
    background: #fdf6e9; border-color: #e08a3c; color: #8a5300;
    font-size: .88rem; padding: .6rem .9rem;
}
.att-tools .pipak-stale { flex: 1 0 100%; margin: 0 0 .2rem; }
.att-check, .att-sort { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.att-check input { margin: 0; }
.att-sort select { padding: .3rem .5rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; }
.att-filter { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; }
.att-filter input {
    padding: .4rem .65rem; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); min-width: 14rem; font: inherit;
}
/* pravidla se rozbaluji jako prekryvny panel — lista se nehybe */
.att-rules { position: relative; }
.att-rules summary { cursor: pointer; display: inline-block; list-style: none; }
.att-rules summary::-webkit-details-marker { display: none; }
.att-rules-panel {
    position: absolute; left: 0; top: calc(100% + .45rem); z-index: 40;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 1rem 1.2rem;
    width: min(54rem, 86vw); max-height: 70vh; overflow: auto;
}
.att-rules h3 { font-size: .95rem; margin: .9rem 0 .35rem; }
.att-rules h3:first-child { margin-top: 0; }
.att-rules table { max-width: 46rem; }
/* mrizka: cela se vejde na sirku okna (fixed layout, dny si rozdeli zbytek),
   zadne vnitrni bezce; hlavicka se lepi POD horni listu pri scrollu stranky */
.load-scroll.att-sticky { overflow: visible; }
.att-table { width: 100%; }
.att-table th.att-flag, .att-table td.att-flag { width: 1.8rem; padding: .2rem .1rem; text-align: center; }
.att-table th.att-live, .att-table td.att-live { width: 1.5rem; padding: .2rem 0; text-align: center; }
.att-table th.att-open, .att-table td.att-open { width: 1.9rem; padding: .2rem 0; text-align: center; }
/* nahradni volno (cerpani nadcasu) — znacka v bunce dne i v rozpisu */
.att-comp { color: #7c3aed; font-weight: 700; font-size: .68rem; }
/* zivy stav podle pipaku — gulicka za jmenem */
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; cursor: help; }
.ld-green  { background: #16a34a; }
.ld-orange { background: #f59e0b; }
.ld-red    { background: #dc2626; }
.att-table th.att-sum { width: 3.4rem; }
.att-table th.att-bal, .att-table td.att-bal { width: 6rem; }
.att-table td.att-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-cell { overflow: hidden; }
.att-table thead th {
    position: sticky; top: 3.1rem;              /* tesne pod sticky topbarem */
    z-index: 30; background: var(--surface); box-shadow: 0 1px 0 var(--border-strong);
}
.att-table thead th.is-free { background: var(--surface-3); }
.att-table thead th.is-today { box-shadow: inset 0 0 0 2px var(--primary), 0 1px 0 var(--border-strong); }
@media (max-width: 1100px) {
    /* na uzke obrazovce se 31 dnu nevejde — vratit vodorovny bezec,
       sticky hlavicka v nem nefunguje, tak se nelepi */
    .load-scroll.att-sticky { overflow-x: auto; }
    .att-table { width: auto; }
    .att-table thead th { position: static; }
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.08rem; margin: 0 0 .7rem; letter-spacing: -.01em; }

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- horni lista --- */
.topbar {
    display: flex; align-items: center; gap: 1rem;
    background: var(--topbar); color: #fff; padding: .5rem 1.3rem;
    position: sticky; top: 0; z-index: 40;
    box-shadow: 0 1px 0 rgba(255,255,255,.05), var(--shadow-sm);
}
/* flex: 0 0 auto + nowrap — jinak delsi navigace logo zmackne a zalomi na dva radky */
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; flex: 0 0 auto; }
.brand span { color: #8fb7f2; }
.brand:hover { text-decoration: none; }
.topnav { display: flex; align-items: center; gap: .25rem; margin-right: auto; margin-left: 1.4rem; }
.topnav a, .navgroup > summary {
    color: #c3ccdb; font-size: .9rem; padding: .32rem .7rem; border-radius: 999px;
    transition: background .12s, color .12s; white-space: nowrap; cursor: pointer;
}
.topnav a:hover, .navgroup > summary:hover { color: #fff; background: rgba(255,255,255,.09); text-decoration: none; }
.topnav a.active, .navgroup > summary.active { color: #fff; background: rgba(255,255,255,.16); font-weight: 600; }

/* rozbalovaci skupiny (Vedeni / Sprava) */
.navgroup { position: relative; }
.navgroup > summary { display: inline-block; list-style: none; }
.navgroup > summary::-webkit-details-marker { display: none; }
.navgroup > summary::after { content: ' ▾'; font-size: .75em; opacity: .8; }
.navgroup[open] > summary::after { content: ' ▴'; }
/* mezera pod tlacitkem, aby se pri prejezdu na panel nezavrel */
.navgroup[open]::after { content: ''; position: absolute; top: 100%; left: 0; right: 0; height: .4rem; }
.navgroup-menu {
    position: absolute; top: calc(100% + .35rem); left: 0; z-index: 60;
    display: flex; flex-direction: column; gap: .1rem; min-width: 12rem;
    background: var(--topbar); border: 1px solid rgba(255,255,255,.14);
    border-radius: var(--radius); padding: .35rem; box-shadow: var(--shadow);
}
.navgroup-menu a { border-radius: var(--radius-xs); padding: .4rem .6rem; }

/* hamburger — jen na uzkych displejich */
.nav-toggle {
    display: none; background: rgba(255,255,255,.1); color: #fff; border: 0;
    border-radius: var(--radius-xs); font-size: 1.15rem; line-height: 1;
    padding: .3rem .6rem; cursor: pointer; margin-left: auto;
}
.nav-toggle:hover { background: rgba(255,255,255,.18); }
.topbar-user { display: flex; align-items: center; gap: .7rem; }
/* jméno + fotka vedou na vlastní profil */
.me-link {
    display: inline-flex; align-items: center; gap: .5rem; color: #dbe2ee;
    border-radius: 999px; padding: .1rem .5rem .1rem .1rem;
    transition: background .12s, color .12s;
}
.me-link:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.me-link span:not(.avatar) { font-size: .9rem; }
.bell { position: relative; text-decoration: none; font-size: 1.15rem; line-height: 1; }
.bell:hover { text-decoration: none; }
.bell-badge {
    position: absolute; top: -7px; right: -9px; background: var(--danger); color: #fff;
    font-size: .65rem; font-weight: 700; line-height: 1; padding: .12rem .3rem;
    border-radius: 10px; min-width: 1rem; text-align: center; box-shadow: 0 0 0 2px var(--topbar);
}
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.view-as { display: inline-flex; align-items: center; gap: .3rem; }
.view-as select {
    width: auto; background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2);
    font-size: .82rem; padding: .25rem .45rem;
}
.view-as select option { color: #1e2734; }
.viewas-banner {
    display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap;
    background: #fdf0d7; color: #7a5309; border-bottom: 1px solid #edd9a8;
    padding: .5rem 1rem; font-size: .9rem;
}
.viewas-banner form { display: inline; }
.viewas-banner button {
    border: 1px solid #caa53f; background: #fff; color: #7a5309; border-radius: var(--radius-xs);
    padding: .2rem .6rem; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.viewas-banner button:hover { background: #fffaf0; }

.container { max-width: 1120px; margin: 1.5rem auto 3.5rem; padding: 0 1.3rem; }

/* --- komponenty --- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem 1.3rem; margin-bottom: 1.2rem; box-shadow: var(--shadow-sm);
}
.btn {
    display: inline-flex; align-items: center; gap: .45rem;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .44rem .95rem; font-size: .92rem; cursor: pointer; color: var(--text);
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
/* ghost tlacitko na svetlem podkladu (karty, filtry) — puvodni svetla varianta
   (#dbe2ee na bile) byla prakticky neviditelna; tmava zustava jen v topbaru */
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.topbar .btn-ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #dbe2ee; }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.btn-google { border-color: var(--border-strong); font-weight: 600; padding: .58rem 1.1rem; }

.flash { border-radius: var(--radius-sm); padding: .65rem 1rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.flash-ok  { background: #e7f6ea; border: 1px solid #a5dcb0; color: #1b6b32; }
.flash-err { background: #fceaea; border: 1px solid #eaa9a9; color: #a52020; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.count {
    background: var(--primary-soft); color: var(--primary); border-radius: 999px;
    padding: .05rem .5rem; font-size: .8rem; font-weight: 700; vertical-align: middle;
}

/* --- badge stavu a priority --- */
.badge {
    display: inline-block; border-radius: 999px; padding: .1rem .6rem;
    font-size: .78rem; font-weight: 600; white-space: nowrap; line-height: 1.45;
}
.st-backlog     { background: #ececf4; color: #4b4f74; }
.st-new         { background: #e1edfb; color: #1b5bab; }
.st-in_progress { background: #fdf0d7; color: #94660a; }
.st-waiting     { background: #e7e3f7; color: #5b3fa0; }
.st-done        { background: #e2f4e5; color: #1d7a34; }
.st-closed      { background: #e8e9ee; color: #5b6373; }
.pr-low      { background: #eef0f3; color: #5b6373; }
.pr-normal   { background: #e1edfb; color: #1b5bab; }
.pr-high     { background: #fde3d2; color: #a34d0c; }
.pr-critical { background: #fbdada; color: #ab1f1f; }
.badge.urgent { background: var(--danger); color: #fff; letter-spacing: .02em; }
.badge.cat { background: #eef2e4; color: #55622a; }
.badge.member { background: var(--primary-soft); color: var(--primary); }

/* --- hlavicky sekci, formulare --- */
.section-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin: 1.6rem 0 .9rem; flex-wrap: wrap;
}
.form-grid { display: flex; flex-wrap: wrap; gap: .85rem; }
.form-grid label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--text-soft); }
.form-grid .grow { flex: 1 1 220px; }
.form-grid .full { flex: 1 1 100%; }
.form-grid .check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
input[type=text], input[type=email], input[type=date], input[type=search], input[type=url], input[type=number], select, textarea {
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .5rem .65rem;
    font: inherit; background: var(--surface); width: 100%; color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }
/* zaškrtávátko VŽDY na řádku s textem — ne jen uvnitř .form-grid, jinak se
   v bočním panelu úkolu rozsype checkbox nad popisek */
label.check {
    display: flex; flex-direction: row; align-items: center; gap: .45rem;
    font-weight: 500; font-size: .85rem; color: var(--text-soft); cursor: pointer;
}
label.check input[type=checkbox] { width: auto; flex: 0 0 auto; margin: 0; accent-color: var(--primary); }

/* --- dashboard --- */
.proj-cat {
    margin: 1.4rem 0 .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: #5b6678; display: flex; align-items: center; gap: .45rem;
}
.proj-cat:first-of-type { margin-top: .4rem; }
.proj-cat .count { font-weight: 500; color: #8a94a6; }
.proj-cat::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.project-grid + .proj-cat { margin-top: 1.6rem; }
.project-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; color: inherit;
    box-shadow: var(--shadow-sm); transition: box-shadow .14s, border-color .14s, transform .14s;
}
.project-card:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.project-card .code { color: var(--primary); font-weight: 700; font-size: .78rem; letter-spacing: .05em; display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; }
.project-card strong { font-size: 1.02rem; }
.project-card p { margin: 0; font-size: .85rem; }
.archived { margin-top: 1.6rem; }

/* --- tabulka ukolu --- */
table.issues { width: 100%; border-collapse: collapse; }
table.issues th {
    text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 700; padding: .35rem .6rem; border-bottom: 1px solid var(--border);
}
table.issues td { padding: .55rem .6rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.issues tr:last-child td { border-bottom: 0; }
table.issues tbody tr, table.issues tr { transition: background .1s; }
table.issues tr:hover td { background: var(--surface-2); }
td.num a { font-weight: 600; white-space: nowrap; }
td.title { width: 52%; }
td.due.overdue { color: var(--danger); font-weight: 600; }

.filters { display: flex; gap: .55rem; margin-bottom: 1rem; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; }
.filters input[type=search] { flex: 1 1 180px; }
.filter-urgent { display: flex; align-items: center; gap: .35rem; font-size: .9rem; white-space: nowrap; }

/* prepinac urgence v detailu ukolu */
.urgent-toggle { display: flex; flex-direction: column; gap: .2rem; }
.urgent-toggle label.check {
    display: flex; flex-direction: row; align-items: center; gap: .5rem;
    font-size: .92rem; color: var(--text-soft); cursor: pointer;
}
.urgent-toggle label.check input { width: auto; margin: 0; }
.urgent-toggle.is-on label.check { color: var(--danger); font-weight: 600; }

.breadcrumb { font-size: .86rem; margin-bottom: .7rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.project-desc { margin: 0 0 1rem; }

/* --- detail ukolu --- */
.issue-key { color: var(--muted); font-weight: 600; }
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 1.4rem; margin-top: 1rem; }
.issue-side {
    /* DVOUSLOUPCOVA mrizka — kratka pole vedle sebe, panel se musi vejit
       na obrazovku cely (delsi bloky maji grid-column 1/-1 nize) */
    align-self: start; display: grid; grid-template-columns: 1fr 1fr;
    gap: .55rem .7rem; align-items: end; position: sticky; top: 4.2rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .9rem 1.1rem; box-shadow: var(--shadow-sm);
}
.issue-side > .timer-box, .issue-side > .spent-box, .issue-side > .side-more,
.issue-side > .hold-box, .issue-side > .hand-btn, .issue-side > .hand-form,
.issue-side > .danger-zone, .issue-side > form:has(select[name=assignee_id]),
.issue-side > form:has(select[name=status]), .issue-side > p { grid-column: 1 / -1; }
.issue-side > .card { border: 0; box-shadow: none; padding: 0; margin: 0; }
.issue-side form { margin: 0; }
.issue-side label { display: flex; flex-direction: column; gap: .3rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.issue-side label.ro span { font-size: .95rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text); }
/* zridka pouzivana nastaveni jsou sbalena, at je casovac a stav videt bez scrollu */
.side-more { border-top: 1px solid var(--border); padding-top: .6rem; }
.side-more > summary {
    cursor: pointer; list-style: none; display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
.side-more > summary::-webkit-details-marker { display: none; }
.side-more > summary::before { content: "▸"; font-size: .7rem; transition: transform .12s; }
.side-more[open] > summary::before { transform: rotate(90deg); }
.side-more > summary .on { font-weight: 400; letter-spacing: .15em; }
.side-more > :not(summary) { margin-top: .7rem; }
.issue-desc { white-space: normal; line-height: 1.6; }
/* obrazky v popisech a komentarich (markdown ![](…)) + galerie priloh */
.md img, .tl-comment img { max-width: 100%; max-height: 420px; border-radius: 8px; border: 1px solid var(--border); display: block; margin: .4rem 0; }
.attach-grid { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: .6rem; }
.attach-item { margin: 0; width: 148px; }
.attach-item img { width: 148px; height: 100px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.attach-item a:hover img { border-color: var(--primary); }
.attach-item figcaption { display: flex; align-items: center; gap: .25rem; margin-top: .2rem; }
.attach-item .link-remove { display: inline; }
.attach-add { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.attach-files { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.attach-files li { display: flex; align-items: center; gap: .5rem; }
/* globalni hledani v hlavicce (.topnav ma margin-right:auto, netlacime se) */
.topbar-search { margin: 0 .2rem; flex: 0 1 14rem; }
.topbar-search input {
    width: 100%; padding: .32rem .7rem; font-size: .85rem; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff;
}
.topbar-search input::placeholder { color: #8b95a7; }
.topbar-search input:focus { background: #fff; color: var(--text); outline: none; }
mark { background: #fde68a; border-radius: 3px; padding: 0 .1rem; }
.people-hits li { display: flex; align-items: center; gap: .6rem; }
.people-hits .avatar { width: 26px; height: 26px; border-radius: 50%; }
.people-hits .avatar-init { display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: .75rem; font-weight: 700; color: var(--muted); }
.watch-form { display: flex; align-items: center; gap: .5rem; }
/* oprava vykazu primo z kalendare (tuzka u polozky + modal) */
.cal-item-row { display: flex; align-items: center; gap: .1rem; }
.cal-item-row .cal-item { flex: 1 1 auto; min-width: 0; }
.cal-fix { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 .1rem; opacity: 0; font-size: .8rem; }
.cal-item-row:hover .cal-fix { opacity: 1; }
.cal-fix:hover { color: var(--primary); }
.cal-fix-modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; display: flex; align-items: center; justify-content: center; }
.cal-fix-modal .card { width: min(430px, 92vw); display: flex; flex-direction: column; gap: .55rem; margin: 0; }
.cal-fix-modal label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.cal-fix-actions { display: flex; gap: .5rem; }
/* inline SVG ikony — dedi barvu, sedi na ucaru textu */
.ico {
    width: 1em; height: 1em; display: inline-block; vertical-align: -.125em;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    flex: 0 0 auto;
}
.ico-play polygon { fill: currentColor; stroke-width: 1; }
@media (max-width: 900px) { .topbar-search { display: none; } }
/* vyhrazeni epiku konkretnim lidem */
.epic-only { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.epic-only .chip {
    display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.epic-only .chip form { display: inline; margin: 0; }
.epic-only-add { display: inline-flex; gap: .3rem; align-items: center; margin: 0; }
.epic-only-add select { width: auto; }
.attach-add input[type=file] { flex: 0 1 auto; }
.attach-add input[type=url] { flex: 1 1 14rem; }

.timeline { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.2rem; }
.tl-event { font-size: .88rem; color: var(--text-soft); padding-left: .2rem; }
.tl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); margin-right: .5rem; }
.tl-comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.tl-comment .tl-head {
    display: flex; align-items: center; gap: .5rem;
    padding: .55rem .9rem; border-bottom: 1px solid var(--border-soft); background: var(--surface-2);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tl-comment .tl-body { padding: .75rem .9rem; line-height: 1.55; }
.comment-form { display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.comment-form textarea { width: 100%; }

/* --- manazersky prehled --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin: 1rem 0 1.5rem; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--primary);
    border-radius: var(--radius); padding: .9rem 1.1rem .8rem;
    display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow-sm);
}
.stat-card .n { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--topbar); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-card .n.n-sm { font-size: 1.15rem; padding: .35rem 0 .2rem; }
.stat-card .l { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-card.neutral { border-top-color: var(--muted-2); }
.stat-card.urgent-card { border-top-color: var(--danger); background: #fff7f7; }
.stat-card.urgent-card .n { color: var(--danger); }
.stat-card.crit { border-top-color: #d64545; }
.stat-card.crit .n { color: #ab1f1f; }
.stat-card.warn { border-top-color: #e08a3c; }
.stat-card.warn .n { color: #a34d0c; }
.stat-card.ok { border-top-color: #3aa65c; }
.stat-card.ok .n { color: #1d7a34; }
select.inline { width: auto; font-size: .85rem; padding: .28rem .45rem; }

/* karty jsou zaroven prepinac pohledu */
a.stat-card { text-decoration: none; transition: box-shadow .12s, transform .12s; }
a.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
a.stat-card.is-active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

/* filtry a skupiny v prehledu */
.mgr-filters {
    position: sticky; top: 3.9rem; z-index: 20;
    background: var(--bg); padding: .5rem 0; margin-bottom: .6rem;
}
.filter-group { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); white-space: nowrap; }
/* na mobilu jsou filtry na vic radku — prilepene by zabraly pul obrazovky */
@media (max-width: 760px) { .mgr-filters { position: static; } }
.mgr-list .mgr-group {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: .55rem; background: var(--surface);
}
.mgr-group > summary {
    display: flex; align-items: center; gap: .5rem; cursor: pointer;
    padding: .45rem .7rem; font-weight: 600; list-style-position: inside;
}
.mgr-group > summary:hover { background: var(--surface-2); }
.mgr-group[open] > summary { border-bottom: 1px solid var(--border); }
.mgr-group table { margin: 0; }
.mgr-idle { margin-top: .6rem; }
.mgr-idle > summary { cursor: pointer; font-size: .9rem; color: var(--muted); }

table.issues.compact th, table.issues.compact td { padding: .3rem .5rem; }
table.issues.compact td { font-size: .9rem; }
th.c-check, td.c-check { padding-right: 0; }
/* presence badge na profilu (online/obed/odesel/v praci/dovolena) */
.badge.presence { font-weight: 600; }
.badge.p-on    { background: #e7f7ee; color: #0f7b3d; }
.badge.p-in    { background: #e8f1fe; color: #1d4fd7; }
.badge.p-lunch { background: #fef3e2; color: #9a5b0f; }
.badge.p-out   { background: #f1f3f7; color: #5b6678; }
.badge.p-vac   { background: #fdeef4; color: #b02a63; }
.badge.p-off   { background: #f1f3f7; color: #5b6678; }
th.c-check input, td.c-check input { width: auto; margin: 0; cursor: pointer; }

/* --- manazersky prehled v2: KPI pilulky + filtr-lista + dva sloupce -------- */
.mgr-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.mgr-head h1 { margin: 0; }
.mgr-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.mgr-pill {
    display: inline-flex; align-items: baseline; gap: .35rem; padding: .3rem .75rem;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
    font-size: .82rem; color: var(--muted); box-shadow: var(--shadow-sm); white-space: nowrap;
}
.mgr-pill b { font-size: 1rem; color: var(--text); font-variant-numeric: tabular-nums; }
.mgr-pill:hover { border-color: var(--primary); text-decoration: none; }
.mgr-pill.is-active { border-color: var(--primary); background: #eef4fe; color: var(--primary); }
.mgr-pill.is-active b { color: var(--primary); }
.mgr-pill.tone-red b { color: #b91c1c; }
.mgr-pill.tone-orange b { color: #b45309; }
.mgr-pill.tone-green b { color: #15803d; }
.mgr-pill.is-static { cursor: default; }
.mgr-filterbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .5rem .7rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.mgr-filterbar select, .mgr-filterbar input[type=search] { padding: .3rem .55rem; font-size: .85rem; width: auto; }
.mgr-filterbar input[type=search] { flex: 1 1 10rem; min-width: 8rem; }
.mgr-filter-right { display: flex; gap: .45rem; align-items: center; margin-left: auto; }
.mgr-cols { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.mgr-side { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 4.2rem; }
.mgr-hint { font-weight: 400; }
@media (max-width: 1200px) { .mgr-cols { grid-template-columns: 1fr; } .mgr-side { position: static; } }
/* Ted se pracuje — kompaktni radky */
.mgr-now .timer-live { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.mgr-now .timer-live li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .45rem; font-size: .85rem; }
.mgr-now .tmr-clock { font-size: .95rem; }
.mgr-now .tmr-issue { flex-basis: 100%; padding-left: .1rem; }
.mgr-now .tmr-since { margin-left: auto; }
/* Vytizeni — radky s mini barem misto tabulky */
.load-rows { display: flex; flex-direction: column; }
.load-row {
    display: grid; grid-template-columns: 1fr auto; gap: .1rem .5rem; align-items: baseline;
    padding: .4rem .35rem; border-radius: var(--radius-sm); color: inherit;
}
.load-row:hover { background: var(--surface-2); text-decoration: none; }
.lr-name { font-size: .88rem; font-weight: 500; }
.lr-nums { display: flex; align-items: baseline; gap: .5rem; font-variant-numeric: tabular-nums; }
.lr-nums b { font-size: .95rem; }
.lr-urgent { color: #b91c1c; font-size: .8rem; display: inline-flex; align-items: center; gap: .1rem; }
.lr-bar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.lr-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* sloupce stejne siroke ve vsech skupinach, at oko nepreskakuje */
table.mgr-table { table-layout: fixed; }
table.mgr-table col.w-check  { width: 2rem; }
table.mgr-table col.w-key    { width: 6rem; }
table.mgr-table col.w-status { width: 6.2rem; }
table.mgr-table col.w-prio   { width: 5.6rem; }
table.mgr-table col.w-due    { width: 6.6rem; }
table.mgr-table col.w-who    { width: 9.5rem; }
table.mgr-table td.title { overflow-wrap: anywhere; }
/* nazev vlevo, badge Urgentni + epic zarovnane VPRAVO na pevne pozici —
   nalepene za ruzne dlouhymi nazvy poskakovaly a sloupec se nedal cist.
   Flex je na vnitrnim wrapperu (.t-flex) — na <td> by rozbil table layout. */
table.mgr-table .t-flex { display: flex; align-items: center; gap: .45rem; }
table.mgr-table .t-flex > a { flex: 1 1 auto; min-width: 0; }
table.mgr-table tbody tr:nth-child(even) td { background: #fbfcfe; }
table.mgr-table tbody tr:hover td { background: var(--surface-2); }
/* epic jen jako tichy stitek za nazvem, ne dalsi barevny badge */
.row-epic {
    display: inline-block; max-width: 14rem; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; vertical-align: bottom;
    font-size: .76rem; color: var(--muted); margin-left: .35rem;
}
.row-epic::before { content: "· "; }
/* select resitele je videt az pod mysi — jinak je v tabulce 60 ramecku */
select.inline.quiet { border-color: transparent; background-color: transparent; max-width: 100%; }
tr:hover select.inline.quiet, select.inline.quiet:focus { border-color: var(--border-strong); background-color: var(--surface); }
@media (max-width: 760px) {
    table.mgr-table { table-layout: auto; }
    select.inline.quiet { border-color: var(--border-strong); background-color: var(--surface); }
}

/* lista hromadnych akci — plave nad obsahem, dokud je neco vybrano */
.bulk-bar {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 45;
    width: min(1120px, calc(100vw - 1.6rem));
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    background: var(--topbar); color: #fff;
    border-radius: var(--radius); padding: .55rem .8rem;
    box-shadow: var(--shadow-lg);
}
.bulk-bar[hidden] { display: none; }
.bulk-count { font-size: .9rem; margin-right: .3rem; }
.bulk-act { display: inline-flex; align-items: center; gap: .3rem; }
.bulk-bar select { width: auto; }
.bulk-bar .btn {
    background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .28);
}
.bulk-bar .btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* --- feed posledni aktivity --- */
.feed { display: flex; flex-direction: column; }
.feed-item {
    display: flex; gap: .55rem; align-items: baseline; flex-wrap: wrap;
    padding: .5rem 0; border-bottom: 1px solid var(--border-soft); font-size: .9rem;
}
.feed-item:last-child { border-bottom: 0; }
.feed-key { font-weight: 600; white-space: nowrap; }
.feed-title { color: var(--text); }
.feed-what { color: var(--text-soft); }

/* --- kategorie, clenstvi, plany --- */
.project-meta { margin: -.3rem 0 .9rem; }
.members-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-bottom: .8rem; }
.member-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
    padding: .16rem .35rem .16rem .7rem; font-size: .85rem; box-shadow: var(--shadow-sm);
}
.member-chip form { display: inline-flex; }
.member-chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted-2); font-size: 1rem; line-height: 1; padding: 0 .3rem; }
.member-chip button:hover { color: var(--danger); }
/* robot = automat na projektu; preskrtnuty (no-auto) = clen vyjmuty z rozdelovani */
.member-chip .bot-toggle { padding: 0 .15rem; }
.member-chip .bot-toggle:hover { color: var(--primary); }
.member-chip.no-auto { border-style: dashed; color: var(--muted); }
.member-chip.no-auto .bot-toggle, .member-chip.no-auto > .ico-bot-off { color: var(--danger); }
.member-add select { border-style: dashed; color: var(--muted); }
.group-chip { background: #efeaf9; border-color: #d6c9f0; }

.progress { width: 120px; height: 8px; background: #e8eaef; border-radius: 999px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: .4rem; }
.progress .bar { height: 100%; background: #3aa65c; border-radius: 999px; transition: width .3s; }
.progress.over .bar { background: var(--danger); }
.cell-progress { white-space: nowrap; }

.avatar-lg { width: 40px; height: 40px; border-radius: 50%; vertical-align: middle; object-fit: cover; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin: .25rem 0; }

/* --- epiky --- */
.epics-head { margin-top: 1.8rem; }
.epic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.epic-card {
    background: var(--surface); border: 1px solid var(--border); border-left: 4px solid #7c5cbf;
    border-radius: var(--radius); padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; color: inherit;
    box-shadow: var(--shadow-sm); transition: box-shadow .14s, transform .14s;
}
.epic-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.epic-card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.epic-tag, .epic-card .epic-tag { background: #efeaf9; color: #5b3fa0; font-size: .68rem; font-weight: 700; letter-spacing: .06em; padding: .12rem .45rem; border-radius: var(--radius-xs); }
.progress.big { width: 100%; height: 12px; }
.epic-progress-row { display: flex; align-items: center; gap: .8rem; margin: .4rem 0 1.2rem; }
.epic-progress-row .progress { flex: 1; height: 12px; max-width: 400px; }

/* --- fronta ukolu --- */
.queue-waiting { background: #fbfaf6; }
.queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.queue-list li { display: flex; align-items: center; gap: .5rem; padding: .45rem .3rem; border-bottom: 1px solid var(--border-soft); color: var(--muted); }
.queue-list li:last-child { border-bottom: 0; }
.q-lock { flex: none; }
.q-key { font-weight: 600; color: #8a92a6; white-space: nowrap; }
.q-title { flex: 1; }
.q-active-row td { background: #f0f9f2; }
.q-move { white-space: nowrap; }
.q-move form { display: inline; }
.q-move button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 5px; cursor: pointer; padding: .1rem .4rem; font-size: .9rem; color: var(--text-soft); }
.q-move button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.wip-form { display: flex; align-items: flex-end; gap: .5rem; }
.wip-label { display: flex; flex-direction: column; font-size: .82rem; color: var(--text-soft); gap: .2rem; font-weight: 600; }
.wip-label input { width: 5rem; }

.locked-box { text-align: center; padding: 3rem 1.5rem; max-width: 560px; margin: 2.5rem auto; }
.locked-ico { font-size: 2.8rem; margin-bottom: .5rem; }
.locked-box h1 { font-size: 1.25rem; margin-bottom: .8rem; }

/* --- vytizeni v case (byvala casova osa) --- */
/* na uzkem displeji se mrizka posouva uvnitr karty, at nepretece stranka */
.load-scroll { overflow-x: auto; }
.load-grid {
    display: grid;
    grid-template-columns: 13rem repeat(var(--cols), minmax(2.4rem, 1fr));
    gap: 2px 3px; align-items: end;
}
.lg-head {
    font-size: .7rem; color: var(--muted); text-align: center; padding-bottom: .2rem;
    white-space: nowrap; overflow: hidden;
}
.lg-head.is-now { color: var(--danger); font-weight: 700; }
.lg-now { display: block; font-size: .6rem; letter-spacing: .04em; text-transform: uppercase; }
.lg-name {
    display: flex; flex-direction: column; gap: .05rem; font-size: .88rem;
    padding: .2rem .5rem .2rem 0; align-self: center; min-width: 0;
}
.lg-name > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-cell {
    position: relative; height: 66px; display: flex; align-items: flex-end; justify-content: center;
    background: var(--surface-2); border-radius: var(--radius-xs); overflow: hidden;
}
.lg-cell.is-now { box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .35); }
.lg-bar { display: block; width: 100%; border-radius: var(--radius-xs) var(--radius-xs) 0 0; }
.lg-free { background: transparent; }
.lg-ok   { background: #9dd3ac; }
.lg-full { background: #f0c674; }
.lg-over { background: #e98b8b; }
.lg-off  { background: repeating-linear-gradient(45deg, #e3e7ee 0 4px, #f2f4f8 4px 8px); }
.lg-num {
    position: absolute; top: .2rem; left: 0; right: 0; text-align: center;
    font-size: .68rem; font-weight: 700; color: var(--text-soft); font-variant-numeric: tabular-nums;
}
.lg-t-over { color: #a51616; }
.load-legend { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; margin-top: .9rem; }
.lg-key { display: inline-block; width: 15px; height: 10px; border-radius: 3px; margin-left: .5rem; }
.lg-key.lg-ok { background: #9dd3ac; }
.lg-key.lg-full { background: #f0c674; }
.lg-key.lg-over { background: #e98b8b; }
.lg-key.lg-off { background: repeating-linear-gradient(45deg, #e3e7ee 0 4px, #f2f4f8 4px 8px); }
@media (max-width: 900px) {
    .load-grid { grid-template-columns: 7rem repeat(var(--cols), minmax(1.8rem, 1fr)); }
    .lg-cell { height: 54px; }
    .lg-name { font-size: .8rem; }
}
/* --- minutovnik (vykazy po skupinach a lidech) --- */
.mt-person { border-top: 1px solid var(--border); padding: .3rem 0; }
.mt-person:first-of-type { border-top: 0; }
.mt-person > summary {
    display: flex; align-items: center; gap: .6rem; cursor: pointer; padding: .3rem 0; font-weight: 600;
}
.mt-person > summary:hover .mt-name { color: var(--primary); }
.mt-table { table-layout: fixed; margin-bottom: .4rem; }
.mt-table col.w-date { width: 8.5rem; }
.mt-table col.w-time { width: 6.5rem; }
.mt-table td { vertical-align: top; }
.mt-day, .mt-time { white-space: nowrap; }
.mt-item { padding: .1rem 0; overflow-wrap: anywhere; }
.mt-key { font-weight: 600; white-space: nowrap; margin-right: .25rem; }
.mt-note { color: var(--muted); }
.mt-comment {
    color: var(--text-soft); font-size: .85rem; border-left: 2px solid var(--border-strong);
    padding-left: .5rem; margin: .15rem 0 .15rem .2rem;
}
.mt-nocomment { color: #a34d0c; font-size: .76rem; margin-left: .3rem; }

/* --- kapacity --- */
.cap-user { margin-top: 1.2rem; }
.cap-user h3 { font-size: .95rem; margin: 0 0 .3rem; }

/* --- markdown --- */
.md-bar { display: flex; gap: .25rem; align-items: center; margin-bottom: .3rem; flex-wrap: wrap; }
.md-bar button {
    border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-xs);
    cursor: pointer; font-size: .8rem; padding: .15rem .45rem; color: var(--text-soft); min-width: 1.8rem;
}
.md-bar button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.md-hint { font-size: .72rem; color: var(--muted); margin-left: .2rem; }
.md h3, .md h4, .md h5 { margin: .8rem 0 .3rem; font-size: 1rem; }
.md p { margin: .5rem 0; }
.md ul, .md ol { margin: .5rem 0; padding-left: 1.4rem; }
.md li { margin: .2rem 0; }
.md code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .25rem; font-size: .9em; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: .7rem .9rem; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; }
.md blockquote { margin: .5rem 0; padding: .3rem .9rem; border-left: 3px solid var(--border-strong); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: .9rem 0; }
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }

/* --- pozdrzeni / blokace --- */
.hold-banner {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #f3f0fc; border: 1px solid #d6c9f0; color: #4b3a7a;
    border-radius: var(--radius); padding: .7rem 1rem; margin: .8rem 0 0;
}
.hold-banner.is-expired { background: #fdf2e7; border-color: #edc9a3; color: #7a4e12; }
/* rozjeto bez planu — seda zona, ktera musi byt videt */
.plan-banner {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: #fff5e6; border: 1px solid #f0d3a0; color: #8a5300;
    border-radius: var(--radius); padding: .7rem 1rem; margin: .8rem 0 0;
}
.plan-banner .muted { color: #a5763a; }
.hold-box { display: flex; flex-direction: column; gap: .5rem; }
.hold-form { display: flex; flex-direction: column; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem; }
.hold-form label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.blocking-card { border-left: 4px solid var(--danger); background: #fff8f8; }

/* --- mazani / nebezpecne akce --- */
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.danger-zone { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .2rem; }
.tl-del { display: inline; }

/* --- korekce vykazaneho casu --- */
.wl-table td { padding: .4rem .5rem; }
.wl-fix { display: flex; gap: .3rem; align-items: center; }
.wl-fix input[type=text] { width: 6rem; padding: .25rem .4rem; font-size: .85rem; }
.wl-fix .btn { padding: .2rem .5rem; font-size: .8rem; }
.wl-actions { text-align: right; }
.table-scroll { overflow-x: auto; }

/* --- organizacni struktura --- */
.org-table td { vertical-align: middle; }
.org-inactive td { opacity: .55; }
.org-edit-row td { background: var(--surface-2); padding: .9rem; }
.org-delete { margin-top: .7rem; }
.user-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--border-strong); }
.user-link:hover { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }
.mute-form { display: inline; }

/* --- ukolnicek --- */
.notes { padding: 0; }
.note { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-bottom: 1px solid var(--border-soft); color: inherit; transition: background .1s; }
.note:last-child { border-bottom: 0; }
.note:hover { background: var(--surface-2); text-decoration: none; }
.note.unread { background: var(--primary-soft); }
.note.unread:hover { background: #dfeafd; }
.note.unread .note-body { font-weight: 600; }
.note-ico { flex: none; font-size: 1.15rem; }
.note-body { flex: 1; }
.note-key { color: var(--primary); font-weight: 600; margin-right: .35rem; }
.note-time { flex: none; white-space: nowrap; }

/* --- plovouci widget casovace --- */
.timer-widget {
    position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 50;
    background: var(--topbar); color: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); max-width: 480px;
}
.tw-main { display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem; padding: .45rem .6rem; }
.tw-clock { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #7fe0a0; white-space: nowrap; }
.tw-issue { color: #cdd6e4; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 3rem; }
.tw-issue:hover { color: #fff; }
.tw-issue strong { color: #8fb7f2; }
.tw-note-btn, .tw-stop button, .tw-stop a {
    border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
    border-radius: var(--radius-xs); padding: .32rem .48rem; font-size: .95rem; line-height: 1;
}
.tw-note-btn:hover, .tw-stop button:hover, .tw-stop a:hover { background: rgba(255,255,255,.24); }
.tw-stop { display: inline-flex; }
.tw-note { display: flex; flex-direction: column; gap: .4rem; padding: 0 .75rem .75rem; }
.tw-note textarea { width: 100%; background: #fff; color: var(--text); border-radius: var(--radius-xs); border: 0; padding: .45rem; }
@media (max-width: 560px) { .timer-widget { left: 1.1rem; right: 1.1rem; max-width: none; } }

/* jemna tuzka pro editaci */
.edit-pencil { border: 0; background: transparent; cursor: pointer; color: var(--muted-2); font-size: .95rem; padding: 0 .3rem; vertical-align: middle; border-radius: 4px; }
.edit-pencil:hover { color: var(--primary); }
.edited-note { margin: .7rem 0 0; }

/* --- casovac v detailu --- */
/* kompakt: hodiny nahore, tlacitka VEDLE sebe — panel musi byt kratky */
.timer-box { display: flex; flex-flow: row wrap; align-items: center; gap: .45rem .5rem; padding: .6rem .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.timer-box form { margin: 0; }
.timer-box p { flex-basis: 100%; margin: 0; }
.timer-running { flex-basis: 100%; display: flex; align-items: baseline; gap: .5rem; }
.timer-clock { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--primary); line-height: 1; }

/* --- GitHub odkazy --- */
.links-box .link-list { list-style: none; margin: 0 0 .7rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.links-box .link-list li { display: flex; align-items: center; gap: .5rem; }
.link-ico { flex: none; }
.link-remove { display: inline-flex; }
.link-remove button { border: 0; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.link-remove button:hover { color: var(--danger); }
.link-add { display: flex; gap: .5rem; flex-wrap: wrap; }
.link-add input[type=url] { flex: 2 1 240px; }
.link-add input[type=text] { flex: 1 1 140px; }

/* --- editace komentaru --- */
.tl-edit-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted-2); font-size: .9rem; margin-left: auto; padding: 0 .3rem; border-radius: 4px; }
.tl-edit-btn:hover { color: var(--primary); }
.tl-edit { padding: .7rem .9rem; display: flex; flex-direction: column; gap: .5rem; }
.tl-edit textarea { width: 100%; }
.tl-edit-actions { display: flex; gap: .5rem; }
.btn-ghost-light { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost-light:hover { background: var(--surface-2); }
.tl-body.old { background: #fbf3f3; border-left: 3px solid #eba7a7; padding: .5rem .7rem; border-radius: var(--radius-xs); }

/* --- kalendar vykazu --- */
.cal-nav { display: flex; gap: .3rem; }
.cal { width: 100%; table-layout: fixed; border-collapse: collapse; }
.cal th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .2rem; }
.cal-day {
    vertical-align: top; height: 6.5rem; border: 1px solid var(--border);
    padding: .25rem; font-size: .8rem;
}
.cal-day.is-out { background: var(--surface-2); opacity: .5; }
.cal-day.is-free { background: var(--surface-3); }
.cal-day.is-leave { background: #eef7f1; }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-head { display: flex; justify-content: space-between; align-items: baseline; }
.cal-num { font-weight: 700; color: var(--muted); }
.cal-sum { font-weight: 700; font-variant-numeric: tabular-nums; color: #17794a; }
/* v bunce dne: nad vykazanym casem cisty cas z pipaku (pritomnost minus obed) */
.cal-times { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.cal-pipak { font-size: .68rem; font-weight: 700; color: var(--primary); white-space: nowrap; cursor: help; }
.cal-leave { color: #17794a; font-size: .72rem; }
.cal-diff { font-size: .7rem; font-weight: 700; text-align: right; }
.cal-diff.is-over { color: #8a5300; }
.cal-diff.is-under { color: var(--muted-2); }
.timer-widget.is-paused { background: #4b5563; }
.cal-item {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: .05rem .2rem; border-radius: 3px; background: var(--primary-soft); color: var(--primary);
    margin-top: .15rem; font-size: .72rem;
}
.cal-item:hover { filter: brightness(.95); }
@media (max-width: 700px) {
    .cal-day { height: auto; min-height: 3.5rem; }
    .cal-item { font-size: .66rem; }
}

/* --- automat: obtiznost v radku --- */
.aut-diff { display: flex; gap: .25rem; white-space: nowrap; }
.aut-diff select { font-size: .78rem; padding: .15rem .2rem; }

/* --- ajax toast + blik ulozeni --- */
.pm-toast {
    position: fixed; right: 1.1rem; bottom: 4.2rem; z-index: 90;
    padding: .5rem .8rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
    font-size: .88rem; color: #fff; opacity: 0; transform: translateY(8px);
    transition: opacity .25s, transform .25s; max-width: min(420px, 90vw);
}
.pm-toast.show { opacity: 1; transform: none; }
.pm-toast.is-ok { background: #17794a; }
.pm-toast.is-err { background: #ab1f1f; }
.pm-toast + .pm-toast { bottom: 7.4rem; }
@keyframes pm-saved { from { background: #e8f5ec; } to { background: transparent; } }
form.saved-ok { animation: pm-saved 1.2s ease-out; }
@keyframes pm-savederr { from { background: #fbdada; } to { background: transparent; } }
form.saved-err { animation: pm-savederr 1.2s ease-out; }

/* --- muj tym (soukrome poznamky) --- */
.tym-table { table-layout: fixed; }
.tym-table .w-name { width: 13rem; }
.tym-table .w-ctx { width: 11rem; }
.tym-table .w-acts { width: 5.5rem; }
.tym-table td { vertical-align: top; }
.tym-note { width: 100%; resize: vertical; font-size: .85rem; }
.tym-table td.note-stale { background: #fff5e6; box-shadow: inset 3px 0 0 #e8a33d; }
.tym-table td.note-none { background: var(--surface-3); }

/* --- prehled dochazky --- */
.att-table { table-layout: fixed; }
.att-table th.att-name, .att-table td.att-name { width: 12rem; text-align: left; }
.att-table th.att-day { font-size: .68rem; padding: .2rem .1rem; text-align: center; }
.att-cell { text-align: center; padding: .2rem .1rem; font-size: .8rem; position: relative; }
/* pipl na terminalu — modra tecka v rohu bunky; neshoda s tabulkou = cerveny ram */
.beep-dot { position: absolute; right: 2px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: #2563eb; }
.att-cell.att-clash { box-shadow: inset 0 0 0 2px #ab1f1f; }
/* prepsana hodnota — oranzovy ruzek, detail v bubline a v tabulce pod prehledem */
.att-cell.att-edited::after {
    content: ""; position: absolute; top: 0; right: 0;
    border-style: solid; border-width: 0 .55rem .55rem 0;
    border-color: transparent #d97706 transparent transparent;
}
.att-cell.is-today.att-clash { box-shadow: inset 0 0 0 2px #ab1f1f, inset 0 0 0 4px var(--primary); }
.att-work { color: #17794a; font-weight: 700; }
.att-home { color: #17794a; font-weight: 700; font-size: .68rem; }
.att-vacation { color: #2563eb; font-weight: 700; }
.att-absent { color: var(--muted-2); }
.att-missing, .att-cell.att-missing { color: #ab1f1f; font-weight: 700; background: #fbdada; }
.att-cell.is-free, .att-table th.is-free { background: var(--surface-3); }
.att-cell.is-today, .att-table th.is-today { box-shadow: inset 0 0 0 2px var(--primary); }

/* --- dokonceni casovace (rozdeleni casu) --- */
.tf-table input[type=text] { width: 100%; }
.tf-note { min-width: 12rem; }
.tf-add { display: flex; gap: .5rem; margin: .6rem 0; }
.tf-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.timer-widget.is-pending { background: #8a5300; }
/* uzavreny rozpocet: fond nerozdelenych minut + krokovani po 5 */
.tf-fund {
    display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
    padding: .5rem .7rem; margin-bottom: .6rem; border-radius: var(--radius-xs);
    background: var(--surface-2); border: 1px solid var(--border);
}
.tf-fund.has-fund { background: #fff5e6; border-color: #f0d3a0; }
.tf-fund.has-fund strong { color: #8a5300; }
.tf-min { white-space: nowrap; }
.tf-min .tf-minutes { width: 5rem; text-align: right; font-variant-numeric: tabular-nums; }
.tf-step { padding: .2rem .45rem; font-size: .8rem; }
#tf-submit:disabled { opacity: .55; cursor: not-allowed; }

/* --- nesrovnalosti: tabulka, kde se opravuje na miste --- */
.fix-table { table-layout: fixed; width: 100%; }
.fix-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fix-table td { vertical-align: middle; }
.fix-key { max-width: 26rem; }
.fix-title { display: block; color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* svítí to, co chybí */
.fix-bad { background: #fff5e6; box-shadow: inset 3px 0 0 #e8a33d; }
.fix-bad input, .fix-bad select { border-color: #e8a33d; }
.fix-ok { color: var(--muted); }
.fix-table input.inline, .fix-table select.inline { width: 100%; min-width: 6rem; }
.fix-table input.fix-est { min-width: 4.5rem; }
.fixup-list { list-style: none; margin: .5rem 0 .3rem; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.fixup-list li { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.fixup-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* --- bezici casovace v manazerskem prehledu --- */
.timer-live { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.timer-live li {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .35rem .5rem; border-radius: var(--radius-xs); background: var(--surface-2);
}
.timer-live li.is-long { background: #fff5e6; }
.tmr-clock { font-weight: 700; font-variant-numeric: tabular-nums; color: #17794a; min-width: 4.2rem; }
.timer-live li.is-long .tmr-clock { color: #8a5300; }
.tmr-who { min-width: 9rem; }
.tmr-issue { flex: 1 1 12rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- vazby mezi ukoly --- */
.rel-box .rel-list li { flex-wrap: wrap; }
.rel-label { flex: none; color: var(--muted); font-size: .8rem; text-transform: lowercase; min-width: 6.5rem; }
.rel-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-list a.is-done, .issue-ref.is-done { text-decoration: line-through; opacity: .65; }
.rel-warn {
    margin: 0 0 .7rem; padding: .45rem .6rem; font-size: .87rem;
    background: #fff5e6; border: 1px solid #f0d3a0; border-radius: var(--radius-xs); color: #8a5300;
}
.rel-add select { flex: 1 1 9rem; }
.rel-add input[type=text] { flex: 1 1 7rem; }
.issue-ref { font-weight: 600; white-space: nowrap; }

/* --- zminky --- */
.mention { background: var(--primary-soft); color: var(--primary); border-radius: 4px; padding: 0 .2rem; font-weight: 600; white-space: nowrap; }

/* --- organizacni schema: plocha na celou sirku, taha se a zoomuje --- */
.container-wide { max-width: none; }
.org-canvas {
    position: relative; overflow: auto;                 /* bez JS aspon scroll */
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-sm);
}
/* plocha se taha, takze na ni nema co oznacovat text (jinak zmodra pri kazdem tahnuti) */
.org-canvas.is-canvas { overflow: hidden; cursor: grab; user-select: none; -webkit-user-select: none; }
.org-canvas.is-canvas.is-dragging { cursor: grabbing; }
.oc-stage { padding: 1.6rem; width: max-content; }
.org-canvas.is-canvas .oc-stage {
    position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform;
}
.oc-tools {
    position: absolute; top: .7rem; right: .7rem; z-index: 3;
    display: flex; gap: .25rem; background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: .2rem; box-shadow: var(--shadow-sm);
}
.oc-tools button {
    border: 0; background: transparent; cursor: pointer; color: var(--text-soft);
    font: 600 .85rem/1 inherit; padding: .35rem .55rem; border-radius: var(--radius-xs);
    min-width: 2rem;
}
.oc-tools button:hover { background: var(--primary-soft); color: var(--primary); }
.oc-hint { position: absolute; left: .9rem; bottom: .5rem; z-index: 3; margin: 0; pointer-events: none; }

.oc-tree, .oc-tree ul {
    display: flex; justify-content: center; align-items: flex-start;
    list-style: none; margin: 0; padding: 1.1rem 0 0; position: relative;
}
.oc-tree li { position: relative; padding: 1.1rem .3rem 0; text-align: center; list-style: none; }
/* lokty ke sourozencum */
.oc-tree li::before, .oc-tree li::after {
    content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 1.1rem;
    border-top: 1px solid var(--border-strong);
}
.oc-tree li::after { right: auto; left: 50%; border-left: 1px solid var(--border-strong); }
.oc-tree li:only-child::before, .oc-tree li:only-child::after { display: none; }
.oc-tree li:first-child::before, .oc-tree li:last-child::after { border-top: 0; }
.oc-tree li:last-child::before { border-right: 1px solid var(--border-strong); }
/* svisly svod od rodice k rade deti */
.oc-tree ul::before {
    content: ''; position: absolute; top: 0; left: 50%; height: 1.1rem;
    border-left: 1px solid var(--border-strong);
}
/* vrchol muze byt vic lidi — tam spojnice nekreslime */
.oc-tree { padding-top: 0; gap: 2rem; }
.oc-tree::before { display: none; }
.oc-tree > li { padding-top: 0; }
.oc-tree > li::before, .oc-tree > li::after { display: none; }

/* retez listu: lidi bez podrizenych visi pod sebou v jednom sloupci */
.oc-tree .oc-col { padding-left: .3rem; padding-right: .3rem; }
.oc-tree ul.oc-chain {
    flex-direction: column; align-items: center; gap: .5rem; padding-top: 0;
}
.oc-tree ul.oc-chain::before { display: none; }
.oc-tree .oc-chain > li { padding: 0; }
.oc-tree .oc-chain > li::before, .oc-tree .oc-chain > li::after { display: none; }
.oc-tree .oc-chain > li + li::before {
    content: ''; display: block; position: absolute; top: -.5rem; left: 50%; height: .5rem;
    width: 0; border-left: 1px solid var(--border-strong); border-top: 0;
}

.oc-node {
    display: inline-flex; flex-direction: column; align-items: center; gap: .05rem; position: relative;
    min-width: 8.5rem; max-width: 11rem; padding: .38rem .55rem;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.oc-node.org-inactive { opacity: .55; }
.oc-node:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
/* list = clovek bez podrizenych, o stupen tissi */
.oc-node.oc-leaf { min-width: 9.5rem; padding: .3rem .5rem; background: var(--surface-2); }
.oc-name { font-size: .85rem; font-weight: 600; line-height: 1.25; }
.oc-pos { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.oc-dept { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.oc-count {
    position: absolute; top: -.55rem; right: -.55rem; min-width: 1.25rem; height: 1.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; border-radius: 999px;
    font-size: .68rem; font-weight: 700; box-shadow: 0 0 0 2px var(--surface);
}
.oc-warn { position: absolute; top: -.5rem; left: -.4rem; font-size: .8rem; color: var(--danger); }
.oc-edit { position: absolute; bottom: -.5rem; right: -.4rem; font-size: .75rem; opacity: 0; transition: opacity .12s; }
.oc-node:hover .oc-edit { opacity: 1; }

/* dlouhy text zkratit na dva radky (cely je v title) */
.clamp-2 {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; line-height: 1.4;
}
table.skills-table { table-layout: fixed; }
table.skills-table col.w-num { width: 6rem; }
table.skills-table col.w-act { width: 5.5rem; }
table.skills-table td.title { overflow-wrap: anywhere; }

/* dlouhy obsah (skilly) — mensi monospace, at se vejde vic na mensi vysku */
textarea.code-area {
    font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    resize: vertical; max-height: 60vh;
}
/* sekce, ktera se da slozit, at stranka neni na tri obrazovky */
details.page-fold { margin-bottom: 1rem; }
details.page-fold > summary {
    display: flex; align-items: center; gap: .6rem; cursor: pointer;
    margin: -.2rem 0; font-size: 1.02rem;
}
details.page-fold > summary:hover { color: var(--primary); }
details.page-fold[open] > summary { margin-bottom: .8rem; }

/* --- sprava uzivatelu: kartu na cloveka misto tabulky o 10 sloupcich --- */
.user-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: .9rem; }
.user-card { display: flex; flex-direction: column; gap: .55rem; margin: 0; }
.uc-head { display: flex; align-items: center; gap: .6rem; }
.uc-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.uc-avatar-empty {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-soft); color: var(--primary); font-weight: 700;
}
.uc-who { min-width: 0; flex: 1 1 auto; }
.uc-name { font-weight: 600; }
.uc-who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-imp { flex: 0 0 auto; }
.uc-org { margin: 0; }
.uc-role, .uc-ro { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.uc-set { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem .6rem; align-items: end; }
.uc-set label { display: flex; flex-direction: column; gap: .15rem; font-size: .74rem; color: var(--muted); font-weight: 600; }
.uc-role label { display: flex; align-items: center; gap: .4rem; font-size: .74rem; color: var(--muted); font-weight: 600; }
.uc-set button { grid-column: 1 / -1; justify-self: start; }
.uc-set input, .uc-set select { width: 100%; }
.uc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; border-top: 1px solid var(--border); padding-top: .45rem; margin-top: auto; }
.uc-end { display: inline-flex; margin-left: auto; }
.btn-link-danger {
    border: 0; background: transparent; cursor: pointer; padding: 0;
    font: inherit; color: var(--danger); text-decoration: underline;
}
.btn-link-danger:hover { color: #a51616; }
.user-card.is-ended { background: var(--surface-2); }
.user-card.is-ended .uc-avatar { filter: grayscale(1); opacity: .7; }
.ended-fold .user-cards { margin-top: .6rem; }
.uc-set label.uc-wide { grid-column: 1 / -1; }
.uc-set label.uc-wide input { max-width: 11rem; }

/* kompaktni sprava: jeden clovek = jeden radek, ulozi se jednim ✓ */
table.users-table { table-layout: fixed; }
table.users-table col.w-role  { width: 7rem; }
table.users-table col.w-lvl   { width: 6.2rem; }
table.users-table col.w-num2  { width: 4.4rem; }
table.users-table col.w-date  { width: 8.2rem; }
table.users-table col.w-acts  { width: 7rem; }
table.users-table td { vertical-align: middle; }
table.users-table th, table.users-table td { padding: .25rem .35rem; }
table.users-table select.inline, table.users-table input.inline { width: 100%; min-width: 0; font-size: .8rem; }
table.users-table input.u-date { padding: .2rem .25rem; }
table.users-table .row-actions { display: flex; gap: .15rem; white-space: nowrap; justify-content: flex-end; }
/* nevyplnene datum nastupu — at je videt, komu ho doplnit */
td.cell-missing { background: #fff8e6; }
td.cell-missing input { border-color: #e0b552; }
table.users-table .row-actions .btn { padding: .25rem .4rem; }

/* nasepta­vac @zminek pod textarea */
.mention-wrap { position: relative; width: 100%; }
.mention-wrap textarea { width: 100%; }
.mention-box {
    position: absolute; top: 100%; left: 0; z-index: 50;
    min-width: 15rem; max-width: min(24rem, 100%); max-height: 15rem; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: .2rem;
}
.mention-item {
    display: flex; flex-direction: column; gap: .05rem; width: 100%; text-align: left;
    border: 0; background: transparent; cursor: pointer;
    padding: .3rem .45rem; border-radius: var(--radius-xs); font: inherit; color: var(--text);
}
.mention-item strong { font-size: .9rem; font-weight: 600; }
.mention-item span { font-size: .76rem; color: var(--muted); }
.mention-item.is-active, .mention-item:hover { background: var(--primary-soft); }

/* --- contribution graf --- */
.contrib-wrap { overflow-x: auto; padding-bottom: .3rem; }
.contrib { display: inline-block; min-width: max-content; }
.contrib-grid { display: flex; gap: 3px; }
.contrib-week { display: flex; flex-direction: column; gap: 3px; }
.contrib-day { width: 12px; height: 12px; border-radius: 3px; background: #ebedf0; display: inline-block; }
.contrib-day.empty { background: transparent; }
.contrib-day.lvl-0 { background: #ebedf0; }
.contrib-day.lvl-1 { background: #9be9a8; }
.contrib-day.lvl-2 { background: #40c463; }
.contrib-day.lvl-3 { background: #30a14e; }
.contrib-day.lvl-4 { background: #216e39; }
.contrib-months { display: flex; gap: 3px; margin-bottom: 3px; height: 1em; }
.contrib-month { width: 12px; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: visible; }
.contrib-legend { display: flex; align-items: center; gap: 3px; margin-top: .5rem; }
.contrib-legend .contrib-day { width: 11px; height: 11px; }

/* --- opravneni roli --- */
.perm-table th:not(:first-child), .perm-table td.perm-cell { text-align: center; width: 90px; }
.perm-table .perm-group td { background: var(--surface-2); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); }
.perm-cell input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }

/* --- vykazovani casu --- */
.spent-box { display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; color: var(--text-soft); }
.spent-line { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.spent-line strong { font-size: 1rem; color: var(--text); }
.spent-line .spent-pct { margin-left: auto; }
.progress.slim { height: 5px; }
.spent-form { display: flex; gap: .4rem; }
.spent-form input { flex: 1; min-width: 0; }

/* --- organizacni struktura: pavouk --- */
.org-spider { overflow-x: auto; }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree ul { margin-left: 1.5rem; padding-left: 1.35rem; }
.org-tree li { position: relative; padding: .12rem 0; }
/* spojky: vodorovny "loket" + svisla linka mezi sourozenci */
.org-tree ul > li::before {
    content: ''; position: absolute; left: -1.35rem; top: 1.05rem;
    width: 1.35rem; height: 2px; background: var(--border);
}
.org-tree ul > li::after {
    content: ''; position: absolute; left: -1.35rem; top: 0; bottom: 0;
    width: 2px; background: var(--border);
}
.org-tree ul > li:last-child::after { bottom: calc(100% - 1.05rem); }
.org-node {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); box-shadow: var(--shadow-sm); width: fit-content; max-width: 100%;
}
.org-node:target, .org-node.org-hit { border-color: var(--primary); box-shadow: 0 0 0 3px #dbeafe; }
.org-main { display: inline-flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.org-name { font-weight: 600; }
.org-pos { color: var(--muted); font-size: .82rem; }
.org-meta { display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.org-up { font-size: .78rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.org-up:hover { color: var(--primary); text-decoration: underline; }
.org-edit { margin: .4rem 0 .6rem; }
.org-inactive { opacity: .55; }

/* misto ve strukture na profilu */
.org-card .org-chain { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; }
.org-card .member-chip { text-decoration: none; color: inherit; padding: .16rem .7rem; }
.org-card .member-chip:hover { border-color: var(--primary); color: var(--primary); }
.org-arrow { color: var(--muted); }

/* zadost o opravu vykazu */
.wl-req-form { display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap; }
.wl-req-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--text-soft); }
.wl-req-form label.check { flex-direction: row; align-items: center; gap: .35rem; font-weight: 500; }
.wl-req-form .grow { flex: 1 1 240px; }
.wl-req-row td { background: #fff8e6; }
.wl-req-actions { display: inline-flex; gap: .35rem; margin-left: .4rem; }
.wl-req-actions form { display: inline-flex; }

/* --- predani ukolu, seniorita, automat --- */
.impersonate-banner { background: #fde8d7; color: #8a4b12; border-bottom-color: #eec3a0; }
.impersonate-banner button { border-color: #d79a5f; color: #8a4b12; }
.away-card .members-row { margin-bottom: 0; }
.away-card .member-chip { background: #eef7ee; border-color: #cfe6cf; }
.inline-form { display: inline-flex; }

/* dva selecty pod jednim popiskem (obtiznost: uroven + v cem) */
.two-selects { display: flex; gap: .35rem; }
.two-selects select { flex: 1 1 0; min-width: 0; }
/* male "?" s vysvetlenim v title misto dlouheho textu */
.hint {
    display: inline-flex; align-items: center; justify-content: center;
    width: 15px; height: 15px; border-radius: 50%; font-size: .68rem; font-weight: 700;
    background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
    cursor: help; flex: 0 0 auto;
}
.hint:hover { color: var(--primary); border-color: var(--primary); }
.avatar-init {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.18); color: #fff; font-size: .8rem; font-weight: 700;
}
.hand-btn { align-self: flex-start; }
.hand-form { display: flex; flex-direction: column; gap: .45rem; background: var(--surface-2); padding: .6rem; border-radius: var(--radius-xs); }
.hand-form form { display: flex; flex-direction: column; gap: .45rem; }
.hand-form label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--text-soft); }
.hand-pending {
    background: #fff8e6; border: 1px solid #edd9a8; border-radius: var(--radius-xs);
    padding: .6rem .7rem; font-size: .85rem; display: flex; flex-direction: column; gap: .4rem;
}
.hand-pending p { margin: 0; }
.hand-resolve { display: flex; flex-direction: column; gap: .4rem; }
.hand-resolve label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; }
.auto-assign-box { display: flex; flex-direction: column; gap: .2rem; }
.u-levels, .u-fond { display: flex; align-items: center; gap: .3rem; }
.u-levels label { display: inline-flex; align-items: center; gap: .2rem; font-size: .8rem; }
.u-fond input { width: 5.5rem; }

/* --- skilly a generovani zadani --- */
.ai-gen {
    background: #f5f2fc; border: 1px dashed #c9bcea; border-radius: var(--radius);
    padding: .7rem .85rem; display: flex; flex-direction: column; gap: .5rem;
}
.ai-gen-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.ai-gen textarea { width: 100%; box-sizing: border-box; }
.ai-gen-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.ai-gen-status.err { color: var(--danger); font-weight: 600; }
.ai-gen.busy textarea, .ai-gen.busy button { opacity: .6; }
.skill-chip { background: #f0ebfa; border-color: #d3c7ef; }
.row-actions { white-space: nowrap; }
.row-actions form, .row-actions button { display: inline-flex; }
td.cell-err { color: var(--danger); font-weight: 600; }

/* --- login --- */
.login-box {
    max-width: 400px; margin: 9vh auto; background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 2.3rem; text-align: center;
    display: flex; flex-direction: column; gap: 1rem; align-items: center; box-shadow: var(--shadow);
}
.login-box h1 { font-size: 1.35rem; }
.login-box hr { width: 100%; border: 0; border-top: 1px solid var(--border); }
.dev-login { display: flex; flex-direction: column; gap: .5rem; width: 100%; }

@media (max-width: 900px) {
    /* mobil: menu se schová pod hamburger, uvnitř je rozbalené na plnou šířku */
    .topbar { position: relative; gap: .6rem; padding: .5rem .9rem; }
    .nav-toggle { display: block; }
    .brand-long { display: none; }
    .topnav {
        display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
        flex-direction: column; align-items: stretch; gap: .15rem; margin: 0;
        background: var(--topbar); padding: .5rem .9rem .9rem;
        border-top: 1px solid rgba(255,255,255,.12); box-shadow: var(--shadow);
    }
    .topnav.open { display: flex; }
    .topnav a, .navgroup > summary { padding: .55rem .7rem; font-size: .95rem; border-radius: var(--radius-xs); }
    /* skupiny se na mobilu rozbalují na místě, ne jako plovoucí panel */
    .navgroup > summary { color: #8fb7f2; font-weight: 600; }
    .navgroup-menu {
        position: static; min-width: 0; background: transparent; border: 0;
        box-shadow: none; padding: 0 0 .3rem .7rem;
    }
    .topbar-user { margin-left: auto; gap: .5rem; }
    .me-link span:not(.avatar) { display: none; } /* jméno — na mobilu zbývá jen fotka */
    .view-as { display: none; }                   /* admin nástroj, na mobilu nepotřebný */
    .topbar-user .btn { padding: .3rem .55rem; font-size: .8rem; }
}

@media (max-width: 760px) {
    .issue-layout { grid-template-columns: 1fr; }
    .issue-side { position: static; }
    td.title { width: auto; }
    .container { padding: 0 .8rem; margin-top: 1rem; }
    .section-head { flex-direction: column; align-items: flex-start; gap: .6rem; }
    .form-grid label, .form-grid .grow { flex: 1 1 100%; }
    table.issues { display: block; overflow-x: auto; }
}

/* --- plánovací matice (/planovani) ------------------------------------ */
/* přepínač měsíce: ‹ srpen 2026 › jako jeden segmentový ovladač */
.month-nav {
    display: inline-flex; align-items: stretch; background: var(--surface);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    overflow: hidden; box-shadow: var(--shadow-sm);
}
.month-nav-btn {
    display: flex; align-items: center; padding: 0 .7rem;
    font-size: 1.1rem; font-weight: 700; line-height: 1;
    color: var(--muted); text-decoration: none;
}
.month-nav-btn:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.month-nav input[type="month"] {
    border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
    border-radius: 0; padding: .38rem .55rem; font-weight: 600; font-size: .9rem;
    color: var(--text); background: transparent; width: auto;
}
.month-nav input[type="month"]:focus { outline: none; background: var(--primary-soft); }

.matrix-scroll { overflow-x: auto; }
table.matrix { border-collapse: separate; border-spacing: 0; }
table.matrix th, table.matrix td { white-space: nowrap; }
table.matrix th.sticky, table.matrix td.sticky {
    position: sticky; left: 0; z-index: 2; background: var(--surface);
    text-align: left; border-right: 1px solid var(--border);
}
table.matrix tr:hover th.sticky { background: var(--surface-2); }
table.matrix .u-sub, table.matrix .proj-sub {
    display: block; font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: .1rem;
}
table.matrix th.grp { text-align: center; border-left: 2px solid var(--border); }
table.matrix th.grp-start, table.matrix td.grp-start { border-left: 2px solid var(--border); }
table.matrix th.proj .badge { margin-left: .3rem; }
/* i hlavicky ciselnych sloupcu zarovnat doprava — table.issues th ma vyssi
   specificitu nez samotne th.cell-num, proto selektor s table.issues */
td.cell-num, th.cell-num,
table.issues td.cell-num, table.issues th.cell-num {
    text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.matrix input.cell {
    width: 3.4rem; padding: .22rem .3rem; text-align: right; font-size: .85rem;
    border: 1px solid transparent; background: var(--surface-2); border-radius: var(--radius-xs);
}
table.matrix input.cell:hover { border-color: var(--border-strong); }
table.matrix input.cell:focus { border-color: var(--primary); outline: none; background: var(--surface); }
tr.matrix-total th, tr.matrix-total td { border-top: 2px solid var(--border); font-weight: 600; }
table.issues td.over, table.issues strong.over, p strong.over { color: var(--danger); font-weight: 600; }
td.cell-num .cell-link { font-weight: 600; }
.matrix-actions { display: flex; gap: .8rem; align-items: center; margin-top: .8rem; flex-wrap: wrap; }
/* akce u projektu (Plánovat + ✎) drží na jednom řádku */
td.proj-actions { white-space: nowrap; text-align: right; }
td.proj-actions form { display: inline; }
/* záložky Plán / Skutečnost / Srovnání u tabulky Projekty a epiky */
.view-tabs { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.view-tabs .btn { padding: .3rem .8rem; font-size: .85rem; }

/* tabulka Projekty a epiky: projektový řádek odděluje skupinu, epiky jsou odsazené podřádky */
tr.pp-project th.sticky, tr.pp-project td { border-top: 2px solid var(--border); }
tr.epic-sub th.sticky { padding-left: 1.4rem; font-weight: 400; }
tr.epic-sub td, tr.epic-sub th { font-size: .88rem; }

/* --- konfigurator mzdy (Uzivatele) --------------------------------------- */
.mzda-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; flex-wrap: wrap; }
.mzda-row input { width: 90px; }
.mzda-h3 { margin: 12px 0 4px; }
.uc-mzda { align-self: center; }
#mzda-modal form.card { max-width: 480px; }

/* ======================================================================
   TMAVY MOTIV. Prepina se atributem data-theme="dark" na <html> (tlacitko
   v horni liste, volba se pamatuje v localStorage). Svetly motiv zustava
   presne jak byl — tady jsou jen prepisy, nic se nemaze.
   ====================================================================== */
:root[data-theme="dark"] {
    --bg:            #12161d;
    --surface:       #191f28;
    --surface-2:     #1f2632;
    --surface-3:     #232b38;
    --border:        #2a3341;
    --border-strong: #3a465c;
    --border-soft:   #242c39;
    --text:          #e6ebf3;
    --text-soft:     #b9c2d0;
    --muted:         #98a3b6;
    --muted-2:       #6f7b90;
    --primary:       #6ba4ff;
    --primary-hover: #8ab8ff;
    --primary-soft:  #1b2a44;
    --danger:        #f87171;
    --topbar:        #0d1117;
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, .5);
    --shadow:        0 2px 10px rgba(0, 0, 0, .55);
    --shadow-lg:     0 10px 30px rgba(0, 0, 0, .65);
    color-scheme: dark;
}
/* --- prepisy svetlych podkladu (vygenerovano z palety svetleho motivu) --- */
:root[data-theme="dark"] .bc-prace { background: hsl(151 45% 17%); color: hsl(151 68% 74%); }
:root[data-theme="dark"] .bc-obed { background: hsl(26 45% 17%); color: hsl(26 80% 74%); }
:root[data-theme="dark"] .bc-odchod { background: hsl(224 45% 17%); color: hsl(224 76% 74%); }
:root[data-theme="dark"] .bc-koureni { background: hsl(217 18% 17%); color: hsl(217 35% 74%); }
:root[data-theme="dark"] table.issues tr.beep-removed td { background: hsl(0 45% 17%); }
:root[data-theme="dark"] table.issues tr.beep-added td { background: hsl(145 45% 17%); }
:root[data-theme="dark"] table.issues tr.beep-changed td { background: hsl(39 45% 17%); }
:root[data-theme="dark"] table.issues tr.beep-new td { background: hsl(145 45% 17%); }
:root[data-theme="dark"] table.issues tr.js-del td { background: hsl(0 45% 17%); }
:root[data-theme="dark"] table.issues tr.js-chg td { background: hsl(39 45% 17%); }
:root[data-theme="dark"] .pipak-stale { background: hsl(36 45% 17%); color: hsl(36 80% 74%); }
:root[data-theme="dark"] .viewas-banner { background: hsl(39 45% 17%); color: hsl(39 80% 74%); }
:root[data-theme="dark"] .viewas-banner button { background: hsl(39 45% 17%); color: hsl(39 80% 74%); }
:root[data-theme="dark"] .viewas-banner button:hover { background: hsl(40 45% 17%); }
:root[data-theme="dark"] .flash-ok { background: hsl(137 45% 17%); color: hsl(137 60% 74%); }
:root[data-theme="dark"] .flash-err { background: hsl(0 45% 17%); color: hsl(0 68% 74%); }
:root[data-theme="dark"] .st-backlog { background: hsl(234 21% 17%); color: hsl(234 35% 74%); }
:root[data-theme="dark"] .st-new { background: hsl(213 45% 17%); color: hsl(213 73% 74%); }
:root[data-theme="dark"] .st-in_progress { background: hsl(40 45% 17%); color: hsl(40 80% 74%); }
:root[data-theme="dark"] .st-waiting { background: hsl(257 43% 17%); color: hsl(257 43% 74%); }
:root[data-theme="dark"] .st-done { background: hsl(135 45% 17%); color: hsl(135 62% 74%); }
:root[data-theme="dark"] .st-closed { background: hsl(220 18% 17%); color: hsl(220 35% 74%); }
:root[data-theme="dark"] .pr-low { background: hsl(220 18% 17%); color: hsl(220 35% 74%); }
:root[data-theme="dark"] .pr-normal { background: hsl(213 45% 17%); color: hsl(213 73% 74%); }
:root[data-theme="dark"] .pr-high { background: hsl(26 45% 17%); color: hsl(26 80% 74%); }
:root[data-theme="dark"] .pr-critical { background: hsl(0 45% 17%); color: hsl(0 69% 74%); }
:root[data-theme="dark"] .badge.cat { background: hsl(74 40% 17%); color: hsl(74 40% 74%); }
:root[data-theme="dark"] .topbar-search input:focus { background: hsl(0 18% 17%); }
:root[data-theme="dark"] mark { background: hsl(48 45% 17%); }
:root[data-theme="dark"] .stat-card.urgent-card { background: hsl(0 45% 17%); }
:root[data-theme="dark"] .badge.p-on { background: hsl(146 45% 17%); color: hsl(146 78% 74%); }
:root[data-theme="dark"] .badge.p-in { background: hsl(224 45% 17%); color: hsl(224 76% 74%); }
:root[data-theme="dark"] .badge.p-lunch { background: hsl(33 45% 17%); color: hsl(33 80% 74%); }
:root[data-theme="dark"] .badge.p-out { background: hsl(217 18% 17%); color: hsl(217 35% 74%); }
:root[data-theme="dark"] .badge.p-vac { background: hsl(334 45% 17%); color: hsl(334 61% 74%); }
:root[data-theme="dark"] .badge.p-off { background: hsl(217 18% 17%); color: hsl(217 35% 74%); }
:root[data-theme="dark"] .mgr-pill.is-active { background: hsl(217 45% 17%); }
:root[data-theme="dark"] table.mgr-table tbody tr:nth-child(even) td { background: hsl(220 45% 17%); }
:root[data-theme="dark"] .group-chip { background: hsl(260 45% 17%); }
:root[data-theme="dark"] .progress { background: hsl(223 18% 17%); }
:root[data-theme="dark"] .epic-tag,
:root[data-theme="dark"] .epic-card .epic-tag { background: hsl(257 43% 17%); color: hsl(257 43% 74%); }
:root[data-theme="dark"] .queue-waiting { background: hsl(48 38% 17%); }
:root[data-theme="dark"] .q-active-row td { background: hsl(133 43% 17%); }
:root[data-theme="dark"] .hold-banner { background: hsl(256 36% 17%); color: hsl(256 36% 74%); }
:root[data-theme="dark"] .hold-banner.is-expired { background: hsl(35 45% 17%); color: hsl(35 74% 74%); }
:root[data-theme="dark"] .plan-banner { background: hsl(36 45% 17%); color: hsl(36 80% 74%); }
:root[data-theme="dark"] .blocking-card { background: hsl(0 45% 17%); }
:root[data-theme="dark"] .note.unread:hover { background: hsl(218 45% 17%); }
:root[data-theme="dark"] .tw-note textarea { background: hsl(0 18% 17%); }
:root[data-theme="dark"] .tl-body.old { background: hsl(0 45% 17%); }
:root[data-theme="dark"] .cal-day.is-leave { background: hsl(140 36% 17%); }
:root[data-theme="dark"] from { background: hsl(138 39% 17%); }
:root[data-theme="dark"] .tym-table td.note-stale { background: hsl(36 45% 17%); }
:root[data-theme="dark"] .att-missing,
:root[data-theme="dark"] .att-cell.att-missing { background: hsl(0 45% 17%); color: hsl(0 69% 74%); }
:root[data-theme="dark"] .tf-fund.has-fund { background: hsl(36 45% 17%); }
:root[data-theme="dark"] .fix-bad { background: hsl(36 45% 17%); }
:root[data-theme="dark"] .timer-live li.is-long { background: hsl(36 45% 17%); }
:root[data-theme="dark"] .rel-warn { background: hsl(36 45% 17%); color: hsl(36 80% 74%); }
:root[data-theme="dark"] td.cell-missing { background: hsl(43 45% 17%); }
:root[data-theme="dark"] .contrib-day { background: hsl(216 18% 17%); }
:root[data-theme="dark"] .contrib-day.lvl-0 { background: hsl(216 18% 17%); }
:root[data-theme="dark"] .contrib-day.lvl-1 { background: hsl(130 45% 17%); }
:root[data-theme="dark"] .wl-req-row td { background: hsl(43 45% 17%); }
:root[data-theme="dark"] .impersonate-banner { background: hsl(29 45% 17%); color: hsl(29 77% 74%); }
:root[data-theme="dark"] .away-card .member-chip { background: hsl(120 36% 17%); }
:root[data-theme="dark"] .hand-pending { background: hsl(43 45% 17%); }
:root[data-theme="dark"] .ai-gen { background: hsl(258 45% 17%); }
:root[data-theme="dark"] .skill-chip { background: hsl(260 45% 17%); }


/* --- rucni dolatky: musi byt AZ ZA generovanymi pravidly, aby vyhraly --- */
/* prvky, ktere maji barvu zadratovanou mimo tokeny */
:root[data-theme="dark"] .topbar-search input:focus,
:root[data-theme="dark"] input, :root[data-theme="dark"] select,
:root[data-theme="dark"] textarea { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: var(--muted-2); }
:root[data-theme="dark"] mark { background: hsl(45 70% 28%); color: var(--text); }
:root[data-theme="dark"] .ot-plus { color: #58d68d; }
:root[data-theme="dark"] .att-comp { color: #b998ff; }
:root[data-theme="dark"] .cal-sum { color: #58d68d; }
:root[data-theme="dark"] .att-work, :root[data-theme="dark"] .att-home { color: #58d68d; }
:root[data-theme="dark"] .beep-orig, :root[data-theme="dark"] .bw-changed { color: #e8b06a; }
:root[data-theme="dark"] .bw-removed, :root[data-theme="dark"] .beep-removed s { color: #f88; }
:root[data-theme="dark"] .bw-added { color: #58d68d; }
:root[data-theme="dark"] .cal-diff.is-over { color: #e8b06a; }
/* tlacitko prepinace v horni liste */
.theme-toggle { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #dbe2ee; }
.theme-toggle:hover { background: rgba(255,255,255,.14); }
/* cisla ve statistickych kartach: ve svetlem rezimu maji barvu horni listy
   (tmava navy na bilem), v tmavem by to byla skoro cerna na tmavem — nutny
   prepis na bezny text */
:root[data-theme="dark"] .stat-card .n { color: var(--text); }
:root[data-theme="dark"] .stat-card.crit .n { color: #f88; }
:root[data-theme="dark"] .stat-card.urgent-card .n { color: #f88; }
/* tmavy text bez svetleho podkladu — v tmavem rezimu by splynul s pozadim
   (dohledano auditem, ne odhadem) */
:root[data-theme="dark"] .mgr-pill.tone-red b,
:root[data-theme="dark"] .lr-urgent,
:root[data-theme="dark"] .lg-t-over,
:root[data-theme="dark"] .btn-link-danger:hover { color: #f88; }
:root[data-theme="dark"] .tf-fund.has-fund strong,
:root[data-theme="dark"] .timer-live li.is-long .tmr-clock,
:root[data-theme="dark"] .impersonate-banner button { color: #e8b06a; }
/* nativni rozbalovaci seznam: s color-scheme dark ho kresli OS tmave */
:root[data-theme="dark"] .view-as select option,
:root[data-theme="dark"] select option { background: var(--surface-2); color: var(--text); }

/* --- rezimy casovace (Prace / Pauza / Pohovor) + Controlling + Prekrocene odhady --- */
.mode-btns { display: inline-flex; gap: .3rem; flex-wrap: wrap; }
.timer-mode-since .timer-clock { font-size: .85rem; color: inherit; }
.timer-widget.is-interview { background: #4c3a7a; }
.tw-mode { display: inline-flex; align-items: center; gap: .25rem; color: #f0c674; font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer-widget.is-interview .tw-mode { color: #c9a7f5; }
.tw-modes { gap: .15rem; }
.tw-modes button { opacity: .55; }
.tw-modes button.is-on { opacity: 1; background: rgba(255,255,255,.3); }
.badge.mode-work      { background: #e7f7ee; color: #0f7b3d; }
.badge.mode-break     { background: #fef3e2; color: #9a5b0f; }
.badge.mode-interview { background: #efe6fb; color: #5b3a9a; }
table.issues th.num, table.issues td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctl-live tr.ctl-break td { background: #fffaf0; }
.ctl-live tr.ctl-interview td { background: #f7f2fd; }
.ctl-segs > td { background: var(--surface-2); padding: .4rem .8rem .7rem; }
.ctl-seg-table { width: auto; min-width: 60%; }
.btn-xs { padding: .15rem .5rem; font-size: .78rem; }
.ov-plus  { color: #ab1f1f; font-weight: 600; }
.ov-minus { color: #1d7a34; }
tr.ov-warn td { background: #fdf6e9; }
tr.ov-bad  td { background: #fdf1f1; }
table.issues tfoot th { padding: .5rem .6rem; border-top: 2px solid var(--border-strong); text-align: left; }
:root[data-theme="dark"] .ctl-live tr.ctl-break td, :root[data-theme="dark"] tr.ov-warn td { background: rgba(224,138,60,.12); }
:root[data-theme="dark"] .ctl-live tr.ctl-interview td { background: rgba(140,100,220,.14); }
:root[data-theme="dark"] tr.ov-bad td { background: rgba(214,69,69,.14); }
:root[data-theme="dark"] .badge.mode-work { background: rgba(58,166,92,.2); color: #7fe0a0; }
:root[data-theme="dark"] .badge.mode-break { background: rgba(224,138,60,.2); color: #f0c674; }
:root[data-theme="dark"] .badge.mode-interview { background: rgba(140,100,220,.2); color: #c9a7f5; }
/* widget: tlacitka rezimu drzi pohromade a pri uzkem okne se zalomi na dalsi radek */
.tw-modes, .timer-widget .tw-stop { flex: 0 0 auto; }
.tw-mode .tw-mode-label { display: none; }   /* rezim pozna ikona + barva widgetu; slovo zabiralo misto */
/* ovladani widgetu drzi pohromade — pri zalomeni jde na dalsi radek cele, vpravo */
.tw-ctrl { display: inline-flex; align-items: center; gap: .3rem; flex: 0 0 auto; margin-left: auto; }
.tw-ctrl .tw-note-btn, .tw-ctrl .tw-stop button, .tw-ctrl .tw-stop a { padding: .28rem .38rem; font-size: .85rem; line-height: 1; }
.tw-mode { font-size: .8rem; gap: .2rem; }
