/* Study-wide reports (routes/reports.py): listings, missing forms, the audit trail page and the
   printable participant casebook. Uses the tokens in style.css. */

.listing-table td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.listing-table th { white-space: nowrap; }
.audit-table td.audit-val { max-width: 260px; overflow-wrap: anywhere; }
.q-filters input[type="search"], .q-filters input[type="date"] { min-width: 0; }

/* ------------------------------------------------------------------ casebook */
.cb-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.casebook { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 24px; box-shadow: var(--shadow); }
.cb-cover { border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 18px; }
.cb-kicker { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.cb-cover h1 { margin: 0 0 4px; }
.cb-title { margin: 0 0 12px; color: var(--muted); }
.cb-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; }
.cb-facts dt { font-weight: 600; }
.cb-facts dd { margin: 0; }
.cb-contents ol { margin: 6px 0 0; padding-left: 22px; columns: 2; }
.cb-group h2 { border-bottom: 1px solid var(--border-strong); padding-bottom: 4px; margin: 26px 0 10px; }
.cb-form { margin: 0 0 18px; break-inside: avoid-page; }
.cb-form h3 { font-size: 15px; margin: 14px 0 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cb-values, .cb-audit { width: 100%; border-collapse: collapse; font-size: 13px; }
.cb-values th, .cb-values td, .cb-audit th, .cb-audit td { border: 1px solid var(--border); padding: 4px 8px;
  text-align: left; vertical-align: top; }
.cb-values th[scope="row"] { width: 52%; font-weight: 500; color: var(--muted); }
.cb-values tr.cb-heading th { background: var(--surface-2); font-weight: 600; color: var(--text); }
.cb-audit { font-size: 12px; }
.cb-audit td { overflow-wrap: anywhere; }
.cb-sub { margin: 10px 0 4px; }
.cb-list { margin: 0 0 6px; padding-left: 20px; font-size: 13px; }
.cb-end { margin-top: 24px; text-align: center; }

@media (max-width: 640px) {
  .casebook { padding: 16px; }
  .cb-contents ol { columns: 1; }
  .cb-values th[scope="row"] { width: 45%; }
}

@media print {
  .no-print { display: none !important; }
  .casebook { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .cb-new-page { break-before: page; }
  .badge { border: 1px solid #999; }
  main, .container, .page { padding: 0 !important; max-width: none !important; }
}

/* ------------------------------------------------------------------ drug supply */
.supply-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.supply-actions .card h3 { margin-top: 0; }
.supply-actions input:not([type="number"]), .supply-actions select { width: 100%; }

/* ------------------------------------------------------------------ visit calendar */
.vc-counts { margin: 6px 0 4px; align-items: center; }
.vc-book summary { list-style: none; cursor: pointer; display: inline-block; }
.vc-book summary::-webkit-details-marker { display: none; }
.vc-book[open] { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; }
.vc-book-form { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: end; margin: 8px 0 6px; }
.vc-book-form label { display: flex; flex-direction: column; font-size: 12px; font-weight: 600; }
.vc-book-form input { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; }
.vc-table td { vertical-align: top; }
