/* Scholar Ghana applicant dashboard: app shell, nav, and dashboard-only
   components. Loaded alongside reset/variables/base/components/accounts.css
   — form primitives (.field, .alert, .checkbox-field, .password-field) are
   intentionally not redefined here; see accounts.css.

   Mobile-first throughout: base rules target phones, enhanced at the 768px
   (tablet/desktop sidebar) breakpoint below.

   Dark-theme design TOKENS (colors/shadows) now live in variables.css, since
   the admin portal also sets data-theme="dark" as of the admin redesign and
   needs the identical palette. What remains here are targeted overrides for
   shared (components.css/accounts.css) classes reused inside the dashboard,
   whose background color is hardcoded to var(--color-white)/a literal hex
   rather than a semantic token. */
:root[data-theme="dark"] .scholarship-card,
:root[data-theme="dark"] .announcement-card,
:root[data-theme="dark"] .accordion,
:root[data-theme="dark"] .field__input,
:root[data-theme="dark"] .field__select {
  background-color: var(--color-card);
}

:root[data-theme="dark"] .badge--neutral {
  background-color: #1c2921;
  color: var(--color-text-muted);
}

:root[data-theme="dark"] .badge--blue {
  background-color: var(--color-blue-100);
  color: var(--color-blue-600);
}

:root[data-theme="dark"] .btn--gold {
  color: var(--color-green-900);
}

/* ---------------------------------------------------------------------- */
/* Shell layout                                                            */
/* ---------------------------------------------------------------------- */

.dashboard-shell {
  display: flex;
  min-height: 100vh;
  background-color: var(--color-surface);
}

.dashboard-sidebar {
  display: none;
  flex-direction: column;
  width: 17rem;
  padding: var(--space-6) var(--space-4);
  background-color: var(--color-green-900);
  color: var(--color-white);
  overflow-y: auto;
  transition: width var(--transition-base);
}

.dashboard-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-inline: var(--space-2);
}

.dashboard-nav {
  flex: 1;
}

.dashboard-nav__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dashboard-nav__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.dashboard-nav__icon {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
}

.dashboard-nav__label {
  flex: 1;
  white-space: nowrap;
}

.dashboard-nav__link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
}

.dashboard-nav__link--active {
  background-color: rgba(255, 255, 255, 0.14);
  color: var(--color-white);
}

.dashboard-nav__link--active .dashboard-nav__icon {
  color: var(--color-gold-400);
}

.dashboard-nav__link--logout {
  color: rgba(255, 255, 255, 0.65);
}

.dashboard-sidebar__footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Collapsed rail state (tablet/desktop only — see the 768px breakpoint):
   icon-only, labels hidden, tooltip via the anchor's title attribute. */
.dashboard-sidebar--collapsed {
  width: 4.75rem;
}

.dashboard-sidebar--collapsed .dashboard-nav__label,
.dashboard-sidebar--collapsed .dashboard-sidebar__header .logo__text,
.dashboard-sidebar--collapsed .dashboard-badge {
  display: none;
}

.dashboard-sidebar--collapsed .dashboard-nav__link,
.dashboard-sidebar--collapsed .dashboard-nav__link--logout {
  justify-content: center;
}

.dashboard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: var(--space-1);
  border-radius: var(--radius-full);
  background-color: var(--color-gold-500);
  color: var(--color-green-900);
  font-size: 0.7rem;
  font-weight: 700;
}

.dashboard-badge--dot {
  position: relative;
  display: inline-block;
  min-width: 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
}

.dashboard-main-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------------- */
/* Topbar                                                                  */
/* ---------------------------------------------------------------------- */

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: calc(var(--space-3) + env(safe-area-inset-top)) var(--space-4) var(--space-3);
  background-color: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--color-border);
}

:root[data-theme="dark"] .dashboard-topbar {
  background-color: rgba(11, 19, 16, 0.97);
}

/* Mobile-only "return to homepage" mark - the sidebar (with its own logo)
   is display:none below 768px (see the 768px breakpoint below), so without
   this the mobile dashboard has no way back to the public site at all. */
.dashboard-topbar__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  color: var(--color-green-800);
}

.dashboard-topbar__logo .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.dashboard-topbar__logo:hover {
  background-color: var(--color-green-50);
}

.dashboard-topbar__rail-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-charcoal);
}

.dashboard-topbar__rail-toggle:hover {
  background-color: var(--color-green-50);
}

.dashboard-topbar__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border-radius: var(--radius-full);
  color: var(--color-charcoal);
  flex-shrink: 0;
}

.dashboard-topbar__back:hover {
  background-color: var(--color-green-50);
}

.dashboard-topbar__title {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.dashboard-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  background-color: var(--color-green-700);
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--font-size-sm);
}

.dashboard-user-menu {
  position: relative;
}

.dashboard-user-menu__trigger {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  list-style: none;
}

.dashboard-user-menu__trigger::-webkit-details-marker {
  display: none;
}

.dashboard-user-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 16rem;
  padding: var(--space-4);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.dashboard-user-menu__name {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-charcoal);
}

.dashboard-user-menu__email {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  word-break: break-all;
}

.dashboard-user-menu__link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-charcoal);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dashboard-user-menu__link:hover {
  background-color: var(--color-green-50);
}

.dashboard-user-menu__link--danger {
  color: var(--color-red-600);
}

.dashboard-user-menu__link .icon {
  width: 1rem;
  height: 1rem;
}

/* ---------------------------------------------------------------------- */
/* Bottom tab bar (phones only — see the 768px breakpoint)                 */
/* ---------------------------------------------------------------------- */

.dashboard-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  background-color: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom);
}

:root[data-theme="dark"] .dashboard-bottom-nav {
  background-color: rgba(11, 19, 16, 0.98);
}

.dashboard-bottom-nav__link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.25rem;
  padding-block: var(--space-2);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-subtle);
}

.dashboard-bottom-nav__link .icon {
  width: 1.35rem;
  height: 1.35rem;
}

.dashboard-bottom-nav__link--active {
  color: var(--color-green-700);
}

.dashboard-bottom-nav__icon-wrap {
  position: relative;
  display: inline-flex;
}

.dashboard-bottom-nav__icon-wrap .dashboard-badge--dot {
  position: absolute;
  top: -0.1rem;
  right: -0.15rem;
  background-color: var(--color-red-600);
}

/* ---------------------------------------------------------------------- */
/* Content area                                                            */
/* ---------------------------------------------------------------------- */

.dashboard-content {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: var(--space-5) var(--space-4) calc(5.5rem + env(safe-area-inset-bottom));
}

.dashboard-messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.dashboard-page-intro {
  margin-bottom: var(--space-5);
}

.dashboard-page-intro__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-charcoal);
}

.dashboard-page-intro__description {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.dashboard-section-heading {
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-charcoal);
}

/* ---------------------------------------------------------------------- */
/* Cards, stat tiles, grids                                                */
/* ---------------------------------------------------------------------- */

.dashboard-card {
  padding: var(--space-5);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dashboard-card + .dashboard-card {
  margin-top: var(--space-4);
}

.dashboard-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.dashboard-card__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-charcoal);
}

.dashboard-card__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-green-700);
}

.dashboard-card__link:hover {
  color: var(--color-green-800);
}

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  padding-bottom: var(--space-3);
}

.dashboard-tabs__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-charcoal);
  background: var(--color-surface-muted, #f3f4f6);
}

.dashboard-tabs__link--active {
  background: var(--color-green-700);
  color: #fff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.dashboard-stat-tile {
  padding: var(--space-4);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.dashboard-stat-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  background-color: var(--color-green-100);
  color: var(--color-green-700);
}

.dashboard-stat-tile__value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-charcoal);
}

.dashboard-stat-tile__label {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------- */
/* Profile completion meter                                                */
/* ---------------------------------------------------------------------- */

.completion-meter__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-2);
}

.completion-meter__percent {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-green-700);
}

.completion-meter__track {
  height: 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--color-green-50);
  overflow: hidden;
}

.completion-meter__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background-color: var(--color-green-600);
  transition: width var(--transition-base);
}

.completion-meter__missing {
  margin-top: var(--space-4);
}

.completion-meter__missing-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
  margin-bottom: var(--space-2);
}

.completion-meter__missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ---------------------------------------------------------------------- */
/* List rows: notifications, messages, announcements, applications, menu   */
/* ---------------------------------------------------------------------- */

.dashboard-list {
  display: flex;
  flex-direction: column;
}

.dashboard-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.75rem;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.dashboard-list__item:last-child {
  border-bottom: none;
}

a.dashboard-list__item:hover {
  background-color: var(--color-green-50);
  margin-inline: calc(var(--space-4) * -1);
  padding-inline: var(--space-4);
  border-radius: var(--radius-md);
}

.dashboard-list__item--unread {
  background-color: var(--color-green-50);
  margin-inline: calc(var(--space-4) * -1);
  padding-inline: var(--space-4);
  border-radius: var(--radius-md);
}

.dashboard-list__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background-color: var(--color-green-100);
  color: var(--color-green-700);
}

.dashboard-list__icon .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.dashboard-list__body {
  flex: 1;
  min-width: 0;
}

.dashboard-list__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-charcoal);
}

.dashboard-list__link {
  color: inherit;
}

.dashboard-list__link:hover {
  color: var(--color-green-700);
}

.dashboard-list__meta {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.dashboard-list__timestamp {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.dashboard-list__actions {
  margin-top: var(--space-2);
}

.dashboard-list__chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--color-text-subtle);
  transform: rotate(-90deg);
}

/* ---------------------------------------------------------------------- */
/* Table: My Applications                                                  */
/* ---------------------------------------------------------------------- */

.dashboard-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.dashboard-table th {
  padding: var(--space-3) var(--space-3);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
  border-bottom: 1px solid var(--color-border);
}

.dashboard-table td {
  padding: var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

/* ---------------------------------------------------------------------- */
/* Timeline: Application Progress                                          */
/* ---------------------------------------------------------------------- */

.timeline {
  position: relative;
  padding-left: var(--space-6);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background-color: var(--color-border);
}

.timeline__item {
  position: relative;
  padding-bottom: var(--space-5);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -1.72rem;
  top: 0.2rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: var(--radius-full);
  background-color: var(--color-green-600);
  border: 2px solid var(--color-card);
  box-shadow: 0 0 0 2px var(--color-green-600);
}

.timeline__status {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-charcoal);
}

.timeline__note {
  margin-top: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.timeline__date {
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

/* ---------------------------------------------------------------------- */
/* Empty states                                                            */
/* ---------------------------------------------------------------------- */

.dashboard-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
}

.dashboard-empty-state__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--space-4);
  border-radius: var(--radius-full);
  background-color: var(--color-green-50);
  color: var(--color-green-700);
}

.dashboard-empty-state__icon .icon {
  width: 1.75rem;
  height: 1.75rem;
}

.dashboard-empty-state__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-charcoal);
}

.dashboard-empty-state__description {
  max-width: 24rem;
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.dashboard-empty-state__action {
  margin-top: var(--space-5);
}

/* ---------------------------------------------------------------------- */
/* Install banner                                                          */
/* ---------------------------------------------------------------------- */

.install-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  background-color: var(--color-green-900);
  color: var(--color-white);
  border-radius: var(--radius-lg);
}

.install-banner[hidden] {
  display: none;
}

.install-banner__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.12);
}

.install-banner__body {
  flex: 1;
  min-width: 0;
}

.install-banner__title {
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.install-banner__description {
  margin-top: 0.15rem;
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.75);
}

.install-banner__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.install-banner__dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-full);
}

.install-banner__dismiss:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                    */
/* ---------------------------------------------------------------------- */

.dashboard-form__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.dashboard-form__section-title {
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-charcoal);
  grid-column: 1 / -1;
}

.dashboard-form__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

/* Toggle switch for notification/privacy preferences */
.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 2.75rem;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.switch-field:last-child {
  border-bottom: none;
}

.switch-field__label {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-charcoal);
}

.switch {
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  width: 2.75rem;
  height: 1.6rem;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch__track {
  position: absolute;
  inset: 0;
  background-color: var(--color-border);
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.switch__track::before {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: var(--radius-full);
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.switch input:checked + .switch__track {
  background-color: var(--color-green-700);
}

.switch input:checked + .switch__track::before {
  transform: translateX(1.15rem);
}

.switch input:focus-visible + .switch__track {
  outline: 2px solid var(--color-green-600);
  outline-offset: 2px;
}

/* Appearance (theme) picker */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option__swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
}

.theme-option__swatch--light {
  background-color: #f2f7f4;
  color: #0f5c3c;
  border: 1px solid var(--color-border);
}

.theme-option__swatch--dark {
  background-color: #0b1310;
  color: #2bb37e;
}

.theme-option__label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-charcoal);
}

.theme-option__check {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--color-green-700);
  visibility: hidden;
}

.theme-option--selected {
  border-color: var(--color-green-700);
  background-color: var(--color-green-50);
}

.theme-option--selected .theme-option__check {
  visibility: visible;
}

/* ---------------------------------------------------------------------- */
/* Native-style bottom sheets                                              */
/* ---------------------------------------------------------------------- */

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-width: 32rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-5) calc(var(--space-6) + env(safe-area-inset-bottom));
  border: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background-color: var(--color-card);
  color: var(--color-charcoal);
  box-shadow: var(--shadow-lg);
  animation: sheet-slide-up 0.2s ease;
}

.sheet::backdrop {
  background-color: rgba(5, 46, 31, 0.55);
}

@keyframes sheet-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------------------- */
/* Scholarship application wizard                                          */
/* ---------------------------------------------------------------------- */

.wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  margin: 0 0 var(--space-6);
  padding: 0;
}

.wizard-steps__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-subtle);
}

.wizard-steps__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-weight: 600;
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.wizard-steps__marker .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.wizard-steps__item--active .wizard-steps__label {
  color: var(--color-charcoal);
  font-weight: 600;
}

.wizard-steps__item--active .wizard-steps__marker {
  border-color: var(--color-green-700);
  color: var(--color-green-700);
}

.wizard-steps__item--done .wizard-steps__marker {
  background: var(--color-green-700);
  border-color: var(--color-green-700);
  color: var(--color-white);
}

.wizard-nav {
  flex-wrap: wrap;
}

/* Institution search combobox (Step 1) */
.combobox {
  position: relative;
}

.combobox__results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-2) 0;
  list-style: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.combobox__result {
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.combobox__result:hover,
.combobox__result--active {
  background: var(--color-green-50);
}

.combobox__result-name {
  display: block;
  color: var(--color-charcoal);
  font-weight: 500;
}

.combobox__result-meta {
  display: block;
  color: var(--color-text-subtle);
  font-size: var(--font-size-xs);
}

.combobox__empty {
  padding: var(--space-2) var(--space-4);
  color: var(--color-text-subtle);
  font-size: var(--font-size-sm);
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: none;
  }
}

.sheet__handle {
  width: 2.5rem;
  height: 0.28rem;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-full);
  background-color: var(--color-border);
}

.sheet__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-charcoal);
  margin-bottom: var(--space-4);
}

.sheet__description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.sheet__description + .btn,
.sheet .btn + .btn {
  margin-top: var(--space-3);
}

.sheet__option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 3rem;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-charcoal);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.sheet__option:hover {
  background-color: var(--color-green-50);
}

.sheet__option--danger {
  color: var(--color-red-600);
}

.sheet__option .icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.sheet__close {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin-top: var(--space-3);
  padding: var(--space-3);
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-radius: var(--radius-md);
}

.sheet__close:hover {
  background-color: var(--color-green-50);
}

.sheet__field {
  margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------------- */
/* Scholars Community                                                       */
/* ---------------------------------------------------------------------- */

.community-toolbar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.community-toolbar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.community-post-card {
  padding: var(--space-4);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.community-post-card + .community-post-card {
  margin-top: var(--space-4);
}

.community-post-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.community-post-card__author {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-charcoal);
}

.community-post-card__timestamp {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.community-post-card__title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-charcoal);
}

.community-post-card__title a {
  color: inherit;
}

.community-post-card__title a:hover {
  color: var(--color-green-700);
}

.community-post-card__excerpt {
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.community-post-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.community-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  background: none;
  border: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
}

.community-action:hover {
  background-color: var(--color-green-50);
  color: var(--color-green-700);
}

.community-action .icon {
  width: 1rem;
  height: 1rem;
}

.community-action--active {
  color: var(--color-green-700);
}

.community-action--active .icon {
  color: var(--color-red-600);
  fill: var(--color-red-600);
}

.community-action--bookmark.community-action--active .icon {
  color: var(--color-gold-600);
  fill: var(--color-gold-600);
}

.community-comment {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.community-comment:last-child {
  border-bottom: none;
}

.community-comment__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.community-comment__author {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-charcoal);
}

.community-comment__timestamp {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
}

.community-comment__body {
  font-size: var(--font-size-sm);
  color: var(--color-charcoal);
}

.community-comment__footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.community-comment__replies {
  margin-top: var(--space-4);
  margin-left: var(--space-4);
  padding-left: var(--space-4);
  border-left: 2px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.community-reply-form {
  margin-top: var(--space-3);
}

.community-reply-form[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------- */
/* Touch-target floor                                                      */
/* ---------------------------------------------------------------------- */

.btn {
  min-height: 2.75rem;
  min-width: 2.75rem;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (min-width: 480px) {
  .dashboard-stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 640px) {
  .dashboard-content {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  .dashboard-form__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-form__grid--full,
  .dashboard-form__grid textarea {
    grid-column: 1 / -1;
  }
}

/* Tablet & desktop: left sidebar replaces the bottom tab bar. */
@media (min-width: 768px) {
  .dashboard-sidebar {
    display: flex;
    position: sticky;
    top: 0;
    height: 100vh;
  }

  .dashboard-topbar__rail-toggle {
    display: inline-flex;
  }

  .dashboard-topbar__logo {
    display: none;
  }

  .dashboard-bottom-nav {
    display: none;
  }

  .dashboard-content {
    padding: var(--space-8) var(--space-8) var(--space-16);
  }

  .dashboard-grid--two {
    grid-template-columns: 2fr 1fr;
  }
}
