/* =========================================================================
   RSBS Planer – ruhiges, klares Schul-Organisationstool
   Warmes Papier · zurückhaltende Terrakotta · klare Statusfarben
   Display: Bricolage Grotesque · UI: Hanken Grotesk
   ========================================================================= */

:root {
  /* Flächen */
  --bg: #f0ece3;
  --surface: #fffdf9;
  --surface-2: #f6f1e8;
  --surface-inset: #f3eee4;

  /* Text */
  --ink: #211f1a;
  --ink-soft: #453f37;
  --muted: #7a736a;
  --faint: #9c968c;

  /* Linien */
  --line: #e7e0d3;
  --line-strong: #dbd2c1;

  /* Marke (Terrakotta) */
  --brand: #bd5b34;
  --brand-strong: #a44a26;
  --brand-soft: #f6e6da;
  --brand-tint: #fbf0e8;
  --brand-ink: #7c3417;

  /* Statusfarben */
  --ok: #3c8a5f;
  --ok-soft: #e2efe6;
  --info: #3f6fa8;
  --info-soft: #e3ebf5;
  --warn: #b07420;
  --warn-soft: #f4e9d5;
  --danger: #a8452f;
  --danger-soft: #f3e0d8;
  --neutral: #7c756c;
  --neutral-soft: #ece6da;

  /* Form */
  --r-xl: 20px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(60, 45, 25, 0.05);
  --shadow: 0 10px 30px rgba(70, 50, 25, 0.07);
  --shadow-pop: 0 18px 44px rgba(50, 35, 18, 0.16);

  --sidebar-w: 264px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -8%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(900px 500px at 108% 4%, rgba(189, 91, 52, 0.06), transparent 55%);
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Bricolage Grotesque", "Hanken Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--ink);
}

p {
  margin: 0;
}

a {
  color: var(--brand-strong);
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.hidden,
[hidden] {
  display: none !important;
}

/* =========================================================================
   Login
   ========================================================================= */

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.login-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 2.2rem 2rem;
  animation: rise 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.login-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.login-glyph {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.login-mark div p:first-child {
  font-weight: 700;
  font-size: 0.92rem;
}

.login-mark div p:last-child {
  color: var(--muted);
  font-size: 0.78rem;
}

.login-card h1 {
  font-size: 1.7rem;
  margin-bottom: 0.35rem;
}

.login-lead {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-hint {
  margin-top: 1.3rem;
  padding: 0.85rem 1rem;
  border-radius: var(--r-md);
  background: var(--brand-tint);
  border: 1px dashed rgba(189, 91, 52, 0.32);
  color: var(--brand-ink);
  font-size: 0.83rem;
  line-height: 1.5;
}

.login-hint strong {
  font-weight: 700;
}

.login-error {
  min-height: 1em;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
}

/* =========================================================================
   Grundlayout
   ========================================================================= */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1.15rem;
  background: #f7f2ea;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.3rem 0.35rem;
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.brand-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-title {
  font-size: 1.28rem;
  line-height: 1.1;
}

.nav {
  display: grid;
  gap: 0.2rem;
}

.nav-eyebrow {
  padding: 0 0.6rem;
  margin: 0.3rem 0 0.4rem;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.68rem 0.7rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-link:hover {
  background: rgba(189, 91, 52, 0.07);
  color: var(--ink);
}

.nav-link.active {
  background: var(--surface);
  color: var(--brand-strong);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: none;
  color: currentColor;
}

.nav-icon svg,
.icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link.active .nav-icon {
  color: var(--brand);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 0.75rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.user-meta {
  min-width: 0;
}

.user-meta strong {
  display: block;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta span {
  color: var(--muted);
  font-size: 0.76rem;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: start;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-ink);
  font-size: 0.72rem;
  font-weight: 700;
}

.demo-badge::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--brand);
}

/* =========================================================================
   Buttons
   ========================================================================= */

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.62rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.primary-button:hover {
  background: var(--brand-strong);
  transform: translateY(-1px);
}

.secondary-button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.secondary-button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.ghost-button {
  padding: 0.42rem 0.7rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
}

.ghost-button:hover {
  background: var(--surface-inset);
  color: var(--ink);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.full-width {
  width: 100%;
}

.danger-link {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--danger);
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
}

.danger-link:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* =========================================================================
   Hauptbereich
   ========================================================================= */

.main-content {
  padding: 1.6rem 1.9rem 3rem;
  max-width: 1240px;
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.page-title {
  font-size: 1.65rem;
}

.topbar .eyebrow {
  margin-bottom: 0.2rem;
}

.topbar-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: rise 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.section-header h3 {
  font-size: 1.28rem;
}

.section-lead {
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem;
}

.panel + .panel,
.content-grid + .panel,
.panel + .content-grid {
  margin-top: 1.1rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.panel-head h3 {
  font-size: 1.1rem;
}

.panel-head p {
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 0.15rem;
}

.content-grid {
  display: grid;
  gap: 1.1rem;
}

.content-grid.two-columns {
  grid-template-columns: 1.15fr 0.85fr;
  align-items: start;
}

/* ---------- Hero ---------- */

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.6rem 1.7rem;
  margin-bottom: 1.2rem;
  border-radius: var(--r-xl);
  color: #fef7f1;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(135deg, #b9542d 0%, #9a4322 100%);
  box-shadow: var(--shadow);
}

.hero-panel .eyebrow {
  color: rgba(255, 247, 240, 0.72);
}

.hero-panel h3 {
  color: #fff;
  font-size: 1.7rem;
  margin-bottom: 0.5rem;
}

.hero-copy {
  color: rgba(255, 247, 240, 0.86);
  max-width: 46ch;
}

.hero-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-pills span {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* ---------- KPI-Kacheln ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.stat-card {
  padding: 1.15rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.stat-card p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stat-card strong {
  display: block;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card.is-text strong {
  font-size: 1.12rem;
  line-height: 1.25;
}

/* ---------- Aktivitäten ---------- */

.activity-list,
.stack-list {
  display: grid;
  gap: 0.2rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.7rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: var(--brand);
}

.activity-item strong {
  font-weight: 600;
  font-size: 0.92rem;
}

.activity-item p {
  color: var(--faint);
  font-size: 0.78rem;
}

/* ---------- Schnellaktionen ---------- */

.quick-actions {
  display: grid;
  gap: 0.7rem;
}

.action-tile {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color 150ms ease, transform 150ms ease;
}

.action-tile:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.action-tile strong {
  font-weight: 700;
  font-size: 0.94rem;
}

.action-tile span {
  color: var(--muted);
  font-size: 0.83rem;
}

/* ---------- Datenschutz ---------- */

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.7rem;
}

.privacy-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.privacy-icon {
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  flex: none;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.8rem;
  font-weight: 700;
}

.privacy-item p {
  font-size: 0.86rem;
  color: var(--ink-soft);
}

/* =========================================================================
   Badges & Status
   ========================================================================= */

.badge-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.muted-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.muted-badge {
  background: var(--surface-inset);
  color: var(--muted);
  border: 1px solid var(--line);
}

.status-badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.active,
.status-badge.free {
  background: var(--ok-soft);
  color: var(--ok);
}

.status-badge.done,
.status-badge.booked {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-badge.reserved {
  background: var(--info-soft);
  color: var(--info);
}

.status-badge.draft,
.status-badge.pause {
  background: var(--neutral-soft);
  color: var(--neutral);
}

.status-badge.archived,
.status-badge.blocked {
  background: var(--danger-soft);
  color: var(--danger);
}

/* =========================================================================
   Abstimmungen
   ========================================================================= */

.filters {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding-bottom: 1.1rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.card-list {
  display: grid;
  gap: 1rem;
}

.list-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.list-card:hover {
  border-color: var(--line-strong);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card-head h4 {
  font-size: 1.12rem;
  margin-bottom: 0.25rem;
}

.card-head > div:first-child > p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 60ch;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin: 1rem 0;
  padding: 0.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
}

.meta-row span strong,
.meta-row b {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Balken-Diagramm */

.chart-list {
  display: grid;
  gap: 0.7rem;
}

.chart-row {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr 58px;
  align-items: center;
  gap: 1rem;
}

.chart-label {
  display: grid;
  gap: 0.1rem;
}

.chart-label strong {
  font-weight: 600;
  font-size: 0.9rem;
}

.chart-label span {
  color: var(--faint);
  font-size: 0.76rem;
}

.chart-value {
  text-align: right;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  position: relative;
  height: 0.62rem;
  border-radius: 999px;
  background: var(--surface-inset);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #d47a4a);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
}

.card-footer small {
  color: var(--faint);
  font-size: 0.78rem;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Überlaufmenü (reine HTML/CSS-Lösung) */

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.84rem;
  font-weight: 600;
  user-select: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu > summary::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
}

.menu[open] > summary {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 12;
  min-width: 190px;
  display: grid;
  gap: 0.1rem;
  padding: 0.35rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  animation: rise 140ms ease;
}

.menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.87rem;
  font-weight: 500;
}

.menu-list button:hover {
  background: var(--surface-inset);
  color: var(--ink);
}

.menu-list button.is-danger:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

/* =========================================================================
   Elternsprechtag
   ========================================================================= */

.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  user-select: none;
}

.toggle-switch input {
  width: auto;
  accent-color: var(--brand);
}

.admin-notice {
  padding: 0.85rem 1.05rem;
  margin-bottom: 1.1rem;
  border-radius: var(--r-md);
  background: var(--info-soft);
  color: #274a70;
  border: 1px solid rgba(63, 111, 168, 0.24);
  font-size: 0.87rem;
}

.planner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease;
}

.planner-card:last-child {
  margin-bottom: 0;
}

.planner-card:hover {
  border-color: var(--brand);
}

.planner-card.active {
  background: var(--brand-tint);
  border-color: rgba(189, 91, 52, 0.35);
}

.planner-card strong {
  font-weight: 700;
  font-size: 0.95rem;
}

.planner-card > div:first-child p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.1rem;
}

.planner-meta {
  display: grid;
  gap: 0.15rem;
  text-align: right;
  flex: none;
}

.planner-meta span {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.planner-meta span:first-child {
  color: var(--ok);
}

.appointment-board {
  display: grid;
  gap: 1.1rem;
}

.appointment-board.empty-state,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 1.5rem;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}

.board-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.board-header h4 {
  font-size: 1.05rem;
}

.board-header p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.notice-box {
  padding: 0.8rem 1rem;
  border-radius: var(--r-md);
  background: var(--brand-tint);
  color: var(--brand-ink);
  border: 1px solid rgba(189, 91, 52, 0.16);
  font-size: 0.86rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.slot-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  border-left: 3px solid var(--neutral);
}

.slot-card.free {
  border-left-color: var(--ok);
}

.slot-card.reserved {
  border-left-color: var(--info);
}

.slot-card.booked {
  border-left-color: var(--warn);
}

.slot-card.pause {
  border-left-color: var(--neutral);
  background: var(--surface-2);
}

.slot-card.blocked {
  border-left-color: var(--danger);
  background: var(--surface-2);
}

.slot-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.slot-top strong {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.slot-card p {
  color: var(--muted);
  font-size: 0.81rem;
  line-height: 1.45;
}

.slot-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* =========================================================================
   Vorlagen
   ========================================================================= */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, transform 150ms ease;
}

.template-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.template-card > div {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}

.template-card h4 {
  font-size: 1.08rem;
}

.template-card > div p {
  color: var(--muted);
  font-size: 0.86rem;
}

.template-card .primary-button {
  margin-top: auto;
  align-self: flex-start;
}

.template-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--surface-inset);
  color: var(--muted);
  border: 1px solid var(--line);
}

.template-tag.poll {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}

.template-tag.appointment {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}

/* =========================================================================
   Formulare
   ========================================================================= */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field,
.fieldset {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.field > span,
.fieldset > legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0;
}

.field small {
  color: var(--faint);
  font-size: 0.78rem;
}

.field.wide,
.fieldset.wide,
.form-grid > .wide {
  grid-column: 1 / -1;
}

.compact {
  min-width: 170px;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(189, 91, 52, 0.15);
}

input[type="color"] {
  padding: 0.25rem;
  height: 2.6rem;
}

textarea {
  resize: vertical;
  min-height: 3.5rem;
}

.fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.9rem;
  background: var(--surface-2);
}

.choice-grid,
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}

.choice-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.choice-row:hover {
  border-color: var(--line-strong);
}

.choice-row input {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

.choice-row.toggle {
  justify-content: flex-start;
}

.error-text {
  min-height: 1em;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
}

/* =========================================================================
   Modal
   ========================================================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(33, 27, 20, 0.5);
  animation: fade 160ms ease;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  animation: rise 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 1.2rem;
}

.modal-content {
  margin: 1.2rem 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* =========================================================================
   Toasts
   ========================================================================= */

.toast-root {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 60;
  display: grid;
  gap: 0.6rem;
}

.toast {
  padding: 0.75rem 1.05rem;
  border-radius: var(--r-md);
  background: var(--ink);
  color: #fdf6ee;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 200ms ease, opacity 200ms ease;
}

.toast::before {
  content: "✓ ";
  color: #8fd3a8;
  font-weight: 700;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

/* =========================================================================
   Animation & Responsive
   ========================================================================= */

.mobile-only {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid.two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 84vw);
    z-index: 50;
    transform: translateX(-102%);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-pop);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    padding: 1.1rem 1.1rem 2.5rem;
  }

  .mobile-only {
    display: inline-flex;
  }

  .form-grid,
  .chart-row {
    grid-template-columns: 1fr;
  }

  .chart-value {
    text-align: left;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

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

  .hero-panel {
    padding: 1.3rem;
  }
}

/* =========================================================================
   Öffentliche Startseite
   ========================================================================= */

.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 1.5rem;
  background: rgba(247, 242, 234, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.1) blur(6px);
}

.public-topbar .brand-glyph {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.public-topbar .secondary-button {
  padding: 0.5rem 0.9rem;
  font-size: 0.86rem;
}

.brand-title-sm {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.btn-icon {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.8rem 1.6rem 3rem;
  flex: 1;
}

/* ---------- Hero mit Schulbild ---------- */

.hero-banner {
  position: relative;
  isolation: isolate;
  min-height: clamp(190px, 27vh, 300px);
  display: flex;
  align-items: flex-end;
  padding: 1.7rem 1.5rem;
  overflow: hidden;
  background-image: url("../assets/schule.jpg");
  background-size: cover;
  background-position: 22% 74%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(24, 17, 12, 0.15) 0%, rgba(24, 17, 12, 0) 32%),
    linear-gradient(75deg, rgba(20, 13, 9, 0.82) 8%, rgba(28, 18, 12, 0.5) 46%, rgba(28, 18, 12, 0.12) 78%);
}

.hero-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  color: #fff;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}

.hero-text {
  min-width: 0;
}

/* Schulsprechtag-Button über dem Bild */
.hero-cta {
  flex: none;
  display: grid;
  gap: 0.15rem;
  width: min(15rem, 42vw);
  padding: 0.85rem 1rem;
  text-align: left;
  color: #fff;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(150deg, rgba(189, 91, 52, 0.92), rgba(150, 63, 33, 0.86));
  box-shadow: 0 12px 30px rgba(20, 12, 8, 0.4);
  backdrop-filter: blur(3px);
  text-shadow: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 36px rgba(20, 12, 8, 0.5);
}

.hero-cta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.hero-cta-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-cta-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-cta-label {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.hero-cta-sub {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.hero-cta-arrow {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 150ms ease;
}

.hero-cta:hover .hero-cta-arrow {
  transform: translateX(3px);
}

@media (max-width: 620px) {
  .hero-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta {
    width: 100%;
  }
}

.hero-kicker {
  margin: 0 0 0.25rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 244, 236, 0.88);
}

.hero-title {
  color: #fff;
  font-size: clamp(1.7rem, 4.3vw, 2.9rem);
  line-height: 1.06;
  margin-bottom: 0.5rem;
  max-width: 20ch;
}

.hero-sub {
  max-width: 56ch;
  color: rgba(255, 248, 242, 0.92);
  font-size: clamp(0.92rem, 1.3vw, 1.08rem);
  line-height: 1.45;
}

.public-block {
  margin-bottom: 2rem;
}

.public-block .section-header h2 {
  font-size: 1.3rem;
}

.public-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.public-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, transform 150ms ease;
}

.public-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.public-card h3 {
  font-size: 1.15rem;
}

.public-card-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.public-card-teacher {
  font-weight: 700;
  color: var(--brand-strong);
  font-size: 0.9rem;
}

/* ---------- Kategorie-Badges ---------- */

.kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.62rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.kind-badge.umfrage {
  background: var(--info-soft);
  color: var(--info);
}

.kind-badge.abfrage {
  background: var(--warn-soft);
  color: var(--warn);
}

.kind-badge.termin {
  background: var(--ok-soft);
  color: var(--ok);
}

.kind-badge.schoolwide {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.card-note {
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-sm);
  background: var(--surface-inset);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 0.8rem;
}

.slot-summary {
  font-size: 0.86rem;
  color: var(--muted);
}

.slot-summary strong {
  color: var(--ok);
  font-weight: 700;
}

/* ---------- Schulweiter Bereich ---------- */

.schoolwide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.public-card.highlight {
  border-color: rgba(189, 91, 52, 0.4);
  background:
    linear-gradient(180deg, var(--brand-tint), var(--surface) 42%);
  box-shadow: var(--shadow);
}

/* ---------- Schulsprechtag: Zurück-Link, Verzeichnis, Board ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
  padding: 0.5rem 0.85rem 0.5rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 600;
}

.back-link svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-link:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.back-link.subtle {
  border: none;
  background: transparent;
  padding-left: 0;
}

.school-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.3rem;
}

.school-head .kind-badge {
  justify-self: start;
}

.school-head h2 {
  font-size: 1.5rem;
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.8rem;
}

.teacher-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.teacher-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.teacher-card.is-primary {
  border-color: rgba(189, 91, 52, 0.42);
  background: linear-gradient(180deg, var(--brand-tint), var(--surface) 60%);
}

.teacher-avatar {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.teacher-avatar.lg {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.25rem;
}

.teacher-info {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  flex: 1;
}

.teacher-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
}

.teacher-sub {
  color: var(--muted);
  font-size: 0.8rem;
}

.teacher-free {
  flex: none;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.76rem;
  font-weight: 700;
}

.teacher-free.none {
  background: var(--danger-soft);
  color: var(--danger);
}

.teacher-board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem;
}

.teacher-board-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.teacher-board-head h2 {
  font-size: 1.35rem;
}

.teacher-board-head p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.teacher-board-head p strong {
  color: var(--ok);
}

.teacher-board .notice-box,
.teacher-board .card-note {
  margin-bottom: 1rem;
}

.slot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.slot-line {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  border-left: 3px solid var(--neutral);
}

.slot-line.free {
  border-left-color: var(--ok);
}

.slot-line.booked {
  border-left-color: var(--warn);
  background: var(--surface-2);
}

.slot-line.pause {
  border-left-color: var(--neutral);
  background: var(--surface-2);
}

.slot-line-time {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 7rem;
}

.slot-line .status-badge {
  margin-right: auto;
}

.slot-book {
  padding: 0.4rem 0.9rem;
  font-size: 0.84rem;
}

/* ---------- Klassen-Navigation ---------- */

.class-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 1.2rem;
  align-items: start;
}

.class-nav {
  position: sticky;
  top: 66px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.class-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0.6rem 0.8rem 0.6rem 0.95rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

/* Akzent-Leiste links */
.class-btn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
  transition: height 160ms ease;
}

.class-btn:hover:not(:disabled) {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.class-btn:hover:not(:disabled)::before,
.class-btn.active::before {
  height: 58%;
}

.class-btn.active {
  background: var(--brand-tint);
  border-color: rgba(189, 91, 52, 0.42);
}

.class-btn .class-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.class-btn.active .class-name {
  color: var(--brand-strong);
}

/* Zähler-Badge für Klassen mit Einträgen */
.class-btn .class-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.class-btn.active .class-hint {
  background: var(--brand);
  color: #fff;
}

.class-btn.is-empty {
  background: var(--surface-2);
  border-style: dashed;
  cursor: not-allowed;
}

.class-btn.is-empty .class-name {
  color: var(--faint);
}

.class-btn.is-empty .class-hint {
  background: transparent;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
}

/* ---------- Klasseninhalt ---------- */

.class-content {
  min-width: 0;
  display: grid;
  gap: 1.6rem;
}

.class-content-head h3 {
  font-size: 1.35rem;
}

.class-group-head {
  margin-bottom: 0.8rem;
}

.class-group-head h3 {
  font-size: 1.08rem;
}

.class-group-head p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.1rem;
}

@media (max-width: 860px) {
  .class-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .class-nav {
    position: static;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.5rem;
  }

  .class-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 62px;
    padding: 0.55rem 0.4rem;
    text-align: center;
  }

  .class-btn::before {
    display: none;
  }

  .class-btn .class-name {
    font-size: 1.18rem;
  }
}

.public-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  color: var(--faint);
  font-size: 0.82rem;
}

.public-card-foot {
  margin-top: auto;
  padding-top: 0.4rem;
}

.public-card-foot .primary-button {
  width: 100%;
}

.public-card-foot .primary-button:disabled {
  background: var(--neutral-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.public-footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.84rem;
}

/* Mini-Ergebnisse in öffentlichen Karten */

.mini-results {
  display: grid;
  gap: 0.4rem;
  padding: 0.2rem 0;
}

.mini-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.mini-label {
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Slot-Pills */

.slot-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.slot-pill {
  padding: 0.22rem 0.55rem;
  border-radius: 7px;
  background: var(--surface-inset);
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-decoration: line-through;
}

.slot-pill.free {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
  text-decoration: none;
  font-weight: 600;
}

.slot-pill.more {
  text-decoration: none;
  background: transparent;
  border-style: dashed;
}

/* =========================================================================
   Zugangscodes & QR
   ========================================================================= */

.code-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--brand-tint);
  border: 1px dashed rgba(189, 91, 52, 0.3);
  color: var(--brand-ink);
  font-size: 0.85rem;
}

.code-hint span {
  font-weight: 600;
}

.code-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.code-chip {
  padding: 0.24rem 0.55rem;
  border-radius: 7px;
  background: var(--surface-inset);
  border: 1px solid var(--line-strong);
  font-family: "Hanken Grotesk", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.access-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.access-panel small {
  display: block;
  margin-top: 0.35rem;
  color: var(--faint);
  font-size: 0.78rem;
}

.qr-box {
  flex: none;
  width: 84px;
  height: 84px;
  padding: 7px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
}

.qr {
  width: 100%;
  height: 100%;
  fill: var(--ink);
}

/* =========================================================================
   Teilnahme-Dialoge
   ========================================================================= */

/* Buchungsblöcke untereinander – bessere Übersicht für Eltern */
.slot-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.slot-radio {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

.slot-radio input {
  width: auto;
  margin: 0;
  accent-color: var(--brand);
}

.slot-radio-time {
  font-weight: 600;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.slot-radio small {
  margin-left: auto;
  color: var(--faint);
  font-weight: 500;
  font-size: 0.76rem;
}

.slot-radio:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-tint);
}

/* =========================================================================
   Admin: Monitor, Karten-Fußzeile, Blockplaner
   ========================================================================= */

.monitor-row {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.monitor-row:last-child {
  border-bottom: none;
}

.monitor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.monitor-head strong {
  font-size: 0.92rem;
  font-weight: 600;
}

.monitor-head span {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.monitor-row small {
  color: var(--faint);
  font-size: 0.78rem;
}

.card-foot-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.card-foot-line small {
  color: var(--faint);
  font-size: 0.78rem;
}

/* Blockplaner */

.block-planner .quick-gen {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px dashed var(--line-strong);
}

.block-planner .quick-gen .field {
  min-width: 90px;
}

.block-list {
  display: grid;
  gap: 0.4rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.block-row {
  display: grid;
  grid-template-columns: 92px 1fr 1.1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.block-row.is-pause {
  background: var(--surface-inset);
  border-style: dashed;
}

.block-time {
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.block-row input,
.block-row select {
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}

.block-remove {
  width: 1.9rem;
  height: 1.9rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  font-size: 0.9rem;
}

.block-remove:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.block-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.block-summary {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 620px) {
  .block-row {
    grid-template-columns: 74px 1fr 1fr auto;
  }

  .access-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}

.reset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.reset-row strong {
  display: block;
  font-size: 0.9rem;
}

.reset-row small {
  color: var(--muted);
  font-size: 0.8rem;
}

/* =========================================================================
   Druck
   ========================================================================= */

/* =========================================================================
   Touch / iPad – größere Tap-Flächen, ruhigere Effekte
   ========================================================================= */

@media (pointer: coarse) {
  .primary-button,
  .secondary-button {
    min-height: 44px;
  }

  .ghost-button,
  .danger-link,
  .menu > summary {
    min-height: 40px;
  }

  .nav-link {
    padding: 0.82rem 0.7rem;
  }

  .icon-button {
    width: 2.8rem;
    height: 2.8rem;
  }

  .slot-radio,
  .choice-row,
  .class-btn {
    min-height: 48px;
  }

  /* Auf Touch keine Hover-Verschiebung „hängen" lassen */
  .public-card:hover,
  .class-btn:hover:not(:disabled),
  .template-card:hover,
  .primary-button:hover,
  .action-tile:hover {
    transform: none;
  }

  input,
  select,
  textarea {
    font-size: 16px; /* verhindert Auto-Zoom auf iOS/iPadOS */
  }
}

/* iPad-Querformat und ähnliche Breiten */
@media (min-width: 861px) and (max-width: 1100px) {
  .public-main {
    padding: 1.5rem 1.4rem 3rem;
  }

  .class-layout {
    grid-template-columns: 184px 1fr;
    gap: 1rem;
  }

  .schoolwide-grid,
  .public-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .section:not(#section-appointments),
  .inline-actions,
  .slot-actions,
  .admin-notice,
  .board-header .inline-actions,
  .toast-root,
  #loginView {
    display: none !important;
  }

  .main-content {
    padding: 0;
    max-width: none;
  }

  .panel,
  .slot-card,
  .appointment-board {
    box-shadow: none;
    border-color: #ddd;
  }
}
