/* Candidates spreadsheet table - minimal padding, class-based styling */

/* Sidebar container (header + nav + last ingested) */
.candidates-sidebar-container {
  padding: 15px;
  background-color: #fafafa;
  height: 100vh;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
}

/* Last ingested date at bottom of sidebar */
.candidates-last-ingested {
  margin-top: auto;
  padding-top: 15px;
  font-size: 11px;
  color: #666;
  flex-shrink: 0;
}

.candidates-last-ingested__stale {
  color: #c0392b;
  font-weight: bold;
}

/* Sidebar nav links (Tracker, Hires, etc.) */
.candidates-nav-link {
  padding: 10px;
  display: block;
  text-decoration: none;
  color: inherit;
  background-color: #ffffff;
  border-radius: 4px;
  margin-bottom: 5px;
}

.candidates-nav-link.active {
  background-color: #f0f0f0;
}

/* Horizontal scroll on content container (scrollbar at viewport bottom); vertical scroll on inner */
.candidates-horizontal-scroll {
  overflow-x: auto !important;
  overflow-y: hidden !important;
}

.candidates-vertical-scroll {
  overflow-x: visible !important;
  overflow-y: auto !important;
}

.candidates-spreadsheet {
  display: inline-block;
  min-width: 100%;
}

.candidates-spreadsheet table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 13px;
}

.candidates-spreadsheet th,
.candidates-spreadsheet td {
  border: 1px solid #ddd;
  padding: 2px 4px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.candidates-spreadsheet th {
  background-color: #5c6bc0;
  color: #fff;
}

/* Sticky column header row - stays at top when scrolling vertically */
.candidates-spreadsheet .candidates-col-header-row th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #5c6bc0;
  box-shadow: 0 1px 0 #ddd;
}

/* Sticky corner cell - top-left when scrolling both directions */
.candidates-spreadsheet .candidates-col-header-row th:first-child {
  left: 0;
  z-index: 10;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
}

/* Sticky first column - stays when scrolling horizontally, other columns scroll underneath */
.candidates-spreadsheet .candidates-recruiter-header,
.candidates-spreadsheet .candidates-bin-header {
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.08);
}

/* Brown bin headers - first cell sticky so "Offer", "Pending Hire" never scroll off */
.candidates-spreadsheet .candidates-bin-header-row .candidates-bin-header,
.candidates-spreadsheet .candidates-bin-header-row .candidates-bin-header-fill {
  background-color: #d7ccc8 !important;
}

.candidates-spreadsheet tr[data-recruiter] td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.08);
  background-color: #f5f5f5;
}

.candidates-spreadsheet .candidates-recruiter-header,
.candidates-spreadsheet .candidates-recruiter-header-fill {
  background-color: #5c6bc0;
  color: #fff;
  font-weight: bold;
  padding: 2px 4px;
}

.candidates-spreadsheet .candidates-bin-header {
  background-color: #d7ccc8;
  color: #000;
  font-weight: bold;
  padding: 2px 4px;
}

/* Row backgrounds by recruiter. Saturation increases with bin tier (mix with white = less saturated). */
.candidates-spreadsheet tr[data-recruiter] {
  --recruiter-base: #fafafa;
  background-color: var(--recruiter-base);
}
.candidates-spreadsheet tr[data-recruiter] td:first-child {
  background-color: var(--recruiter-base);
}

/* More saturated bases so tier progression (50–100% mix) is visible */
.candidates-spreadsheet tr[data-recruiter="Crystal Lora"] { --recruiter-base: #b8e0a8; }
.candidates-spreadsheet tr[data-recruiter="Maritza Goller"] { --recruiter-base: #f5c4a8; }
.candidates-spreadsheet tr[data-recruiter="Michelle Clancy"] { --recruiter-base: #e8a8e0; }
.candidates-spreadsheet tr[data-recruiter="Samantha Cantor"] { --recruiter-base: #b8d4f0; }

/* Tier 0–5: mix base with white. 50 + tier*10 = 50,60,70,80,90,100% */
.candidates-spreadsheet tr[data-bin-tier="0"] { --tier-mix: 50%; }
.candidates-spreadsheet tr[data-bin-tier="1"] { --tier-mix: 60%; }
.candidates-spreadsheet tr[data-bin-tier="2"] { --tier-mix: 70%; }
.candidates-spreadsheet tr[data-bin-tier="3"] { --tier-mix: 80%; }
.candidates-spreadsheet tr[data-bin-tier="4"] { --tier-mix: 90%; }
.candidates-spreadsheet tr[data-bin-tier="5"] { --tier-mix: 100%; }
.candidates-spreadsheet tr[data-recruiter],
.candidates-spreadsheet tr[data-recruiter] td:first-child {
  background-color: color-mix(in srgb, var(--recruiter-base) var(--tier-mix, 100%), white);
}

/* Candidate detail - responsive layout */
.candidate-detail-grid .card-content {
  overflow: visible;
}

.candidate-progression-total-days {
  color: var(--text-secondary, #555);
  font-size: 0.95rem;
}

.candidate-progression-status-wrap {
  margin-bottom: 12px;
}

.candidate-progression-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px 0;
}

/* Progression row: label left, date right */
.candidate-progression-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 0;
  border-radius: 4px;
}

.candidate-progression-row--current {
  border-left: 3px solid #5c6bc0;
  background-color: #e3f2ff;
}

.candidate-progression-row--completed {
  border-left: 3px solid #2e7d32;
  background-color: #eefff0;
}

.candidate-progression-row--future {
  border-left: 3px solid #e0e0e0;
  background-color: #f4f2f8;
}

.candidate-progression-row--current .candidate-progression-row__label {
  font-weight: bold;
}

.candidate-progression-row__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.candidate-progression-row__date {
  font-size: 12px;
  color: #666;
}

.candidate-progression-row--completed .candidate-progression-row__check {
  color: #2e7d32;
  font-size: 14px;
}

/* Days-between connector - compact spacing to fit between rows */
.candidate-progression-days {
  margin: 2px 0 2px 15px;
  padding: 0 0 1px 10px;
  border-left: 2px dashed #ccc;
}

.candidate-progression-days__text {
  font-size: 10px;
  color: #000;
  line-height: 1.2;
}

.candidate-progression-empty {
  color: #666;
  font-size: 14px;
}

/* Responsive grid - cards flow into columns */
.candidate-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
}

@media (min-width: 640px) {
  .candidate-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .candidate-detail-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Card styling for each section - no padding, header/content handle their own */
.candidate-detail-card {
  background: #fff;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e8e8e8;
  min-width: 0; /* prevent grid blowout */
}

.candidate-detail-card .detail-page-section {
  display: block; /* override grid - keep heading + table stacked */
}

/* Panel headers match map popups: navy background, white text */
.detail-section-header {
  border-bottom: none;
}

.detail-section-header.panel-header {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.detail-section-content {
  padding: 12px 15px 16px;
}

.detail-page-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Key-value tables: label left, value right in bold */
.detail-page-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-page-table-key {
  color: #666;
  padding: 4px 8px 4px 0;
  vertical-align: top;
}

.detail-page-table-value {
  font-weight: bold;
  padding: 4px 0;
}
