/* ============================================
   TurniCheck - Document Similarity & AI Detection
   Modern, Professional CSS Styles
   ============================================ */

/* Hide reCAPTCHA badge — usage disclosed in Terms/Privacy */
.grecaptcha-badge {
  visibility: hidden !important;
}

/* CSS Variables */
:root {
  /* Primary Colors */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --primary-dark: #3730A3;
  --primary-gradient: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);

  /* Status Colors */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --warning-bg: #fef3c7;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* Neutrals — Slate palette for cooler, modern look */
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Typography — Plus Jakarta Sans */
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows — tinted with primary for brand depth */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 8px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(79, 70, 229, 0.04);
  --shadow-lg: 0 12px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -4px rgba(79, 70, 229, 0.06);
  --shadow-xl: 0 20px 32px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -6px rgba(79, 70, 229, 0.06);
  --shadow-primary: 0 4px 12px rgba(79, 70, 229, 0.15);

  /* Border Radius — slightly larger for modern SaaS feel */
  --radius-sm: 0.375rem;
  --radius: 0.625rem;
  --radius-md: 0.875rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 70px;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.language-switcher button {
  border: 0;
  background: transparent;
  color: var(--gray-500);
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  min-width: 2.25rem;
  min-height: 2rem;
  font: 700 0.75rem/1 var(--font-family);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.language-switcher button:hover {
  color: var(--gray-900);
  background: var(--gray-100);
}

.language-switcher button.active {
  color: var(--white);
  background: var(--primary);
  box-shadow: var(--shadow-primary);
}

.language-switcher button:active {
  transform: scale(0.96);
}

.language-switcher-floating {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1200;
  display: none;
}

.language-switcher-inline {
  margin-right: 0.5rem;
}

.language-switcher-sidebar {
  width: 100%;
  justify-content: center;
  margin-bottom: 0.75rem;
}

[data-theme="dark"] .language-switcher {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.28);
}

[data-theme="dark"] .language-switcher button:hover {
  color: var(--gray-50);
  background: rgba(148, 163, 184, 0.16);
}

@media (max-width: 768px) {
  .language-switcher-inline {
    display: none;
  }

  .language-switcher-floating {
    display: inline-flex;
  }
}

/* ==========================================
   Site-wide Notice Banner
   ========================================== */
.site-banner {
  position: sticky;
  top: 0;
  z-index: 10000;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.site-banner.hidden {
  display: none;
}
.site-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-banner-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}
.site-banner-text {
  flex: 1;
  font-weight: 500;
}
.site-banner-detail-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.4);
  color: inherit;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.site-banner-detail-btn:hover {
  background: rgba(255,255,255,0.4);
}
.site-banner-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 0.25rem;
  line-height: 1;
  transition: opacity 0.2s;
}
.site-banner-close:hover {
  opacity: 1;
}
/* Banner type variants */
.site-banner.is-info {
  background: var(--info);
  color: #fff;
}
.site-banner.is-warning {
  background: var(--warning);
  color: #78350f;
}
.site-banner.is-warning .site-banner-detail-btn {
  border-color: rgba(120,53,15,0.3);
  background: rgba(120,53,15,0.1);
}
.site-banner.is-warning .site-banner-detail-btn:hover {
  background: rgba(120,53,15,0.2);
}
.site-banner.is-success {
  background: var(--success);
  color: #fff;
}
.site-banner.is-error {
  background: var(--error);
  color: #fff;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ============================================
   LANDING / INTRODUCTION PAGE
   Turnitin-inspired: deep navy, teal accents, bold typography
   ============================================ */
.landing {
  --ln-navy: #1A2332;
  --ln-navy-light: #243044;
  --ln-teal: #00B8A9;
  --ln-teal-dark: #009B8D;
  --ln-teal-light: rgba(0, 184, 169, 0.12);
  --ln-blue: #2563EB;
  --ln-white: #FFFFFF;
  --ln-gray: #94A3B8;
  --ln-gray-light: #F1F5F9;
  font-family: var(--font-family);
  color: var(--gray-800);
  background: var(--ln-white);
  overflow-x: hidden;
}

/* -- Nav -- */
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 2rem;
  transition: background 0.3s, box-shadow 0.3s, padding 0.3s;
}
.landing-nav.scrolled {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
  backdrop-filter: blur(12px);
}
.landing-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--ln-navy);
}
.landing-logo-img {
  height: 36px;
  width: 36px;
  object-fit: contain;
}
.landing-nav.scrolled .landing-logo { color: var(--ln-navy); }
.landing-nav:not(.scrolled) .landing-logo { color: var(--ln-white); }

.landing-nav-links {
  display: flex;
  gap: 2rem;
}
.landing-nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.landing-nav:not(.scrolled) .landing-nav-links a { color: rgba(255,255,255,0.8); }
.landing-nav:not(.scrolled) .landing-nav-links a:hover { color: var(--ln-white); }
.landing-nav.scrolled .landing-nav-links a { color: var(--gray-600); }
.landing-nav.scrolled .landing-nav-links a:hover { color: var(--ln-navy); }

.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.landing-nav:not(.scrolled) .landing-login-btn {
  color: var(--ln-white);
  border-color: rgba(255,255,255,0.4);
}
.landing-nav:not(.scrolled) .landing-login-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--ln-white);
}
.landing-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.landing-nav:not(.scrolled) .landing-mobile-toggle svg { color: var(--ln-white); }
.landing-nav.scrolled .landing-mobile-toggle svg { color: var(--ln-navy); }

.landing-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem 1.5rem 1.5rem;
  background: var(--ln-white);
  border-top: 1px solid var(--gray-200);
}
.landing-mobile-menu a {
  padding: 0.75rem 0;
  color: var(--gray-700);
  font-weight: 500;
  text-decoration: none;
}
.landing-mobile-menu hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 0.5rem 0;
}

/* -- Hero -- */
.landing-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 2rem 80px;
  overflow: hidden;
  gap: 3rem;
}
.landing-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0F172A 0%, #1E293B 30%, #1A2332 50%, #0C4A6E 70%, #164E63 100%);
  background-size: 200% 200%;
  animation: heroGradientShift 20s ease infinite;
  z-index: 0;
}
.landing-hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}
.landing-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(0,184,169,0.15);
  border: 1px solid rgba(0,184,169,0.3);
  border-radius: 999px;
  color: var(--ln-teal);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.75rem;
}
.landing-hero-badge svg { width: 16px; height: 16px; }

.landing-hero h1 {
  font-size: 3.75rem;
  font-weight: 800;
  color: var(--ln-white);
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.landing-gradient-text {
  background: linear-gradient(135deg, var(--ln-teal), #60A5FA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.landing-hero-sub {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.landing-hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}
.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 600;
  transition: color 0.2s;
  text-decoration: none;
}
.btn-ghost:hover { color: var(--ln-white); }
.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ln-white);
  color: var(--ln-navy);
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-weight: 700;
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}
.btn-white:hover {
  background: var(--gray-100);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.landing-hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
}
.landing-stat {
  text-align: center;
}
.landing-stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--ln-white);
}
.landing-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}
.landing-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}

/* -- Scroll indicator -- */
.landing-scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.4);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  animation: scrollBounce 2s ease-in-out infinite;
  z-index: 2;
}
.landing-scroll-indicator svg {
  width: 20px;
  height: 20px;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* -- Trust Banner -- */
.landing-trust {
  background: var(--ln-navy);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 0 2rem;
}
.landing-trust-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.landing-trust-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 1.5rem;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.landing-trust-item:last-child { border-right: none; }
.landing-trust-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(0,184,169,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.landing-trust-icon svg {
  width: 22px;
  height: 22px;
  color: var(--ln-teal);
}
.landing-trust-item strong {
  display: block;
  color: var(--ln-white);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}
.landing-trust-item span {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}

/* -- Sections -- */
.landing-section {
  padding: 6rem 2rem;
}
.landing-section-alt {
  background: var(--ln-gray-light);
}
.landing-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.landing-section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}
.landing-tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: var(--ln-teal-light);
  color: var(--ln-teal-dark);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}
.landing-section-header h2 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--ln-navy);
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}
.landing-section-header p {
  font-size: 1.15rem;
  color: var(--gray-500);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

/* -- Feature Cards -- */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.landing-feature-card {
  background: var(--ln-white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 2rem;
  transition: transform 0.25s, box-shadow 0.25s;
}
.landing-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}
.landing-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.landing-feature-icon svg { width: 26px; height: 26px; color: var(--ln-white); }
.landing-feature-icon.plag { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.landing-feature-icon.ai { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.landing-feature-icon.report { background: linear-gradient(135deg, var(--ln-teal-dark), var(--ln-teal)); }

.landing-feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ln-navy);
  margin-bottom: 0.6rem;
}
.landing-feature-card > p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.landing-feature-list {
  list-style: none;
  padding: 0;
}
.landing-feature-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  padding: 0.3rem 0;
}
.landing-feature-list li svg {
  width: 16px;
  height: 16px;
  color: var(--ln-teal);
  flex-shrink: 0;
}

/* -- Hero Split Layout -- */
.landing-hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
}
.landing-hero-inner .landing-hero-content {
  max-width: none;
  text-align: left;
}
.landing-hero-inner .landing-hero-content .landing-hero-sub {
  margin: 0 0 2.5rem;
}
.landing-hero-inner .landing-hero-cta {
  justify-content: flex-start;
}
.landing-hero-inner .landing-hero-badge {
  justify-content: flex-start;
}
.landing-accent-text {
  background: linear-gradient(135deg, var(--ln-teal), #60A5FA);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.btn-accent {
  background: var(--ln-teal);
  color: #fff;
  border: none;
}
.btn-accent:hover {
  background: var(--ln-teal-dark);
}

/* Hero Visual — Turnitin Report Preview */
.landing-hero-visual {
  display: flex;
  justify-content: center;
}

/* Report preview container — stacked pages effect */
.landing-report-preview {
  position: relative;
  width: 100%;
  max-width: 360px;
  perspective: 800px;
}

/* Background page — peeking out behind */
.landing-report-page-bg {
  position: absolute !important;
  top: 12px;
  left: 12px;
  right: -12px;
  z-index: 0 !important;
  opacity: 0.5;
  transform: rotate(2deg);
  pointer-events: none;
}

/* Main report page */
.landing-report-page {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
}

.landing-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #E5E7EB;
  background: #FAFAFA;
}
.landing-report-logo {
  height: 18px;
  width: auto;
  color: #1A2332;
}
.landing-report-page-label {
  font-size: 0.65rem;
  color: #6B7280;
  font-weight: 500;
}

.landing-report-body {
  padding: 1.25rem;
}

/* AI Writing Overview section */
.landing-report-ai-section {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.landing-report-ai-score {
  flex-shrink: 0;
}
.landing-report-ai-pct {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #10B981;
  line-height: 1;
  letter-spacing: -0.02em;
}
.landing-report-ai-text {
  font-size: 0.7rem;
  color: #6B7280;
  font-weight: 500;
  white-space: nowrap;
}
.landing-report-caution {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  color: #166534;
  line-height: 1.4;
  flex: 1;
}

.landing-report-divider {
  height: 1px;
  background: #E5E7EB;
  margin: 0.75rem 0;
}

/* Detection Groups */
.landing-report-groups-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 0.6rem;
}
.landing-report-group-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
}
.landing-report-group-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.landing-report-group-label {
  font-size: 0.7rem;
  color: #4B5563;
  flex: 1;
}
.landing-report-group-val {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1F2937;
  font-variant-numeric: tabular-nums;
}

/* Similarity page content */
.landing-report-sim-bar {
  height: 8px;
  background: #F3F4F6;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.landing-report-sim-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #F97316);
  border-radius: 4px;
}
.landing-report-sim-score {
  font-size: 0.8rem;
  font-weight: 700;
  color: #F59E0B;
  margin-bottom: 0.75rem;
}
.landing-report-sim-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.landing-report-sim-line {
  height: 6px;
  background: #F3F4F6;
  border-radius: 3px;
  width: 100%;
}
.landing-report-sim-line.w70 { width: 70%; }
.landing-report-sim-line.w85 { width: 85%; }
.landing-report-sim-line.w60 { width: 60%; }
.landing-report-sim-line.hl {
  background: linear-gradient(90deg, #FDE68A 0%, #FDE68A 30%, #F3F4F6 30%);
}



/* -- Zig-Zag Feature Layout -- */
.landing-zigzag {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}
.landing-zigzag-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.landing-zigzag-row.reverse {
  direction: rtl;
}
.landing-zigzag-row.reverse > * {
  direction: ltr;
}
.landing-zigzag-text h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ln-navy);
  margin: 0.75rem 0 0.5rem;
}
.landing-zigzag-text > p {
  font-size: 0.95rem;
  color: var(--gray-500);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Zig-zag visual cards */
.landing-zigzag-visual {
  display: flex;
  justify-content: center;
}
.landing-zigzag-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 1.75rem;
  width: 100%;
  max-width: 320px;
}
.landing-zigzag-card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.landing-zigzag-card-row:last-child {
  margin-bottom: 0;
}
.landing-zz-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.landing-zz-dot.green { background: #10B981; }
.landing-zz-dot.amber { background: #F59E0B; }
.landing-zz-dot.red { background: #EF4444; }
.landing-zz-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--gray-200);
  position: relative;
  overflow: hidden;
}
.landing-zz-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ln-teal), rgba(0,184,169,0.3));
}

/* AI gauge (donut) */
.landing-zz-gauge {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 0.5rem;
}
.landing-zz-ring {
  width: 100%;
  height: 100%;
}
.landing-zz-gauge-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ln-navy);
}
.landing-zz-gauge-label {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* File stack visual */
.landing-zigzag-card.file-stack {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}
.landing-file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--ln-white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.landing-file-icon svg {
  width: 32px;
  height: 32px;
  color: var(--error);
}
.landing-file-icon span {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 600;
}
.landing-file-icon.offset {
  transform: translateY(8px);
}

/* -- Timeline Steps -- */
.landing-timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.landing-timeline-track {
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}
.landing-timeline-step {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  position: relative;
}
.landing-timeline-dot {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: var(--ln-teal);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--ln-white), 0 0 0 6px var(--ln-teal-light);
}
.landing-section-alt .landing-timeline-dot {
  box-shadow: 0 0 0 4px var(--ln-gray-light), 0 0 0 6px var(--ln-teal-light);
}
.landing-timeline-card {
  background: var(--ln-white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.5rem;
  flex: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.landing-timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--ln-teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.landing-timeline-icon svg {
  width: 24px;
  height: 24px;
  color: var(--ln-teal-dark);
}
.landing-timeline-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ln-navy);
  margin-bottom: 0.4rem;
}
.landing-timeline-card p {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* -- Comparison Table -- */
.landing-compare-table-wrap {
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
}
.landing-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: var(--ln-white);
}
.landing-compare-table th,
.landing-compare-table td {
  padding: 0.9rem 1.25rem;
  text-align: left;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-100);
}
.landing-compare-table thead th {
  background: var(--gray-50);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ln-navy);
}
.landing-compare-table thead th.highlight {
  color: var(--ln-teal);
}
.landing-compare-table tbody tr:last-child td {
  border-bottom: none;
}
.landing-compare-table td.highlight {
  color: var(--ln-navy);
  font-weight: 500;
}
.landing-compare-table td.highlight svg {
  width: 16px;
  height: 16px;
  color: var(--ln-teal);
  vertical-align: middle;
  margin-right: 4px;
}
.landing-compare-table td.dim {
  color: var(--gray-400);
}
.landing-compare-table td.dim svg {
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  vertical-align: middle;
  margin-right: 4px;
}
.landing-compare-table td.warn svg {
  width: 16px;
  height: 16px;
  color: var(--warning);
  vertical-align: middle;
  margin-right: 4px;
}
.landing-compare-table td.warn {
  color: var(--warning);
}

/* -- Steps -- */
.landing-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
}
.landing-step {
  flex: 1;
  max-width: 300px;
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--ln-white);
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  position: relative;
}
.landing-step-num {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ln-teal);
  color: var(--ln-white);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-step-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ln-teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.25rem;
}
.landing-step-icon svg {
  width: 28px;
  height: 28px;
  color: var(--ln-teal-dark);
}
.landing-step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ln-navy);
  margin-bottom: 0.5rem;
}
.landing-step p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.6;
}
.landing-step-arrow {
  display: flex;
  align-items: center;
  padding-top: 3.5rem;
  color: var(--gray-300);
}
.landing-step-arrow svg { width: 24px; height: 24px; }

/* -- Comparison -- */
.landing-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.landing-compare-card {
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  overflow: hidden;
  background: var(--ln-white);
}
.landing-compare-card.highlight {
  border: 2px solid var(--ln-teal);
  box-shadow: 0 8px 32px rgba(0,184,169,0.12);
}
.landing-compare-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem 1.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--gray-200);
}
.landing-compare-card.highlight .landing-compare-header {
  background: linear-gradient(135deg, var(--ln-navy), #243044);
  color: var(--ln-white);
  border-bottom: none;
}
.landing-compare-header svg { width: 20px; height: 20px; color: var(--gray-400); }
.landing-compare-card ul {
  list-style: none;
  padding: 1.25rem 1.5rem;
}
.landing-compare-card ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.landing-compare-card ul li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
li.yes svg { color: var(--ln-teal); }
li.yes { color: var(--gray-700); }
li.no svg { color: var(--error); }
li.no { color: var(--gray-400); }
li.warn svg { color: var(--warning); }
li.warn { color: var(--gray-500); }

/* -- Pricing -- */
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  max-width: 960px;
  margin: 0 auto;
}
.landing-price-card {
  background: var(--ln-white);
  border: 2px solid var(--gray-200);
  border-radius: 16px;
  padding: 2.25rem 2rem 2rem;
  text-align: center;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
}
.landing-price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}
.landing-price-card.popular {
  border-color: var(--ln-teal);
  box-shadow: 0 8px 24px rgba(0,184,169,0.15);
  transform: scale(1.04);
}
.landing-price-card.popular:hover {
  transform: scale(1.04) translateY(-4px);
}
.landing-price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--ln-teal);
  color: var(--ln-white);
  white-space: nowrap;
}
.landing-price-badge.best {
  background: var(--success);
}
.landing-price-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}
.landing-price-amount {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--ln-navy);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.landing-price-unit {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}
.landing-price-save {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.1rem 0.5rem;
  background: var(--success-light);
  color: var(--success);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.landing-price-card ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1.75rem;
  text-align: left;
}
.landing-price-card ul li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--gray-600);
}
.landing-price-card ul li svg {
  width: 16px;
  height: 16px;
  color: var(--ln-teal);
  flex-shrink: 0;
}

/* -- FAQ -- */
.landing-faq-inner {
  max-width: 750px;
  margin: 0 auto;
}
.landing-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.landing-faq-item {
  background: var(--ln-white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.landing-faq-item:hover {
  box-shadow: var(--shadow-sm);
}
.landing-faq-item summary {
  padding: 1.15rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ln-navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-faq-item summary::-webkit-details-marker { display: none; }
.landing-faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gray-400);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}
.landing-faq-item[open] summary::after {
  content: '−';
  color: var(--ln-teal);
}
.landing-faq-item p {
  padding: 0 1.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* -- CTA -- */
.landing-cta {
  background: linear-gradient(135deg, var(--ln-navy) 0%, #0C4A6E 100%);
  padding: 6rem 2rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.landing-cta-inner {
  max-width: 650px;
  margin: 0 auto;
}
.landing-cta h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ln-white);
  margin-bottom: 0.75rem;
}
.landing-cta p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 2rem;
}

/* -- Footer -- */
.landing-footer {
  background: var(--ln-navy);
  padding: 2.5rem 2rem;
  text-align: center;
}
.landing-footer-inner {
  max-width: 700px;
  margin: 0 auto;
}
.landing-footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ln-white);
  margin-bottom: 0.75rem;
}
.landing-footer-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
.landing-footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
}

/* -- Landing Responsive -- */
@media (max-width: 1024px) {
  .landing-features-grid,
  .landing-pricing-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing-compare-grid {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing-trust-inner {
    grid-template-columns: repeat(2, 1fr);
  }
  .landing-trust-item:nth-child(2) { border-right: none; }
  .landing-steps {
    flex-direction: column;
    align-items: center;
  }
  .landing-step-arrow {
    transform: rotate(90deg);
    padding-top: 0;
  }
  .landing-price-card.popular {
    transform: none;
  }
  .landing-price-card.popular:hover {
    transform: translateY(-4px);
  }
  .landing-zigzag-row,
  .landing-zigzag-row.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
  }
  .landing-hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .landing-hero-inner .landing-hero-content {
    text-align: center;
  }
  .landing-hero-inner .landing-hero-content .landing-hero-sub {
    margin: 0 auto 2.5rem;
  }
  .landing-hero-inner .landing-hero-cta {
    justify-content: center;
  }
}
@media (max-width: 768px) {
  .landing-nav-links,
  .landing-nav-actions {
    display: none;
  }
  .landing-mobile-toggle {
    display: flex;
  }
  .landing-mobile-menu.active {
    display: flex;
  }
  .landing-hero {
    padding: 100px 1.5rem 60px;
    min-height: auto;
    min-height: 100dvh;
  }
  .landing-hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }
  .landing-hero-inner .landing-hero-content {
    text-align: center;
  }
  .landing-hero-inner .landing-hero-cta {
    justify-content: center;
  }
  .landing-hero-inner .landing-hero-badge {
    justify-content: center;
  }
  .landing-report-preview {
    max-width: 280px;
    margin: 0 auto;
  }
  .landing-hero h1 {
    font-size: 2.25rem;
  }
  .landing-hero-sub {
    font-size: 1rem;
  }
  /* Wrap stats into 2x2 grid on mobile */
  .landing-hero-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem 3rem;
  }
  .landing-stat-divider {
    display: none;
  }
  .landing-stat {
    min-width: 80px;
  }
  .landing-stat-num {
    font-size: 1.5rem;
  }
  .landing-trust-inner {
    grid-template-columns: 1fr;
  }
  .landing-trust-item {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 1.25rem 1.5rem;
  }
  .landing-trust-item:last-child { border-bottom: none; }
  .landing-section {
    padding: 3.5rem 1.5rem;
  }
  .landing-section-header h2 {
    font-size: 1.75rem;
  }
  .landing-section-header p {
    font-size: 1rem;
  }
  .landing-zigzag-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .landing-zigzag-row.reverse {
    direction: ltr;
  }
  .landing-timeline {
    padding-left: 0;
  }
  .landing-cta {
    padding: 3.5rem 1.5rem;
    min-height: auto;
  }
  .landing-cta h2 {
    font-size: 1.5rem;
  }
  .landing-scroll-indicator {
    display: none;
  }
  .landing-hero-bg::before {
    width: 280px;
    height: 280px;
  }
  .landing-hero-bg::after {
    width: 220px;
    height: 220px;
  }
}
@media (max-width: 480px) {
  .landing-hero {
    padding: 88px 1.25rem 48px;
  }
  .landing-hero h1 {
    font-size: 1.85rem;
    line-height: 1.2;
  }
  .landing-hero-sub {
    font-size: 0.92rem;
    margin-bottom: 1.75rem;
  }
  .landing-hero-cta {
    margin-bottom: 2rem;
  }
  .landing-hero-badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.8rem;
  }
  .landing-hero-stats {
    grid-template-columns: repeat(2, auto);
    gap: 1rem 1.5rem;
  }
  .landing-stat-num {
    font-size: 1.3rem;
  }
  .landing-stat-label {
    font-size: 0.72rem;
  }
  .landing-section {
    padding: 2.5rem 1.25rem;
  }
  .landing-section-header {
    margin-bottom: 2rem;
  }
  .landing-section-header h2 {
    font-size: 1.5rem;
  }
  .landing-section-header p {
    font-size: 0.9rem;
  }
  .landing-cta {
    padding: 2.5rem 1.25rem;
  }
  .landing-cta h2 {
    font-size: 1.3rem;
  }
  .landing-cta p {
    font-size: 0.9rem;
  }
  .landing-trust-item {
    padding: 1rem 1.25rem;
    gap: 0.75rem;
  }
  .landing-trust-icon {
    width: 38px;
    height: 38px;
  }
  .landing-trust-icon svg {
    width: 18px;
    height: 18px;
  }
  .landing-trust-item strong {
    font-size: 0.82rem;
  }
  .landing-trust-item span {
    font-size: 0.72rem;
  }
  .landing-feature-card,
  .landing-step,
  .landing-compare-card {
    padding: 1.5rem;
  }
  .landing-faq-item summary {
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
  }
  .landing-faq-item p {
    padding: 0 1.25rem 1rem;
    font-size: 0.85rem;
  }
  .landing-nav {
    padding: 0 1rem;
  }
  .landing-nav-inner {
    height: 60px;
  }
  .landing-footer {
    padding: 2rem 1.25rem;
  }
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-primary);
  filter: brightness(1.05);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-sm);
  filter: brightness(0.97);
}

.btn-success {
  background: #10b981;
  color: var(--white);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.table-actions .highlight-btn {
  background: var(--primary);
  color: var(--white);
  white-space: nowrap;
}

.table-actions .highlight-btn:hover {
  background: var(--primary-hover);
}

.table-actions .highlight-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.table-actions .highlight-download-btn {
  white-space: nowrap;
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow);
}

.btn-secondary:active {
  transform: scale(0.98);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-primary);
}

.btn-outline:active {
  transform: scale(0.98);
}

.btn-social {
  background: var(--white);
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
  flex: 1;
  padding: 0.75rem 1rem;
  box-shadow: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-social:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-1px);
}

.btn-social:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

.btn-full {
  width: 100%;
}

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

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--gray-500);
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  margin-left: 0.25rem;
}

/* ============================================
   AUTH CONTAINER
   ============================================ */
.auth-container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f7f8fb;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(79,70,229,0.04) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(124,58,237,0.03) 0%, transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(79,70,229,0.03) 1px, transparent 0);
  background-size: 100% 100%, 100% 100%, 24px 24px;
  position: relative;
}

.auth-back-to-landing {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray-500);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  z-index: 10;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(4px);
}
.auth-back-to-landing:hover {
  color: var(--primary);
  background: rgba(79,70,229,0.06);
}
.auth-back-to-landing:hover svg {
  transform: translateX(-2px);
}
.auth-back-to-landing svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.auth-wrapper {
  display: flex;
  max-width: 1000px;
  width: 100%;
  background: var(--white);
  border-radius: 1.25rem;
  box-shadow:
    0 24px 48px -12px rgba(15,23,42,0.12),
    0 0 0 1px rgba(15,23,42,0.04),
    inset 0 1px 0 0 rgba(255,255,255,0.8);
  overflow: hidden;
  position: relative;
}
/* Top accent gradient line */
.auth-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary) 0%, #7c3aed 50%, transparent 100%);
  z-index: 2;
  border-radius: 1.25rem 1.25rem 0 0;
}

.auth-card {
  flex: 1;
  padding: 3rem;
  max-width: 480px;
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.auth-logo .logo-icon {
  width: 40px;
  height: 40px;
  color: var(--primary);
}

.auth-logo .logo-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.auth-logo .logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
}

.auth-subtitle {
  color: var(--gray-500);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Staggered entry for form children */
.auth-form.active > *,
.auth-form.active > form > * {
  animation: formEntryStagger 0.4s ease both;
}
.auth-form.active > :nth-child(1),
.auth-form.active > form > :nth-child(1) { animation-delay: 0.04s; }
.auth-form.active > :nth-child(2),
.auth-form.active > form > :nth-child(2) { animation-delay: 0.08s; }
.auth-form.active > :nth-child(3),
.auth-form.active > form > :nth-child(3) { animation-delay: 0.12s; }
.auth-form.active > :nth-child(4),
.auth-form.active > form > :nth-child(4) { animation-delay: 0.16s; }
.auth-form.active > :nth-child(5),
.auth-form.active > form > :nth-child(5) { animation-delay: 0.20s; }
.auth-form.active > :nth-child(6),
.auth-form.active > form > :nth-child(6) { animation-delay: 0.24s; }
.auth-form.active > :nth-child(7),
.auth-form.active > form > :nth-child(7) { animation-delay: 0.28s; }
.auth-form.active > :nth-child(8),
.auth-form.active > form > :nth-child(8) { animation-delay: 0.32s; }
.auth-form.active > :nth-child(9),
.auth-form.active > form > :nth-child(9) { animation-delay: 0.36s; }
.auth-form.active > :nth-child(10),
.auth-form.active > form > :nth-child(10) { animation-delay: 0.40s; }

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

/* Auth method tabs (email / phone) — sliding pill */
.auth-method-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 4px;
  position: relative;
}

.tab-slider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: #fff;
  border-radius: calc(var(--radius-lg) - 2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04), 0 0 12px rgba(79,70,229,0.06);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 0;
}

.auth-method-tabs[data-active="phone"] .tab-slider {
  transform: translateX(100%);
}

.auth-method-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.75rem;
  border: none;
  border-radius: calc(var(--radius-lg) - 2px);
  background: transparent;
  color: var(--gray-500);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.25s ease;
  position: relative;
  z-index: 1;
}

.auth-method-tab svg {
  width: 16px;
  height: 16px;
}

.auth-method-tab:hover {
  color: var(--gray-700);
}

.auth-method-tab.active {
  color: var(--primary);
  background: transparent;
  box-shadow: none;
}

/* Auth method panels */
.auth-method-panel {
  display: none;
}

.auth-method-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}
/* Staggered entry for panel children */
.auth-method-panel.active > * {
  animation: formEntryStagger 0.35s ease both;
}
.auth-method-panel.active > :nth-child(1) { animation-delay: 0.04s; }
.auth-method-panel.active > :nth-child(2) { animation-delay: 0.08s; }
.auth-method-panel.active > :nth-child(3) { animation-delay: 0.12s; }
.auth-method-panel.active > :nth-child(4) { animation-delay: 0.16s; }

/* Phone intro — clean descriptive text */
.phone-hero {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1rem 0.5rem;
}
.phone-hero-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.625rem;
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.phone-hero-icon svg {
  width: 22px;
  height: 22px;
}
.phone-hero-text {
  font-size: 0.85rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Phone field — flag + code + divider + input (premium) */
.phone-field {
  display: flex;
  align-items: center;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 0 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  gap: 0;
}
.phone-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}
.phone-field-prefix {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  padding: 0.875rem 0;
}
.phone-flag {
  font-size: 1.25rem;
  line-height: 1;
}
.phone-code {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.phone-field-divider {
  width: 1px;
  height: 24px;
  background: var(--gray-200);
  margin: 0 0.75rem;
  flex-shrink: 0;
}
.phone-field-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.875rem 0;
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--gray-900);
  letter-spacing: 0.1em;
  outline: none;
  min-width: 0;
}
.phone-field-input::placeholder {
  color: var(--gray-300);
  font-weight: 400;
  letter-spacing: 0.06em;
}

/* Phone send code button — arrow slides right on hover */
#sendPhoneCodeBtn svg,
#sendPhoneCodeBtn i[data-lucide] {
  transition: transform 0.25s ease;
}
#sendPhoneCodeBtn:hover svg,
#sendPhoneCodeBtn:hover i[data-lucide] {
  transform: translateX(2px);
}

/* Phone input hint */
.input-hint {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.35rem;
}

/* Phone field filled state */
.phone-field:not(:focus-within):has(.phone-field-input:not(:placeholder-shown)) {
  border-color: var(--gray-300);
}

/* Phone hero icon gentle pulse */
.phone-hero-icon {
  animation: phoneIconPulse 3s ease-in-out infinite;
}
@keyframes phoneIconPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
  50% { box-shadow: 0 0 0 8px rgba(79,70,229,0.06); }
}

/* OTP Modal — clean, focused design */
.otp-modal-content {
  max-width: 420px;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 1.25rem;
}
.otp-modal-content > .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  color: var(--gray-400);
  transition: color 0.2s;
}
.otp-modal-content > .modal-close:hover {
  color: var(--gray-700);
}
.otp-modal-hero {
  text-align: center;
  padding: 2.25rem 2rem 1.25rem;
  background: var(--white);
}
.otp-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  box-shadow: none;
  animation: none;
}
.otp-modal-icon svg {
  width: 26px;
  height: 26px;
}
.otp-modal-hero h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.otp-modal-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
}
.otp-modal-subtitle strong {
  color: var(--gray-800);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.otp-modal-body {
  padding: 1.25rem 2rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}
.otp-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  text-align: center;
  margin-bottom: 0.75rem;
}

/* OTP individual boxes — refined */
.otp-boxes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.otp-box {
  width: 48px;
  height: 56px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  text-align: center;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  caret-color: var(--primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.otp-box:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
  transform: translateY(-1px);
}
.otp-box.filled {
  border-color: var(--gray-400);
  background: var(--gray-50);
}
.otp-box-dash {
  width: 12px;
  height: 2px;
  background: var(--gray-300);
  border-radius: 1px;
  flex-shrink: 0;
}

/* OTP resend row with countdown */
.otp-resend-row {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 1.25rem;
  text-align: center;
}
.otp-resend-row a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.otp-resend-row a:hover {
  text-decoration: underline;
}
.otp-resend-row .otp-countdown {
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}

/* OTP modal actions */
.otp-modal-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 2rem 1.5rem;
}
.otp-modal-actions .btn {
  flex: 1;
}

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

@keyframes otpShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.auth-form h2 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
  letter-spacing: -0.02em;
}

.form-description {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 0.875rem;
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  pointer-events: none;
  transition: color 0.25s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8125rem 0.875rem 0.8125rem 2.75rem;
  font-size: 0.9375rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--gray-900);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
  font-family: inherit;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.input-wrapper input:focus ~ .input-icon,
.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

.input-wrapper input::placeholder {
  color: var(--gray-350, var(--gray-400));
  font-weight: 400;
}

/* Input filled state — subtle border when has value */
.input-wrapper input:not(:placeholder-shown):not(:focus) {
  border-color: var(--gray-300);
}
.input-wrapper input:not(:placeholder-shown):not(:focus) ~ .input-icon,
.input-wrapper input:not(:placeholder-shown):not(:focus) + .input-icon,
.input-wrapper:not(:focus-within) input:not(:placeholder-shown) ~ .input-icon {
  color: var(--gray-500);
}

/* Input error state */
.input-wrapper.error input,
.phone-field.error {
  border-color: var(--error);
}
.input-wrapper.error input:focus,
.phone-field.error:focus-within {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}
.input-wrapper.error .input-icon {
  color: var(--error);
}
.form-error {
  font-size: 0.75rem;
  color: var(--error);
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  animation: formEntryStagger 0.25s ease both;
}

/* Label darkens when sibling input focused */
.form-group:focus-within > label {
  color: var(--gray-900);
}

/* Keyboard focus-visible ring for accessibility */
.input-wrapper input:focus-visible,
.phone-field-input:focus-visible,
.otp-box:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.toggle-password {
  position: absolute;
  right: 0.625rem;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--gray-400);
  transition: color 0.2s ease, transform 0.15s ease;
  border-radius: var(--radius-sm);
}

.toggle-password:hover {
  color: var(--gray-600);
  transform: scale(1.1);
}
.toggle-password:active {
  color: var(--primary);
  transform: scale(0.95);
}

.toggle-password svg {
  width: 18px;
  height: 18px;
}

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

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.checkbox-wrapper input[type="checkbox"] {
  display: none;
}

.checkbox-wrapper .checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.checkbox-wrapper:hover .checkmark {
  border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.checkbox-wrapper input:checked + .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.forgot-link {
  font-size: 0.8125rem;
  color: var(--primary);
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
  text-decoration: none;
}
.forgot-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width 0.3s ease;
}
.forgot-link:hover {
  color: var(--primary-hover);
}
.forgot-link:hover::after {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
}

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

.auth-divider span {
  font-size: 0.8125rem;
  color: var(--gray-400);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.social-buttons {
  display: flex;
  gap: 0.75rem;
}
.social-buttons .btn-social {
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.social-buttons .btn-social:hover {
  border-color: var(--gray-300);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
}

.auth-switch {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--gray-500);
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

.auth-switch a {
  font-weight: 600;
  color: var(--primary);
  transition: color 0.2s, background 0.2s;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  margin-left: 0.125rem;
}
.auth-switch a:hover {
  color: var(--primary-hover);
  background: rgba(79,70,229,0.06);
}

.password-strength {
  margin-top: 0.625rem;
}

.strength-bar {
  height: 5px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--error);
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: var(--radius-full);
}

.strength-bar.weak span { width: 33%; background: var(--error); }
.strength-bar.medium span { width: 66%; background: var(--warning); }
.strength-bar.strong span { width: 100%; background: var(--success); }

.strength-text {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
  display: block;
  transition: color 0.3s ease;
}
.strength-bar.weak ~ .strength-text { color: var(--error); }
.strength-bar.medium ~ .strength-text { color: var(--warning); }
.strength-bar.strong ~ .strength-text { color: var(--success); }

.terms-checkbox {
  margin-bottom: 1.5rem;
}

.terms-checkbox a {
  text-decoration: underline;
  color: var(--primary);
  font-weight: 500;
}
.terms-checkbox a:hover {
  color: var(--primary-hover);
}

/* Auth form buttons — heavier feel */
.auth-form .btn-primary.btn-full,
#sendPhoneCodeBtn {
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-lg);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
/* Pressed/active feedback */
.auth-form .btn-primary.btn-full:active,
#sendPhoneCodeBtn:active {
  transform: scale(0.98) translateY(1px);
  box-shadow: none;
}
/* Arrow slides right on hover */
.auth-form .btn-primary.btn-full svg,
.auth-form .btn-primary.btn-full i[data-lucide] {
  transition: transform 0.25s ease;
}
.auth-form .btn-primary.btn-full:hover svg,
.auth-form .btn-primary.btn-full:hover i[data-lucide] {
  transform: translateX(3px);
}

.turnstile-group {
  margin: 0.25rem 0 1rem;
}
/* Blend Turnstile widget into card */
.turnstile-group iframe {
  border-radius: var(--radius-md) !important;
}

.turnstile-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Button loading state — spinner replaces content */
.btn.btn-loading {
  pointer-events: none;
  opacity: 0.85;
  position: relative;
}
.btn.btn-loading span,
.btn.btn-loading svg,
.btn.btn-loading i[data-lucide] {
  visibility: hidden;
}
.btn.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* Auth Side Panel — dark with radial accent glows + grain */
.auth-side-panel {
  flex: 1;
  background: var(--gray-900);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.auth-side-panel::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(79,70,229,0.22) 0%, transparent 65%);
  pointer-events: none;
}
.auth-side-panel::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -15%;
  width: 55%;
  height: 55%;
  background: radial-gradient(circle, rgba(124,58,237,0.12) 0%, transparent 65%);
  pointer-events: none;
}
/* Noise/grain overlay on side panel */
.side-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

.side-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
}
.side-content > * {
  position: relative;
  z-index: 1;
}

.side-stat {
  margin-bottom: 2.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.side-stat::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, rgba(79,70,229,0.4) 0%, transparent 100%);
}
.side-stat-number {
  display: block;
  font-size: 3.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 40px rgba(79,70,229,0.3), 0 0 80px rgba(79,70,229,0.1);
  animation: statGlow 4s ease-in-out infinite alternate;
}
@keyframes statGlow {
  from { text-shadow: 0 0 40px rgba(79,70,229,0.3), 0 0 80px rgba(79,70,229,0.1); }
  to { text-shadow: 0 0 50px rgba(79,70,229,0.4), 0 0 100px rgba(79,70,229,0.15); }
}
.side-stat-label {
  display: block;
  font-size: 0.9375rem;
  color: var(--gray-400);
  margin-top: 0.625rem;
  font-weight: 500;
}

.side-quote {
  margin: 0 0 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid rgba(79,70,229,0.6);
  backdrop-filter: blur(8px);
}
.side-quote p {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.side-quote cite {
  font-size: 0.8125rem;
  color: var(--gray-400);
  font-style: normal;
  font-weight: 500;
}

.side-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.side-features li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.side-features li:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.14);
}
.side-check {
  color: var(--success);
  font-weight: 700;
  font-size: 0.75rem;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(16,185,129,0.15);
  flex-shrink: 0;
}

/* Legacy feature-list (keeping for compat) */
.feature-list {
  list-style: none;
  margin-bottom: 2rem;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

.feature-list li svg {
  width: 20px;
  height: 20px;
  color: var(--success);
}

.testimonial {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.testimonial p {
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-info strong {
  font-size: 0.875rem;
}

.author-info span {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* ============================================
   APP CONTAINER
   ============================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition-slow);
  box-shadow: 1px 0 8px rgba(15, 23, 42, 0.03);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

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

.logo .logo-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.logo .logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.logo .logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--gray-600);
  border-radius: var(--radius);
  margin-bottom: 0.25rem;
  transition: var(--transition);
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-link svg {
  width: 20px;
  height: 20px;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--gray-100);
}

.credit-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, #E0E7FF 100%);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.credit-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.credit-icon svg {
  width: 20px;
  height: 20px;
}

.credit-info {
  display: flex;
  flex-direction: column;
}

.credit-label {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.credit-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

/* Theme Toggle Row — sidebar dark/light switch */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin: 0 0.75rem 0.5rem;
  border-radius: var(--radius);
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
}
.theme-toggle-label i,
.theme-toggle-label svg {
  width: 16px;
  height: 16px;
}

/* Theme Toggle Button — sun/moon icon switcher */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: rgba(79, 70, 229, 0.2);
}
.theme-toggle-btn:active {
  transform: scale(0.94);
}
.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon {
  position: absolute;
}
.theme-toggle-btn .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle-btn .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
html[data-theme="dark"] .theme-toggle-btn .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
html[data-theme="dark"] .theme-toggle-btn .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ── Smooth theme transitions ──
   A single wildcard rule ensures every element animates on dark↔light.
   Scoped to the four themeable properties only; per-element transitions
   for :hover / :focus / interactive states still override via specificity. */
*,
*::before,
*::after {
  transition:
    background-color 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.3s ease;
}

/* Opt-out: elements where theme transition causes visual glitches */
input[type="range"],
input[type="range"]::-webkit-slider-thumb,
progress,
svg, svg *, canvas, video, img,
.no-theme-transition,
.no-theme-transition * {
  transition: none !important;
}

/* Re-enable theme transitions on SVG containers that act as icons */
.theme-toggle-btn svg {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease !important;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.user-menu:hover {
  background: var(--gray-50);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

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

.user-name {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  color: var(--gray-700);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

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

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.main-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-menu-btn {
  display: none;
}

.header-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.header-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

/* Pages */
.page {
  display: none;
  padding: 2rem;
  flex: 1;
  max-width: 100%;
  box-sizing: border-box;
}

.page.active {
  display: block;
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
}

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.blue {
  background: var(--info-light);
  color: var(--info);
}

.stat-icon.green {
  background: var(--success-light);
  color: var(--success);
}

.stat-icon.amber {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-icon.purple {
  background: var(--primary-light);
  color: var(--primary);
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  transition: var(--transition);
  overflow: hidden;
  max-width: 100%;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.card-header h2, .card-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}

.card-description {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.view-all-link {
  font-size: 0.875rem;
  font-weight: 500;
}

.card-body {
  padding: 1.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--gray-300);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

/* Quick Actions */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.action-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.action-icon {
  width: 48px;
  height: 48px;
  background: var(--white);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.action-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.action-btn span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

/* ============================================
   SUBMIT PAGE
   ============================================ */
.submit-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  max-width: 1200px;
}

.upload-card .card-body {
  padding: 1.5rem;
  overflow: hidden;
}

/* Credit Check Banner */
.credit-check-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.avg-processing-banner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.avg-processing-banner > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--gray-400);
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.banner-content > svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.banner-text {
  display: flex;
  flex-direction: column;
}

.banner-text strong {
  font-size: 0.9375rem;
  color: var(--gray-900);
}

.banner-text span {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.banner-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
}

.banner-status.sufficient {
  color: var(--success);
}

.banner-status.insufficient {
  color: var(--error);
}

.banner-status svg {
  width: 16px;
  height: 16px;
}

.credit-check-banner.insufficient {
  background: var(--error-light);
}

/* Submit message block */
.submit-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.submit-message svg {
  width: 18px;
  height: 18px;
}

.submit-message.is-yellow {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde68a;
}

.submit-message.is-green {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.submit-message.is-red {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.ai-info-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(79, 70, 229, 0.12);
  border-radius: calc(var(--radius-xl) + 0.125rem);
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(238, 242, 255, 0.88));
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.ai-info-panel__copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.65rem;
  align-content: center;
}

.ai-info-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.38rem 0.75rem;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ai-info-panel__copy h3 {
  font-size: 1.125rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--gray-900);
  text-wrap: balance;
}

.ai-info-panel__copy p {
  max-width: 42rem;
  color: var(--gray-600);
  font-size: 0.9375rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.ai-info-panel__copy strong {
  color: var(--gray-900);
}

.ai-info-panel__details {
  display: block;
}

.ai-info-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.68);
  color: var(--primary-dark);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: var(--transition);
}

.ai-info-panel__summary::-webkit-details-marker {
  display: none;
}

.ai-info-panel__summary::after {
  content: '';
  width: 0.625rem;
  height: 0.625rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.ai-info-panel__summary:hover {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(79, 70, 229, 0.24);
}

.ai-info-panel__details[open] .ai-info-panel__summary {
  margin-bottom: 0.85rem;
}

.ai-info-panel__details[open] .ai-info-panel__summary::after {
  transform: rotate(225deg);
}

.ai-info-panel__figure {
  position: relative;
  z-index: 1;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
}

.ai-info-panel__figure img {
  display: block;
  width: 100%;
  height: auto;
}

.ai-info-panel--compact {
  margin-bottom: 1.25rem;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: var(--gray-50);
  overflow: hidden;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.upload-zone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-light);
}

.upload-content {
  pointer-events: none;
}

.upload-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 1rem;
  background: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.upload-icon svg {
  width: 32px;
  height: 32px;
  color: var(--gray-400);
}

.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
  background: var(--white);
}

.upload-zone:hover .upload-icon svg,
.upload-zone.dragover .upload-icon svg {
  color: var(--primary);
}

.upload-zone h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}

.upload-zone p {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.upload-hint {
  display: block;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* File Preview */
.file-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-preview .file-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-preview .file-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  display: block;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.remove-file {
  color: var(--gray-400);
}

.remove-file:hover {
  color: var(--error);
  background: var(--error-light);
}

/* Document Options */
.document-options {
  margin-top: 1.5rem;
}

.document-options .form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: inherit;
  transition: var(--transition);
}

.document-options .form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.check-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.exclude-options {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.submission-filter-panel {
  position: relative;
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.submission-filter-panel__header {
  margin-bottom: 0.9rem;
}

.submission-filter-panel__eyebrow {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary);
}

.submission-filter-panel__header strong {
  display: block;
  color: var(--gray-900);
  font-size: 0.95rem;
}

.submission-filter-panel__header p {
  margin: 0.3rem 0 0;
  color: var(--gray-500);
  font-size: 0.78rem;
  line-height: 1.55;
}

.submission-filter-options {
  margin-top: 0;
}

.submission-filter-card .option-content {
  background: rgba(255, 255, 255, 0.82);
}

.submission-filter-card input:checked + .option-content {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(16, 185, 129, 0.08));
}

.option-card {
  cursor: pointer;
}

.option-card input {
  display: none;
}

.option-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: var(--transition);
}

.option-card input:checked + .option-content {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option-icon {
  width: 40px;
  height: 40px;
  background: var(--gray-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-icon svg {
  width: 20px;
  height: 20px;
  color: var(--gray-500);
}

.option-card input:checked + .option-content .option-icon {
  background: var(--primary);
}

.option-card input:checked + .option-content .option-icon svg {
  color: var(--white);
}

.option-text {
  flex: 1;
}

.option-text strong {
  display: block;
  font-size: 0.875rem;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}

.option-text span {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.option-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.option-check svg {
  width: 14px;
  height: 14px;
  color: var(--white);
  opacity: 0;
}

.option-card input:checked + .option-content .option-check {
  background: var(--primary);
  border-color: var(--primary);
}

.option-card input:checked + .option-content .option-check svg {
  opacity: 1;
}

/* Submit Actions */
.submit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* Guidelines */
.guidelines-list {
  list-style: none;
}

.guidelines-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  color: var(--gray-600);
}

.guidelines-list li:last-child {
  border-bottom: none;
}

.guidelines-list li svg {
  width: 18px;
  height: 18px;
  color: var(--success);
}

/* ============================================
   SUBMISSIONS PAGE
   ============================================ */
.submissions-container {
  max-width: 1200px;
}

/* WhatsApp Notification Banner */
.wa-notify-banner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--gray-300);
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.2s ease;
}
.wa-notify-banner:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.wa-notify-banner.wa-active {
  border-style: solid;
  border-color: #25D366;
  background: #25d3660d;
}
.wa-notify-banner.wa-active:hover {
  background: #25d3661a;
}
.wa-notify-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.wa-notify-banner-icon svg {
  width: 20px;
  height: 20px;
}
.wa-active .wa-notify-banner-icon {
  background: #25D366;
  color: var(--white);
}
.wa-notify-banner-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.wa-notify-banner-text strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-notify-banner-text span {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}
.wa-active .wa-notify-banner-text strong {
  color: #128C57;
}
.wa-notify-banner-action {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.wa-active .wa-notify-banner-action {
  color: #128C57;
}

/* WhatsApp Settings Modal — premium design */
.wa-modal-content {
  max-width: 440px;
  padding: 0 !important;
  overflow: hidden;
  border-radius: 1.25rem;
}
.wa-modal-content > .modal-close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.wa-modal-content > .modal-close svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.wa-modal-content > .modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-700);
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wa-modal-content > .modal-close:active {
  transform: scale(0.95);
  background: var(--gray-300);
}
.wa-modal-hero {
  text-align: center;
  padding: 2rem 2rem 1.25rem;
}
.wa-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.875rem;
  border-radius: var(--radius-lg);
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.wa-modal-icon svg {
  width: 26px;
  height: 26px;
}
.wa-modal-hero h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}
.wa-modal-desc {
  font-size: 0.875rem;
  color: var(--gray-500);
}
.wa-modal-body {
  padding: 1.25rem 2rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}
.wa-modal-body .form-group {
  margin-bottom: 0;
}
.wa-modal-body .form-group label {
  font-weight: 600;
}
.wa-name-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--warning-light);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-bottom: 0.875rem;
}
.wa-name-notice svg {
  width: 16px;
  height: 16px;
  color: var(--warning);
  flex-shrink: 0;
}
.wa-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.wa-name-row .form-group {
  margin-bottom: 0;
}
.wa-name-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.wa-name-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}
.wa-name-input::placeholder {
  color: var(--gray-400);
}
.wa-status-msg {
  display: none;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  margin-top: 0.75rem;
}
.wa-modal-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 2rem 1.5rem;
}
.wa-modal-actions .btn {
  flex: 1;
}
.wa-save-btn {
  background: #25D366;
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(37,211,102,0.2);
}
.wa-save-btn:hover {
  background: #1EB955;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,211,102,0.3);
}
.wa-save-btn:active {
  transform: translateY(0) scale(0.98);
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 400px;
  min-width: 0;
}

.search-box svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray-400);
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.filter-btn:hover {
  background: var(--gray-50);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.submissions-table {
  width: 100%;
  border-collapse: collapse;
}

.submissions-table th,
.submissions-table td {
  padding: 1rem 1.5rem;
  text-align: left;
}

.submissions-table th {
  background: var(--gray-50);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--gray-200);
}

.submissions-table td {
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.submissions-table tbody tr {
  transition: var(--transition);
}

.submissions-table tbody tr:hover {
  background: var(--gray-50);
}

.doc-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.doc-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-icon svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.doc-name {
  font-weight: 500;
  color: var(--gray-900);
}

.doc-size {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge svg {
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex-shrink: 0;
}

.status-badge.completed {
  background: var(--success-light);
  color: var(--success);
}

.status-badge.highlight-completed {
  background: #ede9fe;
  color: #7c3aed;
}

.status-badge.processing {
  background: var(--warning-light);
  color: var(--warning);
}

.status-badge.processing svg,
.status-badge.queued svg {
  animation: spin 1s linear infinite;
}

.status-badge.failed {
  background: var(--error-light);
  color: var(--error);
}

.status-badge.rejected {
  background: var(--error-light);
  color: var(--error);
}

.status-badge.queued {
  background: var(--info-light);
  color: var(--info);
}

.status-badge.pending {
  background: #eef2ff;
  color: #4f46e5;
}

/* Score Display */
.score {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.score-bar {
  width: 60px;
  height: 6px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
}

.score-bar.low span { background: var(--success); }
.score-bar.medium span { background: var(--warning); }
.score-bar.high span { background: var(--error); }

.score-value {
  font-weight: 600;
  font-size: 0.875rem;
}

.score-value.low { color: var(--success); }
.score-value.medium { color: var(--warning); }
.score-value.high { color: var(--error); }

/* Table Actions */
.table-actions {
  display: flex;
  gap: 0.5rem;
}

.table-actions .btn-icon {
  width: 32px;
  height: 32px;
}

.table-actions .btn-icon svg {
  width: 16px;
  height: 16px;
}

.table-empty {
  padding: 4rem 2rem;
}

/* Submission Cards */
.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.submission-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.submission-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.submission-card-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.submission-card-file-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.submission-card-file-info .doc-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submission-card-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.4;
}

.submission-card-scores {
  display: flex;
  gap: 2rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0.75rem;
}

.submission-score-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
}

.submission-score-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  white-space: nowrap;
  min-width: 3rem;
}

.submission-score-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  min-width: 60px;
}

.submission-score-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  background: var(--gray-300);
}

.submission-score-fill.low { background: var(--success); }
.submission-score-fill.medium { background: var(--warning); }
.submission-score-fill.high { background: var(--error); }

.submission-score-value {
  font-weight: 700;
  font-size: 0.875rem;
  min-width: 2.5rem;
  text-align: right;
}

.submission-score-value.low { color: var(--success); }
.submission-score-value.medium { color: var(--warning); }
.submission-score-value.high { color: var(--error); }

/* *% AI Score Explanation */
.star-info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--warning);
  cursor: help;
  font-style: normal;
  vertical-align: middle;
}

.star-explanation {
  text-align: left;
  line-height: 1.7;
}
.star-explanation strong {
  font-size: 1rem;
  color: var(--gray-900);
}
.star-explanation p {
  margin: 0.5rem 0;
  font-size: 0.875rem;
  color: var(--gray-600);
}
.star-explanation-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.75rem !important;
  padding: 0.75rem;
  background: #FEF3C7;
  border-radius: var(--radius);
  color: var(--gray-700) !important;
  font-size: 0.8125rem !important;
}
.star-explanation-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--warning);
}

.submission-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.submission-card-downloads {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sub-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.sub-download-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.sub-download-btn svg {
  width: 14px;
  height: 14px;
}

.submission-card-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive: submissions cards */
@media (max-width: 640px) {
  .submission-card {
    padding: 1rem;
  }

  .submission-card-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .submission-card-scores {
    flex-direction: column;
    gap: 0.75rem;
  }

  .submission-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .submission-card-downloads {
    flex-direction: column;
  }

  .sub-download-btn {
    justify-content: center;
  }

  .submission-card-btns {
    justify-content: flex-end;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .search-box {
    max-width: none;
  }

  .filter-buttons {
    flex-wrap: wrap;
  }

  /* WA banner compact on mobile */
  .wa-notify-banner {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
  .wa-notify-banner-icon {
    width: 36px;
    height: 36px;
  }
  .wa-notify-banner-icon svg {
    width: 18px;
    height: 18px;
  }
  .wa-notify-banner-text strong {
    font-size: 0.8125rem;
  }
  .wa-notify-banner-text span {
    font-size: 0.75rem;
  }
  .wa-notify-banner-action {
    font-size: 0.75rem;
  }
  /* WA modal mobile */
  .wa-modal-content {
    max-width: calc(100vw - 2rem);
    border-radius: 1rem;
  }
  .wa-modal-hero {
    padding: 1.5rem 1.25rem 1rem;
  }
  .wa-modal-body {
    padding: 1rem 1.25rem 1.25rem;
  }
  .wa-modal-actions {
    padding: 0.75rem 1.25rem 1.25rem;
  }
  .wa-name-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .submission-card-file-info .doc-name {
    font-size: 0.8125rem;
    white-space: normal;
    word-break: break-word;
  }
}

/* ============================================
   CREDITS PAGE (Redesigned)
   ============================================ */
.credits-container {
  max-width: 900px;
}

/* Hero Balance */
.credits-hero {
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  border-radius: var(--radius-xl);
  padding: 2rem 2.5rem;
  margin-bottom: 2rem;
  color: white;
}
.credits-hero-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.credits-hero-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.credits-hero-icon {
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.credits-hero-icon svg {
  width: 28px;
  height: 28px;
  color: white;
}
.credits-hero-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 0.125rem;
}
.credits-hero-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}
.credits-hero-hint {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  opacity: 0.75;
}
.credits-hero-hint svg {
  width: 14px;
  height: 14px;
}

/* Credits Announcement Banner */
.credits-announcement {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.75rem;
  border: 1px solid;
  animation: announcement-slide-in 0.35s ease-out;
}
@keyframes announcement-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.credits-announcement-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.credits-announcement-icon svg {
  width: 20px;
  height: 20px;
}
.credits-announcement-body {
  flex: 1;
  min-width: 0;
}
.credits-announcement-body p {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.credits-announcement-body p:last-child { margin-bottom: 0; }

/* Type variants */
.announcement-info {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E40AF;
}
.announcement-info .credits-announcement-icon {
  background: #DBEAFE;
  color: #2563EB;
}
.announcement-warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}
.announcement-warning .credits-announcement-icon {
  background: #FEF3C7;
  color: #D97706;
}
.announcement-error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #991B1B;
}
.announcement-error .credits-announcement-icon {
  background: #FEE2E2;
  color: #DC2626;
}
.announcement-success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}
.announcement-success .credits-announcement-icon {
  background: #DCFCE7;
  color: #16A34A;
}

/* Admin announcement config card */
.admin-announcement-config {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.admin-announcement-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}
.admin-announcement-header svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}
.admin-announcement-desc {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0 0 1rem;
}

/* Sections */
.credits-section {
  margin-bottom: 1.75rem;
}
.credits-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.credits-section-header h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}
.credits-section-header h2 svg {
  width: 20px;
  height: 20px;
  color: var(--primary);
}
.credits-section-toggle {
  cursor: pointer;
  user-select: none;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}
.credits-section-toggle:hover {
  background: var(--gray-50);
}
.toggle-chevron {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  transition: transform 0.2s;
}
.toggle-chevron.rotated {
  transform: rotate(180deg);
}
.credits-section-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s;
  max-height: 2000px;
  opacity: 1;
}
.credits-section-body.collapsed {
  max-height: 0;
  opacity: 0;
}
.credits-empty-text {
  color: var(--gray-400);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.875rem;
}

/* Package Cards */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 0;
}
.package-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.package-card:hover {
  border-color: var(--primary-light, #818CF8);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.12);
}
.package-card.popular {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

/* Ribbon */
.package-ribbon {
  position: absolute;
  top: 12px;
  right: -32px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 2.5rem;
  transform: rotate(45deg);
  letter-spacing: 0.5px;
}
.package-ribbon.best {
  background: var(--success);
}

.package-ribbon.disabled-ribbon {
  background: var(--gray-500);
}

.package-card.disabled {
  opacity: 0.6;
  border-color: var(--gray-200);
  background: var(--gray-50);
}
.package-card.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
.package-card.disabled .package-credits,
.package-card.disabled .package-price {
  color: var(--gray-400);
}

.package-header {
  margin-bottom: 1rem;
}
.package-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.package-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}
.package-credits-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.package-credits {
  font-size: 3.25rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.package-credits-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-400);
}
.package-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.125rem;
}
.package-per {
  font-size: 0.8rem;
  color: var(--gray-400);
}

.package-card .purchase-btn {
  margin-top: auto;
}

/* Payment Timeline */
.payment-timeline {
  position: relative;
  padding-left: 1.5rem;
}
.payment-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gray-200);
  border-radius: 999px;
}
.payment-timeline-item {
  position: relative;
  padding: 0.5rem 0 1rem 1rem;
}
.payment-timeline-item:last-child {
  padding-bottom: 0;
}
.payment-timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.7rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--gray-200);
  z-index: 1;
}
.payment-timeline-content {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.875rem 1rem;
  transition: box-shadow 0.15s;
}
.payment-timeline-content:hover {
  box-shadow: var(--shadow-sm);
}
.payment-timeline-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.payment-timeline-title {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.9rem;
}
.payment-timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.payment-timeline-badge svg {
  width: 12px;
  height: 12px;
}
.payment-timeline-badge.pending {
  background: var(--warning-light, #FEF3C7);
  color: var(--warning);
}
.payment-timeline-badge.approved {
  background: var(--success-light, #D1FAE5);
  color: var(--success);
}
.payment-timeline-badge.rejected {
  background: var(--error-light, #FEE2E2);
  color: var(--error);
}
.payment-timeline-meta {
  font-size: 0.8rem;
  color: var(--gray-400);
}
.payment-timeline-reason {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.375rem;
}
.payment-timeline-reason svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .credits-hero {
    padding: 1.5rem;
  }
  .credits-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .credits-hero-value {
    font-size: 2rem;
  }
  .packages-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .package-card {
    padding: 1.25rem;
  }
  .package-credits {
    font-size: 2.5rem;
  }
}

/* Transaction History */
.transaction-list {
  display: flex;
  flex-direction: column;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.transaction-item:last-child {
  border-bottom: none;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.transaction-icon svg {
  width: 20px;
  height: 20px;
}

.transaction-icon.credit {
  background: var(--success-light);
  color: var(--success);
}

.transaction-icon.debit {
  background: var(--error-light);
  color: var(--error);
}

.transaction-details {
  flex: 1;
}

.transaction-title {
  display: block;
  font-weight: 500;
  color: var(--gray-900);
}

.transaction-date {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.transaction-amount {
  font-weight: 600;
}

.transaction-amount.positive {
  color: var(--success);
}

.transaction-amount.negative {
  color: var(--error);
}

.tx-expiry-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 100px;
  background: var(--gray-100);
  color: var(--gray-500);
  font-weight: 500;
}
.tx-expiry-tag.warning {
  background: #fef3c7;
  color: #92400e;
}
.tx-expiry-tag.urgent {
  background: #fef2f2;
  color: var(--error);
  font-weight: 600;
}
.tx-expiry-tag.expired {
  background: var(--gray-100);
  color: var(--gray-400);
  text-decoration: line-through;
}

/* ============================================
   MODALS
   ============================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  text-align: center;
  transform: scale(0.95) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Confirm Dialog */
.confirm-dialog {
  text-align: center;
  padding: 1.5rem;
}
.confirm-dialog .confirm-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-full);
  background: #FEF3C7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--warning);
}
.confirm-dialog .confirm-icon svg {
  width: 28px;
  height: 28px;
}
.confirm-dialog h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}
.confirm-dialog p {
  font-size: 0.9375rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.confirm-actions .btn {
  min-width: 120px;
}
.modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-icon.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.modal-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.modal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.modal-content > p {
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Processing Modal */
.processing-modal {
  max-width: 400px;
}

.processing-animation {
  margin-bottom: 1.5rem;
}

.spinner {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

.spin {
  animation: spin 1s linear infinite;
}

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

.processing-steps {
  text-align: left;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: var(--gray-400);
  font-size: 0.875rem;
}

.step svg {
  width: 18px;
  height: 18px;
}

.step.completed {
  color: var(--success);
}

.step.active {
  color: var(--primary);
}

.step.active svg {
  animation: spin 1s linear infinite;
}

/* Report Modal */
.report-modal {
  max-width: 600px;
  text-align: left;
  padding: 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
  margin: 0;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.report-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.report-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.report-tab:hover {
  background: var(--gray-200);
}

.report-tab.active {
  background: var(--primary);
  color: var(--white);
}

.report-content {
  padding: 1rem 0;
}

.report-score {
  text-align: center;
  margin-bottom: 2rem;
}

.score-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}

.score-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-circle circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
}

.score-bg {
  stroke: var(--gray-200);
}

.score-fill {
  stroke: var(--primary);
  stroke-dasharray: 283;
  stroke-dashoffset: 240;
  transition: stroke-dashoffset 1s ease;
}

.score-fill.ai {
  stroke: var(--info);
}

.score-circle .score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
}

.score-label {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.report-details h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 1rem;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
}

.source-match {
  padding: 0.25rem 0.5rem;
  background: var(--error-light);
  color: var(--error);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.source-url {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   COOKIE CONSENT BANNER
   ============================================ */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: var(--gray-900);
  color: var(--gray-100);
  padding: 1rem 1.5rem;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  animation: cookieSlideUp 0.4s ease-out;
}
@keyframes cookieSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.cookie-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.cookie-consent-text {
  flex: 1;
}
.cookie-consent-text p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--gray-300);
}
.cookie-consent-text a {
  color: #818CF8;
  text-decoration: underline;
}
.cookie-consent-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .cookie-consent-actions {
    justify-content: flex-end;
  }
}


/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--gray-400);
  min-width: 300px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.toast.success { border-color: var(--success); background: linear-gradient(90deg, rgba(16, 185, 129, 0.04) 0%, var(--white) 100%); }
.toast.error { border-color: var(--error); background: linear-gradient(90deg, rgba(239, 68, 68, 0.04) 0%, var(--white) 100%); }
.toast.warning { border-color: var(--warning); background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, var(--white) 100%); }
.toast.info { border-color: var(--info); background: linear-gradient(90deg, rgba(59, 130, 246, 0.04) 0%, var(--white) 100%); }

.toast-icon {
  width: 24px;
  height: 24px;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.toast-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

.toast-debug-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  align-self: flex-start;
  padding: 0.3125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
  line-height: 1;
}

.toast-debug-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.toast-debug-btn:active {
  transform: translateY(1px);
}

.toast-debug-btn i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.toast-debug-btn.is-copied {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}

.toast-debug-btn.is-failed {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warning);
}

html[data-theme="dark"] .toast-debug-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--gray-300);
}

html[data-theme="dark"] .toast-debug-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.toast-close {
  color: var(--gray-400);
}

/* Submission Item in Recent List */
.submission-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.submission-item:hover {
  background: var(--white);
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.submission-item:last-child {
  margin-bottom: 0;
}

.submission-item .doc-icon {
  width: 44px;
  height: 44px;
}

.submission-info {
  flex: 1;
}

.submission-info .doc-name {
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.submission-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.submission-scores {
  display: flex;
  gap: 1.5rem;
}

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

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .submit-container {
    grid-template-columns: 1fr;
  }

  .guidelines-card {
    order: -1;
  }

  .ai-info-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .auth-wrapper {
    flex-direction: column;
  }

  .auth-card {
    max-width: none;
    padding: 2rem;
  }

  .auth-side-panel {
    display: none;
  }

  /* Compact auth header on mobile */
  .auth-header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }
  .auth-logo .logo-img {
    width: 44px;
    height: 44px;
  }
  .auth-logo .logo-text {
    font-size: 1.5rem;
  }
  .auth-form h2 {
    font-size: 1.375rem;
  }
  .form-description {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
  }
  /* Tighter form spacing on mobile */
  .form-group {
    margin-bottom: 1rem;
  }
  .auth-divider {
    margin: 1.25rem 0;
  }
  .auth-switch {
    margin-top: 1.25rem;
    padding-top: 1rem;
  }
  .auth-card {
    padding: 1.5rem;
  }
  .auth-container {
    padding: 1rem;
  }

  .ai-info-panel {
    padding: 1rem;
    gap: 1rem;
    border-radius: var(--radius-lg);
  }

  .ai-info-panel__eyebrow {
    font-size: 0.6875rem;
  }

  .ai-info-panel__copy h3 {
    font-size: 1rem;
  }

  .ai-info-panel__copy p {
    font-size: 0.875rem;
    line-height: 1.65;
  }

  /* Phone & OTP mobile adjustments */
  .otp-modal-content {
    max-width: calc(100vw - 2rem);
    border-radius: 1rem;
  }
  .otp-modal-hero {
    padding: 1.5rem 1.25rem 1rem;
  }
  .otp-modal-body {
    padding: 1rem 1.25rem 1.25rem;
  }
  .otp-modal-actions {
    padding: 0.75rem 1.25rem 1.25rem;
  }
  .otp-box {
    width: 42px;
    height: 50px;
    font-size: 1.25rem;
  }
  .otp-boxes {
    gap: 0.375rem;
  }
  .phone-hero-icon {
    width: 40px;
    height: 40px;
  }
  .phone-hero-icon svg {
    width: 20px;
    height: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    width: min(85vw, 320px);
  }

  .sidebar.active {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-header {
    padding: 0.75rem 1rem;
    height: auto;
    flex-wrap: wrap;
  }

  .page {
    padding: 1rem;
  }

  .header-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-title h1 {
    font-size: 1.375rem;
  }

  .header-actions {
    margin-left: auto;
    flex-shrink: 0;
  }

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

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .check-options {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }

  .filter-buttons {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .submissions-table,
  .users-table,
  .transactions-table,
  .data-table {
    min-width: 640px;
  }

  .submissions-table th,
  .submissions-table td {
    padding: 0.75rem;
  }

  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
    max-width: calc(100vw - 2rem) !important;
    box-sizing: border-box;
  }

  .modal-footer {
    flex-direction: column;
  }

  .report-tabs {
    flex-direction: column;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .submission-actions,
  .table-actions,
  .admin-actions {
    flex-wrap: wrap;
  }

  .activity-item {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
  }

  .auth-container {
    padding: 1rem;
  }

  .social-buttons {
    flex-direction: column;
  }

  .header-actions span {
    display: none;
  }

  .main-header {
    gap: 0.75rem;
  }

  .header-title h1 {
    font-size: 1.25rem;
  }

  .submission-scores {
    display: none;
  }

  .table-actions {
    flex-direction: column;
  }

  .stat-card {
    padding: 1rem;
  }

  .card-header {
    padding: 1rem;
  }
}

/* ============================================
   ADMIN PANEL STYLES
   ============================================ */

/* Admin Section in Sidebar */
.nav-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.nav-section-title {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 1rem;
  margin-bottom: 0.75rem;
}

.admin-section {
  display: none;
}

.admin-section.visible {
  display: block;
}

/* Admin Dashboard */
.admin-dashboard-container {
  max-width: 1400px;
}

.stats-overview .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stats-overview .stat-card {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
  border: none;
}

.stats-overview .stat-icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-md);
}

.stats-overview .stat-icon svg {
  width: 28px;
  height: 28px;
}

.stats-overview .stat-value {
  font-size: 2rem;
}

/* Recent Activity */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  transition: var(--transition);
}

.activity-item:hover {
  background: var(--gray-100);
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.activity-icon svg {
  width: 20px;
  height: 20px;
}

.activity-icon.submission {
  background: var(--info-light);
  color: var(--info);
}

.activity-icon.user {
  background: var(--success-light);
  color: var(--success);
}

.activity-icon.credit {
  background: var(--warning-light);
  color: var(--warning);
}

.activity-content {
  flex: 1;
}

.activity-title {
  display: block;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 0.125rem;
}

.activity-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
}

/* Admin Users Page */
.admin-users-container {
  max-width: 1400px;
}

.user-search-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 1rem 1.5rem;
  text-align: left;
}

.users-table th {
  background: var(--gray-50);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
}

.users-table td {
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.users-table tbody tr:hover {
  background: var(--gray-50);
}

.user-info-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info-cell .user-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.user-info-cell .user-details {
  display: flex;
  flex-direction: column;
}

.user-info-cell .user-name {
  font-weight: 500;
  color: var(--gray-900);
}

.user-info-cell .user-id {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.user-ip {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  color: var(--gray-600);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.role-badge.admin {
  background: var(--primary-light);
  color: var(--primary);
}

.role-badge.operator {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.role-badge.user {
  background: var(--gray-100);
  color: var(--gray-600);
}

.user-avatar.operator-badge {
  background: #f59e0b;
  color: #fff;
}

/* User Contact Cell (Admin Users Table) */
.user-contact-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.user-contact-email,
.user-contact-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.user-contact-email svg,
.user-contact-phone svg {
  flex-shrink: 0;
  color: var(--gray-400);
}

/* WhatsApp Badge */
.wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  white-space: nowrap;
}

.wa-badge svg {
  flex-shrink: 0;
}

.wa-badge.wa-on {
  background: rgba(37, 211, 102, 0.1);
  color: #16a34a;
}

.wa-badge.wa-off {
  background: var(--gray-100);
  color: var(--gray-400);
  font-weight: 400;
}

/* Payment Type Filter Buttons */
.payment-type-btn {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.payment-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.payment-type-btn:hover:not(.active) {
  background: var(--gray-50);
}

/* Admin Submissions Page */
.admin-submissions-container {
  max-width: 1400px;
}

.log-message {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-600);
  border-left: 3px solid var(--gray-300);
  padding-left: 0.5rem;
  max-width: 260px;
}

.log-message .log-text {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-message .log-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
}

.log-message.info { border-color: var(--info); }
.log-message.success { border-color: var(--success); }
.log-message.error { border-color: var(--error); }

.log-history {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 0.75rem;
  max-height: 220px;
  overflow: auto;
}

.log-history-item {
  display: flex;
  gap: 0.5rem;
}

.log-history-item .log-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--gray-300);
  margin-top: 0.45rem;
  flex-shrink: 0;
}

.log-history-item .log-line {
  font-size: 0.8125rem;
  color: var(--gray-700);
}

.log-history-item .log-time {
  font-size: 0.6875rem;
  color: var(--gray-400);
  margin-top: 0.125rem;
}

.log-history-item.info .log-dot { background: var(--info); }
.log-history-item.success .log-dot { background: var(--success); }
.log-history-item.error .log-dot { background: var(--error); }

.log-history-empty {
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.submission-filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select {
  padding: 0.625rem 2rem 0.625rem 0.875rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  min-width: 150px;
  font-family: inherit;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Admin Credits Page */
.admin-credits-container {
  max-width: 1400px;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
}

.transactions-table th,
.transactions-table td {
  padding: 1rem 1.5rem;
  text-align: left;
}

.transactions-table th {
  background: var(--gray-50);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--gray-200);
}

.transactions-table td {
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.transactions-table tbody tr:hover {
  background: var(--gray-50);
}

.credit-amount {
  font-weight: 600;
}

.credit-amount.positive {
  color: var(--success);
}

.credit-amount.negative {
  color: var(--error);
}

/* Admin Settings Page */
.admin-settings-container {
  max-width: 800px;
}

.admin-settings-tabbar {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  z-index: 20;
  margin-bottom: 1rem;
  backdrop-filter: blur(12px);
}

.admin-settings-tabbar .card-body {
  padding: 0.75rem;
}

.admin-settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.admin-settings-tab {
  border: none;
  border-radius: var(--radius-full);
  padding: 0.625rem 1rem;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: var(--transition);
}

.admin-settings-tab:hover {
  background: var(--gray-200);
  color: var(--gray-800);
  transform: translateY(-1px);
}

.admin-settings-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px -18px rgba(79, 70, 229, 0.65);
}

.admin-settings-card {
  margin-bottom: 1rem;
}

.admin-settings-card[hidden] {
  display: none !important;
}

.admin-settings-container .form-group {
  margin-bottom: 1.5rem;
}

.admin-settings-container .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.admin-settings-container .form-group input,
.admin-settings-container .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  font-family: inherit;
  transition: var(--transition);
}

.admin-settings-container .form-group input:focus,
.admin-settings-container .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

@media (max-width: 768px) {
  .admin-settings-tabbar {
    top: 0.75rem;
  }

  .admin-settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.125rem;
  }

  .admin-settings-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-settings-tab {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* User Edit Modal */
.user-edit-modal {
  max-width: 500px;
}

.user-edit-modal .modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.user-edit-modal .modal-body {
  padding: 1.5rem;
}

.user-edit-modal .form-group {
  margin-bottom: 1.25rem;
}

.user-edit-modal .form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.user-edit-modal .form-group input,
.user-edit-modal .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  font-family: inherit;
  transition: var(--transition);
}

.user-edit-modal .form-group input:focus,
.user-edit-modal .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.credit-adjustment {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.credit-adjustment input {
  flex: 1;
}

.credit-adjustment .btn {
  flex-shrink: 0;
}

/* Admin Action Buttons */
.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-actions .btn-icon {
  width: 32px;
  height: 32px;
}

.admin-actions .btn-icon svg {
  width: 16px;
  height: 16px;
}

.admin-actions .btn-icon.edit:hover {
  background: var(--info-light);
  color: var(--info);
}

.admin-actions .btn-icon.delete:hover {
  background: var(--error-light);
  color: var(--error);
}

.admin-actions .btn-icon.view:hover {
  background: var(--success-light);
  color: var(--success);
}

/* Admin Badge on User Avatar */
.user-avatar.admin-badge {
  position: relative;
}

.user-avatar.admin-badge::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border: 2px solid var(--white);
  border-radius: var(--radius-full);
}

/* Quick Stats Cards for Admin */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quick-stat {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-stat-icon svg {
  width: 18px;
  height: 18px;
}

.quick-stat-content {
  flex: 1;
}

.quick-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
}

.quick-stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
}

/* ============================================
   INBOX / MESSAGING STYLES
   ============================================ */

.inbox-container {
  max-width: 780px;
  margin: 0 auto;
}

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

.inbox-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inbox-header-left h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.inbox-count {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Message item — clean row, not boxed cards */
.inbox-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-bottom: none;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.inbox-item:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.inbox-item:last-child {
  border-bottom: 1px solid var(--gray-100);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.inbox-item:only-child {
  border-radius: var(--radius-lg);
  border-bottom: 1px solid var(--gray-100);
}

.inbox-item:hover {
  background: var(--gray-50);
}

/* Unread indicator — accent left border */
.inbox-item.unread {
  background: #F0F4FF;
  border-left: 3px solid var(--primary);
}

.inbox-item.unread .inbox-item-subject {
  font-weight: 700;
  color: var(--gray-900);
}

.inbox-item-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 0.5rem;
  opacity: 0;
}

.inbox-item.unread .inbox-item-dot {
  opacity: 1;
}

.inbox-item-body {
  flex: 1;
  min-width: 0;
}

.inbox-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.inbox-item-subject {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item-date {
  font-size: 0.75rem;
  color: var(--gray-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.inbox-item-preview {
  font-size: 0.8125rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  margin-left: 0.5rem;
  flex-shrink: 0;
}

/* Message detail modal */
.message-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
}

.message-detail-sender {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.message-detail-date {
  font-size: 0.8125rem;
  color: var(--gray-400);
}

.message-detail-content {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--gray-800);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Admin compose */
.admin-messages-container {
  max-width: 780px;
  margin: 0 auto;
}

/* ─── Page Header ─── */
.compose-page-header {
  margin-bottom: 1.5rem;
}
.compose-page-title {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.compose-page-title > svg,
.compose-page-title > i {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}
.compose-page-title h2 {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
}
.compose-page-title p {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  color: var(--gray-500);
}

/* ─── Compose Card ─── */
.compose-card .card-body {
  padding: 1.75rem;
}

/* ─── Section Steps ─── */
.compose-section {
  margin-bottom: 1.75rem;
}
.compose-section:last-of-type {
  margin-bottom: 0;
}
.compose-section-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-700);
}
.compose-step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Recipient Toggle (Card-style) ─── */
.msg-recipient-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
}
.msg-type-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: left;
  font-size: inherit;
  color: var(--gray-700);
}
.msg-type-btn > svg,
.msg-type-btn > i {
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  flex-shrink: 0;
  transition: color 0.2s;
}
.msg-type-text {
  display: flex;
  flex-direction: column;
  gap: 0.0625rem;
}
.msg-type-text strong {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-800);
  transition: color 0.2s;
}
.msg-type-text span {
  font-size: 0.75rem;
  color: var(--gray-400);
  transition: color 0.2s;
}
.msg-type-btn:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}
.msg-type-btn.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}
.msg-type-btn.active > svg,
.msg-type-btn.active > i {
  color: var(--primary);
}
.msg-type-btn.active .msg-type-text strong {
  color: var(--primary);
}

/* ─── Recipient Search Field ─── */
.recipient-field {
  transition: max-height 0.3s, opacity 0.3s;
}
.recipient-field.hidden-field {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin: 0;
  pointer-events: none;
}

.recipient-search-wrapper {
  position: relative;
}
.recipient-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  pointer-events: none;
}
.recipient-search-wrapper input {
  padding-left: 2.25rem;
}

.recipient-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 20;
  display: none;
  max-height: 220px;
  overflow-y: auto;
}
.recipient-dropdown.open {
  display: block;
}

.recipient-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s;
  border-bottom: 1px solid var(--gray-50);
}
.recipient-option:last-child {
  border-bottom: none;
}
.recipient-option:hover {
  background: var(--gray-50);
}
.recipient-option .recipient-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}
.recipient-option .recipient-info {
  min-width: 0;
}
.recipient-option .recipient-email {
  color: var(--gray-800);
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipient-option .recipient-name {
  color: var(--gray-400);
  font-size: 0.75rem;
  display: block;
}

/* ─── Selected Recipient Chip ─── */
.selected-recipient {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: var(--radius-lg);
}
.selected-recipient-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.selected-recipient-avatar svg {
  width: 16px;
  height: 16px;
}
.selected-recipient-info {
  flex: 1;
  min-width: 0;
}
.selected-recipient-email {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selected-recipient-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
}
.selected-recipient-clear {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.selected-recipient-clear:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}
.selected-recipient-clear svg {
  width: 16px;
  height: 16px;
}

/* ─── Char Count ─── */
.compose-char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.375rem;
}

/* ─── Send Actions ─── */
.compose-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
}

/* ─── Sent History Card ─── */
.sent-history-card {
  margin-top: 1.5rem;
}
.sent-history-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sent-history-title svg {
  width: 18px;
  height: 18px;
  color: var(--gray-500);
}
.sent-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.375rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Admin sent messages list */
.admin-sent-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.15s;
}
.admin-sent-item:last-child {
  border-bottom: none;
}
.admin-sent-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.admin-sent-icon.is-personal {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}
.admin-sent-icon.is-broadcast {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}
.admin-sent-icon svg {
  width: 16px;
  height: 16px;
}
.admin-sent-info {
  flex: 1;
  min-width: 0;
}
.admin-sent-subject {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--gray-800);
  margin-bottom: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-sent-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-sent-meta .sent-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.0625rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.sent-type-tag.is-personal {
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}
.sent-type-tag.is-broadcast {
  background: rgba(245, 158, 11, 0.08);
  color: var(--warning);
}
.admin-sent-actions {
  flex-shrink: 0;
}
.admin-sent-actions .btn {
  color: var(--gray-400);
}
.admin-sent-actions .btn:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.08);
  border-color: transparent;
}

/* ─── Mobile responsive ─── */
@media (max-width: 640px) {
  .compose-card .card-body {
    padding: 1.25rem;
  }
  .msg-recipient-toggle {
    grid-template-columns: 1fr;
  }
  .compose-actions {
    flex-direction: column-reverse;
  }
  .compose-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .admin-sent-icon {
    display: none;
  }
}

/* Inbox loading skeleton */
.inbox-skeleton {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-100);
  border-bottom: none;
}

.inbox-skeleton:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.inbox-skeleton:last-child { border-bottom: 1px solid var(--gray-100); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.inbox-skeleton .skel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-200);
  margin-top: 0.5rem;
}

.inbox-skeleton .skel-body {
  flex: 1;
}

.inbox-skeleton .skel-line {
  height: 0.875rem;
  border-radius: 4px;
  background: var(--gray-100);
  margin-bottom: 0.5rem;
  animation: shimmer 1.5s infinite;
}

.inbox-skeleton .skel-line.w60 { width: 60%; }
.inbox-skeleton .skel-line.w80 { width: 80%; }
.inbox-skeleton .skel-line.w40 { width: 40%; }

@keyframes shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 768px) {
  .inbox-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .inbox-item {
    padding: 0.875rem 1rem;
  }
  .message-detail-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

.profile-container {
  max-width: 820px;
  margin: 0 auto;
}

/* ---- Profile Hero (banner + avatar + quick stats) ---- */
.profile-hero {
  border-radius: 20px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 12px 28px -16px rgba(15, 23, 42, 0.10);
  border: 1px solid var(--gray-100);
  margin-bottom: 1.25rem;
}
.profile-hero-banner {
  height: 80px;
  background:
    radial-gradient(at 25% 30%, color-mix(in srgb, var(--primary) 65%, #1e1b4b) 0%, transparent 60%),
    radial-gradient(at 80% 70%, color-mix(in srgb, var(--primary) 35%, #312e81) 0%, transparent 55%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, var(--primary) 100%);
  position: relative;
}
.profile-hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.profile-hero-body {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.75rem 1.5rem;
  margin-top: -32px;
  position: relative;
  z-index: 1;
}
.profile-avatar-large {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: var(--white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  border: 3px solid var(--white);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}
.profile-header-info {
  padding-top: 1.75rem;
  min-width: 0;
  flex: 1;
}
.profile-header-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.profile-header-info p {
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* Quick Stats row inside hero */
.profile-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 0 1.25rem 1.25rem;
}
.profile-quick-stat {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-100);
  min-width: 0;
}
.profile-quick-stat:not(:last-child) {
  border-right: 1px solid var(--gray-100);
  padding-right: 0.875rem;
  margin-right: 0;
}
.profile-quick-stat > svg,
.profile-quick-stat > i {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
  opacity: 0.7;
}
.pqs-label {
  display: block;
  font-size: 0.6875rem;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 0.2rem;
}
.pqs-value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---- Profile Cards ---- */
.profile-card {
  border-radius: var(--radius-xl) !important;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.25s ease;
}
.profile-card:hover {
  box-shadow: var(--shadow-md);
}
.profile-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.profile-card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}
.profile-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-card-icon svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}
.profile-card-icon--danger {
  background: #FEE2E2;
}
.profile-card-icon--danger svg {
  color: var(--error);
}
.profile-card .card-body {
  padding: 1.5rem;
}

/* Disabled input */
.input-disabled {
  background: var(--gray-50) !important;
  color: var(--gray-400) !important;
  cursor: not-allowed !important;
  border-color: var(--gray-150, var(--gray-200)) !important;
}

/* Phone display for phone-registered users */
.profile-phone-display {
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}

/* Profile WhatsApp field reuse phone-field from WA modal */
.profile-wa-field {
  max-width: 380px;
}

/* ---- Danger Card ---- */
.profile-danger-card {
  border-color: #FEE2E2 !important;
}
.profile-danger-card .profile-card-header {
  background: #FFF5F5;
  border-bottom-color: #FEE2E2;
}
.profile-danger-card .profile-card-header h3 {
  color: var(--error);
}

/* Danger Zone */
.danger-zone {
  border-color: #FEE2E2;
}

.danger-zone .card-header h3 {
  color: var(--error);
}

.danger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.danger-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.danger-info p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0;
}

.btn-danger {
  background: var(--error);
  color: var(--white);
  border: none;
  transition: background 0.2s, transform 0.15s;
}

.btn-danger:hover {
  background: #DC2626;
  transform: translateY(-1px);
}
.btn-danger:active {
  transform: translateY(0) scale(0.98);
}

/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

/* Profile form inputs — full width */
.profile-card input[type="text"],
.profile-card input[type="email"],
.profile-card input[type="tel"],
.profile-card input[type="password"] {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.profile-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.profile-card .form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 0.375rem;
}
.profile-card .form-group {
  margin-bottom: 1.125rem;
}
.profile-card .form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.5rem;
}

/* Form Row for Side by Side Fields */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Visually Hidden (for accessibility) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Credit Amount Styling */
.credit-amount {
  font-weight: 600;
  font-size: 0.9375rem;
}

.credit-amount.positive {
  color: var(--success);
}

.credit-amount.negative {
  color: var(--error);
}

/* User Info Cell */
.user-info-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-info-cell .user-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-details .user-name {
  font-weight: 500;
  color: var(--gray-900);
}

.user-details .user-id {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* Role Badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-600);
}

.role-badge.admin {
  background: var(--primary-light);
  color: var(--primary);
}

.role-badge.operator {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.role-badge.user {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* Improve Table Styling for Admin Pages */
.users-table,
.transactions-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td,
.transactions-table th,
.transactions-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.users-table th,
.transactions-table th {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gray-50);
}

.users-table tbody tr:hover,
.transactions-table tbody tr:hover {
  background: var(--gray-50);
}

/* Activity List Styles */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  transition: var(--transition);
}

.activity-item:hover {
  background: var(--gray-100);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon svg {
  width: 18px;
  height: 18px;
}

.activity-icon.user {
  background: var(--info-light);
  color: var(--info);
}

.activity-icon.submission {
  background: var(--success-light);
  color: var(--success);
}

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

.activity-title {
  display: block;
  font-weight: 500;
  color: var(--gray-900);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--gray-400);
  flex-shrink: 0;
}

/* Stats Grid Improvement */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

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

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

/* Submission Filters Improvement */
.submission-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

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

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--gray-900);
  cursor: pointer;
  min-width: 150px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* User Search Bar */
.user-search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.user-search-bar .search-box {
  flex: 1;
  min-width: 200px;
}

/* Responsive Profile */
@media (max-width: 768px) {
  .profile-hero-body {
    flex-direction: column;
    text-align: center;
    padding: 0 1.25rem;
  }
  .profile-header-info {
    padding-top: 0.5rem;
  }
  .profile-quick-stats {
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 1.25rem 1rem;
  }
  .profile-quick-stat {
    padding: 0.625rem 0;
  }
  .profile-quick-stat:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
    padding-right: 0;
    margin-right: 0;
    padding-bottom: 0.625rem;
    margin-bottom: 0;
  }
  .danger-item {
    flex-direction: column;
    text-align: center;
  }
  .danger-item .btn-danger {
    width: 100%;
  }
}

/* ============================================
   BUTTON SIZES
   ============================================ */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-sm svg {
  width: 15px;
  height: 15px;
}

.pagination-bar {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--gray-200);
}

/* ============================================
   STATUS BADGE VARIANTS (for guest links)
   ============================================ */
.status-badge.success {
  background: var(--success-light);
  color: #059669;
}

.status-badge.info {
  background: var(--info-light);
  color: var(--info);
}

.status-badge.warning {
  background: var(--warning-light);
  color: #D97706;
}

/* ============================================
   GUEST LINKS ADMIN PAGE
   ============================================ */
.gl-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.gl-page-header .gl-title-area h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gl-page-header .gl-title-area p {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0;
}

.gl-page-header .gl-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Stats row */
.gl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.gl-stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.gl-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gl-stat-icon svg {
  width: 20px;
  height: 20px;
}

.gl-stat-icon.total { background: var(--primary-light); color: var(--primary); }
.gl-stat-icon.active { background: var(--success-light); color: var(--success); }
.gl-stat-icon.used { background: var(--info-light); color: var(--info); }
.gl-stat-icon.expired { background: var(--warning-light); color: var(--warning); }

.gl-stat-text .gl-stat-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}

.gl-stat-text .gl-stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.125rem;
}

/* Link table card */
.gl-table-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.gl-table-card .table-responsive {
  overflow-x: auto;
}

.gl-table {
  width: 100%;
  border-collapse: collapse;
}

.gl-table thead {
  background: var(--gray-50);
}

.gl-table th {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
}

.gl-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.gl-table tbody tr:hover {
  background: var(--gray-50);
}

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

.gl-link-label {
  font-weight: 500;
  color: var(--gray-900);
}

.gl-link-label small {
  display: block;
  font-weight: 400;
  color: var(--gray-400);
  font-size: 0.75rem;
  margin-top: 0.125rem;
}

.gl-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

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

.gl-token-chip svg {
  width: 12px;
  height: 12px;
  opacity: 0.5;
}

.gl-msg-preview {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  max-width: 200px;
}

.gl-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gl-color-dot.c-green { background: #10B981; }
.gl-color-dot.c-yellow { background: #F59E0B; }
.gl-color-dot.c-red { background: #EF4444; }
.gl-color-dot.c-blue { background: #3B82F6; }

.gl-msg-text {
  font-size: 0.8125rem;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-date {
  font-size: 0.8125rem;
  color: var(--gray-500);
  white-space: nowrap;
}

.gl-actions-cell {
  display: flex;
  gap: 0.25rem;
}

.gl-empty {
  padding: 3rem 1.5rem;
  text-align: center;
}

.gl-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.gl-empty-icon svg {
  width: 24px;
  height: 24px;
  color: var(--gray-400);
}

.gl-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  margin: 0 0 0.25rem;
}

.gl-empty p {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin: 0;
}

/* ============================================
   CREATE GUEST LINK MODAL - REDESIGNED
   ============================================ */
.gl-modal .modal-content {
  max-width: 540px;
  text-align: left;
  padding: 0;
}

.gl-form-section {
  padding: 0 1.5rem;
  margin-bottom: 1.25rem;
}

.gl-form-section:first-child {
  padding-top: 0;
}

.gl-form-section label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.gl-form-section label .gl-optional {
  font-weight: 400;
  color: var(--gray-400);
  margin-left: 0.25rem;
}

.gl-form-section small {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
}

.gl-form-section input[type="text"],
.gl-form-section input[type="number"],
.gl-form-section textarea,
.gl-form-section select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.gl-form-section input:focus,
.gl-form-section textarea:focus,
.gl-form-section select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.gl-form-section textarea {
  resize: vertical;
  min-height: 70px;
}

.gl-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

/* Template pills */
.gl-template-bar {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.gl-tpl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.625rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  background: var(--white);
  font-size: 0.75rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.gl-tpl-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.gl-tpl-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
}

.gl-tpl-btn svg {
  width: 12px;
  height: 12px;
}

/* Color picker swatches */
.gl-color-picker {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.gl-color-opt {
  position: relative;
  cursor: pointer;
}

.gl-color-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gl-color-swatch {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: var(--transition);
}

.gl-color-swatch .swatch-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.gl-color-opt input:checked + .gl-color-swatch {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.swatch-dot.sw-none { background: var(--gray-300); }
.swatch-dot.sw-green { background: #10B981; }
.swatch-dot.sw-yellow { background: #F59E0B; }
.swatch-dot.sw-red { background: #EF4444; }
.swatch-dot.sw-blue { background: #3B82F6; }

/* Message preview */
.gl-msg-preview-box {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  line-height: 1.5;
  display: none;
}

.gl-msg-preview-box.visible {
  display: block;
}

.gl-msg-preview-box.pv-none {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
}

.gl-msg-preview-box.pv-green {
  background: #ECFDF5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.gl-msg-preview-box.pv-yellow {
  background: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.gl-msg-preview-box.pv-red {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.gl-msg-preview-box.pv-blue {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.gl-preview-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 0.375rem;
}

/* Created link modal */
.gl-success-modal .modal-content {
  max-width: 520px;
  text-align: left;
  padding: 0;
}

.gl-success-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--success-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.gl-success-icon svg {
  width: 24px;
  height: 24px;
  color: var(--success);
}

.gl-url-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.5rem;
  margin-top: 0.75rem;
}

.gl-url-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.8125rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--gray-700);
  outline: none;
  min-width: 0;
}

.gl-url-box .btn {
  flex-shrink: 0;
}

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

  .gl-page-header {
    flex-direction: column;
  }

  .gl-form-row {
    grid-template-columns: 1fr;
  }

  .gl-table th:nth-child(6),
  .gl-table th:nth-child(7),
  .gl-table td:nth-child(6),
  .gl-table td:nth-child(7) {
    display: none;
  }
}

@media (max-width: 480px) {
  .gl-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .gl-stat-card {
    padding: 0.75rem;
  }

  .gl-color-picker {
    flex-wrap: wrap;
  }
}

/* ============================================
   TEMPLATE LIST (manage templates modal)
   ============================================ */
.tpl-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
}

.tpl-item:hover {
  background: var(--gray-50);
}

.tpl-item:last-child {
  border-bottom: none;
}

.tpl-color-bar {
  width: 4px;
  min-height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}

.tpl-color-bar.tc-none { background: var(--gray-300); }
.tpl-color-bar.tc-green { background: #10B981; }
.tpl-color-bar.tc-yellow { background: #F59E0B; }
.tpl-color-bar.tc-red { background: #EF4444; }
.tpl-color-bar.tc-blue { background: #3B82F6; }

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

.tpl-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.125rem;
}

.tpl-text {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tpl-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  align-self: center;
}

.tpl-actions .btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
}

.tpl-actions .btn-icon svg {
  width: 14px;
  height: 14px;
}

/* Edit mode for template item */
.tpl-edit-row {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--primary-light);
}

.tpl-edit-row .tpl-edit-fields {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tpl-edit-row input,
.tpl-edit-row select {
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  outline: none;
}

.tpl-edit-row input:focus,
.tpl-edit-row textarea:focus {
  border-color: var(--primary);
}

.tpl-edit-row textarea {
  width: 100%;
  padding: 0.375rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
  min-height: 50px;
}

.tpl-edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  justify-content: flex-end;
}

/* Impersonation Banner */
.impersonate-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.impersonate-banner.hidden { display: none; }
.impersonate-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.impersonate-banner .btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 4px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
}
.impersonate-banner .btn-sm:hover {
  background: rgba(255,255,255,0.35);
}
.app-container.impersonating {
  padding-top: 40px;
}
.app-container.impersonating .sidebar {
  top: 40px;
  height: calc(100vh - 40px);
}

/* ============================
   PAYMENT SYSTEM STYLES
   ============================ */

/* ─── Payment Wizard Modal ─── */
.pay-wizard {
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pay-wizard-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.pay-wizard-panel {
  display: none;
}
.pay-wizard-panel.active {
  display: block;
}
.pay-wizard-footer {
  padding: 0.875rem 1.5rem;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  background: var(--white);
}

/* ─── Payment Stepper ─── */
.payment-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  gap: 0;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}
.payment-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.payment-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-400);
  transition: all 0.25s;
  flex-shrink: 0;
}
.payment-step-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-400);
  transition: color 0.25s;
  white-space: nowrap;
}
.payment-step-line {
  width: 2rem;
  height: 2px;
  background: var(--gray-200);
  margin: 0 0.375rem;
  flex-shrink: 0;
  transition: background 0.25s;
}

/* Active step */
.payment-step.active .payment-step-circle {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.payment-step.active .payment-step-label {
  color: var(--primary);
  font-weight: 600;
}

/* Completed step */
.payment-step.completed .payment-step-circle {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.payment-step.completed .payment-step-label {
  color: var(--success);
}
.payment-step.completed ~ .payment-step-line {
  background: var(--success);
}

/* ─── Pay Package Card ─── */
.pay-pkg-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

/* ─── Pay Step Intro ─── */
.pay-step-intro {
  text-align: center;
  padding: 0.5rem 0 1rem;
}
.pay-step-intro-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}
.pay-step-intro-icon svg {
  width: 24px;
  height: 24px;
}
.pay-step-intro-icon.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}
.pay-step-intro p {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.9375rem;
}

/* ─── Screenshot Requirement Hint ─── */
.screenshot-requirement-hint {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-bottom: 1rem;
}
.screenshot-requirement-hint > svg,
.screenshot-requirement-hint > i {
  width: 18px;
  height: 18px;
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.screenshot-requirement-hint strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gray-800);
}
.screenshot-requirement-hint ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}
.screenshot-requirement-hint li {
  margin-bottom: 0.125rem;
}
.screenshot-requirement-hint span {
  font-size: 0.75rem;
  color: var(--error);
  font-weight: 500;
}
.screenshot-guide-img {
  margin-top: 0.5rem;
}
.screenshot-guide-img img {
  max-width: 100%;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--gray-200);
}

/* ─── Pay Review Card ─── */
.pay-review-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
}

/* Screenshot drop zone */
.screenshot-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50);
}
.screenshot-drop-zone:hover,
.screenshot-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}
.screenshot-drop-zone p {
  margin: 0.5rem 0 0;
  color: var(--gray-500);
  font-size: 0.875rem;
}
.screenshot-preview {
  text-align: center;
  padding: 1rem 0;
}

/* Payment methods grid */
.payment-methods-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.payment-method-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  background: var(--gray-50);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.payment-method-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}
.payment-method-card.alipay-card {
  align-items: flex-start;
}
.payment-method-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.payment-method-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}
.payment-method-icon.fps { background: #00A651; }
.payment-method-icon.bank { background: #1E3A5F; }
.payment-method-icon.payme { background: #DB0011; }
.payment-method-icon.alipay { background: #1677FF; }

.payment-method-info {
  flex: 1;
  min-width: 0;
}
.payment-method-label {
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.payment-method-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
  word-break: break-all;
}
.payment-method-name {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 0.125rem;
}

/* Copy button */
.pm-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.pm-copy-btn svg {
  width: 14px;
  height: 14px;
}
.pm-copy-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
  border-color: var(--primary-light, #818CF8);
}
.pm-copy-btn.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

/* PayMe link */
.pm-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  margin-top: 0.25rem;
}
.pm-link-btn svg {
  width: 14px;
  height: 14px;
}
.pm-link-btn:hover {
  background: var(--primary-dark, #4338CA);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* AlipayHK QR */
.alipay-qr-wrapper {
  position: relative;
  display: inline-block;
  margin-top: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.alipay-qr-img {
  display: block;
  max-width: 160px;
  border-radius: var(--radius-md);
  transition: filter 0.2s;
}
.alipay-qr-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: rgba(0,0,0,0.5);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}
.alipay-qr-hover svg {
  width: 16px;
  height: 16px;
}
.alipay-qr-wrapper:hover .alipay-qr-hover {
  opacity: 1;
}
.alipay-qr-wrapper:hover .alipay-qr-img {
  filter: brightness(0.85);
}
.alipay-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 480px) {
  .payment-method-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .payment-method-icon {
    width: 32px;
    height: 32px;
  }
  .payment-method-icon svg {
    width: 16px;
    height: 16px;
  }
  .payment-stepper {
    padding: 0.75rem 1rem;
  }
  .payment-step-label {
    font-size: 0.6875rem;
  }
  .payment-step-line {
    width: 1.25rem;
  }
  .pay-wizard-body {
    padding: 1rem;
  }
}

/* Admin payment card */
.admin-payment-card {
  transition: box-shadow 0.2s;
}
.admin-payment-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Pending payments badge in nav */
.pending-payments-badge {
  background: var(--error);
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  font-weight: 700;
  margin-left: auto;
  min-width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Payment filter buttons */
.payment-filter-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}
.payment-filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.payment-filter-btn:hover:not(.active) {
  background: var(--gray-100);
}

/* Button variants */
.btn-error {
  background-color: var(--error);
  color: white;
  border: none;
}
.btn-error:hover {
  background-color: #dc2626;
}

/* ============================
   TOOLTIP
   ============================ */
.tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  margin-left: 0.25rem;
  color: var(--gray-400);
  transition: color 0.15s;
}
.tooltip-trigger:hover {
  color: var(--primary);
}
.tooltip-trigger svg,
.tooltip-trigger i {
  width: 15px;
  height: 15px;
}
.tooltip-trigger::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  width: 280px;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}
.tooltip-trigger::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gray-900);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
}
.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 640px) {
  .tooltip-trigger::after {
    left: auto;
    right: -1rem;
    transform: none;
    width: 240px;
  }
  .tooltip-trigger::before {
    left: auto;
    right: 0.5rem;
    transform: none;
  }
}

/* ============================================
   PROCESSING QUEUE STYLES
   ============================================ */

/* Submission detail modal grids */
.detail-scores-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 8px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.detail-full-row {
  grid-column: 1 / -1;
}

/* Submission detail footer */
.detail-footer-wrap {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.detail-footer-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Queue styles */
.queue-summary {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--gray-500);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.queue-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.queue-item-urgent {
  border-left: 4px solid var(--error);
  background: var(--error-light, #fef2f2);
}

.queue-item-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.queue-item-number {
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
  font-weight: 700;
  color: var(--gray-400);
  font-size: 0.875rem;
}

.queue-item-info {
  flex: 1;
  min-width: 200px;
}

.queue-item-title {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}

.queue-item-meta {
  font-size: 0.8125rem;
  color: var(--gray-500);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.queue-item-meta i {
  width: 14px;
  height: 14px;
}

.queue-item-wait {
  font-weight: 500;
  color: var(--warning);
}
.queue-item-wait.urgent {
  color: var(--error);
}

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

.queue-item-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 3rem;
}

.queue-item-note > i {
  width: 14px;
  height: 14px;
  color: var(--gray-400);
  flex-shrink: 0;
}

.queue-note-input {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 0.8125rem;
  flex: 1;
  min-width: 100px;
  font-family: inherit;
}

.queue-quick-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem 0 0 1.75rem;
}
.queue-quick-notes .btn-xs {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  color: var(--gray-500);
  border-color: var(--gray-200);
  cursor: pointer;
  transition: all 0.15s;
}
.queue-quick-notes .btn-xs:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light, #eef2ff);
}

.queue-assigned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.queue-assigned-badge i, .queue-assigned-badge svg {
  width: 12px;
  height: 12px;
}
.queue-assigned-badge.mine {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.queue-assigned-badge.other {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.queue-item-assigned-other {
  opacity: 0.55;
}
.queue-item-assigned-other:hover {
  opacity: 0.85;
}

.queue-credit-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-left: 0.45rem;
  padding: 0.16rem 0.52rem;
  border: 1px solid rgba(79, 70, 229, 0.22);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.10), rgba(16, 185, 129, 0.08));
  color: var(--primary-dark);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.3;
  cursor: pointer;
  vertical-align: middle;
  transition: var(--transition);
}
.queue-credit-tag:hover {
  border-color: rgba(79, 70, 229, 0.45);
  background: var(--white);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.14);
  transform: translateY(-1px);
}
.queue-credit-tag i,
.queue-credit-tag svg {
  width: 13px;
  height: 13px;
}

.gl-price-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.10);
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.guest-queue-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(255, 255, 255, 0.92));
}

.guest-queue-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gray-600);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.guest-queue-tab:hover {
  color: var(--gray-900);
  background: rgba(255, 255, 255, 0.75);
}

.guest-queue-tab.active {
  color: var(--white);
  background: linear-gradient(135deg, #0f172a, #334155);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.guest-queue-tab i,
.guest-queue-tab svg {
  width: 14px;
  height: 14px;
}

.guest-queue-shield {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.04), rgba(255, 255, 255, 0.96));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.guest-queue-shield strong {
  display: block;
  color: var(--gray-900);
  font-size: 1rem;
}

.guest-queue-shield span {
  color: var(--gray-500);
  font-size: 0.82rem;
}

.guest-queue-item {
  border-color: rgba(15, 23, 42, 0.12);
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0.025), transparent),
    var(--white);
}

.credit-price-summary {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid rgba(79, 70, 229, 0.16);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.10), transparent 32%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(249,250,251,0.92));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.credit-price-summary-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--primary);
  text-transform: uppercase;
}

.credit-price-summary-title {
  margin-top: 0.15rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gray-700);
}

.credit-price-chip-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
}

.credit-price-chip-row.compact {
  gap: 0.35rem;
}

.credit-price-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.52rem;
  border: 1px solid rgba(79, 70, 229, 0.20);
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.07);
  color: var(--gray-700);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.credit-price-chip strong {
  color: var(--primary);
  font-weight: 900;
}

.credit-trace-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.credit-trace-header {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.credit-trace-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(79, 70, 229, 0.10);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.credit-trace-icon svg {
  width: 20px;
  height: 20px;
}
.credit-trace-header h3 {
  margin: 0.1rem 0 0;
  color: var(--gray-900);
}
.credit-trace-header p {
  margin: 0.25rem 0 0;
  color: var(--gray-500);
  font-size: 0.86rem;
}
.credit-trace-price {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  color: var(--white);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.credit-trace-price span {
  font-size: 0.86rem;
  font-weight: 700;
  opacity: 0.78;
}
.credit-trace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.credit-trace-grid div {
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
}
.credit-trace-grid span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gray-500);
  font-size: 0.72rem;
  font-weight: 700;
}
.credit-trace-grid strong {
  color: var(--gray-800);
  font-size: 0.88rem;
  word-break: break-all;
}
.credit-trace-note {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--warning-light);
  color: #92400e;
  font-size: 0.8rem;
}

/* Admin Upload Drop Zone */
.admin-drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 120px;
  justify-content: center;
  background: var(--gray-50);
}
.admin-drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light, #eef2ff);
}
.admin-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light, #eef2ff);
  transform: scale(1.01);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.admin-drop-zone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
}
.admin-drop-zone-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.admin-drop-zone-icon svg {
  width: 22px;
  height: 22px;
  color: var(--gray-400);
}
.admin-drop-zone:hover .admin-drop-zone-icon {
  background: var(--white);
}
.admin-drop-zone:hover .admin-drop-zone-icon svg {
  color: var(--primary);
}
.admin-drop-zone.has-file .admin-drop-zone-icon {
  background: rgba(16, 185, 129, 0.1);
}
.admin-drop-zone.has-file .admin-drop-zone-icon svg {
  color: var(--success);
}
.admin-drop-zone-text {
  font-size: 0.875rem;
  color: var(--gray-500);
}
.admin-drop-zone-file {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success);
}

/* Shift clock pulse */
.shift-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  flex-shrink: 0;
  animation: shiftPulse 1.5s ease-in-out infinite;
}
@keyframes shiftPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* ============================================
   COMPREHENSIVE RESPONSIVE ENHANCEMENTS
   ============================================ */

/* --- Tablet landscape (≤1024px) --- */
@media (max-width: 1024px) {
  .queue-item-main {
    flex-direction: column;
    align-items: stretch;
  }
  .queue-item-actions {
    flex-wrap: wrap;
  }
}

/* --- Tablet / small laptop (≤768px) --- */
@media (max-width: 768px) {

  /* Page padding */
  .page {
    padding: 1rem;
  }

  /* Card body less padding */
  .card-body {
    padding: 1rem;
  }

  /* Modal: near full-screen on mobile */
  .modal {
    padding: 0.5rem;
  }
  .modal-content {
    max-width: none;
    width: 100%;
    max-height: 95vh;
    border-radius: var(--radius-md);
    padding: 1.25rem;
  }

  /* Admin table: hide less important columns */
  .submissions-table th:nth-child(4),
  .submissions-table td:nth-child(4) {
    display: none; /* hide log column */
  }

  /* Admin actions: smaller buttons */
  .admin-actions {
    gap: 0.25rem !important;
  }
  .admin-actions .btn-icon {
    width: 32px;
    height: 32px;
  }

  /* User management table: hide columns */
  .users-table th:nth-child(5),
  .users-table td:nth-child(5),
  .users-table th:nth-child(6),
  .users-table td:nth-child(6) {
    display: none;
  }

  /* Processing queue items */
  .queue-item-actions {
    width: 100%;
  }
  .queue-item-actions .btn-sm {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }
  .queue-item-note {
    padding-left: 0;
  }
  .queue-item-info {
    min-width: 0;
  }

  /* Stats cards: compact */
  .stat-icon {
    width: 40px;
    height: 40px;
  }
  .stat-icon svg {
    width: 20px;
    height: 20px;
  }
  .stat-value {
    font-size: 1.25rem;
  }

  /* Transaction item */
  .transaction-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Submission detail modal grid */
  .submission-detail-modal .modal-content {
    max-width: none;
  }

  /* Pagination bar */
  .pagination-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }

  /* Payment filter buttons scrollable */
  .payment-filter-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  /* Processing queue note row */
  .queue-note-input {
    font-size: 0.75rem !important;
  }

  /* Admin wage stats date pickers */
  .admin-wage-stats-container .card-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }
  .admin-wage-stats-container .card-header > div {
    flex-wrap: wrap;
    width: 100%;
  }
  .admin-wage-stats-container .card-header input[type="date"] {
    flex: 1;
    min-width: 120px;
  }

  /* Profile page */
  .profile-info-grid {
    grid-template-columns: 1fr !important;
  }

  /* Credit packages */
  .package-card {
    padding: 1rem;
  }
  .package-credits {
    font-size: 2rem;
  }

  /* Activity feed */
  .activity-list .activity-item {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* Guest links / promo codes tables */
  .gl-table {
    min-width: 500px;
  }

  /* Admin dashboard recent activity */
  .recent-activity .card-body {
    padding: 0.75rem;
  }
}

/* --- Phone (≤640px) --- */
@media (max-width: 640px) {

  /* Stack queue action buttons fully */
  .queue-item-actions {
    flex-direction: column;
  }
  .queue-item-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .queue-item-note {
    flex-wrap: wrap;
  }
  .queue-item-number {
    display: none;
  }
  .queue-item .btn-label {
    display: none;
  }

  /* Compact page title */
  .header-title h1 {
    font-size: 1.125rem;
  }

  /* Stats row: always single column */
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .stat-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
  }
  .stat-value {
    font-size: 1.125rem;
  }
  .stat-label {
    font-size: 0.75rem;
  }

  /* Card header compact */
  .card-header {
    padding: 0.875rem 1rem;
    gap: 0.5rem;
  }
  .card-header h2, .card-header h3 {
    font-size: 1rem;
  }

  /* Button sizing for touch */
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  .btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }
  .btn-lg {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }

  /* Filter buttons: wrap + scroll */
  .filter-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.375rem;
  }
  .filter-buttons::-webkit-scrollbar {
    display: none;
  }
  .filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  /* Search box full width */
  .search-box {
    width: 100%;
    max-width: none;
  }
  .search-box input {
    font-size: 0.875rem;
  }

  /* Admin table: force min-width and scroll */
  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  /* Modals: full screen feel */
  .modal {
    padding: 0;
  }
  .modal-content {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    max-height: 100vh;
    min-height: 50vh;
    align-self: flex-end;
    padding: 1rem;
  }

  /* Modal header */
  .modal-header {
    padding: 0.75rem 1rem;
  }
  .modal-header h3 {
    font-size: 1rem;
  }

  /* Modal footer: stack buttons */
  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  /* Upload area */
  .upload-area {
    padding: 1.5rem 1rem;
  }
  .upload-icon svg {
    width: 40px;
    height: 40px;
  }
  .upload-text h3 {
    font-size: 1rem;
  }
  .upload-text p {
    font-size: 0.8125rem;
  }

  /* Submission card scores */
  .submission-card-scores {
    gap: 0.5rem;
  }
  .score-group {
    min-width: 0;
  }

  /* Admin submission detail info grid */
  .detail-scores-grid,
  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  /* Detail footer: stack on mobile */
  .detail-footer-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .detail-footer-buttons {
    flex-direction: column;
  }
  .detail-footer-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Toast messages: wider on mobile */
  .toast-container {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
  }
  .toast {
    min-width: 0;
    width: 100%;
  }

  /* Credit hero */
  .credits-hero {
    padding: 1rem;
  }
  .credits-hero-value {
    font-size: 1.75rem;
  }

  /* Payment request cards */
  .admin-payment-card {
    padding: 0.75rem !important;
  }
}

/* --- Small phone (≤480px) --- */
@media (max-width: 480px) {

  /* Minimal padding */
  .page {
    padding: 0.75rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  /* Stats: compact 2-column on small phones */
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stat-card {
    flex-direction: row;
    padding: 0.625rem 0.75rem;
  }
  .stat-icon {
    width: 32px;
    height: 32px;
  }
  .stat-icon svg {
    width: 16px;
    height: 16px;
  }
  .stat-value {
    font-size: 1rem;
  }

  /* Header compact */
  .main-header {
    padding: 0.5rem 0.75rem;
  }
  .header-title h1 {
    font-size: 1.0625rem;
  }

  /* Sidebar: full width overlay */
  .sidebar.active {
    width: 100vw;
  }

  /* Card header: stack everything */
  .card-header h2, .card-header h3 {
    font-size: 0.9375rem;
  }

  /* Submission card */
  .submission-card {
    padding: 0.75rem;
  }
  .submission-card-header .doc-info h3 {
    font-size: 0.875rem;
  }

  /* WA banner: tighter on small phones */
  .wa-notify-banner {
    padding: 0.625rem 0.75rem;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }
  .wa-notify-banner-icon {
    width: 32px;
    height: 32px;
  }
  .wa-notify-banner-icon svg {
    width: 16px;
    height: 16px;
  }
  .wa-notify-banner-text strong {
    font-size: 0.75rem;
  }
  .wa-notify-banner-text span {
    font-size: 0.6875rem;
  }
  .wa-notify-banner-action {
    font-size: 0.75rem;
  }
  .wa-notify-banner-action svg {
    display: none;
  }
  .sub-download-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  /* Filter buttons even smaller */
  .filter-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.6875rem;
  }

  /* Processing queue: compact */
  .queue-item {
    padding: 0.75rem;
  }
  .queue-item-title {
    font-size: 0.8125rem;
  }
  .queue-item-meta {
    font-size: 0.75rem;
    gap: 0.5rem;
  }

  /* Modal content */
  .modal-content {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  /* Forms */
  .form-group label {
    font-size: 0.8125rem;
  }
  .input-wrapper input,
  .form-control,
  select.form-control {
    font-size: 0.875rem;
    padding: 0.625rem 0.75rem;
  }
  .input-wrapper input {
    padding-left: 2.5rem;
  }

  /* Auth page */
  .auth-card {
    border-radius: var(--radius-md);
  }

  /* Upload result modal fields */
  #uploadResultModal .modal-content {
    padding: 1rem;
  }

  /* Admin user edit modal */
  #editUserModal .modal-content {
    padding: 1rem;
  }

  /* Wage stats: stack entirely */
  .admin-wage-stats-container .card-header > div {
    flex-direction: column;
    gap: 0.5rem;
  }
  .admin-wage-stats-container .card-header input[type="date"] {
    width: 100%;
  }

  /* Profile page */
  .profile-avatar-large {
    width: 64px;
    height: 64px;
    font-size: 1.35rem;
  }
  .profile-hero-banner {
    height: 72px;
  }
  .profile-header-info h2 {
    font-size: 1.125rem;
  }

  /* Credit check banner: stack on small screens */
  .credit-check-banner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  /* Hide table column text, show only icons in admin-actions */
  .admin-actions .btn-icon {
    width: 28px;
    height: 28px;
  }

  /* Transaction item compact */
  .transaction-icon {
    width: 32px;
    height: 32px;
  }

  /* Pagination */
  .pagination-bar {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
  .pagination-bar .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
  }
}

/* --- Touch-friendly improvements (all mobile) --- */
@media (hover: none) and (pointer: coarse) {
  /* Bigger touch targets */
  .btn-icon {
    min-width: 40px;
    min-height: 40px;
  }

  .nav-link {
    padding: 0.875rem 1.25rem;
  }

  /* Remove hover effects that don't work on touch */
  .submission-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--gray-200);
  }

  /* Scrollbar hide for horizontal scrolls */
  .filter-buttons,
  .table-responsive {
    scrollbar-width: none;
  }
  .filter-buttons::-webkit-scrollbar,
  .table-responsive::-webkit-scrollbar {
    display: none;
  }
}

/* --- Landscape phone --- */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-content {
    max-height: 90vh;
  }
  .sidebar.active {
    width: min(70vw, 300px);
  }
}

/* ===== Shift Roster Grid (報更表) ===== */
.roster-granularity-toggle {
  display: inline-flex;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.roster-gran-btn {
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--gray-600);
  transition: all 0.15s;
}
.roster-gran-btn.active {
  background: var(--primary);
  color: #fff;
}
.roster-my-schedule {
  border-bottom: 1px solid var(--gray-200);
}
.roster-my-schedule-inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--gray-600);
  flex-wrap: wrap;
}
.roster-my-schedule-inner strong {
  color: var(--gray-800);
}
.roster-quick-claim-form .roster-qc-select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: #fff;
}
/* Desktop grid */
.roster-desktop { display: block; }
.roster-mobile { display: none; }
.roster-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  border: 1px solid var(--gray-200);
  font-size: 0.75rem;
  min-width: 700px;
}
.roster-grid .roster-corner,
.roster-grid .roster-footer-corner {
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  padding: 0.4rem 0.25rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.6875rem;
  color: var(--gray-600);
  position: sticky;
  left: 0;
  z-index: 2;
}
.roster-grid .roster-corner {
  border-bottom: 2px solid var(--gray-300);
}
.roster-grid .roster-footer-corner {
  border-top: 2px solid var(--gray-300);
  background: var(--gray-100);
}
.roster-grid .roster-day-header {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-300);
  border-right: 1px solid var(--gray-200);
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
}
.roster-grid .roster-day-header.is-today {
  background: var(--primary);
  color: #fff;
}
.roster-grid .roster-day-header .roster-day-date {
  display: block;
  font-weight: 400;
  font-size: 0.6875rem;
  opacity: 0.7;
}
/* Hour group header */
.roster-hour-header {
  grid-column: 1 / -1;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--gray-700);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: sticky;
  left: 0;
}
.roster-hour-header:hover {
  background: var(--gray-200);
}
.roster-hour-chevron {
  font-size: 0.6rem;
  color: var(--gray-500);
  width: 12px;
  display: inline-block;
  text-align: center;
}
.roster-hour-badge {
  background: var(--primary);
  color: #fff;
  padding: 0 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.5;
}
.roster-grid .roster-time-label {
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-100);
  padding: 0.2rem 0.35rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--gray-500);
  font-size: 0.6875rem;
  position: sticky;
  left: 0;
  z-index: 1;
}
.roster-grid .roster-cell {
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-100);
  padding: 2px 3px;
  min-height: 36px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.roster-grid .roster-cell:hover {
  background: var(--primary-light, #eef2ff);
}
.roster-cell-plus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-300);
  font-size: 1rem;
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.roster-grid .roster-cell:hover .roster-cell-plus {
  opacity: 1;
}
.roster-grid .roster-cell .roster-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6875rem;
  line-height: 1.5;
  margin: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.roster-grid .roster-cell .roster-chip.mine {
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
.roster-grid .roster-cell .roster-chip.mine:hover {
  background: var(--error);
}
.roster-grid .roster-cell .roster-chip.other {
  background: var(--gray-200);
  color: var(--gray-600);
}
/* Daily summary footer */
.roster-footer-cell {
  border-right: 1px solid var(--gray-200);
  border-top: 2px solid var(--gray-300);
  padding: 0.35rem 0.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  position: sticky;
  bottom: 0;
  z-index: 1;
}
.roster-footer-good { background: #d1fae5; color: #065f46; }
.roster-footer-warn { background: #fef3c7; color: #92400e; }
.roster-footer-zero { background: #fee2e2; color: #991b1b; }
/* ---- Mobile Card View ---- */
.roster-mcard {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin: 0.5rem;
  overflow: hidden;
}
.roster-mcard.is-today {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.roster-mcard-header {
  background: var(--gray-50);
  padding: 0.6rem 0.75rem;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
}
.roster-mcard-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light, #eef2ff);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-full);
}
.roster-mcard-empty {
  padding: 0.75rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.8rem;
}
.roster-mcard-user {
  padding: 0.4rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--gray-100);
}
.roster-mcard-user:last-of-type { border-bottom: none; }
.roster-mcard-range {
  font-size: 0.75rem;
  color: var(--gray-600);
}
.roster-mcard-range.mine-range {
  cursor: pointer;
  background: var(--primary-light, #eef2ff);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-weight: 600;
}
.roster-mcard-range.mine-range:hover {
  background: #fee2e2;
  color: var(--error);
}
.roster-mcard-qc {
  width: 100%;
  border-radius: 0;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 0.5rem;
}
.roster-mcard-qc:hover { background: var(--primary-light, #eef2ff); }
/* Mobile chip (reuse from desktop) */
.roster-mobile .roster-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.6875rem;
  line-height: 1.5;
  white-space: nowrap;
}
.roster-mobile .roster-chip.mine {
  background: var(--primary);
  color: #fff;
}
.roster-mobile .roster-chip.other {
  background: var(--gray-200);
  color: var(--gray-600);
}
@media (max-width: 768px) {
  .roster-desktop { display: none; }
  .roster-mobile { display: block; }
}
@media (min-width: 769px) {
  .roster-desktop { display: block; }
  .roster-mobile { display: none; }
}

/* ============================================
   Landing Page — Apple-style Scroll Animations
   ============================================ */

/* -- Scroll-driven elements: animated by GSAP ScrollTrigger -- */
/* Elements start visible; GSAP handles reveal animation via gsap.from() */

/* -- Hero Entrance (one-time, not scroll-linked) -- */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroBadgePop {
  0%   { opacity: 0; transform: scale(0.9) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.landing-hero-badge {
  animation: heroBadgePop 0.9s 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.landing-hero h1 {
  animation: heroFadeUp 1s 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.landing-hero-sub {
  animation: heroFadeUp 1s 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.landing-hero-cta {
  animation: heroFadeUp 1s 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
.landing-hero-stats {
  animation: heroFadeUp 1s 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* -- Hero parallax (transform set by JS) -- */
.landing-hero-content {
  will-change: opacity, transform;
}

/* -- Animated Gradient Background -- */
@keyframes heroGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* -- Floating Orbs -- */
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -20px) scale(1.05); }
  66%      { transform: translate(-15px, 15px) scale(0.97); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-25px, 20px) scale(0.95); }
  66%      { transform: translate(20px, -25px) scale(1.03); }
}
.landing-hero-bg::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,184,169,0.12) 0%, transparent 70%);
  top: -10%;
  right: -5%;
  animation: orbFloat1 14s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
.landing-hero-bg::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.1) 0%, transparent 70%);
  bottom: -10%;
  left: -5%;
  animation: orbFloat2 18s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}

/* -- Gradient Text Shimmer -- */
@keyframes gradientShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.landing-gradient-text {
  background: linear-gradient(135deg, var(--ln-teal), #60A5FA, var(--ln-teal), #818CF8);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShimmer 6s ease infinite;
}

/* -- Sticky Features Showcase -- */
.landing-sticky-wrap {
  position: relative;
}
.landing-sticky-scene {
  position: relative;
  top: auto;
  padding-bottom: 0;
  min-height: auto;
  display: block;
}

/* -- Counter glow -- */
.landing-stat-num.counting {
  color: var(--ln-teal);
  transition: color 0.3s;
}

/* -- Trust Hover -- */
.landing-trust-item {
  transition: background 0.4s ease;
}
.landing-trust-item:hover {
  background: rgba(255,255,255,0.03);
}
.landing-trust-icon {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.landing-trust-item:hover .landing-trust-icon {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0,184,169,0.2);
}

/* -- Feature Cards Hover -- */
.landing-feature-card {
  transition: box-shadow 0.4s ease;
  overflow: hidden;
  position: relative;
}
.landing-feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--ln-teal), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.landing-feature-card:hover::before { opacity: 1; }
.landing-feature-card:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.08);
}
.landing-feature-icon {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.landing-feature-card:hover .landing-feature-icon {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* -- Step Cards Hover -- */
.landing-step {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.landing-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.06);
}
.landing-step-icon {
  transition: transform 0.4s ease;
}
.landing-step:hover .landing-step-icon { transform: scale(1.12); }
.landing-step-num {
  transition: transform 0.3s, box-shadow 0.3s;
}
.landing-step:hover .landing-step-num {
  transform: translateX(-50%) scale(1.15);
  box-shadow: 0 4px 12px rgba(0,184,169,0.4);
}
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(6px); }
}
.landing-step-arrow svg {
  animation: arrowBounce 1.5s ease-in-out infinite;
}

/* -- Pricing Hover -- */
.landing-price-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  overflow: hidden;
}
.landing-price-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, transparent 60%, rgba(0,184,169,0.03) 100%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.landing-price-card:hover::after { opacity: 1; }
.landing-price-card:hover { border-color: var(--ln-teal); }
.landing-price-card.popular { overflow: visible; }
.landing-price-amount {
  transition: transform 0.4s ease;
}
.landing-price-card:hover .landing-price-amount { transform: scale(1.08); }
@keyframes popularGlow {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,184,169,0.15); }
  50%      { box-shadow: 0 8px 32px rgba(0,184,169,0.25); }
}
.landing-price-card.popular {
  animation: popularGlow 4s ease-in-out infinite;
}

/* -- Compare Hover -- */
.landing-compare-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.landing-compare-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.06);
}

/* -- FAQ Hover -- */
.landing-faq-item {
  transition: box-shadow 0.3s, border-color 0.3s;
}
.landing-faq-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

/* -- CTA Glow -- */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 0 60px rgba(0,184,169,0.1); }
  50%      { box-shadow: 0 0 80px rgba(0,184,169,0.2); }
}
.landing-cta {
  animation: ctaPulse 4s ease-in-out infinite;
}

/* -- Accessibility -- */
@media (prefers-reduced-motion: reduce) {
  .landing-hero-badge,
  .landing-hero h1,
  .landing-hero-sub,
  .landing-hero-cta,
  .landing-hero-stats { animation-duration: 0.01ms !important; }
  .landing-hero-bg { animation: none; }
  .landing-hero-bg::before,
  .landing-hero-bg::after { animation: none; }
  .landing-gradient-text { animation: none; }
  .landing-step-arrow svg { animation: none; }
  .landing-price-card.popular { animation: none; }
  .landing-cta { animation: none; }
  .landing-hero-content { opacity: 1 !important; transform: none !important; }
  .landing-scroll-indicator { animation: none; }
}


/* ============================================
   Global UI Polish — Transitions & Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: rgba(79, 70, 229, 0.15);
  color: var(--gray-900);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* ============================================
   Festival Theme: Easter 復活節 — Claymorphism
   Style: Soft 3D clay, pastel palette, playful
   Recommended by UI/UX Pro Max design system
   Activated via body[data-festival="easter"]
   ============================================ */

/* --- Design Tokens --- */
body[data-festival="easter"] {
  --primary: #7C3AED;
  --primary-hover: #6D28D9;
  --primary-light: #F3F0FF;
  --primary-dark: #5B21B6;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #F43F5E;
  --error-light: #FFE4E6;
  --info: #8B5CF6;
  --info-light: #EDE9FE;
  --easter-bg: #FAF8FF;
  --easter-surface: rgba(255, 255, 255, 0.85);
  --easter-border: #E6D9F8;
  --easter-radius: 20px;
  --easter-shadow: 6px 6px 12px rgba(139, 92, 246, 0.08), -2px -2px 8px rgba(255, 255, 255, 0.9);
  --easter-shadow-inset: inset 2px 2px 4px rgba(255, 255, 255, 0.7), inset -1px -1px 3px rgba(139, 92, 246, 0.06);
  --easter-lavender: #C4B5FD;
  --easter-pink: #FBCFE8;
  --easter-mint: #A7F3D0;
  --easter-peach: #FDBCB4;
  --easter-sky: #BAE6FD;
  --easter-yellow: #FDE68A;
}

/* --- Typography: Nunito headings + DM Sans body --- */
body[data-festival="easter"] {
  font-family: 'DM Sans', var(--font-family, system-ui, sans-serif);
}
body[data-festival="easter"] h1,
body[data-festival="easter"] h2,
body[data-festival="easter"] h3,
body[data-festival="easter"] .easter-banner-text {
  font-family: 'Nunito', var(--font-family, system-ui, sans-serif);
}

/* --- Easter Egg Images (banner & decorations) --- */
.easter-egg-img {
  display: inline-block;
  filter: drop-shadow(2px 2px 3px rgba(139, 92, 246, 0.15));
  transition: transform 0.2s ease-out;
}
.easter-banner-bunny {
  filter: drop-shadow(1px 2px 3px rgba(139, 92, 246, 0.12));
}

/* --- Greeting Banner (Claymorphism card) --- */
.easter-banner {
  background: var(--easter-surface);
  border-bottom: 3px solid var(--easter-border);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.06);
  padding: 0;
  z-index: 100;
  position: relative;
  overflow: hidden;
  animation: easterBannerSlide 0.4s ease-out;
}
.easter-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(196, 181, 253, 0.12) 0%,
    rgba(251, 207, 232, 0.08) 35%,
    rgba(167, 243, 208, 0.08) 65%,
    rgba(253, 230, 138, 0.06) 100%);
  pointer-events: none;
}
.easter-banner.hidden { display: none; }

.easter-banner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.easter-banner-eggs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.easter-banner-text {
  font-weight: 800;
  font-size: 0.95rem;
  color: #5B21B6;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}
.easter-banner-close {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #7C3AED;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease-out;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.easter-banner-close:hover {
  background: rgba(124, 58, 237, 0.1);
}

@keyframes easterBannerSlide {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Main Content Background --- */
body[data-festival="easter"] .main-content {
  background:
    radial-gradient(ellipse at 10% 15%, rgba(196, 181, 253, 0.1) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 50%, rgba(251, 207, 232, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 40% 85%, rgba(167, 243, 208, 0.08) 0%, transparent 45%),
    var(--easter-bg);
}

/* --- Sidebar (Claymorphism) --- */
body[data-festival="easter"] .sidebar {
  background: linear-gradient(180deg, #F5F3FF 0%, #FEFEFF 40%, #FFFFFF 100%);
  border-right-color: var(--easter-border);
}
body[data-festival="easter"] .sidebar-header {
  position: relative;
  border-bottom-color: var(--easter-border);
}
/* CSS egg decoration in sidebar header */
body[data-festival="easter"] .sidebar-header::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 14px;
  width: 22px;
  height: 28px;
  background: url('/img/easter/egg-lavender.svg') no-repeat center / contain;
  filter: drop-shadow(1px 1px 3px rgba(139, 92, 246, 0.15));
  opacity: 0.85;
}
body[data-festival="easter"] .sidebar .nav-link.active {
  background: linear-gradient(135deg, #EDE9FE, #F5F3FF);
  border-left-color: var(--primary);
  box-shadow: var(--easter-shadow-inset);
}
body[data-festival="easter"] .sidebar .nav-link:hover {
  background: linear-gradient(135deg, #F5F3FF, #FDF2F8);
}

/* Egg image decorations in sidebar footer */
body[data-festival="easter"] .sidebar-footer {
  position: relative;
}
body[data-festival="easter"] .sidebar-footer::before {
  content: '';
  display: block;
  height: 18px;
  margin: 0 auto 6px;
  width: 120px;
  background:
    url('/img/easter/egg-pink.svg') no-repeat 0 center / 14px 18px,
    url('/img/easter/egg-mint.svg') no-repeat 28px center / 12px 16px,
    url('/img/easter/egg-yellow.svg') no-repeat 52px center / 14px 18px,
    url('/img/easter/egg-blue.svg') no-repeat 78px center / 12px 16px,
    url('/img/easter/egg-peach.svg') no-repeat 100px center / 14px 18px;
  opacity: 0.55;
}

/* --- Cards (Claymorphism) --- */
body[data-festival="easter"] .card {
  border: 3px solid var(--easter-border);
  border-radius: var(--easter-radius);
  box-shadow: var(--easter-shadow);
  background: var(--easter-surface);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.2s ease-out, transform 0.2s ease-out;
}
body[data-festival="easter"] .card:hover {
  box-shadow: 8px 8px 16px rgba(139, 92, 246, 0.1), -3px -3px 10px rgba(255, 255, 255, 0.95);
}
body[data-festival="easter"] .card-header {
  border-bottom-color: var(--easter-border);
}
/* Small SVG egg before card headings */
body[data-festival="easter"] .card-header h2::before,
body[data-festival="easter"] .card-header h3::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 18px;
  background: url('/img/easter/egg-lavender.svg') no-repeat center / contain;
  margin-right: 8px;
  vertical-align: middle;
  filter: drop-shadow(1px 1px 2px rgba(139, 92, 246, 0.12));
}

/* --- Stat Cards (Claymorphism) --- */
body[data-festival="easter"] .stat-card {
  border: 3px solid transparent;
  border-radius: var(--easter-radius);
  background-clip: padding-box;
  position: relative;
  box-shadow: var(--easter-shadow);
}
body[data-festival="easter"] .stat-card::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: calc(var(--easter-radius) + 3px);
  background: linear-gradient(135deg, var(--easter-lavender), var(--easter-pink), var(--easter-mint));
  z-index: -1;
}
body[data-festival="easter"] .stat-icon {
  box-shadow: var(--easter-shadow-inset), 0 0 0 3px rgba(139, 92, 246, 0.06);
  border-radius: 16px;
}
body[data-festival="easter"] .stat-icon.blue {
  background: linear-gradient(135deg, #EDE9FE, #F3F0FF);
  color: #7C3AED;
}
body[data-festival="easter"] .stat-icon.green {
  background: linear-gradient(135deg, #D1FAE5, #ECFDF5);
  color: #059669;
}
body[data-festival="easter"] .stat-icon.amber {
  background: linear-gradient(135deg, #FEF3C7, #FEF9C3);
  color: #D97706;
}
body[data-festival="easter"] .stat-icon.purple {
  background: linear-gradient(135deg, #FCE7F3, #FDF2F8);
  color: #BE185D;
}

/* --- Dashboard Decorative Eggs Row --- */
body[data-festival="easter"] .stats-row {
  position: relative;
}
body[data-festival="easter"] .stats-row::after {
  content: '';
  position: absolute;
  top: -16px;
  right: 16px;
  width: 110px;
  height: 20px;
  background:
    url('/img/easter/egg-peach.svg') no-repeat 0 center / 14px 18px,
    url('/img/easter/egg-lavender.svg') no-repeat 26px center / 12px 16px,
    url('/img/easter/egg-mint.svg') no-repeat 50px center / 14px 18px,
    url('/img/easter/egg-yellow.svg') no-repeat 76px center / 12px 16px,
    url('/img/easter/egg-blue.svg') no-repeat 96px center / 14px 18px;
  opacity: 0.4;
  pointer-events: none;
}

/* --- Buttons (Claymorphism press) --- */
body[data-festival="easter"] .btn-primary {
  background: linear-gradient(135deg, #7C3AED, #8B5CF6);
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  box-shadow:
    4px 4px 10px rgba(124, 58, 237, 0.2),
    -2px -2px 6px rgba(255, 255, 255, 0.7),
    inset 1px 1px 2px rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease-out;
}
body[data-festival="easter"] .btn-primary:hover {
  background: linear-gradient(135deg, #6D28D9, #7C3AED);
  box-shadow:
    6px 6px 14px rgba(124, 58, 237, 0.25),
    -3px -3px 8px rgba(255, 255, 255, 0.8),
    inset 1px 1px 2px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
body[data-festival="easter"] .btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    2px 2px 6px rgba(124, 58, 237, 0.15),
    inset 2px 2px 4px rgba(0, 0, 0, 0.08);
}

/* --- Upload Zone (Claymorphism) --- */
body[data-festival="easter"] .upload-zone {
  border: 3px dashed var(--easter-lavender);
  border-radius: var(--easter-radius);
  background: linear-gradient(135deg, #FEFEFE 0%, #F5F3FF 50%, #FDF2F8 100%);
  box-shadow: var(--easter-shadow-inset);
  transition: all 0.2s ease-out;
}
body[data-festival="easter"] .upload-zone:hover,
body[data-festival="easter"] .upload-zone.dragover {
  border-color: var(--primary);
  background: linear-gradient(135deg, #F5F3FF 0%, #FDF2F8 50%, #ECFDF5 100%);
  box-shadow: var(--easter-shadow);
  transform: translateY(-2px);
}
body[data-festival="easter"] .upload-icon {
  background: linear-gradient(135deg, #EDE9FE, #FCE7F3);
  border-radius: 16px;
  box-shadow: var(--easter-shadow-inset);
}

/* --- Main Header --- */
body[data-festival="easter"] .main-header {
  background: linear-gradient(90deg, #FFFFFF 0%, #FAFAFE 50%, #FDF9FF 100%);
  border-bottom: 2px solid var(--easter-border);
}
/* SVG egg accent after header title */
body[data-festival="easter"] .header-title h1::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 20px;
  background: url('/img/easter/egg-mint.svg') no-repeat center / contain;
  margin-left: 8px;
  vertical-align: middle;
  filter: drop-shadow(1px 1px 2px rgba(16, 185, 129, 0.15));
}

/* --- Auth / Hero (Landing page easter tint) --- */
body[data-festival="easter"] .auth-container,
body[data-festival="easter"] .hero {
  background: linear-gradient(135deg, #FAF8FF 0%, #FDF2F8 50%, #F0FDF4 100%);
}

/* --- Inputs (Clay style) --- */
body[data-festival="easter"] .form-control,
body[data-festival="easter"] select,
body[data-festival="easter"] textarea {
  border: 2px solid var(--easter-border);
  border-radius: 14px;
  box-shadow: var(--easter-shadow-inset);
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}
body[data-festival="easter"] .form-control:focus,
body[data-festival="easter"] select:focus,
body[data-festival="easter"] textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--easter-shadow-inset), 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* --- Tables (soft clay borders) --- */
body[data-festival="easter"] .table-container {
  border: 3px solid var(--easter-border);
  border-radius: var(--easter-radius);
  box-shadow: var(--easter-shadow);
  overflow: hidden;
}
body[data-festival="easter"] th {
  background: linear-gradient(135deg, #F5F3FF, #FDF2F8);
  border-bottom: 2px solid var(--easter-border);
}

/* --- Modals (Clay card) --- */
body[data-festival="easter"] .modal-content {
  border: 3px solid var(--easter-border);
  border-radius: 24px;
  box-shadow: 12px 12px 24px rgba(139, 92, 246, 0.1), -6px -6px 16px rgba(255, 255, 255, 0.95);
}

/* --- Toast (Clay accent) --- */
body[data-festival="easter"] .toast {
  border-radius: 16px;
  border: 2px solid var(--easter-border);
  box-shadow: var(--easter-shadow);
}

/* --- Badge / Pill (Clay rounding) --- */
body[data-festival="easter"] .badge,
body[data-festival="easter"] .status-badge {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 2px 2px 4px rgba(139, 92, 246, 0.08);
}

/* --- Reduced Motion (Accessibility) --- */
@media (prefers-reduced-motion: reduce) {
  .easter-banner { animation: none; }
  .easter-egg-img { transition: none; }
  body[data-festival="easter"] .btn-primary { transition: none; }
  body[data-festival="easter"] .upload-zone { transition: none; }
  body[data-festival="easter"] .card { transition: none; }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  body[data-festival="easter"] .card {
    border-radius: 16px;
    border-width: 2px;
  }
  body[data-festival="easter"] .stat-card::before {
    border-radius: 19px;
  }
  body[data-festival="easter"] .stats-row::after {
    display: none;
  }
  body[data-festival="easter"] .header-title h1::after {
    display: none;
  }
}
@media (max-width: 640px) {
  .easter-banner-eggs { display: none; }
  .easter-banner-text { font-size: 0.85rem; }
  .easter-banner-inner { padding: 0.5rem 1rem; }
}

/* ============================================
   CHATWOOT WIDGET — MOBILE FIXES
   Prevent the floating chat bubble from blocking
   page buttons on small screens.
   ============================================ */
@media (max-width: 768px) {
  /* Push the bubble higher so it doesn't cover bottom buttons */
  .woot-widget-bubble,
  .woot--bubble-holder {
    bottom: 80px !important;
  }
  /* Raise toast above the bubble */
  .toast-container {
    bottom: 150px !important;
  }
  /* Extra bottom padding so page content scrolls clear of the bubble */
  .page {
    padding-bottom: 5rem;
  }
}


/* ============================================
   DARK MODE — Neutral Slate
   Activated via html[data-theme="dark"]
   ============================================ */

/* --- 1. Variable Overrides (handles ~80% of UI) --- */
html[data-theme="dark"] {
  /* Invert the gray scale — --white becomes darkest, --gray-900 becomes lightest */
  --white: #0F172A;
  --gray-50: #162032;
  --gray-100: #1E293B;
  --gray-200: #2A3A50;
  --gray-300: #3B4F6B;
  --gray-400: #64748B;
  --gray-500: #94A3B8;
  --gray-600: #B0BEC9;
  --gray-700: #CBD5E1;
  --gray-800: #E2E8F0;
  --gray-900: #F1F5F9;

  /* Primary — lightened indigo for dark backgrounds */
  --primary: #818CF8;
  --primary-hover: #A5B4FC;
  --primary-light: rgba(129, 140, 248, 0.12);
  --primary-dark: #6366F1;
  --primary-gradient: linear-gradient(135deg, #818CF8 0%, #A78BFA 100%);

  /* Status — slightly brighter for readability */
  --success: #34D399;
  --success-light: rgba(52, 211, 153, 0.12);
  --warning: #FBBF24;
  --warning-light: rgba(251, 191, 36, 0.12);
  --warning-bg: rgba(251, 191, 36, 0.12);
  --error: #FB7185;
  --error-light: rgba(251, 113, 133, 0.12);
  --info: #60A5FA;
  --info-light: rgba(96, 165, 250, 0.12);

  /* Shadows — fainter on dark backgrounds, tinted with primary */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.25), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(129, 140, 248, 0.06);
  --shadow-lg: 0 12px 20px -4px rgba(0, 0, 0, 0.35), 0 4px 8px -4px rgba(129, 140, 248, 0.08);
  --shadow-xl: 0 20px 32px -8px rgba(0, 0, 0, 0.4), 0 8px 16px -6px rgba(129, 140, 248, 0.08);
  --shadow-primary: 0 4px 12px rgba(129, 140, 248, 0.2);

  color-scheme: dark;
}

/* --- 2. Layout Shells --- */
html[data-theme="dark"] .main-header {
  background: rgba(15, 23, 42, 0.88);
  border-bottom-color: var(--gray-200);
}

html[data-theme="dark"] .sidebar {
  background: var(--gray-50);
  box-shadow: 1px 0 8px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .sidebar-header {
  background: rgba(129, 140, 248, 0.04);
}

/* --- 3. Logo — boost brightness for dark bg --- */
html[data-theme="dark"] .logo .logo-img,
html[data-theme="dark"] .auth-logo .logo-img,
html[data-theme="dark"] .landing-logo-img {
  filter: brightness(1.15) contrast(1.05);
}

/* --- 4. Auth Pages --- */
html[data-theme="dark"] .auth-container {
  background: #0F172A;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(129, 140, 248, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 85% 20%, rgba(167, 139, 250, 0.04) 0%, transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(129, 140, 248, 0.03) 1px, transparent 0);
}

html[data-theme="dark"] .auth-side-panel {
  background: linear-gradient(135deg, #162032 0%, #1E293B 100%);
}

html[data-theme="dark"] .auth-back-to-landing {
  background: rgba(255, 255, 255, 0.06);
  color: var(--gray-500);
}
html[data-theme="dark"] .auth-back-to-landing:hover {
  background: rgba(129, 140, 248, 0.1);
  color: var(--primary);
}

html[data-theme="dark"] .auth-logo .logo-text {
  color: var(--gray-900);
}

/* --- 5. Cards & Surfaces --- */
html[data-theme="dark"] .card {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .card:hover {
  background: rgba(129, 140, 248, 0.06);
}
html[data-theme="dark"] .card-header {
  background: var(--gray-100);
}
html[data-theme="dark"] .admin-settings-tab {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gray-600);
}
html[data-theme="dark"] .admin-settings-tab:hover {
  background: rgba(129, 140, 248, 0.14);
  color: var(--gray-800);
}
html[data-theme="dark"] .admin-settings-tab.active {
  background: var(--primary);
  color: #0f172a;
  box-shadow: 0 16px 30px -20px rgba(129, 140, 248, 0.8);
}
html[data-theme="dark"] .ai-info-panel {
  border-color: rgba(129, 140, 248, 0.18);
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.18), transparent 44%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
  box-shadow: 0 16px 40px -28px rgba(15, 23, 42, 0.9);
}
html[data-theme="dark"] .ai-info-panel__eyebrow {
  border-color: rgba(129, 140, 248, 0.24);
  background: rgba(15, 23, 42, 0.4);
  color: #c7d2fe;
}
html[data-theme="dark"] .ai-info-panel__summary {
  border-color: rgba(129, 140, 248, 0.24);
  background: rgba(15, 23, 42, 0.42);
  color: #c7d2fe;
}
html[data-theme="dark"] .ai-info-panel__summary:hover {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(129, 140, 248, 0.36);
}
html[data-theme="dark"] .ai-info-panel__copy h3,
html[data-theme="dark"] .ai-info-panel__copy strong {
  color: #e2e8f0;
}
html[data-theme="dark"] .ai-info-panel__copy p {
  color: #94a3b8;
}
html[data-theme="dark"] .ai-info-panel__figure {
  background: rgba(15, 23, 42, 0.72);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .card.status-card {
  background: rgba(129, 140, 248, 0.06);
}
html[data-theme="dark"] .card.alert-card,
html[data-theme="dark"] .card.error-card {
  background: rgba(251, 113, 133, 0.06);
}
html[data-theme="dark"] .card.success-card {
  background: rgba(52, 211, 153, 0.08);
}
html[data-theme="dark"] .card.highlight-card {
  background: rgba(52, 211, 153, 0.1);
}
html[data-theme="dark"] .stat-card {
  background: var(--gray-100);
}

/* Info sections */
html[data-theme="dark"] .info-section {
  background: rgba(255, 255, 255, 0.04);
}
html[data-theme="dark"] .info-section.secondary {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .info-section-alt {
  background: var(--gray-100);
}

/* --- 6. Alerts & Status Backgrounds --- */
html[data-theme="dark"] .alert {
  background: var(--warning-light);
  color: var(--warning);
}
html[data-theme="dark"] .alert.success {
  background: var(--success-light);
  color: var(--success);
}
html[data-theme="dark"] .alert.error {
  background: var(--error-light);
  color: var(--error);
}

html[data-theme="dark"] .status-card.success { background: var(--success-light); }
html[data-theme="dark"] .status-card.warning { background: var(--warning-light); }
html[data-theme="dark"] .status-card.error { background: var(--error-light); }
html[data-theme="dark"] .status-card.info { background: var(--info-light); }

/* --- 7. Badges & Tags --- */
html[data-theme="dark"] .tag {
  background: rgba(129, 140, 248, 0.12);
  color: var(--primary);
}
html[data-theme="dark"] .tag.info {
  background: rgba(96, 165, 250, 0.12);
  color: var(--info);
}
html[data-theme="dark"] .tag.warning {
  background: var(--warning-light);
  color: var(--warning);
}

/* --- 8. Info/Warning/Error/Success Blocks --- */
html[data-theme="dark"] .info-block,
html[data-theme="dark"] .info-block-alt {
  background: var(--info-light);
}
html[data-theme="dark"] .warning-block,
html[data-theme="dark"] .warning-block-alt {
  background: var(--warning-light);
}
html[data-theme="dark"] .error-block,
html[data-theme="dark"] .error-block-alt {
  background: var(--error-light);
}
html[data-theme="dark"] .success-block,
html[data-theme="dark"] .success-block-alt {
  background: var(--success-light);
}
html[data-theme="dark"] .highlight-block {
  background: var(--warning-light);
}
html[data-theme="dark"] .highlight-block-alt {
  background: var(--error-light);
}
html[data-theme="dark"] .highlight-mark {
  background: rgba(129, 140, 248, 0.15);
}

/* --- 9. Tabs --- */
html[data-theme="dark"] .tab.active,
html[data-theme="dark"] .tab.active-alt {
  background: rgba(251, 191, 36, 0.12);
}
html[data-theme="dark"] .tab.active-danger {
  background: rgba(251, 191, 36, 0.2);
}

/* --- 10. List Items --- */
html[data-theme="dark"] .list-item-error {
  background: var(--error-light);
}
html[data-theme="dark"] .list-item-container {
  background: rgba(251, 113, 133, 0.06);
}
html[data-theme="dark"] .search-result.highlight {
  background: var(--warning-light);
}

/* --- 11. Modals --- */
html[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .modal-content {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}
html[data-theme="dark"] .confirm-dialog .confirm-icon {
  background: var(--warning-light);
}

/* --- 12. Toast Notifications --- */
html[data-theme="dark"] .toast {
  background: var(--gray-100);
  border-left-color: var(--gray-400);
}
html[data-theme="dark"] .toast.success {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.08) 0%, var(--gray-100) 100%);
}
html[data-theme="dark"] .toast.error {
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.08) 0%, var(--gray-100) 100%);
}
html[data-theme="dark"] .toast.warning {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.08) 0%, var(--gray-100) 100%);
}
html[data-theme="dark"] .toast.info {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.08) 0%, var(--gray-100) 100%);
}

/* --- 13. Dropdowns & Upload Zones --- */
html[data-theme="dark"] .dropdown {
  background: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .dropdown:hover {
  background: rgba(255, 255, 255, 0.1);
}
html[data-theme="dark"] .upload-zone {
  background: rgba(129, 140, 248, 0.06);
  border-color: var(--gray-300);
}

/* --- 14. Forms & Inputs --- */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-900);
}
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--gray-400);
}

/* --- 15. Site Banner --- */
html[data-theme="dark"] .site-banner.info {
  background: rgba(96, 165, 250, 0.08);
  border-color: rgba(96, 165, 250, 0.2);
}
html[data-theme="dark"] .site-banner.warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
}

/* --- 16. Credit Widget --- */
html[data-theme="dark"] .credit-widget,
html[data-theme="dark"] .credits-badge {
  background: rgba(129, 140, 248, 0.08);
  border-color: var(--gray-200);
}

/* --- 17. Scrollbars --- */
html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--white);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--gray-300);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* --- 18. Backdrop Blur Overlay --- */
html[data-theme="dark"] .backdrop-blur {
  background: rgba(0, 0, 0, 0.5);
}

/* --- 19. Images — slight brightness reduction for comfort, except logos --- */
html[data-theme="dark"] img {
  opacity: 0.92;
}
html[data-theme="dark"] .logo .logo-img,
html[data-theme="dark"] .auth-logo .logo-img,
html[data-theme="dark"] .landing-logo-img,
html[data-theme="dark"] .payment-method-icon img,
html[data-theme="dark"] .alipay-qr-img {
  opacity: 1;
}

/* --- 20. Landing Page --- */
html[data-theme="dark"] .landing {
  --ln-white: #0F172A;
  --ln-navy: #E2E8F0;
  --ln-navy-light: #CBD5E1;
  --ln-gray: #94A3B8;
  --ln-gray-light: #1E293B;
  --ln-teal: #2DD4BF;
  --ln-teal-dark: #5EEAD4;
  --ln-teal-light: rgba(45, 212, 191, 0.12);
  color: var(--gray-700);
  background: #0F172A;
}

/* Nav scrolled */
html[data-theme="dark"] .landing-nav.scrolled {
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 1px 12px rgba(0,0,0,0.3);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .landing-nav.scrolled .landing-logo {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-nav.scrolled .landing-nav-links a {
  color: var(--gray-500);
}
html[data-theme="dark"] .landing-nav.scrolled .landing-nav-links a:hover {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-nav.scrolled .landing-mobile-toggle svg {
  color: var(--gray-700);
}
html[data-theme="dark"] .landing-mobile-menu {
  background: #162032;
  border-top-color: var(--gray-200);
}
html[data-theme="dark"] .landing-mobile-menu a {
  color: var(--gray-600);
}

/* Section backgrounds */
html[data-theme="dark"] .landing-section-alt {
  background: #162032;
}

/* Report preview — keep white card look (it's a document) but soften for dark mode */
html[data-theme="dark"] .landing-report-page {
  background: #F8FAFC;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
}
html[data-theme="dark"] .landing-report-page-bg {
  opacity: 0.35;
}

/* Section headers */
html[data-theme="dark"] .landing-section-header h2 {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-section-header p {
  color: var(--gray-500);
}

/* Tags */
html[data-theme="dark"] .landing-tag {
  background: rgba(45, 212, 191, 0.1);
  color: #5EEAD4;
}

/* Hero — already dark bg, but fix hero-content text for split layout */
html[data-theme="dark"] .landing-hero h1 {
  color: #F1F5F9;
}

/* Feature icons — boost for dark bg */
html[data-theme="dark"] .landing-feature-icon svg {
  color: #fff;
}

/* Feature cards (old grid) */
html[data-theme="dark"] .landing-feature-card {
  background: #1E293B;
  border-color: var(--gray-200);
}
html[data-theme="dark"] .landing-feature-card h3 {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-feature-card > p {
  color: var(--gray-500);
}

/* Feature list items */
html[data-theme="dark"] .landing-feature-list li {
  color: var(--gray-500);
}

/* Zigzag feature text */
html[data-theme="dark"] .landing-zigzag-text h3 {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-zigzag-text > p {
  color: var(--gray-500);
}

/* Zigzag visual cards */
html[data-theme="dark"] .landing-zigzag-card {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
}

/* Zigzag gauge value */
html[data-theme="dark"] .landing-zz-gauge-val {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-zz-gauge-label {
  color: var(--gray-500);
}
html[data-theme="dark"] .landing-zz-bar {
  background: rgba(255,255,255,0.08);
}

/* File icon cards */
html[data-theme="dark"] .landing-file-icon {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
html[data-theme="dark"] .landing-file-icon span {
  color: var(--gray-500);
}

/* Timeline */
html[data-theme="dark"] .landing-timeline-track {
  background: var(--gray-200);
}
html[data-theme="dark"] .landing-timeline-card {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
html[data-theme="dark"] .landing-timeline-card h3 {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-timeline-card p {
  color: var(--gray-500);
}
html[data-theme="dark"] .landing-timeline-dot {
  box-shadow: 0 0 0 4px #0F172A, 0 0 0 6px rgba(45,212,191,0.15);
}
html[data-theme="dark"] .landing-section-alt .landing-timeline-dot {
  box-shadow: 0 0 0 4px #162032, 0 0 0 6px rgba(45,212,191,0.15);
}
html[data-theme="dark"] .landing-timeline-icon {
  background: rgba(45, 212, 191, 0.1);
}

/* Comparison table */
html[data-theme="dark"] .landing-compare-table {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .landing-compare-table thead th {
  background: #162032;
  color: var(--gray-700);
}
html[data-theme="dark"] .landing-compare-table th,
html[data-theme="dark"] .landing-compare-table td {
  border-bottom-color: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .landing-compare-table td.highlight {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-compare-table td.dim {
  color: var(--gray-400);
}

/* Comparison cards (old grid) */
html[data-theme="dark"] .landing-compare-card {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .landing-compare-header {
  border-bottom-color: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .landing-compare-card.highlight .landing-compare-header {
  background: linear-gradient(135deg, #162032, #1E293B);
}
html[data-theme="dark"] li.yes {
  color: var(--gray-600);
}

/* Pricing cards */
html[data-theme="dark"] .landing-price-card {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .landing-price-card:hover {
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}
html[data-theme="dark"] .landing-price-card.popular {
  border-color: var(--ln-teal);
  box-shadow: 0 8px 24px rgba(45,212,191,0.15);
}
html[data-theme="dark"] .landing-price-amount {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-price-card ul li {
  color: var(--gray-500);
}

/* FAQ items */
html[data-theme="dark"] .landing-faq-item {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .landing-faq-item summary {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-faq-item p {
  color: var(--gray-500);
}
html[data-theme="dark"] .landing-faq-inner {
  background: transparent;
}

/* CTA section */
html[data-theme="dark"] .landing-cta {
  background: linear-gradient(135deg, #0B1222 0%, #0C3547 100%);
}

/* Landing footer */
html[data-theme="dark"] .landing-footer {
  background: #0B1222;
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Old landing step cards */
html[data-theme="dark"] .landing-step {
  background: #1E293B;
  border-color: rgba(255,255,255,0.08);
}
html[data-theme="dark"] .landing-step h3 {
  color: var(--gray-800);
}
html[data-theme="dark"] .landing-step p {
  color: var(--gray-500);
}

/* btn-ghost on landing — improve readability */
html[data-theme="dark"] .landing-hero .btn-ghost {
  color: rgba(255,255,255,0.8);
}
html[data-theme="dark"] .landing-hero .btn-ghost:hover {
  color: #fff;
}

/* btn-white on dark bg */
html[data-theme="dark"] .btn-white {
  background: rgba(255,255,255,0.1);
  color: #F1F5F9;
  border: 1px solid rgba(255,255,255,0.15);
}
html[data-theme="dark"] .btn-white:hover {
  background: rgba(255,255,255,0.15);
}

/* Login button scrolled */
html[data-theme="dark"] .landing-nav.scrolled .landing-login-btn {
  color: var(--gray-700);
  border-color: var(--gray-300);
}
html[data-theme="dark"] .landing-nav.scrolled .landing-login-btn:hover {
  background: rgba(255,255,255,0.06);
}

/* Landing glassmorphism panels */
html[data-theme="dark"] .landing-glass,
html[data-theme="dark"] [class*="glass"] {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.06);
}

/* --- Always-dark sections: hero, CTA, footer use dark bg in BOTH modes.
       --ln-white gets inverted to dark in dark mode, so override text to explicit light. --- */

/* Nav (non-scrolled, over dark hero) */
html[data-theme="dark"] .landing-nav:not(.scrolled) .landing-logo {
  color: #F1F5F9;
}
html[data-theme="dark"] .landing-nav:not(.scrolled) .landing-login-btn {
  color: #F1F5F9;
  border-color: rgba(255,255,255,0.4);
}
html[data-theme="dark"] .landing-nav:not(.scrolled) .landing-login-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

/* Hero stats bar */
html[data-theme="dark"] .landing-stat-num {
  color: #F1F5F9;
}
html[data-theme="dark"] .landing-stat-label {
  color: rgba(255,255,255,0.5);
}
html[data-theme="dark"] .landing-stat-divider {
  background: rgba(255,255,255,0.15);
}

/* Hero badge */
html[data-theme="dark"] .landing-hero-badge {
  color: #F1F5F9;
}
html[data-theme="dark"] .landing-hero-badge span {
  color: rgba(255,255,255,0.85);
}

/* Hero subtitle */
html[data-theme="dark"] .landing-hero-sub {
  color: rgba(255,255,255,0.65);
}

/* CTA section text */
html[data-theme="dark"] .landing-cta h2 {
  color: #F1F5F9;
}
html[data-theme="dark"] .landing-cta p {
  color: rgba(255,255,255,0.65);
}

/* Trust bar — always-dark section */
html[data-theme="dark"] .landing-trust {
  background: #0B1222;
}
html[data-theme="dark"] .landing-trust-item strong {
  color: #F1F5F9;
}
html[data-theme="dark"] .landing-trust-item span {
  color: rgba(255,255,255,0.5);
}

/* Footer text */
html[data-theme="dark"] .landing-footer-brand {
  color: #F1F5F9;
}
html[data-theme="dark"] .landing-footer-note {
  color: rgba(255,255,255,0.35);
}
html[data-theme="dark"] .landing-footer-copy {
  color: rgba(255,255,255,0.25);
}

/* --- 21. Tables --- */
html[data-theme="dark"] table {
  border-color: var(--gray-200);
}
html[data-theme="dark"] th {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] td {
  border-color: var(--gray-200);
}
html[data-theme="dark"] tr:hover td {
  background: rgba(129, 140, 248, 0.04);
}

/* --- 22. Code & Pre blocks --- */
html[data-theme="dark"] pre,
html[data-theme="dark"] code {
  background: var(--gray-50);
  color: var(--gray-800);
}

/* --- 23. HR dividers --- */
html[data-theme="dark"] hr {
  border-color: var(--gray-200);
}

/* --- 24. Selection --- */
html[data-theme="dark"] ::selection {
  background: rgba(129, 140, 248, 0.3);
  color: #F1F5F9;
}

/* --- 25. Misc Dark Overrides --- */

/* --- 26. Screenshot Drop Zone hover — use dark-mode primary --- */
html[data-theme="dark"] .screenshot-drop-zone:hover,
html[data-theme="dark"] .screenshot-drop-zone.drag-over {
  background: rgba(129, 140, 248, 0.08);
}

/* --- 27. Admin Drop Zone --- */
html[data-theme="dark"] .admin-drop-zone {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
html[data-theme="dark"] .admin-drop-zone:hover {
  border-color: var(--primary);
  background: rgba(129, 140, 248, 0.06);
}

/* --- 28. Pagination & Misc --- */
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination span {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .pagination a:hover {
  background: var(--gray-50);
}

/* --- 29. Tooltips --- */
html[data-theme="dark"] [data-tooltip]::after {
  background: var(--gray-800);
  color: var(--white);
}

/* --- 30. Payment Method Icons — preserve brand colors --- */
html[data-theme="dark"] .payment-method-icon.fps,
html[data-theme="dark"] .payment-method-icon.bank,
html[data-theme="dark"] .payment-method-icon.payme,
html[data-theme="dark"] .payment-method-icon.alipay {
  filter: brightness(0.9);
}

/* 21. Inbox / Messaging dark mode */
html[data-theme="dark"] .inbox-item {
  background: var(--white);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .inbox-item:hover {
  background: var(--gray-100);
}
html[data-theme="dark"] .inbox-item.unread {
  background: rgba(99, 102, 241, 0.08);
  border-left-color: var(--primary);
}
html[data-theme="dark"] .inbox-skeleton {
  border-color: var(--gray-200);
}
html[data-theme="dark"] .inbox-skeleton .skel-line {
  background: var(--gray-200);
}
html[data-theme="dark"] .recipient-dropdown {
  background: var(--white);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .recipient-option:hover {
  background: var(--gray-100);
}
html[data-theme="dark"] .message-detail-content {
  color: var(--gray-800);
}
html[data-theme="dark"] .message-detail-meta {
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .msg-type-btn {
  background: var(--white);
  border-color: var(--gray-200);
  color: var(--gray-400);
}
html[data-theme="dark"] .msg-type-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}
html[data-theme="dark"] .msg-type-btn .msg-type-text strong {
  color: var(--gray-300);
}
html[data-theme="dark"] .msg-type-btn .msg-type-text span {
  color: var(--gray-500);
}
html[data-theme="dark"] .msg-type-btn.active {
  border-color: var(--primary);
  background: rgba(129, 140, 248, 0.08);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}
html[data-theme="dark"] .msg-type-btn.active .msg-type-text strong {
  color: #a5b4fc;
}
html[data-theme="dark"] .selected-recipient {
  background: rgba(129, 140, 248, 0.08);
  border-color: rgba(129, 140, 248, 0.2);
}
html[data-theme="dark"] .selected-recipient-email {
  color: var(--gray-200);
}
html[data-theme="dark"] .compose-section-label {
  color: var(--gray-300);
}
html[data-theme="dark"] .compose-actions {
  border-top-color: var(--gray-200);
}
html[data-theme="dark"] .compose-page-title h2 {
  color: var(--gray-100);
}
html[data-theme="dark"] .sent-count-badge {
  background: var(--gray-200);
  color: var(--gray-400);
}
html[data-theme="dark"] .admin-sent-icon.is-personal {
  background: rgba(129, 140, 248, 0.12);
  color: #a5b4fc;
}
html[data-theme="dark"] .admin-sent-icon.is-broadcast {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

/* ─── Payment Wizard Dark Mode ─── */
html[data-theme="dark"] .payment-stepper {
  background: var(--gray-100);
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .payment-step-circle {
  border-color: var(--gray-300);
  background: var(--white);
  color: var(--gray-500);
}
html[data-theme="dark"] .payment-step-label {
  color: var(--gray-500);
}
html[data-theme="dark"] .payment-step-line {
  background: var(--gray-300);
}
html[data-theme="dark"] .pay-pkg-card,
html[data-theme="dark"] .pay-review-card {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .screenshot-requirement-hint {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.15);
  color: #CBD5E1;
}
html[data-theme="dark"] .screenshot-requirement-hint strong {
  color: #F1F5F9;
}
html[data-theme="dark"] .screenshot-requirement-hint ul,
html[data-theme="dark"] .screenshot-requirement-hint li {
  color: #CBD5E1;
}
html[data-theme="dark"] .screenshot-requirement-hint span {
  color: #F87171;
}
html[data-theme="dark"] .screenshot-guide-img img {
  border-color: var(--gray-300);
}
html[data-theme="dark"] .pay-step-intro p {
  color: var(--gray-400);
}
html[data-theme="dark"] .pay-wizard-footer {
  border-top-color: var(--gray-200);
}

/* ============================================
   COMPREHENSIVE DARK MODE — Admin & System
   ============================================ */

/* --- Filter Buttons --- */
html[data-theme="dark"] .filter-btn {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .filter-btn:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}
html[data-theme="dark"] .filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- Payment Type & Filter Buttons --- */
html[data-theme="dark"] .payment-type-btn {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .payment-type-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .payment-type-btn:hover:not(.active) {
  background: var(--gray-200);
}
html[data-theme="dark"] .payment-filter-btn {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .payment-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .payment-filter-btn:hover:not(.active) {
  background: var(--gray-200);
}

/* --- Search Box --- */
html[data-theme="dark"] .search-box {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .search-box svg {
  color: var(--gray-400);
}
html[data-theme="dark"] .search-box input {
  color: var(--gray-900);
}

/* --- Pagination Bar --- */
html[data-theme="dark"] .pagination-bar {
  border-top-color: var(--gray-200);
}
html[data-theme="dark"] .pagination-bar .btn-outline {
  background: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-700);
}
html[data-theme="dark"] .pagination-bar .btn-outline:hover:not(:disabled) {
  background: var(--gray-200);
  color: var(--gray-900);
}
html[data-theme="dark"] .pagination-bar .btn-outline:disabled {
  opacity: 0.4;
}

/* --- Role Badges --- */
html[data-theme="dark"] .role-badge.operator {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24;
}
html[data-theme="dark"] .role-badge.user {
  background: var(--gray-200);
  color: var(--gray-600);
}

/* --- Status Badges (all variants) --- */
html[data-theme="dark"] .status-badge {
  border: none;
}
html[data-theme="dark"] .status-badge.completed {
  background: rgba(52, 211, 153, 0.12);
  color: #34D399;
}
html[data-theme="dark"] .status-badge.failed {
  background: rgba(251, 113, 133, 0.12);
  color: #FB7185;
}
html[data-theme="dark"] .status-badge.processing {
  background: rgba(96, 165, 250, 0.12);
  color: #60A5FA;
}
html[data-theme="dark"] .status-badge.queued {
  background: rgba(251, 191, 36, 0.12);
  color: #FBBF24;
}
html[data-theme="dark"] .status-badge.pending {
  background: rgba(251, 191, 36, 0.12);
  color: #FBBF24;
}
html[data-theme="dark"] .status-badge.rejected {
  background: rgba(251, 113, 133, 0.12);
  color: #FB7185;
}
html[data-theme="dark"] .status-badge.success {
  background: rgba(52, 211, 153, 0.12);
  color: #34D399;
}
html[data-theme="dark"] .status-badge.info {
  background: rgba(96, 165, 250, 0.12);
  color: #60A5FA;
}
html[data-theme="dark"] .status-badge.warning {
  background: rgba(251, 191, 36, 0.12);
  color: #FBBF24;
}

/* --- Admin Action Buttons --- */
html[data-theme="dark"] .btn-icon {
  color: var(--gray-500);
}
html[data-theme="dark"] .btn-icon:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}
html[data-theme="dark"] .admin-actions .btn-icon.edit:hover {
  background: rgba(96, 165, 250, 0.12);
  color: #60A5FA;
}
html[data-theme="dark"] .admin-actions .btn-icon.delete:hover {
  background: rgba(251, 113, 133, 0.12);
  color: #FB7185;
}
html[data-theme="dark"] .admin-actions .btn-icon.view:hover {
  background: rgba(52, 211, 153, 0.12);
  color: #34D399;
}

/* --- User Contact Cell & WhatsApp Badge --- */
html[data-theme="dark"] .user-contact-email,
html[data-theme="dark"] .user-contact-phone {
  color: var(--gray-700);
}
html[data-theme="dark"] .user-contact-email svg,
html[data-theme="dark"] .user-contact-phone svg {
  color: var(--gray-400);
}
html[data-theme="dark"] .wa-badge.wa-on {
  background: rgba(37, 211, 102, 0.12);
  color: #34D399;
}
html[data-theme="dark"] .wa-badge.wa-off {
  background: var(--gray-200);
  color: var(--gray-500);
}

/* --- User Avatar in Dark Mode --- */
html[data-theme="dark"] .user-avatar {
  background: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .user-avatar.operator-badge {
  background: #D97706;
  color: #fff;
}
html[data-theme="dark"] .user-avatar.admin-badge::after {
  border-color: var(--gray-100);
}

/* --- Empty State --- */
html[data-theme="dark"] .empty-state {
  color: var(--gray-500);
}
html[data-theme="dark"] .empty-state svg {
  color: var(--gray-400);
}
html[data-theme="dark"] .empty-state h3 {
  color: var(--gray-700);
}

/* --- Submission Filters --- */
html[data-theme="dark"] .submission-filters {
  border-color: var(--gray-200);
}
html[data-theme="dark"] .filter-group label {
  color: var(--gray-600);
}
html[data-theme="dark"] .filter-group select {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-900);
}

/* --- Admin Table Enhancements --- */
html[data-theme="dark"] .users-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .users-table td {
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .users-table tbody tr:hover {
  background: rgba(129, 140, 248, 0.04);
}
html[data-theme="dark"] .submissions-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .submissions-table td {
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .submissions-table tbody tr:hover {
  background: rgba(129, 140, 248, 0.04);
}

/* --- Credit & Transaction Amount Colors --- */
html[data-theme="dark"] .credit-amount.positive,
html[data-theme="dark"] .transaction-amount.positive {
  color: #34D399;
}
html[data-theme="dark"] .credit-amount.negative,
html[data-theme="dark"] .transaction-amount.negative {
  color: #FB7185;
}

/* --- Upload Zone & File Preview --- */
html[data-theme="dark"] .upload-zone:hover,
html[data-theme="dark"] .upload-zone.drag-over {
  background: rgba(129, 140, 248, 0.1);
  border-color: var(--primary);
}
html[data-theme="dark"] .file-preview {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .file-icon {
  background: var(--primary-light);
  color: var(--primary);
}

/* --- Credit Check Banner --- */
html[data-theme="dark"] .credit-check-banner {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .banner-status.sufficient {
  color: #34D399;
}
html[data-theme="dark"] .banner-status.insufficient {
  color: #FB7185;
}

/* --- Avg Processing Banner --- */
html[data-theme="dark"] .avg-processing-banner {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}

/* --- Submit Message Banners --- */
html[data-theme="dark"] .submit-message {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .submit-message.is-yellow {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.2);
  color: #FBBF24;
}
html[data-theme="dark"] .submit-message.is-red {
  background: rgba(251, 113, 133, 0.08);
  border-color: rgba(251, 113, 133, 0.2);
  color: #FB7185;
}

html[data-theme="dark"] .submission-filter-panel {
  border-color: rgba(129, 140, 248, 0.22);
  background:
    radial-gradient(circle at top left, rgba(129, 140, 248, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .submission-filter-panel__header strong {
  color: var(--gray-900);
}

html[data-theme="dark"] .submission-filter-card .option-content {
  background: rgba(15, 23, 42, 0.82);
}

html[data-theme="dark"] .submission-filter-card input:checked + .option-content {
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.18), rgba(16, 185, 129, 0.12));
}

/* --- Document Options --- */
html[data-theme="dark"] .exclude-options {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .exclude-info-row {
  color: var(--gray-700);
}

/* --- Btn Outline in Dark Mode --- */
html[data-theme="dark"] .btn-outline {
  border-color: var(--gray-300);
  color: var(--primary);
}
html[data-theme="dark"] .btn-outline:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* --- Activity Items (Admin Dashboard) --- */
html[data-theme="dark"] .activity-item {
  background: var(--gray-100);
}
html[data-theme="dark"] .activity-item:hover {
  background: var(--gray-200);
}

/* --- Log Messages --- */
html[data-theme="dark"] .log-message {
  border-color: var(--gray-300);
  color: var(--gray-600);
}
html[data-theme="dark"] .log-message .log-time {
  color: var(--gray-400);
}

/* --- Quick Stats (Admin Dashboard) --- */
html[data-theme="dark"] .stat-value {
  color: var(--gray-900);
}

/* --- Modal Header/Footer --- */
html[data-theme="dark"] .modal-header {
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .modal-footer {
  border-top-color: var(--gray-200);
}

/* --- Roster Grid Dark Mode --- */
html[data-theme="dark"] .roster-granularity-toggle {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .roster-gran-btn {
  color: var(--gray-600);
}
html[data-theme="dark"] .roster-gran-btn.active {
  background: var(--primary);
  color: #fff;
}
html[data-theme="dark"] .roster-my-schedule {
  border-color: var(--gray-200);
}
html[data-theme="dark"] .roster-grid .roster-day-header {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .roster-grid .roster-cell {
  border-color: var(--gray-200);
}
html[data-theme="dark"] .roster-grid .roster-cell:hover {
  background: rgba(129, 140, 248, 0.04);
}
html[data-theme="dark"] .roster-hour-header {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-700);
}

/* --- Confirm Dialog Dark --- */
html[data-theme="dark"] .confirm-dialog {
  background: var(--gray-100);
  border-color: var(--gray-200);
}

/* --- Card Body Borders --- */
html[data-theme="dark"] .card-body {
  border-color: var(--gray-200);
}

/* --- Sidebar Nav Active Link --- */
html[data-theme="dark"] .nav-link {
  color: var(--gray-600);
}
html[data-theme="dark"] .nav-link:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}
html[data-theme="dark"] .nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}
html[data-theme="dark"] .nav-badge {
  background: var(--primary);
  color: #fff;
}

/* --- Admin Webhook Test Upload --- */
.admin-webhook-test-container {
  max-width: 1180px;
  margin: 0 auto;
}

.webhook-test-hero {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 12% 20%, rgba(34, 197, 94, 0.16), transparent 34%),
    radial-gradient(circle at 90% 0%, rgba(79, 70, 229, 0.18), transparent 36%),
    linear-gradient(135deg, #0f172a 0%, #172033 58%, #1f2937 100%);
  color: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  position: relative;
}

.webhook-test-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}

.webhook-test-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.webhook-test-kicker svg {
  width: 14px;
  height: 14px;
}

.webhook-test-hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 1.5rem;
  align-items: end;
  margin-top: 1.2rem;
  position: relative;
  z-index: 1;
}

.webhook-test-hero h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.webhook-test-hero p {
  max-width: 620px;
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.webhook-test-endpoint {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(12px);
}

.webhook-test-endpoint span,
.webhook-test-spec-label,
.webhook-test-response-grid span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.webhook-test-endpoint span {
  color: rgba(255, 255, 255, 0.58);
}

.webhook-test-endpoint code {
  display: block;
  color: #86efac;
  white-space: normal;
  word-break: break-all;
  font-size: 0.86rem;
}

.webhook-test-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: stretch;
}

.webhook-test-upload-card .card-header h3,
.webhook-test-result-card .card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.webhook-test-drop-zone {
  min-height: 220px;
}

.webhook-test-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.webhook-test-auth-grid .form-group {
  margin-bottom: 0;
}

.webhook-test-auth-grid .optional {
  color: var(--gray-400);
  font-size: 0.72rem;
  font-weight: 500;
}

.webhook-test-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  color: var(--gray-600);
  font-size: 0.84rem;
}

.webhook-test-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.webhook-test-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.webhook-test-spec {
  display: grid;
  gap: 0.75rem;
}

.webhook-test-spec-card {
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 1rem;
  background: linear-gradient(180deg, #fff, var(--gray-50));
}

.webhook-test-spec-card strong {
  display: block;
  color: var(--gray-900);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.webhook-test-spec-card p {
  margin: 0;
  color: var(--gray-600);
  font-size: 0.86rem;
  line-height: 1.6;
}

.webhook-test-spec-card code {
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  background: var(--gray-100);
  color: var(--gray-800);
}

.webhook-test-result-card {
  margin-top: 1rem;
}

.webhook-test-retrieve-card {
  margin-top: 1rem;
}

.webhook-test-retrieve-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
}

.webhook-test-retrieve-bar .form-group {
  margin-bottom: 0;
}

.webhook-test-status-body {
  margin-top: 1rem;
}

.webhook-test-empty {
  padding: 1rem;
  border: 1px dashed var(--gray-300);
  border-radius: 16px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 0.88rem;
}

.webhook-test-downloads {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

.webhook-test-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 0.78rem;
  font-weight: 700;
}

.webhook-test-status-badge.loading {
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
}

.webhook-test-status-badge.success {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.webhook-test-status-badge.error {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.webhook-test-loading,
.webhook-test-error {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--gray-50);
  color: var(--gray-600);
}

.webhook-test-error {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

.webhook-test-loading svg {
  width: 18px;
  height: 18px;
}

.webhook-test-response-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.webhook-test-response-grid div {
  padding: 0.85rem;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  background: var(--gray-50);
  min-width: 0;
}

.webhook-test-response-grid .wide {
  grid-column: 1 / -1;
}

.webhook-test-response-grid strong {
  display: block;
  color: var(--gray-900);
  word-break: break-word;
}

.webhook-test-response-json {
  margin: 0;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #0f172a;
  color: #d1fae5;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow: auto;
}

html[data-theme="dark"] .webhook-test-spec-card {
  background: linear-gradient(180deg, var(--gray-50), var(--gray-100));
  border-color: var(--gray-200);
}

html[data-theme="dark"] .webhook-test-response-grid div,
html[data-theme="dark"] .webhook-test-loading {
  background: var(--gray-100);
  border-color: var(--gray-200);
}

@media (max-width: 980px) {
  .webhook-test-hero-main,
  .webhook-test-grid,
  .webhook-test-retrieve-bar {
    grid-template-columns: 1fr;
  }
}

/* --- Admin Restock Webhook Logs --- */
.admin-webhook-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-webhook-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.admin-webhook-metric {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  background: var(--gray-50);
}

.admin-webhook-metric-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.admin-webhook-metric strong {
  font-size: 1.5rem;
  color: var(--gray-900);
}

.admin-webhook-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.admin-webhook-dispatch-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-webhook-dispatch-item {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 0.875rem 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-webhook-dispatch-item:hover,
.admin-webhook-dispatch-item.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.admin-webhook-dispatch-head,
.admin-webhook-summary-top,
.admin-webhook-dispatch-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-webhook-dispatch-meta,
.admin-webhook-summary-meta {
  color: var(--gray-500);
  font-size: 0.8125rem;
}

.admin-webhook-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--gray-100);
  overflow: hidden;
  margin: 0.75rem 0;
}

.admin-webhook-progress.large {
  height: 10px;
}

.admin-webhook-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #22c55e);
  border-radius: inherit;
}

.admin-webhook-dispatch-stats {
  font-size: 0.8rem;
  color: var(--gray-600);
}

.admin-webhook-summary-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  background: var(--gray-50);
  margin-bottom: 1rem;
}

.admin-webhook-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.875rem;
}

.admin-webhook-summary-grid div {
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
}

.admin-webhook-summary-grid span {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.admin-webhook-summary-grid strong {
  font-size: 1.1rem;
  color: var(--gray-900);
}

.admin-webhook-summary-note,
.admin-webhook-summary-empty,
.admin-webhook-logs-empty {
  margin-top: 0.875rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

.admin-webhook-log-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-webhook-log-table th,
.admin-webhook-log-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.8125rem;
  text-align: left;
  vertical-align: top;
}

.admin-webhook-log-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 0.75rem;
}

html[data-theme="dark"] .admin-webhook-metric,
html[data-theme="dark"] .admin-webhook-summary-card,
html[data-theme="dark"] .admin-webhook-log-table th {
  background: var(--gray-100);
  border-color: var(--gray-200);
}

html[data-theme="dark"] .admin-webhook-dispatch-item,
html[data-theme="dark"] .admin-webhook-summary-grid div {
  background: var(--gray-50);
  border-color: var(--gray-200);
}

html[data-theme="dark"] .admin-webhook-progress {
  background: var(--gray-200);
}

@media (max-width: 1080px) {
  .admin-webhook-layout {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Admin Credits Page (積分管理 v2)
   ============================================================ */
.admin-credits-container {
  max-width: 1400px;
  margin: 0 auto;
}

.credit-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.credit-stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.credit-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.credit-stat-icon i {
  width: 22px;
  height: 22px;
}

.credit-stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.credit-stat-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 0.15rem;
}

.credit-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.1;
}

.daily-expiry-table {
  width: 100%;
  border-collapse: collapse;
}

.daily-expiry-table th,
.daily-expiry-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  font-size: 0.875rem;
}

.daily-expiry-table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.daily-expiry-table tbody tr:hover {
  background: var(--gray-50);
}

.credit-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem !important;
}

.credit-filter-row .form-control-sm {
  height: 32px;
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.txn-type-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.txn-type-badge.credit  { background: #ECFDF5; color: #059669; }
.txn-type-badge.debit   { background: #FEF2F2; color: #DC2626; }
.txn-type-badge.refund  { background: #EFF6FF; color: #2563EB; }
.txn-type-badge.expired { background: #F3F4F6; color: #6B7280; }
.txn-type-badge.promo   { background: #FAF5FF; color: #7C3AED; }
.txn-type-badge.other   { background: var(--gray-100); color: var(--gray-700); }

@media (max-width: 720px) {
  .credit-filter-row { flex-direction: column; align-items: stretch; }
  .credit-filter-row #creditExportBtn { margin-left: 0 !important; }
  .credit-stat-value { font-size: 1.25rem; }
}

/* Dark theme */
html[data-theme="dark"] .credit-stat-card {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .daily-expiry-table thead th {
  background: var(--gray-100);
}

/* ─── Payment review (充值審核) ─── */
.payment-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.payment-kpi-card {
  background: var(--white, #fff);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md, 8px);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.payment-kpi-label { font-size: 0.75rem; color: var(--gray-500); }
.payment-kpi-value { font-size: 1.4rem; font-weight: 700; color: var(--gray-900); }
.payment-kpi-sub { font-size: 0.7rem; color: var(--gray-500); }
.payment-kpi-card.warn .payment-kpi-value { color: var(--warning); }
.payment-kpi-card.danger .payment-kpi-value { color: var(--error); }

.payment-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
}
.payment-filter-row .form-control-sm {
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  height: auto;
}

/* Risk badges on list cards & in modal header */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
}
.risk-badge.red { background: #FEE2E2; color: #B91C1C; }
.risk-badge.yellow { background: #FEF3C7; color: #92400E; }
.risk-badge.blue { background: #DBEAFE; color: #1E40AF; }
.risk-badge.gray { background: var(--gray-100); color: var(--gray-700); }
html[data-theme="dark"] .risk-badge.red { background: rgba(239,68,68,0.2); color: #FCA5A5; }
html[data-theme="dark"] .risk-badge.yellow { background: rgba(245,158,11,0.2); color: #FCD34D; }
html[data-theme="dark"] .risk-badge.blue { background: rgba(59,130,246,0.2); color: #93C5FD; }

/* Aging label */
.pending-age {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm, 4px);
}
.pending-age.fresh { background: var(--gray-100); color: var(--gray-600); }
.pending-age.warn  { background: #FEF3C7; color: #92400E; }
.pending-age.danger { background: #FEE2E2; color: #B91C1C; }

/* Review modal layout */
.payment-review-modal { width: 95vw; }
.payment-review-image-wrap {
  flex: 1 1 60%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--gray-900, #111);
}
.payment-review-image-toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid var(--gray-800, #222);
}
.payment-review-image-toolbar .btn { color: #eee; border-color: #444; background: transparent; }
.payment-review-image-stage {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
}
.payment-review-image-stage.dragging { cursor: grabbing; }
.payment-review-image-stage img {
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  transition: transform 0.05s linear;
  pointer-events: none;
}
.payment-review-side {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--gray-200);
  background: var(--white, #fff);
  min-height: 0;
}
.payment-review-tabs { display:flex; border-bottom: 1px solid var(--gray-200); }
.payment-review-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.6rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.payment-review-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--gray-50);
}
.payment-review-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  font-size: 0.85rem;
}
.payment-review-pane { display: none; }
.payment-review-pane.active { display: block; }
.dup-count-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  background: var(--error);
  color: #fff;
  border-radius: 9px;
  font-size: 0.65rem;
  line-height: 16px;
  font-weight: 700;
}

/* Payment review side panes content */
.review-section {
  margin-bottom: 1rem;
}
.review-section h4 {
  margin: 0 0 0.4rem 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 600;
}
.review-section .review-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.8rem;
}
.review-section .review-row .lbl { color: var(--gray-500); }
.review-section .review-row .val { color: var(--gray-800); text-align: right; }
.dup-list { list-style: none; padding: 0; margin: 0; }
.dup-list li {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm, 4px);
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}
.dup-list li.exact { border-color: #FCA5A5; background: #FEF2F2; }
.dup-list li.near { border-color: #FCD34D; background: #FFFBEB; }

/* Reject reason chips */
.reject-chip {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.reject-chip:hover { background: var(--gray-200); }
.reject-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

@media (max-width: 800px) {
  .payment-review-modal .modal-body { flex-direction: column; }
  .payment-review-side { flex: 1 1 auto; border-left: 0; border-top: 1px solid var(--gray-200); max-height: 40vh; }
}

/* ============================================================
   ADMIN — ROLE MANAGEMENT (design-taste pass)
   ============================================================ */
.admin-roles-container { display: flex; flex-direction: column; gap: 1.5rem; }

/* Stats strip — divider-based, no card overuse */
.roles-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  padding: 1.25rem 1.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
}
.roles-stat {
  position: relative;
  display: flex; flex-direction: column; gap: .25rem;
  padding: 0 1.25rem;
}
.roles-stat + .roles-stat::before {
  content: ''; position: absolute; left: 0; top: 10%; bottom: 10%;
  width: 1px; background: var(--gray-200);
}
.roles-stat-label {
  font-size: .7rem; font-weight: 600; letter-spacing: .05em;
  color: var(--gray-500); text-transform: uppercase;
}
.roles-stat-value {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.625rem; font-weight: 600; line-height: 1.1;
  color: var(--gray-900); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.roles-stat-value.is-accent { color: var(--primary); }
.roles-stat-value.is-warn   { color: var(--warning); }

/* Card grid */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.roles-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 3rem 1rem;
  color: var(--gray-500);
  border: 1px dashed var(--gray-300);
  border-radius: 1rem;
}
.role-card {
  position: relative;
  display: flex; flex-direction: column; gap: .75rem;
  padding: 1.125rem 1.25rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02), 0 8px 24px -16px rgba(15, 23, 42, .06);
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s cubic-bezier(.16,1,.3,1), border-color .2s;
  will-change: transform;
}
.role-card:hover {
  transform: translateY(-2px);
  border-color: var(--gray-300);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03), 0 18px 36px -20px rgba(15, 23, 42, .14);
}
.role-card.is-admin { border-color: rgba(79, 70, 229, .35); background: linear-gradient(180deg, #fbfaff 0%, #fff 100%); }
.role-card.is-builtin::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.role-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
}
.role-card-head-left { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.role-card-label {
  font-size: 1.0625rem; font-weight: 600; color: var(--gray-900); letter-spacing: -.01em;
  line-height: 1.25;
}
.role-card-id {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .75rem; color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
.role-card-flags { display: flex; flex-wrap: wrap; gap: .25rem; }
.role-flag {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .45rem; border-radius: 999px;
  font-size: .68rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.role-flag i, .role-flag svg { width: .75rem; height: .75rem; }
.role-flag.is-builtin { background: rgba(79, 70, 229, .08); color: #4338ca; border-color: rgba(79, 70, 229, .2); }
.role-flag.is-mfa     { background: rgba(16, 185, 129, .1); color: #047857; border-color: rgba(16, 185, 129, .25); }
.role-flag.is-mfa-off { background: var(--gray-50); color: var(--gray-500); border-color: var(--gray-200); }
.role-flag.is-all     { background: rgba(245, 158, 11, .1); color: #92400e; border-color: rgba(245, 158, 11, .25); }

.role-card-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem;
  padding: .625rem .75rem;
  background: var(--gray-50);
  border-radius: .625rem;
}
.role-meta-item { display: flex; flex-direction: column; gap: .15rem; }
.role-meta-key {
  font-size: .65rem; font-weight: 600; letter-spacing: .05em;
  color: var(--gray-500); text-transform: uppercase;
}
.role-meta-val {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .9375rem; font-weight: 600; color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}

.role-pages-list { display: flex; flex-wrap: wrap; gap: .3rem; min-height: 1.75rem; }
.role-page-chip {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 500;
  background: var(--gray-100); color: var(--gray-700);
  border: 1px solid var(--gray-200);
  white-space: nowrap;
}
.role-page-chip-more {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; color: var(--gray-500);
  background: transparent;
}
.role-page-chip-empty { font-size: .8rem; color: var(--gray-400); font-style: italic; }

.role-card-actions {
  display: flex; gap: .375rem; justify-content: flex-end;
  margin-top: .25rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--gray-200);
}
.role-card-actions .btn { transition: transform .15s cubic-bezier(.16,1,.3,1); }
.role-card-actions .btn:active { transform: translateY(1px) scale(.98); }

/* ----- Edit modal ----- */
.role-edit-modal .modal-body { display: flex; flex-direction: column; gap: 1.25rem; }
.role-form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.role-form-row .form-group { min-width: 160px; }
.role-form-hint {
  margin-left: .4rem; font-size: .7rem; color: var(--gray-400); font-weight: normal;
}
.role-mono-input {
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

.role-mfa-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .875rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: .75rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.role-mfa-row:hover { border-color: var(--gray-300); }
.role-mfa-text { display: flex; flex-direction: column; gap: .15rem; }
.role-mfa-title {
  display: inline-flex; align-items: center; gap: .375rem;
  font-size: .875rem; font-weight: 600; color: var(--gray-900);
}
.role-mfa-desc { font-size: .76rem; color: var(--gray-500); line-height: 1.45; }

.role-switch { position: relative; flex-shrink: 0; width: 40px; height: 22px; }
.role-switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.role-switch input:disabled ~ .role-switch-track { opacity: .55; cursor: not-allowed; }
.role-switch-track {
  position: absolute; inset: 0;
  background: var(--gray-300);
  border-radius: 999px;
  transition: background .2s cubic-bezier(.16,1,.3,1);
}
.role-switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(15, 23, 42, .15);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.role-switch input:checked ~ .role-switch-track { background: var(--primary); }
.role-switch input:checked ~ .role-switch-track::after { transform: translateX(18px); }

.role-pages-header {
  display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem;
  margin-bottom: .625rem;
}
.role-pages-meta {
  font-size: .76rem; color: var(--gray-500);
  font-variant-numeric: tabular-nums;
  margin-top: .15rem;
}
.role-pages-actions { display: flex; align-items: center; gap: .375rem; flex-shrink: 0; }
.role-pages-sep { color: var(--gray-300); }
.btn-link-tight {
  background: none; border: none; padding: 0;
  font-size: .8125rem; font-weight: 500; color: var(--primary); cursor: pointer;
  transition: color .15s;
}
.btn-link-tight:hover { color: var(--primary-dark, #4338ca); text-decoration: underline; }

.role-pages-groups { display: flex; flex-direction: column; gap: .875rem; }
.role-pages-group {
  border: 1px solid var(--gray-200);
  border-radius: .75rem;
  padding: .75rem .875rem;
  background: #fff;
}
.role-pages-group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .55rem;
}
.role-pages-group-title {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: var(--gray-500); text-transform: uppercase;
}
.role-pages-group-count {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: .7rem; color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}
.role-pages-group-toggle {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: .72rem; font-weight: 500; color: var(--primary);
}
.role-pages-group-toggle:hover { text-decoration: underline; }
.role-pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .375rem;
}
.role-page-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .6rem;
  border: 1px solid var(--gray-200);
  border-radius: .5rem;
  cursor: pointer;
  font-size: .825rem;
  color: var(--gray-700);
  background: #fff;
  transition: border-color .15s, background .15s, transform .15s cubic-bezier(.16,1,.3,1);
  user-select: none;
}
.role-page-item:hover { border-color: var(--gray-300); background: var(--gray-50); }
.role-page-item:active { transform: translateY(1px); }
.role-page-item input { margin: 0; flex-shrink: 0; accent-color: var(--primary); }
.role-page-item.is-checked {
  border-color: rgba(79, 70, 229, .35);
  background: rgba(79, 70, 229, .04);
  color: var(--gray-900); font-weight: 500;
}
.role-page-item.is-disabled { opacity: .55; cursor: not-allowed; }

.role-builtin-note {
  display: flex; align-items: center; gap: .5rem;
  padding: .625rem .75rem;
  background: rgba(245, 158, 11, .08);
  border: 1px solid rgba(245, 158, 11, .25);
  color: #92400e;
  border-radius: .5rem;
  font-size: .8rem;
}

@media (max-width: 640px) {
  .roles-stat + .roles-stat::before { display: none; }
  .roles-stat { padding: .5rem 0; border-bottom: 1px solid var(--gray-200); }
  .roles-stat:last-child { border-bottom: 0; }
  .role-form-row { flex-direction: column; }
  .role-card-meta { grid-template-columns: 1fr; }
}

/* Dark-mode overrides for role management */
html[data-theme="dark"] .role-card {
  background: var(--gray-100);
  border-color: var(--gray-200);
  box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px -16px rgba(0,0,0,.5);
}
html[data-theme="dark"] .role-card:hover {
  border-color: var(--gray-300);
  box-shadow: 0 1px 0 rgba(0,0,0,.35), 0 18px 36px -20px rgba(0,0,0,.6);
}
html[data-theme="dark"] .role-card.is-admin {
  background: linear-gradient(180deg, rgba(129,140,248,.08) 0%, var(--gray-100) 100%);
  border-color: rgba(129, 140, 248, .35);
}
html[data-theme="dark"] .role-card-meta { background: var(--gray-50); }
html[data-theme="dark"] .role-page-chip {
  background: var(--gray-50);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .roles-stats {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .roles-empty { border-color: var(--gray-300); }

html[data-theme="dark"] .role-flag.is-builtin {
  background: rgba(129, 140, 248, .15); color: #c7d2fe; border-color: rgba(129, 140, 248, .35);
}
html[data-theme="dark"] .role-flag.is-mfa {
  background: rgba(52, 211, 153, .14); color: #6ee7b7; border-color: rgba(52, 211, 153, .35);
}
html[data-theme="dark"] .role-flag.is-mfa-off {
  background: var(--gray-50); color: var(--gray-500); border-color: var(--gray-200);
}
html[data-theme="dark"] .role-flag.is-all {
  background: rgba(251, 191, 36, .15); color: #fcd34d; border-color: rgba(251, 191, 36, .35);
}

/* Modal pieces */
html[data-theme="dark"] .role-mfa-row {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .role-mfa-row:hover { border-color: var(--gray-300); }
html[data-theme="dark"] .role-switch-track { background: var(--gray-300); }
html[data-theme="dark"] .role-switch-track::after { background: var(--gray-800); box-shadow: 0 2px 4px rgba(0,0,0,.4); }
html[data-theme="dark"] .role-switch input:checked ~ .role-switch-track { background: var(--primary); }

html[data-theme="dark"] .role-pages-group {
  background: var(--gray-100);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .role-page-item {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .role-page-item:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}
html[data-theme="dark"] .role-page-item.is-checked {
  background: rgba(129, 140, 248, .12);
  border-color: rgba(129, 140, 248, .45);
  color: var(--gray-900);
}

html[data-theme="dark"] .role-builtin-note {
  background: rgba(251, 191, 36, .1);
  border-color: rgba(251, 191, 36, .3);
  color: #fcd34d;
}
html[data-theme="dark"] .role-page-chip-empty { color: var(--gray-500); }

/* Role-users modal */
.role-meta-item.is-clickable {
  cursor: pointer;
  border-radius: .375rem;
  padding: .15rem .3rem;
  margin: -.15rem -.3rem;
  transition: background .15s;
}
.role-meta-item.is-clickable:hover { background: var(--gray-100); }

.role-users-list { display: flex; flex-direction: column; gap: .5rem; max-height: 60vh; overflow-y: auto; padding-right: .25rem; }
.role-user-row {
  display: flex; align-items: center; gap: .875rem;
  padding: .75rem .875rem;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: .625rem;
  transition: border-color .15s, transform .15s cubic-bezier(.16,1,.3,1);
}
.role-user-row:hover { border-color: var(--gray-300); }

.role-user-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  border-radius: 50%;
  font-weight: 600; font-size: .9rem;
  font-family: 'Geist Mono', ui-monospace, monospace;
}
.role-user-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.role-user-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.role-user-email {
  font-weight: 600; color: var(--gray-900); font-size: .9rem;
  word-break: break-all;
}
.role-user-status {
  display: inline-flex; align-items: center;
  padding: .12rem .45rem; border-radius: 999px;
  font-size: .65rem; font-weight: 600; letter-spacing: .03em;
  border: 1px solid transparent;
}
.role-user-status.is-active   { background: rgba(16, 185, 129, .1); color: #047857; border-color: rgba(16, 185, 129, .25); }
.role-user-status.is-inactive { background: rgba(239, 68, 68, .08);  color: #b91c1c; border-color: rgba(239, 68, 68, .25); }

.role-user-sub {
  font-size: .76rem; color: var(--gray-500);
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  font-variant-numeric: tabular-nums;
}
.role-user-sub strong { color: var(--gray-700); font-family: 'Geist Mono', ui-monospace, monospace; }
.role-user-dot { color: var(--gray-300); }

.role-user-actions { flex-shrink: 0; }
.role-user-actions .btn { transition: transform .15s cubic-bezier(.16,1,.3,1); }
.role-user-actions .btn:active { transform: translateY(1px) scale(.97); }

/* Dark mode */
html[data-theme="dark"] .role-meta-item.is-clickable:hover { background: var(--gray-200); }
html[data-theme="dark"] .role-user-row { background: var(--gray-100); border-color: var(--gray-200); }
html[data-theme="dark"] .role-user-row:hover { border-color: var(--gray-300); }
html[data-theme="dark"] .role-user-status.is-active   { background: rgba(52, 211, 153, .14); color: #6ee7b7; border-color: rgba(52, 211, 153, .35); }
html[data-theme="dark"] .role-user-status.is-inactive { background: rgba(251, 113, 133, .12); color: #fda4af; border-color: rgba(251, 113, 133, .35); }

/* ================================
   Maintenance Mode (Admin Banner + Toggle)
   ================================ */
.switch input:checked + .slider {
  background: var(--primary) !important;
}
.switch .slider::before {
  content: "";
  position: absolute;
  left: 3px; top: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}
.switch input:checked + .slider::before {
  transform: translateX(22px);
}
.switch input:focus-visible + .slider {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#maintenanceLiveBadge {
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
#maintenanceLiveBadge::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #F59E0B;
  margin-right: 0.4rem;
  vertical-align: 1px;
  animation: mt-pulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes mt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

/* Top-of-page admin banner shown while maintenance is active */
.maintenance-banner {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(180deg, #FEF3C7 0%, #FDE68A 100%);
  border-bottom: 1px solid rgba(180, 83, 9, 0.25);
  color: #78350F;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 1px 0 rgba(180, 83, 9, 0.08);
}
.maintenance-banner[hidden] { display: none !important; }
.maintenance-banner .mb-left {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.maintenance-banner .mb-left .pulse {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #B45309;
  flex: 0 0 auto;
  animation: mt-pulse 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.maintenance-banner .mb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maintenance-banner .mb-actions { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.maintenance-banner .mb-btn {
  appearance: none;
  border: 1px solid rgba(180, 83, 9, 0.35);
  background: rgba(255, 255, 255, 0.7);
  color: #78350F;
  font: inherit;
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms;
}
.maintenance-banner .mb-btn:hover  { background: #FFFFFF; transform: translateY(-1px); }
.maintenance-banner .mb-btn:active { transform: translateY(0) scale(0.97); }
.maintenance-banner .mb-btn.danger {
  background: #B45309;
  color: #FFF;
  border-color: #B45309;
}
.maintenance-banner .mb-btn.danger:hover { background: #92400E; border-color: #92400E; }
@media (max-width: 640px) {
  .maintenance-banner { padding: 0.55rem 0.9rem; font-size: 0.8125rem; }
  .maintenance-banner .mb-text { white-space: normal; }
}

/* ============================================
   ANNOUNCEMENT BELL + DROPDOWN
   ============================================ */
.ann-bell-wrap { position: relative; display: inline-flex; }
.ann-bell-btn {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ann-bell-btn:hover {
  background: var(--gray-100);
  color: var(--gray-900);
  transform: translateY(-1px);
}
.ann-bell-btn:active { transform: translateY(0); }
.ann-bell-btn i { width: 18px; height: 18px; }
.ann-bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--error);
  color: #fff;
  font-size: 0.6875rem; font-weight: 700; line-height: 18px;
  border-radius: 999px; text-align: center;
  border: 2px solid var(--white);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}

.ann-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 380px; max-width: calc(100vw - 32px);
  max-height: 480px; overflow: hidden;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.18), 0 4px 12px -4px rgba(0,0,0,0.08);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 1000;
}
.ann-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ann-dd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}
.ann-dd-header strong { color: var(--gray-900); font-weight: 600; }
.ann-dd-mark-all {
  background: none; border: 0; padding: 0;
  color: var(--primary); font-size: 0.8125rem; cursor: pointer;
}
.ann-dd-mark-all:hover { text-decoration: underline; }

.ann-dd-list { overflow-y: auto; flex: 1; }
.ann-dd-empty {
  padding: 2rem 1rem; text-align: center;
  color: var(--gray-500);
}
.ann-dd-empty i { width: 32px; height: 32px; margin: 0 auto 0.5rem; display: block; opacity: 0.6; }
.ann-dd-empty p { margin: 0; font-size: 0.875rem; }

.ann-item {
  display: flex; gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background-color 0.12s ease;
}
.ann-item:last-child { border-bottom: 0; }
.ann-item:hover { background: var(--gray-50); }
.ann-item.is-unread { background: rgba(79, 70, 229, 0.04); }
.ann-item.is-unread:hover { background: rgba(79, 70, 229, 0.08); }
.ann-item-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 7px; flex: 0 0 8px;
}
.ann-item.is-unread .ann-item-dot { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18); }
.ann-item-body { flex: 1; min-width: 0; }
.ann-item-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0.5rem; margin-bottom: 0.25rem;
}
.ann-item-title {
  font-size: 0.875rem; font-weight: 600;
  color: var(--gray-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}
.ann-item-tag {
  font-size: 0.6875rem; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  border: 1px solid;
  flex: 0 0 auto;
}
.ann-item-preview {
  font-size: 0.8125rem; color: var(--gray-600);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ann-item-meta {
  font-size: 0.75rem; color: var(--gray-500);
  margin-top: 0.375rem;
}

/* Detail modal */
.ann-detail-tag {
  display: inline-block; padding: 2px 10px;
  font-size: 0.75rem; font-weight: 600;
  border-radius: 999px;
}
.ann-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin-top: 1rem; padding: 0.875rem 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}
.ann-detail-grid > div { display: flex; flex-direction: column; gap: 0.125rem; }
.ann-detail-k { font-size: 0.6875rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; }
.ann-detail-v { font-size: 0.9375rem; font-weight: 600; color: var(--gray-900); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .ann-dropdown { width: 320px; right: -50px; }
}

/* Dark mode adjustments for announcements */
html[data-theme="dark"] .ann-bell-btn {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] .ann-bell-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}
html[data-theme="dark"] .ann-bell-badge {
  border-color: var(--gray-50);
}
html[data-theme="dark"] .ann-dropdown {
  background: var(--gray-50);
  border-color: var(--gray-200);
  box-shadow: 0 14px 40px -12px rgba(0,0,0,0.6), 0 6px 18px -6px rgba(0,0,0,0.4);
}
html[data-theme="dark"] .ann-dd-header { border-bottom-color: var(--gray-200); }
html[data-theme="dark"] .ann-item { border-bottom-color: var(--gray-200); }
html[data-theme="dark"] .ann-item:hover { background: var(--gray-100); }
html[data-theme="dark"] .ann-item.is-unread { background: rgba(129, 140, 248, 0.10); }
html[data-theme="dark"] .ann-item.is-unread:hover { background: rgba(129, 140, 248, 0.16); }
html[data-theme="dark"] .ann-item.is-unread .ann-item-dot { box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.28); }
html[data-theme="dark"] .ann-detail-grid { background: var(--gray-100); }

/* ============================================
   ADMIN ANNOUNCEMENT MANAGEMENT
   ============================================ */
.admin-ann-status {
  display: inline-block; padding: 2px 8px;
  font-size: 0.75rem; font-weight: 600;
  border-radius: 999px; line-height: 1.4;
}
.admin-ann-status.upcoming { background: #DBEAFE; color: #1E40AF; }
.admin-ann-status.active   { background: #D1FAE5; color: #065F46; }
.admin-ann-status.expired  { background: var(--gray-100); color: var(--gray-600); }
.admin-ann-row { display: grid; grid-template-columns: 1.4fr 0.7fr 0.7fr 1fr 0.5fr; gap: 1rem; align-items: center; padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: 0.875rem; }
.admin-ann-row.head { font-weight: 600; color: var(--gray-700); background: var(--gray-50); border-bottom: 2px solid var(--gray-200); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-ann-row .row-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.admin-ann-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.admin-ann-form .form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.admin-ann-form .channel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.admin-ann-form .channel-card { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.75rem; border: 1px solid var(--gray-200); border-radius: var(--radius-md); cursor: pointer; transition: all 0.15s ease; }
.admin-ann-form .channel-card input { margin: 0; }
.admin-ann-form .channel-card:hover { background: var(--gray-50); }
.admin-ann-form .channel-card.checked { border-color: var(--primary); background: rgba(79, 70, 229, 0.05); }

/* ============================================
   SEO Admin Page
   ============================================ */
.seo-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1.25rem; border-bottom: 1px solid var(--gray-200); padding-bottom: 0; }
.seo-tab {
  background: transparent; border: none; padding: .65rem 1rem; cursor: pointer;
  color: var(--gray-600); font-weight: 500; font-size: .9rem;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.seo-tab:hover { color: var(--gray-900); }
.seo-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.seo-panel { display: none; }
.seo-panel.active { display: block; }

.seo-form { display: flex; flex-direction: column; gap: 1rem; }
.seo-form .form-field { display: flex; flex-direction: column; gap: .35rem; }
.seo-form .form-field label { font-size: .85rem; font-weight: 500; color: var(--gray-700); }
.seo-form .form-field input,
.seo-form .form-field select,
.seo-form .form-field textarea {
  width: 100%; padding: .55rem .75rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius-md); font-size: .9rem; background: #fff; color: var(--gray-900);
  font-family: inherit;
}
.seo-form .form-field input:focus,
.seo-form .form-field select:focus,
.seo-form .form-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.seo-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.seo-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .seo-grid-2, .seo-grid-3 { grid-template-columns: 1fr; } }
.seo-actions { display: flex; justify-content: flex-end; padding-top: .5rem; border-top: 1px solid var(--gray-100); }
.seo-section-title { font-size: 1rem; font-weight: 600; color: var(--gray-900); margin: 0 0 .75rem; }

.seo-switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.seo-switch input { opacity: 0; width: 0; height: 0; }
.seo-switch span {
  position: absolute; inset: 0; background: var(--gray-300); border-radius: 9999px;
  transition: background .2s;
}
.seo-switch span::before {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm);
}
.seo-switch input:checked + span { background: var(--primary); }
.seo-switch input:checked + span::before { transform: translateX(18px); }

.seo-faq-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.seo-faq-row {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: .75rem; align-items: end;
  padding: .75rem; border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--gray-50);
}
@media (max-width: 768px) { .seo-faq-row { grid-template-columns: 1fr; } }

.seo-table { border: 1px solid var(--gray-200); border-radius: var(--radius-md); overflow: hidden; }
.seo-table-head, .seo-table-row {
  display: grid; grid-template-columns: 1.4fr 1.4fr 2fr 100px;
  gap: .75rem; padding: .65rem .85rem; align-items: center;
}
.seo-table-head { background: var(--gray-50); font-weight: 600; font-size: .8rem; color: var(--gray-700); text-transform: uppercase; letter-spacing: .04em; }
.seo-table-row { border-top: 1px solid var(--gray-100); font-size: .9rem; background: #fff; }
.seo-table-head.sitemap, .seo-table-row.sitemap { grid-template-columns: 2fr 1fr 1fr 1fr 40px; }
.seo-table-row input, .seo-table-row select { padding: .4rem .55rem; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-size: .85rem; width: 100%; background: #fff; color: var(--gray-900); }
.seo-mono { font-family: var(--font-mono, ui-monospace, monospace); color: var(--primary); font-size: .85rem; }
.seo-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gray-600); }
.btn-icon.danger:hover { color: var(--error); background: rgba(239,68,68,.1); }

.seo-preview { display: flex; flex-direction: column; gap: 1rem; }
.seo-preview-google {
  padding: 1rem 1.25rem; border: 1px solid var(--gray-200); border-radius: var(--radius-md);
  background: #fff; max-width: 600px;
}
.seo-preview-google-url { color: #006621; font-size: .85rem; }
.seo-preview-google-title { color: #1a0dab; font-size: 1.25rem; font-weight: 400; line-height: 1.3; margin: .15rem 0; }
.seo-preview-google-desc { color: #4d5156; font-size: .9rem; line-height: 1.45; }
.seo-preview-raw { border: 1px solid var(--gray-200); border-radius: var(--radius-md); background: var(--gray-50); }
.seo-preview-raw summary { padding: .65rem 1rem; cursor: pointer; font-weight: 500; }
.seo-preview-raw pre {
  margin: 0; padding: 1rem; max-height: 360px; overflow: auto;
  font-family: var(--font-mono, ui-monospace, monospace); font-size: .8rem;
  background: var(--gray-900); color: #e5e7eb; border-radius: 0 0 var(--radius-md) var(--radius-md);
  white-space: pre-wrap; word-break: break-word;
}

/* Dark mode */
html[data-theme="dark"] .seo-tabs { border-bottom-color: var(--gray-700); }
html[data-theme="dark"] .seo-tab { color: var(--gray-400); }
html[data-theme="dark"] .seo-tab:hover { color: var(--gray-100); }
html[data-theme="dark"] .seo-form .form-field input,
html[data-theme="dark"] .seo-form .form-field select,
html[data-theme="dark"] .seo-form .form-field textarea {
  background: var(--gray-800); color: var(--gray-100); border-color: var(--gray-700);
}
html[data-theme="dark"] .seo-faq-row { background: var(--gray-800); border-color: var(--gray-700); }
html[data-theme="dark"] .seo-table { border-color: var(--gray-700); }
html[data-theme="dark"] .seo-table-head { background: var(--gray-800); color: var(--gray-300); }
html[data-theme="dark"] .seo-table-row { background: var(--gray-900); border-top-color: var(--gray-800); }
html[data-theme="dark"] .seo-table-row input, html[data-theme="dark"] .seo-table-row select { background: var(--gray-800); color: var(--gray-100); border-color: var(--gray-700); }
html[data-theme="dark"] .seo-preview-google { background: var(--gray-900); border-color: var(--gray-700); }
html[data-theme="dark"] .seo-preview-google-url { color: #6ee7b7; }
html[data-theme="dark"] .seo-preview-google-title { color: #93c5fd; }
html[data-theme="dark"] .seo-preview-google-desc { color: var(--gray-400); }
html[data-theme="dark"] .seo-preview-raw { background: var(--gray-800); border-color: var(--gray-700); }
html[data-theme="dark"] .seo-section-title { color: var(--gray-100); }
html[data-theme="dark"] .seo-actions { border-top-color: var(--gray-800); }

/* ========================================
   Membership tier system
   ======================================== */
.tier-card-wrap { margin-bottom: var(--space-4, 16px); }
.tier-card {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  border-radius: var(--radius-lg, 14px);
  background: linear-gradient(135deg, var(--tier-c1, #E0115F) 0%, var(--tier-c2, #FF6B9D) 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  position: relative; overflow: hidden;
}
.tier-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.25), transparent 60%);
  pointer-events: none;
}
.tier-badge {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.5);
  font-size: 28px;
  backdrop-filter: blur(6px);
  position: relative; z-index: 1;
}
.tier-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.tier-name { font-size: 18px; font-weight: 700; margin: 0 0 2px; letter-spacing: 0.5px; }
.tier-points { font-size: 14px; opacity: 0.92; margin: 0 0 8px; }
.tier-progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.25); overflow: hidden; }
.tier-progress-fill { height: 100%; background: rgba(255,255,255,0.95); transition: width 0.6s ease; }
.tier-next-hint { font-size: 12px; opacity: 0.85; margin-top: 6px; }

.tier-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--tier-c1, #E0115F); color: #fff;
}
.tier-pill .gem { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.85); }

/* Profile tier section — match same column width and rhythm as profile-grid cards */
.profile-tier-section {
  margin: 0 0 1.25rem;
}
.profile-tier-section:empty { display: none; }
.profile-tier-section .tier-card-v2,
.profile-tier-section .tier-card { margin: 0; }

/* ===== Tier card v2 — editorial style for profile page ===== */
.tier-card-v2 {
  position: relative;
  display: flex;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tier-card-v2:hover {
  border-color: var(--gray-200);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.tier-card-v2__accent {
  width: 5px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--tier-c1, #94A3B8) 0%, var(--tier-c2, #E2E8F0) 100%);
}
.tier-card-v2__inner {
  flex: 1;
  padding: 20px 22px;
  min-width: 0;
}
.tier-card-v2__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.tier-card-v2__eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tier-card-v2__name-block { min-width: 0; }
.tier-card-v2__name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
.tier-card-v2__name-en {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--tier-c1, var(--gray-500));
}
.tier-card-v2__points-block {
  text-align: right;
  flex-shrink: 0;
}
.tier-card-v2__points-num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.tier-card-v2__progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.tier-card-v2__progress {
  flex: 1;
  height: 6px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}
.tier-card-v2__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tier-c1, #94A3B8), var(--tier-c2, #E2E8F0));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.tier-card-v2__progress-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}
.tier-card-v2__next-hint {
  margin: 0;
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.5;
}
.tier-card-v2__next-hint strong {
  color: var(--gray-900);
  font-weight: 600;
}
.tier-card-v2__next-hint--max {
  color: var(--gray-700);
  font-weight: 500;
}

@media (max-width: 560px) {
  .tier-card-v2__inner { padding: 16px 18px; }
  .tier-card-v2__header { flex-direction: column; gap: 14px; margin-bottom: 14px; }
  .tier-card-v2__points-block { text-align: left; }
  .tier-card-v2__name { font-size: 22px; }
  .tier-card-v2__points-num { font-size: 26px; }
}

/* Dark mode */
html[data-theme="dark"] .tier-card-v2 {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .tier-card-v2:hover {
  border-color: var(--gray-300);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .tier-card-v2__name,
html[data-theme="dark"] .tier-card-v2__points-num,
html[data-theme="dark"] .tier-card-v2__next-hint strong {
  color: var(--gray-900);
}
html[data-theme="dark"] .tier-card-v2__eyebrow,
html[data-theme="dark"] .tier-card-v2__progress-pct,
html[data-theme="dark"] .tier-card-v2__next-hint {
  color: var(--gray-700);
}
html[data-theme="dark"] .tier-card-v2__progress { background: var(--gray-200); }

.tier-tx-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.tier-tx-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--gray-50); border-radius: var(--radius-md, 8px);
  font-size: 13px;
}
.tier-tx-amount { font-weight: 700; }
.tier-tx-amount.positive { color: var(--success, #10B981); }
.tier-tx-amount.negative { color: var(--error, #EF4444); }

/* Tier celebration toast */
.tier-celebration {
  position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%) scale(0.95);
  z-index: 9999;
  padding: 30px 40px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--tier-c1, #E0115F), var(--tier-c2, #FF6B9D));
  color: #fff; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s, transform 0.4s;
}
.tier-celebration.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.tier-celebration h2 { margin: 0 0 8px; font-size: 24px; }
.tier-celebration p { margin: 0; opacity: 0.95; }

/* Referral page */
.referral-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.referral-history-card { grid-column: 1 / -1; }
@media (max-width: 768px) { .referral-grid { grid-template-columns: 1fr; } }
.referral-link-row { display: flex; gap: 8px; margin-bottom: 16px; }
.referral-link-row input { flex: 1; font-family: monospace; font-size: 13px; }
.referral-code-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--gray-50); border-radius: var(--radius-md, 8px); margin-bottom: 16px; }
.referral-label { font-size: 13px; color: var(--gray-600); }
.referral-code { font-family: monospace; font-size: 16px; font-weight: 700; letter-spacing: 1px; flex: 1; }
.referral-share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.referral-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.referral-stat { text-align: center; padding: 12px; background: var(--gray-50); border-radius: var(--radius-md, 8px); }
.referral-stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--primary, #4F46E5); }
.referral-stat-label { display: block; font-size: 12px; color: var(--gray-600); margin-top: 4px; }
.referral-rewards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.referral-reward { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: var(--radius-md, 8px); }
.referral-reward-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.referral-reward-icon svg { width: 20px; height: 20px; }
.referral-reward-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.referral-reward-label { font-size: 12px; color: var(--gray-600); }
.referral-reward-amount { font-size: 18px; font-weight: 700; color: var(--gray-900); font-variant-numeric: tabular-nums; }
.referral-reward-amount strong { font-weight: 800; color: var(--primary); margin-right: 4px; }
html[data-theme="dark"] .referral-reward { background: var(--gray-100); border-color: var(--gray-200); }
html[data-theme="dark"] .referral-reward-label { color: var(--gray-600); }
html[data-theme="dark"] .referral-reward-amount { color: var(--gray-900); }
.referral-history-list { display: flex; flex-direction: column; gap: 8px; }
.referral-history-row {
  display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr; gap: 12px; align-items: center;
  padding: 10px 14px; background: var(--gray-50); border-radius: var(--radius-md, 8px); font-size: 13px;
}
.referral-history-row .status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.referral-history-row .status-pill.completed { background: var(--success, #10B981); color: #fff; }
.referral-history-row .status-pill.pending { background: var(--warning, #F59E0B); color: #fff; }

/* Admin membership page */
.admin-mem-section {
  background: #fff; padding: 20px; border-radius: var(--radius-lg, 12px); margin-bottom: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}
.admin-mem-section h3 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.admin-mem-tier-row {
  display: grid; grid-template-columns: 80px 1fr 1fr 110px 110px 110px auto;
  gap: 10px; align-items: center;
  padding: 12px; background: var(--gray-50); border-radius: var(--radius-md, 8px); margin-bottom: 8px;
}
.admin-mem-tier-row input { font-size: 13px; }
.admin-mem-tier-row input[type="color"] { padding: 0; width: 100%; height: 36px; cursor: pointer; }
.admin-mem-tier-preview {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
}
.admin-mem-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.admin-mem-form-row label { display: block; font-size: 12px; color: var(--gray-700); margin-bottom: 4px; }
.admin-mem-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.admin-mem-danger { border: 1px solid var(--error, #EF4444); border-radius: var(--radius-md, 8px); padding: 16px; margin-top: 16px; }
.admin-mem-danger h4 { color: var(--error, #EF4444); margin: 0 0 10px; }

/* Dark mode — tier/referral surfaces.
   Note: gray scale is inverted in dark mode (smaller index = darker surface). */
html[data-theme="dark"] .tier-tx-row,
html[data-theme="dark"] .admin-mem-tier-row {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-800);
}
html[data-theme="dark"] .admin-mem-section { background: var(--gray-100); border-color: var(--gray-200); }

/* === Phase 2: tier dashboard CTA + referral dark mode === */
.tier-card { position: relative; }
.tier-detail-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tier-detail-btn i { width: 14px; height: 14px; }
@media (max-width: 600px) {
  .tier-detail-btn { margin-left: 0; margin-top: 8px; width: 100%; justify-content: center; }
}
.tier-section-flash {
  animation: tierFlash 1.4s ease-out;
}
@keyframes tierFlash {
  0% { box-shadow: 0 0 0 0 rgba(79,70,229,0.55); }
  60% { box-shadow: 0 0 0 18px rgba(79,70,229,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
}

/* Referral page: dark mode coverage */
html[data-theme="dark"] #referralPage .referral-link-row input,
html[data-theme="dark"] #referralPage .form-control {
  background: var(--gray-50);
  color: var(--gray-800);
  border-color: var(--gray-200);
}
html[data-theme="dark"] #referralPage .referral-link-row input::placeholder,
html[data-theme="dark"] #referralPage .form-control::placeholder {
  color: var(--gray-500);
}
html[data-theme="dark"] #referralPage .referral-code-row,
html[data-theme="dark"] #referralPage .referral-stat {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
}
html[data-theme="dark"] #referralPage .referral-code { color: var(--gray-900); }
html[data-theme="dark"] #referralPage .referral-label,
html[data-theme="dark"] #referralPage .referral-stat-label {
  color: var(--gray-500);
}
html[data-theme="dark"] #referralPage .referral-stat-num { color: var(--primary); }
html[data-theme="dark"] #referralPage .referral-history-row {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-700);
}
html[data-theme="dark"] #referralPage .referral-history-row.history-header,
html[data-theme="dark"] #referralPage .referral-history-row.empty {
  background: transparent;
  color: var(--gray-500);
  border-color: transparent;
}
html[data-theme="dark"] #referralPage .empty-state,
html[data-theme="dark"] #referralPage .empty-state * {
  color: var(--gray-500);
}
html[data-theme="dark"] #referralPage .btn-secondary {
  background: var(--gray-50);
  color: var(--gray-800);
  border-color: var(--gray-200);
}
html[data-theme="dark"] #referralPage .btn-secondary:hover {
  background: var(--gray-200);
}

/* ============================================
   PREMIUM MEMBERSHIP CARD (dashboard)
   ============================================ */
.mem-card {
  --c1: var(--tier-c1, #94A3B8);
  --c2: var(--tier-c2, #E2E8F0);
  --ink: #0F172A;
  --ink-soft: rgba(15, 23, 42, 0.62);
  --ink-faint: rgba(15, 23, 42, 0.42);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 1.15fr);
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-light, rgba(15, 23, 42, 0.06));
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  isolation: isolate;
}

/* Left panel — quiet tier-tinted strip, no metallic gradient */
.mem-card-surface {
  position: relative;
  padding: 18px 20px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--c1) 14%, var(--card-bg, #fff)) 0%,
    color-mix(in srgb, var(--c2) 10%, var(--card-bg, #fff)) 100%
  );
  color: var(--ink);
  min-height: 0;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-light, rgba(15, 23, 42, 0.05));
  overflow: hidden;
}

/* Sheen + grain — disabled in muted mode */
.mem-card-grain { display: none; }
.mem-card-sheen { display: none; }

/* Tier-colored accent strip on the left edge */
.mem-card-surface::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  opacity: 0.85;
}

.mem-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mem-card-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mem-card-tier-zh {
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 2px 0 1px;
  color: var(--ink);
  text-wrap: balance;
}

.mem-card-tier-en {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.mem-card-tabular { font-variant-numeric: tabular-nums; }

/* Right side — progress + CTA, tighter */
.mem-card-meta {
  position: relative;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-bg, #fff);
}

.mem-card-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
}

.mem-card-points,
.mem-card-next {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mem-card-next { text-align: right; align-items: flex-end; }

.mem-card-points-num {
  font-size: clamp(20px, 2.8vw, 24px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text-primary, #0F172A);
}

.mem-card-next-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #0F172A);
}

.mem-card-next-max {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: color-mix(in srgb, var(--c1) 70%, #92400e);
  background: color-mix(in srgb, var(--c2) 25%, transparent);
  padding: 4px 8px;
  border-radius: 999px;
}
.mem-card-next-max i { width: 12px; height: 12px; }

.mem-card-bar {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: var(--gray-100, #F1F5F9);
  overflow: hidden;
}
.mem-card-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  transition: width 600ms cubic-bezier(0.34, 1.32, 0.64, 1);
  position: relative;
}
.mem-card-bar-fill::after { display: none; }

.mem-card-cta {
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light, rgba(15, 23, 42, 0.08));
  background: transparent;
  color: var(--gray-600, #475569);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
  width: 100%;
}
.mem-card-cta i { width: 14px; height: 14px; transition: transform 180ms ease; }
.mem-card-cta:hover {
  background: var(--gray-50, #F8FAFC);
  border-color: color-mix(in srgb, var(--c1) 35%, var(--border-light, rgba(15, 23, 42, 0.10)));
  color: var(--gray-900, #0F172A);
}
.mem-card-cta:hover i { transform: translateX(2px); }
.mem-card-cta:active { transform: scale(0.99); }
.mem-card-cta:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--c1) 60%, transparent);
  outline-offset: 2px;
}

/* === Mobile: stack as a true vertical card === */
@media (max-width: 720px) {
  .mem-card {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }
  .mem-card-surface {
    min-height: 0;
    padding: 14px 16px;
    border-radius: 14px 14px 0 0;
    border-right: 0;
    border-bottom: 1px solid var(--border-light, rgba(15, 23, 42, 0.06));
  }
  .mem-card-meta {
    padding: 14px 16px 16px;
    border-left: 0;
    gap: 10px;
  }
  .mem-card-meta-row { gap: 12px; }
  .mem-card-points-num { font-size: 22px; }
  .mem-card-next-num { font-size: 13px; }
  .mem-card-tier-zh { font-size: 18px; }
}
@media (max-width: 380px) {
  .mem-card-meta-row { flex-direction: column; align-items: stretch; }
  .mem-card-next, .mem-card-points { text-align: left; align-items: flex-start; }
}

/* === Dark mode ===
   Note: gray scale is inverted in dark mode (gray-50 = darkest, gray-900 = lightest).
   So dark surfaces use gray-50/100, light text uses gray-800/900. */
html[data-theme="dark"] .mem-card {
  --card-bg: var(--gray-100);
  border-color: var(--gray-200);
  box-shadow: none;
}
html[data-theme="dark"] .mem-card-surface {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--c1) 18%, var(--gray-100)) 0%,
    color-mix(in srgb, var(--c2) 8%, var(--gray-100)) 100%
  );
  border-right-color: var(--gray-200);
}
@media (max-width: 720px) {
  html[data-theme="dark"] .mem-card-surface {
    border-right: 0;
    border-bottom-color: var(--gray-200);
  }
}
html[data-theme="dark"] .mem-card-tier-zh { color: var(--gray-900); }
html[data-theme="dark"] .mem-card-tier-en,
html[data-theme="dark"] .mem-card-label { color: var(--gray-500); }
html[data-theme="dark"] .mem-card-meta {
  background: var(--gray-100);
}
html[data-theme="dark"] .mem-card-meta .mem-card-label {
  color: var(--gray-500);
}
html[data-theme="dark"] .mem-card-points-num,
html[data-theme="dark"] .mem-card-next-num {
  color: var(--gray-900);
}
html[data-theme="dark"] .mem-card-next-max {
  color: color-mix(in srgb, var(--c2) 80%, #fff);
  background: color-mix(in srgb, var(--c1) 20%, var(--gray-200));
}
html[data-theme="dark"] .mem-card-bar { background: var(--gray-200); }
html[data-theme="dark"] .mem-card-cta {
  border-color: var(--gray-200);
  color: var(--gray-600);
}
html[data-theme="dark"] .mem-card-cta:hover {
  background: var(--gray-50);
  border-color: color-mix(in srgb, var(--c1) 40%, var(--gray-200));
  color: var(--gray-900);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .mem-card-bar-fill::after { animation: none; }
  .mem-card-bar-fill { transition: none; }
  .mem-card-cta, .mem-card-cta i { transition: none; }
}

/* ============================================
   Profile page — design polish (redesign skill)
   ============================================ */
.profile-card {
  border-radius: 16px !important;
  border: 1px solid var(--gray-100);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: box-shadow 200ms ease, border-color 200ms ease, transform 200ms ease;
}
.profile-card:hover {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 12px 30px -18px rgba(79, 70, 229, 0.18);
  border-color: color-mix(in srgb, var(--primary) 18%, var(--gray-100));
}

.profile-card .form-group label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gray-700);
}
.profile-card input[type="text"]:focus,
.profile-card input[type="email"]:focus,
.profile-card input[type="tel"]:focus,
.profile-card input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  outline: none;
}

/* Danger zone — tinted shadow, more presence */
.profile-danger-card {
  border-color: color-mix(in srgb, var(--error) 22%, var(--gray-100)) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 16px 32px -22px color-mix(in srgb, var(--error) 50%, transparent);
}
.profile-danger-card .profile-card-header {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFFAFA 100%);
  border-bottom-color: color-mix(in srgb, var(--error) 18%, var(--gray-100));
}
.danger-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.danger-info p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin: 0;
  max-width: 52ch;
  line-height: 1.5;
}
.btn-danger:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--error) 70%, transparent);
  outline-offset: 2px;
}

/* Confirm dialog — danger variant for account deletion */
.confirm-dialog-danger .confirm-icon-danger {
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error);
}
.confirm-dialog-danger h3 {
  color: var(--gray-900);
  letter-spacing: -0.01em;
}
#deleteConfirmInput:focus {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 16%, transparent);
  outline: none;
}
#deleteConfirmBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Dark mode — profile page
   NOTE: gray scale is inverted in dark mode (gray-50 = darkest, gray-900 = lightest).
   So dark surfaces use gray-50/100, light text uses gray-800/900. */
html[data-theme="dark"] .profile-hero {
  background: var(--gray-100);
  border-color: var(--gray-200);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.6);
}
html[data-theme="dark"] .profile-hero-banner {
  background:
    radial-gradient(at 25% 30%, color-mix(in srgb, var(--primary) 50%, #0F172A) 0%, transparent 60%),
    radial-gradient(at 80% 70%, color-mix(in srgb, var(--primary) 30%, #1E1B4B) 0%, transparent 55%),
    linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, color-mix(in srgb, var(--primary) 80%, #000) 100%);
}
html[data-theme="dark"] .profile-avatar-large {
  border-color: var(--gray-100);
}
html[data-theme="dark"] .profile-header-info h2 { color: var(--gray-900); }
html[data-theme="dark"] .profile-header-info p { color: var(--gray-500); }
html[data-theme="dark"] .profile-quick-stats { border-top-color: transparent; }
html[data-theme="dark"] .profile-quick-stat {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
html[data-theme="dark"] .profile-quick-stat:not(:last-child) { border-right-color: var(--gray-200); }
html[data-theme="dark"] .pqs-label { color: var(--gray-500); }
html[data-theme="dark"] .pqs-value { color: var(--gray-800); }

html[data-theme="dark"] .profile-card {
  background: var(--gray-100);
  border-color: var(--gray-200);
  box-shadow: none;
}
html[data-theme="dark"] .profile-card:hover {
  background: var(--gray-100);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--gray-200));
  box-shadow: 0 12px 30px -18px color-mix(in srgb, var(--primary) 50%, rgba(0,0,0,0.6));
}
html[data-theme="dark"] .profile-card-header {
  background: var(--gray-50);
  border-bottom-color: var(--gray-200);
}
html[data-theme="dark"] .profile-card-header h3 { color: var(--gray-800); }
html[data-theme="dark"] .profile-card-icon {
  background: color-mix(in srgb, var(--primary) 22%, var(--gray-200));
}
html[data-theme="dark"] .profile-card-icon svg {
  color: color-mix(in srgb, var(--primary) 60%, #fff);
}
html[data-theme="dark"] .profile-card .form-group label { color: var(--gray-600); }
html[data-theme="dark"] .profile-card input[type="text"],
html[data-theme="dark"] .profile-card input[type="email"],
html[data-theme="dark"] .profile-card input[type="tel"],
html[data-theme="dark"] .profile-card input[type="password"] {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-800);
}
html[data-theme="dark"] .profile-card input[type="text"]:focus,
html[data-theme="dark"] .profile-card input[type="email"]:focus,
html[data-theme="dark"] .profile-card input[type="tel"]:focus,
html[data-theme="dark"] .profile-card input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
html[data-theme="dark"] .input-disabled {
  background: var(--gray-50) !important;
  color: var(--gray-500) !important;
  border-color: var(--gray-200) !important;
}
html[data-theme="dark"] .input-hint { color: var(--gray-500); }
html[data-theme="dark"] .profile-phone-display {
  color: var(--gray-700);
  background: var(--gray-50);
  border-color: var(--gray-200);
}

html[data-theme="dark"] .profile-danger-card {
  border-color: color-mix(in srgb, var(--error) 35%, var(--gray-200)) !important;
}
html[data-theme="dark"] .profile-danger-card .profile-card-header {
  background: color-mix(in srgb, var(--error) 14%, var(--gray-100));
  border-bottom-color: color-mix(in srgb, var(--error) 30%, var(--gray-200));
}
html[data-theme="dark"] .profile-card-icon--danger {
  background: color-mix(in srgb, var(--error) 22%, var(--gray-200));
}
html[data-theme="dark"] .danger-info h4 { color: var(--gray-900); }
html[data-theme="dark"] .danger-info p { color: var(--gray-500); }

html[data-theme="dark"] #deleteConfirmInput {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-800);
}

@media (max-width: 640px) {
  .profile-hero-body {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1rem 1.25rem 1rem;
    gap: 0.75rem;
  }
  .profile-header-info { padding-top: 0; }
  .profile-quick-stats {
    grid-template-columns: 1fr;
    padding: 0 1.25rem 1.25rem;
    gap: 0.5rem;
  }
  .profile-quick-stat:not(:last-child) {
    border-right: none;
    padding-right: 0.875rem;
    margin-right: 0;
  }
  .danger-item { flex-direction: column; align-items: stretch; }
  .danger-item .btn-danger { width: 100%; justify-content: center; }
}
