* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --text: #1a1d27;
  --muted: #8a91a3;
  --border: #e8eaf2;
  --border-soft: #f0f2f8;
  --surface: #fafbfe;
  --surface-2: #eef0fb;
  --hover: #fafbff;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --ring: 0 0 0 3px rgba(99, 102, 241, .16);
  --written: #eef2ff;
  --oral: #ecfdf5;
  --oral-strong: #e6faf1;
  --final: #fff8ec;
  --shadow-sm: 0 1px 2px rgba(23, 25, 35, .06);
  --shadow-md: 0 8px 28px -10px rgba(23, 25, 35, .16);
  --radius: 16px;
  --glow1: rgba(139, 92, 246, .07);
  --glow2: rgba(99, 102, 241, .06);
}

body.dark {
  --bg: #020617;
  --card: #0f172a;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: #475569;
  --border-soft: #334155;
  --surface: #111827;
  --surface-2: #1e293b;
  --hover: #243044;
  --primary: #93c5fd;
  --primary-dark: #dbeafe;
  --ring: 0 0 0 3px rgba(147, 197, 253, .28);
  --written: #172554;
  --oral: #064e3b;
  --oral-strong: #065f46;
  --final: #78350f;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, .55);
  --glow1: rgba(139, 92, 246, .10);
  --glow2: rgba(99, 102, 241, .08);
}

body[data-theme="emerald"] { --primary:#10b981; --primary-dark:#059669; --grad:linear-gradient(135deg,#10b981,#14b8a6); --glow1:rgba(16,185,129,.08); --glow2:rgba(20,184,166,.07); }
body[data-theme="rose"] { --primary:#f43f5e; --primary-dark:#e11d48; --grad:linear-gradient(135deg,#f43f5e,#ec4899); --glow1:rgba(244,63,94,.08); --glow2:rgba(236,72,153,.07); }
body[data-theme="amber"] { --primary:#f59e0b; --primary-dark:#d97706; --grad:linear-gradient(135deg,#f59e0b,#ef4444); --glow1:rgba(245,158,11,.08); --glow2:rgba(239,68,68,.06); }
body[data-theme="cyan"] { --primary:#06b6d4; --primary-dark:#0891b2; --grad:linear-gradient(135deg,#06b6d4,#3b82f6); --glow1:rgba(6,182,212,.08); --glow2:rgba(59,130,246,.07); }
body[data-theme="slate"] { --primary:#64748b; --primary-dark:#475569; --grad:linear-gradient(135deg,#475569,#94a3b8); --glow1:rgba(100,116,139,.08); --glow2:rgba(148,163,184,.06); }
body[data-theme="grape"] { --primary:#a855f7; --primary-dark:#9333ea; --grad:linear-gradient(135deg,#a855f7,#6366f1); --glow1:rgba(168,85,247,.09); --glow2:rgba(99,102,241,.07); }
body[data-theme="lime"] { --primary:#84cc16; --primary-dark:#65a30d; --grad:linear-gradient(135deg,#84cc16,#22c55e); --glow1:rgba(132,204,22,.08); --glow2:rgba(34,197,94,.06); }
body[data-theme="coral"] { --primary:#fb7185; --primary-dark:#f97316; --grad:linear-gradient(135deg,#fb7185,#f97316); --glow1:rgba(251,113,133,.08); --glow2:rgba(249,115,22,.06); }
body[data-theme="mono"] { --primary:#111827; --primary-dark:#111827; --grad:linear-gradient(135deg,#111827,#6b7280); --glow1:rgba(17,24,39,.06); --glow2:rgba(107,114,128,.05); }
body.dark[data-theme="indigo"] { --primary:#a5b4fc; --primary-dark:#e0e7ff; --grad:linear-gradient(135deg,#818cf8,#c4b5fd); }
body.dark[data-theme="emerald"] { --primary:#34d399; --primary-dark:#d1fae5; --grad:linear-gradient(135deg,#10b981,#2dd4bf); }
body.dark[data-theme="rose"] { --primary:#fb7185; --primary-dark:#ffe4e6; --grad:linear-gradient(135deg,#fb7185,#f472b6); }
body.dark[data-theme="amber"] { --primary:#fbbf24; --primary-dark:#fef3c7; --grad:linear-gradient(135deg,#f59e0b,#fb7185); }
body.dark[data-theme="cyan"] { --primary:#67e8f9; --primary-dark:#cffafe; --grad:linear-gradient(135deg,#22d3ee,#60a5fa); }
body.dark[data-theme="slate"] { --primary:#cbd5e1; --primary-dark:#f8fafc; --grad:linear-gradient(135deg,#64748b,#e2e8f0); }
body.dark[data-theme="grape"] { --primary:#d8b4fe; --primary-dark:#f3e8ff; --grad:linear-gradient(135deg,#c084fc,#818cf8); }
body.dark[data-theme="lime"] { --primary:#bef264; --primary-dark:#ecfccb; --grad:linear-gradient(135deg,#a3e635,#34d399); }
body.dark[data-theme="coral"] { --primary:#fda4af; --primary-dark:#ffe4e6; --grad:linear-gradient(135deg,#fb7185,#fdba74); }
body.dark[data-theme="mono"] { --primary:#d1d5db; --primary-dark:#f9fafb; --grad:linear-gradient(135deg,#4b5563,#d1d5db); }

/* Hintergrund-/Oberflaechen-Themes (data-surface), unabhaengig von Akzentfarbe (data-theme) und Dark-Mode */
body[data-surface="warm"] { --bg:#f7f3ea; --card:#fffdf8; --surface:#fbf8f1; --surface-2:#f1ebdd; --border:#e8e0cf; --border-soft:#f0ead9; --hover:#fbf7ee; }
body[data-surface="kuehl"] { --bg:#eef2f7; --card:#ffffff; --surface:#f6f9fc; --surface-2:#e3eaf2; --border:#dbe4ee; --border-soft:#e9eff6; --hover:#f3f7fb; }
body[data-surface="mint"] { --bg:#eef6f1; --card:#ffffff; --surface:#f5faf7; --surface-2:#e2f0e8; --border:#d8e8de; --border-soft:#e7f1ea; --hover:#f2f8f4; }
body[data-surface="rose"] { --bg:#f8f1f3; --card:#fffbfc; --surface:#fbf6f7; --surface-2:#f2e4e8; --border:#ecdce1; --border-soft:#f3e8eb; --hover:#faf4f6; }
body[data-surface="kontrast"] { --bg:#ffffff; --card:#ffffff; --surface:#fafafa; --surface-2:#f0f0f0; --border:#d9d9d9; --border-soft:#ececec; --hover:#f7f7f7; }
body.dark[data-surface="warm"] { --bg:#171310; --card:#201a15; --surface:#1b1611; --surface-2:#2a221b; --border:#3d332a; --hover:#251e18; }
body.dark[data-surface="kuehl"] { --bg:#0d1420; --card:#131c2b; --surface:#101825; --surface-2:#1a2536; --border:#2a3a52; --hover:#16202f; }
body.dark[data-surface="mint"] { --bg:#0d1713; --card:#12201a; --surface:#101b16; --surface-2:#1a2b23; --border:#2a4237; --hover:#152520; }
body.dark[data-surface="rose"] { --bg:#170f12; --card:#201519; --surface:#1b1215; --surface-2:#2b1d23; --border:#42303a; --hover:#241820; }
body.dark[data-surface="oled"] { --bg:#000000; --card:#0d0d0f; --surface:#0a0a0c; --surface-2:#17171a; --border:#26262b; --hover:#111114; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, var(--glow1), transparent 60%),
    radial-gradient(900px 400px at -10% 0%, var(--glow2), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  min-height: 100vh;
  transition: background .3s, color .3s;
}

.hidden { display: none !important; }
.mobile-only-action { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: #dc2626; min-height: 1.2em; margin-top: 8px; font-size: 13.5px; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: 3px;
  box-shadow: var(--ring);
}

:where(button, a).btn:focus-visible,
.side-link:focus-visible,
.tab:focus-visible,
.settings-tabs button:focus-visible,
.segmented button:focus-visible,
.pbtn:focus-visible {
  outline-offset: 4px;
}
.pwa-status {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%);
  z-index: 160; background: var(--card); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700;
}
.pwa-status.offline { background: #7f1d1d; color: #fff; border-color: #991b1b; }
.pwa-status.online { background: #065f46; color: #fff; border-color: #047857; }

@media (display-mode: standalone) {
  body { overscroll-behavior: contain; }
  header { padding-top: max(11px, env(safe-area-inset-top)); }
}

/* ---------- Animationen ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.card, .tile, .class-card { animation: fadeInUp .28s ease both; }
.table-wrap { animation: fadeIn .18s ease both; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Beamer-Modus: Noten verbergen ---------- */
body.privacy .grade-input,
body.privacy td.avg-col,
body.privacy td.final-col,
body.privacy td.oral-total,
body.privacy .oral-cell,
body.privacy .check-cell,
body.privacy .quota,
body.privacy .tile-value,
body.privacy .trend-svg,
body.privacy .dist-row,
body.privacy .seat-tally,
body.privacy .ha-status,
body.privacy .seat-actions2,
body.privacy .detail-table,
body.privacy .stats-row td:not(.sticky-col) {
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}

/* ---------- Auth ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-box {
  background: var(--card); padding: 44px 40px; border-radius: 22px;
  box-shadow: var(--shadow-md); width: 380px; text-align: center;
  border: 1px solid var(--border); animation: fadeInUp .35s ease both;
}
.auth-box h1 { font-size: 22px; margin-bottom: 10px; letter-spacing: -.02em; }
.auth-box h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.auth-brand {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 18px;
}
.auth-box p { margin-bottom: 20px; color: var(--muted); font-size: 14px; }
.auth-box input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; font-size: 15px; margin-bottom: 14px; background: var(--surface);
  color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.auth-box input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.auth-box .btn { width: 100%; padding: 11px; }
.auth-setup-profile {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
}
.auth-profile-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin: 12px 0 14px;
  text-align: left;
}
.auth-profile-card > span {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-weight: 850;
}
.auth-profile-card strong { display: block; }
.auth-profile-card small { display: block; color: var(--muted); margin-top: 2px; }

/* ---------- App-Shell ---------- */
#view-main {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--bg);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 18px 20px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  border-right: 1px solid var(--border);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #00897b;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 137, 123, .25);
}
.brand-block strong { display: block; font-size: 17px; letter-spacing: -.03em; }
.brand-block span { color: var(--muted); font-size: 13px; }
.side-section {
  margin: 0 10px 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11px;
  font-weight: 800;
}
.side-link {
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  min-height: 44px;
  border-radius: 13px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}
.side-link span {
  width: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--text) 66%, var(--muted));
}
.app-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: block;
}
.icon-btn {
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn .app-icon,
.status-pill .app-icon,
.class-next .app-icon {
  width: 16px;
  height: 16px;
}
.side-link:hover { background: var(--surface); }
.side-link.active {
  background: color-mix(in srgb, #2dd4bf 20%, var(--card));
  color: #00796b;
}
body.dark .side-link.active {
  background: rgba(45, 212, 191, .16);
  color: #99f6e4;
}
.context-section { margin-top: 18px; }
.side-hint {
  margin: -3px 10px 5px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.side-link.locked {
  opacity: .48;
  cursor: not-allowed;
}
.side-link:disabled {
  pointer-events: none;
}
.side-link.locked:hover { background: transparent; }
.side-link.class-context-link.active {
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
  color: var(--primary-dark);
}
.side-spacer { flex: 1; }
.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.profile-chip > span {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #ccfbf1;
  color: #00796b;
  font-weight: 800;
}
.profile-chip strong { display: block; font-size: 13px; }
.profile-chip small { display: block; color: var(--muted); font-size: 12px; }
.app-main { min-width: 0; }

/* ---------- Kopfzeile ---------- */
header {
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
header h1 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 10px; background: var(--grad);
  font-size: 16px; box-shadow: 0 3px 10px -2px rgba(99, 102, 241, .5);
}
#breadcrumb { flex: 1; }
#breadcrumb a {
  color: var(--primary-dark); text-decoration: none; font-size: 13.5px; font-weight: 500;
  padding: 6px 12px; border-radius: 99px; background: var(--surface-2);
}
#breadcrumb a:hover { filter: brightness(.97); }
.icon-btn { padding: 6px 11px; font-size: 14px; }
.icon-btn[aria-label] { position: relative; }
.icon-btn[aria-label]:hover::after,
.icon-btn[aria-label]:focus-visible::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  max-width: 220px;
  width: max-content;
  padding: 6px 9px;
  border-radius: 8px;
  background: var(--text);
  color: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.25;
  white-space: normal;
  pointer-events: none;
}
.icon-btn.active { background: var(--grad); color: #fff; border-color: transparent; }
.btn.active { background: var(--grad); color: #fff; border-color: transparent; }
body.dark a,
body.dark .col-actions a,
body.dark .row-actions a,
body.dark .seat-actions2 a,
body.dark .mini-edit,
body.dark .seat-unassign {
  color: var(--primary-dark);
}
body.dark .col-actions a,
body.dark .row-actions a,
body.dark .cell-flags a,
body.dark .seat-actions2 a,
body.dark .seat-unassign {
  opacity: .92;
  text-shadow: 0 0 10px rgba(219, 234, 254, .22);
}
body.dark .col-actions a:hover,
body.dark .row-actions a:hover,
body.dark .cell-flags a:hover,
body.dark .seat-actions2 a:hover,
body.dark .seat-unassign:hover {
  opacity: 1;
}
body.dark .muted,
body.dark .student-mail,
body.dark .note-preview,
body.dark .quota,
body.dark .col-meta,
body.dark .seat-first {
  color: #cbd5e1;
}

@media (max-width: 920px) {
  #view-main { grid-template-columns: 1fr; overflow-x: hidden; }
  .app-sidebar {
    position: sticky;
    z-index: 30;
    height: auto;
    top: 0;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    scrollbar-width: thin;
  }
  .brand-block { margin: 0 10px 0 0; min-width: max-content; }
  .brand-block span, .side-section, .profile-chip, .side-spacer, .side-hint, .class-context-link { display: none; }
  .side-link { width: auto; min-width: max-content; padding: 9px 11px; }
  .app-main { max-width: 100vw; overflow-x: hidden; }
  header {
    top: 63px;
    max-width: 100vw;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  #view-dashboard, #view-classes, #view-class, #view-timetable { padding: 20px 14px; }
  .class-overview-head { flex-direction: column; align-items: stretch; }
  .class-overview-actions { width: 100%; }
  .class-search { min-width: 0; width: 100%; }
  .gf-page-head { flex-direction: column; align-items: stretch; }
  .gf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .gf-kpis { grid-template-columns: 1fr; }
  .gf-kpis article { min-width: 0; }
  .gf-kpis span, .gf-kpis small { overflow-wrap: anywhere; }
  header h1 { min-width: max-content; }
  .class-grid { grid-template-columns: 1fr; }
}

/* ---------- Noturio polish pass: Arbeitsflächen ---------- */
#tab-content {
  min-height: 360px;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: var(--surface-2);
}

.tab {
  font-weight: 700;
  border-radius: 11px;
  min-height: 40px;
}

.tab.active {
  color: #00796b;
  font-weight: 850;
}

.tab-toolbar {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.table-wrap,
.student-table,
.detail-table,
.conference-table {
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.table-wrap th,
.student-table th,
.detail-table th,
.conference-table th {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
}

.table-wrap td,
.student-table td,
.detail-table td,
.conference-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.grade-input {
  border-radius: 10px;
  font-weight: 750;
}

.oral-cell,
.check-cell,
.avg-col,
.final-col {
  font-weight: 700;
}

.final-col {
  background: color-mix(in srgb, #fef3c7 45%, var(--card));
}

.lesson-card {
  border-radius: 18px;
  padding: 18px 20px;
  border-color: var(--border);
}

.lesson-date {
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 850;
}

.lesson-topic {
  letter-spacing: -.01em;
}

.lesson-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface);
}

.seat-grid-board,
.seat-free-board {
  background-color: var(--card);
  border-radius: 22px;
  border-color: var(--border);
}

.seat-free-board {
  box-shadow: var(--shadow-md);
}

.seat {
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
}

.seat:hover {
  box-shadow: var(--shadow-sm);
}

.seat.selected {
  border-color: #00897b;
  background: color-mix(in srgb, #2dd4bf 14%, var(--card));
}

.unseated {
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--card);
}

.chip {
  border-radius: 999px;
}

.two-col {
  gap: 20px;
}

.note-editor-row textarea,
#import-area,
#ic-area {
  border-radius: 14px;
}

.conference-head,
.settings-head {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

body.dark .lesson-date {
  background: rgba(45, 212, 191, .16);
  color: #99f6e4;
}

body.dark .final-col {
  background: rgba(251, 191, 36, .12);
}

#view-dashboard, #view-classes, #view-class, #view-timetable { padding: 28px 32px; max-width: 1540px; margin: 0 auto; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.toolbar h2 { font-size: 21px; letter-spacing: -.02em; }
#view-class > .toolbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
#class-title { display: flex; flex-direction: column; gap: 3px; font-size: 24px; letter-spacing: -.04em; }
#class-title small { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }

/* ---------- Heute / Dashboard ---------- */
.gf-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.gf-page-head h2 { font-size: 28px; letter-spacing: -.04em; margin-bottom: 2px; }
.gf-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.gf-kpis article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 17px 18px;
  box-shadow: var(--shadow-sm);
}
.gf-kpis span, .gf-kpis small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.gf-kpis strong { display: block; margin: 5px 0 2px; font-size: 25px; letter-spacing: -.04em; }
.gf-dashboard .dash-card { min-height: 170px; }
.dashboard-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start;
}
.dash-hero {
  grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 18px;
  align-items: flex-end; padding: 24px; border-radius: 20px;
  background: var(--grad); color: #fff; box-shadow: var(--shadow-md);
}
.dash-hero h3 { font-size: 28px; margin: 4px 0 6px; letter-spacing: -.02em; }
.dash-hero p { max-width: 720px; color: rgba(255,255,255,.86); }
.dash-date { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.dash-hero .btn:not(.primary) { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.dash-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); animation: fadeInUp .24s ease both;
}
.dash-card h3 { font-size: 16px; margin-bottom: 12px; }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.quick-class-list, .dash-task-list, .today-event-list, .roadmap-list {
  display: flex; flex-direction: column; gap: 8px;
}
.quick-class-list button, .dash-task-list button {
  width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); padding: 10px 12px; cursor: pointer;
}
.quick-class-list button:hover, .dash-task-list button:hover { border-color: var(--primary); background: var(--hover); }
.quick-class-list strong { display: block; margin-bottom: 2px; }
.quick-class-list span { color: var(--muted); font-size: 12.5px; }
.today-event {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface);
}
.today-event.matched { border-color: var(--primary); }
.today-event strong, .today-event span, .today-event small { display: block; }
.today-event strong { color: var(--primary-dark); font-size: 12.5px; margin-bottom: 2px; }
.today-event small { color: var(--muted); margin-top: 2px; }
.roadmap-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 12px;
}
.roadmap-item.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.roadmap-item p { margin-top: 3px; color: var(--muted); font-size: 12.5px; white-space: normal; }
.roadmap-item span {
  flex-shrink: 0; border-radius: 999px; padding: 3px 8px; background: var(--surface-2);
  color: var(--primary-dark); font-size: 11px; font-weight: 700;
}
.roadmap-list.compact .roadmap-item:nth-child(n+5) { display: none; }
.change-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.change-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  background: var(--surface); display: flex; flex-direction: column; gap: 3px;
}
.change-item span { color: var(--muted); font-size: 12.5px; }

/* ---------- Konferenz ---------- */
.conference-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 14px;
}
.conference-head strong, .conference-head span { display: block; }
.conference-head span { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.conference-table td.wrap {
  white-space: normal; min-width: 220px; max-width: 360px; line-height: 1.35;
}
.conference-table th, .conference-table td { padding: 7px 9px; }
.conf-bad { color: #dc2626; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--card); cursor: pointer; font-size: 13.5px; font-weight: 500;
  color: var(--text); box-shadow: var(--shadow-sm);
  min-height: 40px;
  transition: transform .12s, box-shadow .12s, background .12s, border-color .12s, filter .12s;
}
.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: .55;
}
.btn:hover { border-color: var(--primary); background: var(--hover); transform: translateY(-1px); }
.btn:disabled:hover,
button:disabled:hover {
  transform: none;
  border-color: var(--border);
  background: var(--card);
}
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--grad); border: none; color: #fff; }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 4px 14px -4px rgba(99, 102, 241, .5); }
.btn.small { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.danger { color: #dc2626; border-color: #fecaca; margin-left: auto; }
.btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
body.dark .btn.danger:hover { background: #331414; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- Klassen-Karten ---------- */
.class-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.class-overview-title h2 { font-size: 26px; letter-spacing: -.04em; margin-bottom: 3px; }
.class-overview-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.class-search {
  min-width: 310px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.class-filterbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 0 20px;
  border-top: 1px solid var(--border-soft);
}
.class-filterbar > div { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 8px 13px;
  background: #dcfce7;
  color: #166534;
  font-weight: 750;
  font-size: 13px;
}
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 20px; }
.class-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  position: relative; overflow: hidden;
}
.class-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary); }
.class-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 20px; }
.subject-chip, .class-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 800;
}
.subject-chip::before, .class-status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.subject-chip { background: #dbeafe; color: #2563eb; }
.subject-chip.c1 { background:#ccfbf1; color:#0f766e; }
.subject-chip.c2 { background:#dcfce7; color:#166534; }
.subject-chip.c3 { background:#fef3c7; color:#92400e; }
.subject-chip.c4 { background:#fce7f3; color:#9d174d; }
.subject-chip.c5 { background:#ede9fe; color:#6d28d9; }
.class-status-chip { background: #dcfce7; color: #166534; }
.class-status-chip.warn { background: #ffedd5; color: #9a3412; }
.class-card h3 { margin: 0 0 5px; font-size: 22px; letter-spacing: -.04em; }
.class-card p { font-size: 13.5px; color: var(--muted); }
.class-card p:first-of-type { color: var(--text); font-weight: 500; margin-bottom: 6px; }
.class-card-rule { height: 1px; background: var(--border-soft); margin: 18px 0 14px; }
.class-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.class-metric span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; }
.class-metric b { display: block; font-size: 19px; margin-top: 4px; letter-spacing: -.03em; }
.class-next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}
.class-next strong { color: var(--text); }
.class-card.archived { opacity: .55; }
.class-list-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.class-card.compact {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) minmax(160px, .9fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}
.class-card.compact .class-card-top,
.class-card.compact .class-card-rule { display: none; }
.class-card.compact h3 { margin: 0; font-size: 18px; }
.class-card.compact p { margin: 0; }
.class-card.compact .class-metrics {
  grid-template-columns: repeat(3, minmax(68px, 1fr));
  margin: 0;
}
.class-card.compact .class-next {
  justify-content: flex-end;
  gap: 8px;
}
.class-next {
  gap: 8px;
}
.class-next .app-icon {
  color: var(--muted);
}
.class-next span:last-child { color: var(--text); font-weight: 650; }
.class-overview-head.modern {
  gap: 18px;
  align-items: center;
}
.class-search-wrap {
  min-width: min(360px, 100%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.class-search-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  min-width: 230px;
  padding: 11px 0;
  font: inherit;
}
.class-filterbar.modern {
  justify-content: space-between;
  align-items: center;
}
.class-filterbar select {
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
  font-weight: 650;
}
.grade-filter button,
.compact-toggle button {
  min-width: 86px;
}
.class-add-card {
  min-height: 170px;
  border: 2px dashed var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  color: var(--muted);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  font: inherit;
  cursor: pointer;
}
.class-add-card .app-icon {
  width: 28px;
  height: 28px;
}
.class-add-card:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--hover);
}
.class-add-card.compact {
  min-height: 72px;
  grid-template-columns: auto auto;
  justify-content: center;
}
.archive-block { margin-top: 26px; }
.archive-block .archive-heading {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 18px 0 14px;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}
.class-icon {
  width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-weight: 700; font-size: 15px;
  letter-spacing: .02em; margin-top: 6px; box-shadow: var(--shadow-sm);
}
.class-photo-preview {
  display: flex; align-items: center; gap: 12px;
  margin: -4px 0 16px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px;
}
.class-photo-preview .muted { display: block; margin-top: 2px; }
.class-icon.small-preview { width: 46px; height: 46px; margin-top: 0; }
body.dark .class-card,
body.dark .card,
body.dark .student-table,
body.dark .table-wrap,
body.dark .modal,
body.dark .tile,
body.dark .tt-day,
body.dark .empty-state {
  border-color: var(--border);
}
body.dark input,
body.dark select,
body.dark textarea,
body.dark .tab-toolbar select {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 16px; font-size: 16px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.form-grid input, .form-grid select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.form-grid input:focus, .form-grid select:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.name-row { display: flex; gap: 8px; }
.name-row select, .name-row input { flex: 1; min-width: 0; }
.oral-weights span { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }
.oral-weights input { width: 100%; }

#import-file { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs {
  display: inline-flex; gap: 3px; background: var(--surface-2); padding: 4px;
  border-radius: 13px; margin-bottom: 16px; max-width: 100%; overflow-x: auto;
}
.tab {
  padding: 8px 16px; border: none; background: none; cursor: pointer;
  font-size: 13.5px; font-weight: 500; color: var(--muted); border-radius: 10px;
  white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--card); color: var(--primary-dark); box-shadow: var(--shadow-sm); font-weight: 600; }

.tab-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.tab-toolbar > span:last-child { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab-toolbar select {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--card); color: var(--text); font-size: 12.5px;
}
.segmented {
  display: inline-flex; gap: 3px; padding: 3px;
  background: var(--surface-2); border-radius: 11px; border: 1px solid var(--border-soft);
}
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 10px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 600;
}
.segmented button.active { background: var(--card); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.oral-direct-cell {
  min-width: 112px; position: relative;
}
.oral-direct-input {
  width: 58px; text-align: center; margin-right: 4px;
}
.mini-edit {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  border-radius: 8px; padding: 3px 6px; cursor: pointer; font-size: 12px;
}
.mini-edit:hover { border-color: var(--primary); color: var(--primary-dark); }
.oral-absent { display: inline-block; min-width: 58px; }

/* ---------- Abschnitte ---------- */
.period-bar {
  display: inline-flex; gap: 3px; background: var(--surface-2); padding: 4px;
  border-radius: 12px; margin-bottom: 14px;
}
.pbtn {
  border: none; background: none; padding: 6px 15px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; color: var(--muted); border-radius: 9px;
  transition: background .15s, color .15s;
}
.pbtn:hover { color: var(--text); }
.pbtn.active { background: var(--grad); color: #fff; font-weight: 600; }

/* ---------- Stundenplan ---------- */
.tt-week-title {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}
.tt-grid {
  display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 14px;
}
.tt-day {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  min-height: 180px; animation: fadeInUp .25s ease both;
}
.tt-day.today { border-color: var(--primary); box-shadow: var(--shadow-md); }
.tt-day-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}
.tt-day-head strong { text-transform: uppercase; letter-spacing: .04em; font-size: 12px; }
.tt-day-head span { color: var(--muted); font-size: 12.5px; }
.tt-event {
  margin: 10px; padding: 12px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--border-soft);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tt-event:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.tt-event.matched { background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface)); }
.tt-time { color: var(--primary-dark); font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.tt-title { font-weight: 650; line-height: 1.25; margin-bottom: 5px; }
.tt-description {
  color: var(--muted); font-size: 12px; line-height: 1.35;
  margin-bottom: 8px; max-height: 3.9em; overflow: hidden;
}
.tt-location { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; white-space: normal; }
.tt-unmatched { display: inline-block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.tt-empty, .tt-loading {
  color: var(--muted); font-size: 13px; padding: 18px 14px;
}
.empty-state {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 28px; text-align: center; box-shadow: var(--shadow-sm);
  max-width: 560px; margin: 24px auto; animation: fadeInUp .28s ease both;
}
.empty-state h3 { margin: 8px 0; }
.empty-state p { color: var(--muted); margin-bottom: 18px; }
.empty-icon { font-size: 34px; }

@media (max-width: 980px) {
  .tt-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}
@media (max-width: 620px) {
  .tt-grid { grid-template-columns: 1fr; }
}

/* ---------- Tabellen ---------- */
.table-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
table { border-collapse: collapse; width: 100%; }
th, td {
  border-bottom: 1px solid var(--border-soft);
  padding: 8px 10px; text-align: center; font-size: 14px; white-space: nowrap;
}
th {
  background: var(--surface); font-weight: 600; vertical-align: top; padding-top: 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--hover); }

.sticky-col {
  position: sticky; left: 0; background: var(--card); text-align: left;
  font-weight: 500; z-index: 5; min-width: 170px; border-right: 1px solid var(--border);
  text-transform: none; letter-spacing: 0;
}
th.sticky-col { background: var(--surface); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:hover .sticky-col { background: var(--hover); }

.col-title { max-width: 120px; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--text); }
.col-meta { font-size: 10.5px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 1px; }
.col-actions { font-size: 11px; margin-top: 3px; }
.col-actions a { text-decoration: none; margin: 0 3px; opacity: .45; }
.col-actions a:hover { opacity: 1; }

th.col-schriftlich, td.col-schriftlich { background: var(--written); }
th.col-muendlich, td.col-muendlich { background: var(--oral); }
.avg-col { background: var(--surface); font-size: 13px; }
.final-col { background: var(--final); }
th.oral-total, td.oral-total { background: var(--oral-strong); }

.grade-input {
  width: 54px; padding: 5px 4px; text-align: center; border: 1px solid transparent;
  border-radius: 8px; font-size: 14px; background: transparent; font-family: inherit;
  color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s;
}
.grade-input:hover { border-color: var(--border); background: var(--card); }
.grade-input:focus { border-color: var(--primary); background: var(--card); outline: none; box-shadow: var(--ring); }
.grade-input.invalid { border-color: #dc2626; background: #fef2f2; }
body.dark .grade-input.invalid { background: #331414; }
td.col-muendlich .grade-input:disabled { background: transparent; }

.quota { font-size: 10.5px; color: var(--muted); }
.cell-flags { font-size: 10.5px; line-height: 1.1; }
.cell-flags a { text-decoration: none; opacity: .4; margin-left: 3px; }
.cell-flags a:hover { opacity: 1; }
.oral-cell .oral-grade { font-weight: 600; }

.stats-row td { background: var(--surface) !important; font-size: 12.5px; color: var(--muted); }
.stats-row .sticky-col { font-weight: 600; }

.check-cell { cursor: pointer; font-size: 15px; min-width: 62px; height: 38px; user-select: none; }
.check-cell:hover { background: var(--surface-2) !important; }

.modal-label input.invalid { border-color: #dc2626; background: #fef2f2; }
body.dark .modal-label input.invalid { background: #331414; }

/* ---------- Avatare ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0;
  object-fit: cover; box-shadow: var(--shadow-sm); user-select: none;
}
img.avatar { object-fit: cover; }
.student-row { display: flex; align-items: center; gap: 12px; }
.photo-row { display: flex; justify-content: center; margin-bottom: 14px; }

/* ---------- Schüler-Tab ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.two-col h3 { margin-bottom: 12px; font-size: 16px; }
.student-table {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; width: 100%; box-shadow: var(--shadow-sm);
}
.student-table td { text-align: left; padding: 9px 14px; }
.student-mail { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions a { text-decoration: none; margin-left: 10px; opacity: .45; font-size: 14px; }
.row-actions a:hover { opacity: 1; }
.class-photo {
  width: 46px; height: 46px; border-radius: 13px; object-fit: cover;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--surface);
}
.class-photo.big {
  width: min(100%, 260px); height: 150px; border-radius: 16px;
}
.class-icon.big {
  width: min(100%, 260px); height: 150px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 30px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}

textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 14px; font-family: inherit; margin-bottom: 10px; resize: vertical;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

.note-preview {
  font-size: 12px; color: var(--muted); margin-top: 3px; cursor: pointer;
  white-space: normal; max-width: 420px;
}
.note-editor-row td { background: var(--surface); }
.note-editor-row textarea { margin-bottom: 0; }
.note-editor-row .btn-row { margin-top: 8px; }

/* ---------- Sitzplan ---------- */
.seat-layout { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seat-layout label { font-size: 12.5px; color: var(--muted); }
.seat-layout input {
  width: 54px; padding: 6px 7px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text);
}

.unseated {
  background: var(--card); border: 1px dashed var(--border); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.chip {
  background: var(--surface-2); border-radius: 99px; padding: 5px 14px; font-size: 13px;
  cursor: pointer; border: 2px solid transparent; user-select: none; font-weight: 500;
  transition: filter .12s, border-color .12s;
}
.chip:hover { filter: brightness(.96); }
body.dark .chip:hover { filter: brightness(1.2); }
.chip.selected { border-color: var(--primary); }

.board-label { text-align: center; color: var(--muted); font-size: 11px; letter-spacing: 3px; margin: 8px 0 12px; text-transform: uppercase; }

.seat-grid { display: grid; gap: 10px; }
.seat-grid-board {
  padding: 12px; border-radius: 18px; border: 1px solid var(--border);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: var(--shadow-sm);
}
.seat-free-board {
  position: relative; min-height: 620px; border: 1px solid var(--border);
  border-radius: 18px; background-color: var(--surface); background-size: cover;
  background-position: center; background-repeat: no-repeat; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.seat-free-board::after {
  content: ""; position: absolute; inset: 10px; border: 1px dashed var(--border);
  border-radius: 14px; pointer-events: none;
}
.free-seat {
  position: absolute; width: 156px; z-index: 2; touch-action: none;
  transform: translate(-12%, -12%);
}
.free-seat:active { cursor: grabbing; }
.seat-bg-preview {
  width: 100%; max-height: 240px; border-radius: 16px; object-fit: cover;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
body.dark .seat-grid-board,
body.dark .seat-free-board {
  background-color: var(--surface);
}
.seat {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 13px;
  min-height: 86px; padding: 7px 6px 5px; cursor: pointer;
  position: relative; user-select: none; box-shadow: var(--shadow-sm);
  transition: border-color .12s, transform .12s, box-shadow .12s, opacity .2s;
}
.seat:hover { border-color: var(--primary); transform: translateY(-1px); }
.seat.selected { border-color: var(--primary); background: var(--surface-2); }
.seat.free-seat {
  position: absolute;
  width: 156px;
  z-index: 2;
  touch-action: none;
  transform: translate(-50%, -50%);
  cursor: grab;
}
.seat.free-seat:hover {
  transform: translate(-50%, -50%) scale(1.02);
}
.seat.free-seat:active {
  cursor: grabbing;
}
.seat.empty {
  background: transparent; border-style: dashed; display: flex;
  align-items: center; justify-content: center; color: var(--border); font-size: 20px;
  box-shadow: none; min-height: 86px;
}
.seat.empty:hover { border-color: var(--primary); color: var(--primary); }
.seat.absent { opacity: .5; border-style: dashed; }
.seat-top { display: flex; align-items: center; gap: 7px; text-align: left; }
.seat-names { min-width: 0; }
.seat-name { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-first { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-tally { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.seat-tally button {
  border: none; background: var(--surface-2); border-radius: 7px; cursor: pointer;
  color: var(--text); font-size: 11px; padding: 3px 7px; transition: filter .12s;
}
.seat-tally button:hover { filter: brightness(.94); }
body.dark .seat-tally button:hover { filter: brightness(1.25); }
.seat-tally span { font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.seat-unassign { position: absolute; top: 3px; right: 7px; font-size: 10px; color: var(--muted); opacity: .6; }
.seat-unassign:hover { color: #dc2626; opacity: 1; }
.seat-actions2 {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; padding: 0 2px;
}
.seat-actions2 a { text-decoration: none; font-size: 11.5px; opacity: .75; }
.seat-actions2 a:hover { opacity: 1; }

/* HA-Sitzplanmodus */
.seat.ha-seat { text-align: center; }
.seat.ha-seat .seat-name, .seat.ha-seat .seat-first { white-space: nowrap; }
.ha-status { font-size: 22px; margin-top: 6px; min-height: 28px; }

/* ---------- Archiv & Sicherung ---------- */
.archive-heading { font-size: 17px; margin: 28px 0 14px; color: var(--muted); }
.archive-check {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--muted); margin-top: 14px; cursor: pointer;
}
.archive-check input { accent-color: var(--primary); width: 16px; height: 16px; }
.modal code { background: var(--surface-2); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.theme-choice {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  color: var(--text); cursor: pointer; font-weight: 600; text-align: left;
}
.theme-choice.active { border-color: var(--primary); box-shadow: var(--ring); }
.theme-dot { width: 24px; height: 24px; border-radius: 999px; background: var(--grad); }
.theme-section-title { margin-top: 14px; margin-bottom: 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.surface-dot { border: 1px solid var(--border); }
.surface-choice-dim { opacity: .55; }
.theme-indigo { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.theme-emerald { background: linear-gradient(135deg,#10b981,#14b8a6); }
.theme-rose { background: linear-gradient(135deg,#f43f5e,#ec4899); }
.theme-amber { background: linear-gradient(135deg,#f59e0b,#ef4444); }
.theme-cyan { background: linear-gradient(135deg,#06b6d4,#3b82f6); }
.theme-slate { background: linear-gradient(135deg,#475569,#94a3b8); }
.theme-grape { background: linear-gradient(135deg,#a855f7,#6366f1); }
.theme-lime { background: linear-gradient(135deg,#84cc16,#22c55e); }
.theme-coral { background: linear-gradient(135deg,#fb7185,#f97316); }
.theme-mono { background: linear-gradient(135deg,#111827,#6b7280); }

/* ---------- Mehrfachauswahl ---------- */
.bulk-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px 14px;
}
.sel-box { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }

/* ---------- Gruppen ---------- */
.group-box {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px; display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; font-size: 13px;
}
.group-box strong { margin-right: 4px; }
#groups-result { max-height: 320px; overflow-y: auto; margin-top: 4px; }

/* ---------- Schüler-Einzelansicht ---------- */
.student-link { color: inherit; text-decoration: none; }
.student-link:hover { color: var(--primary-dark); text-decoration: underline; }
body.dark .student-link {
  color: #f8fafc;
  font-weight: 650;
}
body.dark .student-link:hover {
  color: var(--primary-dark);
}

.student-head h2 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 4px; }

.tile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.tile {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow-sm);
}
.tile.accent { background: var(--grad); border: none; }
.tile.accent .tile-label, .tile.accent .tile-value { color: #fff; }
.tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 5px; }
.tile-value { font-size: 17px; font-weight: 700; }

.explain-btn {
  margin-left: 6px; width: 22px; height: 22px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--primary-dark); font-weight: 800; cursor: pointer;
}
.explain-btn:hover { border-color: var(--primary); box-shadow: var(--ring); }
.explain-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin: 10px 0 16px;
}
.explain-tile {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  background: var(--surface);
}
.explain-tile.accent { background: var(--grad); border-color: transparent; color: #fff; }
.explain-tile span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.explain-tile.accent span { color: rgba(255,255,255,.78); }
.explain-tile strong { display: block; margin-top: 5px; font-size: 18px; }
.explain-section {
  border-top: 1px solid var(--border-soft); padding-top: 12px; margin-top: 12px;
}
.explain-section h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }

.detail-table { width: 100%; }
.detail-table th, .detail-table td { text-align: left; padding: 7px 10px; }
.detail-table td.wrap { white-space: normal; max-width: 380px; }
.edit-note-link { font-size: 12.5px; font-weight: 400; text-decoration: none; color: var(--primary-dark); margin-left: 8px; }
.card p.wrap { white-space: pre-wrap; }

/* ---------- Kursbuch ---------- */
.lesson-card { padding: 16px 20px; margin-bottom: 12px; }
.lesson-head { display: flex; align-items: center; gap: 12px; }
.lesson-date {
  background: var(--surface-2); color: var(--primary-dark); font-weight: 600; font-size: 12.5px;
  border-radius: 8px; padding: 4px 10px; white-space: nowrap;
}
.lesson-topic { flex: 1; font-size: 15px; }
.lesson-actions a { text-decoration: none; opacity: .45; margin-left: 8px; }
.lesson-actions a:hover { opacity: 1; }
.lesson-notes { margin-top: 8px; font-size: 13.5px; color: var(--muted); white-space: pre-wrap; }
.lesson-hw { margin-top: 6px; font-size: 13px; color: var(--primary-dark); font-weight: 500; }
.template-picks {
  display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px;
}
.lesson-actions a[title*="Hausaufgabe"] {
  font-size: 11px; font-weight: 800; opacity: .8;
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px;
}
.lesson-actions a[title*="Hausaufgabe"]:hover {
  border-color: var(--primary); color: var(--primary-dark);
}

/* ---------- Sicherheit ---------- */
.security-list { display: grid; gap: 10px; }
.security-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  background: var(--surface); display: flex; flex-direction: column; gap: 3px;
}
.security-item strong { font-size: 14px; }
.security-item span { color: var(--muted); font-size: 13px; }
.security-item.ok { border-color: color-mix(in srgb, #22c55e 42%, var(--border)); }
.security-item.warn { border-color: color-mix(in srgb, #f59e0b 50%, var(--border)); }

/* ---------- Statistik ---------- */
.trend-svg { width: 100%; max-width: 720px; height: auto; }
body.dark .trend-svg text { fill: #aab2c5; }
.dist-card h3 { margin-bottom: 12px; font-size: 15px; }
.dist-card h3 .muted { font-weight: 400; margin-left: 8px; }
.dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dist-label { width: 24px; text-align: right; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.dist-bar-bg { flex: 1; background: var(--border-soft); border-radius: 6px; height: 18px; overflow: hidden; }
.dist-bar { background: var(--grad); border-radius: 6px; height: 18px; min-width: 0; transition: width .25s; }
.dist-count { width: 24px; font-size: 12.5px; font-weight: 600; }

/* ---------- Modale Dialoge ---------- */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 12, 20, .45);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--card); border-radius: 20px; padding: 26px;
  width: 410px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px -12px rgba(0, 0, 0, .45);
  animation: modal-in .16s ease-out; border: 1px solid var(--border);
}
.modal.wide { width: min(980px, 94vw); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal h3 { margin-bottom: 16px; font-size: 16.5px; letter-spacing: -.01em; }
.modal-text { margin-bottom: 4px; font-size: 14.5px; }
.modal-label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 13px; }
.modal-label input, .modal-label select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; color: var(--text); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.modal-label input:focus, .modal-label select:focus, .modal-label textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
.modal-label textarea { margin-bottom: 0; }
.modal .btn-row { margin-top: 16px; }
.settings-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 18px;
}
.settings-head h3 { margin-bottom: 4px; }
.settings-pill {
  flex-shrink: 0; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--primary-dark);
  font-size: 12px; font-weight: 700;
}
.settings-grid {
  display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px;
  align-items: start;
}
.settings-tabs {
  position: sticky;
  top: 0;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.settings-tabs button {
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  padding: 10px 11px;
  min-height: 40px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}
.settings-tabs button[aria-selected="true"] {
  cursor: default;
}
.settings-tabs button:hover { background: var(--surface-2); }
.settings-tabs button.active {
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.onboarding-steps {
  display: grid; grid-template-columns: 1fr; gap: 14px;
}
.onboarding-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.onboarding-progress span {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.onboarding-progress span.active {
  background: color-mix(in srgb, #2dd4bf 22%, var(--card));
  color: #00796b;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #2dd4bf 35%, transparent);
}
.onboarding-progress span.done {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface-2));
  color: var(--text);
}
.onboarding-next {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--muted);
}
.onboarding-next strong { color: var(--text); }
.onboarding-steps .settings-section {
  min-height: 150px;
}
.onboarding-steps .settings-section p {
  margin: -4px 0 12px;
  font-size: 13px;
}
.settings-section {
  border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; background: var(--surface);
}
.settings-section h4 {
  margin-bottom: 12px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.settings-form {
  display: grid; gap: 12px;
}
.settings-form.two { grid-template-columns: 1fr 1fr; }
.settings-form label,
.settings-label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.settings-form input,
.settings-form select,
.settings-form textarea,
.settings-label textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text); font: inherit; font-size: 14px;
}
.settings-form textarea,
.settings-label textarea { resize: vertical; margin-bottom: 0; }
.settings-check {
  display: flex; align-items: center; gap: 8px; margin: 12px 0 8px;
  color: var(--text); font-size: 13.5px; cursor: pointer;
}
.settings-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.settings-footer {
  position: sticky; bottom: -26px; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  padding-top: 14px; border-top: 1px solid var(--border-soft);
}

/* ---------- Suche & Import ---------- */
.quick-search input,
.conference-controls input,
.conference-controls select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); color: var(--text); font: inherit;
}
.quick-results {
  display: grid; gap: 8px; margin-top: 14px; max-height: 58vh; overflow-y: auto;
}
.quick-results button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  color: var(--text); padding: 11px 13px; cursor: pointer; text-align: left;
}
.quick-results button:hover { border-color: var(--primary); box-shadow: var(--ring); }
.quick-results span { color: var(--muted); font-size: 12.5px; }
.import-center-grid,
.conference-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px;
}
.import-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  align-items: stretch; margin: 14px 0 10px; color: var(--muted);
}
.import-summary article {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  padding: 11px 12px;
}
.import-summary strong { display: block; font-size: 22px; color: var(--primary-dark); line-height: 1; }
.import-summary span { display: block; margin-top: 5px; font-size: 12px; font-weight: 750; }
.import-note {
  margin: 6px 0 12px;
  padding: 9px 11px;
  border-radius: 12px;
  background: color-mix(in srgb, #2dd4bf 13%, var(--card));
  color: var(--text);
  font-size: 13px;
}
.import-preview-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.import-preview-list div {
  display: flex; justify-content: space-between; gap: 10px;
  border: 1px solid var(--border-soft); border-radius: 10px; padding: 8px 10px;
}
.import-preview-list div.duplicate {
  opacity: .68;
  background: var(--surface-2);
}
.import-preview-list div.duplicate { opacity: .58; background: var(--surface-2); }
.import-preview-list span { color: var(--muted); font-size: 12.5px; }

/* ---------- Druck ---------- */
@media print {
  header, .tabs, .tab-toolbar, .toolbar button, .col-actions, .row-actions,
  #class-form, .period-bar { display: none !important; }
  body, body.dark {
    background: #fff;
    --bg: #fff; --card: #fff; --text: #111; --muted: #666;
    --border: #ddd; --border-soft: #eee; --surface: #fff; --surface-2: #fff;
    --written: #fff; --oral: #fff; --oral-strong: #fff; --final: #fff; --hover: #fff;
  }
  body.privacy * { filter: none !important; }
  #view-classes, #view-class { padding: 0; max-width: none; }
  .table-wrap, .card, .tile { border: 1px solid #ddd; overflow: visible; box-shadow: none; animation: none; }
  th, td { font-size: 11px; padding: 3px 5px; }
  .grade-input { border: none; }
}

@media (max-width: 800px) {
  .two-col, .form-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .two-col, .two-col > *, .card { min-width: 0; max-width: 100%; }
  .student-table { display: block; width: 100%; overflow-x: auto; }
  .student-table tbody { display: table; min-width: 430px; width: 100%; }
  .seat-grid-board { overflow-x: auto; max-width: 100%; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .settings-grid, .onboarding-steps, .settings-form.two { grid-template-columns: 1fr; }
  .onboarding-progress { grid-template-columns: 1fr 1fr; }
  .onboarding-next { align-items: flex-start; flex-direction: column; }
  .import-summary { grid-template-columns: 1fr 1fr; }
  .settings-head { flex-direction: column; }
  #view-dashboard, #view-classes, #view-class { padding: 14px; }
  header { padding: 11px 14px; }
  .seat-free-board { min-height: 520px; }
  .free-seat { width: 132px; }
  .seat.free-seat { width: 132px; }
}

@media (pointer: coarse) {
  .seat-layout {
    width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .seat-layout .btn,
  .seat-layout .segmented button,
  .seat-tally button,
  .seat-actions2 a {
    min-height: 38px;
  }
  .seat {
    min-height: 96px; padding: 9px 8px 7px;
  }
  .seat-name { font-size: 13.5px; }
  .seat-first { font-size: 12px; }
  .seat-tally button { padding: 6px 10px; }
  .seat-actions2 a {
    display: inline-flex; align-items: center; padding: 4px 6px;
  }
  .seat.free-seat {
    width: 148px;
  }
  .seat-free-board {
    min-height: 64vh;
  }
}

/* ---------- Noturio v28: Produkt-Politur ---------- */
.class-overview-head.modern,
.class-filterbar.modern,
.class-card,
.modal,
.settings-section {
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.class-overview-actions .btn,
.class-filterbar .btn,
.class-filterbar select,
.compact-toggle,
.grade-filter {
  min-height: 42px;
}

.class-search-wrap {
  flex: 1 1 280px;
  min-width: min(100%, 260px);
}

.class-search-wrap input {
  width: 100%;
}

.class-card {
  overflow: hidden;
  min-height: 264px;
}

.class-card.compact {
  min-height: 0;
}

.class-card h3,
.class-card p,
.class-next span,
.quick-class-list span,
.today-event span {
  overflow-wrap: anywhere;
}

.class-card-top,
.class-metrics,
.class-next {
  min-width: 0;
}

.class-next {
  gap: 8px;
  line-height: 1.35;
}

.class-next span {
  min-width: 0;
}

.settings-form select,
.settings-form input,
.settings-form textarea,
.modal-label input,
.modal-label select,
.modal-label textarea,
.quick-search input {
  min-height: 40px;
}

body.dark .side-link span,
body.dark .app-icon,
body.dark .icon-btn,
body.dark .class-next .app-icon {
  color: #f8fafc;
}

body.dark .side-link.locked span,
body.dark .side-link.locked .app-icon {
  color: #94a3b8;
}

body.dark .class-card p,
body.dark .class-metric span,
body.dark .class-next span,
body.dark .settings-form label,
body.dark .settings-label,
body.dark .modal-label {
  color: #dbe4f0;
}

body.dark .class-card h3,
body.dark .class-metric b,
body.dark .settings-check,
body.dark .quick-results strong {
  color: #ffffff;
}

body.dark .subject-chip,
body.dark .class-status-chip,
body.dark .status-pill,
body.dark .settings-pill {
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

body.dark .class-status-chip:not(.warn),
body.dark .status-pill {
  background: rgba(34, 197, 94, .18);
}

@media (max-width: 760px) {
  .mobile-only-action { display: inline-flex !important; }

  .btn,
  .side-link,
  .tab,
  .settings-tabs button,
  .segmented button,
  .pbtn,
  .icon-btn {
    min-height: 44px;
  }

  header {
    gap: 8px;
  }

  .class-overview-actions,
  .class-filterbar.modern {
    display: grid;
    grid-template-columns: 1fr;
  }

  .class-overview-actions > *,
  .class-filterbar.modern > *,
  .class-filterbar select,
  .compact-toggle,
  .grade-filter {
    width: 100%;
  }

  .segmented.compact-toggle,
  .segmented.grade-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-grid,
  .settings-form.two,
  .import-center-grid,
  .conference-controls {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    position: static;
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .settings-tabs button {
    white-space: nowrap;
    text-align: center;
  }

  .modal {
    padding: 20px;
    max-height: 92vh;
  }

  .settings-footer {
    bottom: -20px;
  }
}
