/* ═══════════════════════════════════════════════════════
   AUTO INVOICE — THE GIDZ PRESS
   style.css  v2
═══════════════════════════════════════════════════════ */

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

:root {
  --teal:        #1a6b7c;
  --teal-dark:   #145968;
  --teal-light:  #e8f4f7;
  --red:         #c0392b;
  --white:       #ffffff;
  --gray-100:    #f0f2f4;
  --gray-200:    #e2e6ea;
  --gray-400:    #9aa3ad;
  --gray-600:    #5c6878;
  --gray-800:    #2d3748;
  --gray-900:    #1a202c;
  --sidebar-w:   340px;
  --shadow-lg:   0 12px 40px rgba(0,0,0,.18);
  --transition:  .18s ease;
}

html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #1a202c;
  color: var(--gray-900);
  line-height: 1.5;
  font-size: 14px;
}

/* ════════════════════════════════════════
   TOAST
════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0d2231;
  color: #60c0d4;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(96,192,212,.2);
  z-index: 9999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 320px;
}

.toast--show   { opacity: 1; transform: translateY(0); }
.toast--warning { background: #2a1818; color: #f87171; border-color: rgba(248,113,113,.2); }

/* ════════════════════════════════════════
   APP SHELL
════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ════════════════════════════════════════
   SIDEBAR / FORM PANEL
════════════════════════════════════════ */
.form-panel {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #0f1923;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
  z-index: 10;
}

.form-panel.collapsed { width: 0; min-width: 0; }

.form-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.form-panel__logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #e2e6ea;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .3px;
}

.form-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.form-panel__body::-webkit-scrollbar { width: 4px; }
.form-panel__body::-webkit-scrollbar-track { background: transparent; }
.form-panel__body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.form-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

/* ── Form Sections ── */
.form-section { margin-bottom: 22px; }

.form-section__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(26,107,124,.25);
}

/* Section title row (with inline save button) */
.form-section__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(26,107,124,.25);
}

.form-section__title-row .form-section__title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Saved-invoice save button */
.btn-save-invoice {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(26,107,124,.18);
  border: 1px solid rgba(26,107,124,.38);
  border-radius: 5px;
  padding: 4px 10px;
  color: #60c0d4;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-save-invoice:hover { background: rgba(26,107,124,.32); }

/* ── Saved Invoices List ── */
.saved-invoices-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 168px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}

.saved-invoices-empty {
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
  padding: 12px 0;
  font-style: italic;
}

.saved-invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 7px;
  padding: 8px 10px;
  gap: 8px;
  transition: border-color var(--transition);
}

.saved-invoice-item:hover { border-color: rgba(26,107,124,.35); }

.saved-invoice-item__info { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sii-num { font-size: 12px; font-weight: 600; color: #e2e6ea; }
.sii-date { font-size: 10px; color: var(--gray-400); }

.saved-invoice-item__actions { display: flex; gap: 3px; flex-shrink: 0; }

.sii-load, .sii-del {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: background var(--transition), color var(--transition);
}

.sii-load { color: #60c0d4; }
.sii-load:hover { background: rgba(26,107,124,.2); }
.sii-del  { color: var(--gray-400); }
.sii-del:hover  { color: #f87171; background: rgba(248,113,113,.12); }

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field span {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: .3px;
}

.field-hint {
  font-size: 9.5px;
  color: var(--gray-400);
  font-style: italic;
  font-weight: 400;
}

.field input,
.field textarea,
.field select {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: 8px 10px;
  color: #e2e6ea;
  font-family: inherit;
  font-size: 13px;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
  width: 100%;
}

.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--teal);
  background: rgba(26,107,124,.1);
}

.field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(.4);
  cursor: pointer;
}

/* Select arrow */
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239aa3ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.field select option { background: #1a2535; color: #e2e6ea; }

/* Font preview */
.font-preview {
  margin-top: 6px;
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  color: rgba(255,255,255,.45);
  font-size: 13px;
  line-height: 1.5;
  font-style: italic;
  transition: font-family .2s ease;
}

/* ── Logo Upload Zone ── */
.logo-zone { margin-bottom: 12px; }

.logo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 18px 12px;
  border: 1.5px dashed rgba(26,107,124,.4);
  border-radius: 8px;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 12px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.logo-drop:hover, .logo-drop.drag-over {
  border-color: var(--teal);
  background: rgba(26,107,124,.08);
  color: #c0e8f0;
}

.logo-hint { font-size: 10px; color: inherit; opacity: .7; }

.logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
}

.logo-preview-img {
  max-height: 44px;
  max-width: 110px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.btn-remove-logo {
  background: rgba(192,57,43,.12);
  border: 1px solid rgba(192,57,43,.25);
  border-radius: 5px;
  color: #f87171;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 9px;
  font-family: inherit;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-remove-logo:hover { background: rgba(192,57,43,.24); }

/* ── Color Pickers ── */
.color-pickers-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.color-field span {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
}

.color-field input[type="color"] {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px;
  cursor: pointer;
  padding: 3px;
  background: rgba(255,255,255,.05);
  outline: none;
  transition: border-color var(--transition);
}

.color-field input[type="color"]:hover { border-color: var(--teal); }

.btn-reset-colors {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color var(--transition);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-reset-colors:hover { color: #e2e6ea; }

/* ── Tax Row with Toggle ── */
.tax-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 10px;
}

.tax-toggle-wrap { padding-bottom: 8px; flex-shrink: 0; }

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

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

.toggle-track {
  width: 34px;
  height: 18px;
  background: rgba(255,255,255,.1);
  border-radius: 9px;
  position: relative;
  transition: background .2s;
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.toggle-label input:checked + .toggle-track {
  background: var(--teal);
  border-color: var(--teal);
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}

.toggle-label input:checked + .toggle-track .toggle-thumb { left: 17px; }

.toggle-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  min-width: 22px;
}

/* ── Line Items Form ── */
.line-items-form { display: flex; flex-direction: column; gap: 10px; }

.line-item-form-row {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 10px;
}

.lir-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.lir-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(26,107,124,.18);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lir-reorder {
  display: flex;
  gap: 2px;
  flex: 1;
}

.btn-reorder {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 4px;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 11px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}

.btn-reorder:hover:not(:disabled) { color: #e2e6ea; background: rgba(255,255,255,.12); }
.btn-reorder:disabled { opacity: .3; cursor: default; }

.btn-remove-item {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
}

.btn-remove-item:hover { color: #f87171; background: rgba(248,113,113,.12); }

.lir-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lir-full { grid-column: 1 / -1; }

.line-item-sub-field { display: flex; flex-direction: column; gap: 3px; }

.line-item-sub-field span {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
}

.line-item-sub-field input {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 5px;
  padding: 6px 8px;
  color: #e2e6ea;
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.line-item-sub-field input:focus { border-color: var(--teal); }

/* ── Buttons ── */
.btn-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  background: rgba(26,107,124,.14);
  border: 1.5px dashed rgba(26,107,124,.45);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--teal);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.btn-add:hover { background: rgba(26,107,124,.26); border-color: var(--teal); }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--teal) 0%, #1e8fa3 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: 1.6;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(26,107,124,.4);
}

.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26,107,124,.5); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 11px 10px;
  color: #9aa3ad;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-secondary:hover { background: rgba(255,255,255,.1); color: #e2e6ea; border-color: rgba(255,255,255,.2); }

.btn-icon {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
}

.btn-icon:hover { color: #e2e6ea; background: rgba(255,255,255,.08); }
.btn-icon--light { color: var(--gray-600); }
.btn-icon--light:hover { color: var(--gray-900); background: var(--gray-100); }

/* ════════════════════════════════════════
   PREVIEW PANEL
════════════════════════════════════════ */
.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #1a202c;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #0f1923;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.preview-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--gray-400);
  text-transform: uppercase;
  flex: 1;
}

.btn-print-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(26,107,124,.18);
  border: 1px solid rgba(26,107,124,.38);
  border-radius: 7px;
  padding: 7px 13px;
  color: #60c0d4;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-print-sm:hover { background: rgba(26,107,124,.32); }

/* Invoice Wrap */
.invoice-wrap {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.invoice-wrap::-webkit-scrollbar { width: 6px; }
.invoice-wrap::-webkit-scrollbar-track { background: transparent; }
.invoice-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 6px; }

/* ════════════════════════════════════════
   THE INVOICE DOCUMENT — A4
════════════════════════════════════════ */
.invoice {
  /* A4 at 96 dpi: 210mm × 297mm = 794px × 1123px */
  width: 794px;
  min-height: 1123px;
  background: var(--white);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.07),
    0 10px 28px rgba(0,0,0,.28),
    0 36px 72px rgba(0,0,0,.24);
  border-radius: 2px;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

/* ── Invoice Header ── */
.inv-header {
  background: var(--teal);
  padding: 32px 40px 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}

.inv-header__title {
  font-size: 60px;
  font-weight: 900;
  color: white;
  letter-spacing: -1.5px;
  line-height: 1;
  text-transform: uppercase;
}

.inv-header__company {
  text-align: right;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  line-height: 1.75;
}

/* Logo in invoice header */
.inv-logo-wrap {
  text-align: right;
  margin-bottom: 8px;
}

.inv-logo {
  max-height: 54px;
  max-width: 150px;
  object-fit: contain;
}

.inv-company-name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .7px;
  color: white;
  margin-bottom: 2px;
}

/* ── Meta Bar ── */
.inv-meta {
  background: var(--red);
  padding: 11px 40px;
  display: flex;
  align-items: center;
  gap: 44px;
  flex-shrink: 0;
}

.inv-meta__item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-size: 12px;
}

.inv-meta__label { font-weight: 600; letter-spacing: .3px; }

/* ── Bill To ── */
.inv-to {
  padding: 28px 40px 22px;
  border-bottom: 1px solid var(--gray-200);
}

.inv-to__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.inv-to__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.inv-to__location { font-size: 13px; color: var(--gray-600); }

/* ── Table ── */
.inv-table-wrap { padding: 22px 40px; }

.inv-table__header {
  background: var(--teal);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 3px 3px 0 0;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.inv-table thead tr { border-bottom: 1.5px solid var(--gray-200); }

.inv-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--gray-800);
}

.inv-table thead th.col-qty,
.inv-table thead th.col-price,
.inv-table thead th.col-amount { text-align: right; }

.inv-table tbody tr { border-bottom: 1px solid var(--gray-100); }
.inv-table tbody tr:last-child { border-bottom: none; }

.inv-table tbody td {
  padding: 11px 14px;
  color: var(--gray-800);
  vertical-align: top;
}

.inv-table tbody td.col-qty,
.inv-table tbody td.col-price,
.inv-table tbody td.col-amount { text-align: right; white-space: nowrap; }

.td-desc-main { font-weight: 500; color: var(--gray-900); }
.td-desc-sub  { font-size: 11px; color: var(--gray-400); margin-top: 2px; }

/* ── Footer Row ── */
.inv-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 40px 26px;
  border-top: 1.5px solid var(--gray-200);
  margin-top: 16px;
}

.inv-payment__label {
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-900);
  margin-bottom: 5px;
}

.inv-payment p {
  font-size: 12.5px;
  color: var(--gray-600);
  line-height: 1.6;
}

/* QR code section */
.inv-payment__qr {
  margin: 10px 0 8px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.inv-payment__qr-label {
  font-size: 9px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: .9px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

#qrContainer canvas,
#qrContainer img {
  border-radius: 4px;
  display: block;
  border: 2px solid var(--gray-100);
}

.inv-payment__note {
  margin-top: 10px;
  font-weight: 600 !important;
  color: var(--gray-800) !important;
  font-style: italic;
}

/* Totals */
.inv-totals { min-width: 248px; }

.inv-totals__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-100);
}

.inv-totals__row:last-child { border-bottom: none; }

.inv-totals__row span:last-child { font-weight: 600; color: var(--gray-900); }

.inv-totals__row--total {
  background: var(--teal);
  color: white !important;
  font-weight: 700;
  font-size: 13px;
  margin-top: 5px;
  padding: 10px 12px;
  border-radius: 3px;
  border-bottom: none !important;
}

.inv-totals__row--total span { color: white !important; }

/* Copy total button */
.total-amount-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-total-btn {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 5px;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity .18s, background .15s, color .15s;
}

.inv-totals__row--total:hover .copy-total-btn { opacity: 1; }
.copy-total-btn:hover { background: rgba(255,255,255,.28); color: white; }

/* ── Invoice Doc Footer ── */
.inv-doc-footer {
  text-align: center;
  padding: 14px 40px 20px;
  border-top: 1px solid var(--gray-200);
  font-size: 11.5px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.inv-doc-footer__dot { color: var(--gray-200); }

/* ════════════════════════════════════════
   PRINT STYLES
════════════════════════════════════════ */
@media print {
  @page { size: A4; margin: 0; }

  body { background: white; }

  .app { display: block; height: auto; }

  .form-panel,
  .preview-toolbar,
  .toast { display: none !important; }

  .preview-panel { display: block; }

  .invoice-wrap {
    padding: 0;
    overflow: visible;
    display: block;
  }

  .invoice {
    width: 100%;
    min-height: 100vh;
    box-shadow: none;
    border-radius: 0;
  }

  .copy-total-btn { display: none !important; }

  .inv-payment__qr { display: flex !important; }
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) { :root { --sidebar-w: 290px; } }

@media (max-width: 640px) {
  .form-panel {
    position: absolute;
    top: 0; left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-lg);
  }

  .form-panel.collapsed {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
  }

  .invoice-wrap { padding: 16px; }

  .inv-header { padding: 20px 24px; }
  .inv-header__title { font-size: 40px; }
  .inv-meta { padding: 10px 24px; gap: 18px; flex-wrap: wrap; }
  .inv-to { padding: 18px 24px; }
  .inv-table-wrap { padding: 14px 24px; }
  .inv-footer-row { flex-direction: column; padding: 16px 24px; }
  .inv-totals { min-width: unset; width: 100%; }
  .inv-doc-footer { padding: 12px 24px; }
}
