/* ==========================================================================
   Premium Modern TA & Telemetry Design System
   - Slate & Indigo Accents, Crisp Borders, Subtle Hover Transitions
   - Custom Monospace font layouts for telemetry metrics
   - Clean, professional styling with zero emoji icons
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-main: #ffffff;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-subtle: #ffffff;
  --bg-hover: #f5f5f5;
  
  --border-color: #e5e5e5;
  --border-dark: #000000;
  
  --text-main: #000000;
  --text-muted: #333333;
  --text-dim: #666666;
  --text-on-dark: #000000;
  --text-on-dark-dim: #666666;
  
  --primary: #000000;
  --primary-hover: #222222;
  --primary-bg: #ffffff;
  --primary-text: #000000;
  
  --success: #000000;
  --success-bg: #ffffff;
  --success-text: #000000;
  
  --danger: #000000;
  --danger-bg: #ffffff;
  --danger-text: #000000;

  --neutral-badge-bg: #f5f5f5;
  --neutral-badge-text: #333333;
  
  --sidebar-width: 240px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  font-size: 0.9rem;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.2s ease;
}

input, select, textarea {
  font-family: inherit;
  color: inherit;
  transition: all 0.2s ease;
}

/* Layout */
#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar (Dark & Sleek) */
aside.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid var(--border-color);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Let the nav scroll so the industry switcher stays pinned to the bottom */
aside.sidebar .nav-section {
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-industry-switcher {
  flex-shrink: 0;
}
.sidebar-industry-switcher select:hover {
  border-color: var(--primary, #000);
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: #000000;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.project-switcher-container {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.project-switcher-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-on-dark-dim);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.project-select-btn {
  width: 100%;
  padding: 0.4rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 500;
}

.project-select-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-section {
  padding: 0.25rem 0.5rem;
  flex: 1;
  overflow-y: auto;
}

.nav-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-on-dark-dim);
  padding: 0.25rem 0.5rem;
  letter-spacing: 0.08em;
  margin-top: 0.4rem;
}

.nav-title:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-on-dark-dim);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.nav-item:hover {
  color: #000000;
  background-color: #f5f5f5;
}

.nav-item:hover svg {
  transform: translateX(2px);
}

.nav-item.active {
  color: #000000;
  background: #f5f5f5;
  font-weight: 700;
  border-left: 3px solid #000000;
  padding-left: calc(0.5rem - 3px);
}

/* Main Content */
main.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Header */
header.top-header {
  height: var(--header-height);
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header-icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background-color: var(--danger);
  border-radius: 50%;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info-text {
  line-height: 1.2;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.user-role-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Page Container */
.page-container {
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-dark);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* Metrics Dashboard Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--card-accent, var(--primary));
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-icon-wrapper {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
}

.kpi-footer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.delta-badge {
  font-weight: 600;
}

.delta-badge.up {
  color: #047857;
}

.delta-badge.down {
  color: #b91c1c;
}

/* Card Panels & Lists */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 1024px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.card-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Clean Professional Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-hover);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr {
  transition: background-color 0.15s ease;
}

.data-table tr:hover td {
  background-color: var(--bg-hover);
  cursor: pointer;
}

/* Modern Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-positive {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: rgba(16, 185, 129, 0.2);
}

.badge-neutral {
  background: var(--neutral-badge-bg);
  color: var(--neutral-badge-text);
  border-color: var(--border-color);
}

.badge-negative {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-color: rgba(239, 68, 68, 0.2);
}

.badge-mixed {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: rgba(139, 92, 246, 0.2);
}

.badge-direction-outbound {
  background: var(--primary-bg);
  color: var(--primary-text);
  border-color: rgba(79, 70, 229, 0.2);
}

/* Audio Player Studio Layout */
.call-studio-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  height: calc(100vh - var(--header-height) - 7rem);
}

@media (max-width: 900px) {
  .call-studio-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.call-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.call-list-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-hover);
}

.call-items-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.call-item-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 0.35rem;
  transition: all 0.2s ease;
  background: var(--bg-card);
}

.call-item-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.call-item-card.active {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.call-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.call-item-contact {
  font-weight: 600;
  font-size: 0.88rem;
}

.call-item-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Audio Stage */
.call-detail-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.player-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-hover);
}

.player-title-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.player-main-info {
  line-height: 1.3;
}

.player-contact-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.player-call-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Audio Player Bar */
.audio-player-bar {
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.waveform-canvas-container {
  width: 100%;
  height: 64px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border-color);
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.player-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-controls-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.play-pause-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.play-pause-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.play-pause-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.time-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.speed-select {
  padding: 0.35rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-main);
  outline: none;
}

.speed-select:focus {
  border-color: var(--primary);
}

/* Transcript & AI Summary Panel */
.call-stage-content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .call-stage-content {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.transcript-feed {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.transcript-bubble {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  cursor: pointer;
  transition: all 0.2s ease;
}

.transcript-bubble:hover {
  border-color: var(--border-dark);
}

.transcript-bubble.active-speaking {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.speaker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--primary);
  flex-shrink: 0;
}

.bubble-content {
  flex: 1;
}

.bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.speaker-name {
  font-weight: 700;
  font-size: 0.82rem;
}

.speaker-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.bubble-text {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.call-ai-summary-panel {
  border-left: 1px solid var(--border-color);
  background: var(--bg-hover);
  padding: 1.5rem;
  overflow-y: auto;
}

.summary-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}

.summary-section-title:first-child {
  margin-top: 0;
}

.ai-summary-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  line-height: 1.5;
}

.bullet-list {
  list-style: none;
}

.bullet-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.35rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.bullet-list li::before {
  content: '•';
  color: var(--primary);
  font-weight: bold;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-card.modal-lg {
  max-width: 800px;
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close-btn {
  color: var(--text-dim);
  font-size: 1.25rem;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Minimal Sidebar Search & Job Listing */
.sidebar-search-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: transparent;
  border: none !important;
  color: var(--text-on-dark);
  font-size: 0.82rem;
  outline: none;
  margin-bottom: 0 !important;
}

.sidebar-openings-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
  margin-top: 0;
}
.sidebar-opening-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-on-dark-dim);
}
.sidebar-opening-item:hover {
  background: #fafafa;
}
.sidebar-opening-link {
  flex: 1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  margin-right: 0.5rem;
  cursor: pointer;
}
.sidebar-opening-link:hover {
  color: #000000;
}
.sidebar-opening-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sidebar-opening-icon-btn {
  color: var(--text-muted);
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-opening-icon-btn:hover {
  color: #000000;
  background: #eeeeee;
}
/* Active/selected state is defined with higher specificity + !important
   further down (near '.sidebar-opening-item.active') so it wins over the
   button's inline background:none and the active-row color override. */

/* Compact Candidate Grid/Cards */
.candidate-grid-tight {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.75rem;
}
.candidate-card-tight {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.candidate-card-tight:hover {
  border-color: var(--border-dark);
}
.candidate-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.candidate-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.candidate-info-primary {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.candidate-name-bold {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.candidate-title-dim {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.candidate-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-top: 1px dashed var(--border-color);
  padding-top: 0.4rem;
  margin-bottom: 0.4rem;
}
.candidate-meta-item {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.candidate-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.4rem;
}
.candidate-status-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
}

/* Split Layout 60/40 */
.split-layout-60-40 {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.split-left-60 {
  flex: 3; /* 60% approx */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.split-right-40 {
  flex: 2; /* 40% approx */
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* Wide Candidate Card with least height */
.candidate-card-wide {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.candidate-card-wide:hover {
  border-color: var(--border-dark);
  background: var(--bg-subtle);
}
.candidate-card-wide.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 1px var(--primary);
}

.candidate-left-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.candidate-middle-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: 1.5rem;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

/* Recruiter Card layout (single-column wide format with least height) */
.recruiter-card-wide {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: space-between;
}

.recruiter-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.recruiter-email {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recruiter-openings {
  flex: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Call Accordion Styling */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  overflow: hidden;
  transition: all 0.2s ease;
}
.accordion-item.expanded {
  border-color: var(--primary);
  background: var(--bg-card);
}
.accordion-header {
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 0.8rem;
}
.accordion-header:hover {
  background: var(--bg-subtle);
}
.accordion-title-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}
.accordion-title-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}
.accordion-arrow {
  transition: transform 0.2s ease;
}
.accordion-item.expanded .call-arrow-icon svg {
  transform: rotate(180deg);
}

.accordion-item:hover .call-status-icon {
  display: none !important;
}
.accordion-item:hover .call-arrow-icon {
  display: inline-flex !important;
}
.accordion-body {
  padding: 0 0.85rem 0.85rem 0.85rem;
  display: none;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  margin-top: 0.25rem;
  padding-top: 0.65rem;
}
.accordion-item.expanded .accordion-body {
  display: block;
}

/* Premium Candidate Tabs */
.candidate-tab {
  background: none;
  border: none;
  padding: 0.5rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  outline: none;
}
.candidate-tab:hover {
  color: var(--text-main);
}
.candidate-tab.active {
  color: var(--primary);
}
.candidate-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Active Sidebar Job Opening */
.sidebar-opening-item.active {
  background: #f5f5f5 !important;
  border-left: 3px solid #000000 !important;
  padding-left: calc(0.5rem - 3px) !important;
  color: #000000 !important;
}
.sidebar-opening-item.active .sidebar-opening-link {
  font-weight: 700;
  color: #000000 !important;
}
/* Selected per-project icon (Candidates vs Analytics): give it a clear
   filled pill so it stands out even inside an already-active row. */
.sidebar-opening-icon-btn.active,
.sidebar-opening-item .sidebar-opening-icon-btn.active {
  color: #ffffff !important;
  background: #000000 !important;
}
.sidebar-opening-item.active .sidebar-opening-icon-btn.active {
  color: #ffffff !important;
  background: #000000 !important;
}

/* Upgraded Analytics Charts Layout */
.analytics-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}
@media (max-width: 900px) {
  .analytics-charts-grid {
    grid-template-columns: 1fr;
  }
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.chart-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}
.chart-container-wrapper {
  position: relative;
  flex-grow: 1;
  min-height: 250px;
}

/* Excel Spreadsheet Mode */
.excel-table {
  border-collapse: collapse;
  width: 100%;
  font-family: Calibri, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-card);
}
.excel-table th {
  background: #f3f4f6;
  color: #5f6368;
  border: 1px solid #d1d5db;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  text-align: center;
  user-select: none;
}
.excel-table td {
  border: 1px solid #e5e7eb;
  padding: 0;
  font-size: 0.76rem;
  vertical-align: middle;
}
.excel-row-num {
  background: #f3f4f6;
  color: #5f6368;
  font-weight: bold;
  text-align: center;
  font-size: 0.72rem;
  border: 1px solid #d1d5db;
  width: 25px;
  user-select: none;
}
.excel-cell-input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  box-sizing: border-box;
}
.excel-cell-input:focus {
  outline: 2px solid #107c41; /* Excel Green */
  background: #fff;
  color: #000;
  z-index: 10;
}
