:root {
  --scrapde-primary: #2563eb;
  --scrapde-accent: #38bdf8;
  --scrapde-bg: #0f0f10;
  --scrapde-bg-soft: #17181b;
  --scrapde-surface: #1d1f23;
  --scrapde-border: #2d3038;
  --scrapde-text: #f3f4f6;
  --scrapde-text-muted: #a5aab4;
}

body {
  background-color: var(--scrapde-bg);
  color: var(--scrapde-text);
  font-family: system-ui, -apple-system, sans-serif;
}

a {
  color: #60a5fa;
}

a:hover {
  color: #93c5fd;
}

.app-topbar {
  background: linear-gradient(90deg, #0b0b0c 0%, #0b1834 55%, #0e2a6d 100%);
  border-bottom: 1px solid var(--scrapde-border);
}

.sidebar {
  background: linear-gradient(180deg, #121316 0%, #16181d 100%);
  border-right: 1px solid var(--scrapde-border);
}

.sidebar .nav-link {
  color: #d6dae2;
  border-radius: 0.55rem;
  margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: linear-gradient(135deg, #0f2f6d 0%, #1d4ed8 100%);
  color: #fff;
}

main.col-md-10 {
  background: var(--scrapde-bg-soft);
}

.card {
  background: var(--scrapde-surface);
  border: 1px solid var(--scrapde-border);
  color: var(--scrapde-text);
}

.card-header {
  background: #20232a;
  color: #f8fafc;
  border-bottom: 1px solid var(--scrapde-border);
}

.text-muted,
.form-text,
small {
  color: var(--scrapde-text-muted) !important;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--scrapde-text);
  --bs-table-border-color: var(--scrapde-border);
  --bs-table-striped-bg: #22252c;
  --bs-table-hover-bg: #262a32;
}

.table thead th {
  color: #c7ccd6;
  background: #191b20;
}

.form-control,
.form-select {
  background-color: #121419;
  color: var(--scrapde-text);
  border-color: var(--scrapde-border);
}

.form-control::placeholder {
  color: #7e8591;
}

.form-control:focus,
.form-select:focus {
  background-color: #14171d;
  color: var(--scrapde-text);
  border-color: #2563eb;
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.22);
}

.btn-primary {
  --bs-btn-bg: #2563eb;
  --bs-btn-border-color: #2563eb;
  --bs-btn-hover-bg: #1e40af;
  --bs-btn-hover-border-color: #1e40af;
}

.btn-outline-secondary {
  --bs-btn-color: #cdd3df;
  --bs-btn-border-color: #4b5160;
  --bs-btn-hover-bg: #2a2e37;
  --bs-btn-hover-border-color: #596173;
  --bs-btn-hover-color: #fff;
}

.btn-outline-light {
  --bs-btn-color: #f8f9fa;
  --bs-btn-border-color: #b3bac8;
  --bs-btn-hover-bg: #e9ecef;
  --bs-btn-hover-color: #111;
}

.alert {
  border: 1px solid var(--scrapde-border);
}

.alert-success {
  background: #123423;
  color: #c9f3d8;
  border-color: #1f5538;
}

.alert-danger {
  background: #3a141a;
  color: #ffd2d8;
  border-color: #6f1d2c;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar {
  min-height: calc(100vh - 56px);
  background: linear-gradient(180deg, #121316 0%, #16181d 100%);
  border-right: 1px solid var(--scrapde-border);
}

.sidebar .nav-link {
  color: #d6dae2;
  border-radius: 0.55rem;
  margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: linear-gradient(135deg, #0f2f6d 0%, #1d4ed8 100%);
  color: #fff;
}

.stat-card {
  border-left: 4px solid var(--scrapde-accent);
  transition: transform 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.table-companies th {
  white-space: nowrap;
  font-size: 0.85rem;
}

.table-companies td {
  vertical-align: top;
}

.companies-table-wrap {
  max-width: 100%;
}

.table-companies .col-name {
  min-width: 220px;
  max-width: 360px;
}

.table-companies .col-name a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.table-companies .col-email {
  max-width: 220px;
  word-break: break-word;
}

.table-companies .col-actions {
  white-space: nowrap;
}

.companies-pagination-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.companies-pagination .page-link {
  background: #171a20;
  border-color: #2f343f;
  color: #d7dbe4;
}

.companies-pagination .page-link:hover {
  background: #232833;
  color: #fff;
}

.companies-pagination .page-item.active .page-link {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.companies-pagination .page-item.disabled .page-link {
  background: #121419;
  color: #727987;
}

.badge-status {
  font-size: 0.75rem;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #102a5c 0%, #0f131f 55%, #0b0b0c 100%);
}

.login-card {
  max-width: 420px;
  width: 100%;
}

.chart-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--scrapde-accent);
}

/* ── Scraper page ── */
.scraper-page {
  --scraper-radius: 14px;
  --scraper-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.scraper-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
}

.scraper-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.scraper-subtitle {
  color: var(--scrapde-text-muted);
  font-size: 0.95rem;
}

.scraper-hero-stats {
  display: flex;
  gap: 0.75rem;
}

.scraper-stat {
  background: #1a1c21;
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  box-shadow: var(--scraper-shadow);
  text-align: center;
  min-width: 72px;
}

.scraper-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}

.scraper-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9da3ae;
}

.scraper-stat-running .scraper-stat-value {
  color: #60a5fa;
}

.scraper-stat-done .scraper-stat-value {
  color: #f3f4f6;
}

.scraper-card {
  border-radius: var(--scraper-radius) !important;
  overflow: hidden;
  box-shadow: var(--scraper-shadow) !important;
}

.scraper-card-header {
  background: linear-gradient(135deg, #0f1f3f 0%, #12346d 65%, #1d4ed8 100%);
  color: #fff;
  border: none;
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.scraper-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.scraper-input {
  border-radius: 10px;
  border-color: var(--scrapde-border);
}

.scraper-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.scraper-regions-box {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--scrapde-border);
  border-radius: 10px;
  padding: 0.75rem;
  background: #14161b;
}

.scraper-region-check {
  margin-bottom: 0.35rem;
}

.scraper-region-check .form-check-label {
  font-size: 0.875rem;
}

.btn-scraper {
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-scraper:hover {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.scraper-sources-hint {
  font-size: 0.75rem;
  color: var(--scrapde-text-muted);
  line-height: 1.6;
  padding-top: 0.75rem;
  border-top: 1px solid var(--scrapde-border);
}

.scraper-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: #14161b;
  padding: 0.35rem;
  border-radius: 12px;
}

.scraper-jobs-header {
  background: #1a1c21 !important;
}

.scraper-filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cfd3db;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.scraper-filter-tab:hover {
  background: #22262f;
  color: #fff;
}

.scraper-filter-tab.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
}

.scraper-filter-tab .badge {
  background: #2a2e37;
  color: #e6e8ee;
  font-weight: 600;
  font-size: 0.7rem;
}

.scraper-filter-tab.active .badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.scraper-jobs-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #acb2bd;
  font-weight: 600;
  border-bottom-width: 1px;
  padding: 0.75rem 1rem;
  background: #17191f;
}

.scraper-jobs-table tbody td {
  padding: 0.9rem 1rem;
  border-color: #2c3038;
}

.scraper-job-row:hover {
  background: #232731;
}

.scraper-job-id {
  font-weight: 700;
  color: #dbeafe;
  font-size: 0.9rem;
}

.scraper-job-meta {
  font-size: 0.72rem;
  color: #8a92a0;
  margin-top: 0.1rem;
}

.scraper-job-industry {
  font-weight: 500;
  font-size: 0.875rem;
  color: #f3f4f6;
}

.scraper-job-region {
  font-size: 0.8rem;
  color: #9da3ae;
  margin-top: 0.15rem;
}

.scraper-progress-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #d7dbe4;
  margin-bottom: 0.25rem;
}

.scraper-progress {
  height: 6px;
  border-radius: 3px;
  background: #2a2e37;
}

.scraper-progress .progress-bar {
  background: linear-gradient(90deg, #1d4ed8, #38bdf8);
  border-radius: 3px;
}

.scraper-found {
  margin-top: 0.2rem;
}

.scraper-status-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.scraper-status-badge.status-running {
  background: #132d63;
  color: #93c5fd;
}

.scraper-status-badge.status-completed {
  background: #2a2e37;
  color: #fff;
}

.scraper-status-badge.status-failed {
  background: #4b1d23;
  color: #fda4af;
}

.scraper-status-badge.status-cancelled {
  background: #2e3440;
  color: #cbd5e1;
}

.scraper-status-badge.status-default {
  background: #2a2e37;
  color: #dce1ea;
}

.scraper-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.scraper-empty-icon {
  font-size: 2.5rem;
  color: #5f6673;
  margin-bottom: 0.75rem;
}

.scraper-stop-btn {
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border: 1px solid #1d4ed8;
  color: #93c5fd;
  background: #141c2d;
  white-space: nowrap;
}

.scraper-stop-btn:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.scraper-stop-btn:disabled {
  opacity: 0.55;
}

@media (max-width: 767px) {
  .table-companies .col-hiring,
  .table-companies .col-country,
  .table-companies .col-region,
  .table-companies .col-priority {
    display: none;
  }

  .table-companies .col-name {
    min-width: 170px;
    max-width: 220px;
  }

  .scraper-hero-stats {
    width: 100%;
    justify-content: stretch;
  }

  .scraper-stat {
    flex: 1;
  }

  .scraper-filter-tabs {
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .table-companies .col-hiring {
    display: none;
  }
}

@media (max-width: 992px) {
  .table-companies .col-country,
  .table-companies .col-region,
  .table-companies .col-priority {
    display: none;
  }
}

@media (max-width: 820px) {
  .table-companies .col-email {
    display: none;
  }
}

/* ── Mailing module ── */
.mailing-nav .nav-link {
  color: #cfd3db;
  background: #1a1c21;
  border: 1px solid var(--scrapde-border);
  font-size: 0.875rem;
  padding: 0.4rem 0.85rem;
}

.mailing-nav .nav-link:hover {
  background: #22262f;
  color: #fff;
}

.mailing-nav .nav-link.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #2563eb;
  color: #fff;
}

.mailing-sidebar-sub .nav-link,
.sidebar-sub .nav-link {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  color: #a5aab4;
}

.mailing-sidebar-sub .nav-link.active,
.sidebar-sub .nav-link.active {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

.sidebar-sub {
  margin-bottom: 0.35rem;
}

.sidebar-parent {
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.sidebar-parent:hover,
.sidebar-parent:focus {
  color: #fff;
}

.sidebar-chevron {
  display: inline-block;
  font-size: 0.7rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.sidebar-parent[aria-expanded="true"] .sidebar-chevron {
  transform: rotate(90deg);
}

.sidebar-group {
  margin-bottom: 0.15rem;
}

.send-console {
  background: #0a0c0f;
  border: 1px solid #1e293b;
  border-radius: 8px;
  color: #c9d1d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  max-height: 320px;
  overflow-y: auto;
  padding: 1rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.send-console .console-success {
  color: #3fb950;
}

.send-console .console-error {
  color: #f85149;
}

.send-console .console-pause {
  color: #d29922;
}

.send-console .console-info {
  color: #8b949e;
}
