/* ==========================================================================
   Stundenplan & Kalender – Gestaltung
   Ruhig, flach, weiche Ecken, dünne Rahmen. Hell- und Dunkelmodus.
   Reihenfolge: Grundlagen · Rahmen · Bausteine · Seiten · Druck
   ========================================================================== */

/* ------------------------------------------------------------- 1. Farben */

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f1f3f5;
  --border: #e2e6ea;
  --border-strong: #cfd5dc;
  --text: #111826;
  --muted: #6b7280;
  --muted-2: #9aa3af;

  --blue: #3b82f6;
  --blue-text: #2563eb;
  --red: #ef4444;
  --red-text: #dc2626;
  --amber: #f59e0b;
  --amber-text: #b45309;
  --green: #10b981;
  --green-text: #047857;
  --violet: #8b5cf6;

  --blue-soft: rgba(59, 130, 246, .10);
  --red-soft: rgba(239, 68, 68, .10);
  --amber-soft: rgba(245, 158, 11, .13);
  --green-soft: rgba(16, 185, 129, .12);

  --blue-line: rgba(59, 130, 246, .45);
  --red-line: rgba(239, 68, 68, .55);
  --amber-line: rgba(245, 158, 11, .55);
  --green-line: rgba(16, 185, 129, .5);

  --r-xs: 6px;
  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-pop: 0 8px 28px rgba(16, 24, 40, .14);

  --topbar-h: 56px;
  --pad: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1015;
    --surface: #161a21;
    --surface-2: #1b2027;
    --surface-3: #222833;
    --border: #262c37;
    --border-strong: #39414f;
    --text: #e6e9ee;
    --muted: #98a2b1;
    --muted-2: #77808e;

    --blue-text: #7cb0fb;
    --red-text: #fb8a8a;
    --amber-text: #fbbf5c;
    --green-text: #56d5ab;

    --blue-soft: rgba(59, 130, 246, .16);
    --red-soft: rgba(239, 68, 68, .16);
    --amber-soft: rgba(245, 158, 11, .16);
    --green-soft: rgba(16, 185, 129, .16);

    --shadow: none;
    --shadow-pop: 0 10px 34px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --bg: #0d1015;
  --surface: #161a21;
  --surface-2: #1b2027;
  --surface-3: #222833;
  --border: #262c37;
  --border-strong: #39414f;
  --text: #e6e9ee;
  --muted: #98a2b1;
  --muted-2: #77808e;
  --blue-text: #7cb0fb;
  --red-text: #fb8a8a;
  --amber-text: #fbbf5c;
  --green-text: #56d5ab;
  --blue-soft: rgba(59, 130, 246, .16);
  --red-soft: rgba(239, 68, 68, .16);
  --amber-soft: rgba(245, 158, 11, .16);
  --green-soft: rgba(16, 185, 129, .16);
  --shadow: none;
  --shadow-pop: 0 10px 34px rgba(0, 0, 0, .55);
}

/* -------------------------------------------------------- 2. Grundlagen */

* { box-sizing: border-box; }

/* Muss stärker sein als display:flex/grid der Bausteine, sonst wirkt
   das hidden-Attribut bei Zeilen und Knopfgruppen nicht. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.25; }
p { margin: 0; }
a { color: var(--blue-text); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.num, table td, .time-col, .tt-time { font-variant-numeric: tabular-nums; }

/* Grundgrösse aller Symbole (alle Icons benutzen viewBox "0 0 24 24").
   Knöpfe und Sonderfälle überschreiben das weiter unten. */
svg[viewBox="0 0 24 24"] { width: 18px; height: 18px; flex: 0 0 auto; display: inline-block; vertical-align: -3px; }

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

.app-main { padding: var(--pad); max-width: 1280px; margin: 0 auto; }
.page-pad { padding-bottom: 48px; }

/* ------------------------------------------------------------ 3. Login */

body.is-login { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login { width: 100%; }
.login-box { max-width: 400px; margin: 0 auto; text-align: center; }
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login-title { font-size: 26px; margin-bottom: 4px; }
.login-sub { color: var(--muted); margin-bottom: 22px; }
.login-card { text-align: left; padding: 20px; }
.login-demo-hint { color: var(--muted); font-size: 13px; margin: 22px 0 8px; }
.login-demo { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ---------------------------------------------------------- 4. Kopfzeile */

.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  color: inherit; text-decoration: none; font-weight: 650; white-space: nowrap;
  flex: 0 0 auto;
}
.brand svg { display: block; flex: 0 0 auto; }
.brand-name { font-size: 15px; }

.mainnav {
  flex: 1 1 auto; display: flex; gap: 2px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  margin: 0 4px;
}
.mainnav::-webkit-scrollbar { display: none; }

.navlink {
  padding: 7px 11px; border-radius: var(--r-sm); text-decoration: none;
  color: var(--muted); font-size: 14px; font-weight: 550; white-space: nowrap;
  border: 1px solid transparent;
}
.navlink:hover { background: var(--surface-3); color: var(--text); }
.navlink.is-active { background: var(--blue-soft); color: var(--blue-text); border-color: var(--blue-line); }

.topbar-right { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; cursor: pointer; color: var(--muted); position: relative;
}
.iconbtn:hover { background: var(--surface-3); color: var(--text); }
.iconbtn svg { width: 19px; height: 19px; }

.bell-count {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

.userchip { display: flex; align-items: center; gap: 7px; padding: 4px 8px;
  background: none; border: 1px solid transparent; border-radius: var(--r-sm);
  color: inherit; cursor: pointer; }
.userchip:hover { background: var(--surface-3); }
.userchip .uname { font-size: 14px; font-weight: 550; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rolebadge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2.5px 7px; border-radius: 999px; border: 1px solid;
}
.rolebadge.admin   { color: var(--red-text);   background: var(--red-soft);   border-color: var(--red-line); }
.rolebadge.teacher { color: var(--blue-text);  background: var(--blue-soft);  border-color: var(--blue-line); }
.rolebadge.student { color: var(--green-text); background: var(--green-soft); border-color: var(--green-line); }
.rolebadge.parent  { color: var(--amber-text); background: var(--amber-soft); border-color: var(--amber-line); }

@media (max-width: 820px) {
  .brand-name { display: none; }
  .userchip .uname { display: none; }
}

/* ----------------------------------------------------------- 5. Elemente */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 550;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2f75ea; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #e03131; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-group { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; }
.btn-group button {
  border: 0; background: var(--surface); padding: 7px 12px; font-size: 13.5px;
  font-weight: 550; cursor: pointer; color: var(--muted);
}
.btn-group button + button { border-left: 1px solid var(--border); }
.btn-group button:hover { background: var(--surface-3); color: var(--text); }
.btn-group button.is-on { background: var(--blue); color: #fff; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 550;
  cursor: pointer; white-space: nowrap;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.is-dashed { border-style: dashed; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface-2);
}
.badge.blue  { color: var(--blue-text);  background: var(--blue-soft);  border-color: var(--blue-line); }
.badge.red   { color: var(--red-text);   background: var(--red-soft);   border-color: var(--red-line); }
.badge.amber { color: var(--amber-text); background: var(--amber-soft); border-color: var(--amber-line); }
.badge.green { color: var(--green-text); background: var(--green-soft); border-color: var(--green-line); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title h2 { font-size: 15px; }
.card-title .link { font-size: 13px; }

.alert { padding: 10px 13px; border-radius: var(--r); font-size: 13.5px; border: 1px solid; margin-bottom: 12px; }
.alert-red   { background: var(--red-soft);   border-color: var(--red-line);   color: var(--red-text); }
.alert-amber { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber-text); }
.alert-green { background: var(--green-soft); border-color: var(--green-line); color: var(--green-text); }
.alert-blue  { background: var(--blue-soft);  border-color: var(--blue-line);  color: var(--blue-text); }

.empty { color: var(--muted); font-size: 14px; padding: 14px 2px; }
.empty-lg { text-align: center; padding: 36px 16px; color: var(--muted); }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

.link { background: none; border: 0; padding: 0; color: var(--blue-text);
  cursor: pointer; font-size: inherit; text-decoration: none; }
.link:hover { text-decoration: underline; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }

/* ----------------------------------------------------------- 6. Formulare */

.field { margin-bottom: 13px; }
.field > label, .field-label {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--muted);
  margin-bottom: 5px; letter-spacing: .01em;
}
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=date], .field input[type=time], .field input[type=number],
.field select, .field textarea, .input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--text);
}
.field textarea { resize: vertical; min-height: 74px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--blue); outline: 2px solid var(--blue-soft); outline-offset: 0;
}
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 150px; margin-bottom: 13px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); flex: 0 0 auto; cursor: pointer; }

.switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong);
  transition: background .15s; pointer-events: none;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Farbwähler: gewählte Farbe deutlich – grösser, Ring, weisses Häkchen */
.colors { display: flex; flex-wrap: wrap; gap: 9px; }
.color-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  position: relative; padding: 0; transition: transform .12s;
}
.color-dot:hover { transform: scale(1.08); }
.color-dot.is-on { transform: scale(1.18); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor; }
.color-dot.is-on::after {
  content: ""; position: absolute; left: 9px; top: 5px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(42deg);
}

.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.weekday-picker button {
  width: 38px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.weekday-picker button.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }
.weekday-picker.round button { border-radius: 50%; width: 34px; }

/* Erinnerungs-Block */
.remind-box { border: 1px solid var(--border); border-radius: var(--r); padding: 12px; background: var(--surface-2); }
.remind-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.remind-head b { font-size: 13.5px; }
.remind-row { display: flex; align-items: center; gap: 7px; margin-top: 9px; }
.remind-row input[type=number] { width: 66px; padding: 6px 8px; border: 1px solid var(--border-strong);
  border-radius: var(--r-xs); background: var(--surface); }
.remind-row select { padding: 6px 8px; border: 1px solid var(--border-strong);
  border-radius: var(--r-xs); background: var(--surface); }
.remind-row .rtext { font-size: 13px; color: var(--muted); flex: 1 1 auto; }

/* ------------------------------------------------------------ 7. Schublade */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 20, 28, .42); z-index: 90;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed; z-index: 91; background: var(--surface); display: flex; flex-direction: column;
  border: 1px solid var(--border); box-shadow: var(--shadow-pop);
  top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  animation: slide-in .2s cubic-bezier(.22, .8, .3, 1);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .6; } }

.drawer-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.drawer-head .dh-main { flex: 1 1 auto; min-width: 0; }
.drawer-head h2 { font-size: 17px; overflow-wrap: anywhere; }
.drawer-head .dh-sub { font-size: 13px; margin-top: 2px; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 16px; }
.drawer-foot {
  position: sticky; bottom: 0; display: flex; gap: 9px; justify-content: flex-end;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface);
}
.drawer-foot.spread { justify-content: space-between; }

@media (max-width: 640px) {
  .drawer {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 92vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: slide-up .22s cubic-bezier(.22, .8, .3, 1);
  }
  @keyframes slide-up { from { transform: translateY(28px); opacity: .6; } }
}

/* --------------------------------------------------------------- 8. Dialog */

.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(15, 20, 28, .45); z-index: 120;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.dialog {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); width: min(420px, 100%); padding: 18px;
}
.dialog h3 { font-size: 16px; margin-bottom: 7px; }
.dialog p { color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.dialog-actions.stack { flex-direction: column; }
.dialog-actions.stack .btn { width: 100%; }

/* --------------------------------------------------------------- 9. Toast */

.toast-root { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: min(520px, calc(100% - 24px)); }
.toast {
  background: var(--text); color: var(--surface); padding: 10px 15px; border-radius: var(--r);
  font-size: 13.5px; box-shadow: var(--shadow-pop); animation: fade .16s ease;
}
.toast.err { background: var(--red); color: #fff; }

/* -------------------------------------------------- 10. Benachrichtigungen */

.notif-pop {
  position: absolute; top: calc(var(--topbar-h) - 6px); right: 8px; z-index: 80;
  width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
}
.notif-head { display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--surface); }
.notif-item { display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--surface-3); }
.notif-item.unread { background: var(--blue-soft); }
.notif-item .nt { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.notif-item .nb { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif-item .na { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; }
.notif-item .ndot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: 0 0 auto; }

/* --------------------------------------------------------- 11. Stundenplan */

.plan-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.plan-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-row.right { justify-content: flex-end; }
.plan-title { font-size: 17px; font-weight: 650; margin: 0 4px; }
.plan-select { padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); max-width: 210px; }
.zoom { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); overflow: hidden; }
.zoom button { border: 0; background: var(--surface); width: 30px; height: 32px; cursor: pointer; color: var(--muted); }
.zoom button:hover { background: var(--surface-3); color: var(--text); }
.zoom .zval { font-size: 12.5px; color: var(--muted); min-width: 44px; text-align: center;
  font-variant-numeric: tabular-nums; }

.daychips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.daychips::-webkit-scrollbar { display: none; }
.daychip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 46px; padding: 5px 8px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.daychip .dw { font-size: 11px; color: var(--muted); }
.daychip .dn { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.daychip.is-today { border-color: var(--blue); }
.daychip.is-sel { background: var(--blue); border-color: var(--blue); color: #fff; }
.daychip.is-sel .dw { color: rgba(255, 255, 255, .85); }

/* Raster */
.tt {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden;
}
.tt-scroll { overflow-x: auto; }
.tt-inner { min-width: 100%; }

.tt-head { display: grid; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tt-head .tt-corner { border-right: 1px solid var(--border); }
.tt-head .tt-day {
  padding: 7px 6px; text-align: center; border-right: 1px solid var(--border); min-width: 0;
}
.tt-head .tt-day:last-child { border-right: 0; }
.tt-head .tt-day .dw { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tt-head .tt-day .dd { font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tt-head .tt-day.is-today { background: var(--blue-soft); }
.tt-head .tt-day.is-today .dd { color: var(--blue-text); }

.tt-allday { display: grid; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tt-allday .ad-label { font-size: 10.5px; color: var(--muted); padding: 6px 6px; text-align: right;
  border-right: 1px solid var(--border); }
.tt-allday .ad-cell { padding: 4px 4px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tt-allday .ad-cell:last-child { border-right: 0; }
.ad-holiday {
  background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-text);
  border-radius: var(--r-xs); font-size: 11.5px; font-weight: 600; padding: 2px 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ad-event {
  border-radius: 999px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; cursor: pointer;
  border: 1px solid transparent; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tt-body { display: grid; position: relative; }
.tt-times { border-right: 1px solid var(--border); position: relative; background: var(--surface-2); }
.tt-time {
  position: absolute; left: 0; right: 0; padding-right: 7px; text-align: right;
  font-size: 11px; color: var(--muted); line-height: 1;
}
.tt-time .pn { font-size: 14px; font-weight: 650; color: var(--text); display: block; }
.tt-col { position: relative; border-right: 1px solid var(--border); min-width: 0; }
.tt-col:last-child { border-right: 0; }
.tt-col.is-today { background: rgba(59, 130, 246, .035); }
.tt-band { position: absolute; left: 0; right: 0; background: var(--surface-3); opacity: .55; }
.tt-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.tt-slot { position: absolute; left: 0; right: 0; cursor: pointer; }
.tt-slot:hover { background: var(--blue-soft); }

.tt-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--red); z-index: 6; pointer-events: none; }
.tt-now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); }

/* Kachel */
.tile {
  position: absolute; overflow: hidden; cursor: pointer; z-index: 3;
  border: 1px solid var(--border-strong); border-left: 4px solid var(--tile-color, var(--blue));
  border-radius: var(--r-sm); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3px 4px; gap: 1px; min-height: 22px;
}
.tile:hover { box-shadow: 0 0 0 2px var(--blue-line); background: var(--surface-3); }
.tile .t1 { font-size: 12.5px; font-weight: 700; line-height: 1.15; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t2 { font-size: 11px; color: var(--muted); line-height: 1.1; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .t3 { font-size: 10px; color: var(--muted-2); line-height: 1.1; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.compact { padding: 2px 3px; }
.tile.compact .t2, .tile.compact .t3 { display: none; }

.tile-icons { position: absolute; right: 3px; bottom: 2px; display: flex; gap: 2px; line-height: 1; }
.tile-icons svg { width: 12px; height: 12px; display: block; }
.ic-note { color: var(--muted); }
.ic-hw-open { color: var(--amber); }
.ic-hw-done { color: var(--green); }

.tile.is-exam { background: var(--amber-soft); border-color: var(--amber-line); }
.tile.is-extra { background: var(--green-soft); border-color: var(--green-line); }
.tile.is-cancelled {
  background: var(--red-soft); border-color: var(--red-line); color: var(--red-text);
}
.tile.is-cancelled .t1 { text-decoration: line-through; }
.tile.is-cancelled .t2, .tile.is-cancelled .t3 { color: var(--red-text); opacity: .8; }
.tile.is-cancelled::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top right, transparent calc(50% - 1px),
    var(--red-line) calc(50% - 1px), var(--red-line) calc(50% + 1px), transparent calc(50% + 1px));
}
.tile.is-event { background: var(--surface-2); }
.tile.is-draft { box-shadow: 0 0 0 2px var(--amber-line); }

.tt-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 11px 14px; color: var(--muted);
  font-size: 12.5px; border-top: 1px solid var(--border); background: var(--surface-2); }
.tt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-swatch { width: 14px; height: 12px; border-radius: 3px; border: 1px solid var(--border-strong); display: inline-block; }
.lg-swatch.exam { background: var(--amber-soft); border-color: var(--amber-line); }
.lg-swatch.extra { background: var(--green-soft); border-color: var(--green-line); }
.lg-swatch.cancel { background: var(--red-soft); border-color: var(--red-line); }
.lg-swatch.personal { background: var(--surface); border-left: 4px solid var(--violet); }

/* Monat */
.month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2);
  border-bottom: 1px solid var(--border); }
.month-head div { padding: 7px 4px; text-align: center; font-size: 11.5px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.month-cell {
  min-height: 96px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 4px 5px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell:hover { background: var(--surface-3); }
.month-cell.is-out { background: var(--surface-2); color: var(--muted-2); }
.month-cell.is-exam { background: var(--red-soft); }
.month-cell.is-holiday { background: var(--amber-soft); }
.month-daynum { align-self: flex-end; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.month-cell.is-today .month-daynum { background: var(--blue); color: #fff; }
.month-ev { display: flex; align-items: center; gap: 4px; font-size: 11px; min-width: 0; }
.month-ev .dot { width: 7px; height: 7px; }
.month-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-more { font-size: 10.5px; color: var(--muted); }
@media (max-width: 640px) { .month-cell { min-height: 72px; } }

/* Startseite */
.today-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.today-row:last-child { border-bottom: 0; }
.today-bar { width: 4px; align-self: stretch; min-height: 30px; border-radius: 2px; flex: 0 0 auto; }
.today-time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; width: 44px; }
.today-name { flex: 1 1 auto; font-size: 14px; font-weight: 600; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-meta { font-size: 12.5px; color: var(--muted); text-align: right; flex: 0 0 auto; }
.today-row.is-now { border: 1px solid var(--blue-line); background: var(--blue-soft);
  border-radius: var(--r); padding: 8px 10px; margin: 4px 0; }
.cancel-row { border: 1px dashed var(--red-line); border-radius: var(--r); padding: 7px 11px;
  margin-bottom: 7px; color: var(--red-text); font-size: 13.5px; display: flex; gap: 9px; }
.cancel-row .cn { text-decoration: line-through; }

/* ------------------------------------------------------------- 12. Planer */

.planner-wrap { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
/* Ohne min-width:0 zwingt die breite Tabelle im Raster die ganze Seite
   auf dem Handy in die Breite. */
.planner-wrap > * { min-width: 0; }
@media (min-width: 1050px) { .planner-wrap { grid-template-columns: 1fr 264px; } }

.draftbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--amber-text);
  border-radius: var(--r); padding: 10px 13px; margin-bottom: 12px;
}
.draftbar b { font-size: 14px; }
.draftbar .dsub { font-size: 12.5px; opacity: .85; }
.draftbar .dact { margin-left: auto; display: flex; gap: 8px; }

.pgrid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: auto; user-select: none; -webkit-user-select: none; }
.pgrid table { border-collapse: collapse; width: 100%; min-width: 620px; }
.pgrid th, .pgrid td { border: 1px solid var(--border); vertical-align: top; }
.pgrid thead th { background: var(--surface-2); padding: 6px 5px; font-size: 12px; font-weight: 600; }
.pgrid thead th.is-today { background: var(--blue-soft); color: var(--blue-text); }
.pgrid thead th.is-holiday { background: var(--amber-soft); color: var(--amber-text); }
.pgrid thead th .hname { display: block; font-size: 10.5px; font-weight: 500; }
.pgrid td.ptime { width: 62px; background: var(--surface-2); text-align: center; padding: 6px 3px; }
.pgrid td.ptime .pn { font-size: 15px; font-weight: 650; }
.pgrid td.ptime .ph { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pcell { padding: 3px; min-height: 50px; min-width: 96px; }
.pcell.is-over { background: var(--blue-soft); }
.pcell.is-holiday { background: var(--amber-soft); }

.pcard {
  position: relative; border: 1px solid var(--border-strong); border-left: 4px solid var(--pc, var(--blue));
  border-radius: var(--r-xs); background: var(--surface); padding: 4px 5px; margin-bottom: 3px;
  cursor: grab; touch-action: none; user-select: none;
}
.pcard:last-child { margin-bottom: 0; }
.pcard .p1 { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .p2 { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard.is-draft { box-shadow: 0 0 0 2px var(--amber-line); }
.pcard.is-conflict { box-shadow: 0 0 0 2px var(--red-line); }
.pcard.is-draft.is-conflict { box-shadow: 0 0 0 2px var(--red-line), 0 0 0 4px var(--amber-line); }
.pcard.is-cancel { background: var(--red-soft); color: var(--red-text); }
.pcard.is-del { opacity: .5; }
.pcard.is-del .p1 { text-decoration: line-through; }
.pcard.dragging { opacity: .4; }
.pflag {
  position: absolute; top: -7px; right: -3px; font-size: 9.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 999px; border: 1px solid;
  background: var(--surface);
}
.pflag.new { color: var(--green-text); border-color: var(--green-line); background: var(--green-soft); }
.pflag.cancel { color: var(--red-text); border-color: var(--red-line); background: var(--red-soft); }
.pflag.del { color: var(--muted); border-color: var(--border-strong); background: var(--surface-3); }

.pdrops { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pdrop {
  flex: 1 1 180px; border: 2px dashed var(--border-strong); border-radius: var(--r);
  padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; font-weight: 600;
}
.pdrop.trash { border-color: var(--red-line); color: var(--red-text); }
.pdrop.is-over { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-text); }
.pdrop.trash.is-over { background: var(--red-soft); border-color: var(--red); color: var(--red-text); }

.pool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.pool-item {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong);
  border-left: 4px solid var(--pc, var(--blue)); border-radius: var(--r-sm);
  padding: 7px 9px; margin-bottom: 7px; cursor: grab; touch-action: none; background: var(--surface-2);
}
.pool-item .gripper { color: var(--muted-2); flex: 0 0 auto; }
.pool-item .pi-main { min-width: 0; flex: 1 1 auto; display: block; }
.pool-item .pi1 { display: block; font-size: 13px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-item .pi2 { display: block; font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pool-hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 10px;
  border-top: 1px solid var(--border); padding-top: 10px; }

.drag-ghost {
  position: fixed; z-index: 300; pointer-events: none; opacity: .92;
  box-shadow: var(--shadow-pop); border-radius: var(--r-xs); background: var(--surface);
  border: 1px solid var(--blue); padding: 4px 8px; font-size: 12px; font-weight: 650;
}

/* ------------------------------------------------------------- 13. Listen */

.list-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .lr-main { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.list-row .lr-text { font-size: 14px; display: flex; align-items: flex-start; gap: 6px; overflow-wrap: anywhere; }
.list-row .lr-text .pen { color: var(--muted-2); opacity: .5; flex: 0 0 auto; margin-top: 2px; }
.list-row .lr-main:hover .pen { opacity: 1; color: var(--blue-text); }
.list-row .lr-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px;
  display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: center; }
.list-row .lr-meta b { color: var(--text); font-weight: 650; }
.list-row.is-done .lr-text { text-decoration: line-through; color: var(--muted); }
.list-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); margin-top: 2px;
  flex: 0 0 auto; cursor: pointer; }

.group-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; }
.group-head .gt { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.group-head .gc { font-size: 11.5px; color: var(--muted); }
.g-overdue .gt { color: var(--red-text); }
.g-today .gt { color: var(--amber-text); }
.g-soon .gt { color: var(--blue-text); }
.g-later .gt, .g-none .gt { color: var(--muted); }
.g-done .gt { color: var(--green-text); }

.section-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0;
  padding: 10px 0; cursor: pointer; text-align: left; font-size: 14px; font-weight: 650; color: inherit;
}
.section-toggle .caret { transition: transform .15s; color: var(--muted); }
.section-toggle[aria-expanded="false"] .caret { transform: rotate(-90deg); }

/* Prüfungen */
.exam-card { display: flex; gap: 12px; padding: 13px; border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 10px; background: var(--surface); }
.exam-icon { width: 38px; height: 38px; border-radius: var(--r-sm); background: var(--red-soft);
  color: var(--red-text); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.exam-main { flex: 1 1 auto; min-width: 0; }
.exam-main .en { font-size: 15px; font-weight: 650; }
.exam-main .em { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.exam-main .ed { font-size: 13px; margin-top: 6px; }
.exam-main .edate { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.exam-past { opacity: .62; }

/* Absenzen */
.count-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.count-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px; text-align: center; }
.count-card .cn { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-card .cl { font-size: 12.5px; color: var(--muted); }
.abs-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 13px; margin-bottom: 9px; }
.abs-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.abs-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.abs-actions { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }

/* Anwesenheit */
.att-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.att-row:last-child { border-bottom: 0; }
.att-name { flex: 1 1 auto; min-width: 0; font-size: 13.5px; }
.att-name .ac { font-size: 11.5px; color: var(--muted); }
.att-btns { display: flex; gap: 4px; flex: 0 0 auto; }
.att-btns button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  border-radius: var(--r-xs); padding: 4px 8px; font-size: 12px; font-weight: 600; cursor: pointer; }
.att-btns button.on-present { background: var(--green); border-color: var(--green); color: #fff; }
.att-btns button.on-absent { background: var(--red); border-color: var(--red); color: #fff; }
.att-btns button.on-late { background: var(--amber); border-color: var(--amber); color: #fff; }

/* Lektions-Detail */
.detail-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 13px;
  border-radius: var(--r); margin-bottom: 13px; }
.detail-banner.red { background: var(--red); color: #fff; }
.detail-banner.green { background: var(--green-soft); border: 1px solid var(--green-line); color: var(--green-text); }
.detail-reason { background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red-text);
  border-radius: var(--r); padding: 9px 12px; font-size: 13px; margin: -6px 0 13px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.info-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 13.5px; }
.info-row svg { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; margin-top: 2px; }
.dsection { border-top: 1px solid var(--border); padding-top: 13px; margin-top: 13px; }
.dsection-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.dsection-head h3 { font-size: 13.5px; }
.exam-box { background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: var(--r);
  padding: 11px 12px; display: flex; gap: 10px; }
.exam-box .eb-main { flex: 1 1 auto; min-width: 0; }
.inline-add { display: flex; gap: 7px; margin-top: 10px; }
.inline-add input, .inline-add textarea { flex: 1 1 auto; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface-2); }

/* ---------------------------------------------------------- 14. Verwaltung */

.admin-wrap { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
.admin-wrap > * { min-width: 0; }
@media (min-width: 900px) { .admin-wrap { grid-template-columns: 200px 1fr; } }
.admin-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.admin-nav::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .admin-nav { flex-direction: column; overflow: visible; position: sticky; top: 72px; } }
.admin-nav button {
  border: 1px solid transparent; background: none; border-radius: var(--r-sm); padding: 8px 11px;
  text-align: left; font-size: 14px; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.admin-nav button:hover { background: var(--surface-3); color: var(--text); }
.admin-nav button.is-on { background: var(--blue-soft); color: var(--blue-text); border-color: var(--blue-line); }

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px; text-align: left; cursor: pointer; }
.kpi:hover { background: var(--surface-3); }
.kpi .kn { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .kl { font-size: 12.5px; color: var(--muted); }

.checklist-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--border); width: 100%; background: none; border-top: 0;
  border-left: 0; border-right: 0; text-align: left; cursor: pointer; color: inherit; font-size: 14px; }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item .ci { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong);
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.checklist-item.done .ci { background: var(--green); border-color: var(--green); color: #fff; }
.checklist-item.done span.cl { color: var(--muted); }
.checklist-item .arrow { margin-left: auto; color: var(--muted-2); }

.dtable { width: 100%; border-collapse: collapse; }
.dtable td, .dtable th { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13.5px; }
.dtable th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable .rowacts { text-align: right; white-space: nowrap; }
.dtable .rowacts .iconbtn { width: 30px; height: 30px; }
.searchbox { margin-bottom: 12px; }

.logtable { max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); }
.logtable .lg-row { display: flex; gap: 10px; padding: 7px 11px; font-size: 13px; }
.logtable .lg-row:nth-child(odd) { background: var(--surface-2); }
.logtable .lg-t { color: var(--muted); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.logtable .lg-d { flex: 1 1 auto; }
.logtable .lg-u { color: var(--muted); flex: 0 0 auto; }

.danger-box { border: 1px solid var(--red-line); background: var(--red-soft); border-radius: var(--r); padding: 14px; }
.danger-box h3 { color: var(--red-text); font-size: 14.5px; margin-bottom: 7px; }
.danger-box p { font-size: 13.5px; color: var(--text); margin-bottom: 6px; }

.pwbox { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 13px; text-align: center; }
.pwbox .pw { font-size: 22px; font-weight: 700; letter-spacing: .06em; margin: 8px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--r); padding: 20px;
  text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.dropzone.is-over { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-text); }

/* --------------------------------------------------------------- 15. Druck */

@media print {
  @page { size: A4 landscape; margin: 10mm; }

  /* Druck immer in hellen Farben – auch im Dunkelmodus.
     Das !important schlägt bewusst die Dunkelmodus-Regeln aus Abschnitt 1. */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff !important; --surface: #fff !important; --surface-2: #fff !important;
    --surface-3: #f2f4f6 !important;
    --border: #c9ced6 !important; --border-strong: #aab2bd !important;
    --text: #000 !important; --muted: #444 !important; --muted-2: #666 !important;
    --blue-text: #1d4ed8 !important; --red-text: #b91c1c !important;
    --amber-text: #92400e !important; --green-text: #065f46 !important;
    --blue-soft: #eaf1fe !important; --red-soft: #fdeaea !important;
    --amber-soft: #fdf2dc !important; --green-soft: #e6f7f1 !important;
    --shadow: none !important; --shadow-pop: none !important;
  }
  body { background: #fff !important; color: #000 !important; }

  .topbar, .plan-toolbar, .daychips, .toast-root, .notif-pop, .tt-now,
  .drawer, .drawer-backdrop, .dialog-backdrop, .no-print, .pdrops, .pool-card { display: none !important; }

  .app-main { padding: 0; max-width: none; }
  .tt, .month, .card { border-color: #c9ced6; box-shadow: none; break-inside: avoid; }
  .tt-scroll { overflow: visible; }
  .tile { box-shadow: none; }
  .print-head { display: block !important; margin-bottom: 8mm; }
  a[href]::after { content: ""; }
}
.print-head { display: none; }
.print-head h1 { font-size: 18px; }
.print-head p { color: #444; font-size: 13px; }

/* ------------------------------------------------------- 16. Kleinigkeiten */

.hstack { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vstack { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1 1 auto; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strike { text-decoration: line-through; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.nowrap { white-space: nowrap; }
.scroll-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px; }
