:root {
  --bg: #0f1c2e;
  --bg2: #152238;
  --bg3: #1a2d47;
  --border: rgba(255,255,255,0.10);
  --cyan: #00d4ff;
  --cyan-dim: rgba(0,212,255,0.18);
  --cyan-glow: rgba(0,212,255,0.40);
  --purple: #8b6bbf;
  --purple-dim: rgba(139,107,191,0.2);
  --green: #00c875;
  --amber: #f5a623;
  --red: #e5484d;
  --text: #f0f4f8;
  --text-dim: rgba(240,244,248,0.6);
  --text-faint: rgba(240,244,248,0.35);
  --radius: 8px;
  --sidebar-w: 220px;
  --header-h: 52px;
  --card-bg: #ffffff;
  --card-text: #1a2a42;
  --card-sub: #5a6a82;
  --card-border: rgba(26,42,66,0.12);
  --panel-bg: #ffffff;
  --panel-text: #1a2a42;
  --panel-sub: #5a6a82;
  --panel-border: rgba(26,42,66,0.10);
}

/* ── Sidebar scrollable when nav items overflow ─────────────── */
#sidebar {
  overflow-y: auto;
  overflow-x: hidden;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ── Global font size increase (+15%) ─────────────────────── */
body { font-size: 15px !important; }
.nav-item { font-size: 13.5px !important; }
.td-name { font-size: 13.5px !important; }
.td-sub { font-size: 12px !important; }
.status-pill { font-size: 10.5px !important; }
.modal-title { font-size: 18px !important; }

/* ── Candidate detail drawer — wider ──────────────────────── */
#candidate-drawer {
  width: 65vw !important;
  max-width: 900px !important;
  min-width: 500px !important;
}
#candidate-drawer iframe {
  min-height: 500px;
}

/* ── Card hover effects — blue bg with white text ─────────── */
.role-card,
.client-card,
.affiliate-card {
  transition: all 0.2s ease;
  cursor: pointer;
}
.role-card:hover,
.client-card:hover,
.affiliate-card:hover {
  background: var(--cyan-dim) !important;
  border-color: var(--cyan) !important;
}
.role-card:hover .role-title,
.role-card:hover .role-client,
.client-card:hover .client-name {
  color: #fff !important;
}

/* ── Candidate table row hover ────────────────────────────── */
#candidates-tbody tr:hover {
  background: var(--cyan-dim) !important;
}
#candidates-tbody tr:hover .td-name {
  color: var(--cyan) !important;
}

/* ── Pipeline card hover ──────────────────────────────────── */
.pipeline-card:hover {
  background: var(--cyan-dim) !important;
  border-color: var(--cyan) !important;
}

/* ── Toast: bottom-center, bigger, above Claude FAB ──────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: rgba(20, 22, 28, 0.96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  max-width: 80vw;
  min-width: 200px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transition: transform 0.25s ease, opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Pipeline kanban scrollbars: bigger, white/light visible ─ */
#kanban-board,
#page-pipeline div[style*="overflow-x"],
.pipe-col-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.55) rgba(255,255,255,0.08);
}
#kanban-board::-webkit-scrollbar,
#page-pipeline div[style*="overflow-x"]::-webkit-scrollbar,
.pipe-col-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
#kanban-board::-webkit-scrollbar-track,
#page-pipeline div[style*="overflow-x"]::-webkit-scrollbar-track,
.pipe-col-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
}
#kanban-board::-webkit-scrollbar-thumb,
#page-pipeline div[style*="overflow-x"]::-webkit-scrollbar-thumb,
.pipe-col-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.55);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
#kanban-board::-webkit-scrollbar-thumb:hover,
#page-pipeline div[style*="overflow-x"]::-webkit-scrollbar-thumb:hover,
.pipe-col-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.85);
  background-clip: padding-box;
}

/* ── Role cards — 3 per row, readable ─────────────────────── */
.roles-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
}
.role-card {
  padding: 14px !important;
  font-size: 12px !important;
  overflow: hidden !important;
}
.role-card .role-title {
  font-size: 14px !important;
  line-height: 1.3 !important;
  cursor: pointer;
  transition: color 0.15s;
}
.role-card:hover .role-title {
  color: var(--cyan) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Rich-text blocks inside the role detail modal — descriptions pasted from
   Manatal often arrive as HTML (<p><strong><ul><li>). Default browser
   styles handle most of it; we just need decent spacing so it doesn't all
   collapse onto one line. */
.role-rich-body p { margin: 0 0 8px 0; }
.role-rich-body ul, .role-rich-body ol { margin: 4px 0 8px 0; padding-left: 22px; }
.role-rich-body li { margin-bottom: 4px; }
.role-rich-body strong { color: var(--text); }
.role-rich-body a { color: var(--cyan); }
.role-rich-body br + br { display: none; }
.role-card .role-client {
  font-size: 11px !important;
}
.role-card .toggle-switch { transform: scale(0.7); }
@media (max-width: 1200px) {
  .roles-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ── Client cards — bigger tiles with 2x logo/name ─────────── */
.clients-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 12px !important;
}
.client-card {
  padding: 16px !important;
  min-height: 160px !important;
}
@media (max-width: 900px) {
  .clients-grid { grid-template-columns: 1fr !important; }
}

/* ── Placed badge — gold, prominent ───────────────────────── */
.status-pill.pill-placed {
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  color: #000 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 4px 12px !important;
  text-shadow: 0 1px 1px rgba(255,255,255,0.3);
}

/* ── Owner option hover ───────────────────────────────────── */
.owner-option { cursor: pointer; transition: background 0.15s; }
.owner-option:hover { background: var(--cyan-dim) !important; }

/* ── Pipeline filter bar — sticky on scroll ──────────────── */
#pipeline-filters {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg) !important;
  padding: 8px 0;
}

/* ── Pipeline drag-drop — full column height ─────────────── */
.pipe-col {
  transition: background 0.15s;
  min-height: calc(100vh - 240px) !important;
}
.pipe-col-content {
  min-height: calc(100vh - 300px) !important;
}

/* ── Mic pulse animation for voice recording ──────────────── */
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(229,72,77,0); }
  50% { transform: scale(1.15); box-shadow: 0 0 20px rgba(229,72,77,0.4); }
}

/* ── Light background mode ───────────────────────────────── */
/* White background behind all content. Cards/tables/inputs stay dark. */
/* To revert: remove .light-bg from <body> or delete this section */
body.light-bg #content {
  background: #f5f6fa;
}
body.light-bg .page {
  background: transparent;
}
/* Page headers / filter bars — slight transparency so they blend */
body.light-bg #page-candidates > div:first-child,
body.light-bg #page-roles > div:first-child,
body.light-bg #page-clients > div:first-child,
body.light-bg #page-companies > div:first-child,
body.light-bg #page-affiliates > div:first-child,
body.light-bg #page-archives > div:first-child {
  background: var(--bg2);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
}
/* Pipeline filters bar */
body.light-bg #pipeline-filters {
  background: var(--bg2);
  padding: 10px 14px;
  border-radius: 8px;
}
/* Data tables — keep dark rows */
body.light-bg .data-table {
  background: var(--bg3);
  border-radius: 8px;
  overflow: hidden;
}
/* Dashboard — keep chart and KPI cards dark, lighten the gaps */
body.light-bg #page-dashboard .charts-row {
  gap: 12px;
}
/* Overlays and modals — keep dark (they already have their own bg) */
/* Revenue page wrapper */
body.light-bg #page-revenue > div {
  background: transparent;
}

/* ── Sticky filter/action bars ────────────────────────────── */
/* Freeze filter bars at top when scrolling within #content */
#page-candidates > div:first-child,
#page-roles > div:first-child,
#page-roles > #role-bulk-bar,
#page-clients > div:first-child,
#page-companies > div:first-child,
#page-affiliates > div:first-child,
#page-archives > div:first-child,
#pipeline-filters {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  padding-top: 4px;
  padding-bottom: 10px;
}
/* Bulk bar needs slightly lower z but still sticky */
#role-bulk-bar {
  position: sticky !important;
  top: 48px;
  z-index: 99;
  background: var(--bg) !important;
}

/* ── Pagination controls ──────────────────────────────────── */
#cand-pagination {
  padding: 12px 0;
  font-size: 12px;
}
#cand-pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
