/* ============================================================
   OnlineInvoicesMaker.com — Receipt Generator
   Premium SaaS Design System
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Brand */
  --brand-primary: #6366f1;
  --brand-primary-dark: #4f46e5;
  --brand-primary-light: #818cf8;
  --brand-secondary: #06b6d4;
  --brand-accent: #f59e0b;
  --brand-success: #10b981;
  --brand-danger: #ef4444;
  --brand-warning: #f59e0b;

  /* Neutrals */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;

  /* Surfaces */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-card: #ffffff;
  --bg-overlay: rgba(0,0,0,0.45);

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;

  /* Borders */
  --border-light: #f3f4f6;
  --border-default: #e5e7eb;
  --border-medium: #d1d5db;
  --border-focus: #6366f1;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.09), 0 10px 10px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px rgba(0,0,0,0.15);
  --shadow-brand: 0 4px 14px rgba(99,102,241,0.35);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 200ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 350ms cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 420px;
  --preview-width: calc(100% - 420px);
  --toolbar-height: 60px;
  --container-max: 1280px;
}

/* ── Dark Mode ── */
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #161b27;
  --bg-tertiary: #1e2436;
  --bg-card: #1a2035;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --border-light: #1e2a3a;
  --border-default: #253147;
  --border-medium: #2d3f57;
  --border-focus: #818cf8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.4), 0 10px 10px rgba(0,0,0,0.2);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

/* ── Container ── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-default);
  z-index: 1000;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

[data-theme="dark"] .site-header {
  background: rgba(15,17,23,0.92);
  border-bottom-color: var(--border-default);
}

.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}

.logo-mark svg { color: white; }

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-tagline {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Desktop Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.nav-link.active { color: var(--brand-primary); background: rgba(99,102,241,0.08); }

.nav-dropdown { position: relative; }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 100;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-dropdown-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-dropdown-item .item-icon {
  width: 32px; height: 32px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-lg); }
.btn-xl { padding: 16px 36px; font-size: 16px; border-radius: var(--radius-lg); }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: white;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover { background: var(--bg-secondary); border-color: var(--border-medium); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.btn-outline {
  background: transparent;
  color: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
}
.btn-outline:hover { background: rgba(99,102,241,0.08); }

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16,185,129,0.35);
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(16,185,129,0.45); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}
.btn-danger:hover { transform: translateY(-1px); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.btn-icon:hover { background: var(--bg-secondary); color: var(--text-primary); }
.btn-icon-sm { width: 30px; height: 30px; border-radius: var(--radius-sm); }

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all var(--transition-fast);
}
.theme-toggle:hover { background: var(--bg-secondary); color: var(--text-primary); }

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0; bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: 20px 24px;
  overflow-y: auto;
  flex-direction: column;
  gap: 4px;
}

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

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}
.mobile-nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  padding-top: calc(var(--header-height) + 80px);
  padding-bottom: 100px;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  top: -200px; left: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-gradient-2 {
  position: absolute;
  top: -100px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 28px;
}

.hero-badge-dot {
  width: 7px; height: 7px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--text-primary);
  margin-bottom: 24px;
  line-height: 1.05;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(17px, 2.5vw, 21px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  font-weight: 400;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

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

.hero-stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -1px;
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border-default);
}

/* ── Hero Preview Card ── */
.hero-preview {
  margin-top: 70px;
  position: relative;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.hero-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  position: relative;
}

.hero-preview-bar {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-default);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.preview-dot-r { background: #ff5f57; }
.preview-dot-y { background: #ffbd2e; }
.preview-dot-g { background: #28c840; }

.preview-bar-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   FEATURES SECTION
   ============================================================ */
.section {
  padding: 96px 0;
}

.section-sm { padding: 64px 0; }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 64px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 16px;
  line-height: 1.15;
}

.section-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-slow);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(99,102,241,0.2);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.05));
  color: var(--brand-primary);
}

.feature-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
}

.feature-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ============================================================
   RECEIPT TYPES SECTION
   ============================================================ */
.receipt-types-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.receipt-type-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.receipt-type-card:hover {
  border-color: var(--brand-primary);
  background: rgba(99,102,241,0.03);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.receipt-type-emoji { font-size: 32px; margin-bottom: 12px; }
.receipt-type-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.receipt-type-desc { font-size: 12.5px; color: var(--text-muted); }

/* ============================================================
   TEMPLATES SECTION
   ============================================================ */
.templates-scroll {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.template-card {
  background: var(--bg-card);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.template-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.template-card.active { border-color: var(--brand-primary); }

.template-preview-area {
  height: 200px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}

.template-preview-mini {
  width: 90%;
  background: white;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 10px;
  font-size: 6px;
  line-height: 1.4;
  color: #333;
}

.template-info {
  padding: 14px 16px;
  border-top: 1px solid var(--border-default);
}

.template-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.template-desc { font-size: 11.5px; color: var(--text-muted); }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 32px;
  position: relative;
}

.testimonial-stars {
  color: #f59e0b;
  font-size: 16px;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.testimonial-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.testimonial-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.testimonial-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.testimonial-role { font-size: 12.5px; color: var(--text-muted); }

/* ============================================================
   PRICING
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  position: relative;
  transition: all var(--transition-base);
}

.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }

.pricing-card.popular {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 1px var(--brand-primary), var(--shadow-xl);
}

.popular-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: white;
  padding: 4px 18px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.pricing-plan { font-size: 14px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}
.price-currency { font-size: 22px; font-weight: 700; color: var(--text-secondary); }
.price-amount { font-size: 52px; font-weight: 900; color: var(--text-primary); letter-spacing: -2px; font-family: 'Plus Jakarta Sans', sans-serif; }
.price-period { font-size: 14px; color: var(--text-muted); }
.pricing-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }

.pricing-features {
  list-style: none;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.pricing-feature-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  color: var(--brand-success);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}

.pricing-feature-x {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  color: var(--brand-danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  gap: 16px;
  transition: background var(--transition-fast);
}

.faq-question:hover { background: var(--bg-tertiary); }

.faq-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-base);
  font-size: 14px;
  color: var(--text-muted);
}

.faq-item.open .faq-icon { transform: rotate(180deg); color: var(--brand-primary); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
  padding: 0 24px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding-bottom: 20px;
}

/* ============================================================
   CTA SECTION
   ============================================================ */
.cta-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-2xl);
  padding: 80px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 0 24px;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 60%; height: 200%;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.cta-title {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 900;
  color: white;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  position: relative;
}

.cta-subtitle {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  max-width: 540px;
  margin: 0 auto 40px;
  position: relative;
}

.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

.btn-white {
  background: white;
  color: #4f46e5;
  font-weight: 700;
}
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }

.btn-white-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
}
.btn-white-outline:hover { background: rgba(255,255,255,0.1); border-color: white; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--gray-950);
  color: rgba(255,255,255,0.6);
  padding: 72px 0 32px;
  margin-top: 0;
}

[data-theme="dark"] .site-footer { background: #080b12; }

.footer-grid {
  display: grid;
  grid-template-columns: 280px repeat(4, 1fr);
  gap: 48px;
  margin-bottom: 64px;
}

.footer-brand .logo-name { color: white; }
.footer-brand .logo-tagline { color: rgba(255,255,255,0.4); }

.footer-brand-desc {
  font-size: 13.5px;
  line-height: 1.65;
  margin-top: 16px;
  margin-bottom: 24px;
  color: rgba(255,255,255,0.5);
}

.footer-social {
  display: flex;
  gap: 8px;
}

.social-link {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  transition: all var(--transition-fast);
}
.social-link:hover { background: rgba(99,102,241,0.3); color: white; border-color: rgba(99,102,241,0.5); }

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 13.5px;
  color: rgba(255,255,255,0.5);
  transition: color var(--transition-fast);
}
.footer-link:hover { color: rgba(255,255,255,0.9); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy { font-size: 13px; color: rgba(255,255,255,0.4); }
.footer-bottom-links { display: flex; gap: 24px; }
.footer-bottom-link { font-size: 13px; color: rgba(255,255,255,0.4); transition: color var(--transition-fast); }
.footer-bottom-link:hover { color: rgba(255,255,255,0.7); }

/* ============================================================
   GENERATOR PAGE LAYOUT
   ============================================================ */
.generator-page {
  min-height: 100vh;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  padding-top: var(--header-height);
}

/* Toolbar */
.generator-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 200;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  padding: 0 20px;
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border-default);
  margin: 0 4px;
  flex-shrink: 0;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.toolbar-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.toolbar-btn.btn-primary-toolbar {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-brand);
}

.toolbar-btn.btn-primary-toolbar:hover { transform: translateY(-1px); }

.toolbar-btn svg, .toolbar-btn i { font-size: 15px; }

/* Currency & Template Selects */
.toolbar-select {
  height: 34px;
  padding: 0 28px 0 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 8px center;
  background-size: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  min-width: 100px;
}
.toolbar-select:focus { outline: none; border-color: var(--border-focus); }

/* Color Swatches */
.color-swatch-picker {
  display: flex;
  align-items: center;
  gap: 5px;
}

.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.color-swatch.active, .color-swatch:hover {
  border-color: var(--text-primary);
  transform: scale(1.2);
}

.color-swatch-custom {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px dashed var(--border-medium);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  transition: all var(--transition-fast);
}
.color-swatch-custom:hover { border-color: var(--brand-primary); }

/* Autosave indicator */
.autosave-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.autosave-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-success);
}

.autosave-dot.saving { background: var(--brand-warning); animation: spin 1s linear infinite; }

/* Generator Body */
.generator-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--header-height) - var(--toolbar-height));
  overflow: hidden;
}

/* Editor Panel */
.editor-panel {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-default);
  overflow-y: auto;
  height: calc(100vh - var(--header-height) - var(--toolbar-height));
  position: sticky;
  top: calc(var(--header-height) + var(--toolbar-height));
}

.editor-panel::-webkit-scrollbar { width: 4px; }
.editor-panel::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }

/* Progress Steps */
.progress-steps {
  display: flex;
  padding: 16px 20px;
  gap: 0;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  cursor: pointer;
}

.progress-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 60%;
  width: 80%;
  height: 2px;
  background: var(--border-default);
}

.progress-step.completed:not(:last-child)::after { background: var(--brand-primary); }

.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-primary);
  position: relative;
  z-index: 1;
  transition: all var(--transition-base);
}

.progress-step.active .step-dot {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: white;
}

.progress-step.completed .step-dot {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: white;
}

.step-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.progress-step.active .step-label { color: var(--brand-primary); }
.progress-step.completed .step-label { color: var(--brand-primary); }

/* Preset Selector */
.preset-bar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.preset-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.preset-scroll::-webkit-scrollbar { display: none; }

.preset-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-default);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.preset-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: rgba(99,102,241,0.06); }
.preset-chip.active { border-color: var(--brand-primary); color: var(--brand-primary); background: rgba(99,102,241,0.1); }

/* Form Sections */
.form-section {
  border-bottom: 1px solid var(--border-light);
}

.form-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.form-section-header:hover { background: var(--bg-tertiary); }

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-section-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(99,102,241,0.1);
  color: var(--brand-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.form-section-chevron {
  color: var(--text-muted);
  font-size: 13px;
  transition: transform var(--transition-base);
}

.form-section.open .form-section-chevron { transform: rotate(180deg); }

.form-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
  padding: 0 20px;
}

.form-section.open .form-section-body {
  max-height: 3000px;
  padding-bottom: 20px;
}

/* Form Controls */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: all var(--transition-fast);
  font-family: inherit;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 70px; line-height: 1.5; }

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  padding-right: 28px;
  cursor: pointer;
}

/* Input with icon */
.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.input-with-icon .form-input { padding-left: 32px; }

/* Logo Upload */
.logo-upload-area {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}

.logo-upload-area:hover { border-color: var(--brand-primary); background: rgba(99,102,241,0.04); }
.logo-upload-area.drag-over { border-color: var(--brand-primary); background: rgba(99,102,241,0.08); }

.logo-upload-icon { font-size: 32px; margin-bottom: 10px; }
.logo-upload-text { font-size: 13px; color: var(--text-secondary); }
.logo-upload-subtext { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.logo-preview-container {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

.logo-preview-img {
  width: 60px; height: 60px;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid var(--border-default);
  padding: 4px;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 40px; height: 22px;
  flex-shrink: 0;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-medium);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  left: 2.5px; top: 2.5px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider { background: var(--brand-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Line Items Table */
.line-items-header {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1fr 0.7fr 0.7fr 40px;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.line-item-col-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.line-item-row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1fr 0.7fr 0.7fr 40px;
  gap: 6px;
  margin-bottom: 8px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 10px;
  transition: box-shadow var(--transition-fast);
}

.line-item-row:hover { box-shadow: var(--shadow-sm); }

.line-item-row .form-input {
  padding: 7px 9px;
  font-size: 12.5px;
}

.line-item-total {
  padding: 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  display: flex;
  align-items: center;
}

.btn-remove-item {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.08);
  color: var(--brand-danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-remove-item:hover { background: rgba(239,68,68,0.18); }

.btn-add-item {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-add-item:hover { border-color: var(--brand-primary); background: rgba(99,102,241,0.05); }

/* Totals Summary */
.totals-area {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 12px;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
}

.total-row:last-child { border-bottom: none; }
.total-row.grand { background: var(--bg-tertiary); font-weight: 700; font-size: 15px; }
.total-label { color: var(--text-secondary); }
.total-value { font-weight: 600; color: var(--text-primary); }
.total-row.grand .total-value { color: var(--brand-primary); font-size: 17px; }

/* Preview Panel */
.preview-panel {
  flex: 1;
  background: var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  padding: 16px 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preview-zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.preview-zoom-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.preview-zoom-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

.preview-zoom-level {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

.preview-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 40px 32px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.preview-scroll-area::-webkit-scrollbar { width: 6px; }
.preview-scroll-area::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 6px; }

/* Mobile Tab Switcher */
.mobile-tab-bar {
  display: none;
  position: sticky;
  top: calc(var(--header-height) + var(--toolbar-height));
  z-index: 199;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-default);
  padding: 8px 16px;
}

.mobile-tabs {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.mobile-tab {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mobile-tab.active { background: var(--bg-primary); color: var(--brand-primary); box-shadow: var(--shadow-sm); }

/* ============================================================
   RECEIPT PREVIEW DOCUMENT STYLES
   ============================================================ */
.receipt-document {
  width: 794px; /* A4 at 96dpi */
  min-height: 1000px;
  background: white;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: transform var(--transition-base);
  transform-origin: top center;
}

[data-theme="dark"] .receipt-document { background: white; color: #111; }

/* Watermark */
.receipt-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-35deg);
  font-size: 80px;
  font-weight: 900;
  color: rgba(99,102,241,0.06);
  pointer-events: none;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  z-index: 0;
}

/* Template: Classic */
.receipt-doc-classic {
  font-family: 'Georgia', serif;
  color: #1a1a1a;
}

.receipt-doc-classic .doc-header {
  background: #1a1a1a;
  color: white;
  padding: 40px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* Template: Modern */
.receipt-doc-modern {
  font-family: 'Inter', sans-serif;
  color: #111827;
}

.receipt-doc-modern .doc-header {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  padding: 40px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* Template: Minimal */
.receipt-doc-minimal {
  font-family: 'Inter', sans-serif;
  color: #111827;
}

.receipt-doc-minimal .doc-header {
  padding: 40px 48px;
  border-bottom: 3px solid #111827;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* Template: Bold */
.receipt-doc-bold {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #0f172a;
}

.receipt-doc-bold .doc-header {
  background: #0f172a;
  padding: 40px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* Template: Elegant */
.receipt-doc-elegant {
  font-family: 'Georgia', serif;
  color: #1e293b;
}

.receipt-doc-elegant .doc-header {
  background: linear-gradient(135deg, #1e293b, #334155);
  color: white;
  padding: 40px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

/* Shared Doc Styles */
.doc-header { position: relative; z-index: 1; }

.doc-logo {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
}

.doc-logo-text {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.doc-title-block { text-align: right; }
.doc-receipt-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.doc-receipt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.doc-body { padding: 36px 48px; position: relative; z-index: 1; }

.doc-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.doc-meta-block { }
.doc-meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6b7280;
  margin-bottom: 8px;
}

.doc-meta-content { font-size: 13.5px; color: #374151; line-height: 1.6; }
.doc-meta-content strong { font-weight: 700; color: #111827; }

.doc-meta-table { }
.doc-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}
.doc-meta-row:last-child { border-bottom: none; }
.doc-meta-row-key { color: #6b7280; }
.doc-meta-row-val { font-weight: 600; color: #111827; }

/* Status Badge */
.doc-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.doc-status.paid { background: #d1fae5; color: #065f46; }
.doc-status.unpaid { background: #fee2e2; color: #991b1b; }
.doc-status.partial { background: #fef3c7; color: #92400e; }
.doc-status.draft { background: #f3f4f6; color: #4b5563; }

/* PAID Stamp */
.paid-stamp {
  position: absolute;
  top: 40px;
  right: 48px;
  width: 100px;
  height: 100px;
  border: 4px solid #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 2px;
  transform: rotate(-15deg);
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
}

/* Items Table */
.doc-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 32px;
}

.doc-items-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  background: #1f2937;
}

.doc-items-table td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.doc-items-table tbody tr:last-child td { border-bottom: none; }
.doc-items-table tbody tr:nth-child(even) td { background: #f9fafb; }

/* Totals */
.doc-totals {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}

.doc-totals-table {
  min-width: 280px;
}

.doc-total-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13.5px;
  border-bottom: 1px solid #f3f4f6;
}
.doc-total-row:last-child { border-bottom: none; }
.doc-total-key { color: #6b7280; }
.doc-total-val { font-weight: 600; color: #111827; }
.doc-total-row.grand {
  border-top: 2px solid #1f2937;
  border-bottom: 2px solid #1f2937;
  padding: 10px 0;
  margin-top: 4px;
}
.doc-total-row.grand .doc-total-key { font-weight: 700; font-size: 15px; color: #111827; }
.doc-total-row.grand .doc-total-val { font-size: 18px; font-weight: 900; }
.doc-total-row.amount-paid { background: #d1fae5; border-radius: 6px; padding: 8px 10px; }
.doc-total-row.balance { }

/* Payment Block */
.doc-payment-block {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 28px;
  background: #f9fafb;
}

.doc-payment-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
  margin-bottom: 14px;
}

.doc-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.doc-payment-item {}
.doc-payment-item-label { font-size: 11px; color: #9ca3af; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.doc-payment-item-val { font-size: 13.5px; color: #111827; font-weight: 600; margin-top: 2px; }

/* Signature & QR */
.doc-signature-qr {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
}

.doc-signature-block {
  text-align: center;
  min-width: 160px;
}
.doc-signature-line {
  border-top: 1.5px solid #d1d5db;
  margin-bottom: 6px;
  margin-top: 40px;
}
.doc-signature-name { font-size: 12px; color: #6b7280; }

.doc-qr-block {
  text-align: center;
}
.doc-qr-img {
  width: 80px; height: 80px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px;
  background: white;
}
.doc-qr-label { font-size: 10px; color: #9ca3af; margin-top: 6px; }

/* Notes & Footer */
.doc-notes {
  background: #f9fafb;
  border-left: 3px solid #6366f1;
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 24px;
}
.doc-notes-title { font-size: 12px; font-weight: 700; color: #374151; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.doc-notes-text { font-size: 13px; color: #6b7280; line-height: 1.6; }

.doc-thankyou {
  text-align: center;
  padding: 20px;
  font-size: 15px;
  font-weight: 600;
  color: #4b5563;
  border-top: 1px solid #f3f4f6;
}

.doc-verification {
  text-align: center;
  padding: 12px;
  font-size: 11px;
  color: #9ca3af;
  background: #f9fafb;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(4px);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-base);
}

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

.modal-box-lg { max-width: 760px; }
.modal-box-sm { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--bg-secondary); color: var(--text-primary); }

.modal-body { padding: 28px; }
.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Share Modal */
.share-link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.share-link-url {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  word-break: break-all;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Monaco', 'Consolas', monospace;
}

.share-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-tertiary);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.share-option:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: rgba(99,102,241,0.05); }

/* AI Modal */
.ai-modal-input-area {
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}

.ai-generating-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 0;
}

.spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border-default);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--brand-success); }
.toast-error .toast-icon { color: var(--brand-danger); }
.toast-info .toast-icon { color: var(--brand-primary); }
.toast-warning .toast-icon { color: var(--brand-warning); }

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

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

/* ============================================================
   DASHBOARD
   ============================================================ */
.dashboard-page { padding-top: var(--header-height); min-height: 100vh; }

.dashboard-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 48px 0;
  color: white;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.stat-card {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
}

.stat-number {
  font-size: 36px;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat-label { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 4px; }

.dashboard-receipts-list { padding: 40px 0; }

.receipt-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-fast);
  margin-bottom: 12px;
}

.receipt-list-item:hover { box-shadow: var(--shadow-md); border-color: rgba(99,102,241,0.2); }

.receipt-list-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(99,102,241,0.05));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.receipt-list-info { flex: 1; min-width: 0; }
.receipt-list-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.receipt-list-meta { font-size: 12.5px; color: var(--text-muted); }
.receipt-list-amount { font-size: 17px; font-weight: 800; color: var(--text-primary); }
.receipt-list-actions { display: flex; gap: 6px; }

/* Filters */
.filter-tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 3px;
  width: fit-content;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-tab.active { background: var(--bg-primary); color: var(--brand-primary); box-shadow: var(--shadow-sm); }

/* ============================================================
   LANDING / SEO PAGES
   ============================================================ */
.page-hero {
  padding: calc(var(--header-height) + 60px) 0 60px;
  background: var(--bg-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb-sep { color: var(--border-medium); }
.breadcrumb-current { color: var(--text-secondary); font-weight: 500; }

.content-body {
  max-width: 780px;
  margin: 0 auto;
}

.content-body h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 40px 0 16px;
  letter-spacing: -0.5px;
}

.content-body h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
}

.content-body p {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.content-body ul, .content-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.content-body li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Scroll Top */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-base);
  z-index: 900;
  border: none;
  font-size: 18px;
}
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); }
.scroll-top-btn:hover { background: var(--brand-primary-dark); transform: translateY(-2px); }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header, .generator-toolbar, .editor-panel,
  .preview-header, .scroll-top-btn, .toast-container,
  .mobile-tab-bar, .preview-zoom-controls { display: none !important; }
  
  .generator-body { display: block; }
  .preview-panel { width: 100%; overflow: visible; height: auto; }
  .preview-scroll-area { padding: 0; overflow: visible; }
  
  .receipt-document {
    box-shadow: none;
    border-radius: 0;
    width: 100%;
    transform: none !important;
  }
  
  body { background: white; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  :root { --sidebar-width: 380px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .receipt-types-grid { grid-template-columns: repeat(3, 1fr); }
  .templates-scroll { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 220px repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-width: 340px; }
  .receipt-types-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .templates-scroll { grid-template-columns: repeat(3, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
  .header-nav { display: none; }
  .mobile-menu-btn { display: flex; }
}

@media (max-width: 768px) {
  :root { --toolbar-height: auto; }
  
  .generator-toolbar { 
    height: auto;
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .toolbar-group { flex-wrap: wrap; }
  
  .generator-body { flex-direction: column; }
  .editor-panel { 
    width: 100%; 
    height: auto; 
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-default);
  }
  
  .preview-panel { height: auto; }
  .preview-scroll-area { padding: 20px 12px; }
  .receipt-document { width: 100%; min-width: 0; }
  
  .mobile-tab-bar { display: block; }
  
  .features-grid { grid-template-columns: 1fr; }
  .receipt-types-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-scroll { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 420px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero-stats { gap: 24px; }
  .hero-stat-divider { display: none; }
  .cta-section { padding: 48px 28px; margin: 0 12px; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .line-items-header { display: none; }
  .line-item-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .share-options { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .receipt-types-grid { grid-template-columns: 1fr 1fr; }
  .templates-scroll { grid-template-columns: 1fr 1fr; }
  .hero-title { letter-spacing: -1px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr; }
  .receipt-list-item { flex-wrap: wrap; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in { animation: fadeIn 0.4s ease both; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease both; }
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Visible when scrolled into view */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
