/* ================================================================
   Schulmanager Tracker – Dark Mode Dashboard
   ================================================================ */

/* ── Reset & Variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette */
  --bg-base:       #0d0f14;
  --bg-surface:    #141720;
  --bg-card:       #1a1e2d;
  --bg-card-hover: #1f2438;
  --bg-glass:      rgba(255,255,255,0.04);

  --accent-primary: #6c63ff;
  --accent-glow:    rgba(108,99,255,0.35);
  --accent-blue:    #3b82f6;
  --accent-teal:    #14b8a6;
  --accent-amber:   #f59e0b;
  --accent-rose:    #f43f5e;
  --accent-green:   #22c55e;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #475569;

  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(108,99,255,0.4);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px var(--accent-glow);

  --transition: 0.2s ease;

  /* Day colors */
  --day-0: #6c63ff;
  --day-1: #3b82f6;
  --day-2: #14b8a6;
  --day-3: #f59e0b;
  --day-4: #f43f5e;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: clip;
}

/* ── Sticky Top Header & Nav ─────────────────────────────────── */
.app-header-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(13, 15, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
  padding: env(safe-area-inset-top, 0px) 2rem 0;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px var(--accent-primary));
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.brand-sub #stat-last-scrape {
  color: var(--text-secondary);
  font-weight: 500;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--transition);
}
.status-dot.online   { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.status-dot.error    { background: var(--accent-rose);  box-shadow: 0 0 8px var(--accent-rose);  }
.status-dot.running  { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber);
  animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Stats Bar ───────────────────────────────────────────────── */
.stats-bar {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-teal));
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ── Header Ticker / Laufband ───────────────────────────────── */
.header-ticker-banner {
  width: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(108, 99, 255, 0.12) 0%, rgba(20, 184, 166, 0.09) 50%, rgba(108, 99, 255, 0.12) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(108, 99, 255, 0.18);
  height: 28px;
  line-height: 28px;
  display: flex;
  align-items: center;
  position: relative;
  user-select: none;
}

.header-ticker-banner::before,
.header-ticker-banner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 2;
  pointer-events: none;
}

.header-ticker-banner::before {
  left: 0;
  background: linear-gradient(to right, rgba(13, 15, 20, 0.9), transparent);
}

.header-ticker-banner::after {
  right: 0;
  background: linear-gradient(to left, rgba(13, 15, 20, 0.9), transparent);
}

.ticker-track {
  display: flex;
  flex-shrink: 0;
  white-space: nowrap;
  animation: tickerMarquee 58s linear infinite;
  will-change: transform;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerMarquee {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.ticker-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
}

.ticker-segment {
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.ticker-plus {
  color: #a78bfa;
  font-weight: 700;
  letter-spacing: 0.15em;
  margin: 0 0.85rem;
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

@media (max-width: 768px) {
  .header-ticker-banner {
    height: 25px;
    line-height: 25px;
  }
  .ticker-segment {
    font-size: 0.74rem;
    padding: 0;
    margin: 0;
  }
  .ticker-plus {
    margin: 0 0.65rem;
  }
}

/* ── Tab Navigation ──────────────────────────────────────────── */
.tab-nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.65rem 1.1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tab-btn .tab-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.tab-btn .tab-text {
  display: inline;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.tab-btn.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

/* ── Main & Panels ───────────────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem 3rem;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.panel-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.week-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.week-display {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.week-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.week-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-primary);
  min-width: 2rem;
  text-align: center;
}

.week-range {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.icon-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#panel-timetable .toolbar-right {
  align-items: flex-start;
}

.scrape-action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.last-scrape-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.last-scrape-caption span {
  color: var(--text-secondary);
  font-weight: 500;
}


.week-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.week-select:hover,
.week-select:focus {
  border-color: var(--accent-primary);
}

.action-btn {
  background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-btn.secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}

.action-btn.secondary:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ── Timetable Grid ──────────────────────────────────────────── */
.timetable-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

.timetable-grid {
  width: 100%;
}

.timetable-desktop-view {
  min-width: 700px;
}

.timetable-mobile-view {
  display: none;
}

/* Column headers (days) */
.grid-header {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}

.grid-header-cell {
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
}

.grid-header-cell:last-child { border-right: none; }

.grid-header-cell.today {
  color: var(--accent-primary);
  background: rgba(108,99,255,0.06);
}

.grid-header-cell .day-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.grid-header-cell .day-date {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 0.25rem;
}

.grid-header-cell.today .day-date {
  color: var(--accent-primary);
  opacity: 0.9;
}

/* Grid rows */
.grid-row {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.grid-row:last-child { border-bottom: none; }
.grid-row:hover { background: var(--bg-glass); }

/* Period number column */
.period-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  min-height: 70px;
}

/* Individual lesson cell */
.lesson-cell {
  padding: 0.5rem;
  border-right: 1px solid var(--border);
  min-height: 70px;
  display: flex;
  align-items: stretch;
}

.lesson-cell:last-child { border-right: none; }

.lesson-cell.today-col {
  background: rgba(108,99,255,0.04);
}

.lesson-card {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  border-left: 3px solid var(--subject-border, var(--accent-primary));
  background: var(--subject-bg, rgba(108,99,255,0.08));
  transition: all var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.lesson-card:hover {
  background: var(--subject-hover-bg, rgba(108,99,255,0.14));
  transform: scale(1.01);
}

.lesson-card.cancelled {
  --subject-border: var(--accent-rose) !important;
  --subject-bg: rgba(244,63,94,0.08) !important;
  --subject-hover-bg: rgba(244,63,94,0.14) !important;
  opacity: 0.7;
}

.lesson-card.substitution {
  --subject-border: var(--accent-amber) !important;
  --subject-bg: rgba(245,158,11,0.08) !important;
  --subject-hover-bg: rgba(245,158,11,0.14) !important;
}

.lesson-subject {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-teacher {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-room {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.lesson-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-cancelled    { background: var(--accent-rose);  color: #fff; }
.badge-substitution { background: var(--accent-amber); color: #000; }
.badge-holiday      { background: rgba(140, 145, 165, 0.4); color: #e2e8f0; }

.lesson-card.holiday {
  --subject-border: rgba(140, 145, 165, 0.3) !important;
  --subject-bg: rgba(140, 145, 165, 0.08) !important;
  --subject-hover-bg: rgba(140, 145, 165, 0.14) !important;
  opacity: 0.85;
}
.lesson-card.holiday .lesson-subject {
  color: #94a3b8;
  font-weight: 600;
}

.cell-empty {
  flex: 1;
}

/* ── Mobile Timetable View ─────────────────────────────────── */
.timetable-mobile-view {
  display: none;
  width: 100%;
}

.mobile-day-nav {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.35rem;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.mobile-day-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-day-tab:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.mobile-day-tab.active {
  background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
  border-color: transparent;
}

.mobile-day-tab .tab-day-name {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.mobile-day-tab .tab-day-date {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 2px;
}

.mobile-day-tab.today:not(.active) .tab-day-name {
  color: var(--accent-teal);
}

.mobile-day-tab .tab-badge-dot {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tab-badge-dot.has-cancellation {
  background: var(--accent-rose);
  box-shadow: 0 0 6px var(--accent-rose);
}

.tab-badge-dot.has-substitution {
  background: var(--accent-amber);
  box-shadow: 0 0 6px var(--accent-amber);
}

/* Mobile Day Schedule Container */
.mobile-day-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mobile-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.mobile-day-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.mobile-day-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-day-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.mobile-today-pill {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-teal);
  border: 1px solid rgba(20, 184, 166, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-day-arrow {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  transition: all var(--transition);
}

.mobile-day-arrow:hover:not(:disabled) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.mobile-day-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Period List & Rows */
.mobile-period-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  touch-action: pan-y;
}

.mobile-period-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
}

.mobile-period-badge {
  width: 44px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.2rem;
}

.mobile-period-badge .period-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.mobile-period-badge .period-txt {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

.mobile-period-badge.free-period {
  background: rgba(255,255,255,0.02);
  border-style: dashed;
}

.mobile-period-badge.free-period .period-num,
.mobile-period-badge.free-period .period-txt {
  opacity: 0.45;
}

/* Mobile Lesson Card */
.mobile-lesson-card {
  flex: 1;
  min-width: 0;
  background: var(--subject-bg, rgba(108,99,255,0.08));
  border: 1px solid var(--border);
  border-left: 4px solid var(--subject-border, var(--accent-primary));
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  transition: transform var(--transition), box-shadow var(--transition);
}

.mobile-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.mobile-subject-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mobile-lesson-subject {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

.mobile-lesson-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.mobile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.mobile-lesson-notes {
  margin-top: 0.25rem;
  padding: 0.45rem 0.65rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #fef3c7;
  word-break: break-word;
}

/* Free card */
.mobile-free-card {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.mobile-free-card .free-icon {
  font-size: 1rem;
  opacity: 0.6;
}

/* State modifiers */
.mobile-lesson-card.cancelled {
  --subject-border: var(--accent-rose) !important;
  --subject-bg: rgba(244,63,94,0.08) !important;
  opacity: 0.85;
}

.mobile-lesson-card.cancelled .mobile-lesson-subject {
  text-decoration: line-through;
  opacity: 0.75;
}

.mobile-lesson-card.substitution {
  --subject-border: var(--accent-amber) !important;
  --subject-bg: rgba(245,158,11,0.08) !important;
}

.mobile-lesson-card.holiday {
  --subject-border: rgba(140, 145, 165, 0.3) !important;
  --subject-bg: rgba(140, 145, 165, 0.08) !important;
}

/* Swipe hints and animations */
.mobile-slide-left {
  animation: slideLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-slide-right {
  animation: slideRight 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-fade-in {
  animation: fadeIn 0.2s ease;
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(25px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-25px); }
  to   { opacity: 1; transform: translateX(0); }
}


/* ── Changes Timeline ────────────────────────────────────────── */
.changes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.change-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

.change-item:hover {
  border-color: var(--border-accent);
  transform: scale(1.10);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 10;
}

.change-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.change-icon.subject       { background: rgba(108,99,255,0.15); }
.change-icon.room          { background: rgba(20,184,166,0.15); }
.change-icon.teacher       { background: rgba(59,130,246,0.15); }
.change-icon.is_cancelled  { background: rgba(244,63,94,0.15);  }
.change-icon.other         { background: rgba(245,158,11,0.15); }

.change-body {
  min-width: 0;
}

.change-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.change-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.change-badge {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-accent);
  color: var(--text-secondary);
  text-transform: uppercase;
}

.change-diff {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.diff-old {
  background: rgba(244,63,94,0.12);
  border: 1px solid rgba(244,63,94,0.25);
  color: #fca5a5;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  text-decoration: line-through;
}

.diff-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.diff-new {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  color: #86efac;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.change-meta {
  text-align: right;
  flex-shrink: 0;
}

.change-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.change-week {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Scrape Log ──────────────────────────────────────────────── */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  display: grid;
  grid-template-columns: 12px auto 1fr auto auto;
  gap: 0.75rem 1rem;
  align-items: center;
  font-size: 0.82rem;
  transition: background var(--transition);
}

.log-item:hover { background: var(--bg-card-hover); }

.log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.log-dot.success { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); }
.log-dot.error   { background: var(--accent-rose);  box-shadow: 0 0 6px var(--accent-rose);  }

.log-time {
  color: var(--text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.log-week {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.log-stats {
  display: flex;
  gap: 0.75rem;
}

.log-stat {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.log-stat-num {
  font-weight: 700;
  color: var(--text-primary);
}

.log-stat-traffic {
  color: #fbbf24;
  font-weight: 600;
}

.log-stat-num-yellow {
  color: #fbbf24;
  font-weight: 700;
}

.log-error {
  color: #fca5a5;
  font-size: 0.78rem;
  grid-column: 3 / -1;
  background: rgba(244,63,94,0.08);
  border: 1px solid rgba(244,63,94,0.2);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

/* ── Empty & Loading States ──────────────────────────────────── */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.empty-state p    { font-size: 0.9rem; }

/* ── Toast ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
  max-width: 320px;
}

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

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ── Hausaufgaben (Homework Widget) ─────────────────────────── */
.homework-wrapper {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.homework-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.homework-grid {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
}

.hw-offset-col {
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.05);
}

.homework-day-col {
  padding: 0.75rem 0.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 120px;
}

.homework-day-col:last-child {
  border-right: none;
}

.hw-mobile-header {
  display: none;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.homework-card {
  background: var(--subject-bg, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--subject-border, var(--accent-primary));
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.homework-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--subject-hover-bg, rgba(108, 99, 255, 0.15));
  border-color: var(--subject-border, rgba(108, 99, 255, 0.3));
  background: var(--subject-hover-bg, rgba(255, 255, 255, 0.05));
}

.hw-header {
  margin-bottom: 0.25rem;
}

.hw-subject {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.hw-text {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.hw-day-empty {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.75rem;
  text-align: center;
  margin: auto 0;
  padding: 1rem 0;
}

.hw-empty {
  color: var(--text-muted);
  font-style: italic;
  padding: 2rem;
  text-align: center;
  grid-column: 1 / -1;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
}

/* ── Schulnoten (Grades Dashboard) ────────────────────────── */
.grades-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grades-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.grades-table {
  width: 100%;
  min-width: 950px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.grades-table th {
  padding: 0.45rem 0.35rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #181d2a;
  font-weight: 600;
  color: var(--text-secondary);
}

.grades-table td {
  padding: 0.25rem 0.25rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.grades-table tr th:first-child,
.grades-table tr td:first-child {
  border-left: 1px solid var(--border);
}

.grades-table thead tr:first-child th {
  border-top: 1px solid var(--border);
}

.grades-table thead tr th.col-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  background: rgba(108, 99, 255, 0.04);
}

.grades-table .weight-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: normal;
  text-transform: none;
  display: block;
  margin-top: 1px;
}

.grades-table tbody tr.vorrueckungsfach {
  background: rgba(139, 92, 246, 0.08); /* Violet background */
}

.grades-table tbody tr.vorrueckungsfach td {
  border-color: rgba(139, 92, 246, 0.16);
}

.grades-table tbody tr.vorrueckungsfach td:first-child {
  border-left: 3px solid rgba(139, 92, 246, 0.85); /* Distinct violet indicator */
}

.grades-table .col-v {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  position: sticky;
  left: 0;
  background: var(--bg-surface);
  z-index: 3;
}

.grades-table .col-subject {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  text-align: center;
  position: sticky;
  left: 46px;
  background: var(--bg-surface);
  z-index: 3;
  box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.45);
}

.grades-table thead th.col-v,
.grades-table thead th.col-subject {
  z-index: 5;
  background: #181d2a;
}

.grades-table tbody tr.vorrueckungsfach td.col-v,
.grades-table tbody tr.vorrueckungsfach td.col-subject {
  background: #1d1b2e;
}

.grades-table .col-schnitt { font-weight: 700; color: var(--accent-primary); width: 70px; min-width: 70px; }
.grades-table .col-note { font-weight: 800; font-size: 1.1rem; width: 60px; min-width: 60px; }
.grades-table .col-actions { width: 45px; min-width: 45px; }

.grades-table .subject-name-input {
  background: transparent;
  border: 1px solid transparent;
  font-weight: 800;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
  text-align: center;
  letter-spacing: 0.02em;
}

.grades-table .subject-name-input:focus,
.grades-table .subject-name-input:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.grades-table .subject-teacher-input {
  background: transparent;
  border: 1px solid transparent;
  font-weight: normal;
  color: var(--text-muted);
  font-size: 0.75rem;
  width: 100%;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  outline: none;
}

.grades-table .subject-teacher-input:focus,
.grades-table .subject-teacher-input:hover {
  background: var(--bg-card);
  border-color: var(--border);
}

.grades-table .grade-input {
  width: 28px;
  height: 28px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  padding: 0;
}

.grades-table .grade-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 5px var(--accent-glow);
  background: var(--bg-card-hover);
}

.grades-table .grade-input.fail {
  border-color: var(--accent-rose) !important;
  color: var(--accent-rose) !important;
  background: rgba(244, 63, 94, 0.1) !important;
}

.grades-table .grade-input.warning {
  border-color: var(--accent-amber) !important;
  color: var(--accent-amber) !important;
  background: rgba(245, 158, 11, 0.1) !important;
}

.grades-table .delete-btn {
  background: none;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.grades-table .delete-btn:hover {
  opacity: 1;
}

.grades-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* ── Reports Styles ──────────────────────────────────────────── */
.reports-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-top: 1rem;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.reports-table th,
.reports-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.reports-table th {
  background: var(--bg-card-hover);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.reports-table tr:last-child td {
  border-bottom: none;
}

.reports-table tr:hover {
  background: var(--bg-glass);
}

/* Color badges for reports */
.report-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
}

.report-badge.homework {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.report-badge.material {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.report-badge.exam {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.report-badge.other {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.report-date {
  font-family: monospace;
  font-weight: 600;
  color: var(--text-secondary);
}

.report-subject {
  font-weight: 700;
  color: var(--text-primary);
}

.report-teacher {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

#dashboard-reports-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dashboard-report-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  transition: border-color var(--transition);
}

.dashboard-report-item:hover {
  border-color: var(--border-accent);
}

.dashboard-report-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-report-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.grades-table input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--text-secondary) !important;
}

.grades-table input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Modal Overlay & Card ────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  text-align: center;
  animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

.modal-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.pin-field {
  width: 120px;
  height: 44px;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5em;
  padding-left: 0.25em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition);
  margin-bottom: 1.5rem;
}

.pin-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
  background: rgba(255, 255, 255, 0.08);
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}


/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-header-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
  }
  .header {
    padding: env(safe-area-inset-top, 0px) 1rem 0;
  }
  .header-inner {
    height: 52px;
  }
  .header-brand .brand-icon {
    font-size: 1.25rem;
  }
  .brand-text h1 {
    font-size: 1.05rem;
    line-height: 1.2;
  }
  .brand-sub {
    display: block;
    font-size: 0.68rem;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--text-muted);
  }
  .brand-sub #stat-last-scrape {
    color: var(--text-secondary);
    font-weight: 500;
  }
  .header-status {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
  }

  /* Menüleiste auf dem Smartphone: Nur Symbole, kein Text, in einer Zeile ohne horizontales Scrollen */
  .tab-nav {
    padding: 0 0.25rem;
    overflow-x: hidden;
    gap: 0;
    width: 100%;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }
  .tab-btn {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0;
    justify-content: center;
    border-bottom: 3px solid transparent;
  }
  .tab-btn.active {
    border-bottom-color: var(--accent-primary);
    background: rgba(108, 99, 255, 0.12);
  }
  .tab-btn .tab-text {
    display: none;
  }
  .tab-btn .tab-icon {
    font-size: 1.35rem;
    line-height: 1;
  }

  .main {
    padding: 1.25rem 1rem 2rem;
  }

  .panel-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .week-nav {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }
  .week-display {
    text-align: center;
    justify-content: center;
  }
  .toolbar-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
  }
  #panel-timetable .toolbar-right {
    align-items: center;
  }
  .week-select {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  /* Timetable switcher */
  .timetable-wrapper {
    overflow-x: visible;
    border: none;
    background: transparent;
  }
  .timetable-grid {
    min-width: 0;
  }
  .timetable-desktop-view {
    display: none;
  }
  .timetable-mobile-view {
    display: block;
    width: 100%;
  }

  .change-item        { grid-template-columns: auto 1fr; }
  .change-meta        { display: none; }
  .log-item           { grid-template-columns: 12px 1fr; }
  .log-stats          { display: none; }
  .grades-overview    { grid-template-columns: 1fr; }
  .homework-grid      { grid-template-columns: 1fr; }
  .hw-offset-col      { display: none; }
  .homework-day-col   { border-right: none; border-bottom: 1px solid var(--border); }
  .homework-day-col:last-child { border-bottom: none; }
  .hw-mobile-header   { display: block; }

  /* Exam responsive stacked layout */
  .exam-card {
    padding: 0.75rem 0.85rem;
    gap: 0.75rem;
  }
  .exam-date-pill {
    min-width: 54px;
    padding: 0.3rem 0.5rem;
  }
  .exam-date-pill .exam-dow {
    font-size: 0.75rem;
  }
  .exam-date-pill .exam-day {
    font-size: 1rem;
  }
  .exam-subject-tag {
    font-size: 0.88rem;
    padding: 0.18rem 0.55rem;
  }
  .exam-type-tag {
    font-size: 0.74rem;
    padding: 0.1rem 0.45rem;
  }
  .exam-countdown {
    font-size: 0.85rem;
    padding: 0.38rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .brand-sub { display: block; }
  .mobile-day-tab .tab-day-name { font-size: 0.82rem; }
  .mobile-day-tab .tab-day-date { font-size: 0.65rem; }
  .mobile-period-badge { width: 38px; }
  .mobile-period-badge .period-num { font-size: 1rem; }
}


/* ── Klassenarbeiten (Exams) Tab ─────────────────────────────── */
.exams-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.exam-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--subject-border, var(--accent-primary));
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  transition: all var(--transition);
  position: relative;
}

.exam-card:hover {
  border-color: rgba(108, 99, 255, 0.4);
  border-left-color: var(--subject-border, var(--accent-primary));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.exam-date-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  min-width: 62px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.1;
}

.exam-date-pill .exam-dow {
  color: var(--accent-primary);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.exam-date-pill .exam-day {
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 800;
  margin-top: 1px;
}

.exam-info-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.exam-subject-tag {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  color: var(--accent-primary);
  border: 1px solid rgba(108, 99, 255, 0.3);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-type-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.exam-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.exam-countdown {
  font-size: 0.92rem;
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.exam-countdown.urgent {
  background: rgba(255, 75, 75, 0.18);
  color: #ff5252;
  border: 1px solid rgba(255, 75, 75, 0.4);
  box-shadow: 0 0 12px rgba(255, 75, 75, 0.2);
}

.exam-countdown.soon {
  background: rgba(255, 177, 66, 0.18);
  color: #ffb142;
  border: 1px solid rgba(255, 177, 66, 0.4);
  box-shadow: 0 0 12px rgba(255, 177, 66, 0.2);
}

.exam-countdown.future {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.35);
  box-shadow: 0 0 10px rgba(46, 213, 115, 0.15);
}

.exam-countdown.past {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

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

.exam-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
}

.exam-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.exam-btn.delete:hover {
  background: rgba(255, 75, 75, 0.15);
  color: #ff5252;
  border-color: #ff5252;
}
