/* ==========================================================================
   Palvion Connect — HR directory + org chart styles
   Scoped with hr-/oc- prefixes. Uses the shared design tokens from index.css so
   it matches the dark theme (do NOT duplicate tokens here — read them from
   :root). Modal shells reuse .modal-overlay/.modal-content/.modal-body from
   index.css; only HR-specific pieces live below.
   ========================================================================== */

/* ----- header + sub-nav ----- */
.hr-head { margin-bottom: 6px; }
.hr-title { font-size: 22px; font-weight: 700; }
.hr-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.hr-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 14px;
}

.hr-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.hr-pill i, .hr-pill svg { width: 15px; height: 15px; }
.hr-pill:hover { color: var(--text-primary); border-color: var(--glass-border-strong); }
.hr-pill.active {
  background-image: var(--accent-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ----- stat cards ----- */
.hr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.hr-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.hr-stat-ic {
  width: 42px; height: 42px; flex: none;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--indigo-soft, rgba(99,102,241,0.13));
  color: var(--accent-2);
}
.hr-stat-ic i, .hr-stat-ic svg { width: 20px; height: 20px; }
.hr-stat-value { font-family: var(--font-heading); font-size: 26px; font-weight: 700; line-height: 1.1; }
.hr-stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ----- toolbar + search ----- */
.hr-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.hr-toolbar-title { font-size: 16px; font-weight: 600; }
.hr-search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.hr-search i, .hr-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.hr-search input { padding-left: 36px; width: 100%; }

/* ----- table cells ----- */
.hr-cell-person { display: flex; align-items: center; gap: 10px; }
.hr-avatar {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px;
  color: #fff;
  background-image: var(--accent-gradient);
}
.hr-avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.hr-avatar.lg { width: 56px; height: 56px; font-size: 18px; }

.hr-type-pill {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.hr-row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.hr-row-actions .btn-sm { padding: 6px 9px; }

.hr-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--glass-border); }

.hr-section-label {
  font-family: var(--font-heading);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--violet-text);
  margin: 22px 0 12px;
}

/* ----- profile drawer ----- */
.hr-profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.hr-profile-name { font-size: 20px; font-weight: 700; }
.hr-profile-role { font-size: 13px; color: var(--text-secondary); margin: 3px 0 8px; }
.hr-profile-headmeta > div:last-child { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.hr-details-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.hr-detail-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 3px; }
.hr-detail-value { font-size: 13.5px; color: var(--text-primary); overflow-wrap: anywhere; }

.hr-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.hr-chip { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--violet-soft); color: var(--violet-text); }

/* lifecycle strip */
.hr-lifecycle { display: flex; align-items: center; gap: 4px; margin: 4px 0 22px; flex-wrap: wrap; }
.hr-life-step { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.hr-life-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--glass-border-strong); border: 2px solid transparent; }
.hr-life-step.done { color: var(--text-primary); }
.hr-life-step.done .hr-life-dot { background: var(--green); }
.hr-life-step.current .hr-life-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.25); }
.hr-life-line { flex: 1; min-width: 12px; height: 2px; background: var(--glass-border); }

/* timeline */
.hr-timeline { display: flex; flex-direction: column; gap: 2px; }
.hr-tl-item { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.hr-tl-dot { width: 9px; height: 9px; flex: none; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.hr-tl-title { font-size: 13.5px; font-weight: 600; }
.hr-tl-detail { font-size: 12px; color: var(--text-secondary); }
.hr-tl-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ----- leadership cards ----- */
.hr-lead-group { margin-bottom: 8px; }
.hr-lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; }
.hr-lead-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px;
}
.hr-lead-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hr-lead-kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 3px 0; }
.hr-lead-kv .hr-detail-label { margin: 0; }
.hr-lead-kv > span:last-child { color: var(--text-primary); text-align: right; overflow-wrap: anywhere; }
.hr-lead-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ----- org chart ----- */
.oc-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.oc-toggle { display: inline-flex; gap: 6px; }
.oc-toggle .hr-pill { padding: 7px 13px; font-size: 12.5px; }
.oc-toolbar-actions { display: flex; gap: 8px; margin-left: auto; }

.oc-chart { padding: 20px; }

.oc-tier { margin-bottom: 22px; }
.oc-tier:last-child { margin-bottom: 0; }
.oc-tier-label {
  font-family: var(--font-heading);
  font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--glass-border);
}

.oc-row { display: flex; flex-wrap: wrap; gap: 10px; }

.oc-node {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  min-width: 170px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.oc-node.oc-hit { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,0.28); }
.oc-ava {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background-image: var(--accent-gradient);
}
.oc-node-name { font-size: 13px; font-weight: 600; }
.oc-node-sub { font-size: 11px; color: var(--text-muted); }

.oc-dept { margin-bottom: 12px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 12px 14px; background: rgba(255,255,255,0.012); }
.oc-dept-head { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.oc-dept-head b { font-size: 14px; }
.oc-caret { color: var(--text-muted); font-size: 12px; width: 12px; }

.oc-tree { display: flex; flex-direction: column; gap: 8px; }
.oc-tree-node { display: flex; flex-direction: column; gap: 8px; }
.oc-tree-node > .oc-node { align-self: flex-start; }
.oc-tree-children {
  margin-left: 18px;
  padding-left: 16px;
  border-left: 2px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 8px;
}

/* ----- responsive ----- */
@media (max-width: 720px) {
  .hr-stats { grid-template-columns: 1fr; }
  .hr-details-grid { grid-template-columns: 1fr; }
  .oc-toolbar-actions { margin-left: 0; }
  .hr-search { max-width: none; }
}

/* ---------- J7: HR letters (employee profile drawer) ---------- */
.hr-doc-list { display: flex; flex-direction: column; }
