/* Zeiterfassung · Scherr+Klimke – Rot #E30613, Weiß, Schwarz, helles Grau. Systemschrift (Windows 11: Segoe UI). */

:root {
  --red: #e30613;
  --red-hover: #c00510;
  --red-soft: #fdecec;
  --black: #000;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --line: #dcdcdc;
  --line-strong: #c4c4c4;
  --bg: #f4f4f4;
  --surface: #fff;
  --surface-2: #f8f8f8;
  --work: #2e9e44;
  --home: #138a8a;
  --break: #f39200;
  --break-soft: #fff1dc;
  --errand: #1f6fd1;
  --gap: #b5b5b5;
  --corr: #6b4fbb;
  --corr-soft: #efeafb;
  --pos: #2e7d32;
  --neg: #c62828;
  --warn-bg: #fff4d6;
  --warn-line: #f0c040;
  --focus: #1f6fd1;
  --radius: 4px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --black: #fff; --ink: #ececec; --muted: #a3a3a3; --line: #3a3a3a; --line-strong: #4a4a4a;
    --bg: #161616; --surface: #202020; --surface-2: #272727; --red-soft: #3b1517;
    --break-soft: #3a2a10; --corr-soft: #2a2340; --warn-bg: #3a3214; --warn-line: #8a7020;
    --pos: #66bb6a; --neg: #ef6f6f; --focus: #7fb0ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--ink); text-underline-offset: 2px; }
h1, h2, h3 { color: var(--black); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 650; margin-top: 1.4em; }
p { margin: 0 0 .8em; }
small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; margin-top: .2em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.pos { color: var(--pos); }
.neg, .neg-strong { color: var(--neg); }
.strong { font-weight: 650; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Wortmarke */
.wm { font-weight: 700; font-size: 1.55rem; letter-spacing: -.02em; color: var(--black); white-space: nowrap; }
.wm b { color: var(--red); font-weight: 700; padding: 0 .02em; }
.wm-short { font-size: 1.05rem; letter-spacing: 0; }

/* Schaltflächen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; font: inherit; font-weight: 550; padding: .45em 1.05em; min-height: 38px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn.danger { color: var(--neg); }
.btn.small { min-height: 30px; padding: .2em .7em; font-size: .87rem; }
.btn.ghost { border-color: transparent; }
.btn.wide { width: 100%; }
.btn.icon-only { padding: 0; width: 38px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Formulare */
.form label > input:not([type=checkbox]):not([type=radio]), .form label > select, .form label > .date-wrap { display: block; }
.form label { display: block; font-weight: 550; font-size: .88rem; margin-bottom: .85rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; }
.form legend { font-weight: 700; font-size: 1rem; margin-bottom: .5rem; color: var(--black); }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .45em .6em; min-height: 38px; width: 100%; margin-top: .25rem; }
input:disabled { background: var(--surface-2); color: var(--muted); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; margin: 0 .5em 0 0; accent-color: var(--red); }
.check { display: flex !important; align-items: center; font-weight: 450 !important; }
.check.small { font-size: .82rem; }
.check-inline { align-self: end; min-height: 38px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; margin-bottom: 1rem; }
.week label { text-align: center; font-size: .78rem; margin: 0; }
.week input { text-align: center; padding: .4em .2em; }
.inline-form { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.inline-form label { margin: 0; }
.inline-form .grow, .grow { flex: 1; min-width: 200px; }
.short, input.short { max-width: 7em; }
.short-field { max-width: 240px; }
.narrow-form { max-width: 600px; }
.hint { color: var(--muted); font-size: .86rem; }
.error { background: #fde7e7; color: #8f1d1d; padding: .6em .8em; border-left: 3px solid var(--red); border-radius: var(--radius); }
.lead { color: var(--muted); }
.date-wrap { position: relative; display: block; }
input.date { padding-right: 2.2em; }
input.time { max-width: 7em; }
.cal-btn { position: absolute; right: 4px; top: calc(50% + .125rem); transform: translateY(-50%); }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); padding: .6em .8em; border-radius: var(--radius); overflow-x: auto; font-size: .82rem; }
code.details { white-space: pre-wrap; word-break: break-word; font-size: .78rem; color: var(--muted); }

/* Kalenderhilfe */
.cal { position: absolute; z-index: 30; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .5rem; width: 260px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 650; margin-bottom: .3rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: .82rem; }
.cal-grid span { color: var(--muted); font-size: .72rem; padding: .2em 0; }
.cal-grid button { font: inherit; border: 0; background: none; padding: .35em 0; border-radius: 3px; cursor: pointer; color: var(--ink); }
.cal-grid button:hover { background: var(--surface-2); }
.cal-grid button.sel { background: var(--red); color: #fff; }
.cal-grid button.today { outline: 1px solid var(--red); }
.cal-foot { display: flex; justify-content: space-between; margin-top: .4rem; }

/* Meldungen */
.flash { padding: .6em .9em; border-radius: var(--radius); margin-bottom: 1rem; border-left: 3px solid var(--work); background: var(--surface); box-shadow: 0 0 0 1px var(--line) inset; }
.flash-err { border-left-color: var(--red); }
.flash-info { border-left-color: var(--errand); }
.banner { padding: .6em .9em; border-radius: var(--radius); margin-bottom: 1rem; background: var(--warn-bg); border-left: 3px solid var(--warn-line); }
.banner-info { background: var(--surface); border-left-color: var(--errand); box-shadow: 0 0 0 1px var(--line) inset; }
.banner-warn { background: var(--warn-bg); }
.notes { list-style: none; padding: 0; margin: 1rem 0 0; }
.notes li { display: flex; gap: .5rem; align-items: flex-start; padding: .45em .7em; border-radius: var(--radius); margin-bottom: .35rem; font-size: .88rem; }
.note-warn { background: var(--warn-bg); }
.note-warn .ic { color: #b07800; margin-top: .1em; }
.note-info { background: var(--surface-2); }
.empty { color: var(--muted); padding: .8rem 0; }

/* Tags */
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05em .5em; border-radius: 3px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; vertical-align: 1px; }
.tag-ok { color: var(--pos); border-color: currentColor; }
.tag-warn { color: #8a5b00; background: var(--warn-bg); border-color: var(--warn-line); }
.tag-live { color: var(--work); border-color: currentColor; }
.tag-corr { color: var(--corr); background: var(--corr-soft); border-color: transparent; }
.tag-orig { color: var(--ink); }
.tag-calc { color: #9a5a00; background: var(--break-soft); border-color: transparent; }
@media (prefers-color-scheme: dark) { .tag-warn { color: #f0c040; } .tag-calc { color: var(--break); } }

/* ============ Großes Fenster ============ */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.6rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-brand { text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.lang { display: flex; align-items: center; gap: .25rem; font-size: .85rem; color: var(--muted); }
.lang button { font: inherit; border: 0; background: none; cursor: pointer; color: var(--muted); padding: .2em .3em; }
.lang button[aria-current="true"] { color: var(--red); font-weight: 700; }
.lang-center { justify-content: center; margin-top: 1rem; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius); color: var(--ink); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--surface-2); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .35rem; z-index: 40; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; padding: .45em .6em; border: 0; background: none; color: var(--ink); text-decoration: none; border-radius: 3px; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop button[aria-current="true"]::before { content: "✓ "; color: var(--red); }
.menu-pop .check { padding: .3em .6em; }
.menu-name { font-size: .78rem; color: var(--muted); padding: .3em .6em 0; margin: 0; }

.shell { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 58px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 1rem .7rem; display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: .7rem; padding: .6em .8em; border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.side a:hover { background: var(--surface-2); }
.side a[aria-current="page"] { background: var(--red-soft); font-weight: 650; box-shadow: inset 3px 0 0 var(--red); }
.side a[aria-current="page"] .ic { color: var(--red); }
.main { padding: 1.6rem 2rem 3rem; min-width: 0; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-sub { margin: .2rem 0 0; font-size: 1.05rem; color: var(--ink); }
.switcher label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin: 0; }
.switcher select { width: auto; margin: 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.2rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.attention { border-left: 3px solid var(--warn-line); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; margin-bottom: 1.2rem; }
.cols > .panel { margin-bottom: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .3em 0; border-bottom: 1px solid var(--line); }
.cols-list { columns: 2; }

/* Kennzahlen */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.2rem; }
.kpis-5 { grid-template-columns: repeat(5, 1fr); }
.kpi { padding: .9rem 1.2rem; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi p { margin: 0; }
.kpi-label { font-size: .85rem; color: var(--ink); }
.kpi-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; color: var(--black); }
.kpi-sub { font-size: .8rem; color: var(--muted); }
.kpi-balance.neg .kpi-value { color: var(--neg); }
.kpi-value.neg, .kpi-value.neg-strong { color: var(--neg); }
.compare-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr); gap: 0; align-items: stretch; margin-bottom: 1.2rem; }
.compare-kpis .kpi { border-left: 1px solid var(--line-strong); padding: .3rem 1.4rem; }
.compare-kpis .kpi:first-child { border-left: 0; padding-left: 0; }
.compare-kpis .kpi-value { font-size: 2.3rem; }
.kpi-alert { display: flex; align-items: center; gap: .6rem; align-self: center; margin-left: 1rem; padding: .8rem 1rem; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); font-weight: 600; text-decoration: none; color: var(--ink); }
.kpi-alert .ic { width: 24px; height: 24px; color: #d08a00; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data th, .data td { padding: .5em .7em; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.data thead th { font-weight: 650; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.data tfoot th, .data tfoot td { border-top: 1px solid var(--line-strong); font-weight: 650; }
.data .num { text-align: right; }
.data tbody tr:hover { background: var(--surface-2); }
.data tr.weekend td { background: var(--surface-2); }
.data tr.is-today td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.data tr.row-flag td:first-child { box-shadow: inset 3px 0 0 var(--break); }
.data tr.inactive { opacity: .55; }
.data td.tags { white-space: normal; }
.data td.tags .tag { margin: 1px 0; }
.data .old { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--corr); }
.data td:last-child { white-space: normal; }
.data.compact { font-size: .82rem; margin-top: .8rem; }
.data.compact th, .data.compact td { padding: .3em .5em; }

/* Navigation über Tage und Zeiträume */
.day-nav, .period-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.day-nav .date-wrap { width: 150px; }
.day-nav input { margin: 0; }
.day-status { margin-left: auto; display: flex; gap: .3rem; }
.period-nav strong { min-width: 7em; text-align: center; }
.link-right { margin-left: auto; }
.inline { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.inline input { margin: 0; }
.range .date-wrap { width: 140px; }
.tabs { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; margin: 0 .5rem 0 0; }
.tabs a { padding: .4em .9em; text-decoration: none; color: var(--ink); background: var(--surface); border-left: 1px solid var(--line-strong); }
.tabs a:first-child { border-left: 0; }
.tabs a[aria-current="page"] { background: var(--black); color: var(--surface); }
p.tabs { display: inline-flex; margin-bottom: 1rem; }
.button-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.button-row form { margin: 0; }
.book-actions { display: flex; gap: .8rem; margin: 0 0 1.4rem; }
.book-actions form { margin: 0; }

/* Verbuchung */
.alloc-head, .alloc-row { display: grid; grid-template-columns: 1.3fr 2fr 6.5em; gap: .5rem; }
.alloc-head { font-size: .82rem; font-weight: 650; padding: .3em 0; border-bottom: 1px solid var(--line-strong); margin-bottom: .4rem; }
.alloc-row { margin-bottom: .35rem; }
.alloc-row input, .alloc-row select { margin: 0; }
.alloc .dur { text-align: right; }
details.history summary { cursor: pointer; list-style: none; }
details.history summary h2 { display: inline; }
details.history summary::-webkit-details-marker { display: none; }

/* Korrekturmodus als Seitenleiste */
@media (min-width: 1200px) { .main:has(.drawer) { padding-right: 460px; } }
.drawer { position: fixed; top: 58px; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -10px 0 30px rgba(0,0,0,.12); padding: 1rem 1.2rem 2rem; overflow-y: auto; z-index: 15; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 1rem; padding-bottom: .5rem; }
.drawer-head h2 { margin: 0; }
.drawer .row2 { gap: 0 .8rem; }
.impact { background: var(--corr-soft); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1rem; }
.impact p { margin: 0 0 .25rem; }
.impact-title { font-weight: 700; }
.stamp-list { list-style: none; padding: 0; margin: 0; }
.stamp-list li { display: flex; align-items: center; gap: .5rem; padding: .4em 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.stamp-label { flex: 1; }
.stamp-time { font-weight: 600; }

/* Grafiken */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); }
.chart .grid.zero { stroke: var(--muted); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .axis-today { fill: var(--red); font-weight: 700; }
.chart .row-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .bar { fill: var(--black); }
.chart .bar-live { opacity: .35; }
.chart .bar-muted { fill: var(--gap); }
.chart .target { stroke: var(--red); stroke-width: 2.5; }
.chart .line { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; }
.chart .line-actual { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .dot { fill: var(--red); }
.seg-work { fill: var(--work); }
.seg-home { fill: var(--home); }
.seg-errand { fill: var(--errand); }
.seg-break { fill: var(--break); }
.seg-gap { fill: var(--gap); opacity: .5; }
.seg-auto { fill: url(#hatch); }
.seg-open { opacity: .55; }
.hatch-bg { fill: var(--break-soft); }
.hatch-line { stroke: var(--break); stroke-width: 3; }
.legend { font-size: .8rem; color: var(--muted); margin: .4rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .9rem; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: -.5rem; }
.sw-work { background: var(--work); } .sw-home { background: var(--home); } .sw-errand { background: var(--errand); } .sw-break { background: var(--break); }
.sw-auto { background: repeating-linear-gradient(45deg, var(--break) 0 2px, var(--break-soft) 2px 5px); }
.sw-bar { background: var(--black); } .sw-target { background: var(--red); height: 3px; vertical-align: 3px; }
.sw-line { background: var(--red); height: 3px; vertical-align: 3px; } .sw-line-actual { background: var(--muted); height: 2px; vertical-align: 3px; }

/* Jahresplaner */
table.planner { table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: .7rem; width: 100%; min-width: 760px; }
.planner th { font-weight: 600; color: var(--muted); text-align: center; }
.planner thead th:first-child, .planner tbody th { width: 4.2em; white-space: nowrap; }
.planner tbody th { text-align: left; padding-right: .4rem; color: var(--ink); }
.planner td { height: 18px; background: var(--surface-2); border-radius: 2px; }
.planner td.pl-none { background: none; }
.planner td.pl-we { background: var(--line); }
.pl-hol, .planner td.pl-hol { background: var(--red); opacity: .8; }
.pl-vacation, .planner td.pl-vacation { background: var(--work); }
.pl-company_vacation, .planner td.pl-company_vacation { background: var(--home); }
.pl-sick, .planner td.pl-sick { background: var(--break); }
.pl-office_holiday, .planner td.pl-office_holiday { background: var(--corr); }
.pl-comp, .planner td.pl-comp { background: var(--errand); }
.planner td.pl-other { background: var(--gap); }
.planner td.pl-half { background-image: linear-gradient(135deg, transparent 50%, var(--surface) 50%); }
.planner td.pl-today { outline: 2px solid var(--black); }
.planner td.pl-school { box-shadow: inset 0 -4px 0 #9bc3ec; }
.planner tr.year-start th, .planner tr.year-start td { border-top: 6px solid var(--surface); }
.planner tr.past th { color: var(--muted); }
.planner-wrap:has(#hide-past:checked) tr.past { display: none; }
.sw-school { background: #9bc3ec; height: 5px; vertical-align: 2px; }
.cal-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.cal-list li { display: flex; gap: .6rem; align-items: baseline; padding: .28em 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.cal-kind { width: 10px; height: 10px; border-radius: 2px; flex: none; align-self: center; background: var(--red); opacity: .8; }
.cal-school .cal-kind { background: #9bc3ec; opacity: 1; }
.cal-date { min-width: 15.5em; font-variant-numeric: tabular-nums; }
.cal-past { margin-top: .8rem; }
.cal-past summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.cal-past .cal-list { opacity: .6; margin-top: .4rem; }
@media (max-width: 960px) { .cal-list { columns: 1; } .cal-date { min-width: 0; } }

/* Verwaltung */
.settings { display: grid; grid-template-columns: 220px 1fr; gap: 1.4rem; align-items: start; }
.subnav { display: flex; flex-direction: column; gap: 1px; position: sticky; top: 74px; }
.subnav a { padding: .4em .7em; border-radius: var(--radius); text-decoration: none; color: var(--ink); font-size: .92rem; }
.subnav a:hover { background: var(--surface); }
.subnav a[aria-current="page"] { background: var(--surface); font-weight: 650; box-shadow: inset 3px 0 0 var(--red); }
.nav-group { margin: .8rem 0 .2rem .7rem; font-size: .75rem; color: var(--muted); font-weight: 650; }
.nav-group:first-child { margin-top: 0; }
.row-list { display: flex; flex-direction: column; gap: .4rem; }
.edit-row, .rule-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.edit-row input, .rule-row input { width: auto; margin: 0; }
.edit-row .grow { flex: 1; }
.rule-row { margin-bottom: .4rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.devices { list-style: none; padding: 0; margin: 0 0 1rem; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.steps { padding-left: 1.2rem; }

/* ============ Anmeldung ============ */
.narrow { display: flex; justify-content: center; align-items: flex-start; padding: 9vh 1rem 2rem; }
.narrow-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.7rem 1.2rem; }
.narrow.wide .narrow-box { max-width: 720px; }
.narrow-brand { display: flex; align-items: baseline; gap: .7rem; margin-bottom: 1.5rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.narrow-app { color: var(--muted); }
.narrow-box .sub { text-align: center; font-size: .9rem; margin-top: 1rem; }
.checks { list-style: none; padding: 0; margin: 0 0 1.2rem; font-size: .9rem; }
.checks li::before { content: "✓"; color: var(--pos); font-weight: 700; margin-right: .5em; }
.checks li.bad::before { content: "✗"; color: var(--neg); }
.checks li.bad { color: var(--neg); }

/* ============ Minifenster (Stempeluhr) ============
   Feste Reihenfolge in jedem Zustand: Kopf · Status/Zeit · Schnellbuchung · Hinweis · Aktionen.
   Passt ab ca. 300 × 300 px; größere Fenster bekommen nur mehr Rand, nichts verschiebt sich. */
html:has(body.mini) { height: 100%; }
body.mini { background: var(--surface); min-height: 100%; display: flex; justify-content: center; }
.mini-box { width: 100%; max-width: 460px; padding: .55rem .8rem .6rem; display: flex; flex-direction: column; gap: .45rem; }
.mini-top { display: flex; align-items: center; gap: .2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
.mini-app { font-weight: 650; margin-left: .3rem; flex: 1; }
.mini-menu .menu-pop { right: -64px; }
.mini-msg:empty { display: none; }
.mini-msg .flash, .mini-banner { margin: 0; padding: .25em .6em; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-banner { background: var(--warn-bg); border-radius: var(--radius); }
.mini-status { display: flex; align-items: center; gap: .55rem; min-height: 2.4rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gap); flex: none; }
.dot-work { background: var(--work); } .dot-home { background: var(--home); } .dot-break { background: var(--break); } .dot-errand { background: var(--errand); }
.mini-state { font-weight: 650; font-size: 1.02rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-time { font-size: 2.1rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--black); }
.mini-project { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.mini-project input { border: 0; margin: 0; min-height: 36px; background: none; text-overflow: ellipsis; min-width: 0; flex: 1; }
.mini-project input:focus { outline: none; }
.mini-project:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.chips { display: flex; gap: .3rem; flex-wrap: nowrap; overflow: hidden; margin-top: -.15rem; }
.chips button { font: inherit; font-size: .75rem; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: .08em .65em; cursor: pointer; color: var(--ink); white-space: nowrap; }
.chips button:hover { border-color: var(--ink); }
.chips button[aria-pressed="true"] { background: var(--black); color: var(--surface); border-color: var(--black); }
.mini-hint { font-size: .8rem; color: var(--muted); margin: 0; min-height: 1.25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-hint strong { color: #b06a00; }
.mini-hint.due { color: #b06a00; font-weight: 600; }
.mini-actions { margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.btns { display: grid; gap: .45rem; }
.btns-1 { grid-template-columns: 1fr; } .btns-2 { grid-template-columns: 1fr 1fr; } .btns-3 { grid-template-columns: 1fr 1fr 1fr; }
.btns .span-2 { grid-column: span 2; }
.act { font: inherit; font-weight: 600; font-size: .9rem; min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; padding: 0 .35rem; line-height: 1.15; text-align: center; }
.act:hover { border-color: var(--ink); }
.act.primary { background: var(--red); border-color: var(--red); color: #fff; }
.act.primary:hover { background: var(--red-hover); }
.seg-choice { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; align-self: flex-start; margin: 0; }
.seg-choice label { margin: 0; cursor: pointer; }
.seg-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-choice span, .seg-choice button { display: block; padding: .15em .8em; font: inherit; font-size: .8rem; border: 0; background: var(--surface); color: var(--ink); cursor: pointer; }
.seg-choice label + label span, .seg-choice button + button { border-left: 1px solid var(--line-strong); }
.seg-choice input:checked + span, .seg-choice button[aria-pressed="true"] { background: var(--black); color: var(--surface); }
.seg-choice input:focus-visible + span { outline: 2px solid var(--focus); }
.mini-note input { margin: 0; min-height: 30px; font-size: .8rem; }
.mini-link { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; }
.mini-link .ic { width: 13px; height: 13px; }
.mini-link:hover { color: var(--ink); text-decoration: underline; }
.mini-foot { margin-top: auto; align-self: flex-start; }
body.embedded .mini-box { padding-top: .3rem; }
@media (max-height: 330px) { .mini-foot { display: none; } .mini-box { gap: .35rem; } }
@media (max-width: 330px) { .mini-time { font-size: 1.7rem; } .act { font-size: .82rem; } }

/* Druckansicht */
.print-page { background: #fff; color: #000; }
.print-box { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.print-head { display: flex; align-items: flex-start; gap: 2rem; margin-bottom: 1rem; border-bottom: 2px solid #000; padding-bottom: .8rem; }
.print-head > div { flex: 1; }
.print-head h1 { font-size: 1.4rem; margin: 0; }
.print-head p { margin: 0; color: #444; }
.print-table { font-size: .82rem; }
.print-sum { display: flex; gap: 2rem; margin: 1rem 0; }
.print-sum dt { font-size: .8rem; color: #555; }
.print-sum dd { margin: 0; font-size: 1.1rem; }
@media print {
  .no-print, .topbar, .side, .drawer, form, .book-actions { display: none !important; }
  .shell { display: block; }
  .panel { break-inside: avoid; border-color: #bbb; }
  body { background: #fff; }
}

/* Kleine Bildschirme */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; padding: .4rem .6rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a { white-space: nowrap; }
  .main { padding: 1rem; }
  .cols, .settings { grid-template-columns: 1fr; }
  .subnav { position: static; flex-direction: row; flex-wrap: wrap; }
  .nav-group { width: 100%; }
  .kpis, .kpis-5 { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi { border-top: 1px solid var(--line); }
  .compare-kpis { grid-template-columns: 1fr 1fr 1fr; row-gap: .8rem; }
  .kpi-alert { grid-column: 1 / -1; margin-left: 0; }
  .row4 { grid-template-columns: 1fr 1fr; }
  .topbar { padding: .6rem 1rem; }
  .topbar .btn span { display: none; }
}
@media (max-width: 560px) {
  .row2, .row3, .row4 { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
  .compare-kpis .kpi-value { font-size: 1.6rem; }
  .compare-kpis .kpi { padding: .2rem .7rem; }
  .alloc-head { display: none; }
  .alloc-row { grid-template-columns: 1fr 5.5em; }
  .alloc-row input[name$="[note]"] { grid-column: 1 / -1; order: 3; }
  .wm { font-size: 1.25rem; }
  .cols-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Aktionslog */
.log-filter { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin-bottom: 1rem; }
.log-filter label { font-size: .85rem; font-weight: 550; }
.log-filter select, .log-filter input:not([type=checkbox]) { width: auto; min-width: 12em; }
.log-table td { vertical-align: top; }
.log-table code.details { display: block; max-width: 60ch; }
