:root {
  --bg-main: #0B0F17;
  --bg-card: #111827;
  --bg-card-hover: #162032;
  --bg-input: #1A2234;
  --border-color: #242E42;
  --border-color-light: #334155;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --emerald: #10B981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --blue: #3B82F6;
  --blue-bg: rgba(59, 130, 246, 0.12);
  --cyan: #06B6D4;
  --cyan-bg: rgba(6, 182, 212, 0.12);
  --amber: #F59E0B;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --purple: #8B5CF6;
  --purple-bg: rgba(139, 92, 246, 0.12);
  --rose: #F43F5E;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body.dark-theme {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Announcement / Live Scan Bar */
.scan-status-bar {
  background: linear-gradient(90deg, #1E1B4B 0%, #064E3B 100%);
  border-bottom: 1px solid #059669;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #D1FAE5;
  transition: all 0.3s ease;
}

.scan-status-bar.hidden {
  display: none;
}

.scan-status-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(209, 250, 229, 0.3);
  border-top-color: #34D399;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.scan-found-pill {
  background-color: #059669;
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* App Header */
.app-header {
  background-color: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 16px 24px;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #10B981 0%, #06B6D4 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.accent-text {
  color: var(--emerald);
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--emerald);
  color: #042F2E;
}

.btn-primary:hover {
  background-color: #059669;
  color: #FFFFFF;
}

.btn-glow {
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.btn-glow:hover {
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.55);
}

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

.btn-secondary:hover {
  background-color: var(--border-color);
  border-color: var(--border-color-light);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

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

/* Stats Section */
.stats-section {
  padding: 20px 24px 8px;
}

.stats-container {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon-wrapper {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-icon-wrapper.blue { background-color: var(--blue-bg); color: var(--blue); }
.stat-icon-wrapper.green { background-color: var(--emerald-bg); color: var(--emerald); }
.stat-icon-wrapper.amber { background-color: var(--amber-bg); color: var(--amber); }
.stat-icon-wrapper.emerald { background-color: rgba(16, 185, 129, 0.18); color: #34D399; }
.stat-icon-wrapper.purple { background-color: var(--purple-bg); color: var(--purple); }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px 40px;
  width: 100%;
  flex: 1;
}

/* Filter Panel */
.filter-panel {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.primary-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search-input-wrapper {
  flex: 1;
  min-width: 320px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.search-input-wrapper input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 38px 10px 40px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
  border-color: var(--emerald);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.clear-btn.hidden {
  display: none;
}

.filter-dropdowns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.select-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 0.8rem;
  pointer-events: none;
}

.select-wrapper select,
.select-wrapper input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px 10px 34px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.select-wrapper select:focus,
.select-wrapper input:focus {
  border-color: var(--emerald);
}

/* Skill Chips Row */
.skill-chips-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.chips-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.chips-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.skill-chip {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.skill-chip:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.skill-chip.active {
  background-color: var(--emerald-bg);
  border-color: var(--emerald);
  color: #34D399;
}

/* Secondary Toggles Row */
.view-toggles-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.toggles-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.toggle-btn:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.toggle-btn.active {
  background-color: rgba(59, 130, 246, 0.15);
  border-color: var(--blue);
  color: #60A5FA;
}

.toggles-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.results-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Jobs Table */
.table-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.jobs-table th {
  background-color: #0E1523;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.jobs-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.job-row {
  transition: background-color 0.15s ease, opacity 0.2s ease;
}

.job-row:hover {
  background-color: var(--bg-card-hover);
}

.job-row.row-viewed-faded {
  opacity: 0.42;
}

.job-row.row-viewed-faded:hover {
  opacity: 0.85;
}

/* Row Columns */
.col-status { width: 65px; text-align: center; }
.col-title { min-width: 280px; max-width: 380px; }
.col-skills { min-width: 220px; max-width: 320px; }
.col-location { min-width: 130px; }
.col-type { min-width: 100px; }
.col-rate { min-width: 130px; }
.col-posted { min-width: 90px; }
.col-actions { min-width: 190px; }

.badge-new {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.job-title-link {
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  display: block;
  line-height: 1.3;
}

.job-title-link:hover {
  color: var(--emerald);
}

.job-company {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--cyan);
  margin-top: 3px;
}

/* Skills list */
.skills-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag-pill {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.tag-pill:hover {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* Work Type Badges */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.circle-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: white;
}

.circle-indicator.remote { background-color: var(--emerald); }
.circle-indicator.hybrid { background-color: var(--blue); }
.circle-indicator.onsite { background-color: var(--amber); }

/* Day Rate Column */
.rate-val {
  font-weight: 700;
  color: #34D399;
  font-size: 0.92rem;
  white-space: nowrap;
}

.rate-not-stated {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-style: italic;
}

/* Date */
.posted-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Action buttons in row */
.action-buttons-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

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

.btn-icon.shortlisted {
  color: var(--amber);
  border-color: var(--amber);
  background-color: var(--amber-bg);
}

.btn-icon.viewed {
  color: var(--blue);
}

.btn-row-info {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-row-info:hover {
  background-color: var(--border-color);
}

.btn-row-apply {
  background-color: var(--emerald);
  color: #042F2E;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-row-apply:hover {
  background-color: #059669;
  color: white;
}

/* Modal Drawer / Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalEnter 0.2s ease-out;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

.badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-outside {
  background-color: var(--emerald-bg);
  color: #34D399;
  border: 1px solid var(--emerald);
}

.badge-type {
  background-color: var(--blue-bg);
  color: #60A5FA;
  border: 1px solid var(--blue);
}

.badge-rate {
  background-color: var(--amber-bg);
  color: #FBBF24;
  border: 1px solid var(--amber);
}

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

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

.modal-skills-box {
  padding: 14px 24px;
  background-color: var(--bg-input);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.modal-skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.section-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.modal-description-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #CBD5E1;
  white-space: pre-wrap;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: #0E1523;
}

/* Empty State / Loading */
.empty-state {
  text-align: center;
  padding: 60px 20px !important;
  color: var(--text-muted);
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-color);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* Footer */
.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.app-footer p + p {
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .search-input-wrapper {
    min-width: 100%;
  }
  .view-toggles-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .toggles-right {
    width: 100%;
    justify-content: space-between;
  }
}
