/* ═══════════════════════════════════════════════════════════════
   Hiring Module — Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Tab Bar ──────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 22px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--mid-gray);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  font-family: var(--font-display);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Pipeline Board (Kanban) ──────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 400px;
}
.pipeline-col {
  min-width: 220px;
  width: 220px;
  flex: 0 0 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.pipeline-col-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--dark-gray);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pipeline-col-header .count {
  background: var(--primary-lighter, #e0f2f1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.pipeline-col-body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 500px;
}
.pipeline-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.pipeline-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.pipeline-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-gray);
  margin-bottom: 4px;
}
.pipeline-card-pos {
  font-size: 11px;
  color: var(--mid-gray);
  margin-bottom: 6px;
}
.pipeline-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--mid-gray);
}
.pipeline-card-meta .branch-tag {
  background: var(--primary-lighter, #e0f2f1);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

/* ── Stage Badges ─────────────────────────────────────────────── */
.stage-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.stage-applied { background: #e3f2fd; color: #1565c0; }
.stage-pre-employment { background: #fff3e0; color: #e65100; }
.stage-interview-scheduled { background: #f3e5f5; color: #7b1fa2; }
.stage-interviewed { background: #e8eaf6; color: #283593; }
.stage-accepted { background: #e8f5e9; color: #2e7d32; }
.stage-contract-sent { background: #fff8e1; color: #f57f17; }
.stage-contract-signed { background: #e0f2f1; color: #00695c; }
.stage-onboarding { background: #fce4ec; color: #c62828; }
.stage-completed { background: #e8f5e9; color: #1b5e20; }
.stage-declined { background: #ffebee; color: #c62828; }
.stage-hr-evaluated { background: #e8eaf6; color: #283593; }
.stage-dh-interview-scheduled { background: #f3e5f5; color: #7b1fa2; }
.stage-dh-evaluated { background: #ede7f6; color: #4527a0; }

/* ── Evaluation Badges ────────────────────────────────────────── */
.eval-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.eval-Recommended { background: #e8f5e9; color: #2e7d32; }
.eval-With\ Reservations, .eval-With.Reservations { background: #fff3e0; color: #e65100; }
.eval-Not\ Recommended, .eval-Not.Recommended { background: #ffebee; color: #c62828; }

/* ── Flow Process (Shopee-like) ───────────────────────────────── */
.flow-process {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 20px 0;
  overflow-x: auto;
  padding-bottom: 8px;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
  position: relative;
}
.flow-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  font-weight: 700;
  z-index: 1;
  transition: background .2s;
}
.flow-step.done .flow-step-dot { background: var(--primary); }
.flow-step.active .flow-step-dot { background: #f57c00; box-shadow: 0 0 0 4px rgba(245,124,0,0.2); }
.flow-step.declined .flow-step-dot { background: #c62828; }
.flow-step-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--mid-gray);
  margin-top: 6px;
  text-align: center;
  max-width: 80px;
}
.flow-step.done .flow-step-label { color: var(--primary); }
.flow-step.active .flow-step-label { color: #f57c00; font-weight: 700; }
.flow-connector {
  flex: 1;
  height: 3px;
  background: var(--border);
  min-width: 20px;
  margin-top: -16px;
}
.flow-connector.done { background: var(--primary); }

/* ── Job Postings Grid ────────────────────────────────────────── */
.postings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  gap: 16px;
}
.posting-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .15s;
}
.posting-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.posting-poster {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mid-gray);
  font-size: 13px;
  overflow: hidden;
}
.posting-poster img { width: 100%; height: 100%; object-fit: cover; }
.posting-body {
  padding: 16px;
}
.posting-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark-gray);
  margin-bottom: 4px;
}
.posting-dept {
  font-size: 12px;
  color: var(--mid-gray);
  margin-bottom: 8px;
}
.posting-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--mid-gray);
  margin-bottom: 12px;
}
.posting-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.posting-actions .btn-sm {
  font-size: 11px;
  padding: 3px 8px;
}
.posting-actions .public-link {
  font-size: 11px;
  padding: 3px 8px;
}

/* ── Postings List View ──────────────────────────────────────── */
.postings-list { display: flex; flex-direction: column; gap: 8px; }
.posting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow .15s;
}
.posting-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.posting-row-thumb {
  width: 48px; height: 48px;
  border-radius: 6px;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--mid-gray);
}
.posting-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.posting-row-info { flex: 1; min-width: 0; }
.posting-row-title { font-weight: 700; font-size: 14px; color: var(--dark-gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.posting-row-sub { font-size: 12px; color: var(--mid-gray); }
.posting-row-badges { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.posting-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.posting-row-actions .btn-sm { font-size: 11px; padding: 3px 8px; }

/* ── Stats Row ────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-display);
}
.stat-label {
  font-size: 12px;
  color: var(--mid-gray);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Activity List ────────────────────────────────────────────── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-lighter, #e0f2f1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.activity-text { flex: 1; color: var(--dark-gray); }
.activity-time { font-size: 11px; color: var(--mid-gray); white-space: nowrap; }

/* ── Onboarding Checklist ─────────────────────────────────────── */
.onboarding-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onboarding-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background .1s;
}
.onboarding-item:hover { background: #f0f0f0; }
.onboarding-item.checked { background: #e8f5e9; border-color: #c8e6c9; }
.onboarding-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.onboarding-group {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--mid-gray);
  letter-spacing: 0.5px;
  margin-top: 12px;
  margin-bottom: 4px;
}

/* ── Settings Branch Cards ────────────────────────────────────── */
.settings-branches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.settings-branch-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.settings-branch-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--dark-gray);
}

/* ── Applicant Detail Sections ────────────────────────────────── */
.detail-section {
  margin-bottom: 16px;
}
.detail-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-gray);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.detail-row {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 13px;
}
.detail-label {
  font-weight: 600;
  color: var(--mid-gray);
  min-width: 140px;
}
.detail-value { color: var(--dark-gray); }

/* ── Misc ─────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}
.btn-accept {
  background: #2e7d32;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-accept:hover { background: #1b5e20; }
.btn-decline {
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-decline:hover { background: #b71c1c; }
.btn-schedule {
  background: #7b1fa2;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-schedule:hover { background: #6a1b9a; }
.btn-onboard {
  background: #00695c;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-onboard:hover { background: #004d40; }
.btn-probation {
  background: #e65100;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-probation:hover { background: #bf360c; }

/* ── Probation Checklist ─────────────────────────────────────── */
.prob-header { margin-bottom: 16px; }
.prob-header-row { display: flex; gap: 24px; margin-bottom: 8px; flex-wrap: wrap; }
.prob-field { font-size: 13px; color: var(--dark-gray); }
.prob-field-label { color: var(--mid-gray); font-size: 12px; }

.prob-rating-legend { background: #f8f9fa; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.prob-legend-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.prob-legend-table td { padding: 3px 8px; }
.prob-legend-num { font-weight: 700; color: #e65100; width: 30px; text-align: center; }
.prob-legend-label { font-weight: 600; width: 130px; }

.prob-checklist-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prob-checklist-table th { background: #f5f5f5; padding: 8px 10px; border-bottom: 2px solid #ddd; text-align: left; font-size: 11px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.prob-category-row td { background: #1a7b8a; color: #fff; font-weight: 700; font-size: 13px; padding: 8px 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.prob-sub-row td { background: #e0f2f1; color: #00695c; font-weight: 600; font-size: 12px; padding: 6px 12px; }
.prob-item-row td { padding: 6px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.prob-item-row:hover td { background: #fafafa; }
.prob-item-num { width: 30px; color: var(--mid-gray); font-size: 12px; text-align: center; }
.prob-item-label { line-height: 1.4; }
.prob-rating-cell { text-align: center; width: 40px; }
.prob-radio-label { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.prob-radio-label input[type="radio"] { display: none; }
.prob-radio-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ddd;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #999; transition: all 0.15s;
}
.prob-radio-label input[type="radio"]:checked + .prob-radio-dot {
  background: #e65100; color: #fff; border-color: #e65100;
}
.prob-radio-label:hover .prob-radio-dot { border-color: #e65100; color: #e65100; }
.prob-total-row {
  margin-top: 16px; padding: 12px 16px; background: #fff3e0; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; color: #e65100; text-align: right;
}

/* Pipeline stage badges for new stages */
.stage-probation { background: #fff3e0; color: #e65100; }
.stage-regularized { background: #dbeafe; color: #1d4ed8; }
.stage-terminated { background: #fef2f2; color: #b91c1c; }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--mid-gray);
  font-size: 13px;
}

/* ── Public Job Page link ─────────────────────────────────────── */
.public-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.public-link:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .pipeline-board { flex-direction: column; }
  .pipeline-col { max-width: 100%; min-width: auto; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .postings-grid { grid-template-columns: 1fr; }
  .settings-branches { grid-template-columns: 1fr; }
  .flow-process { flex-wrap: wrap; }
}
