/* style.css - Clean, Professional White Theme Online Invoice Generator */

:root {
  /* Clean Corporate Palette */
  --bg-page: #f1f5f9;
  --bg-sheet: #ffffff;
  --border-sheet: #e2e8f0;
  --border-input: #cbd5e1;
  --border-focus: #4f46e5;

  /* Brand Accents */
  --primary-indigo: #4f46e5;
  --primary-hover: #4338ca;
  --success-emerald: #059669;
  --danger-rose: #e11d48;
  
  /* Text */
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Sizing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top App Bar & Navigation */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.app-header .container {
  max-width: 1440px;
  padding: 0 20px;
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  transition: transform 0.2s ease;
}

.brand-title:hover .brand-logo-img {
  transform: scale(1.05);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-nav-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 3px 5px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: #e2e8f0;
  margin: 0 2px;
  flex-shrink: 0;
}

.header-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.save-indicator {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success-emerald);
  opacity: 0;
  transition: opacity 0.3s ease;
  margin-right: 4px;
}

.save-indicator.visible {
  opacity: 1;
}

/* Custom Styled Select Dropdowns (No Native OS Glitches) */
.select-currency {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  height: 34px;
  padding: 0 24px 0 9px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 11px 11px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.select-clean {
  border: 1px solid transparent;
  background-color: transparent;
}

.select-clean:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.select-clean:focus {
  background-color: #ffffff;
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}

.select-currency-compact {
  max-width: 90px;
}

/* Ghost Buttons */
.btn-ghost {
  height: 34px;
  background: transparent;
  color: #475569;
  border: 1px solid transparent;
  padding: 0 10px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-ghost:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Secondary Button */
.btn-secondary {
  height: 34px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0 12px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Primary Hero Button */
.btn-primary {
  height: 34px;
  background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  color: #ffffff;
  border: none;
  padding: 0 15px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.38);
  transform: translateY(-1px);
}

/* Brand Accent Color Swatches in Header */
.color-picker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  padding: 2px 4px;
  height: 34px;
}

.color-swatch-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  outline: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, outline-color 0.15s ease;
  padding: 0;
}

.color-swatch-btn:hover {
  transform: scale(1.2);
}

.color-swatch-btn.active {
  outline: 2px solid var(--primary-indigo);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.color-custom-label {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f1f5f9;
  font-size: 0.75rem;
  margin-left: 2px;
  transition: background 0.15s ease;
}

.color-custom-label:hover {
  background: #e2e8f0;
}

/* Due Date Quick Presets */
.due-presets-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.preset-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-right: 2px;
}

.btn-preset {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-preset:hover {
  background: #eef2ff;
  border-color: var(--primary-indigo);
  color: var(--primary-indigo);
}

/* Payment QR Code Styling */
.qr-code-box {
  margin-top: 6px;
}

.qr-content-flex {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-sheet);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.qr-code-canvas-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  flex-shrink: 0;
}

.qr-code-output {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-output svg, .qr-code-output canvas, .qr-code-output img {
  width: 80px;
  height: 80px;
  display: block;
}

.qr-caption {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.qr-input-wrap {
  flex: 1;
}

/* Ad Placement Containers (Strict Zero CLS) */
.ad-slot-leaderboard {
  min-height: 90px;
  max-width: 728px;
  margin: 16px auto;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot-incontent {
  min-height: 250px;
  max-width: 728px;
  margin: 40px auto;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-label {
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.ad-placeholder-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* The White Paper Invoice Sheet */
.invoice-sheet-wrapper {
  margin: 20px auto 40px;
  display: flex;
  justify-content: center;
}

.invoice-sheet {
  background: var(--bg-sheet);
  border: 1px solid var(--border-sheet);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  width: 100%;
  max-width: 860px;
  padding: 48px;
  position: relative;
  transition: all 0.25s ease;
}

/* ========================================================= */
/* MULTIPLE INVOICE LAYOUTS & TEMPLATES                      */
/* ========================================================= */

/* 1. Classic Corporate Layout */
.invoice-sheet.layout-classic {
  border-top: 8px solid #1e293b;
  border-radius: 4px;
}

.invoice-sheet.layout-classic .invoice-main-title {
  font-family: 'Georgia', serif;
  color: #1e293b;
  letter-spacing: 1px;
}

.invoice-sheet.layout-classic .address-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 16px;
}

.invoice-sheet.layout-classic .items-table th {
  background: #1e293b;
  color: #ffffff;
  border-bottom: none;
}

.invoice-sheet.layout-classic .items-table td {
  border-bottom: 1px solid #e2e8f0;
}

.invoice-sheet.layout-classic .totals-box {
  background: #f8fafc;
  border: 2px solid #1e293b;
}

.invoice-sheet.layout-classic .grand-total-line {
  border-bottom: 3px double #1e293b;
  padding-bottom: 6px;
}

/* 2. Creative Studio Layout */
.invoice-sheet.layout-creative {
  border: 1px solid #e0e7ff;
}

.invoice-sheet.layout-creative .sheet-top-row {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  border-radius: 10px;
  padding: 24px;
  color: #ffffff;
  margin-bottom: 28px;
}

.invoice-sheet.layout-creative .invoice-main-title {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.invoice-sheet.layout-creative .meta-label {
  color: #e0e7ff;
}

.invoice-sheet.layout-creative .meta-input {
  color: #ffffff;
}

.invoice-sheet.layout-creative .meta-input:hover,
.invoice-sheet.layout-creative .meta-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.invoice-sheet.layout-creative .logo-prompt {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.invoice-sheet.layout-creative .items-table th {
  background: #eef2ff;
  color: #4338ca;
  border-bottom: 2px solid #c7d2fe;
}

.invoice-sheet.layout-creative .items-table tr:nth-child(even) td {
  background: #fafafa;
}

.invoice-sheet.layout-creative .totals-box {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #c7d2fe;
}

/* 3. Compact One-Page Layout */
.invoice-sheet.layout-compact {
  padding: 24px 28px;
  max-width: 820px;
}

.invoice-sheet.layout-compact .sheet-top-row {
  margin-bottom: 18px;
}

.invoice-sheet.layout-compact .invoice-main-title {
  font-size: 1.85rem;
  margin-bottom: 6px;
}

.invoice-sheet.layout-compact .address-grid {
  margin-bottom: 18px;
  padding-bottom: 14px;
  gap: 20px;
}

.invoice-sheet.layout-compact .items-table th {
  padding: 6px 10px;
}

.invoice-sheet.layout-compact .items-table td {
  padding: 6px 10px;
}

.invoice-sheet.layout-compact .sheet-bottom-grid {
  margin-bottom: 12px;
  gap: 20px;
}

/* Top Section: Logo & Invoice Header */
.sheet-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 36px;
}

/* Logo Box */
.logo-upload-box {
  width: 180px;
  min-height: 80px;
  position: relative;
}

.logo-prompt {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.2s ease;
}

.logo-prompt:hover {
  background: #f1f5f9;
  border-color: var(--primary-indigo);
}

.logo-img {
  max-width: 180px;
  max-height: 80px;
  object-fit: contain;
  display: none;
}

.btn-remove-logo {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-rose);
  color: #ffffff;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease;
}

.btn-remove-logo:hover {
  transform: scale(1.15);
}

/* When Logo is Active / Uploaded */
.logo-upload-box.has-logo .logo-prompt {
  display: none;
}

.logo-upload-box.has-logo .logo-img {
  display: block;
  border-radius: 4px;
}

.logo-upload-box.has-logo .btn-remove-logo {
  display: flex;
}

/* Invoice Title & Meta */
.invoice-meta-block {
  text-align: right;
  min-width: 260px;
}

.invoice-main-title {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text-main);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.meta-field-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 6px;
}

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

.meta-input {
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  border-radius: 4px;
  transition: border-color 0.2s ease;
  width: 140px;
}

.meta-input:hover, .meta-input:focus {
  border-color: var(--border-input);
  background: #f8fafc;
}

/* Address Blocks (From & To) */
.address-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
}

.address-block {
  display: flex;
  flex-direction: column;
}

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

.field-name-input {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
}

.field-name-input:hover, .field-name-input:focus {
  border-color: var(--border-input);
  background: #f8fafc;
}

.field-textarea {
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  resize: vertical;
  min-height: 64px;
  line-height: 1.6;
}

.field-textarea:hover, .field-textarea:focus {
  border-color: var(--border-input);
  background: #f8fafc;
}

/* Line Items Table */
.items-table-wrapper {
  margin-bottom: 24px;
  overflow-x: auto;
}

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

.items-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-sheet);
}

.items-table th.col-qty,
.items-table th.col-rate,
.items-table th.col-total {
  text-align: right;
}

.items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.items-table td.col-qty,
.items-table td.col-rate,
.items-table td.col-total {
  text-align: right;
}

.col-desc { width: 52%; }
.col-qty { width: 14%; }
.col-rate { width: 18%; }
.col-total { width: 16%; font-weight: 700; color: var(--text-main); }
.col-action { width: 40px; text-align: center; }

.table-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  border-radius: 4px;
  outline: none;
}

.table-input:hover, .table-input:focus {
  border-color: var(--border-input);
  background: #f8fafc;
}

.item-qty, .item-rate {
  text-align: right;
  font-weight: 600;
}

.btn-delete-row {
  background: transparent;
  color: #cbd5e1;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-delete-row:hover {
  color: var(--danger-rose);
  background: #ffe4e6;
}

/* Add Item Button */
.add-item-wrap {
  margin-bottom: 32px;
}

.btn-add-item {
  background: #f8fafc;
  color: var(--primary-indigo);
  border: 1px dashed var(--border-input);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-add-item:hover {
  background: #eef2ff;
  border-color: var(--primary-indigo);
}

/* Bottom Grid: Notes on Left, Totals on Right */
.sheet-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  margin-bottom: 24px;
}

/* Notes & Payment Terms */
.notes-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-removable-box {
  display: flex;
  flex-direction: column;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.notes-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 0;
}

.btn-remove-section {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-remove-section:hover {
  color: var(--danger-rose);
  background: #ffe4e6;
}

.btn-add-section-toggle {
  background: #f8fafc;
  color: var(--primary-indigo);
  border: 1px dashed var(--border-input);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.15s ease;
}

.btn-add-section-toggle:hover {
  background: #eef2ff;
  border-color: var(--primary-indigo);
}

.btn-remove-mini {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 4px;
  border-radius: 4px;
  line-height: 1;
}

.btn-remove-mini:hover {
  color: var(--danger-rose);
}

.add-total-line-wrap {
  margin-bottom: 10px;
}

.btn-add-total-toggle {
  background: transparent;
  border: none;
  color: var(--primary-indigo);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
}

.btn-add-total-toggle:hover {
  text-decoration: underline;
}

/* Totals Box */
.totals-box {
  background: #f8fafc;
  border: 1px solid var(--border-sheet);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.total-line-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.total-mini-input {
  width: 50px;
  text-align: right;
  border: 1px solid var(--border-input);
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.total-line-value {
  font-weight: 700;
  color: var(--text-main);
}

.total-divider {
  border-top: 2px solid var(--border-sheet);
  margin: 12px 0;
}

.grand-total-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
}

.grand-total-amount {
  color: var(--primary-indigo);
  font-size: 1.45rem;
}

/* 500+ Words SEO Editorial Section */
.seo-section {
  border-top: 1px solid var(--border-sheet);
  padding-top: 48px;
  margin-top: 30px;
}

.seo-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-align: center;
  color: var(--text-main);
}

.seo-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-size: 1rem;
}

.seo-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 36px;
}

.seo-card {
  background: #ffffff;
  border: 1px solid var(--border-sheet);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.seo-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.seo-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.seo-text p {
  margin-bottom: 12px;
}

.seo-text strong {
  color: var(--text-main);
}

/* FAQ Accordion */
.faq-wrap {
  margin-top: 24px;
}

.faq-title {
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 20px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid var(--border-sheet);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-summary {
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  color: var(--primary-indigo);
  transition: transform 0.2s ease;
  font-size: 0.8rem;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-body {
  padding: 0 20px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-sheet);
  padding: 32px 0;
  margin-top: 50px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  background: #ffffff;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* Custom Confirmation Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.2s ease forwards;
}

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

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 420px;
  width: 100%;
  padding: 28px 24px 22px;
  text-align: center;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon-wrap {
  width: 52px;
  height: 52px;
  background: #fff1f2;
  color: #e11d48;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-modal-cancel {
  flex: 1;
  height: 40px;
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-modal-cancel:hover {
  background: #e2e8f0;
}

.btn-modal-confirm {
  flex: 1;
  height: 40px;
  background: var(--danger-rose);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
}

.btn-modal-confirm:hover {
  background: #be123c;
  transform: translateY(-1px);
}

/* ========================================================= */
/* WATERMARK & STATUS STAMP                                  */
/* ========================================================= */
.invoice-stamp-badge {
  position: absolute;
  top: 32px;
  right: 280px;
  padding: 6px 18px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  transform: rotate(-13deg);
  border-radius: 6px;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.stamp-paid {
  color: #059669;
  border: 3.5px dashed #059669;
  background: rgba(5, 150, 105, 0.05);
}

.stamp-draft {
  color: #64748b;
  border: 3.5px dashed #64748b;
  background: rgba(100, 116, 139, 0.05);
}

.stamp-overdue {
  color: #dc2626;
  border: 3.5px dashed #dc2626;
  background: rgba(220, 38, 38, 0.05);
}

.stamp-void {
  color: #be123c;
  border: 3.5px dashed #be123c;
  background: rgba(190, 18, 60, 0.05);
}

/* ========================================================= */
/* CLIENT & SERVICE CATALOG DROPDOWNS                        */
/* ========================================================= */
.section-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.catalog-actions-wrap,
.service-catalog-wrap {
  position: relative;
  display: inline-block;
}

.btn-catalog-toggle,
.btn-catalog-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-catalog-secondary {
  font-size: 0.82rem;
  padding: 8px 12px;
  margin-left: 8px;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-catalog-toggle:hover,
.btn-catalog-secondary:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.catalog-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 270px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 50;
  padding: 8px 0;
  animation: slideDown 0.15s ease;
}

.catalog-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.btn-save-catalog {
  background: var(--primary-indigo);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  cursor: pointer;
}

.btn-save-catalog:hover {
  background: var(--primary-hover);
}

.catalog-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
}

.catalog-item-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.12s ease;
}

.catalog-item-btn:hover {
  background: #f1f5f9;
  color: var(--primary-indigo);
}

.catalog-empty-msg {
  padding: 14px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ========================================================= */
/* DIGITAL SIGNATURE PAD                                     */
/* ========================================================= */
.signature-box {
  margin-top: 14px;
}

.signature-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signature-canvas-container {
  background: #ffffff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 6px;
  padding: 8px;
  display: inline-block;
  width: fit-content;
}

.signature-canvas {
  display: block;
  background: #fafafa;
  border-radius: 4px;
  cursor: crosshair;
  touch-action: none;
}

.signature-guide-line {
  border-bottom: 1.5px solid #0f172a;
  margin: 6px 0 4px;
  width: 100%;
}

.signer-name-input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 0;
}

/* ========================================================= */
/* SLIDE-OVER INVOICES HISTORY DRAWER                        */
/* ========================================================= */
.btn-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-count {
  background: var(--primary-indigo);
  color: #ffffff;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.drawer-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.btn-close-drawer {
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-drawer:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.drawer-toolbar {
  padding: 12px 22px;
  display: flex;
  gap: 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}

.btn-drawer-primary {
  flex: 1;
  background: var(--primary-indigo);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.btn-drawer-secondary {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-drawer-secondary:hover {
  background: #f1f5f9;
}

.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.drawer-tab {
  background: none;
  border: none;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.drawer-tab.active {
  background: #e0e7ff;
  color: var(--primary-indigo);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.invoice-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.15s ease;
}

.invoice-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.invoice-card.active-current {
  border-color: var(--primary-indigo);
  background: #fbfbfe;
}

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

.card-num {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}

.status-pill {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
}

.pill-Draft { background: #f1f5f9; color: #475569; }
.pill-Sent { background: #e0f2fe; color: #0284c7; }
.pill-Paid { background: #dcfce7; color: #16a34a; }
.pill-Overdue { background: #fee2e2; color: #dc2626; }

.card-client {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card-total {
  font-weight: 800;
  color: var(--text-main);
}

.card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

.btn-card-action {
  flex: 1;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-card-action:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-card-action.btn-card-delete {
  flex: 0 0 auto;
  color: var(--danger-rose);
}

.btn-card-action.btn-card-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* ========================================================= */
/* PRINT OPTIMIZATION (@media print)                         */
/* Ensures ONLY the invoice sheet prints on a single A4 page */
/* ========================================================= */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html {
    padding: 0 !important;
    margin: 0 !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    padding: 12mm 15mm !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Completely eliminate all non-print elements */
  .app-header,
  .hero-banner,
  .ad-slot-leaderboard,
  .ad-slot-incontent,
  .seo-section,
  .site-footer,
  .add-item-wrap,
  .logo-prompt,
  .btn-remove-logo,
  .btn-remove-section,
  .btn-remove-mini,
  .btn-add-section-toggle,
  .add-total-line-wrap,
  .btn-delete-row,
  .due-presets-row,
  .qr-input-wrap,
  .save-indicator,
  .toast-msg,
  .print-hide {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .invoice-sheet-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .invoice-sheet {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
  }

  /* Top Section: Header & Meta */
  .invoice-sheet .sheet-top-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 28px !important;
    gap: 24px !important;
    width: 100% !important;
  }

  /* When no logo is uploaded */
  .logo-upload-box:not(.has-logo) {
    display: none !important;
  }

  .invoice-sheet .sheet-top-row:not(:has(.logo-upload-box.has-logo)) {
    justify-content: flex-end !important;
  }

  .logo-upload-box.has-logo {
    display: block !important;
    min-height: 0 !important;
    max-height: 70px !important;
    width: auto !important;
    max-width: 200px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .logo-upload-box.has-logo .logo-img {
    display: block !important;
    max-height: 70px !important;
    max-width: 200px !important;
    object-fit: contain !important;
  }

  .invoice-sheet .invoice-meta-block {
    text-align: right !important;
    min-width: 280px !important;
  }

  .invoice-sheet .invoice-main-title {
    font-size: 2.4rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.5px !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    line-height: 1 !important;
    margin-bottom: 12px !important;
    color: #0f172a !important;
  }

  .invoice-sheet .meta-field-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin-bottom: 4px !important;
  }

  .invoice-sheet .meta-label {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  .invoice-sheet .meta-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    text-align: right !important;
    width: auto !important;
  }

  /* Two Column Address Grid */
  .invoice-sheet .address-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 36px !important;
    margin-bottom: 24px !important;
    padding-bottom: 18px !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
  }

  .invoice-sheet .address-block {
    display: flex !important;
    flex-direction: column !important;
  }

  .invoice-sheet .section-tag {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    color: #94a3b8 !important;
    margin-bottom: 6px !important;
  }

  .invoice-sheet .field-name-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 4px !important;
  }

  .invoice-sheet .field-textarea {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.88rem !important;
    color: #475569 !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    height: auto !important;
    resize: none !important;
    white-space: pre-line !important;
  }

  /* Line Items Table */
  .invoice-sheet .items-table-wrapper {
    margin-bottom: 28px !important;
    overflow: visible !important;
  }

  .invoice-sheet .items-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .invoice-sheet .items-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    padding: 12px 14px !important;
    border-bottom: 2px solid #cbd5e1 !important;
    border-top: 1.5px solid #e2e8f0 !important;
  }

  .invoice-sheet .items-table td {
    padding: 14px 14px !important;
    font-size: 0.95rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
  }

  .invoice-sheet .items-table .col-total {
    font-weight: 800 !important;
    color: #0f172a !important;
  }

  .invoice-sheet .table-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    font-weight: inherit !important;
    color: inherit !important;
  }

  .invoice-sheet .col-action {
    display: none !important;
  }

  /* Bottom Section: Notes & Totals */
  .invoice-sheet .sheet-bottom-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 0.8fr !important;
    gap: 40px !important;
    margin-bottom: 0 !important;
    margin-top: 12px !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .invoice-sheet .notes-block {
    display: flex !important;
    flex-direction: column !important;
    gap: 18px !important;
  }

  .invoice-sheet .notes-label {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    color: #94a3b8 !important;
    margin-bottom: 6px !important;
  }

  /* Standard Totals Card */
  .invoice-sheet .totals-box {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 16px 18px !important;
  }

  .invoice-sheet .total-line {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 0.88rem !important;
    color: #475569 !important;
    margin-bottom: 8px !important;
  }

  .invoice-sheet .total-line-value {
    font-weight: 700 !important;
    color: #0f172a !important;
  }

  .invoice-sheet .total-mini-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    width: auto !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    text-align: right !important;
  }

  .invoice-sheet .total-divider {
    border-top: 1.5px solid #cbd5e1 !important;
    margin: 10px 0 !important;
  }

  .invoice-sheet .grand-total-line {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 1.15rem !important;
    font-weight: 900 !important;
    color: #0f172a !important;
  }

  .invoice-sheet .grand-total-amount {
    font-size: 1.35rem !important;
    font-weight: 900 !important;
    color: var(--primary-indigo) !important;
  }

  /* QR Code in Print */
  .invoice-sheet .qr-code-box {
    margin-top: 6px !important;
  }

  .invoice-sheet .qr-content-flex {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    width: fit-content !important;
  }

  .invoice-sheet .qr-code-canvas-wrap {
    padding: 0 !important;
    border: none !important;
  }

  .invoice-sheet .qr-code-output,
  .invoice-sheet .qr-code-output img,
  .invoice-sheet .qr-code-output svg {
    width: 60px !important;
    height: 60px !important;
  }

  .invoice-sheet .qr-caption {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    color: #64748b !important;
  }

  /* Digital Signature in Print */
  .invoice-sheet .signature-box {
    margin-top: 10px !important;
  }

  .invoice-sheet .signature-canvas-container {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .invoice-sheet .signature-canvas {
    background: transparent !important;
  }

  /* Watermark Stamp in Print */
  .invoice-sheet .invoice-stamp-badge {
    display: inline-block !important;
    opacity: 0.9 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .invoice-sheet .invoice-stamp-badge.stamp-none {
    display: none !important;
  }

  /* Hide native browser calendar icons */
  input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    -webkit-appearance: none !important;
  }
}

/* Responsive Media Queries (Screen Only) */
@media screen and (max-width: 1100px) {
  .header-flex {
    flex-wrap: wrap;
    gap: 10px;
  }
  .header-controls {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .header-controls::-webkit-scrollbar {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .sheet-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .invoice-meta-block {
    text-align: left;
  }

  .meta-field-row {
    justify-content: space-between;
  }

  .meta-input {
    text-align: left;
  }

  .address-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sheet-bottom-grid {
    grid-template-columns: 1fr;
  }

  .invoice-sheet {
    padding: 24px 16px;
  }

  .seo-cards-grid {
    grid-template-columns: 1fr;
  }
}
