/* Matrix tables: one quiet, readable system for the application screens. */
@media screen {
  .main table {
    width:100%;border-collapse:separate;border-spacing:0;font-size:14px;line-height:1.5;
    color:#24364f;font-variant-numeric:tabular-nums;
  }
  .main table :is(th,td) {
    padding:13px 18px;border:0;border-bottom:1px solid #e8edf3;
    vertical-align:middle;background-clip:padding-box;
  }
  .main table thead th {
    background:#fafbfc;color:#596579;font-size:13px;font-weight:600;
    line-height:1.45;text-transform:none;letter-spacing:0;text-align:left;
  }
  .main table td {font-weight:400;}
  .main table td strong {font-weight:600;}
  .main table td>small:not(.field-error):not(.pill) {font-size:12px;line-height:1.5;color:#66758a;margin-top:4px;}
  .main table tbody tr:last-child>:is(th,td) {border-bottom:0;}
  .main table:not(.worksheet-table):not(.payroll-register-table) tbody tr>:is(th,td) {background-color:#fff;}
  .main table:not(.worksheet-table):not(.payroll-register-table) tbody tr:hover>:is(th,td),
  .main table:not(.worksheet-table):not(.payroll-register-table) tbody tr:focus-within>:is(th,td) {background-color:#f7f9fc;}
  .main table:not(.worksheet-table):not(.payroll-register-table) tbody tr:has(input[type=checkbox]:checked)>td {background-color:#f1f6fc;}
  .main table :is(.money,.numeric,[data-calculated]) {text-align:right;font-variant-numeric:tabular-nums;}
  .main table input[type=checkbox] {margin:0;vertical-align:middle;accent-color:#245ca2;}
  .main table tfoot :is(th,td) {
    border-top:1px solid #dce4ed;border-bottom:0;background:#fafbfc;font-size:13px;
    font-weight:600;letter-spacing:0;text-transform:none;
  }
  .main table :is(a.action-link,td:last-child>a:not(:has(strong))):not(.primary):not(.danger):not(.pill) {
    display:inline-flex;align-items:center;justify-content:center;min-height:36px;
    padding:6px 11px;margin:2px 4px 2px 0;border:1px solid #dce4ed;border-radius:6px;
    background:#fff;color:#304f77;font-size:13px;font-weight:500;line-height:1.4;
    text-decoration:none;box-shadow:none;
  }
  .main table :is(a.action-link,td:last-child>a:not(:has(strong))):not(.primary):not(.danger):not(.pill):hover {
    color:#173e74;border-color:#afc0d5;background:#f1f5fa;
  }
  .main table td form button:not(.primary):not(.danger):not(.error-details-trigger) {
    min-height:36px;padding:6px 11px;font-size:13px;font-weight:500;border-radius:6px;box-shadow:none;
  }
  .main table :is(td,th)>a:first-child:not(.button):not(.action-link) {font-weight:500;}
  .main .table-wrap {scrollbar-width:thin;scrollbar-color:#b7c2d0 #f5f7fa;}
  .main .table-wrap::-webkit-scrollbar {height:9px;width:9px;}
  .main .table-wrap::-webkit-scrollbar-track {background:#f5f7fa;}
  .main .table-wrap::-webkit-scrollbar-thumb {background:#b7c2d0;border:2px solid #f5f7fa;border-radius:8px;}
  .main .table-wrap td[colspan]:only-child {padding:36px 24px;color:#66758a;}
  .main .panel:has(.table-wrap) {box-shadow:none;}
  .main .import-preview-table tbody tr:nth-child(even) {background:transparent;}

  /* Preserve the payroll grid's frozen column and explicit editing states. */
  .main .panel.payroll-worksheet .worksheet-table thead th {background:#fafbfc;color:#596579;font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;}
  .main .panel.payroll-worksheet .worksheet-table tbody th.worksheet-employee {font-size:14px;color:#24364f;background:#fff;letter-spacing:0;text-transform:none;}
  .main .panel.payroll-worksheet .worksheet-table .worksheet-employee {box-shadow:1px 0 0 #e3e9f1;}
  .main .panel.payroll-worksheet .worksheet-table :is(input:not([type=checkbox]),select,textarea) {background:#fafbfc;border-color:#d5deea;border-radius:6px;}
  .main .panel.payroll-worksheet .worksheet-table :is(input:not([type=checkbox]),select,textarea):focus {background:#fff;}
  .main .panel.payroll-worksheet .worksheet-table [data-calculated] {background:#fafcfe;font-variant-numeric:tabular-nums;}
  .main .panel.payroll-worksheet .worksheet-table tr.worksheet-dirty [data-calculated] {background:#fff5da;}
  .main .panel.payroll-worksheet .worksheet-table .field-error.error-is-compact {padding:0;border:0;background:transparent;margin:4px 0;}
  .main .payroll-register-table :is(th,td):first-child {box-shadow:1px 0 0 #e3e9f1;}
  .main .payroll-register-table thead th:not(:first-child):not(:last-child) {text-align:right;}
  .main .payroll-register-table td:last-child {text-align:left;}
  .main .report-table :is(td,th) {border-left:0;border-right:0;}

  @media(max-width:760px) {
    .main table :is(th,td) {padding:12px 16px;}
    .main table thead th {font-size:13px;}
    .main table :is(a.action-link,td:last-child>a:not(:has(strong))):not(.primary):not(.danger):not(.pill),
    .main table td form button:not(.primary):not(.danger):not(.error-details-trigger) {min-height:44px;padding:9px 12px;}
    .main .panel.payroll-worksheet .worksheet-table :is(input:not([type=checkbox]),select,textarea) {font-size:16px;}
  }
}

@media screen {
  /* A linked status and its action share one outline instead of nested boxes. */
  .main table a:has(> .pill) {gap:8px;}
  .main table a>.pill {margin:0;padding:0;border:0;background:transparent;}
}

/* Document previews use the same visual language on screen; print rules stay separate. */
@media screen {
  .report-print .report-table, .payslip-print .payslip-components {width:100%;border-collapse:separate;border-spacing:0;font-size:14px;line-height:1.5;color:#24364f;font-variant-numeric:tabular-nums;}
  .report-print .report-table :is(th,td), .payslip-print .payslip-components :is(th,td) {padding:12px 16px;border:0;border-bottom:1px solid #e8edf3;vertical-align:middle;}
  .report-print .report-table thead th, .payslip-print .payslip-components thead th {background:#fafbfc;color:#596579;font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;}
  .report-print .report-table tbody tr:last-child>td, .payslip-print .payslip-components tbody tr:last-child>td {border-bottom:0;}
  .payslip-print .payslip-components :is(th,td):last-child {text-align:right;}
}
