/* ═══════════════════════════════════════════════
   SchoOla — Design System
   ═══════════════════════════════════════════════ */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);
  --border-glass: rgba(0, 0, 0, 0.1);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #eab308;
  --accent-light: #fde047;
  --accent-glow: rgba(234, 179, 8, 0.3);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --gradient-primary: linear-gradient(135deg, #facc15, #eab308, #ca8a04);
  --gradient-hero: linear-gradient(135deg, #facc15 0%, #eab308 50%, #f97316 100%);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Typography ── */
h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

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

.text-center {
  text-align: center;
}

.gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo-img {
  height: 72px;
  width: auto;
  border-radius: 8px;
}

.nav-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.nav-title-school {
  color: var(--text-primary);
}

.nav-title-ola {
  color: #f97316;
  font-weight: 800;
  text-shadow: 0 0 20px rgba(249, 115, 22, 0.25);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-family: var(--font);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-user {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #1e293b;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 60px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-outline:hover {
  background: var(--bg-glass);
  border-color: var(--accent);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ── Pages ── */
.main {
  padding-top: 4.5rem;
  flex: 1;
}

.page {
  display: none;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.page.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  margin-bottom: 0.25rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Hero ── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding: 2rem 0;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  height: 400px;
}

.hero-card {
  position: absolute;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.card-float-1 {
  top: 10%;
  right: 5%;
  animation: float1 6s ease-in-out infinite;
}

.card-float-2 {
  bottom: 10%;
  left: 5%;
  animation: float2 7s ease-in-out infinite;
}

@keyframes float1 {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

@keyframes float2 {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

/* Mini schedule card */
.ms-header {
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.ms-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.ms-day {
  width: 2.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ms-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.ms-badge.am {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
}

.ms-badge.pm {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

/* Mini burden card */
.mb-header {
  font-weight: 700;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--success);
}

.mb-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.mb-name {
  width: 3rem;
  color: var(--text-secondary);
}

.mb-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.mb-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
}

.mb-pct {
  width: 2.5rem;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Features ── */
.features {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Auth ── */
.page-auth {
  display: none;
  min-height: calc(100vh - 5rem);
}

.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 8rem);
}

.auth-card {
  max-width: 420px;
  width: 100%;
  padding: 2.5rem;
}

.auth-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.auth-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  min-height: 1.2rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--accent-light);
  text-decoration: none;
}

/* Google button */
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  gap: 0.75rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.btn-google:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Or divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

/* ── Dashboard ── */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.dash-card h3 {
  margin-bottom: 1rem;
}

.card-content {
  margin-bottom: 1rem;
  min-height: 80px;
}

.group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 0.5rem;
  transition: var(--transition);
  cursor: pointer;
}

.group-item:hover {
  background: rgba(99, 102, 241, 0.1);
}

.group-name {
  font-weight: 600;
}

.group-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-archived {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.status-owner {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
}

/* ── Invitation Cards ── */
.invitation-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-bottom: 0.75rem;
  animation: fadeIn 0.3s ease;
}

.invitation-info {
  flex: 1;
  min-width: 0;
}

.invitation-school {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.invitation-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.invitation-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}


/* ── Discovery ── */
.discovery-list {
  display: block;
}

.discovery-school-section {
  margin-bottom: 2.5rem;
}

.discovery-school-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

.discovery-school-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.discovery-school-name {
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
}

.discovery-school-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
}

.discovery-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.parent-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.parent-card:hover {
  border-color: var(--accent);
}

.parent-card-top {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.parent-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.parent-name {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.parent-distance {
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-bottom: 0.2rem;
}

.parent-seat {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Seat Compatibility Banners ── */
.seat-warning-box {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
}

.seat-warning-title {
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.seat-warning-msg {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
}

.seat-ok-box {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.625rem 1rem;
  color: var(--success);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ── Group Kids List ── */
.group-parent-block {
  margin-bottom: 1rem;
}

.group-parent-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.group-kid-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.group-kid-avatar {
  font-size: 1rem;
  flex-shrink: 0;
}

.group-kid-name {
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
}

.group-kid-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── Manage Kids Modal ── */
.manage-kid-row {
  margin-bottom: 0.75rem;
}

.manage-kid-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.manage-kid-label:hover {
  background: rgba(99, 102, 241, 0.1);
}

.manage-kid-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  flex-shrink: 0;
}


/* ── Admin ── */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.admin-section {
  max-height: 500px;
  overflow-y: auto;
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  margin-bottom: 0.5rem;
}

.admin-item-name {
  font-weight: 500;
}

.admin-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-item-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Contact Us Page ── */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.contact-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

#contact-card-issue::before   { background: linear-gradient(135deg, rgba(220, 38, 38, 0.06), rgba(220, 38, 38, 0.02)); }
#contact-card-feedback::before { background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.02)); }
#contact-card-feature::before  { background: linear-gradient(135deg, rgba(168, 85, 247, 0.06), rgba(168, 85, 247, 0.02)); }
#contact-card-contact::before  { background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(34, 197, 94, 0.02)); }

.contact-card:hover::before {
  opacity: 1;
}

.contact-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(234, 179, 8, 0.15);
}

.contact-card > * {
  position: relative;
  z-index: 1;
}

.contact-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.contact-card:hover .contact-card-icon {
  transform: scale(1.15);
}

.contact-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.contact-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Admin Messages Section ── */
.admin-messages-section {
  grid-column: 1 / -1;
  max-height: 600px;
}

/* Message Filter Tabs */
.message-filter-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-glass);
}

.message-filter-tab {
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.message-filter-tab:hover {
  background: rgba(234, 179, 8, 0.08);
  border-color: var(--accent);
  color: var(--text-primary);
}

.message-filter-tab.active {
  background: var(--gradient-primary);
  color: #1e293b;
  border-color: transparent;
  font-weight: 600;
}

/* Message List Items */
.message-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.message-item:hover {
  background: rgba(234, 179, 8, 0.06);
}

.message-unread {
  background: rgba(234, 179, 8, 0.04);
  border-left: 3px solid var(--accent);
}

.message-read {
  background: var(--bg-card);
  opacity: 0.8;
}

.message-item-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.message-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.5rem;
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.message-item-content {
  flex: 1;
  min-width: 0;
}

.message-item-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.message-item-subject {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-unread .message-item-subject {
  font-weight: 700;
}

.message-item-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.message-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
}

.message-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.message-sender {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.message-email {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Category Pills */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.category-issue {
  background: rgba(220, 38, 38, 0.12);
  color: #ef4444;
}

.category-feedback {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}

.category-feature {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

.category-contact {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

/* Unread Badge (Admin section header) */
.unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Nav Unread Badge (next to Admin link) */
.nav-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  margin-left: 0.3rem;
  vertical-align: super;
  animation: pulseDot 2s ease-in-out infinite;
}

/* Message Detail (Modal) */
.message-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.message-detail-date {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.message-detail-sender {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.message-detail-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  min-height: 80px;
  white-space: pre-wrap;
}

.message-detail-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-glass);
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  box-shadow: var(--shadow-md);
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--accent);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ── Schedule Table ── */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.schedule-table th,
.schedule-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
  font-size: 0.9rem;
}

.schedule-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.schedule-table tr:hover td {
  background: var(--bg-card);
}

.schedule-driver-select {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0.3rem 0.5rem;
  width: 100%;
  max-width: 180px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.schedule-driver-select:focus {
  outline: none;
  border-color: var(--accent);
}

.schedule-table td:last-child {
  width: 90px;
  text-align: right;
}

.schedule-save-btn {
  font-size: 0.78rem !important;
  padding: 0.3rem 0.65rem !important;
}

.btn-success {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}

.leg-am {
  color: var(--accent-light);
}

.leg-pm {
  color: #c4b5fd;
}

/* ── Schedule Action Bar ── */
.schedule-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

.schedule-action-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.schedule-action-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.schedule-action-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Ghost button */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-ghost.active,
.sched-settings-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ── Schedule Settings Panel ── */
.sched-settings-panel {
  margin-top: 0.5rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  background: rgba(15, 15, 30, 0.6);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.2s ease;
  overflow: hidden;
}

.sched-settings-inner {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sched-setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sched-setting-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sched-setting-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* Rotation type radio cards */
.rotation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.rotation-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  position: relative;
}

.rotation-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rotation-card:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.06);
}

.rotation-card.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px rgba(99, 102, 241, 0.2);
}

.rotation-card-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.rotation-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.rotation-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Unavailability rows */
.unavail-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.unavail-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: opacity 0.3s;
}

.unavail-add-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
}


/* ── Collapsible Schedule Sections ── */
.sched-collapsible {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sched-collapsible-past {
  border-color: rgba(100, 116, 139, 0.3);
  opacity: 0.92;
}

.sched-collapse-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
}

.sched-collapse-toggle:hover {
  background: rgba(99, 102, 241, 0.1);
}

.sched-collapsible-past .sched-collapse-toggle {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-secondary);
}

.sched-collapsible-past .sched-collapse-toggle:hover {
  background: rgba(100, 116, 139, 0.2);
}

.sched-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sched-toggle-icon {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.25s ease;
}

.sched-collapse-toggle.open .sched-toggle-icon {
  transform: rotate(0deg);
}

.sched-count-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
}

.sched-count-past {
  background: rgba(100, 116, 139, 0.18);
  color: var(--text-muted);
  border-color: rgba(100, 116, 139, 0.3);
}

.sched-collapse-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border-glass);
  animation: fadeIn 0.2s ease;
}

.sched-past-notice {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  background: rgba(100, 116, 139, 0.1);
  border-radius: var(--radius-sm);
  margin: 0.75rem 0 0;
  border-left: 2px solid rgba(100, 116, 139, 0.4);
}

/* Past row styling – dimmed, no hover highlight */
.past-row td {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.past-row:hover td {
  background: transparent !important;
}

.past-date-label {
  text-decoration: line-through;
  opacity: 0.7;
}

.past-driver-name {
  font-style: italic;
}

/* ── Burden Dashboard ── */
.burden-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.burden-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.burden-name {
  font-weight: 600;
  min-width: 100px;
}

.burden-bar-container {
  flex: 1;
}

.burden-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: visible;
  position: relative;
}

.burden-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient-primary);
  transition: width 0.5s ease;
}

.burden-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 100px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

/* Target share marker — a thin vertical tick on the burden bar */
.burden-target-marker {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 14px;
  background: rgba(245, 158, 11, 0.8);
  border-radius: 1px;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Badge shown on burden cards for parents with multiple children */
.burden-multikid-badge {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Target share annotation in the stats line */
.burden-target {
  font-size: 0.72rem;
  color: rgba(245, 158, 11, 0.8);
  font-weight: 600;
}

/* ── Profile Page ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-section-wide {
  grid-column: 1 / -1;
}

.profile-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.optional-tag {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
}

/* Address geocoding wrapper */
.address-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.address-input-wrap .form-input {
  flex: 1;
}

.geocode-status {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
  cursor: default;
  transition: opacity 0.3s ease;
}

/* Kids cards */
.kids-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.kid-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: var(--transition);
}

.kid-card:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.kid-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light);
  flex-shrink: 0;
}

.kid-info {
  flex: 1;
  min-width: 0;
}

.kid-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.kid-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.kid-school {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.kid-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    margin: 0 auto 2rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    height: 250px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    padding: 0.75rem 1rem;
  }

  .page {
    padding: 1.5rem 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }
}

/* ── Group Discovery Cards ── */
.group-card {
  background: var(--bg-glass);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.group-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

.group-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}

.group-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
}

.group-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.group-card-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.group-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.group-card-members {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Seat availability bar inside group card */
.seat-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.seat-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.seat-bar-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.seat-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-primary);
  transition: width 0.6s ease;
}

.seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.18);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.seat-badge-full {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Join Request Status ── */
.status-pending-join {
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-light);
}

.status-accepted {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Requester join request card */
.join-req-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 0.625rem;
  animation: fadeIn 0.3s ease;
}

.join-req-info {
  flex: 1;
  min-width: 0;
}

.join-req-group {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.join-req-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Incoming join request card (creator view) */
.incoming-req-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  margin-bottom: 0.625rem;
  animation: fadeIn 0.3s ease;
}

.incoming-req-info {
  flex: 1;
  min-width: 0;
}

.incoming-req-name {
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.incoming-req-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.incoming-req-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Group Detail — Seat Capacity Editor ── */
.seat-capacity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.seat-capacity-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.seat-capacity-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-light);
}

.seat-capacity-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.seat-capacity-edit input[type="number"] {
  width: 70px;
  padding: 0.35rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font);
  text-align: center;
}

.seat-capacity-edit input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Capacity Progress Bar (group detail) ── */
.capacity-bar-wrap {
  margin-bottom: 1.25rem;
}

.capacity-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.capacity-bar-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.capacity-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.capacity-ok {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.capacity-warn {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.capacity-full {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ── Generate Schedule Confirmation Modal ── */

.gen-sched-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.gen-sched-modal-overlay.visible {
  opacity: 1;
}

.gen-sched-modal-box {
  background: var(--bg-card);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.5rem;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04);
  transform: scale(0.93) translateY(12px);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gen-sched-modal-overlay.visible .gen-sched-modal-box {
  transform: scale(1) translateY(0);
}

.gen-sched-modal-icon {
  font-size: 2rem;
  line-height: 1;
  text-align: center;
}

.gen-sched-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin: 0;
}

.gen-sched-modal-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
  line-height: 1.55;
}

.gen-sched-modal-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.gen-sched-warning-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.gen-sched-modal-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gen-sched-modal-options-single {
  margin-top: 0.25rem;
}

.gen-sched-option {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  background: var(--bg-glass);
  border: 1.5px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.15s;
  color: var(--text-primary);
  font-family: inherit;
}

.gen-sched-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

.gen-sched-option:disabled {
  cursor: not-allowed;
}

/* Override option — warm orange tint */
#gen-opt-override:hover:not(:disabled) {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

/* Preserve option — green tint */
.gen-sched-option-preserve:hover:not(:disabled) {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.gen-sched-option-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.gen-sched-option-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gen-sched-option-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.gen-sched-option-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.gen-sched-cancel {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0.25rem;
  align-self: center;
  transition: color 0.15s;
  font-family: inherit;
}

.gen-sched-cancel:hover {
  color: var(--text-secondary);
}

/* ── App Footer ── */
.app-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: auto; /* Push to bottom if needed */
  background: transparent;
  color: var(--text-muted);
}

.app-footer-links {
  margin-bottom: 0.5rem;
}

.app-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin: 0 0.75rem;
  font-weight: 500;
  font-size: 0.75rem;
  transition: var(--transition);
}

.app-footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.app-footer-copy {
  font-size: 0.7rem;
  opacity: 0.8;
}

/* ══════════════════════════════════════════════
   Subscription — Badge, Modal, Page
   ══════════════════════════════════════════════ */

/* ── Nav Tier Badge ── */
.subscription-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.subscription-badge.premium {
  background: var(--gradient-primary);
  color: #1e293b;
  box-shadow: 0 0 16px var(--accent-glow);
}

.subscription-badge.premium:hover {
  box-shadow: 0 0 28px var(--accent-glow);
  transform: translateY(-1px);
}

.subscription-badge.free {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.subscription-badge.free:hover {
  background: rgba(234, 179, 8, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Upgrade Modal ── */
.upgrade-modal-content {
  text-align: center;
  padding: 0.5rem 0;
}

.upgrade-modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upgrade-modal-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* ── Subscription Page ── */
.page-subscription {
  max-width: 900px;
}

/* Current plan status card */
.subscription-status-card {
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.08), rgba(202, 138, 4, 0.05));
  border-color: rgba(234, 179, 8, 0.3);
}

.subscription-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.subscription-status-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.subscription-status-tier {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub-status-line {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-glass);
}

.sub-status-line:first-child {
  border-top: none;
}

/* Feature grid (shown when free) */
.subscription-features-free {
  margin-bottom: 2.5rem;
}

.sub-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.sub-feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.sub-feature-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
}

.sub-feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.sub-feature-card h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.sub-feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Stripe Pricing Table container */
.stripe-pricing-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── Help Page Tabs ── */
.help-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .help-layout {
    grid-template-columns: 1fr;
  }
}

.help-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: fit-content;
}

.help-tab {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-weight: 500;
  border: 1px solid transparent;
}

.help-tab:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.help-tab.active {
  background: var(--gradient-primary);
  color: #1e293b;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.help-content-area {
  padding: 1.5rem;
}

.help-section {
  display: none;
}

.help-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}