/* ==========================================================================
   HR · people operations
   ========================================================================== */

.hr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.hr-stat {
  --hr-accent: #475569;
  --hr-soft: #eef2f7;
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 15px;
  overflow: hidden;
  border: 1px solid #e4ecf6;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .04);
}
.hr-stat::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -45px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--hr-soft);
  opacity: .65;
}
.hr-stat.is-blue { --hr-accent: #1d4ed8; --hr-soft: #e7f0ff; }
.hr-stat.is-amber { --hr-accent: #b45309; --hr-soft: #fff4df; }
.hr-stat.is-rose { --hr-accent: #be123c; --hr-soft: #ffe8ee; }
.hr-stat-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--hr-accent);
  color: #fff;
  box-shadow: 0 5px 12px rgba(15, 23, 42, .14);
  position: relative;
  z-index: 1;
}
.hr-stat-icon .icon { width: 15px; height: 15px; }
.hr-stat > div { position: relative; z-index: 1; min-width: 0; }
.hr-stat strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--hr-accent); font-family: var(--font-num); font-size: 20px; font-weight: 700; line-height: 1.1; }
.hr-stat strong em { margin-left: 1px; font-family: var(--font); font-size: 8px; font-style: normal; font-weight: 500; }
.hr-stat small { display: block; margin-top: 3px; color: #7e90a6; font-size: 8.5px; white-space: nowrap; }

.hr-card { overflow: hidden; }
.hr-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  padding: 9px 14px 0;
  border-bottom: 1px solid #edf2f9;
  scrollbar-width: none;
}
.hr-tabs::-webkit-scrollbar { display: none; }
.hr-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #7a8da2;
  font-size: 9.5px;
  cursor: pointer;
}
.hr-tab .icon { width: 12px; height: 12px; }
.hr-tab:hover { color: #2563eb; background: #f6f9fe; }
.hr-tab.active { color: #1d4ed8; font-weight: 600; }
.hr-tab.active::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #2563eb;
}
.hr-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  flex-wrap: wrap;
}
.hr-section-head h3 { color: #233950; font-size: 13px; font-weight: 600; }
.hr-section-head p { margin-top: 3px; color: #8a9bad; font-size: 8.5px; }
.hr-section-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hr-search { min-width: 190px; max-width: 250px; }
.hr-search input { font-size: 9px; }
.hr-table-wrap { overflow-x: auto; }
.hr-table { width: 100%; border-collapse: collapse; }
.hr-table th {
  padding: 9px 12px;
  border-top: 1px solid #f1f5fb;
  border-bottom: 1px solid #edf2f9;
  background: #fbfdff;
  color: #889aaf;
  font-size: 8px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
.hr-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5fb; color: #52677f; font-size: 9px; vertical-align: middle; }
.hr-table tr:last-child td { border-bottom: 0; }
.hr-table tr:hover td { background: #fbfdff; }
.hr-table .cell-main { display: flex; align-items: center; gap: 7px; min-width: 150px; }
.hr-table .cell-title { color: #2d4259; font-size: 9.5px; font-weight: 600; }
.hr-table .cell-sub { color: #8b9db2; font-size: 8px; margin-top: 2px; }
.hr-money { font-family: var(--font-num); white-space: nowrap; }
.hr-money.is-muted { color: #a06a6a; }
.hr-money.is-net { color: #1d4ed8; font-weight: 600; }
.hr-money.is-danger { color: #be123c; font-weight: 600; }
.hr-row-actions { white-space: nowrap; text-align: right; }
.hr-row-actions .btn { height: 25px; padding: 0 6px; font-size: 7.5px; }
.hr-row-actions .icon { width: 11px; height: 11px; }
.hr-grade-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #d8e6f6;
  border-radius: 5px;
  background: #f3f8ff;
  color: #2563eb;
  font-family: var(--font-num);
  font-size: 7.5px;
  white-space: nowrap;
}
.hr-rating {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--rating-color) 22%, #fff);
  border-radius: 99px;
  background: color-mix(in srgb, var(--rating-color) 8%, #fff);
  color: var(--rating-color);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.hr-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 99px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 7.5px;
  white-space: nowrap;
}
.hr-status.is-paid, .hr-status.is-executed { background: #e8f1ff; color: #2563eb; }
.hr-status.is-draft, .hr-status.is-pending { background: #fff5e8; color: #a16207; }
.hr-status.is-confirmed { background: #eef4fc; color: #3b6f9f; }
.hr-status.is-revoked { background: #f1f5f9; color: #8a9bad; }
.hr-score { display: inline-flex; align-items: center; gap: 6px; min-width: 76px; }
.hr-score-track { width: 46px; height: 4px; overflow: hidden; border-radius: 99px; background: #e9f0f9; }
.hr-score-track i { display: block; height: 100%; border-radius: inherit; background: #2563eb; }
.hr-score-track i.is-amber { background: #d97706; }
.hr-score b { color: #405a74; font-family: var(--font-num); font-size: 8px; font-weight: 600; }

.hr-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 18px 18px; }
.hr-kpi-card { min-width: 0; padding: 12px; border: 1px solid #e5edf7; border-radius: 11px; background: #fff; }
.hr-kpi-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hr-kpi-total { flex: 0 0 auto; text-align: right; }
.hr-kpi-total strong { display: block; color: #1d4ed8; font-family: var(--font-num); font-size: 24px; line-height: 1; }
.hr-kpi-total span { color: #8a9bad; font-size: 7px; }
.hr-kpi-items { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.hr-kpi-item { min-width: 0; }
.hr-kpi-item > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hr-kpi-item span { color: #40566e; font-size: 8.5px; }
.hr-kpi-item small { color: #93a3b5; font-size: 7px; white-space: nowrap; }
.hr-kpi-item-track { display: block; height: 3px; margin-top: 4px; overflow: hidden; border-radius: 99px; background: #edf3fa; }
.hr-kpi-item-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #93c5fd, #2563eb); }
.hr-kpi-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f1f5fb; }
.hr-kpi-card-foot .btn { margin-left: auto; }
.hr-kpi-preview { float: right; color: #8a9bad; font-size: 8px; font-weight: 400; }
.hr-kpi-preview b { color: #2563eb; font-family: var(--font-num); font-size: 11px; }
.hr-kpi-edit-list { display: flex; flex-direction: column; gap: 5px; }
.hr-kpi-edit-row { display: flex; align-items: center; gap: 5px; }
.hr-kpi-edit-row input[data-kpi-name] { flex: 1; min-width: 100px; height: 30px; padding: 0 8px; border: 1px solid #e1e9f4; border-radius: 6px; font-size: 8.5px; }
.hr-kpi-edit-row input[type="number"] { width: 48px; height: 30px; padding: 0 5px; border: 1px solid #e1e9f4; border-radius: 6px; font-size: 8.5px; text-align: center; }
.hr-kpi-unit { color: #92a2b4; font-size: 7.5px; }
.hr-icon-btn { width: 25px; height: 25px; display: grid; place-items: center; border: 0; border-radius: 6px; background: #f4f7fb; color: #9aa9ba; cursor: pointer; }
.hr-icon-btn:hover { background: #fff1f4; color: #be123c; }
.hr-icon-btn .icon { width: 11px; height: 11px; }
.hr-payroll-summary { display: flex; align-items: baseline; gap: 9px; margin: 0 18px 10px; padding: 9px 11px; border: 1px solid #e3edf8; border-radius: 8px; background: #f8fbff; color: #7f91a5; font-size: 8.5px; }
.hr-payroll-summary strong { color: #1d4ed8; font-family: var(--font-num); font-size: 15px; }
.hr-net-preview strong { color: #1d4ed8; font-family: var(--font-num); font-size: 18px; }
.hr-grade-list { display: flex; flex-direction: column; gap: 5px; }
.hr-grade-row { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid #e8eef7; border-radius: 9px; background: #fbfdff; }
.hr-grade-code { width: 38px; flex: 0 0 auto; color: #1d4ed8; font-family: var(--font-num); font-size: 10px; font-weight: 600; }
.hr-grade-main { flex: 1; min-width: 0; }
.hr-grade-main strong { display: block; color: #31465e; font-size: 9.5px; }
.hr-grade-main small { display: block; margin-top: 2px; color: #8a9bad; font-size: 8px; }
.hr-penalty-type { display: inline-flex; padding: 2px 6px; border-radius: 4px; background: #fff1f4; color: #a33a52; font-size: 7.5px; white-space: nowrap; }
.hr-penalty-reason { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-card .section-empty { padding: 22px 12px; }
@media (max-width: 1000px) {
  .hr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-kpi-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hr-stats { grid-template-columns: 1fr; }
  .hr-section-head { align-items: flex-start; }
  .hr-section-actions { width: 100%; }
  .hr-search { max-width: none; flex: 1; }
}

/* Clickable deep-colour HR summary modules */
.hr-stat {
  --hr-bg:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .12), transparent 42%),
    linear-gradient(135deg, #26364a 0%, #3b4f68 100%);
  border: 0;
  background: var(--hr-bg);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .16);
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.hr-stat[data-hr-stat="employees"] {
  --hr-bg:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .12), transparent 42%),
    linear-gradient(135deg, #26364a 0%, #3b4f68 100%);
}
.hr-stat[data-hr-stat="performance"] {
  --hr-bg:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .18), transparent 44%),
    linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
}
.hr-stat[data-hr-stat="payroll"] {
  --hr-bg:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .16), transparent 44%),
    linear-gradient(135deg, #92400e 0%, #c2740b 100%);
}
.hr-stat[data-hr-stat="penalties"] {
  --hr-bg:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .16), transparent 44%),
    linear-gradient(135deg, #881337 0%, #be123c 100%);
}
.hr-stat::after {
  pointer-events: none;
  background: rgba(255, 255, 255, .08);
  opacity: 1;
}
.hr-stat-icon {
  border: 0;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  box-shadow: none;
}
.hr-stat strong,
.hr-stat strong em { color: #fff; text-shadow: 0 1px 6px rgba(2, 6, 23, .18); }
.hr-stat small { color: rgba(255, 255, 255, .72); }
.hr-stat-arrow {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border-radius: 7px;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  opacity: .7;
  transition: opacity .18s, transform .18s;
}
.hr-stat-arrow .icon { width: 11px; height: 11px; }
.hr-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .24);
}
.hr-stat:hover .hr-stat-arrow,
.hr-stat.is-active .hr-stat-arrow { opacity: 1; transform: translate(1px, -1px); }
.hr-stat.is-active {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, .3), 0 10px 22px rgba(15, 23, 42, .24);
  filter: brightness(1.05) saturate(1.06);
}
.hr-stat:focus-visible { outline: 2px solid rgba(15, 23, 42, .5); outline-offset: 2px; }

/* Attendance review and automatic payroll deduction */
.hr-attendance-policy { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid #e1e9f4; border-radius: 6px; background: #f8fbff; color: #7e90a5; font-size: 7.5px; white-space: nowrap; }
.hr-attendance-overview { display: flex; align-items: center; gap: 16px; margin: 0 18px 10px; padding: 9px 11px; border: 1px solid #e3edf8; border-radius: 8px; background: #f8fbff; color: #7f91a5; font-size: 8.5px; flex-wrap: wrap; }
.hr-attendance-overview b { color: #be123c; font-family: var(--font-num); font-size: 13px; margin-right: 2px; }
.hr-attendance-overview strong { margin-left: auto; color: #1d4ed8; font-family: var(--font-num); font-size: 13px; }
.hr-attendance-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 6px; font-family: var(--font-num); font-size: 8px; font-weight: 600; }
.hr-attendance-count.is-warning { background: #fff4df; color: #a16207; }
.hr-attendance-count.is-danger { background: #ffe8ee; color: #be123c; }
.hr-attendance-stats { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; padding: 9px 11px; border: 1px solid #e5edf7; border-radius: 8px; background: #fbfdff; color: #7f91a5; font-size: 8.5px; flex-wrap: wrap; }
.hr-attendance-stats b { color: #be123c; font-family: var(--font-num); font-size: 13px; margin-right: 3px; }
.hr-attendance-stats strong { margin-left: auto; color: #1d4ed8; font-family: var(--font-num); font-size: 12px; }
.hr-attendance-table td { padding-top: 8px; padding-bottom: 8px; }
.hr-attendance-table tr.is-absent td { background: #fff8fa; }
