/* ============================================================
   SafeTech Systems – Quotation App
   ============================================================ */

:root {
  --primary: #162534;
  --primary-light: #1e3a52;
  --accent: #a6a6a6;
  --accent-dark: #7e7e7e;
  --bg: #f1f1f1;
  --card: #ffffff;
  --border: #d0d6e0;
  --text: #1e2535;
  --text-muted: #6b7280;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --profit-bg: #ecfdf5;
  --profit-border: #6ee7b7;
  --shadow: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.14);
  --radius: 8px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); }

/* ── Header ─────────────────────────────────────────── */
#header {
  background: #162534;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  position: sticky; top: 0; z-index: 100;
}
#header .logo { display: flex; align-items: center; gap: 10px; }
#header .logo img { height: 44px; width: auto; object-fit: contain; }
#header .logo .logo-text { display: flex; flex-direction: column; }
#header .logo .logo-name { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; color: #fff; line-height: 1.1; }
#header .logo .logo-sub { font-size: 10px; color: rgba(255,255,255,0.55); letter-spacing: 0.3px; }
#header nav { display: flex; gap: 4px; margin-left: 32px; }
#header nav button {
  background: none; border: none; color: rgba(255,255,255,0.7);
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all 0.15s;
}
#header nav button:hover { background: rgba(255,255,255,0.10); color: #fff; }
#header nav button.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 700; border-bottom: 2px solid #a6a6a6; }
#header .spacer { flex: 1; }
#header .header-info { font-size: 11px; color: rgba(255,255,255,0.5); text-align: right; line-height: 1.5; }

/* ── Layout ──────────────────────────────────────────── */
#app { max-width: 1400px; margin: 0 auto; padding: 24px; }
.view { display: none; }
.view.active { display: block; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px;
}
.card-title {
  font-size: 13px; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid #162534;
  display: inline-block;
}

/* ── Form Elements ───────────────────────────────────── */
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 160px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 14px; color: var(--text);
  background: var(--card); transition: border-color 0.15s;
  outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 2px rgba(34,85,161,0.12);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group.sm { min-width: 100px; }
.form-group.xs { min-width: 80px; flex: 0; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm); border: none;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all 0.15s; white-space: nowrap; user-select: none;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(0.95); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: #1e3a52; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-info { background: var(--info); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 5px 8px; font-size: 14px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Search ──────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--primary-light); }
.search-wrap .search-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
#product-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--card); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 300px; overflow-y: auto; box-shadow: var(--shadow-md);
  display: none;
}
#product-dropdown.open { display: block; }
.dropdown-item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--bg);
  transition: background 0.1s;
}
.dropdown-item:hover { background: #eef2ff; }
.dropdown-item .d-code { font-size: 11px; font-weight: 700; color: var(--primary-light); }
.dropdown-item .d-name { font-size: 13px; color: var(--text); }
.dropdown-item .d-cat { font-size: 11px; color: var(--text-muted); }
.dropdown-item .d-price { font-size: 12px; color: var(--success); font-weight: 600; float: right; }
.dropdown-empty { padding: 16px; text-align: center; color: var(--text-muted); font-style: italic; }

/* ── Quote Table ─────────────────────────────────────── */
.quote-table-wrap { overflow-x: auto; margin-top: 8px; }
table.quote-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.quote-table th {
  background: var(--primary); color: #fff;
  padding: 10px 10px; text-align: left; font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}
table.quote-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.quote-table tr:last-child td { border-bottom: none; }
table.quote-table tr:hover td { background: #f5f7ff; }
table.quote-table .col-del { width: 40px; text-align: center; }
table.quote-table .col-cam { width: 50px; text-align: center; }
table.quote-table .col-qty { width: 80px; }
table.quote-table .col-price { width: 120px; }
table.quote-table .col-total { width: 110px; font-weight: 600; text-align: right; }
table.quote-table .col-profit { width: 110px; color: var(--success); font-weight: 600; text-align: right; }
table.quote-table .col-trade { width: 110px; color: var(--text-muted); text-align: right; font-size: 12px; }
table.quote-table input[type=number], table.quote-table input[type=text] {
  width: 100%; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; outline: none;
  transition: border-color 0.15s;
}
table.quote-table input:focus { border-color: var(--primary-light); }
table.quote-table .labour-row td { background: #fffbeb; font-style: italic; }
table.quote-table .custom-row td { background: #f0f7ff; }
.badge-cam { background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 20px; }

/* Camera toggle checkbox styled */
.cam-toggle { cursor: pointer; width: 16px; height: 16px; accent-color: var(--accent); }

/* ── Totals Panel ─────────────────────────────────────── */
.totals-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px;
}
.totals-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.totals-box.profit-box {
  background: var(--profit-bg); border-color: var(--profit-border);
}
.totals-box h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); margin-bottom: 12px; }
.totals-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.totals-row:last-child { border-bottom: none; }
.totals-row.grand { font-size: 16px; font-weight: 700; padding-top: 8px; margin-top: 4px; }
.totals-row .lbl { color: var(--text-muted); }
.totals-row .val { font-weight: 600; }
.totals-row.grand .val { color: var(--primary); }
.profit-val { color: var(--success) !important; }
.margin-badge {
  display: inline-block; background: var(--success); color: #fff;
  font-size: 14px; font-weight: 700; padding: 4px 12px;
  border-radius: 20px; margin-top: 8px;
}
.margin-badge.low { background: var(--warning); }
.margin-badge.very-low { background: var(--danger); }

/* ── Saved Quotes ─────────────────────────────────────── */
.quotes-filter { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.quotes-filter input { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
.quotes-filter input:focus { border-color: var(--primary-light); }

table.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data-table th {
  background: var(--primary); color: #fff; padding: 10px 12px;
  text-align: left; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
  white-space: nowrap;
}
table.data-table th:hover { background: var(--primary-light); }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.data-table tr:hover td { background: #f5f7ff; }
table.data-table .actions { display: flex; gap: 4px; }
.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.status-draft { background: #fef3c7; color: #92400e; }
.status-sent { background: #dbeafe; color: #1e40af; }
.status-accepted { background: #d1fae5; color: #065f46; }
.status-declined { background: #fee2e2; color: #991b1b; }
.status-paid { background: #bbf7d0; color: #14532d; }
.status-overdue { background: #fecaca; color: #7f1d1d; }

/* ── Admin / Products ─────────────────────────────────── */
.admin-toolbar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.admin-toolbar input { flex: 1; min-width: 200px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; }
.admin-toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; color: var(--text); }
.admin-count { font-size: 12px; color: var(--text-muted); padding: 8px 0; }

table.prod-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
table.prod-table th {
  background: var(--primary); color: #fff; padding: 8px 10px;
  text-align: left; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.4px; font-size: 11px; white-space: nowrap; cursor: pointer;
  position: sticky; top: 0; z-index: 10;
}
table.prod-table th:hover { background: var(--primary-light); }
table.prod-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.prod-table tr:hover td { background: #f5f7ff; }
table.prod-table .edit-input {
  width: 100%; padding: 3px 6px; border: 1px solid var(--border);
  border-radius: 3px; font-size: 12px; outline: none; background: #fff;
}
table.prod-table .edit-input:focus { border-color: var(--primary-light); }
.prod-table-wrap { max-height: 520px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); }

/* ── Settings ─────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; } }

/* ── Print / Quote Preview ────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { background: #fff; margin: 0; }
  #header, #app, .no-print { display: none !important; }
  #print-preview {
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
    overflow: visible !important;
    display: block !important;
  }
  #print-preview .preview-toolbar { display: none !important; }
  #quote-pages { display: block !important; gap: 0 !important; padding: 0 !important; }
  /* Each paper is one printed page */
  .quote-paper {
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
    min-height: 0 !important;
    page-break-after: always;
    break-after: page;
  }
  .quote-paper:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  /* Keep footer, notes and continuation header intact */
  .quote-paper .qp-footer       { break-inside: avoid; page-break-inside: avoid; }
  .quote-paper .qp-notes        { break-inside: avoid; page-break-inside: avoid; }
  .quote-paper .qp-notes-extra  { break-inside: avoid; page-break-inside: avoid; }
  .quote-paper .qp-cont-header  { break-inside: avoid; page-break-inside: avoid; }
  .quote-paper .qp-cont-note    { break-inside: avoid; page-break-inside: avoid; }
  /* Keep individual table rows from splitting */
  .quote-paper table.p-table tr { break-inside: avoid; page-break-inside: avoid; }
  @page { margin: 10mm; size: A4; }
}

#print-preview {
  background: #7e7e7e;
  display: none;
  position: fixed; inset: 0; z-index: 1000;
  overflow-y: auto; padding: 0;
}
#print-preview.open { display: flex; flex-direction: column; align-items: center; }

/* Container holding all quote pages in the preview */
#quote-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-bottom: 40px;
  width: 100%;
}

#print-preview .preview-toolbar {
  background: #162534; color: #fff;
  padding: 11px 20px; display: flex; gap: 10px; align-items: center;
  width: 100%; position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  margin-bottom: 20px;
}
#print-preview .preview-toolbar span { flex: 1; font-weight: 600; font-size: 14px; }

/* ─ Quote Paper – pixel-matched from Word template ─ */
.quote-paper {
  background: #fff;
  width: 210mm;
  min-height: 297mm;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  padding: 0;
  font-family: Calibri, 'Aptos Narrow', Arial, sans-serif;
  font-size: 12pt;
  color: #000;
  margin-bottom: 30px;
  border: 1px solid #ccc;
  position: relative;
}

/* ─ Paid stamp overlay ─ */
.paid-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 90pt;
  font-weight: 900;
  font-family: Arial, sans-serif;
  color: rgba(0, 160, 60, 0.15);
  border: 14px solid rgba(0, 160, 60, 0.15);
  padding: 8mm 20mm;
  border-radius: 10px;
  letter-spacing: 0.12em;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  text-transform: uppercase;
  user-select: none;
}

/* ─ Header: dark navy, diagonal bottom edge (left low, right high) ─ */
.quote-paper .qp-header {
  display: flex;
  align-items: flex-start;
  background: #162534;
  min-height: 70mm;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 0 100%);
  position: relative;
  z-index: 1;
}
.quote-paper .qp-logo-cell {
  flex: 0 0 38%;
  padding: 5mm 5mm 4mm 6mm;
  display: flex;
  align-items: flex-start;
}
.quote-paper .qp-logo-cell img {
  max-height: 30mm;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.quote-paper .qp-title-cell {
  flex: 0 0 62%;
  color: #fff;
  padding: 5mm 7mm 4mm 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  text-align: right;
}
.quote-paper .qp-title-cell .qp-title {
  font-size: 40pt;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2.5mm;
}
.quote-paper .qp-title-cell .qp-meta {
  font-size: 12pt;
  line-height: 1.75;
}

/* ─ Client Info (39%) | Quotation Specs (61%) — overlaps header ─ */
.quote-paper .qp-info-row {
  display: flex;
  align-items: stretch;
  border-bottom: none;
  position: relative;
  z-index: 2;
  margin-top: -18mm;
  margin-left: 4mm;
  margin-right: 4mm;
  gap: 4mm;
  padding-bottom: 4mm;
  border-bottom: none;
}
.quote-paper .qp-info-header {
  background: #7f7f7f;
  color: #fff;
  font-weight: 700;
  font-size: 12pt;
  padding: 1.8mm 4mm;
}
.quote-paper .qp-client-cell {
  flex: 0 0 calc(39% - 2mm);
  border: 1px solid #bbb;
  border-radius: 2px;
  overflow: hidden;
}
.quote-paper .qp-specs-cell {
  flex: 1;
  border: 1px solid #bbb;
  border-radius: 2px;
  overflow: hidden;
}
.quote-paper .qp-cell-body {
  padding: 4mm 4mm;
  font-size: 12pt;
  line-height: 1.7;
  min-height: 24mm;
  background: #f2f2f2;
}

/* ─ Items table — col widths from Word: 51% / 16% / 16% / 16% ─ */
.quote-paper table.p-table {
  width: calc(100% - 8mm);
  margin: 4mm 4mm 0;
  border-collapse: collapse;
  border: 1px solid #bbb;
  font-size: 12pt;
}
.quote-paper table.p-table thead tr { background: #a6a6a6; color: #fff; }
.quote-paper table.p-table th {
  padding: 2.5mm 4mm;
  font-weight: 700;
  font-size: 12pt;
}
.quote-paper table.p-table th:first-child { text-align: left; width: 51%; }
.quote-paper table.p-table th.col-r { text-align: center; width: 16%; }
.quote-paper table.p-table td:first-child { text-align: left; }
.quote-paper table.p-table td.col-r { text-align: center; }
.quote-paper table.p-table td {
  padding: 2.5mm 4mm;
  border-bottom: 1px solid #e0e0e0;
  background: #f2f2f2;
}
.quote-paper table.p-table .labour-row td { font-style: italic; }

/* ─ Footer: 4-column layout matching Word table ─
   Payment(45%) | gap(2%) | Subtotal label(27%) | Amount(26%) */
.quote-paper .qp-footer {
  display: flex;
  align-items: stretch;
  border: 1px solid #bbb;
  margin: 4mm 4mm 4mm;
  width: calc(100% - 8mm);
}
.quote-paper .qp-payment-cell {
  flex: 0 0 45%;
  border-right: 1px solid #bbb;
}
.quote-paper .qp-footer-gap {
  flex: 0 0 2%;
  background: #fff;
  border-right: 1px solid #bbb;
}
.quote-paper .qp-amount-section {
  flex: 0 0 53%;
  display: flex;
  flex-direction: column;
}
.quote-paper .qp-footer-header {
  background: #a6a6a6;
  color: #fff;
  font-weight: 700;
  font-size: 12pt;
  padding: 1.8mm 4mm;
}
.quote-paper .qp-footer-body {
  padding: 0 3mm;
  font-size: 12pt;
  line-height: 1.5;
  background: #f2f2f2;
  flex: 1;
}
.quote-paper .qp-footer-body > div {
  padding: 1.2mm 1mm;
  border-bottom: 1px solid #ccc;
}
.quote-paper .qp-footer-body > div:last-child {
  border-bottom: none;
}
/* Amount rows inside amount section */
.quote-paper .qp-amount-inner {
  background: #f2f2f2;
  flex: 1;
  padding: 3.5mm 4mm;
  font-size: 12pt;
}
.quote-paper .qp-amount-row {
  display: flex;
  justify-content: space-between;
  padding: 1mm 0;
}
.quote-paper .qp-amount-divider {
  border: none;
  border-top: 1px solid #bbb;
  margin: 2mm 0 3mm;
}
.quote-paper .qp-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  padding: 1mm 0;
}
/* Signature line */
.quote-paper .qp-sig-line {
  padding-top: 3mm !important;
  font-size: 12pt;
  font-weight: 700;
  color: #000;
}
.quote-paper .qp-sig-line::after {
  content: '';
  display: block;
  margin-top: 7mm;
  width: calc(100% - 4mm);
  border-bottom: 1.5px solid #333;
}

/* ─ Continuation page header (page 2+) ─ */
.quote-paper .qp-cont-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #162534;
  color: #fff;
  padding: 3mm 6mm;
  font-size: 11pt;
  font-weight: 600;
  margin-bottom: 3mm;
}

/* ─ Continuation table (no gap above on continuation pages) ─ */
.quote-paper .qp-cont-table {
  margin-top: 0;
}

/* ─ "Continued on page N" note at bottom of non-last pages ─ */
.quote-paper .qp-cont-note {
  text-align: right;
  font-size: 10pt;
  color: #666;
  font-style: italic;
  padding: 2mm 4mm 3mm;
}

/* ─ NB* notes — color #808080 from Word paragraph runs ─ */
.quote-paper .qp-notes {
  padding: 3mm 4mm 2mm;
  font-size: 11pt;
  color: #808080;
  line-height: 1.7;
  border-top: 1px solid #bbb;
}
.quote-paper .qp-notes-extra {
  padding: 0 4mm 3mm;
  font-size: 11pt;
  color: #808080;
}

/* ── Toast ───────────────────────────────────────────── */
#toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--primary); color: #fff; padding: 12px 18px;
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  font-size: 13px; font-weight: 500; animation: toastIn 0.3s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
@keyframes toastIn { from { opacity:0; transform: translateX(40px); } to { opacity:1; transform: translateX(0); } }

/* ── Modals ───────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  min-width: 320px; max-width: 520px; width: 90%; box-shadow: var(--shadow-md);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform: scale(0.93); } to { opacity:1; transform: scale(1); } }
.modal-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Misc helpers ─────────────────────────────────────── */
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
hr.section-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.no-items { text-align: center; padding: 32px; color: var(--text-muted); font-style: italic; }
.highlight { background: #fffce0; }
.tag { display: inline-block; background: #e0e7ff; color: #3730a3; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.tag-cam { background: #fef3c7; color: #92400e; }
.tag-new { background: #d1fae5; color: #065f46; }

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 800px) {
  #app { padding: 12px; }
  #header nav button { padding: 6px 10px; font-size: 12px; }
  .totals-grid { grid-template-columns: 1fr; }
  #quote-pages .quote-paper { width: 100%; padding: 4mm; }
}
