/* ════════════════════════════════════════════════════════
   hr-module.css — InfraX QMS — Module Ressources Humaines
   ════════════════════════════════════════════════════════ */

/* ─── Overlay ────────────────────────────────────────────── */
#hr-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: var(--bg-base, #0f172a);
  display: flex; flex-direction: column;
}
#hr-overlay.hidden { display: none; }

#hr-overlay-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  flex-shrink: 0;
}
#hr-overlay-header h2 { margin: 0; font-size: 15px; color: var(--text-primary,#f1f5f9); }
#hr-close-btn {
  margin-left: auto; background: none; border: none;
  color: var(--text-secondary,#94a3b8); cursor: pointer;
  font-size: 20px; padding: 4px 8px; border-radius: 6px;
  transition: background .15s;
}
#hr-close-btn:hover { background: rgba(255,255,255,.08); }

#hr-main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ─── Toast ──────────────────────────────────────────────── */
#hr-toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 3000; display: flex; flex-direction: column; gap: 8px;
}
.hr-toast {
  padding: 10px 18px; border-radius: 8px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  animation: hrToastIn .25s ease; box-shadow: 0 4px 20px rgba(0,0,0,.35);
  max-width: 340px;
}
.hr-toast span { font-size: 15px; }
.hr-toast-success { background: #065f46; color: #6ee7b7; border: 1px solid #10b981; }
.hr-toast-error   { background: #7f1d1d; color: #fca5a5; border: 1px solid #ef4444; }
.hr-toast-info    { background: #1e3a5f; color: #93c5fd; border: 1px solid #3b82f6; }
.hr-toast-warn    { background: #78350f; color: #fde68a; border: 1px solid #f59e0b; }
.hr-toast.fade-out { opacity: 0; transform: translateX(40px); transition: all .35s; }
@keyframes hrToastIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:none; } }

/* ─── App shell ──────────────────────────────────────────── */
.hr-app { display: flex; height: 100%; overflow: hidden; }

.hr-sidebar {
  width: 230px; flex-shrink: 0;
  background: rgba(255,255,255,.03);
  border-right: 1px solid rgba(255,255,255,.07);
  display: flex; flex-direction: column; overflow-y: auto;
}
.hr-sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.hr-logo-icon    { font-size: 22px; }
.hr-logo-icon-sm { font-size: 18px; }
.hr-sidebar-title { font-weight: 700; color: var(--text-primary,#f1f5f9); font-size: 13px; }

.hr-nav { padding: 8px 0; flex: 1; }
.hr-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 14px; background: none; border: none;
  color: var(--text-secondary,#94a3b8); cursor: pointer; font-size: 13px;
  text-align: left; border-radius: 6px; margin: 1px 6px; width: calc(100% - 12px);
  transition: background .12s, color .12s;
}
.hr-nav-item:hover  { background: rgba(255,255,255,.06); color: var(--text-primary,#f1f5f9); }
.hr-nav-item.active { background: rgba(139,92,246,.15); color: #a78bfa; }

.hr-sidebar-user {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.06);
  font-size: 12px;
}
.hr-user-name { font-weight: 600; color: var(--text-primary,#f1f5f9); margin-bottom: 2px; }
.hr-user-role { color: var(--text-secondary,#94a3b8); margin-bottom: 8px; }

.hr-content {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.hr-loading-inner {
  display: flex; align-items: center; justify-content: center; flex: 1;
  min-height: 200px;
}
.hr-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid rgba(139,92,246,.3); border-top-color: #a78bfa;
  animation: hrSpin .7s linear infinite;
}
@keyframes hrSpin { to { transform: rotate(360deg); } }

/* ─── Login ──────────────────────────────────────────────── */
.hr-login-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px;
}
.hr-login-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 32px; width: 380px; display: flex; flex-direction: column; gap: 16px;
}
.hr-login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hr-login-title { font-size: 17px; font-weight: 700; color: var(--text-primary,#f1f5f9); }
.hr-login-sub   { font-size: 12px; color: var(--text-secondary,#94a3b8); }
.hr-login-err   { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.hr-login-hint  { font-size: 12px; color: var(--text-secondary,#94a3b8); text-align: center; margin: 0; }

/* ─── Page ───────────────────────────────────────────────── */
.hr-page { padding: 24px 28px; max-width: 1200px; }
.hr-page-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--text-primary,#f1f5f9); }
.hr-page-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.hr-empty { color: var(--text-secondary,#94a3b8); font-style: italic; padding: 20px 0; }
.hr-error { color: #f87171; padding: 20px; background: rgba(239,68,68,.1); border-radius: 8px; }

/* ─── Buttons ────────────────────────────────────────────── */
.hr-btn {
  padding: 7px 16px; border-radius: 7px; border: none;
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all .12s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.hr-btn-primary   { background: #7c3aed; color: #fff; }
.hr-btn-primary:hover { background: #6d28d9; }
.hr-btn-secondary { background: rgba(255,255,255,.08); color: var(--text-primary,#f1f5f9); border: 1px solid rgba(255,255,255,.1); }
.hr-btn-secondary:hover { background: rgba(255,255,255,.12); }
.hr-btn-ghost { background: none; color: var(--text-secondary,#94a3b8); border: 1px solid rgba(255,255,255,.08); }
.hr-btn-ghost:hover { background: rgba(255,255,255,.06); color: var(--text-primary,#f1f5f9); }
.hr-btn-success { background: #065f46; color: #6ee7b7; }
.hr-btn-success:hover { background: #047857; }
.hr-btn-danger  { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.hr-btn-danger:hover { background: rgba(239,68,68,.25); }
.hr-btn-sm   { padding: 5px 11px; font-size: 12px; }
.hr-btn-full { width: 100%; justify-content: center; }
.hr-btn-icon { padding: 5px 8px; }

/* ─── List ───────────────────────────────────────────────── */
.hr-list { display: flex; flex-direction: column; gap: 6px; }
.hr-list-item {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: background .12s;
}
.hr-list-item:hover { background: rgba(255,255,255,.05); }
.hr-list-item-left { display: flex; align-items: center; gap: 14px; }
.hr-list-item-main { flex: 1; }
.hr-list-item-title { font-weight: 600; color: var(--text-primary,#f1f5f9); font-size: 14px; }
.hr-list-item-sub { font-size: 12px; color: var(--text-secondary,#94a3b8); margin-top: 2px; }
.hr-list-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hr-list-item-compact { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 13px; }

/* ─── Avatar ─────────────────────────────────────────────── */
.hr-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hr-avatar-lg {
  width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ─── Badges ─────────────────────────────────────────────── */
.hr-badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600;
  background: rgba(139,92,246,.15); color: #a78bfa; border: 1px solid rgba(139,92,246,.3);
}
.hr-badge-secondary { background: rgba(148,163,184,.1); color: #94a3b8; border-color: rgba(148,163,184,.2); }
.hr-badge-success   { background: rgba(16,185,129,.12); color: #34d399; border-color: rgba(16,185,129,.3); }
.hr-badge-inactive  { background: rgba(239,68,68,.1); color: #f87171; border-color: rgba(239,68,68,.2); }
.hr-badge-primary   { background: rgba(59,130,246,.12); color: #60a5fa; border-color: rgba(59,130,246,.3); }
.hr-badge-warn      { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.3); }
.hr-badge-danger    { background: rgba(239,68,68,.12); color: #f87171; border-color: rgba(239,68,68,.3); }
.hr-badge-tri {
  display: inline-block; padding: 2px 7px; border-radius: 6px;
  background: rgba(139,92,246,.1); color: #a78bfa; font-size: 11px;
  font-weight: 700; margin-left: 6px; font-family: monospace;
}
.hr-level-badge {
  display: inline-flex; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.hr-cat-badge { font-size: 11px; color: var(--text-secondary,#94a3b8); }

/* ─── Detail card ────────────────────────────────────────── */
.hr-detail-card {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 20px;
}
.hr-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.hr-detail-section h3 {
  margin: 0 0 12px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary,#94a3b8); text-transform: uppercase; letter-spacing: .06em;
}
.hr-detail-section h4 { margin: 8px 0 4px; font-size: 13px; color: var(--text-secondary,#94a3b8); }
.hr-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hr-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; }
.hr-info-item { padding: 10px 14px; background: rgba(255,255,255,.03); border-radius: 8px; border: 1px solid rgba(255,255,255,.06); }
.hr-info-label { font-size: 11px; color: var(--text-secondary,#94a3b8); font-weight: 600; text-transform: uppercase; letter-spacing:.04em; margin-bottom: 4px; }
.hr-info-value { font-size: 13px; color: var(--text-primary,#f1f5f9); }
.hr-info-note { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #fbbf24; }

/* ─── Forms ──────────────────────────────────────────────── */
.hr-field { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.hr-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary,#94a3b8); text-transform: uppercase; letter-spacing: .04em; }
.hr-field input, .hr-field select, .hr-field textarea {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; color: var(--text-primary,#f1f5f9); font-size: 13px;
  padding: 8px 11px; transition: border .15s;
}
.hr-field input:focus, .hr-field select:focus, .hr-field textarea:focus {
  outline: none; border-color: #7c3aed; background: rgba(124,58,237,.08);
}
.hr-field input[readonly] { opacity: .6; }
.hr-form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hr-form-row .hr-field { min-width: 140px; }
.hr-section-sep {
  margin: 4px 0 10px; font-size: 12px; font-weight: 700;
  color: var(--text-secondary,#94a3b8); text-transform: uppercase; letter-spacing: .07em;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06);
}
.hr-hint { font-size: 12px; color: var(--text-secondary,#94a3b8); margin: 0; }
.hr-input-row { display: flex; gap: 8px; align-items: flex-end; }
.hr-input-row input { flex: 1; }

/* ─── Checkboxes / Radios ────────────────────────────────── */
.hr-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; color: var(--text-primary,#f1f5f9);
  padding: 6px 10px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.07); transition: background .12s;
}
.hr-checkbox-label:hover { background: rgba(255,255,255,.05); }
.hr-checkbox-label input[type="checkbox"] { accent-color: #7c3aed; }
.hr-jobs-checkboxes { display: flex; flex-direction: column; gap: 5px; }

/* ─── Modal ──────────────────────────────────────────────── */
.hr-modal-backdrop {
  position: fixed; inset: 0; z-index: 3100;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.hr-modal {
  background: #1e293b; border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; width: 100%; max-width: 560px;
  max-height: 90vh; display: flex; flex-direction: column;
  animation: hrModalIn .2s ease;
}
.hr-modal-lg { max-width: 820px; }
@keyframes hrModalIn { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:none; } }
.hr-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.hr-modal-header h2 { margin: 0; font-size: 16px; color: var(--text-primary,#f1f5f9); }
.hr-modal-close { background: none; border: none; color: var(--text-secondary,#94a3b8); cursor: pointer; font-size: 18px; padding: 4px; }
.hr-modal-close:hover { color: var(--text-primary,#f1f5f9); }
.hr-modal-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.hr-modal-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); display: flex; gap: 10px; justify-content: flex-end; flex-shrink: 0; }

/* ─── Tables ─────────────────────────────────────────────── */
.hr-data-table, .hr-comp-table, .hr-eval-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.hr-data-table th, .hr-comp-table th, .hr-eval-table th {
  text-align: left; padding: 8px 12px;
  background: rgba(255,255,255,.04); color: var(--text-secondary,#94a3b8);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing:.05em;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.hr-data-table td, .hr-comp-table td, .hr-eval-table td {
  padding: 9px 12px; color: var(--text-primary,#f1f5f9);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.hr-data-table tr:hover td, .hr-eval-table tr:hover td { background: rgba(255,255,255,.03); }
.hr-eval-table .eval-actual-sel, .hr-eval-table .eval-proof-inp {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; color: var(--text-primary,#f1f5f9); font-size: 12px;
  padding: 5px 8px; width: 100%;
}
.hr-gap-cell { color: #f59e0b; font-weight: 600; }

/* ─── Stats / Dashboard ──────────────────────────────────── */
.hr-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 14px; margin-bottom: 24px; }
.hr-stat-card {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; padding: 18px; text-align: center;
}
.hr-stat-card.warn { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.05); }
.hr-stat-icon { font-size: 24px; margin-bottom: 8px; }
.hr-stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary,#f1f5f9); }
.hr-stat-label { font-size: 12px; color: var(--text-secondary,#94a3b8); margin-top: 4px; }
.hr-dashboard-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Dashboard section label */
.hr-dashboard-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-secondary,#94a3b8); margin-bottom: 12px;
}

/* Skills Coverage Widget */
.hr-skills-coverage-widget {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 18px; margin-bottom: 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.hr-scw-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hr-scw-kpi {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 14px; text-align: center;
}
.hr-scw-kpi.warn { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.05); }
.hr-scw-kpi.ok   { border-color: rgba(52,211,153,.25); background: rgba(52,211,153,.05); }
.hr-scw-kpi-val  { font-size: 26px; font-weight: 800; color: var(--text-primary,#f1f5f9); }
.hr-scw-kpi-lbl  { font-size: 11px; color: var(--text-secondary,#94a3b8); margin-top: 4px; }
.hr-scw-bars { display: flex; flex-direction: column; gap: 10px; }
.hr-scw-bar-row  { display: flex; flex-direction: column; gap: 4px; }
.hr-scw-bar-lbl  { font-size: 12px; color: var(--text-secondary,#94a3b8); }
.hr-scw-uncovered {
  background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.2);
  border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.hr-scw-uncovered-title { font-size: 12px; font-weight: 600; color: #fbbf24; }
.hr-scw-uncovered-list  { display: flex; flex-wrap: wrap; gap: 6px; }

/* Clickable job ref badges in skills catalog */
.hr-job-badge-link {
  transition: background .15s, border-color .15s, transform .1s;
}
.hr-job-badge-link:hover {
  background: rgba(148,163,184,.25) !important;
  border-color: rgba(148,163,184,.5) !important;
  transform: translateY(-1px);
  text-decoration: underline;
}

/* ─── Gap alert ──────────────────────────────────────────── */
.hr-gap-alert {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px; padding: 16px;
}
.hr-gap-alert-title { font-weight: 700; color: #fbbf24; margin-bottom: 8px; font-size: 14px; }
.hr-gap-item { font-size: 13px; color: var(--text-primary,#f1f5f9); margin: 4px 0; }
.hr-success-note {
  background: rgba(16,185,129,.08); border: 1px solid rgba(16,185,129,.2);
  border-radius: 10px; padding: 14px; color: #6ee7b7; font-size: 13px;
}

/* ─── Progress bar ───────────────────────────────────────── */
.hr-progress-bar-wrap {
  position: relative; height: 6px; background: rgba(255,255,255,.08);
  border-radius: 3px; margin-top: 8px; overflow: hidden;
}
.hr-progress-bar { height: 100%; background: #7c3aed; border-radius: 3px; transition: width .4s; }
.hr-progress-label {
  position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--text-secondary,#94a3b8);
}

/* ─── Training items ─────────────────────────────────────── */
.hr-train-item-edit {
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px; padding: 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 10px;
}
.hr-train-item-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ─── Competence edit ────────────────────────────────────── */
.hr-comp-edit-row {
  display: grid; grid-template-columns: 1fr 130px 140px 36px;
  gap: 8px; align-items: center; margin-bottom: 6px;
}
.hr-comp-edit-row input, .hr-comp-edit-row select {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; color: var(--text-primary,#f1f5f9); font-size: 12px; padding: 7px 9px;
}

/* ─── Education edit ─────────────────────────────────────── */
.hr-edu-edit-row {
  display: grid; grid-template-columns: 2fr 1.5fr 80px 1.2fr 36px;
  gap: 8px; margin-bottom: 6px; align-items: center;
}
.hr-edu-edit-row input {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; color: var(--text-primary,#f1f5f9); font-size: 12px; padding: 7px 9px;
}

/* ─── Docs ───────────────────────────────────────────────── */
.hr-doc-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px;
  color: var(--text-primary,#f1f5f9);
}
.hr-doc-ref { color: var(--text-secondary,#94a3b8); font-size: 12px; font-family: monospace; }
.hr-upload-area { margin-top: 10px; }
.hr-action-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Eval sections ──────────────────────────────────────── */
.hr-eval-section {
  background: rgba(255,255,255,.02); border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.hr-eval-section h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-primary,#f1f5f9); }
.hr-eval-done { display: flex; flex-direction: column; gap: 10px; }
.hr-hr-comment { color: #a78bfa !important; font-style: italic; }

/* ─── Org chart ──────────────────────────────────────────── */
.hr-org-wrap { display: flex; gap: 20px; align-items: flex-start; margin-top: 10px; }
.hr-org-tree { flex: 1; min-height: 400px; padding: 14px; background: rgba(255,255,255,.02); border: 1px dashed rgba(255,255,255,.1); border-radius: 10px; }
.hr-org-unassigned { width: 220px; flex-shrink: 0; }
.hr-org-unassigned h4 { font-size: 13px; color: var(--text-secondary,#94a3b8); margin: 0 0 10px; }
.hr-org-unassigned-item { font-size: 12px; color: var(--text-secondary,#94a3b8); padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); }

.hr-org-node { margin-bottom: 6px; }
.hr-org-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.25);
  border-radius: 9px; padding: 10px 12px; cursor: grab;
  transition: background .12s; position: relative;
}
.hr-org-card:hover { background: rgba(139,92,246,.18); }
.hr-org-card.hr-org-inactive { opacity: .5; }
.hr-org-avatar {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: #7c3aed; color: #fff; font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.hr-org-name  { font-size: 13px; font-weight: 600; color: var(--text-primary,#f1f5f9); }
.hr-org-title { font-size: 11px; color: var(--text-secondary,#94a3b8); }
.hr-org-remove-mgr {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-secondary,#94a3b8); font-size: 14px; padding: 2px; opacity: .5;
}
.hr-org-remove-mgr:hover { opacity: 1; }
.hr-org-children {
  padding-left: 24px; margin-top: 4px;
  border-left: 2px solid rgba(139,92,246,.2); margin-left: 16px;
  min-height: 10px; padding-top: 4px;
}
.hr-org-over { background: rgba(139,92,246,.15) !important; border-color: #7c3aed !important; }
.hr-org-tree.hr-org-over { background: rgba(139,92,246,.06) !important; }

/* ─── Proof cell ─────────────────────────────────────────── */
.hr-proof-cell { max-width: 220px; font-size: 12px; color: var(--text-secondary,#94a3b8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Hidden ─────────────────────────────────────────────── */
.hidden { display: none !important; }
/* ════════════════════════════════════════════════════════
   InfraX light theme overrides for HR module
   Harmonisation avec le design rose de l'application
   ════════════════════════════════════════════════════════ */
#hr-overlay {
  background: var(--gray-50, #fdf5f8);
  color: var(--gray-800, #3d1028);
}

#hr-overlay-header {
  background: #e72c85 !important;
  border-bottom: 1px solid rgba(122, 16, 64, .12);
  box-shadow: 0 2px 16px rgba(0,0,0,.10);
}
/* Tout le texte dans le header doit être blanc */
#hr-overlay-header,
#hr-overlay-header h2,
#hr-overlay-header button,
#hr-overlay-header span,
#hr-overlay-header svg {
  color: #fff;
}
#hr-overlay-header h2 { color: #fff; }
.hr-nav-back-btn {
  color: #fff !important;
  background: rgba(255,255,255,.2) !important;
  border: 1.5px solid rgba(255,255,255,.35) !important;
}
.hr-nav-home-btn {
  color: rgba(255,255,255,.88) !important;
  background: rgba(255,255,255,.1) !important;
  border: 1.5px solid rgba(255,255,255,.22) !important;
}
.hr-nav-back-btn:hover { background: rgba(255,255,255,.32) !important; color: #fff !important; }
.hr-nav-home-btn:hover { background: rgba(255,255,255,.2) !important; color: #fff !important; }
#hr-header-user span { color: rgba(255,255,255,.85) !important; }
#hr-close-btn {
  color: rgba(255,255,255,.82);
}
#hr-close-btn:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
}

.hr-sidebar {
  background: var(--white, #fff);
  border-right: 1.5px solid var(--gray-200, #e8cdd9);
}
.hr-sidebar-header {
  border-bottom: 1.5px solid var(--gray-100, #f7eaf1);
}
.hr-sidebar-title,
.hr-user-name,
.hr-page-title,
.hr-list-item-title,
.hr-info-value,
.hr-data-table td,
.hr-comp-table td,
.hr-eval-table td,
.hr-gap-item,
.hr-doc-item,
.hr-modal-header h2 {
  color: var(--gray-800, #3d1028);
}
.hr-user-role,
.hr-page-header .hr-btn-ghost,
.hr-empty,
.hr-hint,
.hr-list-item-sub,
.hr-info-label,
.hr-detail-section h3,
.hr-detail-section h4,
.hr-field label,
.hr-section-sep,
.hr-stat-label,
.hr-doc-ref,
.hr-modal-close,
.hr-data-table th,
.hr-comp-table th,
.hr-eval-table th {
  color: var(--gray-400, #b8809a);
}
.hr-sidebar-user {
  border-top: 1.5px solid var(--gray-100, #f7eaf1);
}
.hr-nav-item {
  color: var(--gray-600, #7a4060);
}
.hr-nav-item:hover {
  background: var(--pink-pale, #fdf0f6);
  color: var(--pink-dark, #a8275f);
}
.hr-nav-item.active {
  background: rgba(213,64,132,.12);
  color: var(--pink-dark, #a8275f);
}

.hr-loading-inner {
  background: transparent;
}
.hr-spinner {
  border: 3px solid var(--pink-light, #f3b2d0);
  border-top-color: var(--pink, #d54084);
}

.hr-detail-card,
.hr-stat-card,
.hr-train-item-edit,
.hr-list-item,
.hr-info-item,
.hr-modal,
.hr-login-card {
  background: var(--white, #fff);
  border: 1.5px solid var(--gray-200, #e8cdd9);
  box-shadow: 0 8px 24px rgba(213,64,132,.08);
}
.hr-list-item:hover,
.hr-checkbox-label:hover,
.hr-data-table tr:hover td,
.hr-eval-table tr:hover td {
  background: var(--pink-pale, #fdf0f6);
}
.hr-stat-card.warn,
.hr-gap-alert,
.hr-info-note {
  background: #fff8eb;
}
.hr-success-note {
  background: #eefcf4;
  color: #15803d;
}

.hr-btn-primary {
  background: var(--pink, #d54084);
  color: #fff;
}
.hr-btn-primary:hover {
  background: var(--pink-dark, #a8275f);
}
.hr-btn-secondary {
  background: var(--gray-100, #f7eaf1);
  color: var(--gray-800, #3d1028);
  border: 1.5px solid var(--gray-200, #e8cdd9);
}
.hr-btn-secondary:hover {
  background: var(--pink-pale, #fdf0f6);
  border-color: var(--pink-light, #f3b2d0);
  color: var(--pink, #d54084);
}
.hr-btn-ghost {
  color: var(--gray-600, #7a4060);
  border: 1.5px solid var(--gray-200, #e8cdd9);
  background: var(--white, #fff);
}
.hr-btn-ghost:hover {
  background: var(--pink-pale, #fdf0f6);
  color: var(--pink, #d54084);
  border-color: var(--pink-light, #f3b2d0);
}
.hr-btn-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.hr-btn-success:hover { background: #bbf7d0; }
.hr-btn-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.hr-btn-danger:hover { background: #fecaca; }

.hr-badge {
  background: rgba(213,64,132,.10);
  color: var(--pink-dark, #a8275f);
  border-color: rgba(213,64,132,.22);
}
.hr-badge-secondary {
  background: var(--gray-100, #f7eaf1);
  color: var(--gray-600, #7a4060);
  border-color: var(--gray-200, #e8cdd9);
}
.hr-badge-primary,
.hr-badge-tri {
  background: rgba(213,64,132,.10);
  color: var(--pink-dark, #a8275f);
  border-color: rgba(213,64,132,.22);
}

.hr-field input,
.hr-field select,
.hr-field textarea,
.hr-comp-edit-row input,
.hr-comp-edit-row select,
.hr-edu-edit-row input,
.hr-eval-table .eval-actual-sel,
.hr-eval-table .eval-proof-inp {
  background: var(--white, #fff);
  border: 1.5px solid var(--gray-200, #e8cdd9);
  color: var(--gray-800, #3d1028);
}
.hr-field input::placeholder,
.hr-field textarea::placeholder {
  color: var(--gray-400, #b8809a);
}
.hr-field input:focus,
.hr-field select:focus,
.hr-field textarea:focus,
.hr-comp-edit-row input:focus,
.hr-comp-edit-row select:focus,
.hr-edu-edit-row input:focus,
.hr-eval-table .eval-actual-sel:focus,
.hr-eval-table .eval-proof-inp:focus {
  outline: none;
  border-color: var(--pink, #d54084);
  box-shadow: 0 0 0 3px rgba(213,64,132,.12);
  background: var(--white, #fff);
}

/* correction combobox blanc sur blanc */
.hr-field select,
.hr-comp-edit-row select,
.hr-eval-table select,
select[id^="ev-"],
select[id^="jf-"] {
  appearance: auto;
  -webkit-appearance: menulist;
  color: var(--gray-800, #3d1028);
  background-color: var(--white, #fff);
}
.hr-field select option,
.hr-comp-edit-row select option,
.hr-eval-table select option,
select[id^="ev-"] option,
select[id^="jf-"] option {
  color: var(--gray-800, #3d1028);
  background: var(--white, #fff);
}

.hr-checkbox-label {
  color: var(--gray-800, #3d1028);
  border: 1.5px solid var(--gray-200, #e8cdd9);
  background: var(--white, #fff);
}
.hr-checkbox-label input[type="checkbox"] { accent-color: var(--pink, #d54084); }

.hr-modal-backdrop {
  background: rgba(61,16,40,.18);
  backdrop-filter: blur(3px);
}
.hr-modal-header,
.hr-modal-footer {
  border-color: var(--gray-100, #f7eaf1);
}

.hr-data-table th,
.hr-comp-table th,
.hr-eval-table th {
  background: var(--gray-100, #f7eaf1);
  border-bottom: 1.5px solid var(--gray-200, #e8cdd9);
}
.hr-data-table td,
.hr-comp-table td,
.hr-eval-table td {
  border-bottom: 1px solid var(--gray-100, #f7eaf1);
}

.hr-progress-bar-wrap {
  background: var(--gray-100, #f7eaf1);
}
.hr-progress-bar {
  background: linear-gradient(90deg, var(--pink, #d54084), var(--pink-dark, #a8275f));
}

/* ═══════════════════════════════════════
   FIX LISIBILITÉ TEXTE (thème clair)
   ═══════════════════════════════════════ */

/* Texte global */
#hr-overlay,
#hr-overlay * {
  color: #3d1028 !important; /* noir InfraX */
}

/* Exceptions header — texte blanc sur fond rose */
#hr-overlay-header *                  { color: #fff !important; }
#hr-overlay-header .hr-nav-back-btn   { background: rgba(255,255,255,.22) !important; border-color: rgba(255,255,255,.35) !important; }
#hr-overlay-header .hr-nav-home-btn   { background: rgba(255,255,255,.1) !important; border-color: rgba(255,255,255,.2) !important; color: rgba(255,255,255,.88) !important; }
#hr-overlay-header .hr-nav-back-btn:hover { background: rgba(255,255,255,.36) !important; }
#hr-overlay-header .hr-nav-home-btn:hover { background: rgba(255,255,255,.22) !important; color: #fff !important; }
#hr-header-user span                  { color: rgba(255,255,255,.82) !important; }

/* Exceptions — FlowchartEngine (couleurs fonctionnelles) */
#hr-overlay .fce-node[data-type="process"],
#hr-overlay .fce-node[data-type="process"],
#hr-overlay .fce-node[data-type="process"] *      { color: #fdf0f6 !important; }
#hr-overlay .fce-node[data-type="process-form"],
#hr-overlay .fce-node[data-type="process-form"] * { color: #fdf0f6 !important; }
#hr-overlay .fce-node[data-type="diamond"],
#hr-overlay .fce-node[data-type="diamond"] *       { color: #bfdbfe !important; }
#hr-overlay .fce-node[data-type="yes"],
#hr-overlay .fce-node[data-type="yes"] *           { color: #22c55e !important; }
#hr-overlay .fce-node[data-type="no"],
#hr-overlay .fce-node[data-type="no"] *            { color: #fca5a5 !important; }
#hr-overlay .fce-node[data-type="result"],
#hr-overlay .fce-node[data-type="result"] *        { color: #86efac !important; }
#hr-overlay .fce-node-badge                        { color: #f3b2d0 !important; }
#hr-overlay .fce-pal-btn[data-type="process"]      { color: #fdf0f6 !important; }
#hr-overlay .fce-pal-btn[data-type="process-form"] { color: #f3b2d0 !important; }
#hr-overlay .fce-pal-btn[data-type="diamond"]      { color: #bfdbfe !important; }
#hr-overlay .fce-pal-btn[data-type="yes"]          { color: #22c55e !important; }
#hr-overlay .fce-pal-btn[data-type="no"]           { color: #fca5a5 !important; }
#hr-overlay .fce-pal-btn[data-type="result"]       { color: #86efac !important; }
#hr-overlay .fce-tool-btn                          { color: #d54084 !important; }
#hr-overlay .fce-tool-btn.active                   { color: white   !important; }
#hr-overlay .fce-tool-btn.primary                  { color: white   !important; }
#hr-overlay .fce-tool-btn.danger                   { color: #ef4444 !important; }
#hr-overlay .fce-props-title                       { color: #7a1040 !important; }
#hr-overlay .fce-label                             { color: #b8809a !important; }
#hr-overlay .fce-input,
#hr-overlay .fce-select,
#hr-overlay .fce-textarea                          { color: #3d1028 !important; }
#hr-overlay .fce-props-empty,
#hr-overlay .fce-props-hint                        { color: #b8809a !important; }
#hr-overlay .fce-del-btn                           { color: #ef4444 !important; }
#hr-overlay .fce-node-badge                        { color: #f3b2d0 !important; }

/* Exceptions — Boutons HR (couleurs fonctionnelles) */
#hr-overlay .hr-btn-primary                        { color: #fff    !important; }
#hr-overlay .hr-btn-secondary                      { color: #3d1028 !important; }
#hr-overlay .hr-btn-ghost                          { color: #7a4060 !important; }
#hr-overlay .hr-btn-ghost:hover                    { color: #d54084 !important; }
#hr-overlay .hr-btn-success                        { color: #166534 !important; }
#hr-overlay .hr-btn-danger                         { color: #b91c1c !important; }
#hr-overlay a.hr-btn                               { color: inherit !important; }

/* Exceptions (titres forts) */
.hr-page-title,
.hr-sidebar-title,
.hr-user-name {
  color: #a8275f !important; /* rose InfraX */
}

/* Labels et textes secondaires */
.hr-user-role,
.hr-empty,
.hr-detail-meta,
.hr-list-item-sub {
  color: #7a4060 !important; /* gris lisible */
}

/* Inputs */
.hr-field input,
.hr-field textarea,
.hr-field select {
  color: #3d1028 !important;
  background: #ffffff !important;
  border: 1.5px solid #e8cdd9 !important;
}

/* Placeholder */
.hr-field input::placeholder,
.hr-field textarea::placeholder {
  color: #b8809a !important;
}

/* Select options (IMPORTANT pour ton bug) */
select,
option {
  background: #ffffff !important;
  color: #3d1028 !important;
}

/* Table */
.hr-comp-table,
.hr-comp-table td,
.hr-comp-table th {
  color: #3d1028 !important;
}

/* Liste */
.hr-list-item-title {
  color: #3d1028 !important;
}

/* Boutons secondaires */
.hr-btn-secondary,
.hr-btn-ghost {
  color: #3d1028 !important;
}

/* Cards */
.hr-detail-card {
  background: #ffffff !important;
  border: 1px solid #e8cdd9 !important;
}

/* ─── Training eval nav badge ────────────────────────────────────────────── */
.hr-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  margin-left: 6px;
  vertical-align: middle;
  animation: hr-badge-pulse 2s ease-in-out infinite;
}

@keyframes hr-badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ─── Highlighted list item (pending action) ─────────────────────────────── */
.hr-list-item-highlight {
  border-left: 3px solid #f59e0b !important;
  background: rgba(245, 158, 11, 0.05) !important;
}

/* ─── Alert banner ───────────────────────────────────────────────────────── */
.hr-alert-warn {
  background: rgba(245, 158, 11, 0.10) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  border-radius: 8px;
  color: var(--text-primary, #1e293b);
}

/* ─── Competence rows in edit forms ──────────────────────────────────────── */
.ep-competence-row input,
.cp-competence-row input {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.85rem;
  color: var(--text-primary, #1e293b);
  min-width: 0;
}

.ep-competence-row input:focus,
.cp-competence-row input:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

/* ─── Mark-complete button highlight ─────────────────────────────────────── */
.hr-btn.hr-btn-primary.hr-btn-sm {
  font-size: 0.78rem;
  padding: 4px 10px;
}
/* ═══════════════════════════════════════════════════════════
   Dashboard — Lower section (flowchart + procedure)
   ═══════════════════════════════════════════════════════════ */

.hr-page-dashboard { max-width: 1400px; }

.hr-section-title {
  margin: 0 0 14px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hr-flow-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary, #94a3b8);
}

.hr-dashboard-lower {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}

/* ─── Procedure card ─────────────────────────────────────── */
.hr-proc-section {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 16px;
}

.hr-proc-card {
  background: rgba(168,85,247,.08);
  border: 1px solid rgba(168,85,247,.3);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hr-proc-card:hover {
  background: rgba(168,85,247,.14);
  border-color: rgba(168,85,247,.55);
  transform: translateY(-1px);
}
.hr-proc-card-icon { font-size: 28px; }
.hr-proc-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.4;
}
.hr-proc-card-ref {
  font-size: 11px;
  color: #a78bfa;
}
.hr-proc-card-hint {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
  margin-top: 4px;
}

.hr-proc-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.hr-proc-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: rgba(255,255,255,.03);
  border: 1px dashed rgba(255,255,255,.12);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary, #94a3b8);
}

/* ─── Flowchart container ────────────────────────────────── */
.hr-flow-section {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: 16px;
}

.hr-flow-container {
  overflow-y: auto;
  max-height: 820px;
  border-radius: 8px;
  border: 1px solid #a8275f;
  background: #fdf0f6;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 191, 244, 0.45) transparent;
}
.hr-flow-container::-webkit-scrollbar { width: 6px; }
.hr-flow-container::-webkit-scrollbar-track { background: transparent; }
.hr-flow-container::-webkit-scrollbar-thumb { background: rgba(168,85,247,.4); border-radius: 3px; }

/* Clickable nodes in flowchart */
.hr-flow-clickable {
  cursor: pointer;
}
.hr-flow-clickable rect:first-child {
  transition: filter .15s, stroke-width .1s;
}
.hr-flow-clickable:hover rect:first-child {
  filter: brightness(1.15);
  stroke-width: 2.5px !important;
}

/* ─── Procedure viewer modal (popup launcher) ────────────── */
.hr-proc-modal-wrap {
  z-index: 4000;
}
.hr-proc-modal {
  background: var(--bg-card, #1e293b);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  overflow: hidden;
}
/* Card variant (launcher) — compact, no iframe */
.hr-proc-modal-card {
  width: 460px;
  max-width: 95vw;
}
.hr-proc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  gap: 12px;
}
.hr-proc-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
}
.hr-proc-modal-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}
.hr-proc-modal-sub {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
  margin-top: 2px;
}
.hr-proc-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Launch body */
.hr-proc-launch-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hr-proc-launch-icon { font-size: 48px; }
.hr-proc-launch-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.hr-proc-launch-btn {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 12px 16px !important;
  text-align: left;
  width: 100%;
  height: auto !important;
}
.hr-proc-btn-icon { font-size: 20px; flex-shrink: 0; }
.hr-proc-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hr-proc-btn-text strong { font-size: 13px; }
.hr-proc-btn-text small  { font-size: 11px; opacity: .75; font-weight: 400; }
.hr-proc-launch-note {
  font-size: 11px;
  color: var(--text-secondary, #94a3b8);
  text-align: center;
  line-height: 1.5;
  padding: 0 8px;
}

/* ─── Responsive tweaks ──────────────────────────────────── */
@media (max-width: 900px) {
  .hr-dashboard-lower {
    grid-template-columns: 1fr;
  }
}
/* ─── HR access error (Jira-session based auth, no module login) ───────────── */
.hr-access-error-wrap {
  flex: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-base, #0f172a);
}
.hr-access-error-card {
  width: min(460px, 100%);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
}
.hr-access-logo {
  height: 54px;
  width: auto;
  object-fit: contain;
  margin-bottom: 18px;
}
.hr-access-error-card h2 {
  margin: 0 0 8px;
  color: var(--text-primary,#f1f5f9);
  font-size: 18px;
  font-weight: 700;
}
.hr-access-error-card p {
  margin: 0;
  color: var(--text-secondary,#94a3b8);
  font-size: 13px;
  line-height: 1.55;
}
.hr-access-error-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}