/* ==========================================================================
   KN AT Zeiterfassung – Stylesheet v8.2g
   Ein Token-System, ein Komponentensatz. Keine Seiten-Inline-Styles mehr.
   Nur heller Modus (Darkmode in v8.2g entfernt).
   Breakpoints: 860px (Navigation/Tablet), 480px (Telefon).
   Ausnahme: Monatskalender wechselt bei 960px auf Listenansicht (8 Spalten).
   ========================================================================== */

/* ── 1. Tokens ─────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Marke */
  --brand: #003b78;
  --brand-strong: #002a57;
  --brand-soft: #e7eef7;
  --brand-line: #b9cbe2;

  /* Flächen und Text */
  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --text: #152233;
  --text-2: #3c4b5d;
  --muted: #4f5e70;          /* 6,4:1 auf --surface-2 */
  --line: #d6dee8;
  --line-strong: #8592a3;    /* 3,2:1 – Eingabefeld-Rahmen (WCAG 1.4.11) */

  /* Semantik: Saldo */
  --pos: #0b6b2e;            /* 6,6:1 auf Weiß */
  --neg: #a3141a;            /* 7,4:1 auf Weiß */

  /* Meldungen */
  --ok-bg: #e9f6ee;   --ok-line: #9ccfae;   --ok-text: #0b4a22;
  --err-bg: #fdecec;  --err-line: #e2a3a3;  --err-text: #7a0c12;
  --warn-bg: #fff6d9; --warn-line: #e3c25a; --warn-text: #5a4300;
  --info-bg: #eef4fb; --info-line: #bcd0e8; --info-text: #0e3463;

  /* Stempel-Aktionen */
  --act-start: #0b6b3a;
  --act-end: #8f1d1d;
  --act-pause: #1d5aa0;      /* 6,5:1 mit Weiß */
  --act-pause-end-bg: #d6e6fa;
  --act-pause-end-text: #0a2a4f;

  /* Statuspalette (Hintergrund / Rand / Text) */
  --st-work-bg: #e7f0ff;       --st-work-line: #a9c5ee;       --st-work-text: #133a6b;
  --st-vacation-bg: #dff5c4;   --st-vacation-line: #93c95a;   --st-vacation-text: #2c4a0c;
  --st-sick-bg: #ffdcdc;       --st-sick-line: #e08c8c;       --st-sick-text: #6e1111;
  --st-flex-bg: #d4e5ff;       --st-flex-line: #84aee7;       --st-flex-text: #12396b;
  --st-seminar-bg: #e4dcff;    --st-seminar-line: #a99bea;    --st-seminar-text: #3a2580;
  --st-holiday-bg: #ffeaa6;    --st-holiday-line: #d9b02c;    --st-holiday-text: #5a4300;
  --st-alarm-bg: #ffdcb5;      --st-alarm-line: #e39a52;      --st-alarm-text: #6a3300;
  --st-free-bg: #eceff3;       --st-free-line: #c3ccd6;       --st-free-text: #3c4b5d;
  --st-hist-bg: #e3f3e7;       --st-hist-line: #87be93;       --st-hist-text: #1d4a28;
  --st-none-bg: #ffffff;       --st-none-line: #7d8a9a;       --st-none-text: #4f5e70;
  --st-weekend-bg: #e4e8ee;    --st-weekend-line: #c9d1db;    --st-weekend-text: #4f5e70;

  /* Fokus */
  --focus: #0b5cad;
  --focus-ring: 0 0 0 3px #ffffff, 0 0 0 5px var(--focus);

  /* Form */
  --radius-sm: 8px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(13, 32, 56, .05);
  --shadow-pop: 0 14px 40px rgba(13, 32, 56, .18);

  /* Abstände */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 28px;

  /* Typografie */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 16px; --fs-md: 18px;
  --fs-h1: clamp(22px, 2.2vw + 12px, 30px);
  --fs-h2: clamp(18px, 1vw + 13px, 22px);
  --fs-kpi: clamp(19px, 1.2vw + 12px, 24px);

  --tap: 44px;
}

/* ── 2. Basis ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/1.45 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); color: var(--text); text-wrap: balance; }
h1 { font-size: var(--fs-h1); letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-md); margin-top: var(--s5); }
p { margin: 0 0 var(--s3); }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
small { font-size: var(--fs-sm); color: var(--muted); }
code { background: var(--brand-soft); padding: 2px 5px; border-radius: 5px; font-size: .9em; word-break: break-all; }
ul { padding-left: 1.2em; }
li { margin: 4px 0; }
::selection { background: #c9dbf3; color: var(--text); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.topbar :focus-visible { outline-color: #ffffff; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s2); top: -60px; z-index: 2000;
  background: var(--surface); color: var(--brand); padding: 10px 14px;
  border-radius: var(--radius); font-weight: 700; box-shadow: var(--shadow-pop);
}
.skip-link:focus { top: var(--s2); }

.num, .kpi strong, td, .net, .times strong { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ── 3. Kopfleiste & Navigation ────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  background: var(--brand); color: #fff;
  padding: 12px max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  padding-top: max(12px, env(safe-area-inset-top));
}
.brand { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: #fff; line-height: 1.15; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sub { font-size: var(--fs-xs); font-weight: 700; color: #fff; letter-spacing: .01em; }
.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.main-nav a {
  color: #fff; text-decoration: none; font-weight: 700;
  padding: 10px 12px; border-radius: var(--radius-sm); min-height: var(--tap);
  display: inline-flex; align-items: center;
}
.main-nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.main-nav a.is-active { background: rgba(255, 255, 255, .18); box-shadow: inset 0 -3px 0 #fff; }
.nav-toggle {
  display: none; width: var(--tap); height: var(--tap);
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); color: #fff;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: var(--radius); cursor: pointer;
}

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding-left: 14px; padding-right: 14px; }
  .brand-logo { height: 26px; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 10px; right: 10px; margin-top: 4px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--brand); border: 1px solid rgba(255, 255, 255, .25);
    border-radius: var(--radius-lg); padding: var(--s2); box-shadow: var(--shadow-pop);
  }
  body.menu-open .main-nav { display: flex; }
  .main-nav a { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .14); border-radius: 0; }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a.is-active { border-radius: var(--radius-sm); box-shadow: none; }
}

/* ── 4. Layout ─────────────────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: var(--s4) var(--s4) var(--s6); }
.container.wide { max-width: 1280px; }
.container.narrow { max-width: 760px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: var(--s5); margin: var(--s4) 0; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.section-head h2 { margin: 0; }
.note { color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.version-badge { font-size: var(--fs-xs); color: var(--muted); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.run { color: var(--brand); }

@media (max-width: 860px) {
  .container { padding: var(--s3) 10px var(--s5); }
  .card { padding: var(--s4); margin: var(--s3) 0; }
}

/* ── 5. Buttons ────────────────────────────────────────────────────────── */
.btn, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 10px 16px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: var(--radius); font: 700 15px/1.2 var(--font);
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover, .button:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn.secondary, .button.secondary { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-line); }
.btn.secondary:hover, .button.secondary:hover { background: #d8e4f2; color: var(--brand-strong); }
.btn.danger { background: var(--act-end); border-color: var(--act-end); }
.btn.danger:hover { background: #701616; border-color: #701616; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--surface-2); color: #5f6c7c; border: 1px dashed var(--line-strong); cursor: not-allowed;
}
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-top: var(--s3); }
.btn-row:first-child { margin-top: 0; }

@media (pointer: coarse) { .btn-sm { min-height: 40px; } }
@media (max-width: 860px) {
  .btn-row { display: grid; grid-template-columns: 1fr 1fr; }
  .btn-row > .btn, .btn-row > form, .btn-row > .segmented { width: 100%; }
}
@media (max-width: 480px) { .btn-row { grid-template-columns: 1fr; } }

/* ── 6. Formulare ──────────────────────────────────────────────────────── */
label, .label { display: block; font-weight: 700; font-size: 14px; color: var(--text); margin: 0 0 6px; }
.label-hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 400 16px/1.3 var(--font);
}
input::placeholder, textarea::placeholder { color: #5f6c7c; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[readonly] { background: var(--surface-2); color: var(--text-2); }
input:disabled, select:disabled { background: var(--surface-2); color: #5f6c7c; cursor: not-allowed; }
input[type="radio"], input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field.is-disabled label { color: var(--muted); }
.field.span-all { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin-bottom: var(--s3); }
.form-grid .span-3 { grid-column: span 3; }
.form-stack .field { margin-bottom: var(--s3); }
.form-actions { margin-top: var(--s4); display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-3 { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .btn { width: 100%; }
}

/* ── 7. Meldungen ──────────────────────────────────────────────────────── */
.msg, .ok, .err, .warn, .info {
  padding: var(--s3) 14px; border-radius: var(--radius); border: 1px solid; margin: 0 0 var(--s3);
}
.msg, .ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.err, .fail { background: var(--err-bg); border-color: var(--err-line); color: var(--err-text); }
.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.info { background: var(--info-bg); border-color: var(--info-line); color: var(--info-text); }
.fail { padding: var(--s3) 14px; border-radius: var(--radius); border: 1px solid var(--err-line); margin: 0 0 var(--s3); }
.msg ul, .err ul, .warn ul, .info ul { margin: 6px 0 0; }
.badge-locked { display: inline-block; font-size: var(--fs-sm); font-weight: 700; color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }

/* ── 8. Kennzahlen ─────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); min-width: 0;
  display: flex; flex-direction: column; justify-content: space-between; gap: 4px;
}
.kpi small { display: block; color: var(--muted); font-size: var(--fs-sm); line-height: 1.2; }
.kpi strong { display: block; font-size: var(--fs-kpi); line-height: 1.1; font-weight: 800; overflow-wrap: anywhere; }
.kpi strong.status-value { font-size: clamp(16px, 1vw + 11px, 21px); }
.kpi .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pos); margin-left: 6px; vertical-align: middle; }

@media (max-width: 860px) { .kpis { grid-template-columns: 1fr 1fr; } }

/* ── 9. Tabellen ───────────────────────────────────────────────────────── */
.tablewrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); font-weight: 700; }
tbody tr:hover td, tbody tr:hover th { background: #f9fbfd; }
tbody th { background: transparent; color: var(--text); font-size: inherit; font-weight: 400; }
tbody th strong { font-weight: 700; }

/* ── 10. Status ────────────────────────────────────────────────────────── */
.status-pill {
  display: inline-block; border-radius: 999px; padding: 3px 10px;
  font-size: var(--fs-xs); font-weight: 700; border: 1px solid var(--st-none-line);
  background: var(--st-none-bg); color: var(--st-none-text);
}
/* Kalenderkaestchen: Basis vor der Statuspalette, damit Status-Farben greifen */
.day-box {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  text-decoration: none; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums;
}
.st-weekend, .weekend { background: var(--st-weekend-bg); border-color: var(--st-weekend-line); color: var(--st-weekend-text); }
.st-work, .status-work { background: var(--st-work-bg); border-color: var(--st-work-line); color: var(--st-work-text); }
.st-vacation, .status-vacation { background: var(--st-vacation-bg); border-color: var(--st-vacation-line); color: var(--st-vacation-text); }
.st-sick, .status-sick { background: var(--st-sick-bg); border-color: var(--st-sick-line); color: var(--st-sick-text); }
.st-flex, .status-flex_day, .status-overtime_reduction { background: var(--st-flex-bg); border-color: var(--st-flex-line); color: var(--st-flex-text); }
.st-seminar, .status-seminar, .status-business_trip { background: var(--st-seminar-bg); border-color: var(--st-seminar-line); color: var(--st-seminar-text); }
.st-holiday, .status-holiday { background: var(--st-holiday-bg); border-color: var(--st-holiday-line); color: var(--st-holiday-text); }
.st-alarm, .status-alarm_callout { background: var(--st-alarm-bg); border-color: var(--st-alarm-line); color: var(--st-alarm-text); }
.st-free, .status-free { background: var(--st-free-bg); border-color: var(--st-free-line); color: var(--st-free-text); }
.st-hist, .status-historical_fulfilled { background: var(--st-hist-bg); border-color: var(--st-hist-line); color: var(--st-hist-text); }
.st-none, .status-not_started { background: var(--st-none-bg); border-color: var(--st-none-line); border-style: dashed; color: var(--st-none-text); }
.weekend.status-not_started, .weekend.st-none, .weekend.status-free { background: var(--st-weekend-bg); border-color: var(--st-weekend-line); border-style: solid; color: var(--st-weekend-text); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 var(--s4); font-size: var(--fs-sm); color: var(--text-2); padding: 0; list-style: none; }
.legend li, .legend span { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid; display: inline-block; flex-shrink: 0; }

/* ── 11. Akkordeon ─────────────────────────────────────────────────────── */
.accordion-card { padding: 0; overflow: hidden; }
.accordion-card > h2 { margin: 0; font-size: inherit; }
.accordion-toggle {
  width: 100%; min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5); background: var(--surface); color: var(--text);
  border: 0; text-align: left; cursor: pointer; font: 800 17px/1.25 var(--font);
}
.accordion-toggle:hover { background: var(--surface-2); }
.accordion-toggle[aria-expanded="true"] { background: var(--surface-2); border-bottom: 1px solid var(--line); }
.accordion-toggle .chev { width: 18px; height: 18px; flex-shrink: 0; transition: transform .2s ease; color: var(--muted); }
.accordion-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.accordion-content { padding: var(--s5); }
.accordion-content > :last-child { margin-bottom: 0; }
@media (max-width: 860px) { .accordion-toggle { padding: 14px var(--s4); } .accordion-content { padding: var(--s4); } }

/* ── 12. Startseite: Stempeln ──────────────────────────────────────────── */
.stamp-card h1 { margin-bottom: 6px; }
.mode-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); margin: var(--s3) 0; border: 0; padding: 0; }
.mode-row legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; padding: 0; }
.mode-option {
  display: flex; align-items: center; gap: 10px; min-height: var(--tap); margin: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 12px; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.2;
}
.mode-option:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.mode-option:has(input:disabled) { color: #5f6c7c; cursor: not-allowed; background: var(--surface); border-style: dashed; }
.mode-option:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.stamp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: var(--s3); }
.stamp-grid .btn { min-height: 56px; font-size: 16px; }
.btn.start { background: var(--act-start); border-color: var(--act-start); }
.btn.start:hover { background: #08552e; }
.btn.end { background: var(--act-end); border-color: var(--act-end); }
.btn.end:hover { background: #701616; }
.btn.pause-start { background: var(--act-pause); border-color: var(--act-pause); }
.btn.pause-start:hover { background: #174a85; }
.btn.pause-end { background: var(--act-pause-end-bg); border-color: #9fc0ea; color: var(--act-pause-end-text); }
.btn.pause-end:hover { background: #c3d9f6; color: var(--act-pause-end-text); }
.stamp-grid .btn:disabled { background: var(--surface-2); color: #5f6c7c; border: 1px dashed var(--line-strong); }
.stamp-state { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: var(--s3) 0 0; font-size: 14px; color: var(--text-2); }
.stamp-state strong { color: var(--text); }
.stamp-reason { font-size: 14px; color: var(--text-2); margin: var(--s2) 0 0; }

@media (max-width: 860px) {
  .mode-row, .stamp-grid { grid-template-columns: 1fr 1fr; }
}

/* Mehrfachbuchung */
.mb-preview { background: var(--info-bg); border: 1px solid var(--info-line); color: var(--info-text); border-radius: var(--radius); padding: 10px 12px; margin: 0 0 var(--s3); font-size: 14px; }

/* ── 13. Woche ─────────────────────────────────────────────────────────── */
.day-cards { display: none; }
.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px; margin: 10px 0; }
.day-card h3 { margin: 0 0 var(--s2); }
.day-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) 10px; }
.box small { display: block; }
.blocks { display: inline-block; font-size: var(--fs-xs); color: var(--st-alarm-text); background: #fff1de; border-radius: 6px; padding: 2px 6px; margin-top: 3px; line-height: 1.3; }
@media (max-width: 860px) {
  .desktop-table { display: none; }
  .day-cards { display: block; }
}

/* ── 14. Monat ─────────────────────────────────────────────────────────── */
.segmented { display: inline-flex; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--radius); padding: 3px; gap: 3px; margin-left: auto; }
.segmented a { min-height: 38px; padding: 8px 14px; border-radius: var(--radius-sm); text-decoration: none; color: var(--brand); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.segmented a[aria-current="true"] { background: var(--brand); color: #fff; }
.month-grid { display: grid; grid-template-columns: 54px repeat(7, minmax(0, 1fr)); gap: 6px; }
.head-cell { font-weight: 800; color: var(--brand); text-align: center; padding: 8px 4px; font-size: 14px; }
.kw-cell { background: var(--brand-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 4px; font-weight: 800; color: var(--brand); text-align: center; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.week-sum { display: block; font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; margin-top: 4px; }
.day-cell {
  min-height: 116px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.detail-view .day-cell { min-height: 154px; }
a.day-cell:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0, 59, 120, .12); color: var(--text); }
.day-cell.outside { background: transparent; border-style: dashed; }
.day-cell.weekend { background: #f4f6f9; color: var(--text); }
.day-cell.status-vacation { background: #f2fbe8; }
.day-cell.status-sick { background: #fff3f3; }
.day-cell.status-overtime_reduction, .day-cell.status-flex_day { background: #eef5ff; }
.day-cell.status-holiday { background: #fff9e0; }
.day-cell.status-alarm_callout { background: #fff3e6; }
.day-cell.status-not_started { border-style: solid; border-color: var(--line); }
.date-line { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; color: var(--text-2); }
.day-num { font-size: 18px; color: var(--text); }
.day-cell .status-pill { align-self: flex-start; font-size: 11px; padding: 2px 7px; }
.times { font-size: 13px; line-height: 1.3; color: var(--text-2); }
.net { margin-top: auto; font-size: 18px; font-weight: 800; color: var(--brand); }
.detail-lines { font-size: var(--fs-xs); line-height: 1.35; color: var(--text-2); background: rgba(255, 255, 255, .7); border-radius: 6px; padding: 4px 5px; }
.meta { font-size: var(--fs-xs); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue { font-size: var(--fs-xs); color: var(--neg); font-weight: 800; }
.mobile-list { display: none; }
.mobile-list h3 { font-size: 15px; color: var(--brand); margin: var(--s4) 0 var(--s2); }
.mobile-day { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); margin: var(--s2) 0; text-decoration: none; color: var(--text); }
.mobile-day:hover { border-color: var(--brand); color: var(--text); }
.mobile-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.mobile-day .sub { font-size: 14px; color: var(--text-2); }
@media (max-width: 960px) {
  .month-grid { display: none; }
  .mobile-list { display: block; }
  .segmented { margin-left: 0; }
}

/* ── 15. Jahresblatt ───────────────────────────────────────────────────── */
.year-head { position: relative; }
.year-print-logo { position: absolute; top: var(--s5); right: var(--s5); background: var(--brand); padding: 9px 14px; border-radius: var(--radius); display: inline-flex; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.year-print-logo img { height: 30px; width: auto; display: block; }
.calendar-row { display: grid; grid-template-columns: 110px 1fr; gap: var(--s2); align-items: center; margin: 7px 0; }
.month-label { font-weight: 800; color: var(--brand); }
.days { display: flex; flex-wrap: wrap; gap: 4px; }
.day-box.weekend { border-style: solid; }
.day-box:hover { outline: 2px solid var(--brand); outline-offset: 1px; color: var(--text); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  font: 700 13px/1.2 var(--font); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip[aria-pressed="true"]::before { content: ""; display: inline-block; width: 6px; height: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 8px 2px 0; }
#monthTable th, #monthTable td { white-space: nowrap; font-size: 14px; }
#monthTable td:last-child { padding-top: 4px; padding-bottom: 4px; }

@media (max-width: 860px) {
  .calendar-row { grid-template-columns: 1fr; gap: 4px; margin: 10px 0; }
  .year-print-logo { position: static; margin-bottom: var(--s3); }
}
@media (pointer: coarse) {
  .day-box { width: 38px; height: 38px; font-size: 13px; border-radius: 8px; }
  .chip { min-height: 44px; }
}

/* ── 16. Einstellungen / Prüfseiten ───────────────────────────────────── */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); padding: 0; list-style: none; margin: 0; }
.check-item { display: flex; align-items: center; gap: var(--s2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; margin: 0; }
.check-item .icon { align-self: flex-start; margin-top: 2px; }
.cc-list { grid-template-columns: 1fr; }
.check-item.is-fail { background: var(--err-bg); border-color: var(--err-line); color: var(--err-text); }
.check-summary { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 700; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-ok { color: var(--pos); }
.icon-fail { color: var(--neg); }
.verdict { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; }

/* ── 17. Login & Passwortseiten ────────────────────────────────────────── */
body.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 22px; padding-top: max(22px, env(safe-area-inset-top));
  background: linear-gradient(180deg, var(--brand) 0, var(--brand) 220px, var(--bg) 220px);
}
.login-shell {
  width: 100%; max-width: 920px; display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 24px 70px rgba(13, 32, 56, .16); overflow: hidden;
}
.brand-panel {
  background: linear-gradient(150deg, var(--brand) 0%, #06325f 65%, #08284d 100%);
  color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; min-height: 500px;
}
.login-logo { width: min(340px, 100%); height: auto; display: block; margin: 0 0 26px; }
.brand-panel p { color: #dce9f8; font-size: 16px; line-height: 1.5; max-width: 360px; }
.brand-panel .credit { font-size: 14px; color: #c3d6ec; margin: 0; }
.form-panel { padding: 42px 38px; display: flex; align-items: center; }
.form-box { width: 100%; }
.form-box h1 { font-size: 27px; margin-bottom: 8px; }
.form-box .sub { color: var(--muted); margin: 0 0 24px; }
.form-box label { margin-top: 14px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 112px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 36px; padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--brand-line); background: var(--brand-soft); color: var(--brand);
  font: 700 13px/1.2 var(--font); cursor: pointer;
}
.form-box .btn[type="submit"] { width: 100%; min-height: 52px; font-size: 17px; margin-top: 22px; }
.auth-links { margin-top: 18px; font-size: 15px; }
.auth-links a { font-weight: 700; }
.foot { font-size: var(--fs-sm); color: var(--muted); margin-top: 26px; line-height: 1.4; max-width: 340px; }
.app-version { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }
.auth-box { width: 100%; max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: 0 20px 60px rgba(13, 32, 56, .12); }
.auth-box h1 { font-size: 26px; }
.auth-box .btn[type="submit"] { width: 100%; min-height: 50px; margin-top: 8px; }
.auth-box .field { margin-bottom: 14px; }

@media (max-width: 860px) {
  body.auth { padding: 0; align-items: stretch; background: var(--surface); }
  .login-shell { grid-template-columns: 1fr; border-radius: 0; border: 0; box-shadow: none; min-height: 100vh; }
  .brand-panel { min-height: auto; padding: max(24px, env(safe-area-inset-top)) 20px 24px; }
  .brand-panel p { font-size: 14px; }
  .login-logo { width: min(240px, 80%); margin-bottom: 14px; }
  .form-panel { padding: 24px 20px; align-items: flex-start; }
  .auth-box { border-radius: 0; border: 0; box-shadow: none; min-height: 100vh; }
}

/* ── 18. iOS-Installationshinweis ──────────────────────────────────────── */
.install-hint {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(520px, calc(100vw - 28px)); z-index: 1500;
  background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-pop);
}
.install-hint strong { display: block; font-size: 15px; margin-bottom: 4px; }
.install-hint p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.4; }
.install-hint-actions { display: flex; gap: var(--s2); margin-top: 10px; }

/* ── 19. Diagnose-/Testseiten ──────────────────────────────────────────── */
.diag table { font-size: 14px; }
.tag { display: inline-block; font-size: var(--fs-xs); font-weight: 700; border-radius: 999px; padding: 2px 8px; border: 1px solid; }
.tag-open { background: var(--err-bg); border-color: var(--err-line); color: var(--err-text); }
.tag-run { background: var(--info-bg); border-color: var(--info-line); color: var(--info-text); }
.tag-fix { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }

/* ── 20. Druck ─────────────────────────────────────────────────────────── */
.print-only { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm 10mm; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .topbar, .skip-link, .btn-row, .btn, button, .install-hint, .no-print, .chip-row, .segmented, .mobile-list, .day-cards { display: none !important; }
  .print-only { display: block; }
  .container { max-width: none; padding: 0; margin: 0; }
  .card { box-shadow: none; border: 0; border-radius: 0; padding: 0; margin: 0 0 12px; }
  .desktop-table, .month-grid { display: grid !important; }
  .desktop-table { display: block !important; }
  .kpis { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; }
  .kpi { padding: 6px; border-color: #bbb; background: #fff; }
  .kpi strong { font-size: 13pt; }
  table { font-size: 9pt; }
  th, td { padding: 3px 5px; border: 1px solid #aaa; }
  th { background: #eee !important; }
  tr { page-break-inside: avoid; }
  .pos, .neg { color: #000; }
  .neg { font-weight: 800; }
  .status-pill, .day-box, .swatch, .day-cell, .year-print-logo { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  [data-col][hidden] { display: table-cell !important; }
  .print-hide { display: none !important; }
  .day-cell { min-height: auto; }
  /* Jahresblatt: Seitenaufteilung */
  .print-page-2 { break-before: page; break-after: page; }
  .print-page-3 { break-before: page; }
  .print-no-break { break-inside: avoid; }
  .calendar-row { grid-template-columns: 80px 1fr; gap: 4px; margin: 3px 0; break-inside: avoid; }
  .days { flex-wrap: nowrap; gap: 2px; }
  .day-box { width: 20px !important; height: 20px !important; font-size: 7pt !important; border-radius: 3px !important; }
  .year-print-logo { position: absolute; top: 0; right: 0; }
}
