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

:root {
  --bg: #0f0f12;
  --surface: #18181c;
  --surface-2: #1f1f24;
  --border: #2a2a30;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-soft: #71717a;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0.35rem 0 0;
  font-weight: 500;
}

/* Main */
.main {
  flex: 1;
}

/* Calendar card */
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.btn-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.btn-nav:hover {
  color: var(--text);
  background: var(--border);
  border-color: var(--text-soft);
}

.month-year {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  min-width: 11rem;
  text-align: center;
}

/* States */
.state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.state-loading {
  color: var(--text-muted);
}

.state-error {
  color: #f87171;
}

.hidden {
  display: none !important;
}

/* Kalender: Wochentage und Tage mit gleichen 7 Spalten, nebeneinander */
.calendar-wrap {
  margin-top: 0.5rem;
}

.weekdays,
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.weekdays {
  margin-bottom: 6px;
}

.weekdays span {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  text-align: center;
  padding: 0.25rem 0;
}

.grid {
  /* 42 Zellen, 6 Zeilen à 7 */
}

.day {
  min-height: 76px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.day.other-month {
  opacity: 0.35;
}

.day.other-month .day-num {
  color: var(--text-soft);
}

.day.today {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.day-num {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
}

.event {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
}

.event:hover {
  background: var(--accent-hover);
}

/* List section */
.list-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.list-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin: 0 0 1rem;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.event-list li:last-child {
  border-bottom: none;
}

.event-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.event-time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
}

@media (max-width: 480px) {
  .page {
    padding: 1.5rem 1rem 2rem;
  }

  .title {
    font-size: 1.5rem;
  }

  .calendar-card {
    padding: 1rem;
  }

  .day {
    min-height: 64px;
    padding: 6px;
  }

  .event {
    font-size: 0.65rem;
    padding: 3px 6px;
  }

  .event-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}
