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: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

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

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

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

.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: cover;
  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-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-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;
  right: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #ef4444;
  border: 2px solid var(--sa-surface);
  transform: translate(25%, -25%);
}

.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;
}
