/* JASKI Verwaltung: one stylesheet for office and companion. System fonts, no CDN, no inline
   styles (strict CSP). Mobile first; the office layout switches to a sidebar from 900px.
   Colours follow the system setting unless the person chose one under „Mein Konto“ / „Ich“:
   common/theme.js sets data-theme="light" or "dark" on <html> (21.09.2026). */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f0f2f5; --border: #d9dde3; --text: #1c2430; --muted: #5b6672;
  --primary: #1f5f8b; --primary-hover: #17496b; --primary-soft: #e3eef7; --accent: #2b8a5b; --warn: #b7791f; --warn-soft: #fdf3dc;
  --danger: #b3261e; --danger-soft: #fbe9e7; --ok: #2b8a5b; --ok-soft: #e4f3ea; --info-soft: #e8eef5;
  --zone-core: #1f5f8b; --zone-expansion: #7a7f87; --zone-excluded: #a3a8b0;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 30, 40, .08), 0 4px 14px rgba(20, 30, 40, .06);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #141920; --surface: #1c232d; --surface-2: #232c38; --border: #313b49; --text: #e6eaf0; --muted: #98a4b3; --primary: #6fb1e0; --primary-hover: #8fc3ea; --primary-soft: #1f3143; --warn-soft: #3a3020; --danger-soft: #3d2320; --ok-soft: #1f3a2b; --info-soft: #1f2a38; }
}
:root[data-theme="dark"] { --bg: #141920; --surface: #1c232d; --surface-2: #232c38; --border: #313b49; --text: #e6eaf0; --muted: #98a4b3; --primary: #6fb1e0; --primary-hover: #8fc3ea; --primary-soft: #1f3143; --warn-soft: #3a3020; --danger-soft: #3d2320; --ok-soft: #1f3a2b; --info-soft: #1f2a38; }
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
h1, h2, h3 { margin: 0 0 var(--space-3); line-height: 1.2; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 var(--space-3); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 var(--space-3); font-size: .875rem; font-weight: 500; }
.btn-block { width: 100%; }
.btn-link { border: none; background: none; color: var(--primary); padding: 0; min-height: 0; font-weight: 500; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: var(--space-1); }
input, select, textarea { width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
.field { margin-bottom: var(--space-4); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: var(--space-1); }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 var(--space-4); }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: span 2; } }
.form-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.checkbox { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.checkbox input { width: auto; min-height: 0; }

/* cards, badges, tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-4); margin-bottom: var(--space-4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-3); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.stat .value { font-size: 1.6rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--info-soft); color: var(--text); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 700; }
.bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; min-width: 90px; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }
.empty { color: var(--muted); padding: var(--space-5); text-align: center; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 3px solid transparent; padding: var(--space-3) var(--space-3); font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
/* capacity tiles (M12) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-3); }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); color: inherit; text-decoration: none; }
.tile:hover { border-color: var(--primary); }
.tile-frei { border-left-color: var(--ok); }
.tile-ausgelastet { border-left-color: var(--warn); }
.tile-ueberlastet { border-left-color: var(--danger); }
.tile-kein_soll { opacity: .7; }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: 4px; }
.tile-nums { display: flex; gap: var(--space-4); margin: 6px 0; }
.tile-nums .n { font-weight: 700; }
.tile-nums .l { color: var(--muted); font-size: .8rem; }
.stat-ok .value { color: var(--ok); } .stat-warn .value { color: var(--warn); } .stat-danger .value { color: var(--danger); } .stat-muted .value { color: var(--muted); }
.toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: end; margin-bottom: var(--space-4); }
.toolbar .field { margin-bottom: 0; min-width: 160px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* zones: core, expansion, excluded (Anlage 1) */
.zone { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); }
.zone-core { color: var(--zone-core); border-color: var(--zone-core); }
.zone-expansion { color: var(--zone-expansion); }
.zone-excluded { color: var(--zone-excluded); text-decoration: line-through; }
.hintbar { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--warn-soft); border: 1px solid #ecd8a8; margin-bottom: var(--space-4); font-size: .9rem; }
.hintbar.info { background: var(--info-soft); border-color: var(--border); }
.hintbar.danger { background: var(--danger-soft); border-color: #e7b3ae; }
.banner { padding: var(--space-2) var(--space-4); font-size: .875rem; font-weight: 600; text-align: center; }
.banner-test { background: #fff2cc; color: #6b5200; }
.banner-emergency { background: var(--danger-soft); color: var(--danger); }
.banner-tech { background: var(--warn-soft); color: var(--warn); }
.alarm-band { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--danger); color: #fff; font-size: 1rem; }
.alarm-band strong { letter-spacing: .04em; }
.alarm-band .btn { background: #fff; color: var(--danger); border-color: #fff; }
.alarm-band.withdrawn { background: var(--surface-2); color: var(--muted); }
.alarm-band.withdrawn .btn { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-alarm { background: var(--danger); color: #fff; border-color: var(--danger); font-weight: 700; }
.alarm-card { border: 2px solid var(--danger); }
.alarm-hint { color: var(--danger); font-weight: 700; }

/* toast and modal */
.toast-host { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 12px); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-2); z-index: 60; width: min(92vw, 480px); }
.toast { padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: .9rem; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
.modal-overlay { position: fixed; inset: 0; background: rgba(10, 15, 20, .45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; padding: 0; }
.modal { background: var(--surface); width: 100%; max-height: 92vh; overflow: auto; border-radius: var(--radius) var(--radius) 0 0; padding: var(--space-4); }
@media (min-width: 700px) { .modal-overlay { align-items: center; padding: var(--space-5); } .modal { max-width: 720px; border-radius: var(--radius); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.modal-head h2 { margin: 0; }

/* office layout */
.office { display: grid; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .brand { font-weight: 700; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; color: var(--muted); }
/* Narrow layout stacks nav over content; without an explicit row template the free height of the
   page would be split between both rows and the nav (and its active link) would grow tall. */
.office-body { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.sidenav { background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--space-2); display: flex; gap: var(--space-1); overflow-x: auto; }
.sidenav a { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: 8px; color: var(--text); text-decoration: none; font-size: .9rem; white-space: nowrap; min-height: 40px; }
.sidenav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidenav a.dim { color: var(--muted); }
.sidenav .group { display: none; }
.content { padding: var(--space-4); max-width: 1280px; width: 100%; min-width: 0; }
@media (min-width: 900px) {
  .office-body { grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: 1fr; }
  .sidenav { flex-direction: column; border-bottom: none; border-right: 1px solid var(--border); position: sticky; top: 53px; height: calc(100vh - 53px); overflow-y: auto; padding: var(--space-3); }
  .sidenav .group { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: var(--space-3) var(--space-2) var(--space-1); }
  .content { padding: var(--space-5); }
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.page-head h1 { margin: 0; }
.page-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.page-actions.nowrap { flex-wrap: nowrap; align-items: center; }

/* calendar matrix */
.cal-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.cal { border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.cal th, .cal td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 2px 3px; text-align: center; min-width: 26px; height: 28px; }
/* Jahresübersicht: zwölf Monatsspalten scrollen waagerecht, der Name bleibt stehen — sonst liest
   man in der Mitte des Jahres Zahlen ohne zu wissen, zu wem sie gehören (wie .cal th.name). */
.year-matrix .tbl th:first-child, .year-matrix .tbl td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2; white-space: nowrap; }

.cal th { position: sticky; top: 0; background: var(--surface-2); z-index: 2; font-weight: 600; }
.cal th.name, .cal td.name { position: sticky; left: 0; background: var(--surface); text-align: left; min-width: 160px; z-index: 3; font-weight: 500; white-space: nowrap; }
.cal th.name { z-index: 4; background: var(--surface-2); }
.cal td.we, .cal th.we { background: var(--surface-2); }
.cal td.hol, .cal th.hol { background: #ecebe4; }
.cal td.sum { font-weight: 600; background: var(--surface-2); }
.cal td.requested { outline: 2px dashed var(--warn); outline-offset: -2px; }
.legend { display: flex; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-3) 0; font-size: .85rem; }
.legend span.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 4px; border: 1px solid var(--border); }

/* companion (mobile first) */
.companion { padding-bottom: calc(var(--nav-h) + 12px); }
.companion .content { padding: var(--space-4); max-width: 640px; margin: 0 auto; }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); background: var(--surface); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
.bottomnav a.active { color: var(--primary); }
.bottomnav a .ico { font-size: 1.25rem; line-height: 1; }
.today-card { background: var(--primary); color: #fff; border-radius: 14px; padding: var(--space-4); margin-bottom: var(--space-4); }
.today-card .date { opacity: .85; font-size: .9rem; }
.today-card .big { font-size: 1.6rem; font-weight: 700; margin: var(--space-1) 0; }
.today-card .pill { display: inline-block; background: rgba(255,255,255,.18); border-radius: 999px; padding: 2px 10px; font-size: .8rem; margin-right: 6px; }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-2) 0 var(--space-3); }
.chip { min-height: 48px; padding: 0 var(--space-4); border-radius: 999px; border: 2px solid var(--border); background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; }
.chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.chip.sub { min-height: 40px; font-size: .85rem; font-weight: 500; }
.tapbtn { min-height: 56px; font-size: 1.05rem; }
/* photo of a signed timesheet, shown in a modal: as large as the screen allows, never larger than itself */
.sigpad { margin: var(--space-3) 0; }
.sigpad-canvas { display: block; width: 100%; max-width: 640px; aspect-ratio: 2 / 1; height: auto; touch-action: none; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); cursor: crosshair; }
.sigpad-hint { margin: var(--space-2) 0; }
.statement { font-weight: 600; margin: var(--space-3) 0 0; }
.sigpad-note { margin-top: var(--space-3); }
.signature-img { display: block; max-width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.photo { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: var(--radius); background: var(--surface-2); }
.entry-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.entry-row:last-child { border-bottom: none; }
.entry-row .k { font-weight: 600; }
.entry-row .m { color: var(--muted); font-size: .85rem; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day-cell { border: 1px solid var(--border); border-radius: 8px; padding: 6px 4px; text-align: center; font-size: .8rem; min-height: 64px; background: var(--surface); }
.day-cell.today { border-color: var(--primary); }
.day-cell.off { background: var(--surface-2); color: var(--muted); }
.day-cell .h { font-weight: 700; font-size: .95rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.month-grid .dc { aspect-ratio: 1; border-radius: 6px; font-size: .72rem; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--surface); }
.month-grid .dc.off { background: var(--surface-2); color: var(--muted); }
.month-grid .dc .v { font-weight: 700; }

/* landing and login */
.landing { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--space-4); }
.landing-box, .login-box { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: var(--space-5); box-shadow: var(--shadow); }
.landing-box .btn { margin-top: var(--space-3); }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 80vh; padding: var(--space-4); }
.qr { display: block; margin: var(--space-3) auto; width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 8px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-family: var(--mono); font-size: .9rem; }

/* ── Ruhige Ansichten (15.09.2026): Jahresband, Kapazitätsband, Zeitstrahl, Startseite.
   Ruhig heißt hier: Fläche statt Rahmen, Farbe nur wo sie etwas bedeutet, eine Stelle je Seite
   darf auffallen. Farben kommen aus den Variablen oder aus der Abwesenheitsart in der Datenbank;
   dynamische Werte setzt das Skript über die CSSOM, nie als Stil-Attribut im Markup (CSP). */
:root {
  --rise: 320ms cubic-bezier(.22, .61, .36, 1);
  --cal-cell: 30px;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rise { animation: rise var(--rise) both; }
@media (prefers-reduced-motion: reduce) { .rise { animation: none; } }

/* Jahresband: der Monat soll als Fläche lesbar sein, bevor man eine Zelle liest */
.cal-wrap { max-height: 78vh; box-shadow: var(--shadow); }
table.cal { font-size: .76rem; }
.cal th, .cal td { border-right: none; border-bottom: none; box-shadow: inset -1px -1px 0 var(--border); min-width: var(--cal-cell); height: var(--cal-cell); padding: 0 2px; }
.cal thead th { padding: 3px 2px; line-height: 1.15; color: var(--muted); font-weight: 600; }
.cal thead th .wd { font-size: .62rem; text-transform: uppercase; letter-spacing: .04em; }
.cal thead th .dn { font-size: .82rem; color: var(--text); font-variant-numeric: tabular-nums; }
.cal td.day { background: var(--tint, transparent); color: var(--ink, var(--text)); font-weight: 600; letter-spacing: .01em; }
.cal td.day.quiet { font-weight: 500; color: var(--muted); }
.cal td.hours { font-variant-numeric: tabular-nums; font-weight: 600; }
.cal td.we, .cal th.we { background: var(--surface-2); color: var(--muted); }
.cal td.hol, .cal th.hol { background: var(--surface-2); color: var(--muted); }
.cal td.hol::after { content: ''; display: block; height: 2px; margin: 1px 3px 0; border-radius: 2px; background: var(--muted); opacity: .45; }
.cal .today { box-shadow: inset 2px 0 0 var(--primary), inset -1px -1px 0 var(--border); }
.cal thead th.today .dn { color: var(--primary); }
.cal tbody tr:hover td.name { color: var(--primary); }
.cal tbody tr:hover td { box-shadow: inset 0 -1px 0 var(--primary), inset -1px 0 0 var(--border); }
.cal td.name a { text-decoration: none; color: inherit; }
.cal td.name a:hover { text-decoration: underline; }
.cal td.sum { background: var(--surface-2); font-variant-numeric: tabular-nums; }
.cal td.requested { outline: 2px dashed var(--warn); outline-offset: -3px; }
.legend { gap: var(--space-2) var(--space-4); align-items: center; color: var(--muted); }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; border: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }

/* Kapazitätsband: eine Zeile je Person, verplant gegen verfügbar */
.capboard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.capline { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 3fr) minmax(120px, auto); gap: var(--space-3) var(--space-4); align-items: center; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.capline:last-child { border-bottom: none; }
.capline:hover { background: var(--surface-2); }
.capline .who { min-width: 0; }
.capline .who strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capline .who .meta { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.captrack { position: relative; height: 22px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.captrack .seg { position: absolute; top: 0; bottom: 0; left: 0; }
.captrack .planned { background: var(--primary); opacity: .82; }
.captrack .planned.warn { background: var(--warn); }
.captrack .planned.over { background: var(--danger); }
.captrack .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .35; }
.capline .figs { display: flex; gap: var(--space-4); font-variant-numeric: tabular-nums; }
.capline .figs div { text-align: right; }
.capline .figs .n { font-weight: 700; font-size: .95rem; }
.capline .figs .n.free { color: var(--ok); }
.capline .figs .n.none { color: var(--muted); }
.capline .figs .l { font-size: .72rem; color: var(--muted); }
@media (max-width: 720px) { .capline { grid-template-columns: 1fr; } .capline .figs { justify-content: space-between; } }

/* Zeitstrahl der Bewilligungen */
.tl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tl-head, .tl-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); align-items: center; }
.tl-head { position: sticky; top: 0; background: var(--surface-2); border-bottom: 1px solid var(--border); z-index: 2; }
.tl-months { display: grid; }
.tl-months span { padding: 5px 4px; font-size: .72rem; color: var(--muted); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.tl-row { border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.tl-row:last-child { border-bottom: none; }
.tl-row:hover { background: var(--surface-2); }
.tl-row .label { padding: 5px var(--space-3); min-width: 0; }
.tl-row .label strong { display: block; font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-row .label .meta { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-lane { position: relative; height: 28px; }
.tl-grid { position: absolute; inset: 0; display: grid; }
.tl-grid i { border-left: 1px solid var(--border); }
.tl-bar { position: absolute; top: 5px; height: 18px; border-radius: 6px; background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.tl-bar .used { position: absolute; inset: 0 auto 0 0; background: var(--primary); opacity: .75; }
.tl-bar.warn .used { background: var(--warn); }
.tl-bar.over .used { background: var(--danger); }
.tl-bar .cap { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 6px; font-size: .7rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); opacity: .55; z-index: 3; pointer-events: none; }
.tl-soon { position: absolute; top: 0; bottom: 0; background: var(--warn); opacity: .07; border-left: 1px solid var(--warn); pointer-events: none; }

/* Startseite: wenig Zahlen, viel Luft */
.hero { padding: var(--space-6) var(--space-5) var(--space-5); margin-bottom: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.hero .day { font-size: .85rem; color: var(--muted); letter-spacing: .02em; }
.hero h1 { font-size: 1.9rem; font-weight: 700; margin: var(--space-2) 0 var(--space-3); }
.hero .lede { font-size: 1.05rem; color: var(--muted); max-width: 62ch; margin: 0; }
.hero .quick { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-5); }
.hero .quick a { display: flex; align-items: baseline; gap: var(--space-2); text-decoration: none; color: inherit; }
.hero .quick a:hover .qv { color: var(--primary); }
.hero .quick .qv { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero .quick .ql { font-size: .85rem; color: var(--muted); }

/* Printable timesheet (Anlage 1 A: Druck ohne Lohnzeile). On screen it is a sheet of paper on the
   page; on paper the shell, the navigation and every button disappear and only .print-sheet is
   left, black on white, so a photocopier and a phone camera both get something readable. */
.print-sheet { background: #fff; color: #111; padding: 18mm 14mm; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 210mm; margin: 0 auto; }
.print-sheet h2 { margin: 0 0 var(--space-1); }
.print-sheet .small { color: #444; }
.print-head { display: flex; justify-content: space-between; gap: var(--space-3); border-bottom: 1px solid #999; padding-bottom: var(--space-2); margin-bottom: var(--space-2); }
.print-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.print-table th, .print-table td { border-bottom: 1px solid #ddd; padding: 3px 6px; text-align: left; }
.print-table .num { text-align: right; }
.print-table tr.off td { color: #888; background: #f6f6f6; }
.print-signatures { display: flex; gap: var(--space-4); margin-top: 14mm; }
.print-signatures > div { flex: 1; }
.print-signatures .line { border-bottom: 1px solid #111; height: 10mm; }

@media print {
  .topbar, .sidenav, .banner, .no-print, .toast, .modal-backdrop { display: none !important; }
  body, .office, .office-body, .content { background: #fff !important; display: block !important; margin: 0; padding: 0; }
  .print-sheet { box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .print-table { font-size: 9pt; }
  .print-table tr { break-inside: avoid; }
  @page { size: A4 portrait; margin: 14mm; }
}

/* Sync pill of the companion app: says whether the phone is on its own and how much is waiting.
   Sits above the bottom navigation, out of the way of the thumbs. */
.syncpill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 72px; z-index: 40; padding: 6px 14px; border-radius: 999px;
  font-size: .82rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.syncpill.wait { background: var(--warn-bg, var(--surface-2)); }
.syncpill.off { border-color: var(--danger, #b3261e); }
.entry-row.waiting { opacity: .8; border-left: 3px solid var(--warn, #b26b00); padding-left: var(--space-2); }

/* Month grid of the companion app: the same cells as the week, seven across, with the weekday
   heads above. The empty cells at the start are the days of the previous month — they are there so
   the first of the month stands under the weekday it actually falls on. */
.day-grid.month { gap: 5px; }
.day-grid .wdhead { text-align: center; padding-bottom: 2px; font-weight: 600; }
.day-grid .day-cell.empty { border: none; background: transparent; min-height: 0; }
.day-grid .day-cell .wd { font-size: .7rem; color: var(--muted); }
.day-grid .day-cell.requested { border-style: dashed; }
.day-grid.month .day-cell { min-height: 54px; font-size: .74rem; }
.day-grid.month .day-cell .h { font-size: .9rem; }

/* Screen version of the companion app (P2 Schritt 13). Same views, more room: the bottom bar
   becomes a side bar out of the way of the content, the month grid gets cells you can read across
   a desk, and the sync pill moves with the content instead of sitting over the navigation.
   Everything below 900px stays exactly as it was on the phone. */
@media (min-width: 900px) {
  .companion { padding-bottom: 0; }
  /* width:auto, because the base rule sets width:100% — with a left margin that would push the
     content off the right edge instead of shrinking it (seen in the browser, 20.09.2026) */
  .companion .content { margin: 0 auto 0 var(--sidenav-w, 220px); width: auto; max-width: 940px; padding: var(--space-5) var(--space-5) var(--space-6); }
  .companion > .banner { margin-left: var(--sidenav-w, 220px); }
  .bottomnav { top: 0; right: auto; width: var(--sidenav-w, 220px); height: auto; grid-template-columns: 1fr; grid-auto-rows: max-content;
    align-content: start; border-top: none; border-right: 1px solid var(--border); padding: var(--space-4) var(--space-2); gap: 2px; }
  .bottomnav a { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 14px; border-radius: 10px; font-size: .95rem; }
  .bottomnav a.active { background: var(--surface-2); }
  .bottomnav a .ico { font-size: 1.1rem; }
  .syncpill { left: calc(var(--sidenav-w, 220px) + 50%); bottom: 24px; transform: translateX(-50%); }
  .day-grid .day-cell { min-height: 84px; padding: 8px 6px; }
  .day-grid.month .day-cell { min-height: 92px; }
  .day-grid .day-cell .h { font-size: 1.1rem; }
  .today-card .big { font-size: 2rem; }
  .chips.seg { margin-right: var(--space-3); }
}

/* Urlaubsanträge als Karten (21.09.2026): eine Karte je Antrag statt einer zwölfspaltigen Tabelle */
.requests { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.req { margin-bottom: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.req .card-head { margin-bottom: 0; align-items: flex-start; }
.req .card-head h2 { font-size: 1.1rem; }
.req-when { font-size: 1.05rem; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.req-type { font-weight: 600; }
.req-leave { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.req-leave .stat { padding: var(--space-2) var(--space-3); }
.req-leave .stat .value { font-size: 1.25rem; }
.req-leave .stat.danger .value { color: var(--danger, #b3261e); }
.req h3 { margin: 0; text-transform: uppercase; letter-spacing: .03em; font-size: .75rem; }
.req-conflicts { margin: 0; padding-left: 1.1rem; font-size: .9rem; }
.req-conflicts .k { font-weight: 600; }
.req-note { margin: 0; padding: var(--space-2) var(--space-3); background: var(--surface-2); border-radius: var(--radius); font-size: .95rem; }

/* Startseite als Dashboard (21.09.2026): Diagramme aus SVG und CSS, eine Farbe je Diagramm, Bewegung nur
   ohne prefers-reduced-motion. Vier Stufen eines Blaus für den Stand der Stundenzettel (Reihenfolge des
   Ablaufs), beschriftet; keine Farbe trägt allein eine Information. */
:root { --viz-1: #9fc3de; --viz-2: #5f95bd; --viz-3: #2f6f9d; --viz-4: #1f5f8b; --viz-soft: rgba(31, 95, 139, .14); --viz-grid: #d9dde3; --viz-over: #b3261e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --viz-1: #3a5f7d; --viz-2: #5a8fb5; --viz-3: #7fb4d9; --viz-4: #a9d1ec; --viz-soft: rgba(111, 177, 224, .16); --viz-grid: #313b49; --viz-over: #e66767; }
}
:root[data-theme="dark"] { --viz-1: #3a5f7d; --viz-2: #5a8fb5; --viz-3: #7fb4d9; --viz-4: #a9d1ec; --viz-soft: rgba(111, 177, 224, .16); --viz-grid: #313b49; --viz-over: #e66767; }
.dash-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-bottom: var(--space-4); }
.dash-grid .card { margin-bottom: 0; }
.dash-grid .card.wide { grid-column: 1 / -1; }
.viz .card-head h2 { font-size: 1.05rem; }
.viz-wrap { position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--viz-grid); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis-line { stroke: var(--viz-grid); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .value { fill: var(--text); font-size: 12px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .weekend { fill: var(--surface-2); }
.chart .area { fill: var(--viz-soft); }
.chart .line { fill: none; stroke: var(--viz-3); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .dot { fill: var(--surface); stroke: var(--viz-3); stroke-width: 2.5; pointer-events: none; }
.chart .col { fill: var(--viz-3); transition: fill 120ms; }
.chart .col.now { fill: var(--viz-4); }
.chart .col.lift { fill: var(--viz-2); }
.chart .hit { fill: transparent; }
.chart path.draw.drawn { transition: stroke-dashoffset 900ms cubic-bezier(.22, .61, .36, 1); stroke-dashoffset: 0 !important; }
.viz-tip { position: absolute; z-index: 5; background: var(--text); color: var(--bg); padding: var(--space-2) var(--space-3); border-radius: 8px; font-size: .85rem; pointer-events: none; box-shadow: var(--shadow); max-width: 170px; }
.viz-tip .v { font-size: 1rem; }
.viz-tip .l { opacity: .85; }
/* grow: bars start at zero width and take their width once the page is on screen */
.fill.grow { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--viz-3); transition: width 700ms cubic-bezier(.22, .61, .36, 1); }
.fill.grow.grown { width: var(--w); }
.fill.light { background: var(--viz-2); }
.fill.over { background: var(--viz-over); }
.chart .col.grow { transform: scaleY(0); transition: transform 700ms cubic-bezier(.22, .61, .36, 1); }
.chart .col.grow.grown { transform: none; }
.chart .area.grow { opacity: 0; transition: opacity 900ms ease; }
.chart .area.grow.grown { opacity: 1; }
.meters { display: grid; gap: var(--space-3); }
.meter-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; gap: var(--space-3); align-items: center; }
.meter-label { display: flex; flex-direction: column; }
.meter-label .k { font-weight: 600; }
.meter { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.meter-pct { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.5ch; text-align: right; }
.hbars { display: grid; gap: var(--space-2); }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: var(--space-3); align-items: center; font-size: .95rem; }
.hbar { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar-value { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; min-width: 5ch; text-align: right; }
.stack { display: flex; height: 28px; border-radius: 8px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.stack .seg { display: flex; align-items: center; justify-content: center; width: 0; transition: width 700ms cubic-bezier(.22, .61, .36, 1); color: #fff; font-size: .8rem; }
.stack .seg.grown { width: var(--w); }
.s1 { background: var(--viz-1); } .s2 { background: var(--viz-2); } .s3 { background: var(--viz-3); } .s4 { background: var(--viz-4); }
.stack .seg.s1 b, .stack .seg.s2 b { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stack .seg.s3 b, :root:not([data-theme="light"]) .stack .seg.s4 b { color: #141920; } }
:root[data-theme="dark"] .stack .seg.s3 b, :root[data-theme="dark"] .stack .seg.s4 b { color: #141920; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); font-size: .85rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tiles .stat { padding: var(--space-3); }
.tiles .value { font-variant-numeric: tabular-nums; }
.tiles .unit { font-size: 1rem; font-weight: 500; color: var(--muted); }
.locs { display: grid; gap: var(--space-3); }
.loc-row { display: grid; grid-template-columns: minmax(100px, 1fr) 2fr auto; gap: var(--space-3); align-items: center; }
.loc-row .k { font-weight: 600; }
.loc-bars { display: grid; gap: 4px; }
.hero .quick .qv.count { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .fill.grow, .stack .seg, .chart .col.grow, .chart .area.grow, .chart path.draw.drawn { transition: none; }
  .fill.grow { width: var(--w); } .stack .seg { width: var(--w); } .chart .col.grow { transform: none; } .chart .area.grow { opacity: 1; }
}
@media (max-width: 480px) { .meter-row, .hbar-row, .loc-row { grid-template-columns: 1fr; gap: var(--space-1); } .meter-pct, .hbar-value { text-align: left; } }

/* Mein Konto / Anzeige (21.09.2026) */
.choice { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.choice label { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 500; margin: 0; }
.choice input { width: auto; min-height: 0; margin: 0; }
.choice label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.topbar .who.link { cursor: pointer; text-decoration: underline dotted; }
