/* OWL Prospector — Optima Well Resources LLC */

.screening-page {
  background: var(--sand-light);
  min-height: 100vh;
}

.screening-main {
  padding: 5rem 1rem 2rem;
  max-width: none;
  width: 100%;
  margin: 0;
}

.screening-hero {
  margin-bottom: 1.25rem;
  padding: 0 0.5rem;
}

.screening-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.screening-hero-lead {
  color: var(--charcoal);
  max-width: 48rem;
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}

.product-byline {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
  opacity: 0.75;
  margin: 0 0 0.5rem;
}

.screening-hero p {
  color: var(--charcoal);
  max-width: 48rem;
  font-size: 0.9375rem;
}

.mvp-badge {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(0, 180, 168, 0.12);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0 0.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid rgba(10, 37, 64, 0.08);
  border-radius: 10px;
  padding: 0.875rem 1rem;
}

.stat-card .label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: 0.25rem;
}

.stat-card .value {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .sub {
  font-size: 0.75rem;
  color: var(--charcoal);
  margin-top: 0.125rem;
}

.screening-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(260px, 22rem);
  gap: 1rem;
  align-items: start;
  padding: 0 0.5rem;
}

.screening-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.well-map {
  height: 340px;
  border-radius: 12px;
  border: 1px solid rgba(10, 37, 64, 0.08);
  overflow: hidden;
  background: var(--navy-dark);
  z-index: 1;
}

.map-pin .pin-core {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.map-pin.deal .pin-core {
  background: #e8a838;
}

.map-pin.selected .pin-core {
  width: 18px;
  height: 18px;
  border-width: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.filter-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.375rem;
}

.vintage-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--navy);
}

.vintage-toggle label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.slider-group input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
  padding: 0;
  border: none;
}

.slider-val {
  font-weight: 500;
  color: var(--teal);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(10, 37, 64, 0.08);
  background: rgba(10, 37, 64, 0.02);
  flex-shrink: 0;
}

.pagination.is-single-page {
  justify-content: flex-start;
}

.pagination #page-info {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--navy);
  min-width: 10rem;
  text-align: center;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--charcoal);
}

.page-jump input {
  width: 3.5rem;
  padding: 0.3rem 0.4rem;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid rgba(10, 37, 64, 0.15);
  border-radius: 6px;
  text-align: center;
}

.page-jump input:disabled {
  opacity: 0.5;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.wells-table tbody tr.deal-row {
  background: rgba(232, 168, 56, 0.06);
}

.filters-panel {
  background: var(--white);
  border: 1px solid rgba(10, 37, 64, 0.08);
  border-radius: 12px;
  padding: 0;
  position: sticky;
  top: 5rem;
  align-self: start;
  max-height: calc(100vh - 5.5rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.filters-panel-head {
  flex-shrink: 0;
  padding: 1rem 1rem 0.75rem;
  background: var(--white);
  border-bottom: 1px solid rgba(10, 37, 64, 0.08);
  position: sticky;
  top: 0;
  z-index: 2;
}

.filters-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
}

.filters-panel h2 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.625rem;
  color: var(--navy);
}

.filter-ui-version {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--gold);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.filter-group {
  margin-bottom: 0.75rem;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 0.375rem;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 0.45rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid rgba(10, 37, 64, 0.15);
  border-radius: 6px;
  background: var(--white);
  color: var(--navy);
}

.filter-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--navy);
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
}

.filter-actions .btn {
  width: 100%;
}

.btn-secondary {
  background: var(--navy);
  color: var(--white);
}

.btn-secondary:hover {
  background: #0d3050;
}

.results-panel {
  background: var(--white);
  border: 1px solid rgba(10, 37, 64, 0.08);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(10, 37, 64, 0.08);
  background: rgba(237, 230, 218, 0.35);
  flex-shrink: 0;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.page-size-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-size-group label {
  font-size: 0.75rem;
  color: var(--charcoal);
  white-space: nowrap;
}

.page-size-group select {
  padding: 0.375rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid rgba(10, 37, 64, 0.15);
  border-radius: 6px;
  background: var(--white);
}

.results-toolbar .count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-group label {
  font-size: 0.75rem;
  color: var(--charcoal);
}

.sort-group select {
  padding: 0.375rem 0.5rem;
  font-family: inherit;
  font-size: 0.8125rem;
  border: 1px solid rgba(10, 37, 64, 0.15);
  border-radius: 6px;
}

.results-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 22rem);
  min-height: 0;
  flex: 1;
}

.table-wrap {
  overflow: auto;
  max-height: min(520px, calc(100vh - 22rem));
  min-width: 0;
  position: relative;
  background: var(--white);
}

.table-wrap.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.wells-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.75rem;
  table-layout: fixed;
}

.table-wrap .wells-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef2f6;
  box-shadow: 0 1px 0 rgba(10, 37, 64, 0.12);
}

.wells-table tbody td {
  background: var(--white);
}

.wells-table tbody tr.deal-row td {
  background: rgba(232, 168, 56, 0.06);
}

.wells-table .col-api { width: 11%; }
.wells-table .col-well { width: 14%; }
.wells-table .col-loc { width: 10%; }
.wells-table .col-status { width: 8%; }
.wells-table .col-op { width: 16%; }
.wells-table .col-form { width: 12%; }
.wells-table .col-num { width: 9%; }
.wells-table .col-ask { width: 8%; }

.wells-table th {
  text-align: left;
  padding: 0.5rem 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--charcoal);
  border-bottom: 1px solid rgba(10, 37, 64, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
}

.wells-table th:nth-child(n+7) {
  text-align: right;
}

.wells-table td {
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid rgba(10, 37, 64, 0.06);
  color: var(--navy);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wells-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.wells-table tbody tr:hover,
.wells-table tbody tr.selected {
  background: rgba(0, 180, 168, 0.08);
}

.wells-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill.producing { background: rgba(0, 180, 168, 0.15); color: #007a72; }
.status-pill.active { background: rgba(0, 180, 168, 0.15); color: #007a72; }
.status-pill.shut-in { background: rgba(212, 196, 168, 0.35); color: #6b5a3e; }
.status-pill.plugged { background: rgba(61, 79, 95, 0.15); color: var(--charcoal); }
.status-pill.permitted { background: rgba(10, 37, 64, 0.1); color: var(--navy); }

.sale-badge {
  display: inline-block;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--teal);
  margin-left: 0.2rem;
}

.detail-panel {
  border: 1px solid rgba(10, 37, 64, 0.08);
  border-radius: 12px;
  padding: 1rem;
  background: rgba(237, 230, 218, 0.25);
  overflow-y: auto;
  max-height: calc(100vh - 5.5rem);
  position: sticky;
  top: 5rem;
}

.detail-panel.has-selection {
  background: rgba(237, 230, 218, 0.35);
}

.detail-panel h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.detail-hint {
  font-size: 0.8125rem;
  color: var(--charcoal);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.detail-hint.hidden {
  display: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem 0.75rem;
  margin-bottom: 0.75rem;
}

.detail-item .k {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--charcoal);
}

.detail-item .v {
  font-size: 0.8125rem;
  color: var(--navy);
  font-weight: 500;
  word-break: break-word;
}

.detail-listing {
  border-top: 1px solid rgba(10, 37, 64, 0.1);
  padding-top: 0.75rem;
}

.detail-listing.empty {
  display: none;
}

.detail-listing h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: 0.375rem;
}

.detail-listing p {
  font-size: 0.8125rem;
  color: var(--navy);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.detail-listing a {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}

.detail-listing a:hover {
  text-decoration: underline;
}

.detail-section-title {
  grid-column: 1 / -1;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0.75rem 0 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(10, 37, 64, 0.08);
}

.detail-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--teal);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.detail-link:hover {
  color: var(--navy);
}

.filter-section {
  margin: 0.75rem 0 0.5rem;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid rgba(10, 37, 64, 0.1);
}

.filter-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.filter-section-hint {
  font-size: 0.75rem;
  color: var(--charcoal);
  margin-bottom: 0.625rem;
  line-height: 1.35;
}

.data-sources {
  margin: 1.5rem 0.5rem 0;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid rgba(10, 37, 64, 0.08);
  border-radius: 12px;
}

.data-sources h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.data-sources p,
.data-sources li {
  font-size: 0.8125rem;
  color: var(--charcoal);
  line-height: 1.55;
}

.data-sources ul {
  margin: 0.5rem 0 0 1.25rem;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--charcoal);
}

/* Wide: filters | map+table | details. Narrow: stack filters → map+table → details. */
@media (max-width: 1200px) {
  .screening-layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .filters-panel-head {
    position: sticky;
    top: var(--header-h);
    z-index: 5;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(10, 37, 64, 0.06);
  }

  .filters-panel-body {
    overflow: visible;
    max-height: none;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 900px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

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