/* =============================================
   JobPilot - Premium Dark Theme Design System
   ============================================= */

:root {
  /* Color Palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1a2035;
  --bg-card: #151c2e;
  --bg-card-hover: #1c2540;
  --bg-input: #0f1525;

  /* Accent Colors */
  --accent-primary: #6366f1;
  --accent-primary-light: #818cf8;
  --accent-primary-dark: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --accent-gradient-hover: linear-gradient(135deg, #818cf8 0%, #a78bfa 50%, #c4b5fd 100%);
  
  /* Secondary Accents */
  --cyan: #22d3ee;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #fb7185;
  --sky: #38bdf8;
  
  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(99, 102, 241, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-glow-intense: 0 0 40px rgba(99, 102, 241, 0.25);

  /* Sizing */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --top-bar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-xs: 6px;
  --border-radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

::selection {
  background: var(--accent-primary);
  color: white;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* =============================================
   App Layout
   ============================================= */
#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =============================================
   Sidebar
   ============================================= */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.logo-icon .material-icons-round {
  color: white;
  font-size: 22px;
}

.logo-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.logo-tagline {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.nav-menu {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--accent-primary-light);
  background: rgba(99, 102, 241, 0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: 0 3px 3px 0;
}

.nav-item .material-icons-round {
  font-size: 20px;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-gradient);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--border-radius-full);
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.scanner-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.online {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.status-indicator.online::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1px solid var(--emerald);
  animation: pulse-ring 2s infinite;
}

.status-indicator.offline {
  background: var(--text-muted);
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* =============================================
   Main Content
   ============================================= */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.top-bar {
  height: var(--top-bar-height);
  min-height: var(--top-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-xs);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-scan {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-scan:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-glow-intense);
  transform: translateY(-1px);
}

.btn-scan .material-icons-round {
  font-size: 18px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-intense);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(251, 113, 133, 0.1);
  color: var(--rose);
  border: 1px solid rgba(251, 113, 133, 0.2);
}

.btn-danger:hover {
  background: rgba(251, 113, 133, 0.2);
}

.btn-success {
  background: rgba(52, 211, 153, 0.1);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.btn-success:hover {
  background: rgba(52, 211, 153, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--border-radius-xs);
}

.notification-bell {
  position: relative;
  padding: 8px;
  cursor: pointer;
  border-radius: var(--border-radius-xs);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.notification-bell:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--rose);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

/* =============================================
   Page Container
   ============================================= */
.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Cards & Containers
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 24px;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* =============================================
   Dashboard Stats
   ============================================= */
.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.page-subtitle {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition-normal);
  cursor: default;
}

.stat-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.purple {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary-light);
}

.stat-icon.cyan {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.stat-icon.emerald {
  background: rgba(52, 211, 153, 0.12);
  color: var(--emerald);
}

.stat-icon.amber {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.stat-icon.rose {
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
}

.stat-icon.sky {
  background: rgba(56, 189, 248, 0.12);
  color: var(--sky);
}

.stat-icon .material-icons-round {
  font-size: 24px;
}

.stat-info h3 {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.stat-info p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* =============================================
   Dashboard Grid
   ============================================= */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

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

/* =============================================
   Top Matches List
   ============================================= */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.match-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-light);
}

.match-score-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.match-score-badge.high {
  background: rgba(52, 211, 153, 0.12);
  color: var(--emerald);
  border: 2px solid rgba(52, 211, 153, 0.3);
}

.match-score-badge.medium {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
  border: 2px solid rgba(251, 191, 36, 0.3);
}

.match-score-badge.low {
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
  border: 2px solid rgba(251, 113, 133, 0.3);
}

.match-info {
  flex: 1;
  min-width: 0;
}

.match-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-info p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* =============================================
   Jobs Page
   ============================================= */
.jobs-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-box .material-icons-round {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

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

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* =============================================
   Job Cards List
   ============================================= */
.job-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.job-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.job-card .match-score-badge {
  width: 52px;
  height: 52px;
  font-size: 0.88rem;
}

.job-card-info {
  min-width: 0;
}

.job-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-card-company {
  font-size: 0.85rem;
  color: var(--accent-primary-light);
  margin-bottom: 6px;
}

.job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.job-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.job-card-meta .material-icons-round {
  font-size: 14px;
}

.job-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.job-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.job-status-tag.new {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary-light);
}

.job-status-tag.applied {
  background: rgba(56, 189, 248, 0.12);
  color: var(--sky);
}

.job-status-tag.interview {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

.job-status-tag.offer {
  background: rgba(52, 211, 153, 0.12);
  color: var(--emerald);
}

.job-status-tag.rejected {
  background: rgba(251, 113, 133, 0.12);
  color: var(--rose);
}

.job-status-tag.skipped {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-tertiary);
}

/* =============================================
   Source Tags
   ============================================= */
.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--border-radius-xs);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.source-tag.linkedin {
  background: rgba(0, 119, 181, 0.15);
  color: #0077b5;
}

.source-tag.remoteok {
  background: rgba(52, 211, 153, 0.12);
  color: var(--emerald);
}

.source-tag.google {
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber);
}

/* =============================================
   Form Styles
   ============================================= */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-section {
  margin-bottom: 32px;
}

.form-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title .material-icons-round {
  font-size: 20px;
  color: var(--accent-primary-light);
}

/* Skills Tags */
.skills-input-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  min-height: 44px;
  cursor: text;
  transition: all var(--transition-fast);
}

.skills-input-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary-light);
  border-radius: var(--border-radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.skill-tag .remove-skill {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.skill-tag .remove-skill:hover {
  opacity: 1;
}

.skills-input {
  border: none;
  background: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  min-width: 120px;
  flex: 1;
}

.skills-input::placeholder {
  color: var(--text-muted);
}

/* =============================================
   Search Config Cards 
   ============================================= */
.config-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 20px;
  transition: all var(--transition-normal);
}

.config-card:hover {
  border-color: var(--border-light);
}

.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.config-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-active-toggle {
  width: 36px;
  height: 20px;
  background: var(--text-muted);
  border-radius: var(--border-radius-full);
  position: relative;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.config-active-toggle.active {
  background: var(--emerald);
}

.config-active-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.config-active-toggle.active::after {
  transform: translateX(16px);
}

.config-card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
}

.config-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.config-detail .material-icons-round {
  font-size: 16px;
  color: var(--text-muted);
}

.config-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* =============================================
   Applications Page
   ============================================= */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.pipeline-column {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 16px;
}

.pipeline-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.pipeline-column-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-count {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.pipeline-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.pipeline-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pipeline-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-light);
}

.pipeline-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-card p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* =============================================
   Settings Page
   ============================================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

/* =============================================
   Resume Upload
   ============================================= */
.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.upload-zone:hover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.04);
}

.upload-zone .material-icons-round {
  font-size: 48px;
  color: var(--accent-primary-light);
  margin-bottom: 12px;
}

.upload-zone h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.upload-zone p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.upload-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: var(--border-radius-sm);
}

.upload-success .material-icons-round {
  color: var(--emerald);
  font-size: 24px;
}

/* =============================================
   Toast Notifications
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 450px;
  animation: slideInToast 0.3s ease;
  backdrop-filter: blur(12px);
}

.toast.success { border-left: 3px solid var(--emerald); }
.toast.error { border-left: 3px solid var(--rose); }
.toast.info { border-left: 3px solid var(--sky); }
.toast.warning { border-left: 3px solid var(--amber); }

.toast .material-icons-round {
  font-size: 20px;
  flex-shrink: 0;
}

.toast.success .material-icons-round { color: var(--emerald); }
.toast.error .material-icons-round { color: var(--rose); }
.toast.info .material-icons-round { color: var(--sky); }
.toast.warning .material-icons-round { color: var(--amber); }

.toast-message {
  flex: 1;
  font-size: 0.85rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0;
}

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =============================================
   Modal
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--border-radius-xs);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination-btn {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-xs);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
}

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin: 0 8px;
}

/* =============================================
   Empty States
   ============================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .material-icons-round {
  font-size: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-tertiary);
  max-width: 400px;
  margin: 0 auto 20px;
}

/* =============================================
   Loading Spinner
   ============================================= */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  flex-direction: column;
  gap: 16px;
}

.loading-center p {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* =============================================
   Cover Letter Preview
   ============================================= */
.cover-letter-preview {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 20px;
  white-space: pre-wrap;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 400px;
  overflow-y: auto;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .jobs-toolbar {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-container {
    padding: 16px;
  }

  .config-cards {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   Utility Classes
   ============================================= */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-tertiary); }
.text-sm { font-size: 0.82rem; }
.font-semibold { font-weight: 600; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* =============================================
   Auth Page
   ============================================= */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100vw;
}

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
  }
  .auth-visual { display: none; }
}

.auth-visual {
  background: linear-gradient(135deg, var(--bg-primary) 0%, hsl(240, 30%, 12%) 50%, hsl(260, 40%, 16%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.auth-visual::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  top: 10%;
  left: 20%;
  animation: float 8s ease-in-out infinite;
}

.auth-visual::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  bottom: 15%;
  right: 15%;
  animation: float 6s ease-in-out infinite reverse;
}

.auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 440px;
}

.auth-visual-content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 16px 0 8px;
}

.auth-tagline {
  font-size: 1.05rem;
  color: var(--text-tertiary);
  margin-bottom: 36px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--border-radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.auth-feature:hover {
  border-color: var(--border-accent);
  background: rgba(255,255,255,0.05);
  transform: translateX(4px);
}

.auth-feature .material-icons-round {
  font-size: 24px;
  color: var(--accent-primary-light);
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-feature h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.auth-feature p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.45;
}

.auth-form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg-secondary);
}

.auth-form-wrapper {
  width: 100%;
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 11px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--border-radius-xs);
  transition: all var(--transition-fast);
}

.auth-tab.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.auth-tab:not(.active):hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper .material-icons-round {
  position: absolute;
  left: 14px;
  font-size: 18px;
  color: var(--text-muted);
  z-index: 1;
}

.auth-input-wrapper .form-input {
  padding-left: 42px;
}

.auth-submit {
  margin-top: 8px;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-logo {
  display: inline-block;
}

/* =============================================
   User Info (Sidebar Footer)
   ============================================= */
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-avatar .material-icons-round {
  font-size: 18px;
  color: white;
}

.user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-icon-logout {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--border-radius-xs);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon-logout:hover {
  color: var(--rose);
  background: rgba(251,113,133,0.1);
}

.btn-icon-logout .material-icons-round {
  font-size: 18px;
}

/* =============================================
   Loading Center
   ============================================= */
.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.spinner.lg {
  width: 40px;
  height: 40px;
}

/* Border accent utility */
.card[style*="border-color:var(--border-accent)"] {
  border-color: rgba(99,102,241,0.3);
}

