:root {
  --bg: #02050a;
  --panel: rgba(3, 11, 18, .76);
  --panel-strong: rgba(5, 16, 26, .94);
  --line: rgba(132, 249, 255, .2);
  --line-strong: rgba(157, 255, 255, .62);
  --text: #e9fbff;
  --muted: #8ea9b7;
  --cyan: #a8fbff;
  --cyan-hot: #35f8ff;
  --blue: #69adff;
  --violet: #b476ff;
  --amber: #ffd75a;
  --green: #20f0ad;
  --red: #ff4f5f;
  --ocean: #030b14;
  --land: rgba(64, 84, 101, .66);
  --active: #12d69c;
  --shadow: 0 28px 90px rgba(0, 0, 0, .58);
}

body.light {
  --bg: #eaf6fb;
  --panel: rgba(245, 253, 255, .78);
  --panel-strong: rgba(255, 255, 255, .96);
  --line: rgba(18, 125, 150, .22);
  --line-strong: rgba(20, 172, 198, .5);
  --text: #07121c;
  --muted: #586f80;
  --cyan: #07121c;
  --cyan-hot: #07121c;
  --blue: #07121c;
  --violet: #07121c;
  --green: #07121c;
  --ocean: #030b14;
  --land: rgba(64, 84, 101, .66);
  --shadow: 0 24px 68px rgba(45, 92, 118, .18);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 12%, rgba(35, 248, 255, .14), transparent 26%),
    radial-gradient(circle at 76% 9%, rgba(79, 80, 255, .15), transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(20, 160, 255, .13), transparent 42%),
    var(--bg);
  font-family: Manrope, Inter, Segoe UI, Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: .22;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.055) 0 1px, transparent 1px 5px),
    linear-gradient(90deg, rgba(67,244,255,.035) 1px, transparent 1px);
  background-size: 100% 5px, 44px 44px;
  mask-image: radial-gradient(circle at center, #000, transparent 88%);
}

.deck {
  width: min(1860px, calc(100vw - 22px));
  margin: 0 auto;
  padding: 12px 0 28px;
}

.command-bar,
.card,
.header-stat,
.ghost-button,
.side-toggle,
.filter {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(120, 255, 255, .035), rgba(0, 0, 0, .04)), var(--panel);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.08);
}

.command-bar {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 4px 12px;
  border-radius: 8px;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 22px 100%, 0 calc(100% - 22px));
}

.command-bar:before,
.card:before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(132, 249, 255, .07);
  clip-path: polygon(0 0, 82px 0, 82px 1px, 1px 1px, 1px 46px, 0 46px, 0 0, 100% 0, 100% 46px, calc(100% - 1px) 46px, calc(100% - 1px) 1px, calc(100% - 82px) 1px, calc(100% - 82px) 0);
}

.command-copy { min-width: 0; }

.eyebrow {
  color: var(--cyan-hot);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
}

h1, h2, p { margin: 0; }

.star-title {
  margin-top: 1px;
  font-family: Manrope, "Arial Narrow", Arial, sans-serif;
  font-size: clamp(17px, 1.3vw, 24px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: .055em;
  color: var(--cyan);
  font-weight: 800;
  -webkit-text-stroke: 0;
  text-shadow:
    0 0 10px rgba(168, 251, 255, .34),
    0 0 22px rgba(53, 248, 255, .16);
}

body.light .eyebrow,
body.light .star-title,
body.light .filter.active,
body.light .ghost-button.active,
body.light .ghost-button:hover,
body.light .status-pill,
body.light .status-pill.needs_review,
body.light .status-pill.ready_to_send,
body.light .status-pill.parsed,
body.light .status-pill.paused,
body.light .route-box svg text,
body.light .scope-line {
  color: #07121c;
  text-shadow: none;
}

.command-bar p {
  margin-top: 1px;
  color: var(--muted);
  max-width: 590px;
  font-size: 11px;
}

.command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.header-stats {
  display: flex;
  gap: 8px;
}

.header-stat {
  width: 118px;
  min-height: 38px;
  padding: 4px 10px;
  border-radius: 0;
  overflow: hidden;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.header-stat:after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.header-stat.cyan { --accent: var(--cyan-hot); }
.header-stat.blue { --accent: var(--blue); }
.header-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.header-stat strong {
  display: block;
  margin-top: 1px;
  font-size: 19px;
  line-height: 1;
}

.sync-stack {
  display: grid;
  gap: 4px;
  justify-items: end;
}

.sync-pill,
.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.035);
  padding: 4px 10px;
  font: inherit;
  font-size: 11px;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, color .18s ease, background .18s ease, transform .18s ease;
}

.sync-pill:hover,
.sync-pill:focus-visible {
  border-color: rgba(132, 249, 255, .86);
  box-shadow:
    0 0 0 1px rgba(132, 249, 255, .18),
    0 0 18px rgba(67, 244, 255, .28),
    inset 0 0 16px rgba(67, 244, 255, .08);
  color: #dffcff;
  outline: none;
}

.sync-pill:active {
  transform: translateY(1px);
}

.sync-pill.loading {
  cursor: progress;
  border-color: rgba(255, 220, 112, .78);
  box-shadow: 0 0 18px rgba(255, 220, 112, .18);
}

.sync-pill.success {
  border-color: rgba(42, 255, 190, .82);
  box-shadow: 0 0 18px rgba(42, 255, 190, .26);
}

.sync-pill.error {
  border-color: rgba(255, 82, 112, .86);
  box-shadow: 0 0 18px rgba(255, 82, 112, .24);
}

.ghost-button {
  border-radius: 0;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border .16s ease, box-shadow .16s ease, color .16s ease;
}

.ghost-button:hover,
.ghost-button.active {
  color: var(--cyan);
  border-color: var(--line-strong);
  box-shadow: 0 0 24px rgba(67,244,255,.16);
}

.side-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 172px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.side-toggle b { font-weight: 800; }

.side-track {
  position: relative;
  width: 42px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(168, 251, 255, .08);
}

.side-track i {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  transition: transform .2s ease, background .2s ease;
}

body.light .side-track i {
  transform: translateX(21px);
  background: var(--amber);
  box-shadow: 0 0 14px var(--amber);
}

.command-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 310px;
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}

.card {
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.sector-list,
.sector-panel {
  min-height: 720px;
  padding: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-title span {
  font-size: 16px;
  font-weight: 800;
}

.card-title b,
.panel-kicker {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.filter {
  padding: 7px 10px;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.filter.active {
  color: var(--cyan);
  border-color: var(--line-strong);
  background: rgba(67,244,255,.08);
}

.country-list {
  display: grid;
  gap: 8px;
  max-height: 615px;
  overflow: auto;
  padding-right: 4px;
}

.country-row {
  border: 1px solid transparent;
  padding: 10px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.country-row:hover,
.country-row.active {
  border-color: var(--line-strong);
  background: rgba(67,244,255,.08);
}

.country-row strong {
  display: block;
  font-size: 13px;
}

.country-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.holo-stage {
  min-height: 720px;
  padding: 16px 16px 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(67,244,255,.08), transparent 24%),
    radial-gradient(circle at 50% 66%, rgba(39,245,178,.09), transparent 22%),
    var(--panel);
}

.stage-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.stage-header h2 {
  margin-top: 4px;
  font-size: 21px;
}

.stage-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.globe-wrap {
  position: relative;
  min-height: 650px;
  margin-top: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(132, 249, 255, .08);
  border-radius: 10px;
  background:
    radial-gradient(circle at 24% 18%, rgba(78, 111, 255, .17), transparent 24%),
    radial-gradient(circle at 78% 30%, rgba(255, 215, 90, .08), transparent 18%),
    #030914;
}

.stellar-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: .9;
}

.rebel-mark {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(78vw, 850px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: .035;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 51%, transparent 0 20%, rgba(255,255,255,.85) 21% 23%, transparent 24%),
    conic-gradient(from 18deg, transparent 0 34deg, rgba(255,255,255,.9) 35deg 60deg, transparent 61deg 145deg, rgba(255,255,255,.9) 146deg 172deg, transparent 173deg 213deg, rgba(255,255,255,.9) 214deg 239deg, transparent 240deg 326deg, rgba(255,255,255,.9) 327deg 352deg, transparent 353deg);
  filter: blur(.2px);
}

.planet {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: .22;
  filter: blur(.2px);
}

.planet-a {
  left: 6%;
  top: 12%;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 35% 28%, #fff, #7cc7ff 20%, #11496a 68%, transparent 70%);
}
.planet-b {
  right: 9%;
  top: 17%;
  width: 46px;
  height: 46px;
  background: radial-gradient(circle at 35% 30%, #fff4bd, #d99139 34%, #58331c 72%);
}
.planet-c {
  left: 14%;
  bottom: 12%;
  width: 36px;
  height: 36px;
  background: radial-gradient(circle at 35% 28%, #d9fff7, #2ce1b2 35%, #064536 74%);
}
.planet-d {
  right: 18%;
  bottom: 10%;
  width: 118px;
  height: 42px;
  border: 2px solid rgba(168,251,255,.22);
  transform: rotate(-12deg);
}
.planet-d:before {
  content: "";
  position: absolute;
  left: 36px;
  top: -24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #fff, #86a0ff 28%, #20224a 76%);
}

#globe {
  position: relative;
  z-index: 1;
  width: min(100%, 1080px);
  height: min(72vh, 690px);
  min-height: 610px;
  display: block;
  filter: drop-shadow(0 0 40px rgba(67,244,255,.14));
  cursor: grab;
}

#globe:active { cursor: grabbing; }

.sphere {
  fill: var(--ocean);
  stroke: rgba(67,244,255,.34);
  stroke-width: 1.2;
}

.graticule {
  fill: none;
  stroke: rgba(112, 231, 255, .16);
  stroke-width: .55;
}

.country {
  fill: var(--land);
  stroke: rgba(206, 246, 255, .24);
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: .35;
  cursor: default;
}

.country.has-data {
  fill: rgba(34, 185, 134, .52);
  stroke: rgba(177, 255, 236, .42);
  cursor: pointer;
}

.country.sent { fill: rgba(25, 179, 130, .58); }
.country.ready_to_send { fill: rgba(255, 191, 87, .44); }
.country.needs_review { fill: rgba(255, 90, 111, .5); }
.country.parsed { fill: rgba(88, 166, 255, .5); }
.country.paused { fill: rgba(137, 151, 172, .42); }

.country.active,
.country.has-data:hover {
  fill: rgba(28, 226, 175, .94);
  stroke: #f1fffb;
  stroke-width: .9;
  filter: drop-shadow(0 0 11px rgba(67,244,255,.75));
}

.route {
  fill: none;
  stroke: var(--amber);
  stroke-width: 1.15;
  stroke-dasharray: 6 7;
  filter: drop-shadow(0 0 8px rgba(255,191,87,.7));
  animation: dash 1.8s linear infinite;
}

.pulse-dot {
  fill: #fff;
  stroke: var(--cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(67,244,255,.9));
}

body.light .globe-wrap {
  background:
    radial-gradient(circle at 50% 50%, rgba(31, 220, 190, .13), transparent 42%),
    radial-gradient(circle at 14% 18%, rgba(54, 96, 182, .34), transparent 18%),
    radial-gradient(circle at 86% 20%, rgba(220, 160, 80, .18), transparent 14%),
    #030914;
}

body.light .stellar-backdrop {
  opacity: .78;
}

body.light .sphere {
  fill: #030b14;
  stroke: rgba(67,244,255,.34);
}

body.light .graticule {
  stroke: rgba(112, 231, 255, .16);
}

body.light .country {
  fill: rgba(64, 84, 101, .66);
  stroke: rgba(206, 246, 255, .24);
}

body.light .country.has-data {
  fill: rgba(34, 185, 134, .52);
  stroke: rgba(177, 255, 236, .42);
}

body.light .country.sent { fill: rgba(25, 179, 130, .58); }
body.light .country.ready_to_send { fill: rgba(255, 191, 87, .44); }
body.light .country.needs_review { fill: rgba(255, 90, 111, .5); }
body.light .country.parsed { fill: rgba(88, 166, 255, .5); }
body.light .country.paused { fill: rgba(137, 151, 172, .42); }

body.light .country.active,
body.light .country.has-data:hover {
  fill: rgba(28, 226, 175, .94);
  stroke: #f1fffb;
}

body.light .pulse-dot {
  fill: #fff;
  stroke: #35f8ff;
}

@keyframes dash { to { stroke-dashoffset: -26; } }

.reticle,
.orbit {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(67,244,255,.17);
}

.reticle {
  width: min(60vw, 610px);
  height: min(60vw, 610px);
  max-height: 610px;
  box-shadow:
    inset 0 0 0 18px rgba(67,244,255,.015),
    inset 0 0 0 82px rgba(67,244,255,.012),
    0 0 70px rgba(67,244,255,.08);
}

.reticle:before {
  content: "";
  position: absolute;
  left: 50%;
  top: -7%;
  width: 2px;
  height: 114%;
  background: linear-gradient(transparent, rgba(67,244,255,.34), transparent);
  animation: scan 4.8s ease-in-out infinite;
}

@keyframes scan {
  0%, 100% { transform: translateX(-50%) rotate(0deg); opacity: .08; }
  50% { transform: translateX(-50%) rotate(180deg); opacity: .62; }
}

.orbit-a {
  width: min(76vw, 800px);
  height: min(29vw, 300px);
  transform: rotate(-12deg);
}

.orbit-b {
  width: min(72vw, 720px);
  height: min(22vw, 220px);
  transform: rotate(24deg);
  border-color: rgba(180,118,255,.15);
}

.tooltip {
  position: absolute;
  z-index: 5;
  min-width: 220px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(3, 10, 20, .9);
  color: var(--text);
  box-shadow: 0 18px 48px rgba(0,0,0,.45), 0 0 34px rgba(67,244,255,.12);
  pointer-events: none;
}

body.light .tooltip { background: rgba(255,255,255,.94); }
.tooltip strong { display: block; font-size: 15px; }
.tooltip span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.sector-panel h2 {
  margin: 8px 0;
  font-size: 28px;
  line-height: 1;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  color: var(--green);
  padding: 8px 11px;
  background: rgba(39,245,178,.08);
  font-size: 12px;
  font-weight: 800;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.status-pill.needs_review { color: var(--red); background: rgba(255,90,111,.1); }
.status-pill.ready_to_send { color: var(--amber); background: rgba(255,191,87,.1); }
.status-pill.parsed { color: var(--blue); background: rgba(88,166,255,.1); }
.status-pill.paused { color: var(--muted); background: rgba(145,166,189,.1); }

.readouts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0;
}

.readouts div,
.route-box {
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(255,255,255,.035);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.readouts b {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.readouts span,
.route-box span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

#routeScope {
  width: 100%;
  height: 90px;
  margin-top: 8px;
}

.scope-line {
  stroke: var(--cyan);
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 4 6;
  animation: dash 1.4s linear infinite;
}

.scope-node {
  fill: var(--panel-strong);
  stroke: var(--cyan);
  stroke-width: 2;
}

body.light .scope-line,
body.light .scope-node {
  stroke: #07121c;
}

.mission-log {
  margin-top: 14px;
  padding: 16px;
}

.campaign-log {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.campaign {
  border: 1px solid var(--line);
  padding: 13px;
  background: rgba(255,255,255,.035);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.campaign strong {
  display: block;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.campaign small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 1280px) {
  .command-bar { grid-template-columns: 1fr; }
  .command-actions { justify-content: space-between; }
  .command-grid { grid-template-columns: 1fr; }
  .sector-list, .sector-panel, .holo-stage { min-height: auto; }
  .country-list { max-height: 240px; }
  .campaign-log { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
  .deck { width: min(100vw - 14px, 1860px); padding-top: 8px; }
  .command-actions { align-items: stretch; flex-direction: column; }
  .header-stat { flex: 1; width: auto; }
  .sync-stack { justify-items: stretch; }
  .side-toggle { width: 100%; justify-content: center; }
  .campaign-log { grid-template-columns: 1fr; }
  #globe { min-height: 460px; }
  .globe-wrap { min-height: 500px; }
}

.crm-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.metric-card {
  position: relative;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(120, 255, 255, .055), rgba(0, 0, 0, .02)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.08);
  overflow: hidden;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.metric-card:before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 2px;
  background: var(--accent, var(--cyan-hot));
  box-shadow: 0 0 18px var(--accent, var(--cyan-hot));
}

.metric-card.success { --accent: var(--green); }
.metric-card.offer { --accent: var(--amber); }
.metric-card.review { --accent: var(--violet); }

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(24px, 2.3vw, 42px);
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.command-grid {
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.holo-stage {
  min-height: calc(100vh - 360px);
  padding-bottom: 16px;
}

.globe-wrap {
  min-height: min(72vh, 760px);
}

#globe {
  height: min(72vh, 740px);
  min-height: 570px;
}

.sync-note span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.sync-note strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.crm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr) minmax(260px, .7fr);
  gap: 14px;
  margin-top: 14px;
}

.pipeline-card,
.ideas-card,
.sites-card,
.sync-note {
  padding: 16px;
}

.pipeline-list {
  display: grid;
  gap: 9px;
}

.pipeline-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  overflow: hidden;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.pipeline-row i {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--bar);
  height: 2px;
  background: var(--cyan-hot);
  box-shadow: 0 0 16px var(--cyan-hot);
}

.pipeline-row.samples_sent i { background: var(--blue); box-shadow: 0 0 16px var(--blue); }
.pipeline-row.won i { background: var(--green); box-shadow: 0 0 16px var(--green); }
.pipeline-row.offer_received i { background: var(--amber); box-shadow: 0 0 16px var(--amber); }
.pipeline-row.order_sent_unpaid i { background: var(--violet); box-shadow: 0 0 16px var(--violet); }
.pipeline-row.lost i { background: var(--red); box-shadow: 0 0 16px var(--red); }

.pipeline-row strong,
.site-link strong {
  display: block;
  font-size: 14px;
}

.pipeline-row small,
.pipeline-values span,
.site-link small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.pipeline-values {
  text-align: right;
  white-space: nowrap;
}

.pipeline-values b {
  display: block;
  font-size: 24px;
}

.insight-list {
  display: grid;
  gap: 8px;
}

.insight-item {
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.035);
  font-size: 13px;
  line-height: 1.35;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.site-links {
  display: grid;
  gap: 7px;
}

.site-link {
  display: block;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(67,244,255,.08), transparent),
    rgba(255,255,255,.035);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: border .16s ease, transform .16s ease, background .16s ease;
}

.site-link:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  background:
    linear-gradient(90deg, rgba(67,244,255,.15), transparent),
    rgba(255,255,255,.055);
}

.site-link.pending {
  cursor: default;
  opacity: .76;
}

.sync-note {
  margin-top: 14px;
}

@media (max-width: 1280px) {
  .crm-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .crm-overview { grid-template-columns: 1fr; }
  .stage-header { align-items: stretch; flex-direction: column; }
  .stage-controls { justify-content: flex-start; }
  .pipeline-row { grid-template-columns: 1fr; }
  .pipeline-values { text-align: left; }
}

.command-actions {
  align-items: center;
}

.command-actions .header-stats {
  display: flex;
  gap: 8px;
}

.command-actions .header-stat {
  width: 124px;
  min-height: 38px;
}

.command-actions .header-stat strong {
  margin-top: 1px;
  font-size: 20px;
}

.command-grid {
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(250px, 300px);
  align-items: stretch;
}

.deal-rail,
.sites-card {
  min-height: calc(100vh - 88px);
  padding: 16px;
}

.deal-rail .card-title {
  margin-bottom: 10px;
}

.period-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.period-panel small {
  grid-column: 1 / -1;
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.period-chip {
  min-height: 25px;
  border: 1px solid rgba(132, 249, 255, .18);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, color .16s ease;
}

.period-chip:hover,
.period-chip.active {
  border-color: rgba(132, 249, 255, .76);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(67,244,255,.16);
}

.deal-rail .pipeline-list {
  display: grid;
  gap: 8px;
}

.deal-rail .pipeline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  grid-template-rows: minmax(22px, auto) minmax(29px, auto) 25px;
  grid-template-areas:
    "note amount"
    "title amount"
    "count amount";
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  align-content: center;
  box-sizing: border-box;
  height: 98px;
  min-height: 98px;
  width: 100%;
  padding: 8px 12px 8px 13px;
  clip-path: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 14%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(160deg, rgba(67,244,255,.07), rgba(255,255,255,.025)),
    rgba(255,255,255,.035);
}

.deal-rail .pipeline-row:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--cyan-hot);
  box-shadow: 0 0 18px var(--cyan-hot);
}

.deal-rail .pipeline-row.samples_sent:before { background: var(--blue); box-shadow: 0 0 18px var(--blue); }
.deal-rail .pipeline-row.won:before { background: var(--green); box-shadow: 0 0 18px var(--green); }
.deal-rail .pipeline-row.offer_received:before { background: var(--amber); box-shadow: 0 0 18px var(--amber); }
.deal-rail .pipeline-row.order_sent_unpaid:before { background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.deal-rail .pipeline-row.lost:before { background: var(--red); box-shadow: 0 0 18px var(--red); }

.deal-rail .pipeline-row > span {
  grid-area: note;
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.24;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.deal-rail .pipeline-row > strong {
  grid-area: title;
  min-width: 0;
  overflow: hidden;
  margin-top: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.16;
}

.deal-rail .pipeline-values {
  grid-area: count;
  display: flex;
  align-items: end;
  gap: 6px;
  min-width: 0;
  min-height: 25px;
  margin-top: 1px;
  overflow: hidden;
  text-align: left;
}

.deal-rail .pipeline-values b {
  font-size: 20px;
  line-height: 1;
}

.deal-rail .pipeline-values small {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.deal-rail .pipeline-row em {
  grid-area: amount;
  justify-self: end;
  align-self: center;
  display: grid;
  gap: 1px;
  width: 100%;
  min-height: 54px;
  margin-top: 0;
  color: var(--text);
  font-style: normal;
  font-weight: 800;
  line-height: 1.02;
  text-align: right;
  white-space: nowrap;
}

.deal-rail .amount-split {
  display: grid;
  gap: 1px;
}

.deal-rail .amount-split span {
  display: grid;
  grid-template-columns: 44px 1fr;
  justify-content: stretch;
  column-gap: 6px;
  font-size: 15px;
  line-height: 1.08;
}

.deal-rail .amount-split b {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  transform: translateY(1px);
}

.deal-rail .amount-split .total {
  margin-top: 1px;
  padding-top: 1px;
  border-top: 1px solid rgba(132,249,255,.12);
  color: var(--cyan);
  font-size: 14px;
}

.pipeline-summary-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-column: 1 / -1;
  gap: 8px 10px;
  align-items: center;
  margin-top: 2px;
  padding: 9px 2px 0;
  border-top: 1px solid rgba(132,249,255,.16);
}

.pipeline-summary-line > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pipeline-summary-line > div {
  display: flex;
  align-items: end;
  gap: 6px;
  color: var(--muted);
}

.pipeline-summary-line > div b {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.pipeline-summary-line > div small {
  margin-bottom: 1px;
  font-size: 10px;
}

.pipeline-summary-line .amount-split {
  justify-self: end;
}

.pipeline-summary-line .amount-split span {
  font-size: 16px;
  font-weight: 800;
}

.pipeline-total {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "title amount"
    "count amount";
  gap: 4px 10px;
  align-items: center;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(132,249,255,.2);
  border-radius: 8px;
  background: rgba(67,244,255,.045);
}

.pipeline-total > strong {
  grid-area: title;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pipeline-total > div {
  grid-area: count;
  display: flex;
  align-items: end;
  gap: 6px;
  color: var(--muted);
}

.pipeline-total > div b {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.pipeline-total > div small {
  margin-bottom: 1px;
  font-size: 10px;
}

.pipeline-total .amount-split {
  grid-area: amount;
  justify-self: end;
}

.pipeline-total .amount-split span {
  font-size: 18px;
  font-weight: 800;
}

.deal-rail .pipeline-row i {
  height: 3px;
}

.holo-stage {
  min-height: calc(100vh - 88px);
}

.analytics-stage {
  min-height: calc(100vh - 88px);
  padding: 10px;
  overflow: hidden;
}

.analytics-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid rgba(132,249,255,.1);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 12%, rgba(67,244,255,.12), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(137,123,255,.1), transparent 26%),
    linear-gradient(135deg, rgba(5, 16, 25, .72), rgba(2, 8, 14, .92));
  box-shadow: inset 0 0 50px rgba(67,244,255,.035);
  overflow: hidden;
}

.analytics-shell:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 49%, rgba(67,244,255,.08) 50%, transparent 51%),
    linear-gradient(180deg, transparent 0 49%, rgba(132,249,255,.045) 50%, transparent 51%);
  background-size: 90px 90px;
  opacity: .22;
  pointer-events: none;
}

.analytics-head,
.analytics-center {
  position: relative;
  z-index: 1;
}

.analytics-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.analytics-head h2 {
  margin-top: 10px;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.05;
}

.analytics-sync {
  display: grid;
  gap: 6px;
  min-width: 220px;
  justify-items: end;
  color: var(--muted);
  font-size: 11px;
}

.analytics-sync span,
.analytics-sync b {
  display: inline-flex;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid rgba(132,249,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  color: var(--text);
  white-space: nowrap;
}

.analytics-sync b {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.analytics-center {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.analytics-kpi,
.analytics-panel,
.analytics-site-row {
  border: 1px solid rgba(132,249,255,.14);
  background:
    radial-gradient(circle at 100% 0, rgba(67,244,255,.12), transparent 26%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.022));
}

.analytics-kpi {
  min-height: 82px;
  padding: 10px 12px;
  overflow: hidden;
}

.analytics-kpi span,
.analytics-panel-title b,
.analytics-site-row span,
.analytics-site-head {
  color: var(--muted);
}

.analytics-kpi span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.analytics-kpi strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1;
}

.analytics-kpi small {
  display: block;
  margin-top: 7px;
  color: var(--cyan);
  font-size: 10px;
  line-height: 1.2;
}

.analytics-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(330px, .92fr);
  gap: 12px;
  min-height: 0;
}

.analytics-panel {
  min-height: 0;
  padding: 14px;
  overflow: hidden;
}

.analytics-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.analytics-panel-title span {
  min-width: 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
}

.analytics-panel-title b {
  flex-shrink: 0;
  max-width: 112px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.analytics-funnel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.analytics-funnel article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 116px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid rgba(132,249,255,.12);
  background: rgba(1, 10, 18, .42);
}

.analytics-funnel small {
  display: block;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.analytics-funnel strong {
  display: block;
  margin-top: 0;
  color: var(--text);
  font-size: clamp(22px, 2.15vw, 31px);
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.analytics-funnel span,
.analytics-funnel em {
  display: block;
  margin-top: 0;
  font-style: normal;
  line-height: 1.25;
}

.analytics-funnel span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
}

.analytics-funnel em {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  margin-top: 3px;
}

.analytics-pulse-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.analytics-pulse-grid article {
  position: relative;
  min-height: 118px;
  padding: 12px;
  border: 1px solid rgba(132,249,255,.14);
  background:
    radial-gradient(circle at 96% 0, rgba(67,244,255,.13), transparent 30%),
    rgba(1, 10, 18, .42);
  overflow: hidden;
}

.analytics-pulse-grid article:before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--cyan);
  opacity: .9;
}

.analytics-pulse-grid article.green:before { background: var(--green); }
.analytics-pulse-grid article.red:before { background: var(--red); }
.analytics-pulse-grid article.blue:before { background: var(--blue); }

.analytics-pulse-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.25;
  text-transform: uppercase;
}

.analytics-pulse-grid strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1;
  white-space: nowrap;
}

.analytics-pulse-grid small {
  display: block;
  margin-top: 9px;
  color: var(--cyan);
  font-size: 10px;
  line-height: 1.3;
}

.analytics-flow {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(132,249,255,.12);
  background: rgba(67,244,255,.035);
}

.analytics-flow span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.analytics-flow i {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, rgba(132,249,255,.12), rgba(132,249,255,.56));
}

.analytics-sites-panel {
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-self: start;
  max-height: 318px;
}

.analytics-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.analytics-site-head,
.analytics-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(48px, 58px));
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.analytics-site-head {
  padding: 0 6px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.analytics-site-list {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 0;
  height: auto;
  max-height: 184px;
  padding-right: 4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(132, 249, 255, .4) rgba(255,255,255,.04);
  scrollbar-width: thin;
}

.analytics-site-list::-webkit-scrollbar {
  width: 6px;
}

.analytics-site-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(132, 249, 255, .34);
}

.analytics-site-row {
  min-height: 58px;
  padding: 9px 8px;
}

.analytics-site-row strong,
.analytics-site-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analytics-site-row strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.18;
  white-space: normal;
}

.analytics-site-row span {
  margin-top: 3px;
  font-size: 10px;
  white-space: nowrap;
}

.analytics-site-row b,
.analytics-site-row i {
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
  min-width: 0;
}

.analytics-site-row b small {
  display: none;
}

.analytics-site-row i {
  color: var(--cyan);
}

.sites-card .card-title {
  margin-bottom: 12px;
}

.sites-card {
  display: grid;
  grid-template-rows: auto auto;
  align-self: start;
  min-height: auto;
  max-height: 344px;
  overflow: hidden;
}

.site-links {
  align-content: start;
  grid-template-columns: 1fr;
  min-height: 0;
  height: auto;
  max-height: 286px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: rgba(132, 249, 255, .4) rgba(255,255,255,.04);
  scrollbar-width: thin;
}

.site-links::-webkit-scrollbar {
  width: 6px;
}

.site-links::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}

.site-links::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(132, 249, 255, .34);
}

.site-link {
  position: relative;
  min-height: 44px;
  padding: 5px 58px 5px 10px;
  flex-shrink: 0;
  overflow: hidden;
}

.site-link:before {
  content: "";
  position: absolute;
  right: -18px;
  top: -24px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(132, 249, 255, .2);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67,244,255,.13), transparent 62%);
}

.site-link strong {
  position: relative;
  font-size: 11px;
  line-height: 1.15;
}

.site-link small {
  position: relative;
  min-height: 0;
  margin-top: 1px;
  font-size: 9px;
  line-height: 1.15;
}

.site-link span {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  margin-top: 3px;
  padding: 2px 6px;
  border: 1px solid rgba(132, 249, 255, .18);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.site-logo {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(132, 249, 255, .34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.1), transparent 22%),
    rgba(6, 22, 29, .72);
  box-shadow:
    inset 0 0 10px rgba(67,244,255,.08),
    0 0 20px rgba(67,244,255,.08);
  overflow: hidden;
}

.site-logo img {
  position: relative;
  z-index: 2;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 50%;
  image-rendering: auto;
  filter: saturate(1.08) contrast(1.04);
}

.site-logo i {
  position: absolute;
  z-index: 1;
  color: var(--cyan);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.site-logo:after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid rgba(67,244,255,.18);
  animation: scan 4.8s ease-in-out infinite;
}

@media (max-width: 1280px) {
  .command-grid {
    grid-template-columns: 1fr;
  }

  .deal-rail,
  .holo-stage,
  .analytics-stage {
    min-height: auto;
  }

  .deal-rail .pipeline-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .analytics-main-grid {
    grid-template-columns: 1fr;
  }

  .analytics-site-list {
    max-height: 420px;
  }
}

@media (max-width: 780px) {
  .command-actions .header-stats {
    width: 100%;
  }

  .command-actions .header-stat {
    width: auto;
  }

  .deal-rail .pipeline-list,
  .site-links {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1101px) {
  .command-grid {
    grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(250px, 300px);
  }

  .deal-rail,
  .holo-stage,
  .analytics-stage {
    min-height: calc(100vh - 88px);
  }

  .sites-card {
    min-height: auto;
  }

  .deal-rail .pipeline-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .command-grid {
    grid-template-columns: 1fr;
  }

  .deal-rail,
  .sites-card,
  .holo-stage,
  .analytics-stage {
    min-height: auto;
  }

  .deal-rail .pipeline-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-links {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .command-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .sync-stack {
    justify-items: stretch;
  }

  .side-toggle {
    justify-content: center;
  }

  .analytics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-funnel {
    grid-template-columns: 1fr;
  }

  .analytics-flow {
    grid-template-columns: 1fr;
  }

  .analytics-flow i {
    display: none;
  }
}

@media (max-width: 780px) {
  .deck {
    width: calc(100vw - 28px);
  }

  .command-bar,
  .card,
  .deal-rail .pipeline-row,
  .site-link {
    max-width: 100%;
  }

  .analytics-shell {
    padding: 14px;
  }

  .analytics-head {
    flex-direction: column;
  }

  .analytics-sync {
    width: 100%;
    min-width: 0;
    justify-items: stretch;
  }

  .analytics-sync span,
  .analytics-sync b {
    justify-content: center;
    white-space: normal;
  }

  .analytics-kpi-grid,
  .analytics-funnel {
    grid-template-columns: 1fr;
  }

  .analytics-site-head {
    display: none;
  }

  .analytics-site-row {
    grid-template-columns: minmax(0, 1fr) repeat(4, auto);
  }

  .analytics-funnel article {
    grid-template-columns: 36px minmax(0, 1fr) 88px;
    gap: 8px;
  }

  .analytics-site-list {
    max-height: none;
  }
}

.holo-stage {
  padding: 10px;
}

.holo-stage .stage-header {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 20px;
  z-index: 6;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.holo-stage .stage-controls {
  pointer-events: auto;
}

.holo-stage .globe-wrap {
  margin-top: 0;
}

@media (max-width: 780px) {
  .holo-stage .stage-header {
    left: 18px;
    right: 18px;
    top: 16px;
  }
}

@media (max-width: 780px) {
  .deal-rail .pipeline-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .deal-rail .pipeline-row {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 64px;
  }

  .deal-rail .pipeline-row > span {
    font-size: 8px;
    letter-spacing: .11em;
  }

  .deal-rail .pipeline-row > strong {
    font-size: 14px;
    line-height: 1.16;
  }

  .deal-rail .pipeline-values b {
    font-size: 21px;
  }

  .deal-rail .pipeline-row em {
    font-size: 19px;
    max-width: 100%;
    white-space: nowrap;
  }

  .site-links {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .site-link {
    min-height: 62px;
    padding: 10px 66px 10px 12px;
  }

  .site-link strong {
    font-size: 13px;
    line-height: 1.2;
  }

  .site-link small {
    font-size: 11px;
  }

  .site-link span {
    max-width: calc(100% - 4px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
  }

  .site-logo {
    right: 12px;
  }
}

.date-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 6, 14, .58);
  backdrop-filter: blur(10px);
}

.date-modal[hidden] {
  display: none;
}

.date-dialog {
  width: min(420px, 100%);
  padding: 14px;
  border: 1px solid rgba(132,249,255,.24);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.035)),
    rgba(8, 14, 23, .92);
  box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.08);
}

.date-dialog-head,
.range-tabs,
.date-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.date-dialog-head button,
.range-tabs button,
.date-apply {
  border: 1px solid rgba(132,249,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.date-dialog-head button {
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
}

.range-tabs {
  margin: 12px 0 8px;
  justify-content: center;
}

.range-tabs button {
  min-width: 72px;
  padding: 6px 14px;
  color: var(--muted);
}

.range-tabs button.active {
  border-color: rgba(132,249,255,.72);
  color: var(--cyan);
}

.wheel-picker {
  --wheel-item-height: 44px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  height: 236px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(8,14,23,.86), transparent 28%, transparent 72%, rgba(8,14,23,.86)),
    rgba(255,255,255,.035);
}

.wheel-highlight {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 50%;
  height: var(--wheel-item-height);
  transform: translateY(-50%);
  border-radius: 12px;
  background: rgba(255,255,255,.09);
  border-top: 1px solid rgba(255,255,255,.16);
  border-bottom: 1px solid rgba(0,0,0,.32);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(132,249,255,.08);
  pointer-events: none;
}

.wheel-column {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  padding: calc((236px - var(--wheel-item-height)) / 2) 0;
  scroll-padding-block: calc((236px - var(--wheel-item-height)) / 2);
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 26%, #000 74%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 26%, #000 74%, transparent 100%);
}

.wheel-column::-webkit-scrollbar {
  display: none;
}

.wheel-item {
  display: block;
  width: 100%;
  height: var(--wheel-item-height);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  border: 0;
  background: transparent;
  color: rgba(230,244,255,.42);
  font: inherit;
  font-size: 28px;
  line-height: var(--wheel-item-height);
  cursor: pointer;
  transition: color .14s ease, transform .14s ease, opacity .14s ease;
}

.wheel-item.active {
  color: var(--text);
  transform: scale(1.06);
}

.date-preview {
  justify-content: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.date-preview span {
  color: var(--text);
  font-weight: 700;
}

.date-apply {
  width: 100%;
  min-height: 42px;
  border-color: rgba(132,249,255,.42);
  color: var(--cyan);
}

@media (max-width: 780px) {
  .period-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deal-rail .amount-split span {
    font-size: 18px;
  }

  .pipeline-total {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .wheel-item {
    font-size: 24px;
  }
}
