/* HR Domain — composed from Foundation tokens; no alternate theme */

.ui-avatar--md {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.ui-avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.ui-avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 20px;
}

/* —— Page header —— */
.hr-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-4);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hr-page-header > div:first-child {
  min-width: 0;
  flex: 1 1 220px;
}

.hr-page-header__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-1);
  margin-bottom: var(--ui-space-2);
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-muted);
}

.hr-page-header__crumbs a {
  color: var(--ui-primary);
  text-decoration: none;
}

.hr-page-header__crumbs a:hover {
  text-decoration: underline;
}

.hr-page-header__sep {
  color: var(--ui-n-300);
}

.hr-page-header__title {
  margin: 0;
  font-size: var(--ui-fs-h2);
  line-height: var(--ui-lh-h2);
  font-weight: var(--ui-fw-h2);
  color: var(--ui-text-primary);
}

.hr-page-header__subtitle {
  margin: var(--ui-space-1) 0 0;
  font-size: var(--ui-fs-base);
  line-height: var(--ui-lh-base);
  color: var(--ui-text-secondary);
}

.hr-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
}

/* —— Filter bar —— */
.hr-filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-3);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--ui-space-3);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
}

.hr-filter-bar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
}

.hr-filter-bar__search {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
}

.hr-filter-bar__search .ui-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ui-n-400);
  pointer-events: none;
}

.hr-filter-bar__search .ui-input {
  padding-left: 34px;
  width: 100%;
}

.hr-filter-bar__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  flex: 2 1 320px;
}

.hr-filter-bar__filters .ui-select,
.hr-filter-bar__filters select.ui-input {
  min-width: 140px;
}

.hr-filter-bar__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  align-items: center;
}

.hr-filter-bar__chips .ui-badge {
  cursor: default;
}

.hr-filter-bar.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.hr-filter-bar.is-loading {
  position: relative;
}

.hr-filter-bar.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  border-radius: inherit;
}

/* —— Employee identity —— */
.hr-employee-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--ui-space-3);
  min-width: 0;
  max-width: 100%;
}

.hr-employee-identity > .ui-avatar {
  flex: 0 0 auto;
}

.hr-employee-identity__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.hr-employee-identity__name {
  font-size: var(--ui-fs-base);
  font-weight: 600;
  color: var(--ui-text-primary);
  line-height: var(--ui-lh-base);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hr-employee-identity__role {
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-secondary);
  line-height: var(--ui-lh-sm);
  overflow-wrap: anywhere;
}

.hr-employee-identity__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2);
  margin-top: 2px;
  max-width: 100%;
}

/* —— Employee profile header —— */
.hr-profile-header {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-4);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hr-profile-header__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-4);
  min-width: 0;
}

.hr-profile-header__person {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-4);
  min-width: 0;
  flex: 1 1 240px;
}

.hr-profile-header__person > div:last-child {
  min-width: 0;
  flex: 1 1 160px;
}

.hr-profile-header__tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  border-bottom: 1px solid var(--ui-border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  max-width: 100%;
}

.hr-profile-header__tabs .ui-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 40px;
}

.hr-profile-header__id {
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-muted);
}

.hr-profile-header__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-4);
  margin-top: var(--ui-space-2);
}

.hr-profile-header__fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hr-profile-header__fact span:first-child {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

/* —— Shift / availability cells —— */
.hr-shift-cell,
.hr-avail-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  min-width: 0;
  padding: 6px 4px;
  border-radius: var(--ui-radius-md);
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  font-size: var(--ui-fs-caption);
  line-height: var(--ui-lh-caption);
  text-align: center;
  color: var(--ui-text-primary);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hr-shift-cell > span:first-child,
.hr-avail-cell > span:first-child {
  max-width: 100%;
}

.hr-shift-cell__label,
.hr-avail-cell__label {
  font-weight: 500;
  color: var(--ui-text-secondary);
}

.hr-shift-cell[data-status="normal"] {
  background: var(--ui-primary-soft);
  border-color: #bfdbfe;
  color: var(--ui-primary-active);
}

.hr-shift-cell[data-status="preferred"] {
  background: var(--ui-success-soft);
  border-color: #bbf7d0;
  color: var(--ui-success-hover);
}

.hr-shift-cell[data-status="unavailable"] {
  background: var(--ui-n-100);
  border-color: var(--ui-border);
  color: var(--ui-n-500);
}

.hr-shift-cell[data-status="conflict"] {
  background: var(--ui-danger-soft);
  border-color: #fecaca;
  color: var(--ui-danger-hover);
  box-shadow: inset 0 0 0 1px var(--ui-danger);
}

.hr-shift-cell[data-status="leave"] {
  background: var(--ui-info-soft);
  border-color: #a5f3fc;
  color: var(--ui-info-hover);
}

.hr-shift-cell[data-status="absence"] {
  background: var(--ui-warning-soft);
  border-color: #fde68a;
  color: var(--ui-warning-hover);
}

.hr-shift-cell[data-status="overtime"] {
  background: var(--ui-warning-soft);
  border-color: #fde68a;
  color: var(--ui-warning-hover);
  box-shadow: inset 0 0 0 1px var(--ui-warning);
}

.hr-avail-cell[data-status="available"] {
  background: var(--ui-success-soft);
  border-color: #bbf7d0;
  color: var(--ui-success-hover);
}

.hr-avail-cell[data-status="unavailable"] {
  background: var(--ui-n-100);
  color: var(--ui-n-500);
}

.hr-avail-cell[data-status="shift-1"] {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-active);
}

.hr-avail-cell[data-status="shift-2"] {
  background: var(--ui-info-soft);
  color: var(--ui-info-hover);
}

.hr-avail-cell[data-status="prefer-off"] {
  background: var(--ui-warning-soft);
  color: var(--ui-warning-hover);
}

.hr-avail-cell[data-status="custom"] {
  background: var(--ui-info-soft);
  color: var(--ui-info-hover);
}

/* —— Schedule / availability grids —— */
.hr-schedule-wrap,
.hr-avail-wrap,
.hr-perm-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  box-sizing: border-box;
}

.hr-schedule-table,
.hr-avail-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.hr-schedule-table th,
.hr-schedule-table td,
.hr-avail-table th,
.hr-avail-table td {
  border-bottom: 1px solid var(--ui-border);
  border-right: 1px solid var(--ui-border);
  padding: var(--ui-space-2);
  vertical-align: middle;
}

.hr-schedule-table th:not(.hr-sticky-col),
.hr-schedule-table td:not(.hr-sticky-col),
.hr-avail-table th:not(.hr-sticky-col),
.hr-avail-table td:not(.hr-sticky-col) {
  min-width: 96px;
  width: 96px;
}

.hr-schedule-table th:last-child,
.hr-schedule-table td:last-child,
.hr-avail-table th:last-child,
.hr-avail-table td:last-child {
  border-right: 0;
}

.hr-schedule-table thead th,
.hr-avail-table thead th {
  background: var(--ui-surface-muted);
  font-size: var(--ui-fs-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ui-text-secondary);
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1;
}

.hr-schedule-table .hr-sticky-col,
.hr-avail-table .hr-sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--ui-surface);
  text-align: left;
  min-width: 160px;
  width: 180px;
  max-width: 200px;
  box-shadow: 2px 0 0 var(--ui-border);
}

.hr-schedule-table thead .hr-sticky-col,
.hr-avail-table thead .hr-sticky-col {
  z-index: 3;
  background: var(--ui-surface-muted);
}

/* —— Staffing indicator —— */
.hr-staffing {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: var(--ui-space-2);
  padding: 6px 10px;
  border-radius: var(--ui-radius-md);
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  font-weight: 700;
  font-size: var(--ui-fs-base);
  line-height: 1.2;
  max-width: 100%;
  box-sizing: border-box;
}

.hr-staffing > span:first-child {
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hr-staffing[data-status="full"] {
  background: var(--ui-success-soft);
  border-color: #bbf7d0;
  color: var(--ui-success-hover);
}

.hr-staffing[data-status="short"] {
  background: var(--ui-danger-soft);
  border-color: #fecaca;
  color: var(--ui-danger-hover);
}

.hr-staffing[data-status="over"] {
  background: var(--ui-warning-soft);
  border-color: #fde68a;
  color: var(--ui-warning-hover);
}

.hr-staffing__hint {
  font-size: var(--ui-fs-caption);
  font-weight: 500;
  color: inherit;
  opacity: 0.85;
}

/* —— Time entry —— */
.hr-time-entry {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(4, minmax(88px, 1fr)) auto;
  gap: var(--ui-space-2);
  align-items: center;
  padding: var(--ui-space-3);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hr-time-entry > .hr-employee-identity {
  min-width: 0;
}

.hr-time-entry__status {
  justify-self: end;
}

.hr-time-entry__metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hr-time-entry__metric span:first-child {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hr-time-entry__metric strong {
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-primary);
}

.hr-time-entry__diff.is-late {
  color: var(--ui-danger);
}

.hr-time-entry__diff.is-ok {
  color: var(--ui-success);
}

.hr-time-entry.is-loading {
  opacity: 0.6;
}

/* —— Punch status (kiosk) —— */
.hr-punch-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ui-space-3);
  min-height: 160px;
  padding: var(--ui-space-6);
  border-radius: var(--ui-radius-xl);
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  text-align: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.hr-punch-status__state {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ui-text-primary);
  overflow-wrap: anywhere;
}

.hr-punch-status__detail {
  font-size: var(--ui-fs-lg);
  color: var(--ui-text-secondary);
}

.hr-punch-status[data-state="off"] .hr-punch-status__state {
  color: var(--ui-n-500);
}

.hr-punch-status[data-state="on"] .hr-punch-status__state {
  color: var(--ui-success);
}

.hr-punch-status[data-state="break"] .hr-punch-status__state {
  color: var(--ui-warning-hover);
}

.hr-punch-status__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ui-space-2);
  margin-top: var(--ui-space-2);
  width: 100%;
  max-width: 480px;
}

.hr-punch-status__actions .ui-btn {
  min-height: 44px;
}

/* —— QR scanner —— */
.hr-qr-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ui-space-4);
  width: 100%;
  max-width: min(100%, 420px);
  margin: 0 auto;
  box-sizing: border-box;
  padding-inline: var(--ui-space-2);
}

.hr-qr-frame__title {
  font-size: var(--ui-fs-h4);
  font-weight: 700;
  text-align: center;
}

.hr-qr-frame__viewport {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1;
  border-radius: var(--ui-radius-xl);
  background: var(--ui-n-900);
  overflow: hidden;
  box-shadow: var(--ui-shadow-md);
}

.hr-qr-frame .ui-btn {
  width: 100%;
  min-height: 44px;
}

.hr-qr-frame__viewport::before,
.hr-qr-frame__viewport::after {
  content: "";
  position: absolute;
  width: 36px;
  height: 36px;
  border: 3px solid var(--ui-primary);
  z-index: 2;
}

.hr-qr-frame__viewport::before {
  top: 18px;
  left: 18px;
  border-right: 0;
  border-bottom: 0;
}

.hr-qr-frame__viewport::after {
  right: 18px;
  bottom: 18px;
  border-left: 0;
  border-top: 0;
}

.hr-qr-frame__scanline {
  position: absolute;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--ui-primary);
  top: 30%;
  opacity: 0.85;
  box-shadow: 0 0 12px rgba(27, 97, 209, 0.8);
}

.hr-qr-frame[data-state="scanning"] .hr-qr-frame__scanline {
  animation: hr-qr-scan 1.6s ease-in-out infinite;
}

.hr-qr-frame[data-state="idle"] .hr-qr-frame__scanline {
  display: none;
}

.hr-qr-frame[data-state="recognized"] .hr-qr-frame__viewport {
  box-shadow: 0 0 0 3px var(--ui-success);
}

.hr-qr-frame[data-state="invalid"],
.hr-qr-frame[data-state="expired"],
.hr-qr-frame[data-state="error"] {
  /* status via badge below */
}

.hr-qr-frame[data-state="invalid"] .hr-qr-frame__viewport,
.hr-qr-frame[data-state="expired"] .hr-qr-frame__viewport,
.hr-qr-frame[data-state="error"] .hr-qr-frame__viewport {
  box-shadow: 0 0 0 3px var(--ui-danger);
}

.hr-qr-frame__hint {
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-secondary);
  text-align: center;
}

@keyframes hr-qr-scan {
  0%,
  100% {
    top: 22%;
  }
  50% {
    top: 72%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hr-qr-frame[data-state="scanning"] .hr-qr-frame__scanline {
    animation: none;
  }
}

/* —— QR employee result —— */
.hr-qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ui-space-3);
  text-align: center;
  padding: var(--ui-space-5);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xl);
  background: var(--ui-surface);
  width: 100%;
  max-width: min(100%, 420px);
  margin: 0 auto;
  box-sizing: border-box;
}

.hr-qr-result__name {
  font-size: var(--ui-fs-h3);
  font-weight: 700;
  line-height: var(--ui-lh-h3);
  overflow-wrap: anywhere;
}

.hr-qr-result__role {
  color: var(--ui-text-secondary);
}

.hr-qr-result__time {
  font-size: var(--ui-fs-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hr-qr-result__countdown {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--ui-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--ui-fs-lg);
  color: var(--ui-primary);
  flex: 0 0 auto;
}

.hr-qr-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  justify-content: center;
  width: 100%;
}

.hr-qr-result__actions .ui-btn {
  min-height: 44px;
  flex: 1 1 140px;
}

/* —— Settlement —— */
.hr-settlement {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hr-settlement__lines {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.hr-settlement__lines th,
.hr-settlement__lines td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-border);
  font-size: var(--ui-fs-base);
  vertical-align: top;
}

.hr-settlement__lines th {
  text-align: left;
  font-weight: 500;
  color: var(--ui-text-secondary);
  width: 70%;
  overflow-wrap: anywhere;
}

.hr-settlement__lines td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
  width: 30%;
}

.hr-settlement__lines tr.is-add td {
  color: var(--ui-success);
}

.hr-settlement__lines tr.is-deduct td {
  color: var(--ui-danger);
}

.hr-settlement__lines tr.is-total th,
.hr-settlement__lines tr.is-total td {
  border-bottom: 0;
  padding-top: var(--ui-space-4);
  font-size: var(--ui-fs-h4);
  font-weight: 800;
  color: var(--ui-text-primary);
  background: var(--ui-primary-soft);
}

.hr-settlement-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--ui-space-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--ui-border);
  font-size: var(--ui-fs-base);
  max-width: 100%;
}

.hr-settlement-line > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hr-settlement-line strong {
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hr-settlement-line.is-add strong {
  color: var(--ui-success);
}

.hr-settlement-line.is-deduct strong {
  color: var(--ui-danger);
}

.hr-settlement-line.is-total {
  border-bottom: 0;
  padding-top: var(--ui-space-3);
  font-weight: 700;
}

.hr-settlement-line.is-total strong {
  color: var(--ui-text-primary);
  font-size: var(--ui-fs-h4);
}

/* —— Request timeline —— */
.hr-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 4px;
}

.hr-timeline__item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: var(--ui-space-3);
  position: relative;
  padding-bottom: var(--ui-space-4);
}

.hr-timeline__item:last-child {
  padding-bottom: 0;
}

.hr-timeline__item:not(:last-child) .hr-timeline__rail::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: var(--ui-border);
}

.hr-timeline__rail {
  position: relative;
  width: 14px;
}

.hr-timeline__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ui-primary);
  border: 2px solid var(--ui-surface);
  box-shadow: 0 0 0 2px var(--ui-primary-soft);
}

.hr-timeline__item[data-tone="success"] .hr-timeline__dot {
  background: var(--ui-success);
  box-shadow: 0 0 0 2px var(--ui-success-soft);
}

.hr-timeline__item[data-tone="danger"] .hr-timeline__dot {
  background: var(--ui-danger);
  box-shadow: 0 0 0 2px var(--ui-danger-soft);
}

.hr-timeline__item[data-tone="muted"] .hr-timeline__dot {
  background: var(--ui-n-400);
  box-shadow: 0 0 0 2px var(--ui-n-100);
}

.hr-timeline__time {
  font-size: var(--ui-fs-caption);
  color: var(--ui-text-muted);
  font-weight: 600;
}

.hr-timeline__label {
  font-size: var(--ui-fs-base);
  color: var(--ui-text-primary);
  margin-top: 2px;
}

/* —— Document acknowledgement —— */
.hr-doc-ack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-3);
  padding: var(--ui-space-3);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-surface);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hr-doc-ack > .hr-employee-identity {
  flex: 1 1 180px;
  min-width: 0;
}

.hr-doc-ack__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ui-space-2) 10px;
  min-width: 0;
}

.hr-doc-ack__when {
  font-size: var(--ui-fs-sm);
  color: var(--ui-text-secondary);
}

/* —— Permission matrix —— */
.hr-perm-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.hr-perm-table th,
.hr-perm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-border);
  text-align: center;
  font-size: var(--ui-fs-sm);
  min-width: 88px;
}

.hr-perm-table th:first-child,
.hr-perm-table td:first-child {
  text-align: left;
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--ui-surface);
  box-shadow: 2px 0 0 var(--ui-border);
  min-width: 140px;
  width: 160px;
}

.hr-perm-table thead th {
  background: var(--ui-surface-muted);
  font-size: var(--ui-fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ui-text-secondary);
}

.hr-perm-table thead th:first-child {
  background: var(--ui-surface-muted);
  z-index: 3;
}

.hr-perm-table .ui-check {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hr-empty {
  padding: var(--ui-space-8) var(--ui-space-4);
  text-align: center;
  color: var(--ui-text-secondary);
  border: 1px dashed var(--ui-border);
  border-radius: var(--ui-radius-lg);
  background: var(--ui-n-50);
}

/* —— KPI —— */
.hr-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--ui-space-3);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.hr-kpi-row .ui-stat-card__value {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hr-variant-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ui-space-2);
  max-width: 100%;
  min-width: 0;
}

.hr-demo-block {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-3);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Contained table scroll for HR row demos */
.hr-table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
