/* ============================================================
   OnlineInvoicesMaker.com — Generator Page Styles
   Premium invoice builder UI
   ============================================================ */

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

/* Top Toolbar */
.generator-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: var(--z-sticky);
  background: var(--bg-overlay);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-card);
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.generator-toolbar::-webkit-scrollbar { display: none; }

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-card);
  flex-shrink: 0;
  margin: 0 4px;
}
.toolbar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.toolbar-spacer { flex: 1; min-width: 8px; }

/* Toolbar Button */
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.toolbar-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-card);
}
.toolbar-btn.active {
  background: var(--brand-primary-ultra-light);
  color: var(--brand-primary);
  border-color: rgba(99,102,241,0.2);
}
.toolbar-btn.primary {
  background: var(--brand-primary);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.toolbar-btn.primary:hover {
  background: var(--brand-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.toolbar-btn.success {
  background: var(--brand-success);
  color: white;
  border-color: transparent;
}
.toolbar-btn.success:hover {
  background: #059669;
  transform: translateY(-1px);
}
.toolbar-btn-icon { font-size: 14px; }

/* Color Swatches in Toolbar */
.color-swatches {
  display: flex;
  align-items: center;
  gap: 5px;
}
.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  position: relative;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}
.color-swatch.active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: white;
  font-weight: 900;
}

/* Template Selector in Toolbar */
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1.5px solid transparent;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  white-space: nowrap;
}
.template-chip:hover { background: var(--bg-secondary); color: var(--text-secondary); }
.template-chip.active {
  background: var(--brand-primary-ultra-light);
  color: var(--brand-primary);
  border-color: rgba(99,102,241,0.3);
}

/* Progress Steps */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 12px 20px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.progress-steps::-webkit-scrollbar { display: none; }
.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 700;
  background: var(--bg-card);
  border: 2px solid var(--border-card);
  color: var(--text-subtle);
  transition: all var(--transition-base);
  cursor: pointer;
  flex-shrink: 0;
}
.step-text {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-subtle);
  white-space: nowrap;
  transition: color var(--transition-base);
}
.progress-step.active .step-indicator {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}
.progress-step.active .step-text { color: var(--brand-primary); }
.progress-step.done .step-indicator {
  background: var(--brand-success);
  border-color: var(--brand-success);
  color: white;
}
.progress-step.done .step-text { color: var(--brand-success); }
.step-connector {
  width: 28px;
  height: 2px;
  background: var(--border-card);
  border-radius: 2px;
  flex-shrink: 0;
  transition: background var(--transition-base);
}
.step-connector.done { background: var(--brand-success); }

/* Quick Presets Strip */
.presets-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-primary);
  overflow-x: auto;
  scrollbar-width: none;
}
.presets-strip::-webkit-scrollbar { display: none; }
.preset-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-subtle);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.preset-btn:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(99,102,241,0.2);
}

/* ============================================================
   TWO COLUMN LAYOUT
   ============================================================ */
.generator-body {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--header-height) - var(--toolbar-height));
  align-items: start;
}

/* LEFT PANEL — Form */
.form-panel {
  position: sticky;
  top: calc(var(--header-height) + var(--toolbar-height));
  height: calc(100vh - var(--header-height) - var(--toolbar-height));
  overflow-y: auto;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-card);
  scrollbar-width: thin;
}
.form-panel::-webkit-scrollbar { width: 4px; }
.form-panel::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }
[data-theme="dark"] .form-panel::-webkit-scrollbar-thumb { background: var(--gray-700); }

.form-panel-inner { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

/* RIGHT PANEL — Preview */
.preview-panel {
  background: var(--bg-secondary);
  padding: 24px;
  min-height: calc(100vh - var(--header-height) - var(--toolbar-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 820px;
  gap: 12px;
}
.preview-toolbar-left { display: flex; align-items: center; gap: 8px; }
.preview-toolbar-right { display: flex; align-items: center; gap: 8px; }
.preview-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.preview-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 3px;
}
.zoom-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-fast);
}
.zoom-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.zoom-value {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
}

/* Invoice Paper */
.invoice-wrapper {
  width: 100%;
  max-width: 820px;
  transform-origin: top center;
  transition: transform var(--transition-base);
}
.invoice-paper {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.04),
    0 4px 8px rgba(0,0,0,0.04),
    0 16px 40px rgba(0,0,0,0.08);
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .invoice-paper {
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    0 4px 8px rgba(0,0,0,0.3),
    0 16px 40px rgba(0,0,0,0.4);
}

/* ============================================================
   FORM SECTION CARDS
   ============================================================ */
.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}
.form-section:focus-within {
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}
.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
  gap: 10px;
}
.form-section-header:hover { background: var(--bg-secondary); }
.form-section-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.form-section-icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-md);
  background: var(--brand-primary-ultra-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand-primary);
  font-size: 14px;
  flex-shrink: 0;
}
.form-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.form-section-subtitle {
  font-size: var(--text-xs);
  color: var(--text-subtle);
  margin-top: 1px;
}
.form-section-chevron {
  color: var(--text-subtle);
  font-size: 12px;
  transition: transform var(--transition-base);
  flex-shrink: 0;
}
.form-section.collapsed .form-section-chevron { transform: rotate(-90deg); }
.form-section-body {
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-section.collapsed .form-section-body { display: none; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Logo Upload */
.logo-upload-area {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.logo-upload-area:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-ultra-light);
}
.logo-upload-area.has-logo {
  border-style: solid;
  border-color: var(--border-card);
  padding: 12px;
}
.logo-upload-input { display: none; }
.logo-preview {
  max-height: 72px;
  max-width: 200px;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.logo-upload-icon { font-size: 28px; color: var(--text-subtle); margin-bottom: 8px; }
.logo-upload-text { font-size: var(--text-xs); color: var(--text-muted); }
.logo-upload-text strong { color: var(--brand-primary); }

/* Signature Canvas */
.signature-area {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--bg-input);
}
.signature-canvas { width: 100%; height: 120px; cursor: crosshair; display: block; }
.signature-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-card);
}
.signature-hint { font-size: var(--text-xs); color: var(--text-subtle); }

/* Line Items Table */
.line-items-table {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-card);
}
.line-items-header {
  display: grid;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-card);
  padding: 8px 10px;
  gap: 8px;
}
.line-items-header span {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.line-item-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border-secondary);
  align-items: start;
  position: relative;
  transition: background var(--transition-fast);
}
.line-item-row:last-child { border-bottom: none; }
.line-item-row:hover { background: var(--bg-secondary); }
.line-item-row.gst-mode { grid-template-columns: 2.5fr 0.7fr 0.9fr 0.8fr 0.8fr 28px; }
.line-item-row:not(.gst-mode) { grid-template-columns: 2.5fr 0.7fr 0.9fr 0.8fr 28px; }
.line-items-header.gst-mode { grid-template-columns: 2.5fr 0.7fr 0.9fr 0.8fr 0.8fr 28px; }
.line-items-header:not(.gst-mode) { grid-template-columns: 2.5fr 0.7fr 0.9fr 0.8fr 28px; }

.item-input {
  width: 100%;
  padding: 7px 9px;
  font-size: var(--text-xs);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}
.item-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
.item-total {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-secondary);
  padding: 7px 2px;
  text-align: right;
}
.item-delete {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 6px;
}
.item-delete:hover { background: #fee2e2; color: var(--brand-danger); }

.add-item-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-top: 1px solid var(--border-secondary);
  width: 100%;
  text-align: left;
}
.add-item-btn:hover { background: var(--brand-primary-ultra-light); }

/* AI Description Button */
.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: #7c3aed;
  background: #f3e8ff;
  border: 1px solid #ddd6fe;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.ai-btn:hover { background: #7c3aed; color: white; }
[data-theme="dark"] .ai-btn { background: #3b1f6e; color: #c4b5fd; border-color: #5b21b6; }

/* Totals Section */
.totals-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}
.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.total-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}
.total-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
}
.total-row.grand {
  border-top: 2px solid var(--border-card);
  padding-top: 10px;
  margin-top: 4px;
}
.total-row.grand .total-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
}
.total-row.grand .total-value {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
}

/* GST Breakdown */
.gst-breakdown {
  background: var(--brand-primary-ultra-light);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.gst-breakdown-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--brand-primary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.gst-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  padding: 3px 0;
}
.gst-row strong { color: var(--text-primary); }

/* Voice Input */
.voice-input-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  font-size: 13px;
  flex-shrink: 0;
}
.voice-input-btn:hover { color: var(--brand-primary); border-color: var(--brand-primary); background: var(--brand-primary-ultra-light); }
.voice-input-btn.listening {
  color: var(--brand-danger);
  border-color: var(--brand-danger);
  background: #fee2e2;
  animation: pulse-brand 1s infinite;
}

.input-with-action {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.input-with-action .form-input { flex: 1; }

/* QR Code */
.qr-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
}
.qr-code-img {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  background: white;
  padding: 6px;
}
.qr-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

/* ============================================================
   MOBILE TAB SWITCHER
   ============================================================ */
.mobile-tab-switcher {
  display: none;
  position: sticky;
  top: calc(var(--header-height) + var(--toolbar-height));
  z-index: calc(var(--z-sticky) - 1);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-card);
  padding: 0 16px;
}
.mobile-tabs {
  display: flex;
  gap: 0;
}
.mobile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  user-select: none;
}
.mobile-tab:hover { color: var(--text-primary); }
.mobile-tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

/* ============================================================
   TEMPLATE PREVIEW MODAL
   ============================================================ */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.template-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}
.template-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary);
}
.template-card.active {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
}
.template-card.active::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.template-thumbnail {
  width: 100%;
  height: 140px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.template-thumbnail-inner {
  width: 80%;
  height: 85%;
  transform-origin: top center;
  transform: scale(0.7);
}
.template-card-footer {
  padding: 8px 10px;
  border-top: 1px solid var(--border-card);
}
.template-card-name {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
}
.template-card-desc {
  font-size: 10px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* ============================================================
   SHARE MODAL
   ============================================================ */
.share-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.share-link-text {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.share-option {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
}
.share-option:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-ultra-light);
  transform: translateY(-2px);
}
.share-option-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.share-option-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Saved Invoices Panel */
.saved-panel {
  position: fixed;
  top: var(--header-height);
  right: -380px;
  width: 360px;
  height: calc(100vh - var(--header-height));
  background: var(--bg-modal);
  border-left: 1px solid var(--border-card);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-sticky);
  transition: right var(--transition-slow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.saved-panel.open { right: 0; }
.saved-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.saved-panel-title {
  font-size: var(--text-base);
  font-weight: 700;
}
.saved-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.saved-invoice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 8px;
  border: 1px solid var(--border-card);
}
.saved-invoice-card:hover {
  background: var(--brand-primary-ultra-light);
  border-color: rgba(99,102,241,0.2);
}
.saved-invoice-icon {
  width: 40px; height: 40px;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 16px;
  flex-shrink: 0;
}
.saved-invoice-info { flex: 1; min-width: 0; }
.saved-invoice-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-invoice-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}
.saved-invoice-amount {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* AI Modal */
.ai-modal-header-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 22px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(124,58,237,0.3);
}
.ai-output-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 60px;
  white-space: pre-wrap;
}
.ai-generating {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.ai-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--brand-primary);
  border-radius: 50%;
  animation: aiBounce 1.2s infinite ease-in-out;
}
.ai-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   RESPONSIVE — GENERATOR
   ============================================================ */
@media (max-width: 1100px) {
  :root { --sidebar-width: 360px; }
}
@media (max-width: 900px) {
  .generator-body {
    grid-template-columns: 1fr;
  }
  .form-panel {
    position: static;
    height: auto;
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid var(--border-card);
    display: none;
  }
  .form-panel.mobile-active { display: block; }
  .preview-panel { display: none; }
  .preview-panel.mobile-active { display: flex; }
  .mobile-tab-switcher { display: block; }
  .progress-steps { padding: 10px 16px 0; }
  .presets-strip { padding: 8px 16px; }
}
@media (max-width: 600px) {
  .generator-toolbar { padding: 0 12px; gap: 6px; }
  .toolbar-label { display: none; }
  .preview-panel { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}
