*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --purple: #5b4ef8;
  --purple-dark: #4338e0;
  --purple-bg: #eeeefe;
  --gray-light: #f3f4f8;
  --gray-text: #4b5563;
  --border: #e5e7eb;
  --dark: #0f1117;
  --dark-2: #1a1d2e;
  --white: #ffffff;
  --radius: 14px;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--gray-light);
  color: var(--dark);
}

a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

button {
  font-family: inherit;
  cursor: pointer;
}


/* ── PAGE ─────────────────────────────────── */
.page {
  padding-top: 64px;
  min-height: 100vh;
}

#browse-page {
  display: block;
}

#detail-page {
  display: none;
}

/* ── PAGE HEADER ──────────────────────────── */
.browse-header {
  background: white;
  padding: 36px 40px 32px;
  border-bottom: 1px solid var(--border);
}

.browse-header-inner {
  max-width: 1280px;
  margin: auto;
}

.browse-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.browse-header p {
  color: var(--gray-text);
  font-size: .95rem;
}

/* ── MAIN BODY: SIDEBAR + CONTENT ────────── */
.browse-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px 60px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
  align-items: start;
}

/* ══════════════════════════════════════════
       FILTER SIDEBAR
    ══════════════════════════════════════════ */
.filter-sidebar {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: sticky;
  top: 80px;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
}

.sidebar-heading svg {
  width: 16px;
  height: 16px;
  color: var(--dark);
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: .875rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

/* custom radio */
.filter-option input[type="radio"] {
  display: none;
}

.radio-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color .15s;
}

.radio-dot::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
  opacity: 0;
  transition: opacity .15s;
}

.filter-option input[type="radio"]:checked+.radio-dot {
  border-color: var(--purple);
}

.filter-option input[type="radio"]:checked+.radio-dot::after {
  opacity: 1;
}

/* custom checkbox */
.filter-option input[type="checkbox"] {
  display: none;
}

.check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid #d1d5db;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}

.check-box svg {
  width: 10px;
  height: 10px;
  stroke: white;
  stroke-width: 3;
  opacity: 0;
  transition: opacity .15s;
}

.filter-option input[type="checkbox"]:checked+.check-box {
  border-color: var(--purple);
  background: var(--purple);
}

.filter-option input[type="checkbox"]:checked+.check-box svg {
  opacity: 1;
}

.filter-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.btn-clear-filters {
  width: 100%;
  padding: 9px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: none;
  color: var(--gray-text);
  font-family: inherit;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}

.btn-clear-filters:hover {
  border-color: var(--purple);
  color: var(--purple);
}

/* ══════════════════════════════════════════
       RIGHT COLUMN: SEARCH + LISTINGS
    ══════════════════════════════════════════ */
.listings-col {
  min-width: 0;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.search-box {
  flex: 1;
  position: relative;
}

.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 16px;
  height: 16px;
}

.search-box input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 16px 0 42px;
  font-family: inherit;
  font-size: .9rem;
  color: var(--dark);
  background: white;
  outline: none;
  transition: border-color .2s;
}

.search-box input:focus {
  border-color: var(--purple);
}

.search-box input::placeholder {
  color: #adb5bd;
}

.results-label {
  font-size: .9rem;
  color: #374151;
  margin-bottom: 16px;
}

.results-label strong {
  color: var(--dark);
}

/* ── LISTING CARDS ───────────────────────── */
.listings-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.listing-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 20px 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
}

.listing-card:hover {
  border-color: #c4bcfd;
  box-shadow: 0 4px 20px rgba(91, 78, 248, .08);
}

.company-logo {
  width: 52px;
  height: 52px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title-block {
  margin-bottom: 10px;
}

.card-title-block h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.card-title-block p {
  font-size: .85rem;
  color: var(--gray-text);
}

.card-action-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.save-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: white;
  color: #9ca3af;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}

.save-icon-btn:hover {
  border-color: var(--purple);
  color: var(--purple);
  transform: translateY(-1px);
}

.save-icon-btn.is-saved {
  border-color: #f9a8d4;
  background: #fdf2f8;
  color: #db2777;
}

.save-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
}

.mode-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .78rem;
  font-weight: 600;
}

.badge-hybrid {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c4b5fd;
}

.badge-remote {
  background: #d1fae5;
  color: #047857;
  border: 1px solid #6ee7b7;
}

.badge-onsite {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge-weeks {
  background: #f9fafb;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .8rem;
  color: var(--gray-text);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.meta-row span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-row svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.meta-salary {
  color: #374151;
  font-weight: 600;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.skill-tag {
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .775rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.st-blue {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.st-cyan {
  background: #cffafe;
  color: #0f766e;
  border-color: #67e8f9;
}

.st-violet {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #c4b5fd;
}

.st-green {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.st-pink {
  background: #fce7f3;
  color: #be185d;
  border-color: #f9a8d4;
}

.st-orange {
  background: #ffedd5;
  color: #c2410c;
  border-color: #fdba74;
}

.st-gray {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

.st-teal {
  background: #ccfbf1;
  color: #0f766e;
  border-color: #5eead4;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f3f4f6;
  padding-top: 12px;
  font-size: .82rem;
}

.applicants {
  color: var(--gray-text);
  display: flex;
  align-items: center;
  gap: 5px;
}

.applicants svg {
  width: 13px;
  height: 13px;
}

.view-details {
  color: var(--purple);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap .15s;
}

.listing-card:hover .view-details {
  gap: 8px;
}

/* No results */
.no-results {
  text-align: center;
  padding: 60px 0;
  color: var(--gray-text);
}

.no-results svg {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  color: #d1d5db;
  display: block;
  margin-inline: auto;
}

.no-results p {
  font-size: .95rem;
}

/* ══════════════════════════════════════════
       DETAIL PAGE  (unchanged)
    ══════════════════════════════════════════ */
.detail-wrapper {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 40px 60px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: var(--gray-text);
  margin-bottom: 28px;
  background: none;
  border: none;
  transition: color .2s;
}

.back-btn:hover {
  color: var(--purple);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.d-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 28px;
  margin-bottom: 16px;
}

.d-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.d-logo {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.d-title-block {
  flex: 1;
}

.d-title-block h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.d-company-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--purple);
  font-size: .9rem;
  font-weight: 600;
}

.d-company-link svg {
  width: 14px;
  height: 14px;
}

.detail-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.approved-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: #10b981; /* green */
  background: transparent;
  border: none;
  padding: 0;
}

.d-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f3f4f6;
  font-size: .875rem;
  color: #374151;
}

.d-meta span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.d-meta svg {
  width: 15px;
  height: 15px;
  color: var(--gray-text);
}

.d-meta .dm-badge {
  background: #eef2ff;
  color: #6366f1;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: .8rem;
  font-weight: 600;
}

.d-apply-row {
  display: flex;
  gap: 24px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #f3f4f6;
  font-size: .875rem;
  color: #374151;
}

.d-apply-row span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.d-apply-row svg {
  width: 15px;
  height: 15px;
  color: var(--gray-text);
}

.d-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.d-card p {
  font-size: .9rem;
  color: #4b5563;
  line-height: 1.7;
}

.d-skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-company-inner {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
}

.about-logo {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.about-desc {
  font-size: .875rem;
  color: #4b5563;
  line-height: 1.7;
}

.about-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--gray-text);
}

.about-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.about-meta svg {
  width: 13px;
  height: 13px;
}

.about-meta a {
  color: var(--purple);
  font-weight: 600;
}

.sidebar-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 24px;
  margin-bottom: 16px;
  position: sticky;
  top: 80px;
}

.sidebar-card p {
  font-size: .85rem;
  color: var(--gray-text);
  text-align: center;
  margin-bottom: 14px;
}

.btn-apply {
  width: 100%;
  height: 50px;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 11px;
  font-size: 1rem;
  font-weight: 700;
  transition: background .2s;
}

.btn-apply:hover {
  background: var(--purple-dark);
}

.btn-apply.is-disabled,
.btn-apply:disabled {
  background: #e5e7eb;
  color: #6b7280;
  cursor: not-allowed;
}

.overview-card {
  background: white;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 24px;
}

.overview-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.ov-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: .85rem;
}

.ov-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ov-label {
  color: var(--gray-text);
}

.ov-value {
  font-weight: 600;
  color: #374151;
}

body {
  overflow-x: hidden;
}

body.filters-open {
  overflow: hidden;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.sidebar-top .sidebar-heading {
  margin-bottom: 0;
}

.mobile-filter-bar {
  display: none;
  margin-bottom: 14px;
}

.mobile-filter-toggle,
.filter-close {
  border: 1.5px solid var(--border);
  background: white;
  color: var(--dark);
  cursor: pointer;
}

.mobile-filter-toggle {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mobile-filter-toggle svg {
  width: 16px;
  height: 16px;
}

.filter-close {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-close svg {
  width: 18px;
  height: 18px;
}

.filter-backdrop {
  display: none;
}

@media (max-width: 1024px) {
  .browse-body {
    grid-template-columns: 1fr;
    padding: 24px 20px 56px;
  }

  .mobile-filter-bar {
    display: flex;
  }

  .filter-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, 0.38);
    z-index: 399;
  }

  .filter-backdrop.open {
    display: block;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 360px);
    max-width: 360px;
    height: 100dvh;
    overflow-y: auto;
    border-radius: 0 20px 20px 0;
    z-index: 400;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    padding: 18px 16px 24px;
    top: 0;
  }

  .filter-sidebar.open {
    transform: translateX(0);
  }

  .filter-close {
    display: inline-flex;
  }

  .search-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .listings-grid {
    gap: 16px;
  }

  .listing-card {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .browse-header {
    padding: 28px 16px 24px;
  }

  .browse-body {
    padding: 20px 16px 48px;
  }

  .browse-header h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  .browse-header p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .listing-card {
    gap: 14px;
  }

  .card-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
  }

  .card-title-block h2 {
    font-size: 1.3rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .card-title-block p {
    font-size: 0.95rem;
    overflow-wrap: anywhere;
  }

  .meta-row {
    gap: 12px;
  }

  .card-footer {
    gap: 12px;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .listing-card {
    flex-direction: column;
    align-items: stretch;
  }

  .company-logo {
    width: 76px;
    height: 76px;
    border-radius: 14px;
  }

  .card-top {
    grid-template-columns: 1fr;
  }

  .card-action-wrap {
    justify-content: flex-start;
  }

  .meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
