html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sa-font-body);
  color: var(--sa-body-color);
  background: var(--sa-page-bg);
  -webkit-font-smoothing: antialiased;
}

/* Überschriften: Ubuntu · Fliesstext: Inter (siehe --sa-font-body) */
:is(
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .h1,
  .h2,
  .h3,
  .h4,
  .h5,
  .h6,
  .sa-page-title,
  .sa-panel__title,
  .sa-modal__title,
  .sa-step-form__panel-title,
  .sa-step-form__step-question,
  .sa-step-form__action-cancel,
  .sa-home-title,
  .sa-home-feature__title,
  .sa-highlight-card__title,
  .sa-personal-bot__title,
  .sa-calendar-page__title,
  .sa-calendar-detail__title,
  .sa-chat__title,
  .sa-onboarding-welcome__title,
  .sa-onboarding-step-title,
  .sa-onboarding-done__title,
  .sa-login-title,
  .sa-student-home__greeting-title,
  .sa-student-home__schedule-heading,
  .sa-student-home__mini-card-title,
  .sa-student-home__quick-action-title,
  .sa-student-home__goal-text
) {
  font-family: var(--sa-font-heading);
}

.sa-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.sa-page-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.sa-page-body {
  flex: 1 1 auto;
  padding: 1.5rem 0 2.5rem;
}

.sa-container {
  width: 100%;
  max-width: var(--sa-container-max, 96rem);
  margin: 0 auto;
  padding: 0 1rem;
}

.sa-navbar__inner {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .sa-container {
    padding: 0 1.5rem;
  }
}

.sa-message-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  scroll-margin-top: 5rem;
}

/* AJAX-/Seiten-Feedback (z. B. Kalender nach Wizard) – gleiche Abstände wie .sa-message-list */
.sa-feedback-slot:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  scroll-margin-top: 5rem;
}

.sa-feedback-slot.hidden {
  display: none;
}

.sa-message {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  font-size: 0.875rem;
}

/* In Listen/Feedback-Slots: Abstand über gap + Listen-Margin, nicht doppelt */
.sa-message-list > .sa-message,
.sa-feedback-slot > .sa-message {
  margin-bottom: 0;
}

.sa-message-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.sa-message-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.sa-message-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.sa-message-info {
  background: #ecfeff;
  border-color: #a5f3fc;
  color: #155e75;
}

[data-bs-theme="dark"] .sa-message-success {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(74, 222, 128, 0.35);
  color: #d1fae5;
}

[data-bs-theme="dark"] .sa-message-error {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fee2e2;
}

[data-bs-theme="dark"] .sa-message-warning {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fef3c7;
}

[data-bs-theme="dark"] .sa-message-info {
  background: rgba(8, 145, 178, 0.15);
  border-color: rgba(103, 232, 249, 0.35);
  color: #cffafe;
}

.sa-message-close {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
}

.sa-message-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.sa-footer {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid var(--sa-border);
  background: var(--sa-surface);
  padding: 1.25rem 0;
}

.sa-footer-inner {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  font-size: 0.875rem;
  color: var(--sa-muted);
}

@media (min-width: 992px) {
  .sa-footer-inner {
    flex-direction: row;
  }
}

.sa-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: var(--sa-secondary-soft);
  color: var(--sa-ink-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sa-avatar.sa-avatar--image {
  padding: 0;
  overflow: hidden;
  object-fit: contain;
  background: var(--sa-surface-muted);
}

.sa-nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  text-decoration: none;
}

.sa-nav-icon-btn:hover,
.sa-nav-icon-btn:focus {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .sa-nav-icon-btn {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .sa-nav-icon-btn:hover,
[data-bs-theme="dark"] .sa-nav-icon-btn:focus {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.16);
}

.sa-nav-icon-btn .bi {
  font-size: 1.15rem;
  line-height: 1;
}

.sa-user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.sa-user-menu-btn:hover,
.sa-user-menu-btn:focus {
  background: rgba(148, 163, 184, 0.12);
}

[data-bs-theme="dark"] .sa-user-menu-btn:hover,
[data-bs-theme="dark"] .sa-user-menu-btn:focus {
  background: rgba(148, 163, 184, 0.16);
}

.sa-user-menu-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sa-ink);
}

.sa-user-menu-role {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--sa-muted);
}

.sa-nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.sa-nav-dropdown-toggle:hover,
.sa-nav-dropdown-toggle:focus {
  color: #0f172a;
}

[data-bs-theme="dark"] .sa-nav-dropdown-toggle:hover,
[data-bs-theme="dark"] .sa-nav-dropdown-toggle:focus {
  color: #f1f5f9;
}

.sa-nav-dropdown-toggle__icon {
  font-size: 0.75rem;
  opacity: 0.75;
}

.sa-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  min-width: 12rem;
  overflow: hidden;
  border: 1px solid var(--sa-border);
  border-radius: 0.75rem;
  background: var(--sa-surface);
  box-shadow: 0 16px 40px -20px rgba(15, 23, 42, 0.35);
}

.sa-nav-dropdown {
  left: 0;
  right: auto;
  min-width: 14rem;
}

.sa-dropdown a {
  display: block;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--sa-body-color);
  text-decoration: none;
}

.sa-dropdown a:hover,
.sa-dropdown a:focus {
  background: var(--sa-surface-muted);
}

.sa-dropdown-divider {
  height: 1px;
  margin: 0.25rem 0;
  background: var(--sa-border);
}

.sa-notify-dot {
  position: absolute;
  top: -0.1rem;
  right: -0.15rem;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: #ef4444;
  border: 2px solid var(--sa-surface);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.sa-notify-dot.is-hidden,
.sa-notify-dot[hidden] {
  display: none;
}

.sa-notify-dropdown {
  right: 0;
  left: auto;
  width: min(24rem, calc(100vw - 1.5rem));
  min-width: 20rem;
  padding: 0;
}

.sa-notify-dropdown__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--sa-border);
}

.sa-notify-dropdown__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sa-ink);
}

.sa-notify-dropdown__action {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #1a6b66;
  cursor: pointer;
}

.sa-notify-dropdown__action:hover,
.sa-notify-dropdown__action:focus {
  text-decoration: underline;
}

.sa-notify-dropdown__list {
  max-height: 22rem;
  overflow-y: auto;
}

.sa-notify-dropdown__empty {
  margin: 0;
  padding: 1.25rem 1rem;
  font-size: 0.875rem;
  color: var(--sa-muted);
  text-align: center;
}

/* Spezifischer als `.sa-dropdown a`, sonst kleben Titel/Body/Meta in einer Zeile */
.sa-dropdown a.sa-notify-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--sa-border);
  text-decoration: none;
  color: var(--sa-body-color);
}

.sa-dropdown a.sa-notify-item:last-child {
  border-bottom: 0;
}

.sa-dropdown a.sa-notify-item:hover,
.sa-dropdown a.sa-notify-item:focus {
  background: var(--sa-surface-muted);
  text-decoration: none;
}

.sa-dropdown a.sa-notify-item.is-unread {
  background: rgba(36, 167, 159, 0.08);
}

.sa-notify-item__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--sa-ink);
}

.sa-dropdown a.sa-notify-item.is-unread .sa-notify-item__title {
  font-weight: 700;
}

.sa-notify-item__body {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--sa-muted);
}

.sa-notify-item__meta {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--sa-muted);
}

.sa-min-nav .sa-nav-link--active {
  color: #24a79f !important;
  font-weight: 600;
}

[data-bs-theme="dark"] .sa-min-nav .sa-nav-link--active {
  color: #a1d7d6 !important;
}
