/* ============================================================
   INVOICE GENERATOR — STYLE.CSS
   Design: Premium SaaS · Notion meets Stripe Dashboard
   ============================================================ */

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

:root {
  --bg: #f8fafc;
  --sidebar: #1e293b;
  --accent: #6366f1;
  --accent-light: #eef2ff;
  --emerald: #10b981;
  --invoice-bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.06);
  --transition: 180ms ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* --- Utilities --- */
.hidden { display: none !important; }

/* ============================================================
   RESUME BANNER
   ============================================================ */
.resume-banner {
  background: var(--accent);
  color: #fff;
  padding: 12px 24px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 300ms ease;
}
.resume-banner.show { transform: translateY(0); }
.resume-banner-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.resume-actions { display: flex; gap: 8px; }
.btn-resume-yes, .btn-resume-no {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn-resume-yes { background: #fff; color: var(--accent); }
.btn-resume-yes:hover { background: #f0f0ff; }
.btn-resume-no { background: rgba(255,255,255,.2); color: #fff; }
.btn-resume-no:hover { background: rgba(255,255,255,.3); }

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  background: var(--sidebar);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1;
}
.logo-iwf {
  color: #fff;
  font-weight: 700;
}
.logo-inv {
  color: #818cf8;
  font-weight: 700;
}
.logo-badge {
  background: var(--emerald);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #5254cc; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.btn-secondary {
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.15);
}
.btn-secondary:hover { background: rgba(255,255,255,.18); }
.btn-danger-ghost {
  background: transparent;
  color: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.10);
}
.btn-danger-ghost:hover { color: #fca5a5; border-color: #fca5a5; background: rgba(239,68,68,.12); }

/* Pulse animation for download button */
.btn-pulse {
  position: relative;
}
.btn-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pulse-ring 2.5s ease-out infinite;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.15); opacity: 0; }
}

/* ============================================================
   APP LAYOUT — TWO COLUMN
   ============================================================ */
.app-layout {
  max-width: 1500px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
  align-items: start;
}

/* ============================================================
   LEFT PANEL — FORM
   ============================================================ */
.form-panel {
  padding: 20px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.form-panel::-webkit-scrollbar { width: 4px; }
.form-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}

/* --- Form Sections --- */
.form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-header svg { color: var(--accent); }
.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* --- Form Elements --- */
.form-row { margin-bottom: 10px; }
.form-row:last-child { margin-bottom: 0; }
.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.form-input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-input::placeholder { color: #c4cdd6; }
.form-textarea { resize: vertical; min-height: 56px; }
.form-select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* --- Logo Upload --- */
.logo-upload-area {
  border: 2px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}
.logo-upload-area:hover { border-color: var(--accent); background: var(--accent-light); }
.logo-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  width: 100%;
  height: 100%;
}
.logo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.logo-upload-placeholder svg { color: var(--border); }
.logo-upload-placeholder small { font-size: 11px; color: #94a3b8; }
.logo-preview-wrap {
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 64px;
}
.logo-preview-wrap img { max-height: 60px; max-width: 180px; object-fit: contain; }
.logo-remove-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

/* --- Template Selector --- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.template-thumb {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px 6px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.template-thumb:hover { border-color: var(--accent); color: var(--accent); }
.template-thumb.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.tmpl-preview {
  width: 100%;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
  background: #f1f5f9;
  position: relative;
}
.tp-header {
  height: 14px;
  background: var(--border);
  margin-bottom: 4px;
}
.tp-header.filled { background: var(--accent); }
.tp-header.minimal-hdr { background: transparent; border-bottom: 2px solid var(--accent); height: 12px; }
.tp-lines { padding: 0 6px; display: flex; flex-direction: column; gap: 3px; }
.tp-line { height: 4px; background: #cbd5e1; border-radius: 2px; }
.tp-line.short { width: 60%; }
.tp-lines.no-border .tp-line { background: #e2e8f0; }

/* --- Color Swatches --- */
.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 3px var(--accent); }

/* --- Line Items (card layout) --- */
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.sortable-ghost { opacity: 0.4; background: var(--accent-light); }

.line-item-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
  animation: slide-in 150ms ease;
}

.line-item-description {
  margin-bottom: 12px;
}

.line-item-description label,
.line-item-qty label,
.line-item-rate label,
.line-item-amount label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 4px;
}

.description-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
  background: white;
  box-sizing: border-box;
}
.description-input:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.line-item-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: end;
}

.qty-input,
.rate-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #0f172a;
  background: white;
  box-sizing: border-box;
}
.qty-input:focus,
.rate-input:focus {
  border-color: #6366f1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.amount-display {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  padding-bottom: 10px;
}

.line-item-delete {
  position: absolute;
  top: 12px;
  right: 12px;
}

.delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  font-family: inherit;
}
.delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.add-item-btn {
  width: 100%;
  padding: 12px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: none;
  color: #6366f1;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s;
}
.add-item-btn:hover {
  border-color: #6366f1;
  background: #f5f3ff;
}

/* --- Toggles --- */
.toggle-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}
.toggle-checkbox { display: none; }
.toggle-switch {
  width: 36px; height: 20px;
  background: #cbd5e1;
  border-radius: 10px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}
.toggle-switch::after {
  content: '';
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 3px; left: 3px;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-checkbox:checked + .toggle-switch { background: var(--accent); }
.toggle-checkbox:checked + .toggle-switch::after { transform: translateX(16px); }
.toggle-content {
  padding: 12px 0 4px;
  animation: fade-in 150ms ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Tax Info Box */
.tax-info-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #92400e;
  margin-bottom: 10px;
  line-height: 1.6;
}
.tax-info-box a { color: #d97706; font-weight: 600; }

/* ============================================================
   RIGHT PANEL — PREVIEW
   ============================================================ */
.preview-panel {
  padding: 20px;
  background: #eef2f7;
}
.preview-sticky {
  position: sticky;
  top: 80px;
}
.preview-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: #22c55e;
  border-radius: 50%;
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}
.preview-scale-wrap {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ============================================================
   INVOICE PREVIEW STYLES
   ============================================================ */
.invoice-preview {
  background: #fff;
  font-family: 'Inter', sans-serif;
  color: #0f172a;
  padding: 48px;
  min-height: 900px;
  position: relative;
  transition: all 250ms ease;
}

/* --- Invoice Header --- */
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  gap: 20px;
}
.inv-from { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prev-logo-wrap { margin-bottom: 8px; }
.prev-logo-wrap img { max-height: 80px; max-width: 200px; object-fit: contain; }
.prev-biz-name {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.prev-detail {
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  white-space: pre-line;
}
.inv-title-block {
  text-align: right;
  flex-shrink: 0;
}
.inv-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  margin-bottom: 12px;
  transition: color 200ms;
}
.inv-meta { display: flex; flex-direction: column; gap: 4px; }
.inv-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
}
.inv-meta-label { color: #64748b; }
.inv-meta-value { font-weight: 600; color: #0f172a; }

/* --- Bill To --- */
.inv-bill-to {
  margin-bottom: 32px;
}
.inv-bill-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
  transition: color 200ms;
}
.prev-client-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* --- Line Items Table --- */
.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13px;
}
.inv-table thead tr {
  background: var(--accent);
  transition: background 200ms;
}
.inv-table thead th {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
}
.inv-table .col-qty,
.inv-table .col-rate,
.inv-table .col-amt { text-align: right; }
.inv-table tbody tr { transition: background var(--transition); }
.inv-table tbody tr:nth-child(even) { background: #f8fafc; }
.inv-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.inv-table tbody td.col-qty,
.inv-table tbody td.col-rate,
.inv-table tbody td.col-amt { text-align: right; }

/* --- Totals --- */
.inv-totals-wrap {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 32px;
}
.inv-totals {
  width: 260px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
}
.inv-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}
.inv-total-row + .inv-total-row { border-top: 1px solid var(--border); }
.inv-total-label { color: #64748b; font-weight: 500; }
.inv-total-value { font-weight: 600; color: #0f172a; }
.discount-value { color: #10b981; }
.inv-grand-total {
  border-top: 2px solid var(--accent) !important;
  margin-top: 4px;
  padding-top: 10px !important;
}
.inv-grand-total .inv-total-label {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.grand-total-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  transition: color 200ms;
}

/* --- Notes & Footer --- */
.inv-footer-section { margin-bottom: 32px; }
.inv-notes-block { display: flex; flex-direction: column; gap: 16px; }
.inv-notes-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
  transition: color 200ms;
}
.inv-footer {
  text-align: center;
  font-size: 10px;
  color: #c4cdd6;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 24px;
}

/* ============================================================
   TEMPLATE VARIATIONS
   ============================================================ */

/* Classic: default (above) */

/* Modern: filled header block */
.template-modern .inv-header {
  background: var(--accent);
  margin: -48px -48px 40px;
  padding: 36px 48px;
  border-radius: 0;
  color: #fff;
  transition: background 200ms;
}
.template-modern .prev-biz-name { color: #fff; }
.template-modern .prev-detail { color: rgba(255,255,255,.75); }
.template-modern .inv-title { color: rgba(255,255,255,.9); }
.template-modern .inv-meta-label { color: rgba(255,255,255,.65); }
.template-modern .inv-meta-value { color: #fff; }

/* Minimal: no borders, thin lines */
.template-minimal .inv-table thead tr { background: transparent; }
.template-minimal .inv-table thead th {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  background: transparent;
  transition: color 200ms, border-color 200ms;
}
.template-minimal .inv-table tbody tr:nth-child(even) { background: transparent; }
.template-minimal .inv-table tbody td { border-bottom: 1px solid #f1f5f9; }
.template-minimal .inv-totals { background: transparent; border-top: 2px solid var(--accent); border-radius: 0; padding: 12px 0; transition: border-color 200ms; }
.template-minimal .inv-bill-to { border-left: 3px solid var(--accent); padding-left: 12px; transition: border-color 200ms; }

/* ============================================================
   SEO SECTION
   ============================================================ */
.seo-section {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 60px 20px;
}
.seo-inner {
  max-width: 800px;
  margin: 0 auto;
}
.seo-col h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  margin-top: 40px;
}
.seo-col h2:first-child { margin-top: 0; }
.seo-col p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 16px;
}

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background var(--transition);
}
.faq-item summary:hover { background: var(--bg); }
.faq-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--accent);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 0;
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--sidebar);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 24px 20px;
  font-size: 13px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; }
.site-footer p + p { margin-top: 8px; }
.footer-links a {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body { background: #fff; }
  .site-header,
  .form-panel,
  .resume-banner,
  .preview-label,
  .seo-section,
  .site-footer,
  .ad-slot { display: none !important; }
  .app-layout {
    display: block;
    max-width: 100%;
    margin: 0;
  }
  .preview-panel {
    padding: 0;
    background: #fff;
  }
  .preview-sticky { position: static; }
  .preview-scale-wrap {
    box-shadow: none;
    border-radius: 0;
  }
  .invoice-preview { padding: 32px; }
  @page { margin: 0; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .form-panel {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .preview-sticky { position: static; }
  .invoice-preview { padding: 24px; }
  .inv-header { flex-direction: column; gap: 16px; }
  .inv-title-block { text-align: left; }
  .inv-totals { width: 100%; }
  .header-actions { gap: 6px; }
  .btn { padding: 7px 12px; font-size: 12px; }
  .logo-text { font-size: 15px; }
}

@media (max-width: 600px) {
  .header-inner { padding: 0 12px; }
  .form-panel { padding: 12px; }
  .preview-panel { padding: 12px; }
  .invoice-preview { padding: 20px; min-height: auto; }
  .form-row.two-col { grid-template-columns: 1fr; }
  .inv-title { font-size: 24px; }
  .inv-totals { padding: 12px; }
  .inv-table thead th, .inv-table tbody td { padding: 8px; font-size: 12px; }
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  transform: translateY(60px);
  opacity: 0;
  transition: all 300ms ease;
  pointer-events: none;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { border-left: 3px solid var(--emerald); }
.toast.error { border-left: 3px solid var(--danger); }

/* ============================================================
   PREVIEW TOOLBAR & ZOOM CONTROLS
   ============================================================ */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.preview-toolbar .preview-label { margin-bottom: 0; }
.zoom-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 18px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
  padding: 0;
  font-family: inherit;
}
.zoom-btn:hover { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.zoom-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.zoom-level {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-width: 38px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.preview-scale-wrap {
  overflow: auto;
}

/* ============================================================
   INVOICE STATUS BADGE
   ============================================================ */
.inv-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.status-draft  { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; }
.status-sent   { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.status-paid   { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-overdue{ background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ============================================================
   PAID STAMP OVERLAY
   ============================================================ */
.paid-stamp {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 80px;
  font-weight: 900;
  color: rgba(16, 185, 129, 0.22);
  border: 10px solid rgba(16, 185, 129, 0.22);
  padding: 6px 24px;
  border-radius: 10px;
  letter-spacing: 10px;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  white-space: nowrap;
  line-height: 1;
}

/* ============================================================
   PARTIAL PAYMENT — PREVIEW ROWS
   ============================================================ */
.paid-value { color: var(--emerald); font-weight: 600; }
.inv-balance-due {
  border-top: 2px solid var(--danger) !important;
  margin-top: 4px;
  padding-top: 10px !important;
}
.inv-balance-due .inv-total-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}
.balance-due-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
}

/* ============================================================
   AMOUNT IN WORDS
   ============================================================ */
.inv-amount-words {
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 24px;
  line-height: 1.6;
  transition: border-color 200ms;
}
.inv-amount-words em {
  font-style: normal;
  color: var(--text);
  font-weight: 600;
}

/* ============================================================
   QUICK FILL
   ============================================================ */
.quick-fill-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.quick-fill-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-quick-fill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  width: 100%;
}
.btn-quick-fill:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateX(3px);
}

/* Print: hide stamp and words if desired */
@media print {
  .paid-stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-amount-words { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
