/* HoursSim - dizajn podle wildenborch-ui (Tektur + Onest, karty 20 px, sidebar 256 px) */
:root {
  --bg: #F2F3F6;
  --panel: #FFFFFF;
  --field: #F5F6F9;
  --line: #E4E7ED;
  --line-2: #D3D8E1;
  --line-soft: #EEF0F4;
  --ink: #11141B;
  --ink-2: #465064;
  --muted: #667085;
  --faint: #A3AAB8;
  --accent: #3B57EE;
  --accent-hover: #2F49D6;
  --accent-2: #5C72F0;
  --accent-3: #1D2C8F;
  --accent-soft: #EBEEFD;
  --danger: #C93C3C;
  --danger-soft: #FBECEC;
  --ok: #1F8A55;
  --ok-soft: #E7F5EE;
  --warn: #B26B00;
  --warn-soft: #FFF4E0;
  --dark: #11141B;
  --r-card: 20px;
  --r-ctl: 12px;
  --h-ctl: 48px;
  --font-head: "Tektur", system-ui, sans-serif;
  --font: "Onest", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(17, 20, 27, .04);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23465064' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  --chevron-active: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%233B57EE' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; letter-spacing: .01em; }

/* ---------- rozvržení ---------- */
.layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 26px 16px 22px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 14px var(--font-head); flex: none; }
.brand b { display: block; font: 700 16px/1.15 var(--font-head); white-space: nowrap; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.nav-group h6 { margin: 0 0 6px; padding: 0 12px; font: 700 11px/1 var(--font); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.nav a, .nav span { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav span.soon { color: var(--faint); cursor: default; }
.nav span.soon em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; background: var(--bg); color: var(--muted); padding: 2px 8px; border-radius: 999px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 14px 12px 0; border-top: 1px solid var(--line-soft); }

.content { padding: 28px 32px 56px; min-width: 0; max-width: 1480px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumbs b { color: var(--ink-2); font-weight: 500; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 30px; line-height: 1.15; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); }
.page-head .actions { display: flex; gap: 10px; flex: none; }

/* ---------- karty ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px 24px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h2 { font-size: 18px; line-height: 1.25; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card-head .actions { display: flex; gap: 8px; flex: none; }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }

/* ---------- formulářové prvky ---------- */
.ctl { width: 100%; height: var(--h-ctl); border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--field); padding: 0 14px; font: 500 15px var(--font); color: var(--ink); transition: border-color .15s, background .15s, box-shadow .15s; }
.ctl:hover { border-color: #BCC3D0; }
.ctl:focus { outline: none; border-color: var(--accent); background-color: #fff; box-shadow: 0 0 0 3px rgba(59, 87, 238, .15); }
.ctl::placeholder { color: var(--faint); }
select.ctl { appearance: none; -webkit-appearance: none; padding-right: 44px; cursor: pointer; text-overflow: ellipsis;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
select.ctl:focus { background-image: var(--chevron-active); }
.ctl.big { font: 600 20px var(--font-head); letter-spacing: .02em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h-ctl); padding: 0 22px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--panel); font: 700 14px var(--font); color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-2); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.htmx-request .spin { display: inline-block; }
.btn.htmx-request .ico { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: flex; background: var(--field); border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 4px; height: var(--h-ctl); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { flex: 1; display: grid; place-items: center; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.seg input:checked + label { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(17, 20, 27, .12); }
.seg input:focus-visible + label { outline: 2px solid var(--accent-2); }

/* Zadání: všechna pole v jedné řadě, popisky i nápovědy mají pevnou výšku - nic neposkakuje */
.zadani { display: grid; grid-template-columns: minmax(240px, 2.2fr) minmax(150px, 1fr) minmax(110px, .8fr) minmax(220px, 1.2fr) auto; gap: 14px; align-items: start; }
.field { min-width: 0; }
.field > label, .field > .label { display: block; height: 18px; margin-bottom: 8px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.field .hint { height: 18px; margin-top: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field .hint b { color: var(--ink-2); }

/* ---------- KPI ---------- */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-card); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.kpi .lbl { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.kpi .lbl i { width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 13px var(--font-head); font-style: normal; flex: none; }
.kpi .val { font: 700 34px/1 var(--font-head); margin-top: 16px; white-space: nowrap; }
.kpi .val small { font: 500 14px var(--font); color: var(--muted); margin-left: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.kpi.dark .lbl { color: #C9CEDA; }
.kpi.dark .lbl i { background: rgba(255, 255, 255, .12); color: #fff; }
.kpi.dark .val small, .kpi.dark .sub { color: #9AA2B4; }
.kpi.ok .val { color: var(--ok); }
.kpi.ok .lbl i { background: var(--ok-soft); color: var(--ok); }
.kpi.bad .val { color: var(--danger); }
.kpi.bad .lbl i { background: var(--danger-soft); color: var(--danger); }

/* ---------- tabulka evidence ---------- */
.tbl-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
table.evid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.evid th { text-align: left; font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.evid td { height: 48px; padding: 0 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
.evid th:first-child, .evid td:first-child { padding-left: 4px; }
.evid .num { text-align: right; }
.evid tbody tr:hover td { background: #FAFBFD; }
.evid tr.volno td { height: 34px; color: var(--faint); }
.evid tr.volno .datum b { color: var(--faint); font-weight: 600; }
.evid tr.svatek td { background: #FFF9EE; }
.evid tr.chyba td { background: var(--danger-soft); }
.evid tfoot td { height: 52px; font-weight: 700; border-top: 2px solid var(--line-2); border-bottom: none; }
.evid .datum { width: 1%; }
.evid .datum b { display: inline-block; min-width: 50px; font-weight: 700; }
.evid .datum span { color: var(--muted); font-size: 12px; }
.evid .plan { color: var(--muted); font-size: 12.5px; }
.evid .fakt b { font-weight: 600; }
.evid .odch { display: inline-block; min-width: 30px; margin-left: 4px; font-size: 11px; color: var(--muted); }
.evid .dash { color: var(--faint); margin: 0 3px; }
.chip { display: inline-grid; place-items: center; width: 30px; height: 26px; border-radius: 8px; font: 700 12px var(--font-head); background: var(--accent-soft); color: var(--accent); }
.chip.O { background: #D9DFFC; color: var(--accent-3); }
.chip.N { background: var(--accent-3); color: #fff; }
.chip.D { background: #E7F5EE; color: var(--ok); }
.chip.K { background: #FFF4E0; color: var(--warn); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--ink-2); }
.tag.svatek { background: #FCE7C3; color: #8A5300; }
.tag.prescas { background: var(--accent-soft); color: var(--accent); }
.osa { position: relative; width: 120px; height: 10px; border-radius: 5px; background: var(--line-soft); overflow: hidden; }
.osa b { position: absolute; top: 0; bottom: 0; background: var(--accent-2); }
.osa b.prestavka { background: #fff; opacity: .95; }
.osa b.presah { background: var(--accent-3); }
.osa::after { content: ""; position: absolute; left: 25%; right: 25%; top: 0; bottom: 0; border-left: 1px solid #fff; border-right: 1px solid #fff; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .chip { width: 22px; height: 18px; font-size: 10px; border-radius: 5px; }

/* ---------- kontroly ---------- */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.checks li:first-child { border-top: none; padding-top: 0; }
.checks .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 700 12px var(--font-head); }
.checks .A .ic { background: var(--danger-soft); color: var(--danger); }
.checks .B .ic { background: var(--warn-soft); color: var(--warn); }
.checks .i .ic { background: var(--bg); color: var(--muted); }
.checks .okk .ic { background: var(--ok-soft); color: var(--ok); }
.checks b { display: block; font-size: 14px; font-weight: 600; }
.checks small { display: block; color: var(--muted); margin-top: 2px; }
.stav { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.bars i { width: 3px; background: var(--line-2); border-radius: 1px; }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 12px; }
.bars.l3 i { background: var(--ok); }
.bars.l1 i:nth-child(1) { background: var(--danger); }
.bars.l2 i:nth-child(-n+2) { background: var(--warn); }

/* ---------- mzda ---------- */
table.mzda { width: 100%; border-collapse: collapse; font-size: 14px; }
.mzda td { padding: 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.mzda td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; padding-left: 16px; }
.mzda td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.mzda tr:first-child td { padding-top: 0; }
.mzda tr.sum td { font: 700 18px var(--font-head); border-bottom: none; padding-top: 14px; }
.money-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.money-strip div { background: var(--bg); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.money-strip span { display: block; font-size: 12px; color: var(--muted); }
.money-strip b { display: block; font: 700 18px var(--font-head); margin-top: 4px; white-space: nowrap; }
.money-strip .hl { background: var(--dark); color: #fff; }
.money-strip .hl span { color: #9AA2B4; }
.note { font-size: 12px; color: var(--muted); margin: 12px 0 0; }

/* ---------- stavy ---------- */
.alert { border-radius: var(--r-card); padding: 20px 24px; display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.alert .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 700 20px var(--font-head); }
.alert.bad { background: var(--danger-soft); border: 1px solid #F2C9C9; }
.alert.bad .ic { background: #fff; color: var(--danger); }
.alert h3 { font-size: 18px; margin-bottom: 6px; }
.alert p { margin: 0 0 12px; color: var(--ink-2); }
.alert .quick { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: center; padding: 28px; }
.empty .ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty .ic svg { width: 26px; height: 26px; }
.empty h3 { font-size: 18px; margin-bottom: 4px; }
.empty p { margin: 0; color: var(--muted); }
.muted { color: var(--muted); }
#vysledek { transition: opacity .15s; }
#vysledek.htmx-request { opacity: .45; }

@media (max-width: 1440px) {
  .col-osa { display: none; }
}
@media (max-width: 1360px) {
  .zadani { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
  .zadani .f-druh { grid-column: 1 / 3; }
  .zadani .f-btn .btn { width: 100%; }
}
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 20px 16px; }
  .zadani, .kpis { grid-template-columns: minmax(0, 1fr); }
  .zadani .f-druh { grid-column: auto; }
  .page-head { flex-direction: column; align-items: flex-start; }
}

/* =================== seznamy, formuláře, nastavení (Workers / WorkerCard / Settings) =================== */
.admin-link { display: block; margin-top: 8px; color: var(--muted); font-weight: 600; }
.admin-link:hover { color: var(--accent); }
.toasts { position: fixed; top: 20px; right: 24px; z-index: 50; display: grid; gap: 8px; }
.toast { background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(17, 20, 27, .18); animation: toast 4s forwards; }
.toast.error { background: var(--danger); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-6px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; visibility: hidden; } }

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search .ctl { padding-left: 44px; }
.toolbar select.ctl { width: auto; min-width: 180px; }
.tabs { display: inline-flex; gap: 4px; background: var(--field); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(17, 20, 27, .1); }
.tabs a em { font-style: normal; color: var(--muted); font-weight: 600; }
.tabs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.count { font-size: 13px; color: var(--muted); }
.count b { color: var(--ink); }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { height: 62px; padding: 0 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover td { background: #FAFBFD; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .end { text-align: right; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { display: block; font-weight: 700; white-space: nowrap; }
.who small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 12px var(--font-head); flex: none; }
.avatar.big { width: 64px; height: 64px; font-size: 20px; border-radius: 18px; }
.flag { display: inline-block; min-width: 38px; padding: 3px 7px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); font: 700 11px var(--font); text-align: center; color: var(--ink-2); }
.st { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.st.ok { color: var(--ink); } .st.warn { color: var(--warn); } .st.bad { color: var(--danger); } .st.none { color: var(--muted); font-weight: 600; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.row-actions { display: inline-flex; gap: 6px; }

/* karta pracovníka */
.profile { display: flex; align-items: center; gap: 18px; }
.profile h1 { font-size: 28px; }
.profile p { margin: 4px 0 0; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.kv div { padding: 11px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv b { display: block; font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -8px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 3px solid var(--line-2); }
.timeline li.now::after { border-color: var(--accent); }
.timeline b { display: block; }
.timeline small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.timeline .t-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.badge.grey { background: var(--bg); color: var(--muted); }
.grid-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 18px; align-items: start; }

/* nastavení */
.obj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.obj { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: grid; gap: 10px; }
.obj-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.obj-head b { font: 600 16px var(--font-head); }
.obj-head small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pol { display: flex; flex-wrap: wrap; gap: 6px; }
.pol span { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); }
.pol span.on { background: var(--ok-soft); color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-weight: 700; font-size: 13px; }
.chips a:hover { border-color: var(--ink-2); }
.chips a em { font-style: normal; color: var(--muted); font-weight: 600; }
.info-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 13px; margin-top: 14px; }
.info-box svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* formulář */
.form-card { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.form-grid .help { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-grid .err { font-size: 12px; color: var(--danger); margin-top: 6px; font-weight: 600; }
.form-grid .has-err .ctl { border-color: var(--danger); background-color: #fff; }
textarea.ctl { height: 96px; padding: 12px 14px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.toggles { margin-top: 22px; border-top: 1px solid var(--line-soft); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.toggle b { display: block; font-weight: 700; font-size: 14px; }
.toggle small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch-input { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch-input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch-input:checked { background: var(--accent); }
.switch-input:checked::after { transform: translateX(20px); }
.switch-input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.chips-input { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-input div, .chips-input label { margin: 0; }
.chips-input label { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--field); font-weight: 600; font-size: 13px; cursor: pointer; }
.chips-input input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.chips-input label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-3); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.nonfield { background: var(--danger-soft); color: var(--danger); padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 600; font-size: 13px; }

@media (max-width: 1180px) {
  .grid-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .form-grid, .kv { grid-template-columns: minmax(0, 1fr); }
  .toolbar { flex-wrap: wrap; }
}

.list td.nowrap, .nowrap { white-space: nowrap; }

/* =================== sken dokladů (WorkerAdd) =================== */
.drop { position: relative; display: grid; place-items: center; text-align: center; gap: 6px; padding: 38px 20px; border: 2px dashed var(--line-2); border-radius: 18px; background: #FAFBFC; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.drop .ic svg { width: 24px; height: 24px; }
.drop b { font: 600 18px var(--font-head); }
.drop span { color: var(--muted); font-size: 13px; }
.drop .vybrano { color: var(--accent); font-weight: 700; font-size: 14px; min-height: 20px; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.files .thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--accent-soft); }
.files b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files .right { display: flex; align-items: center; gap: 10px; }
.progress { height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; margin: 6px 0 4px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.mrz-strip { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.mrz-strip img { display: block; width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; }
.mrz-text { font: 600 15px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; background: var(--dark); color: #E8EBF2; padding: 12px 14px; border-radius: 12px; overflow-x: auto; white-space: nowrap; margin-top: 12px; }
.mrz-text span.x { background: var(--danger); color: #fff; border-radius: 3px; }
.problems { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.problems li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 13px; }
.problems li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.kbd { display: inline-block; padding: 1px 7px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; font: 700 11px var(--font); background: #fff; color: var(--ink-2); }
.photo-full { width: 100%; border-radius: 12px; border: 1px solid var(--line); display: block; }

/* =================== šablony dokumentů (DocEditor) =================== */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.lbl-obsah { display: block; font-weight: 700; font-size: 13px; margin: 18px 0 8px; }
.ed { border: 1px solid var(--line-2); border-radius: var(--r-ctl); background: var(--field); overflow: hidden; }
.ed:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 87, 238, .15); }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: #fff; }
.ed-bar button { height: 32px; min-width: 32px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px; background: none; font: 600 13px var(--font); color: var(--ink-2); cursor: pointer; }
.ed-bar button:hover { background: var(--bg); border-color: var(--line); color: var(--ink); }
.ed-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.ed textarea.ctl { border: none; border-radius: 0; background: var(--field); height: 440px; min-height: 240px; box-shadow: none; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 14px 16px; resize: vertical; }
.ed textarea.ctl:focus { box-shadow: none; }
.ed-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.ed-foot b { color: var(--ink); }
.err-inline { color: var(--danger); font-weight: 700; }
.vars { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.var-group h6 { margin: 16px 0 8px; font: 700 12px var(--font); color: var(--accent); letter-spacing: .02em; }
.var { display: grid; width: 100%; text-align: left; gap: 1px; padding: 9px 12px; margin-bottom: 7px; border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff; cursor: pointer; font: 13px var(--font); color: var(--ink-2); }
.var:hover { border-color: var(--accent); background: var(--accent-soft); }
.var code { font: 700 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); }
.var span { font-size: 12.5px; }
.var em { font-style: normal; font-size: 11px; color: var(--faint); }
.var.pouzito { border-color: var(--ok); }
.var.pouzito code::after { content: " ✓"; color: var(--ok); }
.nahled-bar { display: flex; gap: 10px; margin-bottom: 12px; }
.nahled-bar .ctl { flex: 1; }
.nahled-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chybi-tag { background: var(--danger-soft); color: var(--danger); font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.prazdne-tag { background: var(--warn-soft); color: var(--warn); font-weight: 700; padding: 3px 9px; border-radius: 999px; }
iframe.a4 { width: 100%; height: 820px; border: 1px solid var(--line); border-radius: 12px; background: #e9ecf1; }
@media (max-width: 1180px) { .editor-layout { grid-template-columns: minmax(0, 1fr); } .vars { position: static; max-height: none; } }

/* přepínač uvnitř formuláře nesmí převzít styl popisků polí */
.form-grid .seg label, .field .seg label { display: grid; place-items: center; margin: 0; height: auto; font-size: 13px; font-weight: 600; }
.form-grid .seg { display: flex; }

/* =================== ruční úprava dne, nepřítomnosti =================== */
.evid tr.klik { cursor: pointer; }
.evid tr.klik:hover td { background: var(--accent-soft); }
.evid tr.absence td { background: #F6F3FF; }
.evid tr.zvyraznit td { animation: blik 2.2s ease-out; }
@keyframes blik { 0%, 30% { background: #FFF1B8; } 100% { background: transparent; } }
.upr { color: var(--accent); font-weight: 700; margin-left: 4px; }
.tag.absence { background: #EDE7FF; color: #5B3CC4; }
.tag.pohot { background: #E6F6F7; color: #0F7C85; }
.checks li.klik { cursor: pointer; border-radius: 10px; }
.checks li.klik:hover { background: var(--bg); }
dialog.panel { max-height: calc(100vh - 40px); overflow-y: auto; width: min(720px, calc(100vw - 32px)); border: none; border-radius: 20px; padding: 0; box-shadow: 0 24px 60px rgba(17, 20, 27, .28); }
dialog.panel::backdrop { background: rgba(17, 20, 27, .45); }
.panel-form { padding: 22px 24px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 20px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.panel-form .seg { max-width: 420px; }
.abs-wrap { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.abs-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.abs-list { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.abs-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; background: #EDE7FF; color: #3E2A8C; font-size: 12.5px; }
.abs-chip button { border: none; background: rgba(255, 255, 255, .7); border-radius: 50%; width: 20px; height: 20px; cursor: pointer; color: #5B3CC4; font-size: 11px; }
.abs-form { display: flex; gap: 8px; align-items: center; }
.abs-form .ctl { height: 38px; font-size: 13px; width: auto; }
.abs-form select.ctl { max-width: 210px; }

/* =================== přihlášení =================== */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth { width: 100%; max-width: 420px; }
.auth-card { padding: 30px 30px 28px; }
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card .muted { margin: 0 0 20px; font-size: 14px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.user-box { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--bg); margin-bottom: 10px; }
.user-box b { display: block; font-size: 13px; }
.user-box a, .user-box button { font-size: 12px; color: var(--muted); background: none; border: none; padding: 0; cursor: pointer; font-family: var(--font); }
.user-box a:hover, .user-box button:hover { color: var(--accent); }

/* =================== přihlášení v2, účet, patička menu =================== */
.sidebar .foot { padding: 12px 0 0; border-top: 1px solid var(--line-soft); }
.user-box { display: flex; align-items: center; gap: 6px; padding: 0; background: none; margin: 0; }
.user-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--ink); }
.user-main:hover, .user-main.on { background: var(--bg); }
.user-main .avatar { width: 34px; height: 34px; font-size: 11px; }
.user-main b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-main small { display: block; font-size: 12px; color: var(--muted); }
.user-box form { margin: 0; }

.auth-body { display: block; padding: 0; min-height: 100vh; background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #2A3FC7 0%, #1D2C8F 45%, #11141B 100%);
  color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-hero .brand b { color: #fff; }
.auth-hero .brand small { color: #AEB8E8; }
.auth-hero .brand .logo { background: #fff; color: var(--accent); }
.auth-hero-text { position: relative; z-index: 1; max-width: 460px; }
.auth-hero h2 { font: 700 34px/1.15 var(--font-head); margin: 0 0 14px; }
.auth-hero p { color: #C9D0F5; font-size: 15px; margin: 0 0 24px; }
.auth-points { list-style: none; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.auth-points li { background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 10px 14px; font-size: 12px; color: #C9D0F5; }
.auth-points span { display: block; font: 700 20px var(--font-head); color: #fff; }
.auth-grid { position: absolute; right: -40px; bottom: 60px; display: grid; grid-template-columns: repeat(7, 38px); gap: 8px; opacity: .55; transform: rotate(-8deg); }
.auth-grid i { height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .07); }
.auth-grid i.r { background: #5C72F0; } .auth-grid i.o { background: #3B57EE; } .auth-grid i.n { background: #0B1352; border: 1px solid #5C72F0; }
.auth-note { position: relative; z-index: 1; color: #8E99CF; font-size: 12px; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 36px 34px 32px; box-shadow: 0 20px 50px rgba(17, 20, 27, .08); }
.auth-card h1 { font-size: 28px; margin: 0 0 6px; }
.auth-card .muted { margin: 0 0 22px; font-size: 14px; }
.auth-field { display: block; margin-bottom: 16px; }
.auth-field > span:first-child { display: block; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.auth-input { position: relative; display: block; }
.auth-input > svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.auth-input .ctl { padding-left: 44px; height: 50px; }
.auth-input .ukaz { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.auth-input .ukaz:hover { background: var(--bg); color: var(--ink); }
.auth-input .ukaz svg { width: 18px; height: 18px; display: block; }
.auth-btn { width: 100%; height: 50px; margin-top: 8px; font-size: 15px; }
.auth-foot { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--muted); font-size: 12px; margin-top: 18px; }
.auth-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.auth-ic.bad { background: var(--danger-soft); color: var(--danger); }
.auth-ic svg { width: 26px; height: 26px; }
.kod-input { height: 60px; text-align: center; font: 700 28px var(--font-head); letter-spacing: .3em; }
.link-btn { border: none; background: none; color: var(--muted); font: 600 13px var(--font); cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--accent); }
.kroky { margin: 0 0 18px; padding-left: 20px; color: var(--ink-2); font-size: 14px; display: grid; gap: 6px; }
.qr-row { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; line-height: 0; }
.qr svg { width: 180px; height: 180px; }
.klic { display: block; margin-top: 4px; font: 600 15px ui-monospace, Menlo, monospace; letter-spacing: .06em; background: var(--bg); padding: 10px 12px; border-radius: 10px; word-break: break-all; }
.kody-box { background: var(--ok-soft); border: 1px solid #BFE5D0; border-radius: 16px; padding: 16px 18px; margin-bottom: 18px; }
.kody-box p { margin: 4px 0 10px; font-size: 13px; color: var(--ink-2); }
.kody-box ol { columns: 2; margin: 0 0 12px; padding-left: 22px; }
.kody-box code { font: 600 14px ui-monospace, Menlo, monospace; }
.inline-form { display: flex; gap: 8px; }
.inline-form .ctl { flex: 1; min-width: 0; }
.btn.danger { color: var(--danger); border-color: #F2C9C9; }
.btn.danger:hover { background: var(--danger-soft); }
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; }
  .auth-hero-text h2 { font-size: 26px; }
  .auth-grid, .auth-points { display: none; }
  .qr-row { grid-template-columns: 1fr; }
}
html:has(.auth-body), .auth-body { overflow-x: hidden; }
.auth-split { width: 100%; }
.auth-hero, .auth-main { min-width: 0; }
