:root {
  --bg: #f6f4f2; --card: #fff; --text: #172033; --muted: #5d6675; --line: #e1e5ec;
  /* barvy loga DSM: oranžová #D0623C, téměř černá #1A1919 */
  --navy: #1a1919; --primary: #d0623c; --primary-dark: #a9482a; --primary-text: #fff; --primary-bg: #fbece6;
  --ok: #1d7a3e; --ok-bg: #e3f4e8; --warn: #8a5a00; --warn-bg: #fff2d6;
  --err: #a32020; --err-bg: #fde4e4; --info-bg: #eef0f4; --grey-bg: #eef0f3;
  --radius: 16px; --shadow: 0 2px 10px rgba(26, 25, 25, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }
a { color: var(--primary-dark); }

/* --- horní lišta ------------------------------------------------------ */
.top { display: flex; gap: 12px; align-items: center; justify-content: space-between;
       max-width: 1500px; margin: 12px auto 0; padding: 10px 14px; background: var(--card);
       border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
       width: calc(100% - 24px); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; min-width: 0; flex: 1; }
.brand > span:last-child { min-width: 0; }
.brand .logo { height: 34px; width: auto; flex: none; }
.brand .sep { width: 1px; align-self: stretch; background: var(--line); }
.brand b { font-size: 1.25rem; color: var(--navy); letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-nav { display: flex; gap: 6px; margin-left: auto; }
.desk-nav a { padding: 8px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.desk-nav a.on { background: var(--primary-bg); color: var(--primary-dark); }
.menu { position: relative; }
.menu summary { list-style: none; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; color: var(--text); }
.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 54px; z-index: 30; min-width: 220px; padding: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(26, 25, 25, .15); }
.menu-pop p { margin: 4px 8px 10px; }
.menu-pop small { color: var(--muted); }
.menu-pop a, .menu-pop button.link { display: block; width: 100%; padding: 10px 8px; border-radius: 8px; text-align: left;
  color: var(--text); text-decoration: none; }
.menu-pop a:hover, .menu-pop button.link:hover { background: var(--grey-bg); }

main { padding: 16px 12px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 1.4rem; margin: .2em 0 .5em; }
h2 { font-size: 1.1rem; margin: 1.2em 0 .5em; }
h2 small { font-weight: normal; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.narrow { max-width: 400px; margin: 30px auto; }
.account { margin-top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.account p { margin: 0; }
label { display: block; font-size: .85rem; color: var(--muted); }
label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--text); font-size: .95rem; margin: 4px 12px 4px 0; }
[hidden] { display: none !important; }   /* skryté prvky skrýt vždy (i tlačítka s vlastním display) */
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  display: block; width: 100%; min-width: 0; padding: 9px 10px; margin-top: 3px; border: 1px solid #c9cfd8; border-radius: 10px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
input[readonly], textarea[readonly] { background: var(--grey-bg); }
.narrow label { margin-bottom: 12px; }
button, .button { display: inline-block; padding: 9px 16px; border: 1px solid #c9cfd8; border-radius: 10px; background: #fff;
  color: var(--text); cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
button.big { padding: 14px 20px; font-size: 1.05rem; font-weight: 600; }
button.danger { color: var(--err); border-color: var(--err); }
button.link { background: none; border: 0; color: var(--primary-dark); padding: 0; text-decoration: underline; }
form.inline { display: inline; }
.inline-form { display: flex; gap: 8px; } .inline-form input { flex: 1; margin: 0 !important; }
.hint { color: var(--muted); font-size: .9rem; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }

/* --- nahrání ---------------------------------------------------------- */
.upload h1 { scroll-margin-top: 12px; }
.upload .pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px;
  margin: 0 0 12px; padding: 14px; border: 1px solid #c9cfd8; border-radius: 14px;
  background: #fff; color: var(--text); font-size: 1.1rem; font-weight: 600; text-align: center; cursor: pointer; }
.upload .pick.camera { min-height: 84px; padding: 12px 16px; background: var(--primary); border-color: var(--primary); color: var(--primary-text);
  font-size: 1.35rem; box-shadow: 0 6px 18px rgba(208, 98, 60, .3); }
.upload .pick .ico { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 14px; background: #fff; flex: none; }
.upload .pick .ico svg { width: 34px; height: 34px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linejoin: round; }
.upload .pick.camera span:last-child { flex: 1; }
/* skutečné pole pro soubor je neviditelné přes celé tlačítko – funguje dotyk i čtečka obrazovky */
.upload .pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload.busy .pick { opacity: .45; pointer-events: none; }
.upload noscript button { width: 100%; padding: 12px; font-size: 1.05rem; }
.progress { position: relative; min-height: 40px; margin: 0 0 12px; border-radius: 12px; background: var(--grey-bg); overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ok-bg); transition: width .2s; }
.progress .label { position: relative; display: block; padding: 10px 12px; line-height: 1.35; text-align: center; font-weight: 600; }
#fronta { scroll-margin-top: 12px; }

/* --- seznam dokladů --------------------------------------------------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: var(--grey-bg); }
.s-ok { background: var(--ok-bg); color: var(--ok); }
.s-k_kontrole { background: var(--warn-bg); color: var(--warn); }
.s-chyba { background: var(--err-bg); color: var(--err); }
.s-odeslano { background: #e6eefb; color: #1f5fbf; }
.s-zpracovava { background: var(--grey-bg); color: var(--muted); }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.row { cursor: pointer; }
table.list tr.row:hover td { background: var(--primary-bg); }
table.list th { background: #f6f8fb; font-size: .85rem; color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
.m-only { display: none; }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* --- detail dokladu --------------------------------------------------- */
.meta { color: var(--muted); font-size: .9rem; margin-top: -6px; overflow-wrap: anywhere; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.split > section { min-width: 0; }
.original { position: sticky; top: 10px; }
.original iframe { width: 100%; height: calc(100vh - 160px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.original img.scan { max-height: calc(100vh - 160px); width: auto; max-width: 100%; display: block; margin: 0 auto; }
.original img { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.original p { overflow-wrap: anywhere; }
.issues { list-style: none; padding: 0; margin: 0 0 14px; }
.issues li { padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; overflow-wrap: anywhere; }
.lvl-chyba { background: var(--err-bg); color: var(--err); font-weight: 600; }
.lvl-upozorneni { background: var(--warn-bg); color: var(--warn); }
.lvl-info { background: var(--info-bg); color: var(--muted); }
.approve { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-color: var(--ok); }
.approve small { overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin-bottom: 8px; }
.grid .wide { grid-column: span 2; }
.scroll { overflow-x: auto; }
table.lines { border-collapse: collapse; width: 100%; margin-bottom: 10px; }
table.lines th { font-size: .75rem; color: var(--muted); text-align: left; padding: 2px 3px; }
table.lines td { padding: 2px 3px; }
table.lines input:not([type=checkbox]) { margin: 0 !important; padding: 6px 7px !important; }
table.lines input.num { width: 90px; text-align: right; }
table.lines input.short { width: 70px; }
table.lines input.desc { min-width: 200px; }
table.lines label.check { margin: 0; font-size: .85rem; }
.docform h2 a.small { font-size: .85rem; font-weight: normal; margin-left: 10px; }
.docform > button { margin-top: 10px; }
.actions form { margin: 0 10px 8px 0; }
.actions .inline input { display: inline-block; width: auto; }
.ares { list-style: none; padding: 0; } .ares li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; align-items: end; }
.filters .statuses { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; }
.filters legend { font-size: .85rem; color: var(--muted); }

/* --- spodní lišta (jen telefon) -------------------------------------- */
.tabs { display: none; }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .original { position: static; }
  .original iframe { height: 60vh; }
  .grid .wide { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .top { margin-top: 10px; }
  .brand .logo { height: 28px; }
  .brand b { font-size: 1.1rem; }
  .desk-nav { display: none; }
  main { padding: 12px 12px 24px; }
  body.with-tabs main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  /* spodní lišta přes celou šířku, aktivní záložka = oranžový proužek nahoře */
  .tabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    padding: 0 4px env(safe-area-inset-bottom); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(26, 25, 25, .06); backdrop-filter: blur(8px); }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 2px 9px; border-top: 3px solid transparent;
    color: var(--muted); text-decoration: none; font-size: .8rem; font-weight: 600; }
  .tabs a.on { border-top-color: var(--primary); color: var(--primary-dark); }
  .tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  /* seznam dokladů jako karty */
  .scroll:has(> table.list) { overflow: visible; }
  table.list, table.list tbody { display: block; background: none; border: 0; box-shadow: none; }
  table.list thead { display: none; }
  table.list tr { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px;
    grid-template-areas: "sup tot" "st rcv"; margin-bottom: 10px; padding: 12px 14px; background: var(--card);
    border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  table.list td { padding: 0; border: 0; }
  table.list .c-id, table.list .c-no, table.list .c-date { display: none; }
  table.list .c-sup { grid-area: sup; overflow-wrap: anywhere; }
  table.list .c-sup a { font-weight: 600; color: var(--text); text-decoration: none; }
  /* celá karta je klikací */
  table.list .c-sup a.row-link::after { content: ""; position: absolute; inset: 0; }
  table.list .c-tot { grid-area: tot; font-weight: 700; text-align: right; }
  table.list .c-st { grid-area: st; }
  table.list .c-rcv { grid-area: rcv; text-align: right; color: var(--muted); }
  table.list td.empty { grid-column: 1 / -1; }
  .m-only { display: inline; }

  /* řádky dokladu a rekapitulace DPH jako karty s popisky */
  .scroll:has(> table.lines) { overflow: visible; }
  table.lines, table.lines tbody { display: block; }
  table.lines thead { display: none; }
  table.lines tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; padding: 12px;
    border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
  table.lines.vat tr { grid-template-columns: 1fr 1fr; }
  table.lines td { padding: 0; min-width: 0; }
  table.lines td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
  table.lines td.c-desc, table.lines td.c-del { grid-column: 1 / -1; }
  table.lines input.num, table.lines input.short, table.lines input.desc { width: 100%; min-width: 0; }
  table.lines .new { color: var(--muted); }

  .approve.sticky { position: sticky; z-index: 10; bottom: calc(76px + env(safe-area-inset-bottom)); box-shadow: 0 6px 24px rgba(26, 25, 25, .18); }
  .approve button.big { width: 100%; }
  .actions .inline input { width: 100%; margin-bottom: 8px; }
  .actions form.inline { display: block; }
  .docform > button.primary { width: 100%; padding: 14px; }
  .account { flex-wrap: wrap; }
}

/* --- ikony a počty ---------------------------------------------------- */
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; }
.statusline { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 12px; }
.upload .pick .ico svg .fill, .tabs svg .fill { fill: var(--primary); fill-opacity: .18; stroke: none; }
.upload .pick .ico svg { stroke-linecap: round; }
@media (max-width: 700px) {
  .tabs a { position: relative; }
  .tabs .tab-ico { position: relative; display: block; height: 24px; }
  .tabs .count { position: absolute; top: -6px; left: 21px; min-width: 18px; height: 18px; font-size: .7rem; border: 2px solid #fff; box-sizing: content-box; }
  .tabs .count.all { left: auto; right: 21px; }
  .tabs a.on svg .fill { fill-opacity: .35; }
  .tabs a:not(.on) svg .fill { fill: currentColor; fill-opacity: .1; }
}

/* --- typ dokladu, schvalování, historie, administrace ----------------- */
.cat { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--grey-bg); color: var(--muted); }
.cat-zbozova { background: #e7f0e3; color: #2f6b22; }
.cat-nakladova { background: #f3e9f7; color: #6b3483; }
.cat-uctenka { background: #fff1e0; color: #8a5200; }
.unsure { color: var(--warn); font-weight: 700; }
.who { color: var(--muted); }
.route p { margin: .35em 0; }
.reasons { margin: .3em 0 .2em 1.1em; padding: 0; color: var(--warn); }
.history ol { list-style: none; margin: 0; padding: 0; }
.history li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.history li:first-child { border-top: 0; }
.ev-detail { color: var(--muted); }
.reject-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 10px; }
.reject-form label { flex: 1; min-width: 200px; }
.warn-card { border-color: var(--warn); }
table.limits { border-collapse: collapse; margin-bottom: 12px; }
table.limits th, table.limits td { padding: 6px 8px; text-align: left; }
table.limits input { max-width: 160px; }
.user-row { border-top: 1px solid var(--line); padding: 10px 0; }
.user-row summary { cursor: pointer; }
.user-row form { margin-top: 10px; }
.card h2:first-child { margin-top: 0; }
@media (max-width: 700px) {
  table.list .c-cat { display: none; }
}

.test-banner { background: #fff2d6; color: #8a5a00; text-align: center; font-weight: 700; font-size: .85rem;
  padding: 6px 12px; border-bottom: 1px solid #f0d9a8; }

.can-approve { color: #2f6b22; font-weight: 600; }
.count.all { background: #8a8580; color: #fff; }

/* --- nahrání: typ dokladu, info, stránky ------------------------------ */
.upload fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.upload legend, .upload .step-title, .info-field > label { padding: 0; margin: 0 0 6px; font-weight: 700; color: var(--text); font-size: .95rem; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg label { position: relative; color: var(--text); }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: grid; place-items: center; min-height: 48px; padding: 6px 4px; text-align: center; line-height: 1.15;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; font-size: .9rem; cursor: pointer; }
.seg input:checked + span { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-dark); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.seg-hint { margin: 6px 0 0; font-size: .8rem; }
.doc-type.missing .seg span, .info-field.missing textarea { border-color: var(--err); background: var(--err-bg); }
.info-field { margin: 0 0 14px; }
.info-field > label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-field textarea { width: 100%; box-sizing: border-box; }
.req { font-size: .75rem; font-weight: 600; color: var(--primary-dark); background: var(--primary-bg); padding: 1px 7px; border-radius: 999px; }
.info-field { position: relative; }
.info-tip { position: static; display: inline-block; font-weight: 400; }
.info-tip summary { list-style: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--muted); color: var(--muted); font: italic 700 .8rem Georgia, serif; cursor: pointer; }
.info-tip summary::-webkit-details-marker { display: none; }
.info-tip[open] summary { border-color: var(--primary); color: var(--primary); }
.info-tip > div { position: absolute; z-index: 15; top: 30px; left: 0; right: 0; max-width: 420px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(26, 25, 25, .15);
  color: var(--text); font-size: .85rem; line-height: 1.4; }
.info-tip ul { margin: 6px 0; padding-left: 18px; }
.upload .pick.off { opacity: .5; pointer-events: none; }
.pages { margin: 0 0 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
.thumbs li { position: relative; width: 74px; text-align: center; font-size: .75rem; color: var(--muted); }
.thumbs img { display: block; width: 74px; height: 98px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumbs .del { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  background: var(--navy); color: #fff; border: 2px solid #fff; font-size: 1rem; line-height: 1; }
.pages .send-pages { width: 100%; }
.doc-info textarea { width: 100%; box-sizing: border-box; margin: 4px 0 6px; }
.doc-info.missing { border-color: var(--err); background: var(--err-bg); }
.danger-zone { border-color: #f0c4c4; }
.filters .buttons { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.filters .buttons > * { white-space: nowrap; }
.upload .confirm { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px; color: var(--text); font-size: .9rem; }
.upload .confirm input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.upload .confirm.missing { border-color: var(--err); background: var(--err-bg); }
.flash.info { background: var(--info-bg); color: var(--text); }
.push-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- archiv: hledání, čipy, období ------------------------------------ */
.filters2 { display: grid; gap: 10px; }
.filters2 .search { position: relative; }
.filters2 .search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.filters2 .search input { width: 100%; box-sizing: border-box; padding-left: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-label { margin: 2px 0 -4px; font-size: .8rem; color: var(--muted); }
.chip { position: relative; flex: none; color: var(--text); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.chip span { display: inline-block; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: .85rem; white-space: nowrap; cursor: pointer; }
.chip input:checked + span { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.filter-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.filter-foot .period { display: flex; align-items: center; gap: 6px; color: var(--text); }
.filter-foot .period svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.filter-foot .period select { width: auto; padding: 6px 10px; }
.filter-foot .foot-links { display: flex; gap: 14px; font-size: .9rem; white-space: nowrap; }
.filters2 .dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters2 .dates input { width: 100%; box-sizing: border-box; }

/* --- přepínač upozornění ---------------------------------------------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 2px;
  color: var(--text); font-size: 1rem; position: relative; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; width: 50px; height: 30px; border-radius: 999px; background: #d5d8de; position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--primary); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:disabled + .switch { opacity: .5; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--primary); outline-offset: 2px; }
.push-sub { margin: 0 0 10px; }
.push-test { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; margin: 4px 0 10px; }
.push-test svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* --- fronta: úkoly ---------------------------------------------------- */
.tasks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.task { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; }
.task-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task-tag { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-schvalit { background: var(--primary-bg); color: var(--primary-dark); }
.tag-zkontrolovat { background: #fdf1d8; color: #7a4a05; }
.tag-opravit { background: var(--err-bg); color: var(--err); }
.tag-vyresit { background: var(--info-bg); color: var(--text); }
.task-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px;
  color: var(--text); text-decoration: none; }
.task-sup { font-weight: 600; font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-sum { font-weight: 700; white-space: nowrap; }
.task-meta { margin-top: 2px; font-size: .85rem; }
.task-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 10px; }
.task-actions .button, .task-actions button { text-align: center; padding: 10px; }
.all-done { padding: 18px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.overview { padding: 0; }
.overview > summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.overview > summary::-webkit-details-marker { display: none; }
.overview > summary::before { content: "›"; display: inline-block; margin-right: 8px; transition: transform .2s; }
.overview[open] > summary::before { transform: rotate(90deg); }
.overview h2 { margin: 6px 16px 8px; font-size: 1rem; }
.overview .scroll { margin: 0 8px 12px; }
