/* ISO Anwesenheit – Stil
   Angelehnt an die Koran-Wettbewerb-App des Vereins: ruhig, klar, große Tippflächen,
   Farben aus dem Vereinslogo, Systemschrift des Handys (iPhone: San Francisco, Android: Roboto). */
:root {
  --teal: #009E96;
  --teal-strong: #00776F;   /* für weiße Schrift (Kontrast ≥ 4.5:1) */
  --teal-soft: #E3F4F3;
  --orange: #F39200;
  --purple: #8B1A6B;
  --green: #4E9A2E;
  --blue: #0088CC;
  --red: #E2001A;
  --red-strong: #B80016;

  --bg: #F5F7F7;
  --surface: #FFFFFF;
  --text: #1E2828;
  --muted: #5E6969;
  --line: #E1E7E7;
  --soft: #EEF2F2;
  --shadow: 0 1px 2px rgba(20, 40, 40, .06), 0 4px 16px rgba(20, 40, 40, .06);

  /* Anwesenheit: dunklere Töne der Logofarben, damit weiße Schrift gut lesbar ist */
  --a: #3B7D23; --a-tint: #EAF4E4;   /* da */
  --f: #B80016; --f-tint: #FDE8EA;   /* fehlt */
  --e: #B35F00; --e-tint: #FFF2DF;   /* entschuldigt */
  --v: #0072AD; --v-tint: #E2F1FA;   /* zu spät */

  --radius: 14px;
  --tap: 56px;
  --tabbar-h: 62px;
  --savebar-h: 112px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  font-size: 106.25%; /* 17 px – folgt der Schriftgröße des Browsers */
  touch-action: manipulation; /* kein Zoomen per Doppeltipp */
}
/* App-Gerüst: Das Fenster selbst bewegt sich nie. Nur #scroller scrollt – senkrecht. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0;
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 1rem/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Icons ---------- */
.icon { display: inline-flex; width: 1.2em; height: 1.2em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.chevron { width: 18px; height: 18px; color: #A5B0B0; }
.icon-tile {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--teal-soft); color: var(--teal-strong);
}
.icon-tile .icon { width: 20px; height: 20px; }
.icon-tile.small { width: 34px; height: 34px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: relative; flex: none; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: var(--safe-top);
}
.topbar-inner {
  display: flex; align-items: center; gap: 8px;
  max-width: 560px; margin: 0 auto;
  min-height: 60px; padding: 8px 8px 8px 14px;
}
.topbar.has-back .topbar-inner { padding-left: 6px; }
.brand-icon { width: 34px; height: 34px; object-fit: contain; flex: none; }
.brand {
  flex: 1; min-width: 0; margin: 0;
  font-size: 18px; font-weight: 700; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-badge {
  flex: none; background: var(--purple); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; letter-spacing: .03em;
}
.topbar-actions { display: flex; align-items: center; }
.icon-btn {
  position: relative; flex: none;
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--text);
}
.icon-btn:active { background: var(--teal-soft); }
.icon-btn .icon { width: 24px; height: 24px; }
.icon-btn > svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .dot {
  position: absolute; top: 11px; right: 12px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 2px var(--surface);
}

.offline-banner {
  flex: none; background: #FFF4E0; color: #7A4A00; text-align: center;
  padding: 10px 16px; font-size: 15px; border-bottom: 1px solid #F6DDB0;
}

/* ---------- Grundlayout ---------- */
.scroller {
  flex: 1 1 auto; min-height: 0;
  overflow-x: hidden; overflow-y: auto;
  /* natürliches Nachfedern nur im Inhalt – Kopfzeile und Leisten bleiben stehen */
  overscroll-behavior-x: none; overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
body.sheet-open .scroller { overflow-y: hidden; }
.container { max-width: 560px; margin: 0 auto; padding: 18px 16px 32px; }
/* Platz für die unteren Leisten, damit das Letzte in der Liste nicht verdeckt wird */
body.has-tabbar .container { padding-bottom: calc(32px + var(--tabbar-h) + var(--safe-bottom)); }
body.has-tabbar.has-savebar .container { padding-bottom: calc(32px + var(--tabbar-h) + var(--savebar-h) + var(--safe-bottom)); }
.narrow { max-width: 440px; margin: 0 auto; }

.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 10px; }
.stack-lg > * + * { margin-top: 24px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .row { grid-template-columns: 3fr 2fr; } }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.section-title {
  margin-left: 4px; margin-right: 4px; font-size: 14px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.card .section-title { margin-left: 0; margin-right: 0; }
/* Listen ohne eigenen Außenabstand – der Abstand kommt von .stack (niedrige Spezifität per :where) */
:where(.list, .students, .hint-list) { margin: 0; }
.page-head p { margin-top: 4px; }
.date-heading { font-size: 1.2rem; font-weight: 800; }
.date-line { font-size: 1.05rem; font-weight: 700; }

/* Begrüßung (klein) */
.hello-greet { font-size: 15px; font-weight: 600; color: var(--teal-strong); }
.hello-name { font-size: 1.6rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

/* ---------- Anmeldung ---------- */
.login {
  min-height: calc(100dvh - 50px - var(--safe-top) - var(--safe-bottom));
  display: flex; flex-direction: column; justify-content: center;
  max-width: 400px; margin: 0 auto;
}
.hero { text-align: center; }
.hero-logo { display: block; width: min(78%, 280px); height: auto; margin: 0 auto 8px; }
.hero h1 { margin: 18px 0 4px; font-size: 24px; }
.welcome { text-align: center; padding-top: 8px; }
.welcome-logo { display: block; width: 72px; height: auto; margin: 0 auto 14px; }
.welcome h1 { font-size: 24px; margin-bottom: 6px; }

/* ---------- Eingabefelder ---------- */
.field { display: block; }
.field-label { display: block; font-size: 15px; font-weight: 600; margin: 0 0 6px 2px; }
.field-hint { display: block; font-size: 14px; color: var(--muted); margin: 6px 2px 0; }
input[type='text'], input[type='password'], select {
  width: 100%; min-height: var(--tap);
  padding: 12px 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font-size: 18px; /* ≥ 16 px: iPhone zoomt beim Tippen nicht */
  appearance: none; -webkit-appearance: none; outline: none;
}
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235E6969' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
  padding-right: 44px;
}

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 12px 18px;
  border: 0; border-radius: 12px;
  font-size: 18px; font-weight: 700; text-decoration: none;
  background: var(--teal-strong); color: #fff;
}
.btn:active:not(:disabled) { filter: brightness(.92); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--teal-strong); color: #fff; }
.btn.soft { background: var(--surface); color: var(--text); border: 1.5px solid var(--line); }
.btn.soft .icon { color: var(--teal-strong); }
.btn.ghost { background: transparent; color: var(--teal-strong); }
.btn.danger { background: var(--red-strong); color: #fff; }
.btn.danger-outline { background: var(--surface); color: var(--red-strong); border: 1.5px solid #F2C9CE; }
.btn.small { min-height: 48px; padding: 8px 12px; font-size: 16px; gap: 6px; }
.btn .icon { width: 20px; height: 20px; }
.btn.small .icon { width: 18px; height: 18px; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy .icon { visibility: hidden; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.btn.soft.is-busy::after, .btn.ghost.is-busy::after, .btn.danger-outline.is-busy::after {
  border-color: var(--line); border-top-color: var(--teal);
}
.link {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
  padding: 4px 2px; border: 0; background: none;
  font-weight: 700; color: var(--teal-strong); text-decoration: none;
}
.link .icon { width: 16px; height: 16px; }
.links { display: flex; justify-content: center; gap: 4px 28px; flex-wrap: wrap; }

/* ---------- Hinweise ---------- */
.notice { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.notice.info { background: var(--teal-soft); color: #0B4F4A; }
.notice.warn { background: #FFF4E0; color: #7A4A00; }
.notice.error { background: #FDE8EA; color: var(--red-strong); font-weight: 600; }

/* ---------- Datum: wischbare Reihe ---------- */
.chips { display: grid; gap: 10px; }
.chip-strip {
  position: relative; display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  touch-action: pan-x pan-y; /* hier ist auch seitliches Wischen erlaubt */
  -webkit-overflow-scrolling: touch;
}
.chip-strip::-webkit-scrollbar { display: none; }
/* gut vier Knöpfe sichtbar – der angeschnittene fünfte zeigt, dass man wischen kann */
.chip-strip > .chip { flex: 0 0 calc((100% - 4 * 8px) / 4.35); scroll-snap-align: start; }
.chip {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 62px; padding: 6px 4px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
}
.chip-top { font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.chip-day { font-size: 18px; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
.chip.active { background: var(--teal-strong); border-color: var(--teal-strong); color: #fff; }
.chip.active .chip-top { color: #BFEDEA; }
.chip-other {
  flex-direction: row; gap: 10px; min-height: 52px; padding: 6px 20px;
  overflow: hidden; font-size: 16px; font-weight: 600; white-space: nowrap;
}
.chip-other .icon { width: 18px; height: 18px; color: var(--muted); }
.chip-other.active .icon { color: #BFEDEA; }
.chip-other:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.chip-other .date-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; cursor: pointer;
  font-size: 16px; /* unter 16 px zoomt das iPhone beim Antippen hinein */
}

/* ---------- Listen und Karten ---------- */
.list {
  padding: 0; list-style: none;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.list > * + * { border-top: 1px solid var(--line); }

.button-list { display: grid; gap: 10px; }

/* Klassen-Karte: farbiger Streifen links wie in der Koran-App, Name groß in der Mitte */
.class-card {
  position: relative; display: grid; grid-template-columns: 44px 1fr 44px;
  align-items: center; gap: 12px;
  width: 100%; min-height: 78px; padding: 14px 14px 14px 22px;
  border: 0; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  text-align: left; color: inherit; overflow: hidden;
  transition: transform .12s;
}
.class-card::before, .day-tile::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 6px;
  background: var(--accent, var(--teal));
}
.class-card:active, .day-tile:active { transform: scale(.98); }
.class-card > .chevron { justify-self: end; }
.class-icon {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--bg);
}
.class-art { width: 30px; height: 30px; }
.class-art svg { display: block; width: 100%; height: 100%; }
.saved-badge {
  position: absolute; right: -4px; bottom: -4px;
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--a); color: #fff; box-shadow: 0 0 0 2px var(--surface);
}
.saved-badge .icon { width: 13px; height: 13px; }
.class-body { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.class-name { font-size: 1.45rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.class-sub {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px;
  font-size: 14px; color: var(--muted);
}
.class-mine { color: var(--teal-strong); font-weight: 700; }
.class-saved { color: var(--a); font-weight: 700; }

/* Samstag / Sonntag */
.day-tile {
  position: relative; display: flex; align-items: center; gap: 18px;
  width: 100%; min-height: 84px; padding: 16px 14px 16px 24px;
  border: 0; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  text-align: left; color: inherit; overflow: hidden;
  transition: transform .12s;
}
.day-tile-body {
  display: flex; flex-wrap: nowrap; /* Datum immer rechts neben dem Wochentag */
  align-items: baseline; gap: 12px; flex: 1; min-width: 0; white-space: nowrap;
}
.day-tile-name { font-size: clamp(1.6rem, 8.5vw, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.day-tile-date { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- Profil / Menü (wie das Menü der Koran-Wettbewerb-App) ---------- */
.menu-who { background: var(--teal-soft); border-radius: 12px; padding: 12px 14px; }
.menu-who b { font-weight: 700; }
.menu-who-sub { font-size: 14px; color: #3F5F5C; margin-top: 2px; }
.menu-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 58px; padding: 10px 14px 10px 16px;
  border: 0; background: transparent; text-align: left; color: var(--text);
}
.menu-list > .menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row:active { background: var(--teal-soft); }
.menu-row:focus-visible { outline-offset: -3px; }
.menu-row-main { flex: 1; min-width: 0; }
.menu-row-title { display: block; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-row-sub { display: block; font-size: 14px; color: var(--muted); }
.menu-row.is-danger .menu-row-title { color: var(--red-strong); }
.menu-row.is-busy { opacity: .6; }
.install-step { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--bg); }

/* ---------- Klassen ankreuzen (Registrierung) ---------- */
.check-item { position: relative; display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 10px 16px; cursor: pointer; }
.check-item:active { background: var(--teal-soft); }
.check-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.check-box {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border: 2px solid #B8C4C4; border-radius: 8px;
  background: var(--surface); color: transparent;
  transition: background .15s, border-color .15s;
}
.check-box .icon { width: 18px; height: 18px; }
.check-input:checked + .check-box { background: var(--teal-strong); border-color: var(--teal-strong); color: #fff; }
.check-input:focus-visible + .check-box { outline: 2px solid var(--teal); outline-offset: 2px; }
.check-body { display: flex; flex-direction: column; min-width: 0; }
.check-name { font-weight: 700; }
.check-sub { font-size: 14px; color: var(--muted); }

/* ---------- Symbol-Auswahl (Admin) ---------- */
.symbol-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.symbol-option {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px 10px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); font-weight: 700; color: var(--text);
}
.symbol-option[aria-checked='true'] {
  border-color: var(--teal-strong); background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px var(--teal-strong); color: var(--teal-strong);
}

/* ---------- Hinweise (Glocke) ---------- */
.hint-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.hint {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left;
}
.hint:active { background: var(--teal-soft); }
.hint-body { display: flex; flex-direction: column; min-width: 0; }
.hint .chevron { margin-left: auto; }

/* ---------- Klasse (Schülerliste) ---------- */
.class-head { display: flex; align-items: center; gap: 14px; }
.class-head .class-icon { background: var(--surface); box-shadow: var(--shadow); }
.toolbar { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.toolbar .btn.small { padding: 6px 4px; white-space: nowrap; }
.students {
  padding: 0; list-style: none;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.student { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 14px 20px; }
.student + .student { border-top: 1px solid var(--line); }
.student::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: transparent; }
.student.has-status.s-A::before { background: var(--a); }
.student.has-status.s-F::before { background: var(--f); }
.student.has-status.s-E::before { background: var(--e); }
.student.has-status.s-V::before { background: var(--v); }
.student-name { font-weight: 700; font-size: 18px; }
.student-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.status-group { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.status {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; padding: 6px 2px;
  border: 0; border-radius: 12px; background: var(--soft);
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.status .status-icon { width: 22px; height: 22px; }
.status.s-A[aria-pressed='true'] { background: var(--a); color: #fff; }
.status.s-F[aria-pressed='true'] { background: var(--f); color: #fff; }
.status.s-E[aria-pressed='true'] { background: var(--e); color: #fff; }
.status.s-V[aria-pressed='true'] { background: var(--v); color: #fff; }
@media (min-width: 560px) {
  .student { flex-direction: row; align-items: center; justify-content: space-between; }
  .status-group { flex: 0 0 340px; }
}
.empty {
  text-align: center; color: var(--muted); padding: 32px 16px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty p { margin-bottom: 14px; }

/* ---------- Untere Leisten ---------- */
.tabbar, .savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--surface); /* fester Hintergrund: Unschärfe ruckelt beim Scrollen */
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar { display: grid; grid-template-columns: repeat(3, 1fr); }
.tab-item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabbar-h); padding: 8px 4px 6px;
  border: 0; background: transparent;
  font-size: 13px; font-weight: 700; color: #7D8A8A;
}
.tab-item .icon { width: 24px; height: 24px; }
.tab-item.active { color: var(--teal-strong); }
.tab-item.active::before {
  content: ''; position: absolute; top: 0; left: 50%;
  width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px;
  background: var(--teal);
}
.tab-item:focus-visible { outline-offset: -4px; }
.savebar { padding: 12px 16px calc(12px + var(--safe-bottom)); }
/* Speichern-Leiste sitzt direkt über der unteren Navigation */
body.has-tabbar .savebar { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: 12px; }
.savebar-inner { max-width: 528px; margin: 0 auto; }
.progress-row { margin-bottom: 8px; }
.progress-text { font-size: 14px; color: var(--muted); }
.savebar .progress { position: absolute; top: -1px; left: 0; right: 0; height: 3px; background: transparent; }
.progress-fill { height: 100%; background: var(--teal); transition: width .2s; }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--muted); }
.spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--teal);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Admin ---------- */
.admin-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.tabs { display: flex; gap: 6px; background: #E9EEEE; padding: 4px; border-radius: 12px; }
.tab {
  flex: 1; min-height: 46px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 700; font-size: 15px; color: var(--muted);
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.admin-item { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.admin-list.compact { margin-top: 12px; background: transparent; border-radius: 0; box-shadow: none; }
.admin-list.compact .admin-item { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 0; }
.admin-item-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.admin-item-main { display: flex; flex-direction: column; min-width: 0; }
.admin-item-title strong { font-size: 18px; font-weight: 700; }
.admin-item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
details summary { cursor: pointer; font-weight: 700; }

/* ---------- Bottom-Sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(15, 30, 30, .42); animation: fade .18s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; max-height: 92dvh; margin: 0 auto;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  padding: 10px 18px calc(18px + var(--safe-bottom));
  background: var(--surface); color: var(--text);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
  outline: none;
}
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: #D5DCDC; margin: 0 auto 12px; }
.sheet-title { font-size: 22px; font-weight: 800; line-height: 1.25; }
.sheet-actions { display: grid; gap: 6px; padding-top: 4px; }
.sheet-actions .btn.ghost { border: 0; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Meldung (Toast) ---------- */
.toast {
  position: fixed; left: 12px; right: 12px; z-index: 50;
  bottom: calc(24px + var(--safe-bottom));
  max-width: 536px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 14px; overflow: hidden;
  background: #1E2828; color: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden;
  transition: opacity .2s, transform .2s, visibility 0s linear .2s;
}
.toast.show { opacity: 1; transform: translateY(0); visibility: visible; transition: opacity .2s, transform .2s; }
.toast.show.has-action { pointer-events: auto; padding: 8px 8px 8px 16px; }
.toast-text { flex: 1; font-weight: 600; font-size: 16px; }
.toast-btn {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, .14); color: #7FE3DC; font-weight: 800; font-size: 16px;
}
.toast-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #7FE3DC;
  transform-origin: left; transition-property: transform; transition-timing-function: linear;
}
.toast-bar.run { transform: scaleX(0); }
.toast.error { background: var(--red-strong); }
.toast.warn { background: #7A4A00; }
body.has-tabbar .toast { bottom: calc(var(--tabbar-h) + 24px + var(--safe-bottom)); }
body.has-tabbar.has-savebar .toast { bottom: calc(var(--tabbar-h) + var(--savebar-h) + 12px + var(--safe-bottom)); }
/* Bei offenem Sheet oben anzeigen, damit die Meldung keine Knöpfe verdeckt */
body.sheet-open .toast { top: calc(12px + var(--safe-top)); bottom: auto; }

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