/* ============================================
   CardVault Elite — print.css
   Vault export / printable inventory styles
   ============================================ */

@media print {
  /* Paper is always white, whatever the theme. html[data-theme] matches the
     themes' own selectors and comes later, so it wins (a plain :root lost to
     Night Vault, which printed white text on white paper). */
  :root, html[data-theme] {
    color-scheme: light;
    --bg-page: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-elevated: #FFFFFF;
    --bg-subtle: #F2F2F2;
    --bg-accent: #F2F2F2;
    --text-primary: #000000;
    --text-secondary: #444444;
    --text-muted: #555555;
    --accent-text: #222222;
    --border: #CCCCCC;
    --border-strong: #999999;
    --success: #1E6B34;
    --error: #A1261B;
    --warning: #7A5200;
    --info: #1F4E79;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt;
  }

  .app-sidebar,
  .bottom-nav,
  .app-topbar,
  .install-banner,
  .toast-stack,
  .modal-backdrop,
  .drawer,
  .drawer-backdrop,
  .btn,
  .toolbar,
  .filter-panel,
  .quick-add-row,
  .no-print {
    display: none !important;
  }

  .app-content {
    padding: 0;
    max-width: 100%;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #CCCCCC;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    color: #000000 !important;
  }

  .page-header {
    border-bottom: 2px solid #000000;
    padding-bottom: 12pt;
    margin-bottom: 16pt;
  }

  a {
    color: #000000 !important;
    text-decoration: underline;
  }

  .cv-hero__art { display: none !important; }
  .cv-hero { background: #FFFFFF !important; border: 1px solid #CCCCCC; box-shadow: none; }
  .cv-hero__grid { grid-template-columns: minmax(0, 1fr) !important; grid-template-areas: "text" "foot" !important; }

  .print-only {
    display: block !important;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    page-break-inside: auto;
  }
  table tr { page-break-inside: avoid; }
  table th, table td {
    border: 1px solid #CCCCCC;
    padding: 6pt 8pt;
    text-align: left;
    font-size: 10pt;
  }
  table th {
    background: #F0F0F0;
    font-weight: 600;
  }

  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 9pt;
    color: #666666;
  }
}

.print-only { display: none; }

/* Binder checklist (#storage/<id> → Print checklist): one sheet per page. */
@media print {
  .binder-print__page { break-after: page; page-break-after: always; }
  .binder-print__page:last-child { break-after: auto; page-break-after: auto; }
  .binder-print__page h2 { font-size: 14pt; margin-bottom: 10pt; }
  .binder-print__grid { display: grid; gap: 6pt; }
  .binder-print__grid--2 { grid-template-columns: repeat(2, 1fr); }
  .binder-print__grid--3 { grid-template-columns: repeat(3, 1fr); }
  .binder-print__grid--4 { grid-template-columns: repeat(4, 1fr); }
  .binder-print__pocket {
    border: 1px solid #000000;
    min-height: 2.6in;
    padding: 6pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .binder-print__grid--4 .binder-print__pocket { min-height: 2.1in; }
  .binder-print__head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 4pt; }
  .binder-print__box { width: 12pt; height: 12pt; border: 1.5px solid #000000; display: inline-block; }
  .binder-print__name { font-weight: 700; font-size: 10pt; }
  .binder-print__meta { font-size: 8.5pt; color: #333333; }
  .binder-print ul { list-style: none; padding: 0; font-size: 10pt; line-height: 1.8; }
}

/* Insurance report (The Vault → Insurance → Print / save as PDF). */
@media print {
  body.print-sheet-only .page-root { display: none !important; }
  .insurance-print h1 { font-size: 16pt; margin-bottom: 8pt; }
  .insurance-print .ip-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 2pt 16pt; font-size: 10pt; margin-bottom: 10pt; }
  .insurance-print .ip-summary { border: 1.5px solid #000000; padding: 8pt; margin-bottom: 12pt; font-size: 11pt; display: flex; gap: 18pt; flex-wrap: wrap; }
  .insurance-print .ip-item { display: flex; gap: 12pt; border-bottom: 1px solid #999999; padding: 8pt 0; font-size: 9.5pt; line-height: 1.45; break-inside: avoid; page-break-inside: avoid; }
  .insurance-print .ip-item__text { flex: 1; min-width: 0; }
  .insurance-print .ip-item__title { font-weight: 700; font-size: 11pt; }
  .insurance-print .ip-item__photos { display: flex; gap: 6pt; }
  .insurance-print .ip-item__photos img { height: 1.7in; width: auto; border: 1px solid #999999; }
  .insurance-print .ip-note { margin-top: 12pt; font-size: 8.5pt; color: #333333; }
}

/* Profit & tax report (#sales/report → Print / save as PDF). */
@media print {
  .tax-print h1 { font-size: 16pt; margin-bottom: 4pt; }
  .tax-print table { width: 100%; border-collapse: collapse; margin: 8pt 0; font-size: 9pt; }
  .tax-print th, .tax-print td { border: 1px solid #999999; padding: 3pt 5pt; text-align: left; }
  .tax-print__summary { width: auto !important; }
  .tax-print__summary th { background: #EEEEEE; }
  .tax-print__note { font-size: 8.5pt; color: #333333; margin-top: 10pt; }
}
