/*
 * Payroll table system v1 — one visual contract for every Payroll tab.
 * This stylesheet loads after payroll.css to consolidate former scattered rules.
 * Semantics: purple = normal/primary actions, green = import, red = destructive;
 * reconciliation/status badge colours remain specific to their meanings.
 * Do not change table contents, business logic, or the print layout.
 */
.payroll-page,
.payroll-modal-card{
  --payroll-grid-text:#382a45;
  --payroll-grid-emphasis:#281a36;
  --payroll-grid-muted:#766980;
  --payroll-grid-heading:#61536e;
  --payroll-grid-rule:#eee8f3;
  --payroll-grid-heading-bg:#faf8fc;
  --payroll-grid-soft-bg:#f3eaff;
  --payroll-grid-soft-border:#e6d8f8;
  --payroll-grid-soft-ink:#6225b7;
}

/* Header typography and rows: same font/color hierarchy in personnel,
   services, decrees, periods, performance, inline details and modal tables. */
.payroll-page .payroll-table thead th,
.payroll-modal-card .payroll-table thead th{
  color:var(--payroll-grid-heading)!important;
  background:var(--payroll-grid-heading-bg)!important;
  font-size:11.5px!important;
  font-weight:850!important;
  line-height:1.5!important;
  border-bottom-color:var(--payroll-grid-rule)!important;
}
.payroll-page .payroll-table .payroll-sort-button,
.payroll-modal-card .payroll-table .payroll-sort-button{
  color:inherit!important;
  font-size:inherit!important;
  font-weight:850!important;
}
/* Hover/sorted headers keep their purple feedback, rather than inheriting the neutral header ink. */
.payroll-page .payroll-table .payroll-sort-button:is(:hover,.is-sorted){
  color:#6d28d9!important;
}
.payroll-page .payroll-table tbody td,
.payroll-modal-card .payroll-table tbody td{
  color:var(--payroll-grid-text);
  font-size:12px!important;
  line-height:1.65!important;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  border-bottom-color:var(--payroll-grid-rule)!important;
}
.payroll-page .payroll-table tbody td > b,
.payroll-page .payroll-table tbody .payroll-person b,
.payroll-page .payroll-table tbody .payroll-service-main > b,
.payroll-modal-card .payroll-table tbody td > b{
  color:var(--payroll-grid-emphasis)!important;
  font-weight:900!important;
}
.payroll-page .payroll-table tbody td > small,
.payroll-page .payroll-table tbody .payroll-person small,
.payroll-page .payroll-table tbody .payroll-service-main > small,
.payroll-modal-card .payroll-table tbody td small{
  color:var(--payroll-grid-muted)!important;
  font-weight:500!important;
}
.payroll-page .payroll-table tbody :is(.payroll-state,.payroll-recon,.payroll-model-badge),
.payroll-modal-card .payroll-table tbody :is(.payroll-state,.payroll-recon,.payroll-model-badge){
  font-size:10.5px!important;
  font-weight:850!important;
  line-height:1.4!important;
  /* Keep semantic badge foreground/background rules from payroll.css. */
}

/* A table must scroll within its own panel instead of cutting off the final
   action column. Fixed headers and vertical scroll remain unchanged. */
.payroll-page .payroll-directory .payroll-table-wrap{
  overflow-x:auto!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table{
  min-width:1040px!important;
}
.payroll-page .payroll-directory[data-directory="services"] .payroll-services-table{
  min-width:960px!important;
}
.payroll-page .payroll-directory[data-directory="decrees"] .payroll-decrees-table{
  min-width:920px!important;
}
.payroll-page .payroll-directory[data-directory="periods"] .payroll-periods-table{
  min-width:1000px!important;
}
.payroll-page .payroll-directory[data-directory="performance"] .payroll-performance-table{
  min-width:1020px!important;
}

/* Personnel table (no colgroup in the renderer): 4 + 23 + 9 + 9 + 9 +
   10 + 8 + 28 = 100. Reserve room for all three full-label actions. */
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(1){width:4%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(2){width:23%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(3){width:9%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(4){width:9%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(5){width:9%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(6){width:10%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(7){width:8%!important}
.payroll-page .payroll-directory[data-directory="physicians"] .payroll-services-table :is(th,td):nth-child(8){width:28%!important}

/* Services table: transfer 3% from long titles to the two action buttons. */
.payroll-page .payroll-directory[data-directory="services"] .payroll-services-table col.col-service{width:26%!important}
.payroll-page .payroll-directory[data-directory="services"] .payroll-services-table col.col-actions{width:15%!important}

/* Performance may have four actions (details, payslip, approve, profile).
   Redistribute only within its existing 100% colgroup. */
.payroll-page .payroll-directory[data-directory="performance"] .payroll-performance-table col.col-main{width:19%!important}
.payroll-page .payroll-directory[data-directory="performance"] .payroll-performance-table col.col-money{width:12%!important}
.payroll-page .payroll-directory[data-directory="performance"] .payroll-performance-table col.col-actions{width:28%!important}

/* Decree actions can include view, publish and void/delete. */
.payroll-page .payroll-directory[data-directory="decrees"] .payroll-decrees-table col.col-main{width:23%!important}
.payroll-page .payroll-directory[data-directory="decrees"] .payroll-decrees-table col.col-number{width:14%!important}
.payroll-page .payroll-directory[data-directory="decrees"] .payroll-decrees-table col.col-status{width:11%!important}
.payroll-page .payroll-directory[data-directory="decrees"] .payroll-decrees-table col.col-actions{width:26%!important}

/* Uniform row-action layout and touch targets across all directories.
   Never wrap, clip, or conceal action labels. */
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] > td:last-child{
  overflow:visible!important;
  white-space:nowrap!important;
  padding-inline:6px!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions){
  display:flex!important;
  flex-flow:row nowrap!important;
  justify-content:center!important;
  align-items:center!important;
  gap:4px!important;
  min-width:0!important;
  width:100%!important;
  white-space:nowrap!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions) > .btn,
.payroll-page .payroll-directory[data-directory="performance"] .payroll-performance-table tr[data-directory-row] .payroll-row-actions > .btn{
  display:inline-flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  min-width:0!important;
  max-width:none!important;
  min-height:30px!important;
  padding:5px 7px!important;
  font-family:inherit!important;
  font-size:10px!important;
  font-weight:850!important;
  line-height:1.4!important;
  border-radius:8px!important;
  white-space:nowrap!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions) > .btn span{
  display:inline!important;
  white-space:nowrap!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions) > .btn i{
  font-size:10px!important;
  flex:0 0 auto!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions) > .btn--soft:not(.payroll-delete-action){
  color:var(--payroll-grid-soft-ink)!important;
  background:var(--payroll-grid-soft-bg)!important;
  border:1px solid var(--payroll-grid-soft-border)!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions) > .btn--soft:not(.payroll-delete-action):hover{
  background:#eadcff!important;
}
.payroll-page .payroll-directory .payroll-table tbody tr[data-directory-row] :is(.payroll-row-actions,.payroll-service-actions) > .btn:focus-visible{
  outline:2px solid #8b5cf6!important;
  outline-offset:2px!important;
}


/* Payroll service readiness discovery: visual warnings use the same tone as
   the overview's incomplete tariff count and do not change saved data. */
.payroll-page .payroll-service-shortcuts{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin:0 0 12px;
}
.payroll-page .payroll-service-shortcut{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:34px;
  padding:6px 11px;
  border:1px solid #e7dbf4;
  border-radius:10px;
  background:#faf7ff;
  color:#6537a1;
  font-family:inherit;
  font-size:11px;
  font-weight:850;
  cursor:pointer;
}
.payroll-page .payroll-service-shortcut:hover{background:#f2ebff;border-color:#d7c2f2}
.payroll-page .payroll-service-shortcut--warning{
  background:#fff8ed;
  color:#9b4e0b;
  border-color:#f4ddba;
}
.payroll-page .payroll-service-shortcut--warning:hover{background:#fff0d9}
.payroll-page .payroll-service-shortcut b{
  display:grid;
  place-items:center;
  min-width:22px;
  min-height:22px;
  border-radius:7px;
  background:#ffead0;
  color:#894006;
  font-size:11px;
}
.payroll-page .payroll-service-shortcut:focus-visible,
.payroll-page .payroll-overview-needs-link:focus-visible{
  outline:2px solid #8b5cf6;
  outline-offset:2px;
}
.payroll-page .payroll-services-table .payroll-service-config-hint{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  margin-top:4px;
  color:#aa5512!important;
  font-size:10px!important;
  font-weight:800!important;
  white-space:normal;
}
.payroll-page .payroll-directory[data-directory="services"] .payroll-service-money .payroll-recon--rate_missing{
  background:#fff7ed;
  color:#a3470b;
  padding:4px 7px;
}
.payroll-page .payroll-overview-needs-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
  padding:9px 12px;
  border:1px solid #edcd99;
  border-radius:11px;
  background:#fff1d8;
  color:#8d470c;
  font-family:inherit;
  font-size:11.5px;
  font-weight:850;
  white-space:nowrap;
  cursor:pointer;
}
.payroll-page .payroll-overview-needs-link:hover{background:#ffe8c6}
@media(max-width:840px){
  .payroll-page .payroll-overview-status{flex-wrap:wrap}
  .payroll-page .payroll-overview-needs-link{max-width:100%;white-space:normal}
}
