/* Styles for src/routes/reports.tsx pages. Same tokens as app.css and finance.css. */

/* Reports & files list */
.report-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.report-item { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.report-item p { margin: .2rem 0 0; font-size: .86rem; }
.report-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.small-note { font-size: .84rem; margin: .5rem 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.panel-head h2 { margin-bottom: .2rem; }
.panel-head p { margin: 0 0 .5rem; }

/* Statutory tracker */
.stat-table input { min-width: 0; width: 100%; padding: .35rem .5rem; font-size: .88rem; }
.stat-table td:first-child { min-width: 9rem; }
.stat-table td:first-child small { font-size: .76rem; }
.stat-ref { display: grid; gap: 4px; min-width: 11rem; }
.stat-table input[type=date] { min-width: 9.5rem; }
.stat-status { display: grid; justify-items: start; }
.stat-by { font-size: .74rem; margin-top: 3px; white-space: nowrap; }

/* Payment history: transfers per paid run */
.transfers { margin-top: .6rem; border: 1px solid var(--border); border-radius: 14px; padding: .5rem .85rem; }
.transfers summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
.transfers[open] summary { margin-bottom: .4rem; }

/* Employee portal */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.facts > div { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.facts dt { font-size: .74rem; color: var(--text-2); }
.facts dd { margin: .15rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

/* Audit log */
.audit-filter { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0 12px; align-items: end; }
.audit-filter label { margin-bottom: .6rem; min-width: 0; }
.audit-filter input, .audit-filter select { min-width: 0; width: 100%; }
.audit-buttons { display: flex; gap: 6px; margin-bottom: .6rem; }
.audit-detail { overflow-wrap: anywhere; max-width: 36rem; }
.audit-table code { font-size: .82rem; white-space: nowrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 1rem; }
.pager [aria-disabled=true] { opacity: .45; pointer-events: none; }

/* Summary report (print-ready) */
.report-doc h3 { font-size: .95rem; margin: 1.2rem 0 .4rem; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: .8rem; }
.doc-head h2 { margin: 0; }
.doc-head p { margin: .2rem 0 0; }
.doc-meta { display: grid; gap: 2px; text-align: right; justify-items: end; font-size: .88rem; }
.draft-stamp { margin-top: 4px; font-size: .8rem; letter-spacing: .04em; border: 1.5px solid currentColor; }
.doc-totals { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 1rem; }
.doc-totals > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.doc-totals span { font-size: .74rem; color: var(--text-2); }
.doc-totals b { font-variant-numeric: tabular-nums; }
.doc-table { font-size: .8rem; }
.doc-table td:first-child { min-width: 8.5rem; }
.doc-table th, .doc-table td { padding: .4rem .45rem; }
.doc-table td.r, .doc-table th.r { white-space: nowrap; }
.doc-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.doc-foot { margin-top: 1rem; }

@media (max-width: 900px) {
  .doc-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .doc-meta { text-align: left; justify-items: start; }
  .report-list { grid-template-columns: minmax(0, 1fr); }
  .stat-table input[type=date] { min-width: 0; max-width: 62%; }
  .stat-ref { min-width: 0; width: 62%; }
  .stat-status { justify-items: end; }
  .stat-table td:first-child { min-width: 0; }
  .audit-detail { max-width: none; text-align: left; }
}

@media print {
  @page { size: A4 landscape; margin: 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  .sidebar, .topbar, .nav-scrim, .hub-tabs, .no-print { display: none !important; }
  .with-nav { display: block !important; }
  .page { padding: 0 !important; max-width: none !important; animation: none !important; }
  .report-doc { border: 0 !important; padding: 0 !important; background: #fff !important; box-shadow: none !important; }
  .report-doc .scroll { overflow: visible !important; }
  body::before { display: none !important; }
  .doc-table { display: table !important; width: 100% !important; }
  .doc-table tbody { display: table-row-group !important; }
  .doc-table thead { display: table-header-group !important; }
  .doc-table tfoot { display: table-footer-group !important; }
  .doc-totals { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  .doc-meta { text-align: right !important; justify-items: end !important; }
  .doc-table tr { display: table-row !important; border: 0 !important; padding: 0 !important; background: none !important; }
  .doc-table td { display: table-cell !important; border-bottom: 1px solid #ccc !important; text-align: right; }
  .doc-table td:first-child { text-align: left; }
  .doc-table td::before { content: none !important; }
  .doc-table { font-size: 8pt; }
  .doc-totals > div, .facts > div { background: #f2f2f2 !important; }
  .doc-two { grid-template-columns: 1fr 1fr !important; break-inside: avoid; }
  .draft-stamp { color: #b00 !important; background: none !important; }
  .table th, .table td { color: #000 !important; }
  tr { break-inside: avoid; }
}
