/* Extras on top of style.css: receipt, print rules, two-column layout, tabs. */

/* ---- 56mm receipt: hidden on screen, the only thing printed when body has .printing-receipt */
#receipt { display: none; width: 56mm; padding: 2mm; font-family: "Times New Roman", serif; font-size: 10pt; line-height: 1.35; color: #000; }
#receipt .r-head { text-align: center; font-size: 8.5pt; font-weight: bold; }
#receipt .r-gap { height: 3mm; }
#receipt img { display: block; max-width: 100%; margin: 3mm auto 0; }

@media print {
  .site-header, .side-nav, .bottom-nav, .nav-backdrop, .no-print, .tab-bar { display: none !important; }
  body { padding-bottom: 0; }
  .site-content { padding: 0; }
  .table-wrapper--scroll { max-height: none; overflow: visible; }
  body.printing-receipt .page-layout { display: none; }
  body.printing-receipt #receipt { display: block; }
}

/* ---- two-column pages: stacks below 900px, flows normally when printing */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.two-col--side { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.two-col > div { min-width: 0; }
@media (max-width: 900px) { .two-col, .two-col--side { grid-template-columns: minmax(0, 1fr); } }
@media print { .two-col, .two-col--side { display: block; } }

/* ---- admission: tabs, search bar, clickable result rows */
.tab-bar { display: flex; gap: 4px; margin: 0 0 20px; border-bottom: 2px solid var(--border-light); }
.tab { margin-bottom: -2px; padding: 10px 22px; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--text-muted); font: inherit; font-weight: 600; cursor: pointer; }
.tab:hover { color: var(--text-color); }
.tab.active { color: var(--header-color); border-bottom-color: var(--header-color); }
.tab[hidden] { display: none; }

.search-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.search-bar .form-group { flex: 1 1 140px; }

#results tr[data-i] { cursor: pointer; }
#results tr[data-i]:hover td { background: #f3f8fd; }
#results tr.is-selected td { background: #eaf2fb; }
#results .data-table td, #results .data-table th { white-space: normal; }
#results .cell-action { white-space: nowrap; }

#person-card .alert { margin: 15px 0 0; }
#person-card .form-actions { margin-top: 20px; }

/* dashboard: one full-width chart per row */
.chart-grid { grid-template-columns: minmax(0, 1fr); }

/* select: custom arrow, inset to line up with the date-picker icon */
.form-group select:not([multiple]) {
  appearance: none;
  padding-right: 36px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23333' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 20px center;
}

/* compact print for reports */
@media print {
  body:not(.printing-receipt) { font-size: 9px; }
  .page-header { margin-bottom: 6px; }
  .page-title { font-size: 13px; line-height: 16px; margin-bottom: 2px; }
  .card { padding: 0; border: 0; margin-bottom: 6px; }
  .section { margin-bottom: 6px; }
  .info-grid { gap: 8px; }
  .info-value--lg { font-size: 14px; line-height: 16px; }
  .data-table th, .data-table td { padding: 2px 6px; font-size: 9px; line-height: 11px; }
  .data-table thead { display: table-header-group; }   /* repeat header on each page */
  .data-table tr { break-inside: avoid; }
}

/* no browser headers/footers on any print (margins are added back below) */
@page { margin: 0; }

/* admitted report: Crystal-style print layout (hidden on screen) */
#print-report { display: none; }
@media print {
  body:not(.printing-receipt) { padding: 0 10mm; }
  .page { padding: 10mm 0; }

  .page--report { padding: 0; }
  .page--report > :not(#print-report) { display: none !important; }
  #print-report { display: block; color: #000; font-family: "Times New Roman", serif; font-size: 10pt; }
  #print-report table { margin: 0 auto; border-collapse: separate; border-spacing: 24px 0; }
  #print-report table + table { break-before: page; }
  #print-report thead { display: table-header-group; }
  #print-report tfoot { display: table-footer-group; }
  #print-report th { padding: 4px 0; font-weight: normal; text-align: center; border-bottom: 1px solid #000; }
  #print-report th.pr-title { padding: 10mm 0 14px; font-size: 10pt; border-bottom: 0; }
  #print-report td { padding: 1px 0; white-space: nowrap; }
  #print-report tbody tr:first-child td { padding-top: 12px; }
  #print-report tfoot td { height: 10mm; }
  #print-report .c { text-align: center; }
}