.oa-learner-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 0;
}
.oa-learner-filters .field { flex: 1 1 160px; }
.oa-learner-caption { padding: 12px 20px; color: var(--muted); font-size: 12px; }
.oa-learner-table { white-space: normal; }
.oa-learner-table tbody th { background: transparent; border-top: 1px solid var(--line); color: var(--ink); }
.oa-learner-table :is(th, td) { vertical-align: top; }
.oa-learner-table :is(th, td):first-child { min-width: 100px; }
.oa-learner-table tfoot td { border-top: 1px solid var(--line); font-weight: 650; }
.oa-learner-number { font-variant-numeric: tabular-nums; }
.oa-learner-number small { display: block; color: #81531c; }
.oa-learner-checks { color: var(--muted); font-size: 12px; }
.oa-learner-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.oa-learner-detail > td { padding-block: 6px; }
.oa-learner-sessions > summary { width: fit-content; cursor: pointer; font-weight: 650; color: var(--brand); }
.oa-learner-sessions[open] { margin-bottom: 6px; }
.oa-learner-sessions[open] table { margin-top: 8px; }

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  :root { --ink: #152536; --muted: #435268; --line: #bdc8d2; }
  body { background: #fff; color: var(--ink); font-size: 9.5pt; line-height: 1.35; }
  .shell, .main-area, .content, .split, .stack { display: block; min-height: 0; max-width: none; width: auto; }
  .content { margin: 0; padding: 0; }
  .sidebar, .topbar, .mobile-tabbar, #sign-in, .toast, #editor, .no-print, [data-no-print],
  .button, .icon-button, .page-actions, .hero-actions, .item-actions,
  .oa-learner-actions, .oa-learner-filters, .oa-procedure-tools, .communication-filters,
  .procedure-search, .gantt-scroll + .text-link, .panel-header .text-link,
  .approval-summary .field { display: none !important; }
  .hero {
    display: block; overflow: visible; margin-bottom: 5mm; padding: 0 0 3mm;
    background: #fff; color: var(--ink); border-radius: 0; border-bottom: 1px solid var(--line);
  }
  .hero::before, .hero::after { display: none; }
  .hero h1, .page-head h1 { font-size: 20pt; }
  .hero-project, .hero-description { color: var(--ink); }
  .page-head { display: block; margin-bottom: 5mm; }
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 3mm 0 5mm; gap: 2.5mm; }
  .metric { display: block; padding: 2.5mm; break-inside: avoid; }
  .metric strong { font-size: 16pt; }
  .metric span { font-size: 8pt; }
  .panel { overflow: visible; border-radius: 3px; margin-bottom: 4mm; }
  .panel-header, .panel-body, .item, .oa-learner-caption { padding: 2.5mm 3.5mm; }
  .panel-header h2, .training-gantt .panel-header h2 { font-size: 12pt; }
  .panel-header, .schedule-day-title, .page-head, h1, h2, h3, summary {
    break-after: avoid-page;
  }
  .table-wrap, .gantt-scroll { overflow: visible; max-height: none; }
  table { width: 100%; max-width: 100%; white-space: normal; font-size: 8.5pt; }
  thead { display: table-header-group; break-inside: avoid-page; }
  tfoot { display: table-footer-group; }
  tr, .item, .session-procedure, .history-procedures > li { break-inside: avoid-page; }
  th, td { min-width: 0; padding: 1.25mm 1.75mm; white-space: normal; overflow-wrap: anywhere; }
  th { font-size: 8.5pt; }
  th, .badge, .gantt-status, .gantt-lane, .gantt-table thead th {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .approval-table td, .approval-table td:last-child, .approval-table tbody th,
  .oa-learner-table :is(th, td):first-child { min-width: 0; }
  .approval-table tr > :last-child { display: none; }
  :is(.team-permissions-table, .member-permissions-table) { table-layout: fixed; }
  .team-permissions-table thead th:first-child { width: 20%; }
  .team-permissions-table thead th:nth-child(2) { width: 22%; }
  .team-permissions-table thead th:nth-child(5) { width: 26%; }
  .member-permissions-table thead th:first-child { width: 30%; }
  .member-permissions-table thead th:nth-child(4) { width: 20%; }
  .member-cell-main { display: block; }
  .member-avatar, .perm-filter-bar .field { display: none; }
  .perm-filter-bar { padding: 2mm; }
  .perm-filter-summary { margin: 0; }
  :is(.team-permissions-table, .member-permissions-table) :is(.perm-chip, .perm-mod, .badge) {
    max-width: 100%; white-space: normal; overflow-wrap: anywhere;
    font-size: 8pt; padding: 0.5mm 1mm;
  }
  .member-permissions-table .perm-mod-grid { grid-template-columns: 1fr; gap: 1mm; }
  .oa-learner-number small, .item-meta, .oa-learner-checks { font-size: 8pt; }
  .oa-learner-detail:has(details:not([open])) { display: none; }
  .oa-learner-sessions[open] table { margin-top: 2mm; }
  .gantt-table { table-layout: fixed; width: 100%; }
  .gantt-table thead, .gantt-table .gantt-session { position: static; }
  .gantt-table .gantt-session { min-width: 0; width: 34%; max-width: none; padding: 1.5mm 2mm; }
  .gantt-table thead th { padding: 1mm 0.5mm; }
  .gantt-table .gantt-lane, .gantt-table .gantt-period { width: auto; min-width: 0; white-space: normal; }
  .gantt-table .gantt-period, .gantt-time, .gantt-status { font-size: 7pt; }
  .gantt-summary { padding: 2mm 3mm; }
  .gantt-lane svg { height: 5mm; }
  dialog::backdrop { display: none; }
  body:has(#training-history[open]) .shell,
  body:has(#paperwork-dialog[open]) .shell { display: none !important; }
  #training-history[open],
  #paperwork-dialog[open] {
    position: static; display: block; margin: 0; width: 100%; max-width: none; max-height: none;
    overflow: visible; border: 0; border-radius: 0; box-shadow: none;
  }
  #training-history .dialog-header,
  #paperwork-dialog .dialog-header { padding: 0 0 3mm; }
  .paperwork-sheet { padding: 0; font-size: 9.5pt; }
  .paperwork-sign-box { break-inside: avoid; }
}
