:root {
  --bg: #f5f6f8;
  --card-bg: #ffffff;
  --text: #1c1f26;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --weekend: #4b5563;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 12px 40px;
}

/* Desktop-Dashboard (Kalenderseite) */
.dashboard-sidebar {
  display: none;
}

@media (min-width: 900px) {
  main.main-wide {
    max-width: 1080px;
  }

  .dashboard {
    display: grid;
    grid-template-columns: 2.1fr 1fr;
    gap: 28px;
    align-items: start;
  }

  .dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 76px;
  }

  .cal-cell {
    font-size: 0.8rem;
  }

  .cal-code {
    font-size: 0.85rem;
  }
}

.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.next-dienst-code {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.05rem;
}

.next-dienst-date {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-actions a {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* Login */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-card label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
}

.login-card input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
}

.login-card button {
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error {
  color: #dc2626;
  font-size: 0.9rem;
  text-align: center;
}

/* Topbar */
.topbar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.profile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--text);
}

/* Hamburger-Menü */
.hamburger-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  right: 16px;
  margin-top: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  min-width: 190px;
  overflow: hidden;
  z-index: 20;
}

.hamburger-menu.open {
  display: flex;
}

.hamburger-menu a {
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.hamburger-menu a:last-child {
  border-bottom: none;
  color: var(--muted);
}

/* Abo-Seite */
.abo-box {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.abo-label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.abo-link {
  color: var(--accent);
  word-break: break-all;
  font-size: 0.85rem;
  text-decoration: none;
}

.abo-icons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.abo-icon-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.krank-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.krank-form label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 10px;
}

.krank-form input,
.krank-form textarea,
.krank-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  background: white;
}

.field-hint {
  margin: 2px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.date-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.date-row > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.date-row label {
  margin-top: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-label input {
  width: auto;
}

.krank-form button {
  margin-top: 20px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

/* Month/week nav */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 4px;
}

.month-nav h1 {
  font-size: 1.15rem;
  margin: 0;
  text-align: center;
}

.month-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.page-title {
  font-size: 1.15rem;
  margin: 0;
  padding: 16px 4px 4px;
  text-align: center;
}

.hint {
  text-align: center;
  color: var(--muted);
  margin-top: 40px;
}

.sent-message {
  text-align: center;
  margin-top: 60px;
  padding: 0 16px;
}

.sent-message p {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 0 8px;
}

/* Kalenderansicht */
.cal-weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

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

.cal-day {
  min-width: 0;
}

.cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.7rem;
}

.cal-cell-empty {
  background: transparent;
}

.cal-cell.is-weekend {
  box-shadow: inset 0 0 0 2px var(--weekend);
}

.cal-cell.is-today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: today-pulse 1.8s ease-in-out infinite;
}

@keyframes today-pulse {
  0%, 100% { outline-color: var(--accent); outline-width: 2px; }
  50% { outline-color: rgba(37, 99, 235, 0.35); outline-width: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .cal-cell.is-today { animation: none; }
}

.cal-weekday-header span:nth-child(6),
.cal-weekday-header span:nth-child(7) {
  color: var(--weekend);
  font-weight: 700;
}

.cal-daynum {
  font-size: 0.7rem;
  color: var(--muted);
}

.cal-code {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  padding: 0 2px;
}

.cal-day-remark {
  font-size: 0.6rem;
  line-height: 1.15;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
  padding: 0 1px;
  word-break: break-word;
  hyphens: auto;
}

.cal-day-remark.has-color {
  color: var(--text);
  border-radius: 4px;
  padding: 1px 3px;
}

@media (max-width: 400px) {
  .cal-code { font-size: 0.68rem; }
  .cal-day-remark { font-size: 0.55rem; }
}
