* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

:root {
  --ink: #17202a;
  --ink-2: #2f3b47;
  --muted: #697586;
  --line: #dce3ea;
  --line-strong: #c9d4df;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef3f7;
  --canopy: #15805d;
  --canopy-soft: #e7f6ef;
  --rater: #1f6fb7;
  --rater-soft: #e8f1fb;
  --carrier: #a93445;
  --carrier-soft: #f9e9ed;
  --good: #138a52;
  --good-soft: #e5f7ed;
  --warn: #b36a05;
  --warn-soft: #fff2d6;
  --danger: #be3144;
  --danger-soft: #fae8ec;
  --gold: #c29b42;
  --shadow: 0 16px 45px rgba(32, 45, 60, 0.12);
  --radius: 8px;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(238, 243, 247, 0.9), rgba(247, 249, 252, 0.95)),
    #f7f9fc;
}

body {
  overflow: visible;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  color: #f8fafc;
  background: linear-gradient(90deg, #15202b 0%, #233244 58%, #192631 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fafc;
  color: #182230;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(23, 32, 42, 0.14);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.brand-subtitle {
  margin-top: 4px;
  color: rgba(248, 250, 252, 0.68);
  font-size: 12px;
  white-space: nowrap;
}

.top-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  gap: 10px;
  min-width: 0;
}

.top-metric {
  min-width: 0;
  padding: 7px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.metric-value {
  display: block;
  color: #ffffff;
  font-weight: 850;
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-value.good,
.metric-value.money {
  color: #7ee2ab;
}

.metric-value.warn {
  color: #ffd166;
}

.metric-label {
  display: block;
  margin-top: 5px;
  color: rgba(248, 250, 252, 0.62);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pill {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(248, 250, 252, 0.82);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #62d394;
  box-shadow: 0 0 0 4px rgba(98, 211, 148, 0.16);
}

.primary-btn,
.ghost-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  color: #ffffff;
  background: linear-gradient(180deg, #14825e, #0f694d);
  box-shadow: 0 8px 18px rgba(13, 105, 76, 0.26);
}

.ghost-btn {
  color: rgba(248, 250, 252, 0.82);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.ghost-btn.dark {
  color: #dbe4ee;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  overflow: visible;
}

.command-band {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(560px, 1.6fr);
  gap: 14px;
  min-height: 176px;
}

.operating-line,
.flow-map,
.queue-panel,
.selected-lead,
.market-panel,
.activity-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.operating-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px;
  gap: 18px;
  padding: 20px;
}

.section-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-size: 27px;
  line-height: 1.12;
  font-weight: 850;
  color: #15202b;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 850;
}

.throughput-stack {
  display: grid;
  gap: 8px;
}

.throughput-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.throughput-item span {
  display: block;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.throughput-item label {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.flow-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr) 58px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 14px;
}

.flow-node {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.flow-node.canopy {
  border-color: rgba(21, 128, 93, 0.24);
}

.flow-node.rater {
  border-color: rgba(31, 111, 183, 0.24);
}

.flow-node.carrier {
  border-color: rgba(169, 52, 69, 0.24);
}

.node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12px;
}

.node-top span {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.canopy .node-top span {
  background: var(--canopy);
}

.rater .node-top span {
  background: var(--rater);
}

.carrier .node-top span {
  background: var(--carrier);
}

.node-value {
  margin-top: 18px;
  font-size: 44px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.node-foot {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.node-bar {
  height: 7px;
  margin-top: 15px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.node-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.canopy .node-bar span {
  background: var(--canopy);
}

.rater .node-bar span {
  background: var(--rater);
}

.carrier .node-bar span {
  background: var(--carrier);
}

.flow-rail {
  display: grid;
  place-items: center;
}

.flow-rail span {
  width: calc(100% - 16px);
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--line-strong), var(--gold), var(--line-strong));
  position: relative;
  overflow: hidden;
}

.flow-rail span::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 36%;
  background: rgba(255, 255, 255, 0.8);
  animation: railMove 1.8s linear infinite;
}

@keyframes railMove {
  from { transform: translateX(-100%); }
  to { transform: translateX(320%); }
}

.main-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(650px, 1fr) 390px;
  gap: 14px;
}

.queue-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  align-self: start;
  position: sticky;
  top: 14px;
}

.panel-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  min-height: 58px;
  padding: 12px 14px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segmented button {
  height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(32, 45, 60, 0.13);
}

.segmented span {
  margin-left: 4px;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.search-wrap {
  height: 38px;
  width: 230px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.search-wrap span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.search-wrap input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.queue-table {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.queue-head,
.lead-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) 92px minmax(275px, 1.35fr) minmax(128px, 0.8fr) 90px 118px;
  align-items: center;
}

.queue-head {
  min-height: 36px;
  padding-right: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfe;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.queue-head div {
  padding: 0 12px;
  white-space: nowrap;
}

.queue-body {
  /* Bounded so this column scrolls internally; the side panel can still grow */
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #bac7d4 transparent;
}

.lead-row {
  width: 100%;
  min-height: 58px;
  padding: 0;
  color: inherit;
  text-align: left;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.lead-row:hover,
.lead-row.selected {
  background: #f6faff;
}

.lead-row.selected {
  box-shadow: inset 3px 0 0 var(--rater);
}

.lead-cell {
  min-width: 0;
  padding: 0 12px;
  color: var(--ink-2);
  font-size: 13px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #2f6c8f;
  font-size: 12px;
  font-weight: 900;
}

.lead-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.path {
  display: flex;
  align-items: center;
  gap: 6px;
}

.path-step {
  min-width: 62px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 850;
}

.path-line {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--line-strong);
}

.path-step.done.canopy,
.path-step.active.canopy {
  color: var(--canopy);
  background: var(--canopy-soft);
}

.path-step.done.rater,
.path-step.active.rater {
  color: var(--rater);
  background: var(--rater-soft);
}

.path-step.done.carrier,
.path-step.active.carrier {
  color: var(--carrier);
  background: var(--carrier-soft);
}

.path-step.active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.carrier,
.quote {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote {
  color: var(--ink);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.status {
  display: flex;
  justify-content: flex-end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.status-pill.queued {
  color: var(--muted);
  background: var(--surface-3);
}

.status-pill.working {
  color: var(--rater);
  background: var(--rater-soft);
}

.status-pill.bound {
  color: var(--good);
  background: var(--good-soft);
}

.status-pill.exception {
  color: var(--warn);
  background: var(--warn-soft);
}

.status-pill.failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.side-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.selected-lead,
.market-panel,
.activity-panel {
  min-width: 0;
  overflow: hidden;
}

.detail-status {
  align-self: flex-start;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--rater);
  background: var(--rater-soft);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.detail-status.bound {
  color: var(--good);
  background: var(--good-soft);
}

.detail-status.exception {
  color: var(--warn);
  background: var(--warn-soft);
}

.detail-status.queued {
  color: var(--muted);
  background: var(--surface-3);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}

.detail-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-grid label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.carrier-strip {
  display: grid;
  gap: 7px;
  padding: 0 14px 14px;
}

.strip-row,
.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.strip-row strong,
.market-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip-row span,
.market-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.strip-row.best,
.market-row.best {
  border-color: rgba(19, 138, 82, 0.3);
  background: var(--good-soft);
}

.carrier-list {
  display: grid;
  gap: 7px;
  padding: 14px;
}

.activity-panel {
  display: flex;
  flex-direction: column;
}

.feed-count {
  min-width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.feed-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px;
  overflow: auto;
}

.feed-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
}

.feed-time {
  color: var(--muted);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.feed-text {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item.good {
  border-color: rgba(19, 138, 82, 0.26);
  background: var(--good-soft);
}

.feed-item.warn {
  border-color: rgba(179, 106, 5, 0.26);
  background: var(--warn-soft);
}

.feed-item.danger {
  border-color: rgba(190, 49, 68, 0.26);
  background: var(--danger-soft);
}

.automation-theater {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(15, 23, 33, 0.72);
  backdrop-filter: blur(8px);
}

.automation-theater.hidden {
  display: none;
}

.theater-shell {
  width: min(1180px, 100%);
  height: min(760px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
  color: #eef4f8;
  background: #15202b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 80px rgba(10, 16, 23, 0.38);
}

.theater-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.theater-head h2 {
  color: #ffffff;
}

.theater-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.browser-chrome {
  padding: 10px 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: #1c2a37;
}

.browser-tabs {
  display: flex;
  gap: 4px;
}

.browser-tab {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 8px 8px 0 0;
  color: rgba(238, 244, 248, 0.68);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  opacity: 0.46;
}

.browser-tab span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.browser-tab.active {
  color: #15202b;
  background: #f8fafc;
  opacity: 1;
}

.browser-tab.opened {
  opacity: 1;
}

.address-bar {
  height: 36px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--ink);
  background: #f8fafc;
}

.lock-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--good);
}

.address-bar strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-bar em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.theater-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  padding: 14px;
}

.browser-screen {
  position: relative;
  min-width: 0;
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.automation-page {
  position: absolute;
  inset: 0;
  display: none;
  padding: 22px;
  color: var(--ink);
  background: #ffffff;
}

.automation-page.active {
  display: block;
  animation: pageIn 0.24s ease;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-top strong {
  font-size: 22px;
}

.page-badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--rater);
  background: var(--rater-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mock-form {
  display: grid;
  gap: 10px;
  max-width: 640px;
  margin-top: 26px;
}

.mock-form label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.typing-line {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 800;
}

.typing-line.active {
  box-shadow: inset 0 0 0 1px var(--canopy);
}

.document-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.document-stack span {
  min-height: 70px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 850;
}

.document-stack span.done {
  color: var(--canopy);
  background: var(--canopy-soft);
  border-color: rgba(21, 128, 93, 0.28);
}

.quote-board {
  display: grid;
  gap: 10px;
  max-width: 680px;
  margin-top: 26px;
}

.theater-quote {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.theater-quote.best {
  background: var(--good-soft);
  border-color: rgba(19, 138, 82, 0.3);
}

.theater-quote span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--rater);
  font-size: 12px;
  font-weight: 900;
}

.theater-quote strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theater-quote em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.portal-checklist {
  display: grid;
  gap: 10px;
  max-width: 620px;
  margin-top: 26px;
}

.portal-checklist div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 850;
}

.portal-checklist span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--line-strong);
}

.portal-checklist div.done span {
  background: var(--good);
}

.premium-card {
  max-width: 300px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--good-soft);
  border: 1px solid rgba(19, 138, 82, 0.28);
}

.premium-card label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.premium-card strong {
  display: block;
  margin-top: 8px;
  font-size: 36px;
  line-height: 1;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.premium-card span {
  display: block;
  margin-top: 8px;
  color: var(--good);
  font-size: 13px;
  font-weight: 900;
}

.automation-timeline {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #101923;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.timeline-title {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(238, 244, 248, 0.72);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.automation-steps {
  height: calc(100% - 45px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  overflow: auto;
}

.auto-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border-radius: 8px;
  color: rgba(238, 244, 248, 0.72);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
}

.auto-step span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #15202b;
  background: #dbe4ee;
  font-size: 10px;
  font-weight: 950;
}

.auto-step.active {
  color: #ffffff;
  background: rgba(31, 111, 183, 0.32);
}

.auto-step.done {
  color: #c9f4da;
  background: rgba(19, 138, 82, 0.24);
}

@media (max-width: 1180px) {
  .queue-body {
    max-height: none;
  }

  .topbar,
  .command-band,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    padding: 16px;
  }

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

  .main-grid {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .panel-head,
  .panel-tools,
  .top-actions,
  .theater-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-metrics,
  .flow-map,
  .operating-line {
    grid-template-columns: 1fr;
  }

  .flow-rail {
    display: none;
  }

  .segmented {
    overflow-x: auto;
  }

  .search-wrap {
    width: 100%;
  }

  .queue-table {
    overflow-x: auto;
  }

  .queue-head,
  .lead-row {
    width: 980px;
  }

  .automation-theater {
    padding: 10px;
  }

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

  .automation-timeline {
    min-height: 210px;
  }

  .document-stack {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Real parallel automation theater ===== */
.real-theater {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: stretch;
  padding: 22px;
  background: rgba(8, 14, 22, 0.82);
  backdrop-filter: blur(10px);
}

.real-theater.hidden {
  display: none;
}

.real-theater-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #0e1822;
  color: #eef4f8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.real-theater-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.real-theater-head h2 {
  color: #ffffff;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.real-theater-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.real-theater-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 5px 10px;
  border-radius: 999px;
}

.real-theater-status.running {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.5);
}

.real-theater-status.done {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.45);
}

.real-lanes {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  min-height: 0;
}

.real-lane {
  display: flex;
  flex-direction: column;
  background: #15202b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  min-height: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.real-lane.active {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.25), 0 14px 32px rgba(16, 185, 129, 0.12);
}

.real-lane.bound {
  border-color: rgba(96, 165, 250, 0.5);
}

.real-lane.flagged {
  border-color: rgba(251, 146, 60, 0.6);
}

.real-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.real-lane-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.real-lane-tag {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}

.real-lane-title strong {
  color: #f1f5f9;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.real-lane-stage {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  white-space: nowrap;
}

.real-lane-stage.canopy {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.real-lane-stage.ezlynx {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.real-lane-stage.travelers {
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
}

.real-lane-stage.bound {
  background: rgba(34, 197, 94, 0.22);
  color: #86efac;
}

.real-lane-stage.flagged {
  background: rgba(251, 146, 60, 0.22);
  color: #fdba74;
}

.real-lane-frame {
  flex: 1;
  position: relative;
  min-height: 0;
  background: #fff;
}

.real-lane-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

.real-lane-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: rgba(15, 23, 33, 0.85);
  color: #e2e8f0;
  font-size: 13px;
  z-index: 2;
  transition: opacity 0.25s ease;
}

.real-lane-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.real-lane-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #34d399;
  animation: realLaneSpin 0.85s linear infinite;
}

@keyframes realLaneSpin {
  to { transform: rotate(360deg); }
}

.real-lane-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.18);
  font-size: 11.5px;
}

.real-lane-step {
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.real-lane-outcome {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10.5px;
  color: #94a3b8;
}

.real-lane-outcome.bound {
  color: #4ade80;
}

.real-lane-outcome.flagged {
  color: #fb923c;
}

@media (max-width: 1080px) {
  .real-lanes {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .real-theater {
    padding: 10px;
  }
  .real-lanes {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .real-lane {
    min-height: 480px;
  }
}

/* ===== CRM client profile overlay ===== */
.client-profile {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 33, 0.62);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.client-profile.hidden {
  display: none;
}

.profile-shell {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: 0 32px 64px rgba(15, 23, 33, 0.3);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.profile-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  flex-shrink: 0;
}

.profile-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.profile-back:hover {
  background: var(--surface-3);
}

.profile-id {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2f6c8f;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.profile-id-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-policy {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.profile-id-text strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.profile-id-text small {
  font-size: 12px;
  color: var(--muted);
}

.profile-status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.profile-status {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
}

.profile-status.bound { background: var(--good-soft); color: var(--good); }
.profile-status.exception { background: var(--warn-soft); color: var(--warn); }
.profile-status.working { background: var(--rater-soft); color: var(--rater); }
.profile-status.queued { background: var(--surface-3); color: var(--muted); }

.profile-savings {
  font-size: 13px;
  font-weight: 700;
  color: var(--good);
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}

.profile-summary > div {
  padding: 12px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-summary > div:last-child {
  border-right: 0;
}

.profile-summary label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.profile-summary strong {
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
}

.profile-summary span {
  font-size: 12px;
  color: var(--muted);
}

.profile-body {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
}

.profile-side {
  border-right: 1px solid var(--line);
  background: var(--surface-2);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  min-height: 0;
}

.profile-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.profile-card h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  font-size: 13px;
}

.kv .k {
  color: var(--muted);
  font-weight: 600;
}

.kv .v {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}

.member-row,
.asset-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.member-row:last-child,
.asset-row:last-child {
  border-bottom: 0;
}

.member-row strong,
.asset-row strong {
  color: var(--ink);
  font-weight: 700;
}

.member-row small,
.asset-row small {
  color: var(--muted);
  font-size: 12px;
}

.profile-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.profile-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  flex-shrink: 0;
}

.profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
  border-bottom: 0;
  cursor: pointer;
  position: relative;
  top: 1px;
}

.profile-tab span {
  font-size: 11px;
  background: var(--surface-3);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 700;
}

.profile-tab:hover {
  color: var(--ink-2);
  background: var(--surface-2);
}

.profile-tab.active {
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.profile-tab.active span {
  background: var(--rater-soft);
  color: var(--rater);
}

.profile-pane {
  display: none;
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.profile-pane.active {
  display: block;
}

/* Quotes pane */
.quote-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #ffffff;
  align-items: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.quote-card:hover {
  border-color: var(--line-strong);
}

.quote-card.best {
  border-color: var(--good);
  box-shadow: 0 0 0 1px var(--good-soft);
  background: linear-gradient(180deg, #ffffff 0%, var(--good-soft) 100%);
}

.quote-rank {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  font-weight: 800;
}

.quote-rank small {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.quote-card.best .quote-rank {
  background: var(--good);
  color: #ffffff;
}

.quote-card.best .quote-rank small {
  color: rgba(255, 255, 255, 0.85);
}

.quote-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.quote-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.quote-head strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.quote-head em {
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
}

.quote-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote-tags span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-3);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.quote-coverage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px 14px;
  font-size: 12px;
  color: var(--ink-2);
}

.quote-coverage span {
  display: flex;
  flex-direction: column;
}

.quote-coverage label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.quote-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.quote-price strong {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}

.quote-price small {
  font-size: 12px;
  color: var(--good);
  font-weight: 700;
}

.quote-price em {
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Request pane */
.request-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.request-grid > div {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.request-grid label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.request-grid strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

/* Activity pane */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.timeline-row {
  display: grid;
  grid-template-columns: 64px 18px 1fr;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
}

.timeline-row .t-time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  padding-top: 2px;
}

.timeline-row .t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rater);
  margin: 4px auto 0;
  position: relative;
}

.timeline-row .t-dot::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 38px;
  background: var(--line);
}

.timeline-row:last-child .t-dot::after { display: none; }

.timeline-row .t-dot.canopy { background: var(--canopy); }
.timeline-row .t-dot.rater { background: var(--rater); }
.timeline-row .t-dot.carrier { background: var(--carrier); }
.timeline-row .t-dot.bound { background: var(--good); }
.timeline-row .t-dot.exception { background: var(--warn); }
.timeline-row .t-dot.intake { background: #2f6c8f; }

.timeline-row .t-body {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.45;
}

/* Documents pane */
.doc-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #ffffff;
  font-size: 13px;
}

.doc-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-icon.pdf { background: var(--carrier-soft); color: var(--carrier); }
.doc-icon.zip { background: var(--warn-soft); color: var(--warn); }
.doc-icon.jpg { background: var(--rater-soft); color: var(--rater); }
.doc-icon.png { background: var(--rater-soft); color: var(--rater); }

.doc-row small {
  color: var(--muted);
  font-size: 12px;
}

/* Notes pane */
.note-card {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--rater);
  border-radius: 6px;
  margin-bottom: 10px;
  background: var(--surface-2);
}

.note-card header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.note-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
}

.empty-pane {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 30px 0;
}

@media (max-width: 980px) {
  .client-profile {
    overflow: auto;
  }
  .profile-shell {
    height: auto;
    min-height: calc(100vh - 36px);
    overflow: visible;
  }
  .profile-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .profile-side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-y: visible;
  }
  .profile-main {
    overflow-y: visible;
  }
  .profile-pane {
    overflow-y: visible;
  }
}
