/* ============================================================
   EduPulse SaaS Design System (Modern Minimalist UI)
   Clean Light Workspace + Crisp Left Sidebar + Inter Typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Color Palette */
  --bg-canvas: #f9fafb;
  --bg-subtle: #f3f4f6;
  --surface: #ffffff;
  --surface-hover: #f3f4f6;
  --ink: #1e3a8a;

  /* Typography */
  --text-primary: #1e293b;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  /* Borders & Dividers */
  --border-light: #e5e7eb;
  --border-subtle: #d1d5db;
  --border-focus: #2563eb;

  /* Primary Brand (EduPulse Electric Blue) */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #dbeafe;

  /* Accents */
  --success: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --purple: #7c3aed;
  --purple-light: #f5f3ff;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(16, 24, 40, 0.06), 0 1px 2px -1px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(16, 24, 40, 0.08), 0 4px 8px -4px rgba(16, 24, 40, 0.03);
  --shadow-modal: 0 20px 40px -8px rgba(16, 24, 40, 0.16);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Screen-reader and Search-Engine crawler semantic accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

html, body {
  min-height: 100%;
  width: 100%;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  line-height: 1.5;
}

body {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   1. CLEAN TOP NAVBAR (Clean Brand on Left, Lang & Profile on Right)
   ============================================================ */
.rb-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.rb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.rb-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.rb-brand-text {
  display: flex;
  flex-direction: column;
}

.rb-brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rb-brand-tagline {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Download & Install Chrome App Pill Button */
.install-pill-btn {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.install-pill-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.install-pill-btn.pulse {
  animation: pulseHighlight 2s infinite;
}

@keyframes pulseHighlight {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* In-App PWA Install Banner (On Auth / Home pages) */
.pwa-install-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-install-banner:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pwa-install-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Compact Language Switcher Pill (Top Right Corner) */
.lang-pill-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.lang-pill-btn:hover {
  background: #ffffff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* User Session Status Chip & Logout Button */
.user-chip {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logout-icon-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: transform 0.15s;
}

.logout-icon-btn:hover {
  transform: scale(1.1);
}

/* ============================================================
   2. APP CONTAINER & TRUE RESPONSIVE FLUID LAYOUT
   ============================================================ */
.app-container {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 12px 10px 80px 10px; /* bottom padding for floating bar */
}

/* Fluid Wrapper (No artificial phone borders) */
.mobile-wrapper {
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: calc(100vh - 120px);
}

/* Screen Header */
.screen-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.school-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.school-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.school-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
}

.school-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.subscription-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid var(--success-border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Screen Scrollable Body */
.screen-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--bg-canvas);
}

/* ============================================================
   3. AUTHENTICATION & REGISTRATION SCREEN (Clean Modern Style)
   ============================================================ */
.auth-card {
  max-width: 460px;
  margin: 10px auto;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}

.auth-icon-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

/* Auth Role Selector Tabs */
.auth-role-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
}

.auth-role-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 6px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.auth-role-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* Sign In / Register Mode Switch */
.auth-mode-switch {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 18px;
}

.auth-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 0;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.18s;
}

.auth-mode-btn.active {
  color: var(--primary);
  font-weight: 800;
}

.auth-mode-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

/* OTP Input Boxes */
.otp-box {
  width: 48px;
  height: 54px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-primary);
  transition: all 0.15s;
}

.otp-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ============================================================
   4. CARDS & WIDGETS
   ============================================================ */
.content-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.content-card-title {
  font-family: var(--font-heading);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Student Banner (Profile) */
.student-banner {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.student-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--primary-border);
  object-fit: cover;
  flex-shrink: 0;
}

.student-details h3 {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* Badges */
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }
.badge-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.badge-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-danger { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger-border); }
.badge-purple { background: var(--purple-light); color: var(--purple); border: 1px solid #ddd6fe; }

/* Grid Quick Action Cards */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

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

.quick-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-xs);
}

.quick-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.quick-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-card:hover .quick-card-icon {
  transform: scale(1.08) translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quick-card h4 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-card p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Audio Player */
.audio-card {
  background: #ffffff;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.audio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.audio-speaker {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-player-btn {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.18s;
}

.audio-player-btn:hover { background: var(--primary-hover); }

.audio-player-btn.playing {
  background: linear-gradient(135deg, #ea580c, #f97316);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.35);
  animation: pulse-voice 1.5s infinite;
}

.audio-player-btn.loading {
  background: var(--text-muted);
  cursor: wait;
}

@keyframes pulse-voice {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.audio-transcript {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-style: italic;
  line-height: 1.45;
}

/* Attendance Pills */
.attendance-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.att-day {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  min-width: 64px;
  text-align: center;
  flex-shrink: 0;
}

.att-day.present { border-color: var(--success-border); background: var(--success-light); }
.att-day.absent { border-color: var(--danger-border); background: var(--danger-light); }
.att-day.holiday { border-color: var(--warning-border); background: var(--warning-light); }

.att-day-name { font-size: 0.66rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.att-day-num { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 800; margin: 2px 0; color: var(--text-primary); }
.att-day-badge { font-size: 0.66rem; font-weight: 800; padding: 2px 6px; border-radius: var(--radius-full); }

/* Fee Summary */
.fee-summary-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}

.fee-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.fee-row.total {
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
  margin-top: 6px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--danger);
}

/* Printable Digital Receipt */
.receipt-paper {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  font-size: 0.8rem;
  box-shadow: var(--shadow-xs);
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.receipt-header h4 { font-family: var(--font-heading); font-size: 1rem; color: var(--text-primary); }
.receipt-stamp {
  display: inline-block;
  border: 2px solid var(--success);
  color: var(--success);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  transform: rotate(-3deg);
  margin-top: 10px;
}

/* ============================================================
   5. BUTTONS & INPUT CONTROLS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #ffffff; box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #ffffff; }
.btn-success:hover { background: #047857; }
.btn-outline { background: #ffffff; border: 1px solid var(--border-subtle); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-subtle); color: var(--text-primary); }
.btn-sm { padding: 4px 10px; font-size: 0.74rem; }
.btn-block { width: 100%; }

/* Form Inputs */
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  background: #ffffff;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

@media (min-width: 768px) {
  .form-input, .form-select, .form-textarea {
    font-size: 0.86rem;
  }
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ============================================================
   6. FLOATING BOTTOM NAVIGATION (Mobile-Optimized for Android & iOS)
   ============================================================ */
.mobile-nav-bar {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px -5px rgba(16, 24, 40, 0.12);
  padding: 6px 8px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 99;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-full);
  border: none;
  background: none;
  transition: all 0.15s;
  flex: 1;
}

.mobile-nav-item svg {
  width: 19px;
  height: 19px;
  margin-bottom: 2px;
}

.mobile-nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 700;
}

/* ============================================================
   7. MODALS & UTILITIES
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.modal-overlay.active { display: flex; }

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 18px;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-muted);
}

.fade-in {
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   8. RESPONSIVE OPTIMIZATIONS (Android, iOS & Web)
   ============================================================ */

/* iOS Notch & Android Navigation Safe-Area Support */
@supports (padding: max(0px)) {
  .rb-navbar {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .mobile-nav-bar {
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .app-container {
    padding-bottom: max(84px, calc(72px + env(safe-area-inset-bottom)));
  }
}

/* Mobile Screens (Android & iOS Phones) */
@media (max-width: 640px) {
  .app-container {
    padding: 0 0 calc(80px + env(safe-area-inset-bottom, 0px)) 0;
  }

  .mobile-wrapper {
    max-width: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
    min-height: calc(100vh - 56px);
  }

  .screen-header {
    padding: 10px 14px;
  }

  .screen-body {
    padding: 12px 12px 24px 12px;
  }

  .auth-card {
    margin: 4px auto;
    padding: 20px 14px;
    border-radius: var(--radius-md);
    box-shadow: none;
    border: 1px solid var(--border-light);
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .quick-card {
    padding: 12px 10px;
  }

  .quick-card h4 {
    font-size: 0.85rem;
  }

  .content-card {
    padding: 14px 12px;
  }

  .student-banner {
    padding: 14px 12px;
  }

  .mobile-nav-bar {
    width: calc(100% - 16px);
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    padding: 5px 6px;
  }

  .mobile-nav-item {
    font-size: 0.65rem;
    padding: 3px 4px;
  }

  .mobile-nav-item svg {
    width: 18px;
    height: 18px;
  }

  .rb-navbar {
    padding: 8px 12px;
  }

  .rb-brand-title {
    font-size: 0.98rem;
  }

  .rb-brand-icon {
    width: 32px;
    height: 32px;
  }

  .install-pill-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
  }

  .lang-pill-btn {
    padding: 4px 9px;
    font-size: 0.72rem;
  }

  .user-chip {
    padding: 3px 8px;
    font-size: 0.72rem;
  }
}

/* Tablet & Desktop (Web View) */
@media (min-width: 641px) {
  .app-container {
    padding: 20px 16px 90px 16px;
  }

  .mobile-wrapper {
    max-width: 820px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
  }

  .screen-body {
    padding: 20px 24px;
  }

  .quick-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   WEB & DESKTOP OPTIMIZATION FOR SCHOOL PORTAL (.portal-mode)
   ============================================================ */

/* Subscription Grid Default (Mobile Phone / Android / iOS) */
.subscription-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.subscription-tier-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.subscription-tier-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tablet Screens (641px - 899px) */
@media (min-width: 641px) and (max-width: 899px) {
  .subscription-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Tablet, Laptop & Desktop View (900px and up) */
@media (min-width: 900px) {
  .mobile-wrapper.portal-mode {
    max-width: 1440px;
    width: calc(100% - 28px);
    border-radius: 14px;
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  }

  .app-container.portal-mode {
    padding: 14px 14px 36px 14px;
    max-width: 100%;
  }

  .mobile-wrapper.portal-mode .screen-body {
    padding: 0;
  }

  /* 3-Column Plan Grid on Desktop */
  .portal-mode .subscription-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  /* Two-column dashboard layout on Desktop */
  .portal-mode .portal-desktop-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 20px;
    align-items: flex-start;
  }

  /* Wider quick-grid stats on Desktop */
  .portal-mode .quick-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

/* Wide Desktop Screens (1280px and up) */
@media (min-width: 1280px) {
  .mobile-wrapper.portal-mode {
    max-width: 1520px;
    width: calc(100% - 32px);
  }

  .mobile-wrapper.portal-mode .screen-body {
    padding: 0;
  }
}

/* Print Invoice Styles */
@media print {
  body * {
    visibility: hidden;
  }
  #genericModal, #genericModal * {
    visibility: visible;
  }
  #genericModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .modal-content {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    padding: 12px !important;
  }
  .modal-header button,
  .modal-content button,
  .modal-content a.btn,
  #printableInvoiceDoc button {
    display: none !important;
  }
}

/* ============================================================
   9. WORLD-CLASS SAAS LANDING PAGE (Clean Modern Theme)
   ============================================================ */

/* Full-width container mode for Landing Page */
.mobile-wrapper.landing-mode {
  max-width: 1200px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: auto !important;
}

.app-container.landing-mode {
  padding: 0 !important;
  max-width: 100% !important;
}

.landing-page-root {
  width: 100%;
  color: var(--text-primary);
  background: linear-gradient(180deg, #fcfcfd 0%, #f8fafc 100%);
  padding-bottom: 60px;
}

/* 1. Hero Section */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 50px 20px 30px;
  max-width: 980px;
  margin: 0 auto;
}

.hero-pill {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-full);
  padding: 5px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e40af;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.08);
}

.hero-pill-badge {
  background: #2563eb;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.95rem;
    line-height: 1.2;
  }
}

.hero-gradient-text {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #475569;
  max-width: 740px;
  margin: 0 auto 28px;
}

@media (max-width: 640px) {
  .hero-subtitle {
    font-size: 0.88rem;
    margin-bottom: 22px;
  }
}

.hero-cta-group {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-lg {
  padding: 12px 26px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.hero-demo-bar {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
  justify-content: center;
}

.hero-demo-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-demo-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.demo-chip {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
}

.demo-chip:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.demo-chip.owner {
  background: var(--purple-light);
  color: var(--purple);
  border-color: #ddd6fe;
}

.hero-stats-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 18px 24px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  flex-wrap: wrap;
}

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

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e3a8a;
}

.stat-label {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-light);
}

@media (max-width: 640px) {
  .stat-divider {
    display: none;
  }
  .hero-stats-strip {
    gap: 16px;
    padding: 14px;
  }
}

/* 2. Interactive Showcase Section */
.landing-showcase-section {
  padding: 40px 16px;
  max-width: 960px;
  margin: 0 auto;
}

.showcase-header {
  text-align: center;
  margin-bottom: 24px;
}

.section-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .section-title {
    font-size: 1.4rem;
  }
}

.section-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 20px;
}

.showcase-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

.showcase-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
}

.showcase-tab-btn.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.showcase-frame {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.showcase-frame-header {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.browser-address-bar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: 0.74rem;
  color: var(--text-muted);
  flex: 1;
  max-width: 480px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.showcase-screen-body {
  padding: 20px;
  background: #fafbfc;
  min-height: 200px;
}

.showcase-content-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
}

/* 3. Bento Features Grid */
.landing-bento-section {
  padding: 50px 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

.bento-span-2 {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .bento-span-2 {
    grid-column: span 1;
  }
}

.bento-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bento-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover .bento-icon {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.bento-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bento-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.bento-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.bento-mockup {
  margin-top: 14px;
}

/* 4. Pricing Grid */
.landing-pricing-section {
  padding: 50px 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.pricing-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: all 0.2s ease;
}

.pricing-featured {
  border: 2px solid var(--primary);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.12);
  background: var(--primary-light);
}

.pricing-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.pricing-badge-popular {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #ffffff;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.pricing-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 8px 0 4px;
}

.pricing-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 38px;
  line-height: 1.4;
}

.pricing-price {
  font-family: var(--font-heading);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 16px 0;
}

.pricing-cycle {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 24px;
  padding: 0;
}

/* 5. FAQ Accordion */
.landing-faq-section {
  padding: 40px 16px;
  max-width: 760px;
  margin: 0 auto;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease;
}

.faq-question {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.faq-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-answer {
  display: none;
  padding: 0 18px 14px 18px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-item.active .faq-arrow {
  transform: rotate(45deg);
}

/* 6. High Converting CTA Banner */
.landing-cta-banner {
  margin: 40px 16px 20px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  border-radius: var(--radius-lg);
  padding: 46px 24px;
  text-align: center;
  box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.3);
}

/* 7. Modern SaaS Footer */
.landing-footer {
  border-top: 1px solid var(--border-light);
  padding: 36px 24px 20px;
  max-width: 1080px;
  margin: 40px auto 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.78rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
}

/* Responsive adjustments for Cloud DB Badge */
@media (max-width: 520px) {
  #cloudDbStatusBadge span {
    display: none;
  }
  #cloudDbStatusBadge {
    padding: 4px 6px;
  }
}

/* Smooth Sliding ON/OFF Switch Component */
.ep-switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.ep-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.ep-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ep-switch-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background-color 0.22s ease, box-shadow 0.22s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16);
}

.ep-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.ep-switch input:checked + .ep-switch-slider {
  background: #16a34a;
}

.ep-switch input:checked + .ep-switch-slider::before {
  transform: translateX(22px);
}

.ep-switch input:focus-visible + .ep-switch-slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ep-switch-text {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  min-width: 28px;
}

.ep-switch-text.on {
  color: #15803d;
}

.ep-switch-text.off {
  color: #991b1b;
}

/* ============================================================
   MODERN SAAS SIDEBAR SHELL & 2-COLUMN BILLING (ReplyBird Style)
   ============================================================ */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.ep-saas-shell {
  display: flex;
  min-height: calc(100vh - 96px);
  background: var(--bg-canvas);
  position: relative;
}

.ep-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border-light);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.ep-sidebar-school {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ep-sidebar-school-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1e3a8a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-sidebar-school-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 3px;
}

.ep-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #10b981;
  display: inline-block;
  flex-shrink: 0;
}

.ep-nav-scroll {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ep-nav-group-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  padding: 12px 10px 4px;
}

.ep-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #4b5563;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.ep-nav-item:hover {
  background: #f3f4f6;
  color: #111827;
}

.ep-nav-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.24);
}

.ep-nav-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ep-nav-item-left span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ep-nav-count {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
}

.ep-nav-item.active .ep-nav-count {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.ep-sidebar-footer {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ep-sidebar-plan-box {
  background: #f9fafb;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 12px;
}

.ep-main-workspace {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
  background: var(--bg-canvas);
}

.ep-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.ep-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin: 0;
}

.ep-page-subtitle {
  font-size: 0.84rem;
  color: #6b7280;
  margin-top: 4px;
}

.ep-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ep-btn-ink {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid #2563eb;
  border-radius: 8px;
  padding: 9px 15px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.24);
  transition: background-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.ep-btn-ink:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.ep-btn-ink:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.ep-btn-ghost {
  background: #ffffff;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ep-btn-ghost:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* 2-Column Billing Layout matching reference video */
.ep-billing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr);
  gap: 20px;
  align-items: start;
}

.ep-plan-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ep-plan-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ep-plan-box.is-current {
  border: 1.5px solid #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.ep-segmented {
  display: inline-flex;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 3px;
  border-radius: 8px;
  gap: 2px;
}

.ep-segmented button {
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
}

.ep-segmented button.active {
  background: #ffffff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}

.ep-mobile-bar {
  display: none;
}

@media (max-width: 1120px) {
  .ep-billing-grid {
    grid-template-columns: 1fr;
  }
  .ep-plan-matrix {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 899px) {
  .ep-saas-shell {
    flex-direction: column;
    min-height: auto;
  }
  .ep-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    gap: 8px;
  }
  .ep-sidebar {
    display: none;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .ep-sidebar.open {
    display: flex;
  }
  .ep-main-workspace {
    padding: 16px;
  }
}

/* ============================================================
   Female AI Co-Founder Split-Screen Studio (Orb + Synced Cards + Live Preview)
   ============================================================ */
.cf-studio-topbar {
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 55%, #eff6ff 100%);
  border: 1.5px solid #ddd6fe;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cf-studio-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cf-avatar-dot {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a855f7 0%, #4f46e5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 6px 14px rgba(124, 58, 237, 0.25);
  flex-shrink: 0;
}

.cf-studio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cf-split-grid {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.cf-left-pane {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.cf-orb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: radial-gradient(circle at center, #f5f3ff 0%, #ffffff 75%);
  border-radius: 12px;
}

.cf-orb-ring {
  width: 78px;
  height: 78px;
  border-radius: 999px;
  padding: 4px;
  background: conic-gradient(from 0deg, #a855f7, #ec4899, #4f46e5, #06b6d4, #a855f7);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.26);
}

.cf-orb-ring:hover {
  transform: scale(1.04);
}

.cf-orb-ring.is-speaking {
  animation: cfOrbSpin 2.4s linear infinite, cfOrbPulse 1.3s ease-in-out infinite;
}

.cf-orb-ring.is-listening {
  background: conic-gradient(from 0deg, #10b981, #06b6d4, #22c55e, #10b981);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.16), 0 8px 22px rgba(16, 185, 129, 0.35);
}

.cf-orb-core {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cf-orb-glyph {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6d28d9;
  letter-spacing: -0.02em;
}

.cf-wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
  margin-top: 2px;
}

.cf-wave-bars span {
  width: 2.5px;
  height: 4px;
  background: #7c3aed;
  border-radius: 99px;
  transition: height 0.2s ease;
}

.cf-orb-ring.is-speaking .cf-wave-bars span {
  animation: cfWaveBar 0.7s ease-in-out infinite alternate;
}

.cf-orb-ring.is-speaking .cf-wave-bars span:nth-child(2) { animation-delay: 0.12s; }
.cf-orb-ring.is-speaking .cf-wave-bars span:nth-child(3) { animation-delay: 0.24s; }
.cf-orb-ring.is-speaking .cf-wave-bars span:nth-child(4) { animation-delay: 0.18s; }
.cf-orb-ring.is-speaking .cf-wave-bars span:nth-child(5) { animation-delay: 0.08s; }

.cf-beats-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.cf-beat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  padding: 9px 11px;
  box-shadow: var(--shadow-xs);
  animation: cfCardSlide 0.28s ease-out;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cf-beat-card.is-active {
  border: 1.5px solid #8b5cf6;
  background: #faf5ff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.12);
}

.cf-goahead-bar {
  margin-top: 10px;
  background: linear-gradient(135deg, #f5f3ff 0%, #eff6ff 100%);
  border: 1.5px solid #c4b5fd;
  border-radius: 12px;
  padding: 10px;
}

.cf-command-box {
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

.cf-right-pane {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.cf-canvas-chrome {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cf-canvas-body {
  padding: 18px;
  flex: 1;
  background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
  min-height: 290px;
  overflow: hidden;
}

.cf-celebrate-banner {
  background: linear-gradient(90deg, #059669, #10b981);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}

.cf-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 20;
}

.cf-confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: cfConfettiFall 2s ease-out forwards;
}

@keyframes cfOrbSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes cfOrbPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.16), 0 8px 24px rgba(139, 92, 246, 0.28); }
  50% { box-shadow: 0 0 0 10px rgba(236, 72, 153, 0.18), 0 12px 28px rgba(139, 92, 246, 0.4); }
}

@keyframes cfWaveBar {
  0% { height: 4px; }
  100% { height: 14px; }
}

@keyframes cfCardSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cfConfettiFall {
  0% { top: -10px; opacity: 1; }
  100% { top: 105%; opacity: 0; transform: translateY(30px) rotate(540deg); }
}

@media (max-width: 960px) {
  .cf-split-grid {
    grid-template-columns: 1fr;
  }
}





