/* ============================== Design-Tokens ============================== */
:root {
  color-scheme: light;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --surface-3: #e6e9f1;
  --border: #e3e6ee;
  --border-strong: #cdd3df;
  --grid-line: #eceef4;
  --text: #121624;
  --muted: #5f6b7f;
  --faint: #98a2b3;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #3730a3;
  --on-accent: #ffffff;
  --violet: #7c3aed;
  --violet-soft: #f3edff;

  --success: #0f8a5f;
  --success-soft: #e5f6ee;
  --warning: #b45309;
  --warning-soft: #fff4e2;
  --danger: #d92d20;
  --danger-soft: #fdecea;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 10px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 50px rgba(16, 24, 40, .22);
  --topbar: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d0f15;
    --surface: #151821;
    --surface-2: #1c202b;
    --surface-3: #252a37;
    --border: #262b38;
    --border-strong: #3a4152;
    --grid-line: #1f232e;
    --text: #e8ebf2;
    --muted: #9aa4b6;
    --faint: #687185;

    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, .14);
    --accent-text: #c7d2fe;
    --on-accent: #0b0d14;
    --violet: #a78bfa;
    --violet-soft: rgba(167, 139, 250, .14);

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, .12);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .13);

    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

/* ============================== Basis ============================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { flex: 1; }

.icon { display: inline-flex; width: 18px; height: 18px; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* ============================== Laden ============================== */
.boot, .loading { display: grid; place-items: center; min-height: 40vh; }
.boot { min-height: 100vh; }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================== Kopfzeile & Navigation ============================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1180px; height: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.brand-logo .icon { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text span { font-size: 12px; color: var(--muted); }

.nav { display: flex; gap: 2px; margin: 0 auto; }
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }

.menu { position: relative; flex: none; }
.menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
}
.menu summary::-webkit-details-marker { display: none; }
.menu-name { font-weight: 600; font-size: 14px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: flex; flex-direction: column;
}
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-who span { font-size: 12px; color: var(--muted); }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); text-decoration: none; font-size: 14px;
}
.menu-item:hover { background: var(--surface-2); }

@media (max-width: 820px) {
  /* backdrop-filter würde position:fixed der Navigation an die Kopfzeile binden */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 45;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }
  .nav-link { flex: 1; flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 11px; font-weight: 600; text-align: center; }
  .nav-link .icon { width: 22px; height: 22px; }
  .nav-link.active { background: none; color: var(--accent); }
  .topbar-inner { justify-content: space-between; }
  .menu-name { display: none; }
  .menu summary { padding: 3px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ============================== Layout ============================== */
.container { max-width: 1180px; margin: 0 auto; padding: 28px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.narrow { max-width: 440px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .lead { margin-top: 6px; }
.lead { color: var(--muted); font-size: 15px; max-width: 62ch; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: 4px; text-transform: none; }
.section-title { font-size: 18px; margin-top: 8px; }
.section-title .muted { font-weight: 500; font-size: 14px; letter-spacing: 0; }

.grid-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); align-items: start; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; }
.card-icon {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.card-icon .icon { width: 17px; height: 17px; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; text-decoration: none; align-self: flex-start; }
.card-link .icon { width: 16px; height: 16px; transition: transform .15s; }
.card-link:hover .icon { transform: translateX(2px); }
.empty { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* ============================== Buttons & Formulare ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-inner { display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-link { background: none; color: var(--muted); height: auto; padding: 6px; }
.btn-link:hover { color: var(--text); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.card .btn-sm { align-self: flex-start; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); flex: none;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.sm .icon { width: 14px; height: 14px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); }
.input {
  height: 42px; padding: 0 12px; border-radius: 10px; width: 100%;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { padding-right: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.form-error {
  background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; font-size: 14px; font-weight: 500;
}

/* ============================== Chips, Personen, Avatare ============================== */
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; flex: none;
}
.chip .icon { width: 13px; height: 13px; }
.chip-xs { height: 20px; padding: 0 7px; font-size: 11px; }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-warn { background: var(--warning-soft); color: var(--warning); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-live { background: var(--danger-soft); color: var(--danger); }
.chip-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.person { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; min-width: 0; }
.person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: color-mix(in srgb, var(--c) 75%, var(--text));
  font-weight: 700; font-size: 14px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }

/* ============================== Banner ============================== */
.banner {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.banner-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.banner-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.banner-body p { color: var(--muted); font-size: 14px; }
.banner-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 8px; justify-content: space-between; }
.banner-accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.banner-accent .banner-icon { background: var(--accent); color: var(--on-accent); }
.banner-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.banner-success .banner-icon { background: var(--success); color: #fff; }
.banner-warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.banner-warn .banner-icon { background: var(--warning); color: #fff; }

.mieter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mchip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600;
}
.mchip .icon { width: 14px; height: 14px; color: var(--success); }
.mchip-wait { color: var(--faint); }
.mchip:not(.ready) { color: var(--muted); }

/* ============================== Listen ============================== */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 96px; }
.list-row .day { min-width: 92px; color: var(--muted); font-weight: 500; }
.list-row.is-past { opacity: .5; }
.list-row.is-current .time { color: var(--danger); }

/* ============================== Übersicht ============================== */
.putz-mine { display: flex; flex-direction: column; gap: 10px; }
.putz-mine-head { display: flex; align-items: center; gap: 10px; }
.putz-mine-head strong { flex: 1; font-size: 16px; }
.area-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--area) 16%, var(--surface)); color: color-mix(in srgb, var(--area) 80%, var(--text));
}
.tasks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.tasks li { display: flex; gap: 8px; }
.tasks li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--area, var(--accent)); margin-top: 8px; flex: none; opacity: .8; }

.week-status-list { display: flex; flex-direction: column; gap: 14px; }
.ws { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.ws:last-child { border-bottom: 0; padding-bottom: 0; }
.ws-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.ws-line .icon { width: 16px; height: 16px; }
.ws-line > span:not(.icon) { flex: 1 1 160px; min-width: 0; }
.ws-line.ok { color: var(--success); font-weight: 600; }
.ws-line .btn { margin-left: auto; }

.kasse-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; display: block; }
.big.success { color: var(--success); }
.big.danger { color: var(--danger); }
.big.warn { color: var(--warning); }

.swap-card { gap: 10px; }
.swap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.swap { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.swap-text { display: flex; flex-direction: column; gap: 8px; }
.swap-detail { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.swap-actions { display: flex; gap: 8px; }
.swap-give { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }

/* ============================== Badzeiten ============================== */
.week-nav { display: flex; align-items: center; gap: 8px; }
.week-nav-label { display: flex; flex-direction: column; align-items: center; min-width: 170px; line-height: 1.25; }
.week-nav-label strong { font-size: 16px; }
.week-nav-label span { font-size: 13px; color: var(--muted); }

.grid-card { padding: 0; gap: 0; }
.grid-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item .muted { font-weight: 400; }

.slot-grid {
  display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr));
  padding: 0 10px 12px 0;
}
.corner, .day-head {
  position: sticky; top: var(--topbar); z-index: 6; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.day-head { display: flex; flex-direction: column; align-items: center; padding: 10px 2px 8px; line-height: 1.2; }
.day-head .wd { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day-head .dd { font-size: 15px; font-weight: 700; }
.day-head.today .dd {
  background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 1px 8px;
}
.time-cell {
  font-size: 11.5px; color: var(--muted); text-align: right; padding-right: 10px;
  height: 32px; display: flex; align-items: center; justify-content: flex-end; font-variant-numeric: tabular-nums;
}
.time-cell.full { font-weight: 600; color: var(--text); }
.time-cell.half { color: var(--faint); }
.cell { position: relative; height: 32px; border-top: 1px solid var(--grid-line); border-left: 1px solid var(--grid-line); }
.cell.half { border-top-style: dashed; }
.cell.today { background: color-mix(in srgb, var(--accent) 3.5%, transparent); }

.slot {
  position: absolute; top: 2px; bottom: 2px; left: 3px; right: 3px;
  border: 0; border-radius: 7px; background: transparent; cursor: pointer; padding: 0;
  font-size: 12px; text-align: left; color: var(--text);
}
.slot.free:not(:disabled) { border: 1px dashed transparent; }
.slot.free:not(:disabled):hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.slot.free:disabled { cursor: default; }
.slot.free.past { background: repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, var(--surface-3) 45%, transparent) 5px 6px); left: 0; right: 0; top: 0; bottom: 0; border-radius: 0; }
.free-label {
  display: none; align-items: center; gap: 4px; justify-content: center; height: 100%;
  color: var(--accent-text); font-weight: 600; font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.free-label .icon { width: 13px; height: 13px; }
.slot.free:not(:disabled):hover .free-label { display: flex; }

.slot.booked {
  background: color-mix(in srgb, var(--c) 22%, var(--surface));
  border-left: 3px solid var(--c);
  z-index: 1;
}
.slot.booked:hover { background: color-mix(in srgb, var(--c) 30%, var(--surface)); }
.slot.booked:not(.bs) { top: -1px; border-top-left-radius: 0; border-top-right-radius: 0; }
.slot.booked:not(.be) { bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.slot.booked.mine { background: color-mix(in srgb, var(--c) 34%, var(--surface)); border-right: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); }
.slot.booked.mine.bs { border-top: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); }
.slot.booked.mine.be { border-bottom: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); }
.slot.booked.past { opacity: .55; }
.slot.pending { opacity: .5; pointer-events: none; }
.slot-label {
  position: absolute; top: 4px; left: 7px; right: 4px; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; line-height: 1.2; overflow: hidden;
}
.slot-label strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-label span { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slot.booked.bs.be .slot-label span { display: none; }
.fine-badge {
  position: absolute; right: 3px; bottom: 3px; z-index: 3; font-size: 10px; font-weight: 700;
  background: var(--danger); color: #fff; border-radius: 999px; padding: 0 5px; line-height: 15px;
}
.now-line { position: absolute; left: -1px; right: 0; top: var(--p); height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

.day-tabs { display: none; }
.foot-note { text-align: center; }

@media (max-width: 820px) {
  .page-head .week-nav { width: 100%; justify-content: space-between; }
  .hint-desktop { display: none; }
  .grid-toolbar { padding: 12px 14px; }
  .day-tabs {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px 10px;
    position: sticky; top: var(--topbar); z-index: 7; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .day-tab {
    position: relative; border: 0; background: none; border-radius: 12px; padding: 6px 0; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; line-height: 1.2;
  }
  .day-tab .wd { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
  .day-tab .dd { font-size: 17px; font-weight: 700; }
  .day-tab.today .dd { color: var(--accent); }
  .day-tab.active { background: var(--accent); }
  .day-tab.active .wd, .day-tab.active .dd { color: var(--on-accent); }
  .day-tab .cnt { position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
  .day-tab.active .cnt { background: var(--on-accent); }

  .slot-grid { grid-template-columns: 52px 1fr; padding: 4px 10px 12px 0; }
  .corner, .day-head { display: none; }
  .cell:not(.sel) { display: none; }
  .cell, .time-cell { height: 40px; }
  .cell.today { background: none; }
  .slot.free:not(:disabled) { border-color: var(--border); }
  .slot.free:not(:disabled) .free-label { display: flex; color: var(--faint); font-weight: 500; }
  .slot.free:not(:disabled):hover .free-label { color: var(--accent-text); }
  .slot-label { flex-direction: row; gap: 8px; align-items: baseline; top: 50%; transform: translateY(-50%); }
  .slot.booked:not(.be) .slot-label { top: 20px; }
  .slot-label strong { font-size: 14px; }
  .slot-label span { font-size: 12.5px; }
  .slot.booked.bs.be .slot-label span { display: inline; }
  .fine-badge { top: 50%; bottom: auto; transform: translateY(-50%); right: 8px; font-size: 11px; line-height: 18px; padding: 0 7px; }
}

/* ============================== Putzplan ============================== */
.area-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.area-card { border-top: 4px solid var(--area); }
.area-card.mine { box-shadow: 0 0 0 2px color-mix(in srgb, var(--area) 45%, transparent), var(--shadow); }
.area-top { display: flex; align-items: flex-start; gap: 12px; }
.area-title { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.area-title .person { font-size: 14px; color: var(--muted); }
.area-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
.plan { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.plan th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.th-area { display: inline-flex; align-items: center; gap: 6px; }
.th-area::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--area); }
.plan td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.plan tr:last-child td { border-bottom: 0; }
.plan td.wk { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; white-space: nowrap; }
.plan tr.current td { background: var(--accent-soft); }
.plan tr.past td { opacity: .6; }
.plan td.mine .person > span:last-child { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.pcell { display: flex; align-items: center; gap: 8px; }
.tick { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--success); color: #fff; flex: none; }
.tick .icon { width: 12px; height: 12px; }

.rules { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.rules li::marker { color: var(--accent); }

/* ============================== Kasse ============================== */
.stats { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { gap: 4px; }
.kasse-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.entries { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.entry { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.entry:last-child { border-bottom: 0; }
.entry.paid { opacity: .7; }
.entry-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entry-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.amount { font-variant-numeric: tabular-nums; }

@media (max-width: 820px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .kasse-layout { grid-template-columns: 1fr; }
  .entry { flex-wrap: wrap; }
  .entry-side { width: 100%; justify-content: flex-start; padding-left: 44px; }
}

/* ============================== Verwaltung ============================== */
.admin-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: 0; }
.user-row.inactive { opacity: .55; }
.user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.user-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.user-actions { display: flex; gap: 6px; }
@media (max-width: 820px) { .admin-layout { grid-template-columns: 1fr; } }

.pw-box { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.pw-box > div { display: flex; flex-direction: column; gap: 2px; }
.pw-code, .pw-user { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: .04em; user-select: all; }
.pw-user { font-size: 16px; }

/* ============================== Login ============================== */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, #6366f1 18%, transparent), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #ec4899 12%, transparent), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow-lg);
}
.narrow .auth-card { box-shadow: var(--shadow); }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .lead { text-align: center; margin: -8px auto 4px; font-size: 14px; }
.auth-logo {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; box-shadow: 0 10px 24px rgba(99, 102, 241, .4);
}
.auth-logo .icon { width: 28px; height: 28px; }

/* ============================== Dialog ============================== */
.dialog {
  border: 0; padding: 0; border-radius: 20px; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.dialog.wide { width: min(640px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(10, 12, 20, .45); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.dialog-inner { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-head h2 { font-size: 18px; }
.dialog-head .icon-btn { border: 0; }
.dialog-body { display: flex; flex-direction: column; gap: 14px; font-size: 15px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-person { display: flex; align-items: center; gap: 12px; }
.dialog .banner { padding: 12px 14px; }
@media (max-width: 520px) {
  .dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dialog-actions .btn { flex: 1; }
}

/* ============================== Toasts ============================== */
.toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: #1c2030; color: #fff; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: pop .18s ease-out; transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-success .icon { color: #34d399; }
.toast-error .icon { color: #f87171; }
.toast-info .icon { color: #a5b4fc; }
.toast-action { border: 0; background: rgba(255, 255, 255, .14); color: #fff; border-radius: 8px; padding: 4px 10px; font-weight: 600; cursor: pointer; }
.toast-action:hover { background: rgba(255, 255, 255, .24); }
@media (prefers-color-scheme: dark) { .toast { background: #2a2f40; } }
@media (max-width: 820px) { .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); } }

@media (max-width: 520px) {
  h1 { font-size: 24px; }
  .card { padding: 16px; }
  .container { padding-top: 20px; gap: 16px; }
  .list-row .time { min-width: 88px; }
}

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

/* ============================== Badplan: Mehrfachauswahl, Abwesenheit ============================== */
.toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hint-mobile { display: none; padding: 8px 14px 0; }
.slot { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.slot.free.selecting {
  background: var(--accent-soft) !important;
  border: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent) !important;
  border-radius: 0; top: 0; bottom: -1px; z-index: 2;
}
.slot.free.selecting .free-label { display: flex !important; color: var(--accent-text); }
.slot.free.selecting:not(.sel-first) { border-top-width: 0 !important; }
.slot.free.selecting:not(.sel-last) { border-bottom-width: 0 !important; }
.slot.free.selecting.sel-first { border-top-left-radius: 7px; border-top-right-radius: 7px; top: 2px; }
.slot.free.selecting.sel-last { border-bottom-left-radius: 7px; border-bottom-right-radius: 7px; bottom: 2px; }
.sel-tip {
  position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; white-space: nowrap;
  padding: 3px 8px; border-radius: 6px; pointer-events: none; font-variant-numeric: tabular-nums;
}
.cell.away { background: repeating-linear-gradient(-45deg, transparent 0 6px, color-mix(in srgb, var(--violet) 7%, transparent) 6px 8px); }
.away-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--violet); }
.away-tag .icon { width: 12px; height: 12px; }
.day-tab.away .wd { color: var(--violet); }
.mchip.away .icon { color: var(--violet); }
.area-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.away-range { white-space: nowrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.note .icon { width: 16px; height: 16px; margin-top: 2px; }
.note-warn { background: var(--warning-soft); }
.note-warn .icon { color: var(--warning); }

/* ============================== Kassenbuch ============================== */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.jicon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.jicon .icon { width: 16px; height: 16px; }
.jicon.pos { background: var(--success-soft); color: var(--success); }
.jicon.neg { background: var(--surface-2); color: var(--muted); }
.jside { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; white-space: nowrap; }
.jside-pad { width: 28px; flex: none; }
.amount { font-variant-numeric: tabular-nums; }
.amount.pos { color: var(--success); }
.sums { display: inline-flex; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sums .pos { color: var(--success); }
.sums .neg { color: var(--muted); }

/* ============================== Statistik ============================== */
.filter-row { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.refetching .card, .refetching .stats { opacity: .6; transition: opacity .2s; }
.stat .big { font-variant-numeric: normal; }

.awards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.award { flex-direction: row; align-items: center; gap: 12px; padding: 16px; }
.award > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.award-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--warning-soft); color: var(--warning); }

.stat-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: start; }

.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 4px; border-radius: 8px; outline-offset: 0; }
.hbar-row:hover { background: var(--surface-2); }
.hbar-name { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; min-width: 0; }
.hbar-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbar { flex: none; height: 16px; min-width: 2px; width: calc((100% - 96px) * var(--f)); background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar-val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.heat {
  --heat-empty: var(--surface-2);
  display: grid; grid-template-columns: 26px repeat(var(--cols), minmax(0, 1fr)); gap: 2px; align-items: center;
}
.heat-hour { font-size: 10.5px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.heat-wd { font-size: 12px; color: var(--muted); font-weight: 600; }
.heat-cell { height: 24px; border-radius: 3px; background: color-mix(in oklab, var(--accent) var(--p), var(--heat-empty)); cursor: default; }
.heat-cell.zero { background: var(--heat-empty); }
.heat-cell:hover, .heat-cell:focus-visible { outline: 2px solid var(--text); outline-offset: 0; }
.heat-legend { display: flex; align-items: center; gap: 8px; }
.heat-scale { width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(to right, var(--surface-2), var(--accent)); }
.table-view summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.table-view[open] summary { margin-bottom: 8px; }
.mini-table { border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.mini-table th, .mini-table td { padding: 3px 6px; text-align: center; border-bottom: 1px solid var(--border); }
.mini-table th { color: var(--muted); font-weight: 600; }

.stat-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.stat-table th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.stat-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.stat-table tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.meter-cell { display: grid; grid-template-columns: 80px auto; gap: 2px 10px; align-items: center; }
.meter-cell .small { grid-column: 1 / -1; }
.meter { display: block; width: 80px; height: 6px; border-radius: 3px; background: color-mix(in oklab, var(--accent) 18%, var(--surface)); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: calc(var(--f) * 100%); background: var(--accent); border-radius: 3px; }

.viz-tip {
  position: fixed; z-index: 200; pointer-events: none; display: flex; flex-direction: column; gap: 1px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 6px 10px; border-radius: 8px; font-size: 12px; max-width: 240px;
}
.viz-tip strong { font-size: 14px; }
.viz-tip span { color: var(--muted); }

@media (max-width: 820px) {
  .hint-mobile { display: block; }
  .stat-layout { grid-template-columns: 1fr; }
  .hbar-row { grid-template-columns: 92px minmax(0, 1fr); }
  .heat-hour.minor { visibility: hidden; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
}
.away-row { flex-wrap: wrap; row-gap: 4px; }
.away-row .person { flex: none; }
.person-sums { flex-wrap: wrap; row-gap: 4px; }
.person-sums .person { flex: none; }
