/* ---------- Search hero band ---------- */
.search-hero {
  background: var(--pine);
  position: relative;
  overflow: hidden;
  padding: 30px 0 0;
  margin-top: 0;
}
.search-hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -100px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184,137,43,0.16) 0%, rgba(184,137,43,0) 70%);
}
.hero-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}
.hero-title {
  color: var(--white);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}
.hero-sub {
  color: #a9c1b7;
  font-size: 13.5px;
  margin: 0 0 20px;
}
.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 24px;
}
.search-field {
  flex: 1 1 340px;
  background: var(--white);
  border-radius: 11px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 48px;
  gap: 10px;
}
.search-field input {
  border: none;
  outline: none;
  flex: 1;
  font-size: 14.5px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: transparent;
}
.search-field input::placeholder {
  color: var(--text-muted);
}
.search-field.location {
  flex: 0 0 250px;
}
.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}
.btn-search {
  background: var(--gold);
  color: #2b1e08;
  border: none;
  border-radius: 11px;
  padding: 0 28px;
  height: 48px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
.btn-search:hover {
  background: #c99936;
}

.chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}
.chip-row .label {
  font-size: 12.5px;
  color: #a9c1b7;
  margin-right: 2px;
}
.pill-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #d7e4dd;
  font-size: 12.8px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.pill-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}
.pill-chip.active {
  background: var(--gold);
  color: #2b1e08;
  border-color: var(--gold);
  font-weight: 600;
}

.stat-strip {
  background: var(--pine-light);
}
.stat-row {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat-cell {
  padding: 16px 0;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.10);
}
.stat-cell:first-child {
  border-left: none;
}
.stat-num {
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  font-size: 21px;
  color: var(--white);
}
.stat-label {
  font-size: 11.8px;
  color: #a9c1b7;
  margin-top: 1px;
}

/* ---------- Layout ---------- */
.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 32px 60px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 26px;
  align-items: start;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 88px;
  z-index: 10;
}
.filter-search {
  position: relative;
}
.filter-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--sage-border);
  border-radius: 10px;
  padding: 0 14px 0 38px;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  outline: none;
  background: var(--white);
}
.filter-search input:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(18, 56, 50, 0.08);
}
.filter-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.active-filters:empty {
  display: none;
}
.af-chip {
  background: var(--gold-bg);
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px 5px 11px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.af-chip svg {
  width: 10px;
  height: 10px;
  cursor: pointer;
}
.af-clear {
  font-size: 12px;
  font-weight: 600;
  color: var(--coral);
  cursor: pointer;
  padding: 5px 4px;
}

.panel {
  background: var(--white);
  border: 1px solid var(--sage-border);
  border-radius: 14px;
  padding: 18px 18px 6px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pine);
  margin-bottom: 12px;
  cursor: pointer;
}
.panel-title svg {
  color: var(--text-muted);
  width: 15px;
  height: 15px;
  transition: transform .15s;
}
.panel-title.collapsed svg {
  transform: rotate(-90deg);
}

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  cursor: pointer;
  border-radius: 8px;
}
.cat-row:hover {
  background: var(--sage-bg);
}
.cat-row.hidden {
  display: none !important;
}

/* Custom styles for native inputs inside panels */
.panel input[type="radio"], 
.panel input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--sage-border);
  flex-shrink: 0;
  position: relative;
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: all 0.15s;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel input[type="radio"] {
  border-radius: 50%;
}
.panel input[type="radio"]:checked {
  border-color: var(--pine);
}
.panel input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--pine);
}
.panel input[type="checkbox"] {
  border-radius: 5px;
}
.panel input[type="checkbox"]:checked {
  background: var(--pine);
  border-color: var(--pine);
}
.panel input[type="checkbox"]:checked::after {
  content: '';
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg);
  position: absolute;
  top: 3px;
}

.cat-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--sage-bg);
  color: var(--pine);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cat-icon svg, .cat-icon i {
  width: 13px;
  height: 13px;
}
.cat-label {
  flex: 1;
  font-size: 13.6px;
  color: var(--ink);
}
.cat-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--sage-bg);
  padding: 2px 7px;
  border-radius: 999px;
}
.cat-row.selected .cat-label {
  color: var(--pine);
  font-weight: 600;
}
.cat-row.selected .cat-count {
  background: var(--gold-bg);
  color: var(--gold-dark);
}
.panel-divider {
  height: 1px;
  background: var(--sage-border);
  margin: 2px 0 14px;
}

.salary-slider {
  padding: 6px 4px 16px;
}
.salary-track {
  height: 5px;
  border-radius: 999px;
  background: var(--sage-border);
  position: relative;
  margin: 14px 2px 10px;
}
.salary-fill {
  position: absolute;
  left: 0%;
  right: 0%;
  top: 0;
  bottom: 0;
  background: var(--pine);
  border-radius: 999px;
}
.salary-handle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--pine);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}
.salary-handle:hover {
  transform: translate(-50%, -50%) scale(1.15);
}
.salary-handle.left {
  left: 0%;
}
.salary-handle.right {
  left: 100%;
}
.salary-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
}

.reset-btn {
  width: 100%;
  background: transparent;
  border: 1.5px dashed var(--sage-border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all .15s;
}
.reset-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: var(--coral-bg);
}

/* ---------- Results header ---------- */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-count {
  font-size: 14.5px;
  color: var(--text-secondary);
}
.results-count b, .results-count strong {
  color: var(--pine);
  font-weight: 700;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-select {
  height: 38px;
  border: 1px solid var(--sage-border);
  border-radius: 9px;
  background: var(--white);
  padding: 0 12px;
  font-size: 13.5px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
}
.sort-select:focus {
  border-color: var(--pine);
}
.view-toggle {
  display: flex;
  border: 1px solid var(--sage-border);
  border-radius: 9px;
  overflow: hidden;
}
.view-toggle button {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle button.active {
  background: var(--pine);
  color: var(--white);
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.job-card {
  background: var(--white);
  border: 1px solid var(--sage-border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.job-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #c9d5be;
}
.job-card.featured {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-card);
}
.featured-tag {
  position: absolute;
  top: 0;
  right: 18px;
  background: var(--gold);
  color: #2b1e08;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px 5px;
  border-radius: 0 0 7px 7px;
  font-family: 'IBM Plex Mono', monospace;
  z-index: 2;
}
.match-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--gold-bg);
  color: var(--gold-dark);
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid #f2e2be;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: 'IBM Plex Mono', monospace;
  z-index: 2;
}

.card-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.dept-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--sage-bg);
  color: var(--pine);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto Slab', serif;
  font-weight: 700;
  font-size: 13.5px;
  flex-shrink: 0;
}
.save-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--sage-border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .15s;
  flex-shrink: 0;
}
.save-btn:hover, .save-btn.saved {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: var(--gold-bg);
}

.job-title {
  font-family: 'Roboto Slab', serif;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  margin: 0 0 2px;
}
.job-dept {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 4px;
  line-height: 1.4;
}

.meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.8px;
  color: var(--ink);
}
.meta-row svg, .meta-row i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.meta-row .meta-label {
  color: var(--text-muted);
}
.meta-row .meta-val {
  font-weight: 600;
}
.meta-row.salary .meta-val {
  color: var(--pine);
}
.meta-row.deadline .meta-val {
  color: var(--coral);
}

.card-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--gold-bg);
  color: var(--gold-dark);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
}
.source-badge svg, .source-badge i {
  width: 11px;
  height: 11px;
}
.posted-when {
  font-size: 11.5px;
  color: var(--text-muted);
}

.tear-line {
  position: relative;
  height: 0;
  border-top: 2px dashed var(--sage-border);
  margin: 0 18px;
}
.tear-line::before, .tear-line::after {
  content: '';
  position: absolute;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sage-bg);
  border: 1px solid var(--sage-border);
}
.tear-line::before {
  left: -28px;
}
.tear-line::after {
  right: -28px;
}

.apply-row {
  padding: 14px 18px 18px;
}
.apply-btn {
  width: 100%;
  background: var(--pine);
  color: var(--white);
  border: none;
  border-radius: 9px;
  height: 42px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}
.apply-btn:hover {
  background: var(--pine-light);
}
.apply-btn svg, .apply-btn i {
  width: 15px;
  height: 15px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--sage-border);
}
.page-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--sage-border);
  background: var(--white);
  border-radius: 8px;
  font-size: 13.5px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 10px;
  transition: all 0.15s;
}
.page-btn.active {
  background: var(--pine);
  color: var(--white);
  border-color: var(--pine);
  font-weight: 600;
}
.page-btn.nav {
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-weight: 600;
}
.page-btn:hover:not(.active):not(:disabled) {
  border-color: #c9d5be;
  background: var(--sage-bg);
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.back-top {
  color: var(--pine);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- List View Upgrades (Desktop) ---------- */
@media (min-width: 769px) {
  .card-grid.list-view {
    grid-template-columns: 1fr;
  }
  .card-grid.list-view .job-card {
    flex-direction: row;
    align-items: stretch;
  }
  .card-grid.list-view .job-card.featured {
    box-shadow: -4px 0 0 0 var(--gold) inset, var(--shadow-card);
  }
  .card-grid.list-view .featured-tag {
    top: auto;
    bottom: 0;
    right: 0;
    border-radius: 7px 0 0 0;
  }
  .card-grid.list-view .match-badge {
    top: 10px;
    right: 10px;
  }
  .card-grid.list-view .card-body {
    flex: 1;
    flex-direction: row;
    align-items: center;
    padding: 16px 24px;
    gap: 24px;
  }
  .card-grid.list-view .card-top {
    margin-bottom: 0;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .card-grid.list-view .job-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .card-grid.list-view .card-details-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .card-grid.list-view .meta-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 0;
  }
  .card-grid.list-view .card-tags {
    margin-top: 0;
    padding-top: 0;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
  }
  .card-grid.list-view .tear-line {
    width: 0;
    height: auto;
    border-top: none;
    border-left: 2px dashed var(--sage-border);
    margin: 18px 0;
  }
  .card-grid.list-view .tear-line::before, 
  .card-grid.list-view .tear-line::after {
    width: 18px;
    height: 18px;
    left: -9px;
  }
  .card-grid.list-view .tear-line::before {
    top: -28px;
  }
  .card-grid.list-view .tear-line::after {
    bottom: -28px;
    top: auto;
  }
  .card-grid.list-view .apply-row {
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .card-grid.list-view .apply-btn {
    width: 130px;
  }
}

/* Spinner and Loaders */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: rgba(18, 56, 50, 0.15);
  border-top-color: var(--pine);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-note {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px 20px;
  background: var(--white);
  border: 1px dashed var(--sage-border);
  border-radius: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .page {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  .hero-wrap {
    padding: 0 16px !important;
  }
  .search-hero {
    padding-top: 20px !important;
  }
  .search-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-bottom: 18px !important;
  }
  .search-field, 
  .search-field.location {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: 50px !important;
    border-radius: 12px !important;
  }
  .search-field input {
    width: 100% !important;
    font-size: 15px !important;
  }
  .btn-search {
    width: 100% !important;
    max-width: 100% !important;
    height: 50px !important;
    border-radius: 12px !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    justify-content: center !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  .stat-strip {
    background: rgba(0, 0, 0, 0.2) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }
  .stat-row {
    padding: 14px 16px !important;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  .stat-cell {
    border-left: none !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    padding: 14px 10px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .stat-num {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
  }
  .stat-label {
    font-size: 11.5px !important;
    color: #a9c1b7 !important;
    margin-top: 4px !important;
    text-align: center !important;
  }
  .chip-row {
    padding-bottom: 16px !important;
  }
  .chip-row .label {
    display: none !important;
  }
  .pill-chip {
    font-size: 12px !important;
    padding: 6px 12px !important;
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .page {
    padding: 20px 16px 40px;
  }
}
