/* ============================================================
   SpaceX CapEx Intelligence Terminal
   Design: Exact SpaceX.com design language + careers hero
   Font: D-DIN (SpaceX's actual typeface via CDNFonts)
   Colors: #000 / rgba(240,240,250,x) spectral white — exact from spacex.com
   ============================================================ */

@import url('https://fonts.cdnfonts.com/css/d-din');

/* ── CSS Custom Properties — exact from spacex.com source ── */
:root {
  --white-100: rgba(240, 240, 250, 1);
  --white-90:  rgba(240, 240, 250, .9);
  --white-80:  rgba(240, 240, 250, .8);
  --white-70:  rgba(240, 240, 250, .7);
  --white-60:  rgba(240, 240, 250, .6);
  --white-50:  rgba(240, 240, 250, .5);
  --white-35:  rgba(240, 240, 250, .35);
  --white-30:  rgba(240, 240, 250, .3);
  --white-25:  rgba(255, 255, 255, .25);
  --white-15:  rgba(240, 240, 250, .15);
  --white-10:  rgba(240, 240, 250, .1);
  --black-50:  rgba(0, 0, 0, .5);
  --black-70:  rgba(0, 0, 0, .70);
  --black-80:  rgba(0, 0, 0, .8);
  --gray-80:   rgba(37, 38, 40, .8);

  /* Page surface — deep blue/gray, Tomcat Capex theme */
  --surface:   #1a1d24;
  --surface-2: #242836;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base (SpaceX exact) ── */
html { scroll-behavior: smooth; }
body {
  background-color: var(--surface);
  color: var(--white-100);
  font-family: 'D-DIN', 'DIN', Arial, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.625rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════════════════ */
.sx-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  height: 64px;
  /* Transparent over hero, becomes opaque on scroll */
  background: transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.sx-nav.scrolled {
  background: rgba(26, 29, 36, 0.96);
  border-bottom-color: var(--white-10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── SpaceX Logo SVG ── */
.sx-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  user-select: none;
  flex-shrink: 0;
}

.sx-logo-text {
  font-family: 'D-DIN', 'DIN', Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-100);
  line-height: 1;
}

.sx-logo-divider {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: rgba(240,240,250,0.25);
  margin: 0 12px;
  vertical-align: middle;
}

.sx-logo-capex {
  font-family: 'D-DIN', 'DIN', Arial, sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,240,250,0.75);
  line-height: 1;
}

/* ── Nav Right ── */
.sx-nav-right {
  display: flex;
  align-items: center;
  gap: 36px;
}

.sx-nav-tag {
  font-family: 'D-DIN', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white-50);
  font-variant-numeric: tabular-nums;
}

.sx-live-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-60);
}

.sx-sync-time {
  color: var(--white-40);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  margin-left: 6px;
  font-weight: 400;
  text-transform: none;
}

.sx-live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--white-100);
  animation: blink 2.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.15; }
}

/* ═══════════════════════════════════════════════════════════
   HERO — Full-bleed background image (SpaceX careers style)
═══════════════════════════════════════════════════════════ */
.sx-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

/* The actual background image */
.sx-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('../hero.png?v=spacex_4k_flight');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  /* Slight Ken Burns drift */
  animation: hero-drift 32s ease-in-out infinite alternate;
  transform-origin: center;
}

@keyframes hero-drift {
  from { transform: scale(1.0) translate(0, 0); }
  to   { transform: scale(1.22) translate(-2%, -1.5%); }
}

/* Gradient overlay — light over the image, fades into --surface at the very bottom
   so the transition to the grey content area below is seamless with no visible seam */
.sx-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.22)   0%,    /* near-transparent at top — image fully visible */
    rgba(0,0,0,0.12)   30%,   /* lightest — maximum cinematic image impact */
    rgba(0,0,0,0.45)   65%,   /* building toward legible text zone */
    rgba(26,29,36,0.82) 85%,  /* blending with --surface colour */
    rgba(26,29,36,1)   100%   /* fully --surface at the bottom edge = seamless join */
  );
}

/* Text content sits at the bottom of the hero, above overlay */
.sx-hero-content {
  position: relative;
  z-index: 2;
  padding: 0 48px 72px;
  max-width: 820px;
}

.sx-hero-eyebrow {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white-60);
  margin-bottom: 20px;
}

.sx-hero-title {
  font-size: clamp(2.75rem, 5.5vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.0;
  color: var(--white-100);
  margin-bottom: 24px;
}

.sx-hero-sub {
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-60);
  line-height: 1.9;
  max-width: 560px;
}

/* Scroll-down indicator (SpaceX careers has a subtle chevron) */
.sx-scroll-indicator {
  position: absolute;
  bottom: 32px;
  right: 48px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--white-35);
  font-size: 0.5625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: scroll-bob 2s ease-in-out infinite;
  cursor: pointer;
  user-select: none;
}

.sx-scroll-indicator svg {
  width: 14px; height: 14px;
  fill: none;
  stroke: var(--white-35);
  stroke-width: 1.5;
}

@keyframes scroll-bob {
  0%, 100% { transform: translateY(0);   opacity: 0.5; }
  50%       { transform: translateY(6px); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   PIPELINE BANNER
═══════════════════════════════════════════════════════════ */
.sx-pipeline-banner {
  display: none;
  align-items: center;
  gap: 24px;
  padding: 16px 48px;
  background: var(--black-70);
  border-bottom: 1px solid var(--white-15);
  backdrop-filter: blur(6px);
}

.sx-pipeline-banner.visible { display: flex; }

.sx-pipeline-label {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-70);
  white-space: nowrap;
  min-width: 180px;
}

.sx-pipeline-track {
  flex: 1;
  height: 1px;
  background: var(--white-15);
  position: relative;
  overflow: hidden;
}

.sx-pipeline-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--white-100);
  transition: width 0.6s ease;
  width: 0%;
}

.sx-pipeline-pct {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--white-50);
  min-width: 44px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   STATS STRIP
═══════════════════════════════════════════════════════════ */
.sx-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--white-10);
  background: var(--surface);
}

.sx-stat-item {
  padding: 40px 48px;
  border-right: 1px solid var(--white-10);
  transition: background 0.2s;
}
.sx-stat-item:last-child { border-right: none; }
.sx-stat-item:hover { background: var(--white-10); }

.sx-stat-value {
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white-100);
  line-height: 1;
  margin-bottom: 10px;
  font-variant-numeric: tabular-nums;
}

.sx-stat-label {
  font-size: 0.625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--white-40);
}

/* ═══════════════════════════════════════════════════════════
   CONTROLS
═══════════════════════════════════════════════════════════ */
.sx-controls {
  padding: 24px 48px;
  border-bottom: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--surface-2);
}

.sx-control-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
}

/* Ghost select */
.sx-select {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--white-25);
  color: var(--white-80);
  font-family: 'D-DIN', Arial, sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 36px 10px 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, color 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(240,240,250,0.4)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 150px;
}
.sx-select:hover { border-color: var(--white-60); color: var(--white-100); }
.sx-select option { background: #111; color: var(--white-80); }

/* Ghost input */
.sx-input {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid var(--white-25);
  color: var(--white-80);
  font-family: 'D-DIN', Arial, sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, color 0.2s;
  min-width: 190px;
}
.sx-input::placeholder { color: var(--white-30); letter-spacing: 0.16em; }
.sx-input:hover, .sx-input:focus { border-color: var(--white-60); color: var(--white-100); }

/* Slider */
.sx-slider-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sx-slider-label {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-50);
  white-space: nowrap;
}

.sx-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 1px;
  background: var(--white-25);
  outline: none;
  cursor: pointer;
}
.sx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  background: var(--white-100);
  cursor: pointer;
  border-radius: 0;
}
.sx-slider::-moz-range-thumb {
  width: 13px; height: 13px;
  background: var(--white-100);
  cursor: pointer;
  border-radius: 0;
  border: none;
}

.sx-slider-value {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--white-80);
  min-width: 24px;
}

/* Ghost buttons */
.sx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: transparent;
  border: 1px solid var(--white-35);
  color: var(--white-80);
  font-family: 'D-DIN', Arial, sans-serif;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}
.sx-btn:hover { border-color: var(--white-80); color: var(--white-100); background: var(--white-10); }
.sx-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.sx-btn-actions {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════
   RESULTS BAR
═══════════════════════════════════════════════════════════ */
.sx-results-bar {
  padding: 14px 48px;
  border-bottom: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}

.sx-results-count {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-50);
}
.sx-results-count span { color: var(--white-100); }

.sx-sort-info {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-30);
}

/* ═══════════════════════════════════════════════════════════
   LEAD TABLE
═══════════════════════════════════════════════════════════ */
.sx-table-container { overflow-x: auto; background: var(--surface); position: relative; }

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#leads-table {
  width: 1315px;
}
@media (min-width: 1350px) {
  #leads-table {
    width: 100%;
  }
}

thead th {
  padding: 14px 16px 14px 0;
  text-align: left;
  font-size: 0.5625rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--white-30);
  font-weight: 400;
  border-bottom: 1px solid var(--white-10);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s;
  position: sticky;
  top: 64px;
  background: var(--surface);
  z-index: 10;
}
thead th:first-child { padding-left: 48px; }
thead th:last-child  { padding-right: 48px; }
thead th:hover       { color: var(--white-70); }
thead th.sort-asc::after  { content: ' ↑'; color: var(--white-60); }
thead th.sort-desc::after { content: ' ↓'; color: var(--white-60); }

/* Column widths */
col.col-score   { width: 110px; }
col.col-company { width: 220px; }
col.col-asset   { width: 175px; }
col.col-lender  { width: 195px; }
col.col-age     { width: 85px; }
col.col-lapse   { width: 105px; }
col.col-volume  { width: 130px; }
col.col-node    { width: 185px; }
col.col-match   { width: 110px; }

tbody tr.data-row {
  border-bottom: 1px solid var(--white-10);
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}
tbody tr.data-row:hover { background: rgba(240,240,250,0.06); }

/* Selected row — bright accent bar + highlight */
tbody tr.data-row.row-open {
  background: rgba(240,240,250,0.12);
  border-bottom-color: rgba(240,240,250,0.4);
}
tbody tr.data-row.row-open td { color: var(--white-100); }
tbody tr.data-row.row-open td:first-child {
  border-left: 3px solid var(--white-100);
  padding-left: calc(48px - 3px);
}

tbody tr.data-row td {
  padding: 20px 16px 20px 0;
  font-size: 0.8125rem;
  color: var(--white-80);
  vertical-align: top;
  line-height: 1.5;
}
tbody tr.data-row td:first-child { padding-left: 48px; }
tbody tr.data-row td:last-child  { padding-right: 48px; }

/* Score bar */
.sx-score-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sx-score-bar-track {
  width: 64px;
  height: 1px;
  background: var(--white-15);
  position: relative;
  flex-shrink: 0;
}

.sx-score-bar-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: var(--white-100);
  transition: width 0.7s ease;
  width: 0;
}

.sx-score-num {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white-100);
  min-width: 34px;
  font-variant-numeric: tabular-nums;
}
.sx-score-num.tier-hot     { color: var(--white-80); }
.sx-score-num.tier-monitor { color: var(--white-55); }
.sx-score-num.tier-low     { color: var(--white-30); }

/* Company */
.sx-company-name {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--white-100);
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 4px;
}
.sx-company-loc {
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-35);
}

/* Lapse */
.lapse-urgent { color: var(--white-100); }
.lapse-normal { color: var(--white-50); }

/* Volume */
.sx-volume {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--white-60);
}

/* Entity badge */
.sx-match-badge {
  display: inline-block;
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-100);
  border: 1px solid var(--white-30);
  padding: 3px 7px;
  white-space: nowrap;
  line-height: 1.5;
}

/* Node */
.sx-node-name {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-70);
  margin-bottom: 3px;
}
.sx-node-dist {
  font-size: 0.5625rem;
  letter-spacing: 0.12em;
  color: var(--white-30);
}

/* ═══════════════════════════════════════════════════════════
   BREAKDOWN ROW — 3D LIFTED CARD
═══════════════════════════════════════════════════════════ */
/* Old table-row breakdown hidden — panel is now a floating div */
tbody tr.breakdown-row { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   FLOATING BREAKDOWN PANEL — renders as a real div, not a tr
   so box-shadow, transform, z-index ALL work properly
═══════════════════════════════════════════════════════════ */
.bd-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 100;
  /* Light surface — inverted against the dark table for maximum contrast */
  background: #e8eaed;
  border-top: 3px solid #ffffff;
  border-bottom: 2px solid rgba(0,0,0,0.3);
  /* Real 3D depth — works perfectly on a div */
  box-shadow:
    0  4px  12px rgba(0,0,0,0.5),
    0 16px  40px rgba(0,0,0,0.6),
    0 40px  80px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(240,240,250,0.15);
  /* Entrance animation */
  animation: panel-in 0.25s cubic-bezier(0.22,1,0.36,1) both;
}

.bd-panel.open { display: block; }

@keyframes panel-in {
  from { opacity:0; transform: translateY(-10px) scaleY(0.97); }
  to   { opacity:1; transform: translateY(0)     scaleY(1);    }
}

/* Panel header bar */
.bd-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 48px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.06);
}

.bd-title {
  flex: 1;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #1a1c22;
}

.bd-score {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1a1c22;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: none;
}

.bd-close {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.2);
  color: rgba(0,0,0,0.4);
  font-size: 0.75rem;
  width: 28px; height: 28px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
  letter-spacing: 0;
}
.bd-close:hover {
  border-color: rgba(0,0,0,0.6);
  color: #000;
}

/* Four-card grid */
.bd-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: rgba(0,0,0,0.1);
  margin: 16px 48px 24px;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.4),
    0 8px 24px rgba(0,0,0,0.4);
}

/* Individual card */
.bd-card {
  background: #f0f2f5;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.bd-card:hover {
  background: #ffffff;
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  z-index: 2;
}

/* Specular highlight on light cards — subtle shadow at top edge */
.bd-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: rgba(255,255,255,0.9);
}

/* Pending card (W2) */
.bd-card--pending {
  background: #d8dae0;
  opacity: 0.7;
}
.bd-card--pending:hover {
  background: #d8dae0;
  transform: none;
  box-shadow: none;
  opacity: 0.7;
}

/* Active bonus card */
.bd-card--active { background: #e8f0eb; }
.bd-card--active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.25), transparent);
}

.bd-card-inner {
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.bd-card-label {
  font-size: 0.5rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.45);
}

.bd-card-value {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0d0e11;
  line-height: 1;
  text-shadow: none;
}

.bd-card-value--pending {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  color: rgba(0,0,0,0.35);
  text-shadow: none;
  margin-top: 6px;
}

/* Score bar inside panel */
.bd-bar-track {
  height: 2px;
  background: rgba(0,0,0,0.12);
  position: relative;
  border-radius: 1px;
  overflow: hidden;
}
.bd-bar-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: #1a1c22;
  transition: width 0.9s cubic-bezier(0.22,1,0.36,1);
  box-shadow: none;
  border-radius: 1px;
}

.bd-card-note {
  font-size: 0.5625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.4);
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════
   EMPTY / LOADING
═══════════════════════════════════════════════════════════ */
.sx-empty {
  padding: 100px 48px;
  text-align: center;
}
.sx-empty-label {
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--white-25);
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════ */
.sx-footer {
  padding: 44px 48px 64px;
  border-top: 1px solid var(--white-10);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  background: var(--surface-2);
}

.sx-footer-legend {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.sx-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.5625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white-35);
}

.sx-legend-bar { width: 28px; height: 1px; }
.sx-legend-bar.priority { background: var(--white-100); }
.sx-legend-bar.hot      { background: var(--white-70); }
.sx-legend-bar.monitor  { background: var(--white-40); }
.sx-legend-bar.low      { background: var(--white-20); }

.sx-footer-note {
  font-size: 0.5625rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-20);
  line-height: 2.2;
  text-align: right;
}

/* ── Toast ── */
.sx-toast {
  position: fixed;
  bottom: 36px;
  right: 48px;
  background: var(--white-100);
  color: #000;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 13px 22px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.sx-toast.show { opacity: 1; transform: translateY(0); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--white-15); }
::-webkit-scrollbar-thumb:hover { background: var(--white-30); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .sx-stats-strip { grid-template-columns: repeat(2, 1fr); }
  .sx-breakdown   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sx-nav,
  .sx-hero-content,
  .sx-controls,
  .sx-results-bar,
  .sx-footer { padding-left: 24px; padding-right: 24px; }
  .sx-pipeline-banner { padding-left: 24px; padding-right: 24px; }
  .sx-stat-item { padding: 32px 24px; }
  .sx-stats-strip { grid-template-columns: repeat(2, 1fr); }
  thead th:first-child,
  tbody tr.data-row td:first-child { padding-left: 24px; }
  thead th:last-child,
  tbody tr.data-row td:last-child  { padding-right: 24px; }
  .sx-breakdown   { grid-template-columns: 1fr; }
  tbody tr.breakdown-row td { padding: 24px; }
  
  /* Responsive Filters Stack */
  .sx-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
  }
  .sx-control-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    width: 100% !important;
  }
  .sx-select, .sx-input, .sx-slider-group {
    width: 100% !important;
    min-width: 0 !important;
  }
  .sx-slider {
    flex: 1;
    width: auto !important;
  }
  .sx-btn-actions {
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    gap: 12px !important;
  }
  .sx-btn-actions .sx-btn {
    flex: 1 !important;
    justify-content: center !important;
  }
  
  /* Horizontal Table Scroll */
  .sx-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  #leads-table {
    width: 1315px !important;
    min-width: 1315px !important;
  }
  
  /* Full screen Detail Panel on Mobile */
  .detail-panel {
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .sx-hero-title  { font-size: 2.5rem; }
  thead th { top: 56px; }
}

/* ═══════════════════════════════════════════════════════════
   RIGHT-SIDE DETAIL PANEL — Tomcat-style light panel
═══════════════════════════════════════════════════════════ */

.detail-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 299;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.detail-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: 480px;
  max-width: 96vw;
  background: #f4f5f7;
  border-left: 1px solid #d0d4da;
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
  box-shadow:
    -8px  0  24px rgba(0,0,0,0.35),
    -24px 0  60px rgba(0,0,0,0.25),
    -48px 0 100px rgba(0,0,0,0.15);
}
.detail-panel.open { transform: translateX(0); }

/* accent bar */
.dp-accent-bar { height: 4px; width: 100%; flex-shrink: 0; background: #e0e3e8; }
.dp-accent-bar.urgent  { background: #ff3b3b; }
.dp-accent-bar.warning { background: #ff8c00; }
.dp-accent-bar.warm    { background: #f5a623; }
.dp-accent-bar.ok      { background: #34c759; }

/* header */
.dp-header {
  flex-shrink: 0;
  padding: 18px 20px 14px;
  background: #ffffff;
  border-bottom: 1px solid #e4e7ec;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
.dp-header-info { flex: 1; min-width: 0; }
.dp-company {
  font-size: 1.0625rem;
  font-weight: 800;
  color: #0d0e11;
  line-height: 1.3;
  margin-bottom: 3px;
}
.dp-location { font-size: 0.875rem; color: #374151; }
.dp-close {
  background: transparent;
  border: none;
  color: #1f2937;
  font-size: 1.375rem;
  cursor: pointer;
  padding: 0 0 0 12px;
  line-height: 1;
  flex-shrink: 0;
}
.dp-close:hover { color: #111; }

/* scrollable body */
.dp-body { flex: 1; overflow-y: auto; background: #f4f5f7; }
.dp-body::-webkit-scrollbar { width: 4px; }
.dp-body::-webkit-scrollbar-track { background: #f4f5f7; }
.dp-body::-webkit-scrollbar-thumb { background: #c8cdd5; border-radius: 2px; }

/* urgency block */
.dp-urgency-block {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e4e7ec;
}
.dp-urgency-label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1f2937;
  margin-bottom: 5px;
}
.dp-urgency-days {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
}
.dp-urgency-ctx {
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
  margin-bottom: 12px;
}
.dp-filing-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.dp-meta-item { display: flex; flex-direction: column; gap: 3px; }
.dp-meta-label { font-size: 0.5625rem; letter-spacing: 0.18em; text-transform: uppercase; color: #1f2937; }
.dp-meta-val { font-size: 0.9375rem; font-weight: 600; color: #1f2937; }

/* score ring block */
.dp-score-block {
  padding: 18px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e4e7ec;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 1px 3px rgba(0,0,0,0.05);
}
.dp-score-ring-wrap {
  flex-shrink: 0;
  position: relative;
  width: 72px;
  height: 72px;
}
.dp-score-ring-wrap svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.dp-score-ring-bg { fill: none; stroke: #e5e7eb; stroke-width: 6; }
.dp-score-ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.dp-score-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.dp-score-ring-num { font-size: 1.375rem; font-weight: 800; color: #0d0e11; }
.dp-score-ring-tier { font-size: 0.5625rem; letter-spacing: 0.16em; text-transform: uppercase; color: #1f2937; margin-top: 3px; }

.dp-score-narrative { flex: 1; min-width: 0; }
.dp-score-section-label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 7px;
}
.dp-score-text { font-size: 0.9375rem; color: #374151; line-height: 1.6; font-weight: 500; }
.dp-score-rows { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.dp-score-row {
  display: grid;
  grid-template-columns: 100px 1fr 30px;
  align-items: center;
  gap: 8px;
}
.dp-score-row-label { font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; color: #1f2937; }
.dp-mini-bar-track { height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; position: relative; }
.dp-mini-bar-fill { position: absolute; left:0; top:0; height:100%; background: #374151; border-radius:2px; transition: width 0.8s ease; }
.dp-score-row-val { font-size: 0.8125rem; font-weight: 700; color: #374151; text-align: right; font-variant-numeric: tabular-nums; }
.dp-score-row--pending { opacity: 0.85; grid-template-columns: 100px 1fr; }
.dp-score-row-pending { font-size: 0.625rem; letter-spacing: 0.18em; text-transform: uppercase; color: #1f2937; }

/* section cards */
.dp-card {
  background: #ffffff;
  border-bottom: 1px solid #e4e7ec;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.8);
}
.dp-card-header {
  padding: 14px 20px 4px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* filing table rows — exact Tomcat layout */
.dp-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; }
.dp-table tr { border-top: 1px solid #f3f4f6; }
.dp-table tr:first-child { border-top: none; }
.dp-table td { padding: 8px 20px; font-size: 0.875rem; vertical-align: top; line-height: 1.4; }
.dp-table td:first-child { color: #1f2937; font-size: 0.8125rem; width: 100px; white-space: nowrap; }
.dp-table td:last-child { color: #1f2937; font-weight: 600; }
.dp-table a { color: #1f2937; text-decoration: underline; text-underline-offset: 2px; }

/* lender intel */
.dp-lender-text { padding: 8px 20px 14px; font-size: 0.9375rem; color: #1f2937; line-height: 1.65; }
.dp-lender-text strong { color: #111827; font-weight: 700; }

/* volume block */
.dp-volume-block { padding: 12px 20px 14px; display: flex; align-items: center; gap: 16px; }
.dp-volume-num { font-size: 1.375rem; font-weight: 800; color: #111827; line-height: 1; white-space: nowrap; }
.dp-volume-sub { font-size: 0.5625rem; letter-spacing: 0.18em; text-transform: uppercase; color: #1f2937; margin-top: 3px; }
.dp-volume-note { font-size: 0.8125rem; color: #374151; line-height: 1.5; }

/* entity badges */
.dp-badges { padding: 8px 20px 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.dp-badge {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1.5px solid #d1d5db;
  color: #374151;
  padding: 4px 10px;
  border-radius: 4px;
  background: #f9fafb;
}
.dp-empty-note { padding: 10px 20px 14px; font-size: 0.8125rem; color: #1f2937; font-style: italic; line-height: 1.6; }

/* action bar — Tomcat-style large CTA */
.dp-actions {
  flex-shrink: 0;
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e4e7ec;
  display: flex;
  gap: 8px;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.dp-action-primary {
  flex: 1;
  padding: 13px 18px;
  background: #111827;
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s, transform 0.12s;
}
.dp-action-primary:hover { background: #1f2937; transform: translateY(-1px); }
.dp-action-secondary {
  padding: 13px 16px;
  background: transparent;
  border: 1.5px solid #d1d5db;
  color: #374151;
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.dp-action-secondary:hover { border-color: #374151; color: #374151; }

/* Glassmorphic Paywall Card */
.sx-paywall-card {
  margin: 20px;
  padding: 24px;
  background: rgba(30, 35, 48, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(240, 240, 250, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.sx-paywall-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.sx-paywall-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.sx-paywall-title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white-100);
  margin-bottom: 8px;
}

.sx-paywall-price {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--white-100);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.sx-paywall-desc {
  font-size: 0.8125rem;
  color: var(--white-70);
  line-height: 1.5;
  margin-bottom: 20px;
}

.sx-paywall-btn {
  width: 100%;
  padding: 14px 20px;
  background: #ffffff;
  color: #1a1d24;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.sx-paywall-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.25);
}

.sx-paywall-btn:active {
  transform: translateY(0);
}

/* ── Newsletter Subscription Card ────────────────────────────────────────── */
.sx-subscribe-section {
  width: 100%;
  max-width: 1315px;
  margin: 40px auto 10px auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.sx-subscribe-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background: rgba(26, 29, 36, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 30px 40px;
  gap: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.sx-subscribe-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.02);
}

.sx-subscribe-content {
  flex: 1;
  max-width: 600px;
}

.sx-subscribe-eyebrow {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--white-40);
  margin-bottom: 8px;
}

.sx-subscribe-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--white-100);
  margin: 0 0 10px 0;
}

.sx-subscribe-desc {
  font-size: 0.875rem;
  color: var(--white-60);
  line-height: 1.6;
  margin: 0;
}

.sx-subscribe-form {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-shrink: 0;
  width: 100%;
  max-width: 480px;
}

.sx-subscribe-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 14px 18px;
  color: var(--white-100);
  font-family: inherit;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sx-subscribe-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.sx-subscribe-btn {
  background: #ffffff;
  color: #1a1d24;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.sx-subscribe-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.2);
}

.sx-subscribe-btn:active {
  transform: translateY(0);
}

.sx-subscribe-btn.success {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* Responsive Newsletter Stack */
@media (max-width: 991px) {
  .sx-subscribe-card {
    flex-direction: column;
    align-items: stretch;
    padding: 30px;
    gap: 24px;
  }
  .sx-subscribe-content {
    max-width: 100%;
  }
  .sx-subscribe-form {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .sx-subscribe-form {
    flex-direction: column;
  }
  .sx-subscribe-btn {
    width: 100%;
  }
}

/* ── Pagination Controls ─────────────────────────────────────────────────── */
.sx-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 30px auto 10px auto;
  max-width: 1315px;
  padding: 0 24px;
}

.sx-page-btn {
  background: rgba(26, 29, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white-80);
  border-radius: 4px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 1.125rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sx-page-btn:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--white-100);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

.sx-page-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.sx-page-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  box-shadow: none;
}

.sx-page-info {
  font-family: 'D-DIN', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white-40);
  min-width: 140px;
  text-align: center;
  user-select: none;
}

#page-current {
  color: var(--white-90);
  font-weight: 800;
}

#page-total {
  color: var(--white-60);
}
