/* Infinite Visions AI — Hiring Manager Dashboard
   Dark mode theme matching Training Portal */

:root {
  --sidebar-bg: #171717;
  --sidebar-hover: #1E1E1E;
  --sidebar-active: #2A2A2A;
  --main-bg: #212121;
  --surface: #2A2A2A;
  --surface-hover: #333333;
  --text-primary: #ECECEC;
  --text-secondary: #8E8E8E;
  --text-muted: #666666;
  --accent: #6C63FF;
  --accent-dim: rgba(108, 99, 255, 0.15);
  --accent-hover: #7B73FF;
  --border: #333333;
  --border-subtle: #2A2A2A;
  --code-bg: #1A1A1A;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #F44336;
  --transition-speed: 200ms;

  --sidebar-width: 240px;
  --header-height: 56px;

  /* Pipeline stage colors */
  --stage-applied: #6B7280;
  --stage-phone-screen: #3B82F6;
  --stage-interview: #8B5CF6;
  --stage-trial: #F59E0B;
  --stage-offer: #10B981;
  --stage-onboarding: #06B6D4;
  --stage-active: #22C55E;
  --stage-rejected: #EF4444;
  --stage-withdrawn: #9CA3AF;
}

/* ==================== RESET ==================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--main-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ==================== SCROLLBAR ==================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ==================== LOGIN ==================== */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 24px;
  color: #fff;
  margin-bottom: 20px;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.login-form {
  text-align: left;
}

.login-error {
  background: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.login-footer {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==================== HEADER ==================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.header-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.header-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-company {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.header-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 8px 16px 8px 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-speed), background var(--transition-speed);
}

.header-search input:focus {
  border-color: var(--accent);
  background: var(--sidebar-bg);
}

.header-search input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 360px;
  overflow-y: auto;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1001;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-speed);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--surface);
}

.search-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.search-result-email {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-user {
  font-size: 13px;
  color: var(--text-secondary);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition-speed);
}

.hamburger:hover {
  background: var(--surface);
}

/* ==================== LAYOUT ==================== */

.app-container {
  display: flex;
  height: 100vh;
  padding-top: var(--header-height);
}

/* ==================== SIDEBAR ==================== */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 499;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-speed);
  border-left: 3px solid transparent;
  text-decoration: none;
  user-select: none;
  position: relative;
}

.sidebar .nav-item:hover {
  color: var(--text-primary);
  background: var(--sidebar-hover);
}

.sidebar .nav-item.active {
  color: var(--text-primary);
  background: var(--sidebar-active);
  border-left-color: var(--accent);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-footer-phone {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==================== MAIN CONTENT ==================== */

.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

#view-container {
  max-width: 1400px;
  margin: 0 auto;
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-speed);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(244, 67, 54, 0.15);
  color: var(--danger);
  border-color: rgba(244, 67, 54, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 67, 54, 0.25);
}

.btn-success {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
  border-color: rgba(76, 175, 80, 0.3);
}

.btn-success:hover:not(:disabled) {
  background: rgba(76, 175, 80, 0.25);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 2px 8px;
  font-size: 11px;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 6px;
  min-width: 32px;
  min-height: 32px;
}

/* ==================== FORMS ==================== */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-speed);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238E8E8E' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--surface);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== STAGE BADGES ==================== */

.stage-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.stage-badge.applied {
  background: rgba(107, 114, 128, 0.2);
  color: var(--stage-applied);
}

.stage-badge.phone_screen {
  background: rgba(59, 130, 246, 0.2);
  color: var(--stage-phone-screen);
}

.stage-badge.interview {
  background: rgba(139, 92, 246, 0.2);
  color: var(--stage-interview);
}

.stage-badge.trial {
  background: rgba(245, 158, 11, 0.2);
  color: var(--stage-trial);
}

.stage-badge.offer {
  background: rgba(16, 185, 129, 0.2);
  color: var(--stage-offer);
}

.stage-badge.onboarding {
  background: rgba(6, 182, 212, 0.2);
  color: var(--stage-onboarding);
}

.stage-badge.active {
  background: rgba(34, 197, 94, 0.2);
  color: var(--stage-active);
}

.stage-badge.rejected {
  background: rgba(239, 68, 68, 0.2);
  color: var(--stage-rejected);
}

.stage-badge.withdrawn {
  background: rgba(156, 163, 175, 0.2);
  color: var(--stage-withdrawn);
}

/* ==================== AI SCORE BADGE ==================== */

.ai-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.ai-score.high {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.ai-score.medium {
  background: rgba(255, 152, 0, 0.15);
  color: var(--warning);
}

.ai-score.low {
  background: rgba(244, 67, 54, 0.15);
  color: var(--danger);
}

/* ==================== PIPELINE BOARD ==================== */

.pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.pipeline-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.pipeline-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pipeline-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 180px);
}

.pipeline-column {
  min-width: 260px;
  max-width: 300px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px 10px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}

.pipeline-column-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.pipeline-column-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--text-muted);
}

.pipeline-column-body {
  flex: 1;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pipeline-column-body.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.pipeline-empty-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

/* Stage color indicators on column headers */
.pipeline-column[data-stage="applied"] .pipeline-column-header {
  border-top: 3px solid var(--stage-applied);
}
.pipeline-column[data-stage="phone_screen"] .pipeline-column-header {
  border-top: 3px solid var(--stage-phone-screen);
}
.pipeline-column[data-stage="interview"] .pipeline-column-header {
  border-top: 3px solid var(--stage-interview);
}
.pipeline-column[data-stage="trial"] .pipeline-column-header {
  border-top: 3px solid var(--stage-trial);
}
.pipeline-column[data-stage="offer"] .pipeline-column-header {
  border-top: 3px solid var(--stage-offer);
}
.pipeline-column[data-stage="onboarding"] .pipeline-column-header {
  border-top: 3px solid var(--stage-onboarding);
}
.pipeline-column[data-stage="active"] .pipeline-column-header {
  border-top: 3px solid var(--stage-active);
}

/* ==================== CANDIDATE CARD ==================== */

.candidate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.candidate-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.candidate-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.candidate-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.candidate-card-email {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  word-break: break-all;
}

.candidate-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 8px;
}

.candidate-card-source {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.candidate-card-days {
  font-size: 10px;
  color: var(--text-muted);
}

.candidate-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.candidate-card:hover .candidate-card-actions {
  opacity: 1;
}

/* ==================== CANDIDATE DETAIL ==================== */

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-header-info h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-header-info p {
  color: var(--text-secondary);
  font-size: 14px;
}

.detail-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.detail-stage-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.detail-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-speed);
  white-space: nowrap;
}

.detail-tab:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.detail-tab-content {
  display: none;
}

.detail-tab-content.active {
  display: block;
}

.detail-section {
  margin-bottom: 32px;
}

.detail-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-field-value {
  font-size: 14px;
  color: var(--text-primary);
}

/* ==================== SCREENING ==================== */

.rubric-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.rubric-table th,
.rubric-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.rubric-table th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.rubric-table td {
  color: var(--text-primary);
}

.rubric-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.rubric-score.score-high {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.rubric-score.score-mid {
  background: rgba(255, 152, 0, 0.15);
  color: var(--warning);
}

.rubric-score.score-low {
  background: rgba(244, 67, 54, 0.15);
  color: var(--danger);
}

/* ==================== TIMELINE ==================== */

.timeline {
  padding-left: 20px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--main-bg);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timeline-text {
  font-size: 13px;
  color: var(--text-primary);
}

.timeline-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==================== COMMUNICATION THREAD ==================== */

.comm-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 180px);
}

.comm-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.comm-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.comm-message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.comm-message.outbound {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.comm-message.inbound {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.comm-message.ai-generated {
  align-self: flex-end;
  background: var(--accent-dim);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  border-bottom-right-radius: 4px;
}

.comm-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.comm-message.outbound .comm-message-meta,
.comm-message.ai-generated .comm-message-meta {
  justify-content: flex-end;
}

.comm-ai-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.comm-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.comm-compose textarea {
  flex: 1;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color var(--transition-speed);
}

.comm-compose textarea:focus {
  border-color: var(--accent);
}

.comm-compose textarea::placeholder {
  color: var(--text-muted);
}

.comm-compose-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comm-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-muted);
  font-size: 14px;
}

/* ==================== AI RECOMMENDATIONS ==================== */

.decisions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.decisions-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.decision-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.decision-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color var(--transition-speed);
}

.decision-card:hover {
  border-color: var(--accent);
}

.decision-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.decision-card-candidate {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.decision-card-action {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.decision-card-action.advance {
  background: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.decision-card-action.reject {
  background: rgba(244, 67, 54, 0.15);
  color: var(--danger);
}

.decision-card-action.message {
  background: var(--accent-dim);
  color: var(--accent);
}

.decision-card-reasoning {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--code-bg);
  border-radius: 8px;
}

.decision-card-confidence {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.confidence-bar {
  flex: 1;
  max-width: 200px;
  height: 6px;
  background: var(--code-bg);
  border-radius: 3px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.confidence-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.decision-card-actions {
  display: flex;
  gap: 8px;
}

/* ==================== STATS PANEL ==================== */

.stats-header {
  margin-bottom: 24px;
}

.stats-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.stat-card-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card-change {
  font-size: 12px;
  margin-top: 6px;
}

.stat-card-change.positive {
  color: var(--success);
}

.stat-card-change.negative {
  color: var(--danger);
}

/* Funnel */
.funnel-container {
  margin-bottom: 32px;
}

.funnel-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.funnel-label {
  width: 120px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
  flex-shrink: 0;
}

.funnel-bar-container {
  flex: 1;
  height: 28px;
  background: var(--code-bg);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.funnel-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
  min-width: fit-content;
}

.funnel-bar-value {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  white-space: nowrap;
}

.funnel-rate {
  font-size: 11px;
  color: var(--text-muted);
  width: 50px;
  text-align: left;
  flex-shrink: 0;
}

/* Stage time chart */
.stage-time-chart {
  margin-bottom: 32px;
}

.stage-time-chart h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.stage-time-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.stage-time-label {
  width: 120px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: right;
  flex-shrink: 0;
}

.stage-time-bar {
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  transition: width 0.5s ease;
}

.stage-time-value {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* AI accuracy stats */
.ai-stats-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.ai-stats-container h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.ai-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-stats-row:last-child {
  border-bottom: none;
}

.ai-stats-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.ai-stats-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==================== SETTINGS ==================== */

.settings-container {
  max-width: 700px;
}

.settings-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.slider-group {
  margin-bottom: 20px;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.slider-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.slider-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.slider-input {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--code-bg);
  border-radius: 3px;
  outline: none;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--main-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--main-bg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-description {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ==================== ACTIVITY FEED ==================== */

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.activity-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background var(--transition-speed);
}

.activity-item:hover {
  background: var(--surface-hover);
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--accent-dim);
  color: var(--accent);
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.activity-text strong {
  color: #fff;
  font-weight: 600;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== CANDIDATE LIST VIEW ==================== */

.candidates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.candidates-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.candidates-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.candidates-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.candidates-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
}

.candidates-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.candidates-table tbody tr {
  cursor: pointer;
  transition: background var(--transition-speed);
}

.candidates-table tbody tr:hover {
  background: var(--surface-hover);
}

.candidates-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==================== MODAL ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 24px;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition-speed);
}

.modal-close:hover {
  background: var(--code-bg);
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ==================== TOAST ==================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: toast-in 0.3s ease;
  max-width: 360px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

.toast.info {
  background: var(--accent);
}

.toast.fade-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(16px);
  }
}

/* ==================== LOADING SPINNER ==================== */

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  flex-direction: column;
  gap: 16px;
}

.loading-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ==================== EMPTY STATE ==================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.6;
}

/* ==================== ERROR STATE ==================== */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.error-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--danger);
}

.error-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 8px;
}

.error-state-text {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ==================== BACK LINK ==================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: 16px;
  transition: color var(--transition-speed);
}

.back-link:hover {
  color: var(--accent);
}

/* ==================== PAGINATION ==================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}

.pagination-btn {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
  .pipeline-board {
    min-height: auto;
  }

  .pipeline-column {
    min-width: 220px;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 500;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .header-brand {
    min-width: auto;
  }

  .header-titles {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .pipeline-board {
    flex-direction: column;
  }

  .pipeline-column {
    min-width: 100%;
    max-width: 100%;
  }

  .pipeline-column-body {
    max-height: 300px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .comm-message {
    max-width: 85%;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 12px;
  }

  .candidates-table {
    font-size: 12px;
  }

  .candidates-table th,
  .candidates-table td {
    padding: 8px 10px;
  }

  .funnel-label,
  .stage-time-label {
    width: 80px;
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .header-search {
    display: none;
  }

  .header-actions {
    gap: 8px;
  }

  .header-user {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .pipeline-controls {
    flex-wrap: wrap;
  }
}

/* ==================== PRINT ==================== */

@media print {
  .sidebar, .header, .hamburger, .sidebar-overlay, .toast-container, .modal-overlay {
    display: none !important;
  }
  .main-content {
    padding: 0;
  }
  .app-container {
    padding-top: 0;
  }
  body {
    background: #fff;
    color: #000;
    overflow: visible;
  }
}

/* ==================== NOTIFICATION PANEL ==================== */

.notification-bell {
  position: relative;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}

.notification-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notification-panel {
  position: fixed;
  top: var(--header-height);
  right: 12px;
  width: 360px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notification-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.notification-panel-body {
  overflow-y: auto;
  max-height: 420px;
  padding: 8px 0;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-speed);
}
.notification-item:hover {
  background: var(--surface-hover);
}
.notification-item:last-child {
  border-bottom: none;
}

.notification-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.notification-icon.new-app { background: var(--accent-dim); color: var(--accent); }
.notification-icon.ai-rec { background: rgba(255, 152, 0, 0.15); color: var(--warning); }
.notification-icon.stale { background: rgba(244, 67, 54, 0.15); color: var(--danger); }
.notification-icon.pending-msg { background: rgba(76, 175, 80, 0.15); color: var(--success); }

.notification-text {
  flex: 1;
  min-width: 0;
}
.notification-text .title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.notification-text .detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.notification-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .notification-panel {
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 0 0 10px 10px;
  }
}

/* ==================== HITL & NOTIFICATION HUB ==================== */

.notification-panel-section {
  border-top: 1px solid var(--border);
  padding: 8px 0 0 0;
}

.notification-panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hitl-count-badge {
  background: var(--warning);
  color: #000;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.hitl-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background var(--transition-speed);
}

.hitl-item:hover {
  background: var(--surface-hover);
}

.hitl-item.hitl-urgent {
  border-left: 3px solid var(--danger);
}

.hitl-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.hitl-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.hitl-urgency-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.hitl-urgency-badge.critical { background: var(--danger); color: #fff; }
.hitl-urgency-badge.urgent { background: var(--warning); color: #000; }
.hitl-urgency-badge.high { background: #F59E0B; color: #000; }
.hitl-urgency-badge.normal { background: var(--accent-dim); color: var(--accent); }
.hitl-urgency-badge.low { background: var(--surface); color: var(--text-muted); }

.hitl-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.hitl-status-badge.pending { background: var(--warning); color: #000; }
.hitl-status-badge.resolved { background: var(--success); color: #fff; }
.hitl-status-badge.expired { background: var(--text-muted); color: #fff; }
.hitl-status-badge.escalated { background: var(--danger); color: #fff; }

.hitl-item-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.hitl-view-btn {
  font-size: 0.72rem;
  padding: 2px 10px;
}

/* HITL Detail Modal */

.hitl-detail-body {
  padding: 16px;
}

.hitl-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hitl-detail-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hitl-section {
  margin: 16px 0;
}

.hitl-section h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hitl-section p {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.hitl-options ol {
  padding-left: 20px;
  margin-top: 6px;
}

.hitl-options li {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.hitl-resolved {
  background: rgba(76, 175, 80, 0.08);
  border-radius: 8px;
  padding: 12px;
}

.hitl-resolve-form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.hitl-resolve-form h4 {
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}
