/* 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;
}

.candidates-sidebar-col {
  flex: 0 0 200px !important;
  max-width: 200px !important;
  min-width: 200px !important;
  width: 200px !important;
  padding: 0;
  overflow: hidden;
}

.candidates-home-link-icon {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.candidates-home-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  line-height: 1;
}

.candidates-sidebar-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.candidates-sidebar-title {
  margin: 0;
  line-height: 1.2;
  font-size: 1.5rem;
}

.candidates-sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.candidates-landing-container {
  padding: 40px;
  text-align: center;
}

.candidates-landing-title {
  margin-bottom: 20px;
  color: #333;
}

.candidates-landing-text {
  color: #666;
  font-size: 16px;
}

.candidates-recruiting-container {
  display: none; /* toggled to flex by callback */
  width: 100%;
  padding: 0;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.candidates-filter-label {
  margin: 0;
  font-weight: bold;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.candidates-timespan-filter {
  align-items: center;
  gap: 10px;
}

.candidates-filter-dropdown-timespan {
  width: 160px;
  min-width: 140px;
}

.candidates-filter-dropdown-timespan .Select-control {
  display: flex;
  align-items: center;
  min-height: 36px;
  height: 36px;
}

.candidates-filter-dropdown-timespan .Select-value,
.candidates-filter-dropdown-timespan .Select-placeholder {
  display: flex;
  align-items: center;
  line-height: normal;
}

.candidates-filter-dropdown-timespan .Select-value-label,
.candidates-filter-dropdown-timespan .Select-placeholder {
  line-height: normal;
}

.candidates-filter-dropdown-recruiter {
  min-width: 180px;
}

.candidates-filter-dropdown-bin {
  min-width: 260px;
}

.candidates-filter-row {
  gap: 20px;
}

.candidates-top-filters {
  padding: 15px 20px;
  border-bottom: 1px solid #ddd;
  background-color: #f5f5f5;
  flex-shrink: 0;
}

.candidates-table-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 32px 32px;
  overflow: hidden;
}

/* Table view: hide Dash's dcc.Loading wrapper so it doesn't split flex space */
#candidates-table-wrapper > div:has(#candidates-loading),
#candidates-loading {
  display: none !important;
  height: 0 !important;
  flex: 0 0 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.candidates-loading-container {
  height: 0;
  width: 0;
  overflow: hidden;
}

.candidates-table-container {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.candidates-table-loading-msg {
  padding: 40px;
  text-align: center;
  color: #666;
}

.candidates-content-container {
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background-color: #f5f5f5;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
}

.candidates-detail-container {
  display: none; /* toggled to flex by callback */
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

/* Detail view: hide Dash's dcc.Loading wrapper so it doesn't split flex space */
#candidates-detail-container > div:has(#candidates-detail-loading),
#candidates-detail-loading,
#candidates-detail-container > div:empty {
  display: none !important;
  height: 0 !important;
  flex: 0 0 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#candidates-detail-error-message:not(:empty) {
  flex: 0 0 auto !important;
}

.candidates-detail-content {
  padding: 24px 32px 48px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* Detail page: sidebar hidden — main column spans full width */
.candidates-main-row:has(#candidates-sidebar-col[style*="display: none"]) .candidates-main-col,
.candidates-main-row:has(#candidates-sidebar-col[style*="display:none"]) .candidates-main-col {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
}

.candidates-detail-error {
  display: none !important;
  padding: 20px;
  color: red;
}

.candidates-error-message {
  display: none !important;
  padding: 20px;
  color: red;
  flex-shrink: 0;
}

.candidates-content-wrapper {
  padding: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100vh;
  background-color: #f5f5f5;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.candidates-main-col {
  padding: 0;
  min-width: 0;
  flex: 1 1 0 !important;
  max-width: none !important;
  width: auto !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.candidates-main-row {
  margin: 0;
  height: 100vh;
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
}

#candidates-layout-root,
.candidates-page-root {
  background-color: #f5f5f5;
  height: 100vh;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  width: 100%;
}

.candidates-page-root > div {
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* 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 outer container; 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;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.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;
}

/* Keep candidate name + Marketplace mismatch emoji on one line (Tracker, Hires, etc.). */
.candidates-spreadsheet tr[data-recruiter] td:first-child .candidates-name-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  flex-wrap: nowrap;
}

.candidates-spreadsheet .candidates-marketplace-mismatch-emoji {
  color: #b45309;
  cursor: help;
  flex-shrink: 0;
}

.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 .expandable-card.expanded .card-content {
  overflow: visible;
}

.candidate-detail-grid .expandable-card:not(.expanded) .card-content {
  overflow: hidden !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.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: 5px 0;
}

/* Progression row: label left, date right */
.candidate-progression-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 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 0 10px;
  border-left: 2px dotted #ccc;
  line-height: 1;
  display: block;
}

.candidate-progression-days__text {
  font-size: 9px;
  color: #666;
  line-height: 1;
}

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

.candidate-detail-progression-card .card-content {
  padding: 5px 12px !important;
}

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

@media (min-width: 640px) {
  .candidate-detail-grid {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .candidate-detail-grid {
    column-count: 3;
  }
}

@media (min-width: 1400px) {
  .candidate-detail-grid {
    column-count: 4;
  }
}

.expandable-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 20px;
}

.candidate-detail-assessment-panel {
  width: 100%;
}

.candidate-assessment-panel {
  width: 100%;
}

.candidate-assessment-panel.expanded .card-content {
  overflow: visible;
}

.candidate-assessment-panel:not(.expanded) .card-content {
  overflow: hidden !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.candidate-assessment-panel .assessment-results-empty {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.candidate-assessment-panel #assessment-shift-report-table {
  width: 100%;
}

.assessment-panel-loading {
  position: relative;
  width: 100%;
  min-height: 160px;
}

.assessment-panel-loading-body {
  width: 100%;
}

/* 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;
}
