/* Customers page only. Loaded last, unlayered, so these rules beat the
   layered legacy sheets (including @layer screens) without !important.
   Every selector is scoped to body.route-customers. Other routes are untouched.

   Palette is the sidebar ramp. #2196F3 is the selected filter label only.
   Weights are Satoshi 400 / 500 / 700. 700 is the page title. */

html body.route-customers {
  --cust-canvas: #171818;
  --cust-page: #1A1B1B;
  --cust-card: #1F2121;
  --cust-raised: #252727;
  --cust-hover: #2B2D2D;
  --cust-border: #2F3232;
  --cust-border-strong: #3B3E3E;
  --cust-text: #ECEDEC;
  --cust-text-2: #A6ABAB;
  --cust-text-3: #7A7F7F;
  --cust-accent: #2196F3;
}

html body.route-customers #main,
html body.route-customers #main-content,
html body.route-customers .main-content {
  background: var(--cust-page);
  color: var(--cust-text);
}

html body.route-customers .cust-view {
  max-width: none;
  margin: 0;
  padding: 8px 24px 32px;
  color: var(--cust-text);
  font-size: 14px;
  font-weight: 400;
  background: transparent;
}

/* On this route the sidebar active row is a neutral fill, and the plan
   label is plain tertiary text. Other routes keep their own sidebar. */
html body.route-customers aside.sidebar#sidebar .sidebar-quick-item.active {
  background: var(--cust-hover);
  background-image: none;
  color: var(--cust-text);
  box-shadow: none;
}

html body.route-customers aside.sidebar#sidebar .sidebar-quick-item.active .sqi-icon,
html body.route-customers aside.sidebar#sidebar .sidebar-quick-item.active .sqi-label {
  background: transparent;
  background-image: none;
  color: var(--cust-text);
  stroke: currentColor;
  font-weight: 500;
}

html body.route-customers .footer-org-tier-badge {
  background: transparent;
  background-image: none;
  color: var(--cust-text-3);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  padding: 0;
  opacity: 1;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

html body.route-customers .cust-page-title {
  margin: 4px 0 16px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cust-text);
}

html body.route-customers .cust-search {
  margin: 0 0 12px;
}

html body.route-customers .cust-search-input {
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--cust-border);
  background: var(--cust-raised);
  color: var(--cust-text);
  font-size: 14px;
  font-weight: 400;
  box-shadow: none;
}

html body.route-customers .cust-search-input::placeholder {
  color: var(--cust-text-3);
  font-weight: 400;
}

html body.route-customers .cust-search-input:focus {
  border-color: var(--cust-border-strong);
  box-shadow: none;
  outline: none;
}

html body.route-customers .cust-search-icon,
html body.route-customers .cust-search-clear {
  color: var(--cust-text-3);
}

html body.route-customers .cust-search-clear:hover {
  background: var(--cust-hover);
  color: var(--cust-text);
}

html body.route-customers .cust-filter-row {
  margin-bottom: 12px;
  gap: 12px;
}

html body.route-customers .cust-filter-chips {
  background: transparent;
  padding: 0;
  gap: 8px;
}

html body.route-customers .cust-chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--cust-border);
  background: transparent;
  color: var(--cust-text-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
}

html body.route-customers .cust-chip:hover {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-text);
}

html body.route-customers .cust-chip.active {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-accent);
}

html body.route-customers .cust-sort-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cust-text-3);
}

html body.route-customers .cust-sort {
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--cust-border);
  background: var(--cust-card);
  color: var(--cust-text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

html body.route-customers .cust-total {
  font-size: 12px;
  font-weight: 400;
  color: var(--cust-text-3);
}

html body.route-customers #cust-refresh {
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--cust-border);
  background: var(--cust-card);
  color: var(--cust-text-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

html body.route-customers #cust-refresh:hover {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-text);
}

html body.route-customers .cust-view .cust-list {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  padding: 0;
  gap: 0;
  min-width: 0;
  max-width: 100%;
}

html body.route-customers .cust-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--cust-card);
  border: 1px solid var(--cust-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--cust-text);
  table-layout: auto;
}

html body.route-customers .cust-table thead,
html body.route-customers .cust-table thead tr,
html body.route-customers .cust-table thead th {
  background: transparent;
  background-color: transparent;
  background-image: none;
  box-shadow: none;
}

html body.route-customers .cust-table thead {
  position: static;
}

html body.route-customers .cust-table thead th {
  height: 36px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: var(--cust-text-3);
  border: 0;
  border-bottom: 1px solid var(--cust-border);
  white-space: nowrap;
}

html body.route-customers .cust-table tbody tr {
  background: transparent;
  box-shadow: none;
}

html body.route-customers .cust-table tbody td {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--cust-border);
  background: transparent;
  box-shadow: none;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 400;
  color: var(--cust-text);
  white-space: nowrap;
}

html body.route-customers .cust-table tbody tr:last-child td {
  border-bottom: 0;
}

html body.route-customers .cust-table tbody tr.cust-row {
  cursor: pointer;
}

html body.route-customers .cust-table tbody tr.cust-row:hover,
html body.route-customers .cust-table tbody tr.cust-row:focus-visible {
  background: var(--cust-hover);
}

html body.route-customers .cust-table tbody tr.cust-row:focus-visible {
  outline: 1px solid var(--cust-border-strong);
  outline-offset: -1px;
}

html body.route-customers .cust-table .cust-c-name,
html body.route-customers .cust-card-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--cust-text);
  text-align: left;
  max-width: none;
}

html body.route-customers .cust-card-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html body.route-customers .cust-table .cust-c-phone {
  font-size: 13px;
  font-weight: 400;
  color: var(--cust-text-2);
  font-variant-numeric: tabular-nums;
}

html body.route-customers .cust-table :is(th, td).cust-c-end {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

html body.route-customers .cust-table th.cust-c-end {
  font-size: 12px;
  font-weight: 500;
  color: var(--cust-text-3);
}

html body.route-customers .cust-table td.cust-c-end {
  font-size: 14px;
  color: var(--cust-text);
}

html body.route-customers .cust-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cust-text-2);
}

html body.route-customers .cust-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--cust-text-3);
}

html body.route-customers .cust-status-dot--active { background: #8FBF9F; }
html body.route-customers .cust-status-dot--hold { background: #C4A574; }
html body.route-customers .cust-status-dot--cancelled,
html body.route-customers .cust-status-dot--other { background: var(--cust-text-3); }

html body.route-customers .cust-phone-copy {
  opacity: 0;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cust-text-3);
  box-shadow: none;
  vertical-align: middle;
}

html body.route-customers .cust-row:hover .cust-phone-copy,
html body.route-customers .cust-row:focus-within .cust-phone-copy,
html body.route-customers .cust-phone-copy:focus-visible,
html body.route-customers .cust-phone-copy[data-copied="1"] {
  opacity: 1;
}

html body.route-customers .cust-phone-copy:hover,
html body.route-customers .cust-phone-copy[data-copied="1"] {
  background: transparent;
  border: 0;
  color: var(--cust-text);
}

html body.route-customers .cust-table-frame {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

html body.route-customers .cust-addcol-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cust-text-3);
  font-size: 16px;
  font-weight: 500;
  box-shadow: none;
}

html body.route-customers .cust-table thead th:last-child {
  padding-right: 40px;
}

html body.route-customers .cust-addcol-btn:hover {
  background: var(--cust-hover);
  color: var(--cust-text);
  border: 0;
}

html body.route-customers .cust-col-menu {
  background: var(--cust-raised);
  border: 1px solid var(--cust-border);
  border-radius: 10px;
  box-shadow: none;
}

html body.route-customers .cust-col-opt:hover {
  background: var(--cust-hover);
}

html body.route-customers .cust-row--skel td {
  height: 40px;
}

html body.route-customers .cust-skel-bar {
  height: 12px;
  width: 56%;
  margin-left: auto;
  border-radius: 6px;
  background: var(--cust-hover);
  animation: cust-quiet-pulse 1.8s ease-in-out infinite;
}

html body.route-customers .cust-table td.cust-c-name .cust-skel-bar,
html body.route-customers .cust-skel-bar--wide {
  width: 72%;
  margin-left: 0;
}

html body.route-customers .cust-empty {
  background: transparent;
  border: 1px solid var(--cust-border);
  border-radius: 10px;
  box-shadow: none;
}

html body.route-customers .cust-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--cust-text);
}

html body.route-customers .cust-empty-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--cust-text-2);
}

html body.route-customers .cust-pager-btn {
  border-radius: 6px;
  border: 1px solid var(--cust-border);
  background: var(--cust-card);
  color: var(--cust-text-2);
  font-weight: 500;
  box-shadow: none;
}

html body.route-customers .cust-pager-btn:hover:not([disabled]) {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-text);
}

html body.route-customers .cust-pager-btn--active,
html body.route-customers .cust-pager-btn--active:hover:not([disabled]) {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-text);
}

/* Optional churn column: number only, no tinted pill. */
html body.route-customers .cust-churn,
html body.route-customers .cust-churn--low,
html body.route-customers .cust-churn--mid,
html body.route-customers .cust-churn--high,
html body.route-customers .cust-churn--na {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-width: 0;
  font-weight: 500;
  font-size: 14px;
  color: var(--cust-text-2);
}

/* Initials tile is gone. If a stale node is still in the DOM, it has no fill. */
html body.route-customers .cust-avatar {
  display: none;
  background: transparent;
  background-image: none;
}

/* Phone: name, status, LTV. No sideways page scroll. */
@media (max-width: 480px) {
  html body.route-customers,
  html body.route-customers #main,
  html body.route-customers #main-content,
  html body.route-customers .cust-view,
  html body.route-customers .cust-list {
    overflow-x: hidden;
    max-width: 100%;
  }

  html body.route-customers .cust-view {
    padding-left: 0;
    padding-right: 0;
  }

  html body.route-customers .cust-filter-row,
  html body.route-customers .cust-sort-wrap {
    min-width: 0;
    max-width: 100%;
  }

  html body.route-customers .cust-sort-wrap {
    margin-left: 0;
  }

  html body.route-customers .cust-search-input {
    font-size: 16px;
  }

  html body.route-customers .cust-addcol-btn {
    display: none;
  }

  html body.route-customers .cust-table thead th:last-child {
    padding-right: 12px;
  }

  html body.route-customers .cust-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  html body.route-customers .cust-table :is(th, td):is(
    .cust-c-phone,
    .cust-c-date,
    .cust-c-city,
    .cust-c-days,
    .cust-c-churn,
    .cust-c-spark,
    .cust-c-first,
    .cust-c-last
  ) {
    display: none;
  }

  html body.route-customers .cust-table .cust-c-name {
    width: auto;
  }

  html body.route-customers .cust-table .cust-c-status {
    width: 108px;
  }

  html body.route-customers .cust-table .cust-c-ltv {
    width: 92px;
  }

  html body.route-customers .cust-table :is(th, td) {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Detail panel. One rounded surface. Cards are flat 1px borders.
   Skeleton bars pulse opacity only. No second inset, no gradient. */
@keyframes cust-quiet-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

html body.route-customers .cust-detail-panel {
  background: var(--cust-card);
  color: var(--cust-text);
  border: 1px solid var(--cust-border);
  border-radius: 10px;
  box-shadow: none;
  overflow: hidden;
}

html body.route-customers .cust-detail-panel--docked {
  top: 56px;
  right: 16px;
  bottom: 16px;
  left: auto;
  width: 440px;
  border-radius: 10px;
}

html body.route-customers .cust-detail-panel--floating {
  border-radius: 10px;
  border: 1px solid var(--cust-border);
  background: var(--cust-card);
  box-shadow: none;
}

html body.route-customers .cust-detail-panel-header {
  gap: 10px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--cust-border);
  background: transparent;
  background-image: none;
}

html body.route-customers .cust-detail-panel-eyebrow {
  color: var(--cust-text-3);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
}

html body.route-customers .cust-detail-panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--cust-text);
}

html body.route-customers .cust-detail-panel-status {
  min-height: 22px;
  margin-top: 6px;
}

html body.route-customers .cust-detail-panel-status .cust-status-pill {
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cust-border);
  background: transparent;
  color: var(--cust-text-2);
  font-size: 12px;
  font-weight: 500;
}

html body.route-customers .cust-detail-panel-close,
html body.route-customers .cust-detail-panel-dock {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--cust-border);
  background: transparent;
  color: var(--cust-text-2);
  box-shadow: none;
}

html body.route-customers .cust-detail-panel-close:hover,
html body.route-customers .cust-detail-panel-dock:hover {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-text);
}

html body.route-customers .cust-detail-panel-body {
  padding: 16px 18px 28px;
  background: transparent;
}

html body.route-customers .cust-detail-view--panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  margin: 0;
  background: transparent;
  border-radius: 0;
}

html body.route-customers .cust-detail-panel .cust-detail-tabs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  margin: 0;
  padding: 0 0 4px;
  gap: 8px;
  border: 0;
  background: transparent;
  scrollbar-width: none;
}

html body.route-customers .cust-detail-panel .pred-detail-tab,
html body.route-customers .cust-detail-panel .cust-detail-back,
html body.route-customers .cust-detail-panel .pred-detail-back {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--cust-border);
  background: transparent;
  background-image: none;
  color: var(--cust-text-2);
  font-size: 12px;
  font-weight: 500;
  line-height: 26px;
  white-space: nowrap;
  box-shadow: none;
}

html body.route-customers .cust-detail-panel .pred-detail-tab.active,
html body.route-customers .cust-detail-panel .pred-detail-tab:hover {
  background: var(--cust-hover);
  border-color: var(--cust-border);
  color: var(--cust-accent);
}

html body.route-customers .cust-detail-sub {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--cust-text-2);
}

html body.route-customers .cust-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

html body.route-customers .cust-detail-panel .cust-detail-stat,
html body.route-customers .cust-detail-panel .pred-card,
html body.route-customers .cust-detail-panel .cust-detail-kv-row,
html body.route-customers .cust-detail-panel .cust-detail-note,
html body.route-customers .cust-detail-panel .cust-detail-empty {
  background: var(--cust-card);
  background-image: none;
  border: 1px solid var(--cust-border);
  border-radius: 10px;
  box-shadow: none;
}

html body.route-customers .cust-detail-stat {
  padding: 12px 14px;
  min-height: 72px;
}

html body.route-customers .cust-detail-stat-label,
html body.route-customers .cust-detail-panel .pred-label,
html body.route-customers .cust-detail-panel .pred-section-head {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cust-text-3);
}

html body.route-customers .cust-detail-stat-value,
html body.route-customers .cust-detail-panel .pred-num {
  font-size: 18px;
  font-weight: 500;
  color: var(--cust-text);
  background: transparent;
  background-image: none;
}

html body.route-customers .cust-detail-section,
html body.route-customers .cust-detail-panel .pred-section {
  margin: 0;
  padding: 0;
  background: transparent;
  background-image: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html body.route-customers .cust-detail-panel .cust-detail-kv {
  gap: 8px;
  padding: 0;
}

html body.route-customers .cust-detail-panel .cust-detail-kv-row {
  padding: 10px 12px;
}

html body.route-customers .cust-detail-panel .cust-detail-kv-key {
  color: var(--cust-text-3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

html body.route-customers .cust-detail-panel .cust-copy-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cust-border);
  background: transparent;
  color: var(--cust-text-2);
  font-size: 12px;
  font-weight: 500;
}

html body.route-customers .cust-quiet {
  display: block;
  height: 12px;
  width: 64%;
  border-radius: 6px;
  background: var(--cust-hover);
  background-image: none;
  animation: cust-quiet-pulse 1.8s ease-in-out infinite;
}

html body.route-customers .cust-quiet--label { width: 72px; height: 10px; }
html body.route-customers .cust-quiet--value { width: 88px; height: 18px; margin-top: 2px; }
html body.route-customers .cust-quiet--name,
html body.route-customers .cust-quiet--title { width: 148px; height: 16px; }
html body.route-customers .cust-quiet--sub { width: 220px; height: 12px; margin: 0 0 4px; }
html body.route-customers .cust-quiet--head { width: 96px; height: 12px; margin-bottom: 12px; }
html body.route-customers .cust-quiet--line { width: 100%; height: 12px; margin-bottom: 8px; }
html body.route-customers .cust-detail-invoice-pending { padding: 4px 0 8px; }
html body.route-customers .cust-detail-ident { margin: 0 0 4px; }

html body.route-customers .cust-detail-panel .pred-detail-tablewrap,
html body.route-customers .cust-detail-panel .pred-detail-table {
  background: transparent;
  border-radius: 10px;
}

@media (max-width: 820px) {
  html body.route-customers .cust-detail-panel,
  html body.route-customers .cust-detail-panel--docked,
  html body.route-customers .cust-detail-panel--floating {
    left: 8px;
    right: 8px;
    top: 52px;
    bottom: 8px;
    width: auto;
    max-width: none;
    height: auto;
    border-radius: 10px;
  }

  html body.route-customers .cust-detail-stats {
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.route-customers .cust-quiet,
  html body.route-customers .cust-skel-bar {
    animation: none;
  }
}
