/* Readable first: big text, big tap targets, high contrast. */
:root { --fg:#111; --muted:#5b6370; --bg:#f3f4f6; --card:#fff; --line:#d9dce1; --pri:#0b5cad; --pri-fg:#fff; --danger:#b42318; --ok:#e7f6ec; --okb:#1f7a3a; --err:#fdecea; }
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--fg); background: var(--bg); line-height: 1.4; }
main { max-width: 860px; margin: 0 auto; padding: 12px 16px 48px; }
h1 { font-size: 1.5rem; margin: .3em 0 .5em; }
h2 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
a { color: var(--pri); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; background: #1f2933; color: #fff; padding: 8px 16px; }
.top .brand { color: #fff; font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.menu summary { cursor: pointer; list-style: none; padding: 8px 12px; border: 1px solid #52606d; border-radius: 8px; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 16px; top: 52px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.15); min-width: 240px; padding: 6px 0; max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain; }
.menu nav .menu-sep { border-top: 1px solid var(--line); margin: 6px 0; }
.menu nav a, .menu nav button { display: block; width: 100%; text-align: left; padding: 12px 18px; color: var(--fg); text-decoration: none; font-size: 1rem; }
.menu nav a:hover { background: var(--bg); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.btn { display: inline-block; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); text-decoration: none; font-size: 1rem; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--pri); color: var(--pri-fg); border-color: var(--pri); }
.btn-start { background: var(--okb); color: #fff; border-color: var(--okb); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.stopwatch { border-left: 6px solid var(--muted); }
.stopwatch.running { border-left-color: var(--okb); }
.stopwatch.paused { border-left-color: #e8a317; }
.stopwatch .sw-title { font-weight: 600; }
.stopwatch .sw-time { font-size: 1.2rem; margin: 6px 0 4px; }
.stopwatch .wide { margin-bottom: 4px; }
.stopwatch .sw-cancel { margin-top: 8px; font-size: .95rem; }
.wide { display: block; width: 100%; text-align: center; margin: 8px 0 14px; }
.big { font-size: 1.15rem; padding: 16px; font-weight: 600; }
button.link { background: none; border: 0; color: var(--pri); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.danger { color: var(--danger) !important; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions form { margin: 0; }
.actions.small { gap: 18px; margin-top: 8px; font-size: .95rem; }
form.inline { display: inline; margin-left: 10px; }
.back { display: inline-block; margin: 4px 0 10px; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.logo-now { margin: 10px 0 4px; }
.logo-now img { max-height: 80px; max-width: 100%; margin-top: 4px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; } /* white like the PDF, also in dark mode */
.pad { padding: 12px 14px; }
.num { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg { padding: 12px 14px; border-radius: 10px; margin-bottom: 12px; background: var(--ok); border: 1px solid var(--okb); }
.msg-error { background: var(--err); border-color: var(--danger); }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field.check label { font-weight: 400; display: flex; gap: 10px; align-items: center; }
.field small { display: block; color: var(--muted); margin-top: 3px; }
.field .error { color: var(--danger); margin-top: 3px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font-size: 1.05rem; padding: 11px 12px; border: 1px solid #aab1bb; border-radius: 10px; background: #fff; color: var(--fg); font-family: inherit; }
input[type=checkbox] { width: 24px; height: 24px; }
.field div > div label, .field ul li label { font-weight: 400; display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.field div[id] > div, .field ul { list-style: none; padding: 0; margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 160px; }
.filters select { width: auto; }
.list { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.list li > a { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 14px; text-decoration: none; color: var(--fg); }
.list li.inactive { opacity: .55; }
.entries { list-style: none; padding: 0; margin: 0; }
.entries > li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.entries form { margin: 0; }
.changes { margin: 6px 0 0; padding-left: 18px; font-size: .95rem; }
.tag { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: #e4e7eb; color: #1f2933; }
.tag-rozpracovana { background: #fff4d6; } .tag-hotova { background: #dcf3e3; } .tag-predana { background: #dbeafe; }
.tag-vyfakturovana { background: #ede4ff; } .tag-closed { background: #374151; color: #fff; }
.note { white-space: normal; background: var(--bg); padding: 10px; border-radius: 8px; }
.hours-line { font-size: 1.1rem; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tbl th, .tbl td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { background: #eef0f3; font-size: .9rem; }
.tbl .r { text-align: right; }
.nowrap { white-space: nowrap; }
.summary .sub td { background: #f8f9fa; }
.summary .total td { font-weight: 700; font-size: 1.15rem; border-top: 2px solid var(--fg); }
.warn { color: #9a5b00; font-weight: 600; }
.perms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: .8rem; }
.perms span { padding: 2px 8px; border-radius: 999px; }
.perms .on { background: #dcf3e3; } .perms .off { background: #eee; color: #888; text-decoration: line-through; }
.month-nav { margin: 6px 0; }
.danger-zone { margin-top: 40px; text-align: center; }
@media (max-width: 520px) { .tbl th, .tbl td { padding: 8px 6px; font-size: .9rem; } }
/* v2: calendar, warnings */
.center { text-align: center; }
.legend { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--muted); margin: 6px 0 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot-plan { background: #0b5cad; } .dot-absence { background: #d97706; }
.dot-stk, .dot-oil, .dot-inspection { background: #b42318; }
.week { display: grid; gap: 8px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, 1fr); } main:has(.week) { max-width: 1280px; } }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.day.today { border: 2px solid var(--pri); }
.day.weekend { background: #f8f9fa; }
.dayhead { margin-bottom: 6px; text-transform: capitalize; }
.ev { border-left: 4px solid #999; padding: 4px 8px; margin: 4px 0; background: #f5f7fa; border-radius: 0 6px 6px 0; }
.ev a { color: inherit; text-decoration: none; display: block; }
.ev-plan { border-color: #0b5cad; } .ev-absence { border-color: #d97706; background: #fff7ed; }
.ev-stk, .ev-oil, .ev-inspection { border-color: #b42318; background: #fdecea; }
.warnbox { border-color: #d97706; background: #fffaf0; }
.warnbox h2 { margin-top: 0; }
.warnlist { list-style: none; margin: 0; padding: 0; }
.warnlist li a { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 8px 0; color: var(--fg); text-decoration: none; border-top: 1px solid var(--line); }
.warnlist li:first-child a { border-top: 0; }
.warnlist li.overdue strong { color: var(--danger); }
.tag-koupit { background: #dbeafe; } .tag-opravit { background: #fde68a; }
.entries.done li { opacity: .7; }
.weeknav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin: 8px 0; }
.warnlist li a strong { flex-basis: 100%; }
.warnlist li { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.warnlist li:first-child { border-top: 0; }
.warnlist li > a:first-child { flex: 1; border-top: 0 !important; }
.done-btn { white-space: nowrap; padding: 8px 12px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 6px; }
.appver { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 24px; }
@media print { .appver { display: none; } }
.msg-warning { background: #fff7ed; border-color: #d97706; }
.msg .inline-form, .msg > .btn { display: block; margin-top: 8px; }
.dot-meeting { background: #7c3aed; } .ev-meeting { border-color: #7c3aed; background: #f3efff; }
.tag-q-koncept { background: #fff4d6; } .tag-q-odeslana { background: #dbeafe; } .tag-q-odmitnuta { background: #374151; color: #fff; }
.listnote { white-space: normal; margin-top: 4px; }
.tag-overdue { background: #fdecea; color: #b42318; }
.aresrow { margin: -6px 0 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.issueform { display: flex; flex-direction: column; gap: 8px; flex-basis: 100%; }
.issueform .check { display: flex; gap: 8px; align-items: flex-start; }
.dot-quote { background: #0e7490; }
.entries > li.release { background: #eef6ff; border-color: #0b5cad; }

/* ---------- Dark mode (3.4): <html data-theme="dark">, switched in the menu, remembered per device ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --fg: #e5e9ef; --muted: #9aa5b4; --bg: #0f1419; --card: #1a2129; --line: #2f3944;
  --pri: #4a95e3; --pri-fg: #fff; --danger: #f47c7c; --ok: #12301d; --okb: #3fae6a; --err: #3a1715;
}
:root[data-theme="dark"] .btn-primary, :root[data-theme="dark"] .btn-primary:visited { color: #fff; }
:root[data-theme="dark"] .top { background: #0a0e12; }
:root[data-theme="dark"] .menu summary { border-color: #3a4552; }
:root[data-theme="dark"] input[type=text], :root[data-theme="dark"] input[type=password], :root[data-theme="dark"] input[type=number],
:root[data-theme="dark"] input[type=date], :root[data-theme="dark"] input[type=search], :root[data-theme="dark"] input[type=email],
:root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #11171d; border-color: #3a4552; color: var(--fg); }
:root[data-theme="dark"] .tag { background: #2d3640; color: var(--fg); }
:root[data-theme="dark"] .tag-rozpracovana, :root[data-theme="dark"] .tag-q-koncept { background: #4a3b10; }
:root[data-theme="dark"] .tag-hotova { background: #163a24; }
:root[data-theme="dark"] .tag-predana, :root[data-theme="dark"] .tag-q-odeslana, :root[data-theme="dark"] .tag-koupit { background: #16304f; }
:root[data-theme="dark"] .tag-vyfakturovana { background: #33245a; }
:root[data-theme="dark"] .tag-opravit { background: #4a3b10; }
:root[data-theme="dark"] .tag-overdue { background: #3a1715; color: #f47c7c; }
:root[data-theme="dark"] .tbl th { background: #222a33; }
:root[data-theme="dark"] .summary .sub td { background: #1f262e; }
:root[data-theme="dark"] .day.weekend { background: #151b22; }
:root[data-theme="dark"] .ev { background: #222a33; }
:root[data-theme="dark"] .ev-absence, :root[data-theme="dark"] .msg-warning { background: #3a2a12; }
:root[data-theme="dark"] .ev-stk, :root[data-theme="dark"] .ev-oil, :root[data-theme="dark"] .ev-inspection { background: #3a1715; }
:root[data-theme="dark"] .ev-meeting { background: #2b2145; }
:root[data-theme="dark"] .warnbox { background: #2a2212; }
:root[data-theme="dark"] .perms .on { background: #163a24; }
:root[data-theme="dark"] .perms .off { background: #2a3038; color: #7d8794; }
:root[data-theme="dark"] .warn { color: #f0b44c; }
:root[data-theme="dark"] .entries > li.release { background: #14283d; }
:root[data-theme="dark"] .menu nav { box-shadow: 0 6px 24px rgba(0,0,0,.6); }
:root[data-theme="dark"] .btn-start { background: #1f7a3a; border-color: #3fae6a; }
:root[data-theme="dark"] .btn-danger { background: #b42318; border-color: #f47c7c; }
/* 5.2 Docházka in Moje hodiny */
.attendance-box { border-left: 6px solid var(--muted); }
.attendance-box.running { border-left-color: var(--okb); }
.attendance-box .sw-title { font-weight: 600; margin-bottom: 8px; }
.attendance-box .wide { margin-bottom: 6px; }
.week-head { font-size: 1rem; margin: 18px 0 6px; gap: 8px; flex-wrap: wrap; }
.att-line { margin-top: 4px; }
.att-desc { font-size: .95rem; margin-left: 1.4em; }
.hours-who { margin-bottom: 8px; }
.hours-summary { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin: 10px 0 6px; overflow: hidden; }
.hours-summary th, .hours-summary td { padding: 7px 8px; text-align: right; white-space: nowrap; }
.hours-summary th { font-weight: 400; color: var(--muted); font-size: .9rem; }
.hours-summary td:first-child { text-align: left; }
.hours-summary tr + tr td { border-top: 1px solid var(--line); }
