/* CARDIOGYM / ZENGYM - Module RH & Paie */
#hrPayrollApp { display: grid; gap: 16px; }
.rh-toolbar,
.rh-tabs,
.rh-actions,
.rh-filters,
.rh-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.rh-toolbar { justify-content: space-between; }
.rh-toolbar h3 { margin: 0; }
.rh-tabs {
  padding: 8px;
  border: 1px solid var(--cg-line, #ddd);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
}
.rh-tab-btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}
.rh-tab-btn.active {
  color: #fff !important;
  background: linear-gradient(135deg, #18365e, #0d1d34) !important;
  border-color: #18365e !important;
}
.rh-view { display: none; }
.rh-view.active { display: grid; gap: 16px; }
.rh-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rh-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rh-stats { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; }
.rh-stat {
  position: relative;
  overflow: hidden;
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--cg-line, #ddd);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--cg-shadow-sm, 0 6px 18px rgba(0,0,0,.07));
}
.rh-stat span { display: block; color: #667085; font-weight: 700; font-size: 13px; }
.rh-stat strong { display: block; margin-top: 10px; color: #10233f; font-size: clamp(22px, 2.4vw, 32px); }
.rh-stat small { display: block; margin-top: 5px; color: #7a8494; }
.rh-stat::after {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  right: -22px;
  bottom: -24px;
  border-radius: 50%;
  background: rgba(200,164,93,.12);
}
.rh-panel {
  padding: 18px;
  border: 1px solid var(--cg-line, #ddd);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--cg-shadow-sm, 0 6px 18px rgba(0,0,0,.07));
}
.rh-panel h3,
.rh-panel h4 { margin-top: 0; color: #10233f; }
.rh-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rh-form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rh-form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rh-field { display: grid; gap: 6px; }
.rh-field > span { color: #4b5565; font-size: 12px; font-weight: 800; }
.rh-field.wide { grid-column: 1 / -1; }
.rh-check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.rh-table-wrap { overflow: auto; border: 1px solid #e6e0d5; border-radius: 14px; }
.rh-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.rh-table th,
.rh-table td { padding: 11px 12px; border-bottom: 1px solid #eee9df; text-align: left; vertical-align: top; }
.rh-table th { position: sticky; top: 0; z-index: 1; color: #10233f; background: #f6f2e9; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.rh-table tbody tr:hover { background: #fffaf0; }
.rh-table .num { text-align: right; white-space: nowrap; }
.rh-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  background: #eef2f7;
  color: #334155;
}
.rh-badge.ok { background: #e7f7f0; color: #17634f; }
.rh-badge.warn { background: #fff4d8; color: #8a5a00; }
.rh-badge.danger { background: #fee8e6; color: #a12820; }
.rh-badge.info { background: #e7effb; color: #244e84; }
.rh-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid #e2d8c5;
  background: #f5f1e8;
}
.rh-avatar.placeholder { display: grid; place-items: center; color: #806525; font-weight: 900; }
.rh-employee-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.rh-employee-cell strong { display: block; }
.rh-employee-cell small { color: #6b7280; }
.rh-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7,16,30,.72);
}
.rh-modal.hidden { display: none; }
.rh-modal-card {
  width: min(1180px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border-radius: 22px;
  background: #fffdf8;
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.rh-modal-head,
.rh-modal-foot {
  position: sticky;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #fffdf8;
  border-color: #e6dece;
}
.rh-modal-head { top: 0; border-bottom: 1px solid #e6dece; }
.rh-modal-foot { bottom: 0; justify-content: flex-end; border-top: 1px solid #e6dece; }
.rh-modal-body { padding: 20px; }
.rh-section-title {
  margin: 18px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e0d2;
  color: #10233f;
}
.rh-photo-box { display: flex; gap: 16px; align-items: center; margin-bottom: 15px; }
.rh-photo-preview { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; border: 1px solid #d9d2c4; background: #f6f2e9; }
.rh-empty { padding: 30px; text-align: center; color: #6b7280; }
.rh-alert-list { display: grid; gap: 10px; }
.rh-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #eadfca;
  border-radius: 12px;
  background: #fffaf0;
}
.rh-alert-icon { font-size: 24px; }
.rh-alert strong { display: block; color: #10233f; }
.rh-alert small { color: #697386; }
.rh-pay-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.rh-pay-line { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed #ded7ca; }
.rh-pay-line.total { margin-top: 8px; padding: 13px 0; border-top: 2px solid #10233f; border-bottom: 0; font-size: 18px; font-weight: 900; }
.rh-positive { color: #17634f; }
.rh-negative { color: #a12820; }
.rh-muted { color: #667085; }
.rh-progress { height: 9px; overflow: hidden; border-radius: 999px; background: #ece8df; }
.rh-progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#18365e,#c8a45d); }
.rh-no-print { display: initial; }
@media print {
  body * { visibility: hidden !important; }
  .rh-print-area,
  .rh-print-area * { visibility: visible !important; }
  .rh-print-area { position: absolute; inset: 0; width: 100%; padding: 18mm; background: #fff; }
  .rh-no-print { display: none !important; }
}
@media (max-width: 1200px) {
  .rh-stats { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .rh-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rh-pay-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .rh-grid-2,
  .rh-grid-3,
  .rh-form-grid,
  .rh-form-grid.cols-2,
  .rh-form-grid.cols-3,
  .rh-stats,
  .rh-pay-summary { grid-template-columns: 1fr; }
  .rh-modal { padding: 0; }
  .rh-modal-card { width: 100vw; max-height: 100vh; min-height: 100vh; border-radius: 0; }
  .rh-alert { grid-template-columns: auto 1fr; }
  .rh-alert > :last-child { grid-column: 2; }
}
