:root {
  color-scheme: light;
  --bg: #040913;
  --bg-deep: #020611;
  --bg-panel: rgba(8, 20, 42, 0.9);
  --surface: rgba(10, 24, 49, 0.88);
  --surface-strong: rgba(15, 32, 61, 0.96);
  --surface-soft: rgba(18, 37, 68, 0.74);
  --ink: #eef4ff;
  --muted: #8ea7c9;
  --line: rgba(67, 122, 202, 0.3);
  --brand: #2f7fd1;
  --brand-strong: #173f71;
  --brand-soft: rgba(47, 127, 209, 0.2);
  --gold: #d7bf70;
  --warm: #c7b06a;
  --danger: #d06a66;
  --shadow: 0 28px 60px rgba(0, 5, 18, 0.5);
  --shadow-strong: 0 34px 78px rgba(0, 5, 18, 0.58);
  --radius: 22px;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", sans-serif;
  --font-display: "Aptos Display", "Aptos", "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    linear-gradient(180deg, #09152a 0%, #040913 42%, #02050d 100%);
}

body {
  position: relative;
  padding: 18px;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  inset: -10% -18%;
  background:
    radial-gradient(circle at 18% 18%, rgba(77, 120, 189, 0.42), transparent 24%),
    radial-gradient(circle at 72% 12%, rgba(19, 40, 88, 0.64), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(66, 101, 156, 0.32), transparent 24%),
    radial-gradient(circle at 14% 72%, rgba(13, 29, 66, 0.44), transparent 26%),
    linear-gradient(124deg, rgba(99, 142, 208, 0.26) 0%, rgba(18, 34, 67, 0.18) 28%, rgba(3, 8, 19, 0.72) 52%, rgba(56, 86, 136, 0.24) 76%, rgba(4, 10, 22, 0.82) 100%);
  filter: blur(34px) saturate(110%);
  opacity: 0.96;
  transform: scale(1.08);
}

body::after {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.028), transparent 36%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 2px,
      transparent 2px,
      transparent 9px
    );
  opacity: 0.22;
  mix-blend-mode: screen;
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

input::placeholder,
textarea::placeholder {
  color: #627da4;
}

input[type="date"],
input[type="time"] {
  color-scheme: dark;
}

[hidden] {
  display: none !important;
}

.auth-shell,
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, 100%);
  margin: 0 auto;
}

.auth-shell {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid rgba(74, 124, 203, 0.34);
  border-radius: calc(var(--radius) + 10px);
  background:
    radial-gradient(circle at top center, rgba(69, 109, 176, 0.24), transparent 32%),
    linear-gradient(145deg, rgba(12, 27, 54, 0.97), rgba(8, 18, 38, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(164, 201, 255, 0.08),
    0 28px 70px rgba(0, 6, 18, 0.56);
  color: var(--ink);
  animation: surface-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card h1,
.panel h2,
.panel h3,
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.auth-copy,
.hero-copy {
  margin: 12px 0 0;
  line-height: 1.55;
}

.auth-copy {
  color: #aec2df;
}

.hero-copy {
  max-width: 56ch;
  color: rgba(225, 236, 255, 0.8);
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7e99bf;
}

.auth-tabs,
.tabs {
  display: flex;
  gap: 10px;
}

.auth-tabs {
  margin: 22px 0 18px;
}

.auth-tab,
.tab {
  flex: 1;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid rgba(64, 114, 188, 0.22);
  border-radius: 16px;
  font-weight: 700;
}

.auth-tab {
  background: rgba(14, 30, 57, 0.74);
  color: #abc0dc;
}

.auth-tab.active {
  background: linear-gradient(135deg, rgba(28, 60, 110, 0.94), rgba(18, 39, 74, 0.98));
  border-color: rgba(90, 145, 228, 0.42);
  color: #f3f7ff;
  box-shadow: inset 0 1px 0 rgba(192, 222, 255, 0.08);
}

.hero {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid rgba(52, 104, 178, 0.28);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(circle at 18% 0%, rgba(70, 109, 175, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(10, 23, 45, 0.98), rgba(6, 14, 30, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(162, 199, 255, 0.08),
    var(--shadow);
  color: var(--ink);
  animation: surface-enter 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.hero-metric,
.session-card {
  position: relative;
  padding: 18px 20px;
  border: 1px solid rgba(69, 120, 199, 0.24);
  border-radius: 18px;
  background: rgba(16, 32, 61, 0.72);
  backdrop-filter: blur(16px);
}

.hero-metric span,
.session-card span {
  display: block;
  font-size: 0.85rem;
  color: #9eb8db;
}

.hero-metric strong {
  display: block;
  margin-top: 4px;
  font-size: 2rem;
  color: #ffffff;
}

.metric-button {
  display: grid;
  width: 100%;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.metric-button::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #8eb0d8;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.metric-button[aria-expanded="true"]::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.metric-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.metric-mini-grid span {
  padding: 8px;
  border: 1px solid rgba(69, 120, 199, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  font-weight: 800;
}

.metric-mini-grid strong {
  margin-top: 3px;
  font-size: 1rem;
  line-height: 1.1;
}

.metric-popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 10px);
  right: 0;
  width: min(300px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 16px;
  background: #ffffff;
  color: #10263d;
  box-shadow: 0 22px 48px rgba(39, 82, 130, 0.22);
  animation: surface-enter 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.metric-popover-head {
  display: grid;
  gap: 3px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(0, 120, 212, 0.12);
}

.metric-popover-head strong {
  margin: 0;
  color: #10263d;
  font-size: 0.95rem;
}

.metric-popover-head span {
  color: #5f7b97;
  font-size: 0.76rem;
}

.metric-history-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.metric-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f7fbff;
}

.metric-history-row.current {
  border: 1px solid rgba(0, 120, 212, 0.18);
  background: #eef7ff;
}

.metric-history-row span {
  color: #5f7b97;
  font-size: 0.84rem;
  font-weight: 800;
}

.metric-history-row strong {
  margin: 0;
  color: #10263d;
  font-size: 0.95rem;
}

.session-card strong {
  display: block;
  color: #ffffff;
  word-break: break-word;
}

.session-card {
  display: grid;
  align-content: start;
  gap: 4px;
}

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

.tabs {
  margin: 18px 0;
}

.tab {
  background: rgba(10, 22, 42, 0.7);
  color: #97b1d4;
}

.tab.active {
  background: linear-gradient(135deg, rgba(23, 49, 91, 0.96), rgba(14, 32, 62, 0.98));
  border-color: rgba(93, 148, 230, 0.4);
  color: #f3f7ff;
  box-shadow:
    inset 0 1px 0 rgba(188, 219, 255, 0.08),
    0 10px 26px rgba(1, 9, 24, 0.28);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.layout {
  display: grid;
  gap: 18px;
}

.sidebar-stack,
.agenda-list,
.agenda-items,
.timeline-list,
.timeline-summary {
  display: grid;
  gap: 12px;
}

.auth-card,
.hero,
.hero-metric,
.session-card,
.panel,
.panel-lite,
.lead-card,
.lead-address-card,
.list-card,
.result-card,
.agenda-card,
.timeline-entry,
.timeline-icon,
.timeline-confirm,
.detail-item,
.history-entry,
.mapping-row,
.badge,
.tab,
.auth-tab,
.button,
.copy-button,
.call-button,
.chip,
.field input,
.field select,
.field textarea,
table {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    color 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.panel,
.panel-lite {
  padding: 20px;
  border: 1px solid rgba(58, 110, 188, 0.32);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(16, 34, 66, 0.95), rgba(10, 22, 44, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(164, 204, 255, 0.06),
    var(--shadow);
  animation: surface-enter 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head.tight {
  margin-bottom: 14px;
}

.queue-head-actions {
  display: none;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  justify-content: flex-end;
}

.mobile-panel-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.mobile-panel-head {
  margin-bottom: 0;
}

.mobile-panel-head > div {
  min-width: 0;
}

.mobile-panel-body:not([hidden]) {
  margin-top: 18px;
}

.mobile-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--brand);
}

.mobile-panel-icon::before {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms ease;
}

.mobile-panel-toggle[aria-expanded="true"] .mobile-panel-icon::before {
  transform: translateY(2px) rotate(-135deg);
}

.mobile-panel-toggle:focus-visible {
  outline: none;
}

.mobile-panel-toggle:focus-visible .mobile-panel-icon {
  border-color: rgba(133, 183, 255, 0.78);
  box-shadow:
    0 0 0 3px rgba(62, 131, 214, 0.18),
    0 0 24px rgba(37, 87, 166, 0.18);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(88vh, 960px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(77, 129, 211, 0.34);
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top center, rgba(59, 96, 157, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(11, 25, 48, 0.98), rgba(7, 17, 35, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(174, 207, 255, 0.08),
    0 36px 80px rgba(1, 8, 21, 0.58);
  animation: surface-enter 260ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.stack-form,
.queue-form,
.list-grid,
.result-list,
.mapping-grid,
.detail-grid,
.history-list,
.agenda-list,
.agenda-items,
.timeline-list,
.auth-form {
  display: grid;
  gap: 12px;
}

#search-results {
  margin-top: 22px;
  gap: 16px;
}

.field {
  display: block;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(58, 104, 172, 0.36);
  border-radius: 16px;
  background: rgba(24, 44, 76, 0.84);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(188, 214, 255, 0.04);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: rgba(98, 147, 223, 0.5);
  background: rgba(26, 48, 84, 0.92);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: rgba(121, 175, 255, 0.82);
  background: rgba(28, 52, 92, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(203, 226, 255, 0.08),
    0 0 0 3px rgba(62, 131, 214, 0.18),
    0 0 26px rgba(37, 87, 166, 0.18);
}

.field textarea {
  resize: vertical;
}

.field span,
.field-label,
.badge span,
.contact-item span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.call-button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: linear-gradient(135deg, #3484d7, #205ea5);
  color: #f7fbff;
  text-decoration: none;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(223, 238, 255, 0.12),
    0 10px 24px rgba(10, 33, 76, 0.32);
  cursor: pointer;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  flex: 0 0 34px;
  border: 1px solid rgba(71, 119, 191, 0.22);
  border-radius: 10px;
  background: rgba(19, 38, 68, 0.08);
  color: var(--brand);
  cursor: pointer;
  line-height: 1;
}

.copy-button svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.button.muted {
  background: rgba(19, 38, 68, 0.86);
  border-color: rgba(71, 119, 191, 0.28);
  color: #dbe8fb;
  box-shadow: none;
}

.button.danger {
  background: rgba(90, 34, 38, 0.84);
  border-color: rgba(180, 84, 92, 0.28);
  color: #ffd7d3;
  box-shadow: none;
}

.button.small {
  min-height: 38px;
  padding: 8px 12px;
}

.theme-toggle-shell {
  display: flex;
  justify-content: flex-start;
  width: auto;
  margin-bottom: 0;
}

.theme-toggle {
  display: inline-flex;
  cursor: pointer;
}

.theme-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 74px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(0, 120, 212, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f609f;
  box-shadow: var(--shadow);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd56a, #ffb24d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 14px rgba(0, 120, 212, 0.12);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms ease,
    box-shadow 180ms ease;
}

.theme-toggle-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  transition: opacity 180ms ease, color 180ms ease;
}

.theme-toggle-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle-icon-moon {
  opacity: 0.45;
}

.theme-toggle-input:checked + .theme-toggle-track .theme-toggle-thumb {
  transform: translateX(36px);
  background: linear-gradient(135deg, #dce8ff, #8cb4ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 18px rgba(0, 13, 34, 0.24);
}

.theme-toggle-input:checked + .theme-toggle-track .theme-toggle-icon-sun {
  opacity: 0.45;
}

.theme-toggle-input:checked + .theme-toggle-track .theme-toggle-icon-moon {
  opacity: 1;
}

.theme-toggle-input:not(:checked) + .theme-toggle-track .theme-toggle-icon-sun {
  opacity: 1;
}

.theme-toggle-input:focus-visible + .theme-toggle-track {
  border-color: rgba(0, 120, 212, 0.48);
  box-shadow:
    0 0 0 3px rgba(0, 120, 212, 0.12),
    var(--shadow);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.button:focus-visible,
.copy-button:focus-visible,
.call-button:focus-visible,
.chip:focus-visible,
.tab:focus-visible,
.auth-tab:focus-visible,
.timeline-icon:focus-visible {
  outline: none;
  border-color: rgba(133, 183, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(223, 238, 255, 0.12),
    0 0 0 3px rgba(62, 131, 214, 0.18),
    0 0 26px rgba(37, 87, 166, 0.22);
}

.notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(69, 125, 208, 0.26);
  border-radius: 18px;
  background: rgba(19, 41, 76, 0.72);
  color: #cfe0f8;
}

.notice.warm {
  border-color: rgba(195, 169, 98, 0.24);
  background: rgba(67, 54, 24, 0.58);
  color: #f0dfaa;
}

.notice-action {
  display: grid;
  gap: 12px;
}

.notice-action strong {
  display: block;
  color: inherit;
  line-height: 1.45;
}

.list-card,
.result-card,
.agenda-card,
.timeline-entry,
.detail-item,
.history-entry {
  padding: 16px;
  border: 1px solid rgba(61, 111, 188, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(20, 41, 74, 0.9), rgba(14, 29, 54, 0.94));
}

.list-card h3,
.result-card h3,
.agenda-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #f7fbff;
}

.result-card-button {
  display: grid;
  width: 100%;
  gap: 14px;
  border: 1px solid rgba(61, 111, 188, 0.28);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.result-main {
  display: grid;
  gap: 14px;
}

.result-title-block {
  min-width: 0;
}

.result-title-block h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.result-contact {
  display: grid;
  gap: 6px;
  color: #dce8fa;
  font-size: 0.94rem;
  font-weight: 800;
}

.result-contact span {
  overflow-wrap: anywhere;
}

.result-action-pill,
.result-status-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(75, 127, 204, 0.28);
  border-radius: 999px;
  background: rgba(18, 39, 72, 0.82);
  color: #dbe8fb;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.result-action-pill {
  justify-self: start;
  border-color: rgba(96, 154, 236, 0.34);
  background: linear-gradient(135deg, rgba(43, 112, 198, 0.94), rgba(31, 83, 154, 0.96));
  color: #ffffff;
}

.result-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #9eb8db;
  font-size: 0.84rem;
}

.result-status-chip.outcome-open {
  border-color: rgba(75, 127, 204, 0.22);
  background: rgba(15, 31, 58, 0.72);
  color: #aac0dd;
}

.result-status-chip.outcome-sale {
  border-color: rgba(40, 156, 100, 0.26);
  background: rgba(12, 92, 57, 0.18);
  color: #c6ffe0;
}

.result-status-chip.outcome-not-interested,
.result-status-chip.outcome-bad-number,
.result-status-chip.outcome-hang-up {
  border-color: rgba(207, 61, 61, 0.28);
  background: rgba(207, 61, 61, 0.14);
  color: #ffd9d9;
}

.result-status-chip.outcome-no-answer,
.result-status-chip.outcome-voicemail {
  border-color: rgba(167, 131, 40, 0.28);
  background: rgba(185, 145, 38, 0.14);
  color: #ffefb7;
}

.result-status-chip.outcome-appointment {
  border-color: rgba(86, 146, 232, 0.3);
  background: rgba(34, 101, 184, 0.2);
  color: #dcebff;
}

.list-card-head,
.scope-group-head,
.scope-builder-toolbar,
.scope-builder-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.scope-count,
.scope-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(75, 127, 204, 0.28);
  border-radius: 999px;
  background: rgba(18, 39, 72, 0.82);
  color: #dbe8fb;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.muted-copy.compact {
  margin-top: 16px;
  color: #a8bfdc;
}

.mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  color: #a6bcda;
  font-size: 0.9rem;
}

.copy-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-line strong {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.scope-pill-row,
.scope-group-list,
.group-lead-checklist {
  display: grid;
  gap: 12px;
}

.scope-pill-row {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 14px;
}

.scope-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(69, 118, 194, 0.28);
  border-radius: 16px;
  background: rgba(16, 35, 64, 0.84);
  color: #dbe7fa;
  font-weight: 700;
  cursor: pointer;
}

.scope-pill span {
  color: #8ca8ce;
  font-size: 0.85rem;
  font-weight: 600;
}

.scope-pill.active {
  border-color: rgba(101, 154, 236, 0.46);
  background: linear-gradient(135deg, rgba(41, 88, 154, 0.98), rgba(18, 44, 86, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(214, 232, 255, 0.1),
    0 14px 28px rgba(8, 24, 57, 0.26);
}

.scope-pill.active span {
  color: #e4efff;
}

.badge-row,
.contact-grid,
.form-grid,
.action-row {
  display: grid;
  gap: 12px;
}

.queue-topline {
  display: grid;
  gap: 18px;
}

.badge {
  padding: 14px;
  border: 1px solid rgba(63, 115, 191, 0.24);
  border-radius: 18px;
  background: rgba(17, 37, 67, 0.82);
}

.badge strong,
.contact-item strong,
.detail-item strong {
  font-size: 1rem;
  color: #f4f8ff;
}

.sale-summary {
  display: grid;
  align-content: center;
  min-height: 100%;
}

.lead-card {
  padding: 18px;
  border: 1px solid rgba(76, 132, 212, 0.34);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(57, 103, 176, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(16, 37, 70, 0.96), rgba(8, 19, 39, 0.98));
  box-shadow: inset 0 1px 0 rgba(181, 213, 255, 0.05);
}

.lead-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lead-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.lead-title-row h3 {
  margin: 0;
}

.lead-dob-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.lead-address-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(72, 124, 201, 0.28);
  border-radius: 18px;
  background: rgba(14, 31, 58, 0.72);
}

.lead-address-lines {
  display: grid;
  gap: 4px;
}

.lead-address-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 11px 14px;
  border: 1px solid rgba(62, 109, 182, 0.28);
  border-radius: 999px;
  background: rgba(20, 39, 69, 0.88);
  color: #d9e7fb;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(135deg, #317fd0, #214d9a);
  border-color: transparent;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(229, 241, 255, 0.12),
    0 12px 24px rgba(12, 38, 82, 0.26);
}

.empty-state {
  padding: 26px;
  border: 1px dashed rgba(74, 128, 208, 0.28);
  border-radius: 20px;
  background: rgba(12, 25, 47, 0.72);
}

.empty-state h3 {
  margin: 0 0 8px;
  color: #f8fbff;
}

.empty-state p {
  color: var(--muted);
}

.empty-state.compact {
  padding: 18px;
}

.detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.detail-item strong {
  display: block;
  line-height: 1.45;
  word-break: break-word;
}

.detail-item-address {
  display: grid;
  gap: 10px;
}

.detail-address-block {
  display: grid;
  gap: 4px;
}

.detail-address-line.secondary {
  color: var(--muted);
  font-weight: 600;
}

.detail-copy-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-copy-chip {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 34px;
  padding: 7px 11px;
  flex: 0 1 auto;
  gap: 6px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.detail-copy-chip span {
  line-height: 1;
}

.detail-copy-chip svg {
  width: 14px;
  height: 14px;
}

.detail-meta {
  color: var(--muted);
  font-weight: 500;
}

.history-entry p {
  margin: 0;
}

.history-entry time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.mapping-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(65, 117, 194, 0.28);
  border-radius: 18px;
  background: rgba(19, 38, 69, 0.88);
}

.queue-closeout {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.agenda-day {
  display: grid;
  gap: 10px;
}

.agenda-date {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a4bcdd;
}

.agenda-card {
  display: grid;
  gap: 12px;
}

.agenda-time {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(84, 136, 214, 0.26);
  border-radius: 999px;
  background: rgba(18, 38, 70, 0.8);
  color: #f4f8ff;
  font-weight: 700;
}

.agenda-body {
  display: grid;
  gap: 6px;
}

.timeline-summary {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(76, 128, 206, 0.28);
  border-radius: 999px;
  background: rgba(17, 37, 67, 0.84);
  color: #dfeafb;
  font-size: 0.9rem;
  font-weight: 700;
}

.timeline-entry {
  display: grid;
  gap: 8px;
}

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

.timeline-copy {
  display: grid;
  gap: 6px;
}

.timeline-head strong {
  color: #f7fbff;
}

.timeline-head time {
  color: #93add0;
  font-size: 0.85rem;
  white-space: nowrap;
}

.timeline-note {
  margin: 0;
  color: #d7e5fa;
  line-height: 1.5;
}

.timeline-priority {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid rgba(76, 128, 206, 0.28);
  border-radius: 18px;
  background: rgba(17, 37, 67, 0.84);
}

.timeline-priority-bad-number,
.timeline-entry.outcome-bad-number,
.timeline-badge.outcome-bad-number {
  border-color: rgba(207, 61, 61, 0.26);
  background: rgba(207, 61, 61, 0.12);
  color: #ffd9d9;
}

.timeline-entry.outcome-bad-number .timeline-head strong,
.timeline-priority-bad-number strong {
  color: #ffd9d9;
}

.timeline-badge.outcome-sale,
.timeline-entry.outcome-sale {
  border-color: rgba(40, 156, 100, 0.24);
  background: rgba(12, 92, 57, 0.16);
  color: #c6ffe0;
}

.timeline-badge.outcome-appointment,
.timeline-entry.outcome-appointment {
  border-color: rgba(0, 120, 212, 0.24);
  background: rgba(0, 120, 212, 0.14);
  color: #d9efff;
}

.timeline-badge.outcome-not-interested,
.timeline-badge.outcome-hang-up,
.timeline-entry.outcome-not-interested,
.timeline-entry.outcome-hang-up {
  border-color: rgba(207, 61, 61, 0.22);
  background: rgba(207, 61, 61, 0.12);
  color: #ffd9d9;
}

.timeline-badge.outcome-no-answer,
.timeline-badge.outcome-voicemail,
.timeline-entry.outcome-no-answer,
.timeline-entry.outcome-voicemail {
  border-color: rgba(177, 137, 27, 0.24);
  background: rgba(185, 145, 38, 0.12);
  color: #ffefb7;
}

.timeline-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: end;
  min-width: 42px;
  min-height: 40px;
}

.timeline-confirm {
  position: absolute;
  right: 0;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateX(14px) scale(0.9);
  pointer-events: none;
}

.timeline-actions.confirming .timeline-delete {
  opacity: 0;
  transform: translateX(-10px) scale(0.72);
  pointer-events: none;
}

.timeline-actions.confirming .timeline-confirm {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.timeline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(75, 126, 204, 0.28);
  border-radius: 999px;
  background: rgba(18, 38, 70, 0.9);
  color: #dce9fb;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(202, 225, 255, 0.05);
}

.timeline-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.timeline-icon.confirm {
  border-color: rgba(84, 196, 136, 0.34);
  background: rgba(18, 83, 53, 0.88);
  color: #d9ffe9;
}

.timeline-icon.cancel {
  border-color: rgba(213, 102, 109, 0.34);
  background: rgba(98, 29, 36, 0.88);
  color: #ffe4e2;
}

.scope-pane {
  display: grid;
  gap: 14px;
}

.scope-actions {
  margin-top: 4px;
}

.builder-save-actions {
  margin-top: 0;
  padding: 12px;
  border: 1px solid rgba(76, 128, 206, 0.2);
  border-radius: 16px;
  background: rgba(13, 28, 53, 0.5);
}

.scope-group-card,
.group-lead-row {
  padding: 16px;
  border: 1px solid rgba(63, 112, 189, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(20, 41, 74, 0.92), rgba(14, 29, 54, 0.96));
}

.scope-group-card {
  display: grid;
  gap: 14px;
}

.scope-group-card.phone-active {
  border-color: rgba(109, 166, 244, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(199, 225, 255, 0.08),
    0 0 0 1px rgba(110, 164, 242, 0.12);
}

.scope-group-card.current-open {
  background:
    radial-gradient(circle at top right, rgba(58, 103, 176, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(24, 47, 84, 0.96), rgba(14, 31, 58, 0.98));
}

.scope-group-copy {
  display: grid;
  gap: 8px;
}

.scope-group-copy h3 {
  margin: 0;
}

.scope-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scope-builder-grid {
  display: grid;
  gap: 12px;
}

.scope-builder-toolbar {
  align-items: center;
}

.scope-builder-toolbar > strong {
  color: #f5f9ff;
}

.scope-builder-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.builder-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.builder-counts span {
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid rgba(76, 128, 206, 0.24);
  border-radius: 14px;
  background: rgba(17, 37, 67, 0.78);
  color: #98b1d2;
  font-size: 0.78rem;
  font-weight: 700;
}

.builder-counts strong {
  color: #f5f9ff;
  font-size: 1.25rem;
  line-height: 1;
}

.builder-filter-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(76, 128, 206, 0.2);
  border-radius: 16px;
  background: rgba(13, 28, 53, 0.5);
}

.builder-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.state-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.state-filter-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(76, 128, 206, 0.28);
  border-radius: 999px;
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.state-filter-chip span {
  color: #9eb8db;
  font-size: 0.78rem;
  font-weight: 700;
}

.state-filter-chip.active {
  border-color: rgba(101, 154, 236, 0.46);
  background: linear-gradient(135deg, rgba(41, 88, 154, 0.98), rgba(18, 44, 86, 0.98));
  color: #ffffff;
}

.state-filter-chip.active span {
  color: #e4efff;
}

.group-lead-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  cursor: pointer;
}

.group-lead-row input {
  width: 20px;
  height: 20px;
  margin-top: 4px;
  accent-color: #3d8ae0;
}

.group-lead-row.selected {
  border-color: rgba(109, 166, 244, 0.4);
  background:
    radial-gradient(circle at top right, rgba(48, 94, 166, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(22, 45, 81, 0.94), rgba(15, 31, 58, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(197, 223, 255, 0.07),
    0 0 0 1px rgba(109, 166, 244, 0.1);
}

.group-lead-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.group-lead-copy strong {
  color: #f7fbff;
  line-height: 1.4;
}

.group-lead-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  justify-self: start;
  width: fit-content;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(76, 128, 206, 0.28);
  border-radius: 999px;
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
  font-size: 0.86rem;
  font-weight: 700;
}

.group-lead-status.outcome-open {
  border-style: dashed;
}

.group-lead-status.outcome-sale {
  border-color: rgba(38, 156, 98, 0.28);
  background: rgba(12, 92, 57, 0.16);
  color: #c6ffe0;
}

.group-lead-status.outcome-appointment {
  border-color: rgba(0, 120, 212, 0.32);
  background: rgba(0, 120, 212, 0.14);
  color: #d9efff;
}

.group-lead-status.outcome-not-interested,
.group-lead-status.outcome-bad-number,
.group-lead-status.outcome-hang-up {
  border-color: rgba(207, 61, 61, 0.26);
  background: rgba(207, 61, 61, 0.12);
  color: #ffd9d9;
}

.group-lead-status.outcome-no-answer,
.group-lead-status.outcome-voicemail {
  border-color: rgba(167, 131, 40, 0.26);
  background: rgba(185, 145, 38, 0.12);
  color: #ffefb7;
}

.notes-panel .field {
  margin: 0;
}

.mapping-header {
  font-weight: 700;
  color: #f4f8ff;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: rgba(12, 24, 46, 0.56);
  border-radius: 18px;
  overflow: hidden;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(54, 95, 157, 0.24);
}

td {
  color: #dde8fa;
}

th {
  color: #90a9cb;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 340px;
  padding: 14px 16px;
  border: 1px solid rgba(73, 123, 197, 0.28);
  border-radius: 16px;
  background: rgba(11, 28, 54, 0.95);
  color: #f4f8ff;
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(186, 90, 98, 0.32);
  background: rgba(77, 24, 29, 0.96);
}

@media (hover: hover) {
  .auth-card:hover,
  .hero:hover,
  .hero-metric:hover,
  .session-card:hover,
  .panel:hover,
  .panel-lite:hover,
  .lead-card:hover,
  .list-card:hover,
  .result-card:hover,
  .agenda-card:hover,
  .timeline-entry:hover,
  .detail-item:hover,
  .history-entry:hover,
  .mapping-row:hover,
  .badge:hover {
    transform: translateY(-2px);
    border-color: rgba(113, 166, 245, 0.5);
    box-shadow:
      inset 0 1px 0 rgba(182, 216, 255, 0.08),
      var(--shadow-strong),
      0 0 0 1px rgba(112, 168, 255, 0.14),
      0 0 30px rgba(44, 102, 184, 0.16);
  }

  .field input:hover,
  .field select:hover,
  .field textarea:hover {
    box-shadow:
      inset 0 1px 0 rgba(201, 224, 255, 0.06),
      0 0 0 1px rgba(95, 152, 234, 0.12),
      0 0 22px rgba(31, 80, 154, 0.14);
  }

  .button:hover:not(:disabled),
  .copy-button:hover,
  .call-button:hover {
    transform: translateY(-1px);
    border-color: rgba(168, 209, 255, 0.28);
    background: linear-gradient(135deg, #4598ee, #286fc4);
    box-shadow:
      inset 0 1px 0 rgba(236, 245, 255, 0.14),
      0 16px 34px rgba(10, 35, 82, 0.36),
      0 0 24px rgba(43, 109, 198, 0.22);
    filter: saturate(110%);
  }

  .copy-button:hover {
    transform: translateY(-1px);
    border-color: rgba(118, 170, 247, 0.36);
    background: rgba(24, 47, 84, 0.12);
    color: #f4f9ff;
    box-shadow:
      inset 0 1px 0 rgba(208, 228, 255, 0.08),
      0 8px 18px rgba(6, 18, 44, 0.16);
  }

  .button.muted:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(32, 60, 105, 0.96), rgba(18, 39, 74, 0.98));
    border-color: rgba(106, 156, 235, 0.42);
    color: #f6f9ff;
    box-shadow:
      inset 0 1px 0 rgba(220, 236, 255, 0.08),
      0 14px 30px rgba(7, 19, 46, 0.34),
      0 0 22px rgba(43, 109, 198, 0.14);
  }

  .button.danger:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(134, 54, 60, 0.96), rgba(93, 34, 39, 0.98));
    border-color: rgba(221, 121, 130, 0.42);
    color: #fff0ef;
    box-shadow:
      inset 0 1px 0 rgba(255, 231, 230, 0.08),
      0 14px 30px rgba(44, 10, 13, 0.34),
      0 0 22px rgba(166, 62, 70, 0.18);
  }

  .auth-tab:hover:not(.active),
  .tab:hover:not(.active) {
    transform: translateY(-1px);
    border-color: rgba(105, 155, 233, 0.36);
    background: rgba(17, 35, 67, 0.9);
    color: #dce9fb;
    box-shadow:
      inset 0 1px 0 rgba(188, 219, 255, 0.06),
      0 12px 24px rgba(2, 10, 26, 0.22);
  }

  .auth-tab.active:hover,
  .tab.active:hover {
    transform: translateY(-1px);
    box-shadow:
      inset 0 1px 0 rgba(198, 225, 255, 0.1),
      0 14px 28px rgba(1, 9, 24, 0.32),
      0 0 24px rgba(41, 98, 180, 0.18);
  }

  .chip:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 165, 246, 0.44);
    background: rgba(24, 47, 84, 0.94);
    color: #f5f9ff;
    box-shadow:
      inset 0 1px 0 rgba(194, 222, 255, 0.06),
      0 12px 22px rgba(5, 17, 42, 0.24);
  }

  .chip.active:hover {
    background: linear-gradient(135deg, #4299f2, #2865bf);
    box-shadow:
      inset 0 1px 0 rgba(229, 241, 255, 0.14),
      0 14px 28px rgba(11, 38, 83, 0.3),
      0 0 22px rgba(42, 110, 199, 0.22);
  }

  .timeline-icon:hover {
    transform: translateY(-1px);
    border-color: rgba(118, 170, 247, 0.46);
    background: rgba(24, 47, 84, 0.96);
    color: #f4f9ff;
    box-shadow:
      inset 0 1px 0 rgba(208, 228, 255, 0.08),
      0 12px 24px rgba(6, 18, 44, 0.26);
  }

  .state-filter-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 165, 246, 0.44);
    background: rgba(24, 47, 84, 0.94);
    color: #f5f9ff;
    box-shadow:
      inset 0 1px 0 rgba(194, 222, 255, 0.06),
      0 12px 22px rgba(5, 17, 42, 0.24);
  }

  .timeline-icon.confirm:hover {
    border-color: rgba(112, 216, 159, 0.52);
    background: rgba(24, 110, 70, 0.94);
    color: #f0fff6;
  }

  .timeline-icon.cancel:hover {
    border-color: rgba(234, 128, 136, 0.52);
    background: rgba(126, 38, 47, 0.94);
    color: #fff2f1;
  }

  .scope-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(111, 165, 246, 0.44);
    background: rgba(24, 47, 84, 0.94);
    color: #f5f9ff;
    box-shadow:
      inset 0 1px 0 rgba(194, 222, 255, 0.06),
      0 12px 22px rgba(5, 17, 42, 0.24);
  }

  .scope-group-card:hover,
  .group-lead-row:hover,
  .modal-dialog:hover {
    transform: translateY(-1px);
    border-color: rgba(113, 166, 245, 0.46);
    box-shadow:
      inset 0 1px 0 rgba(182, 216, 255, 0.08),
      var(--shadow-strong),
      0 0 0 1px rgba(112, 168, 255, 0.12),
      0 0 28px rgba(44, 102, 184, 0.12);
  }
}

.button:active:not(:disabled),
.copy-button:active,
.call-button:active,
.chip:active,
.result-card-button:active,
.tab:active,
.auth-tab:active,
.timeline-icon:active {
  transform: translateY(0);
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 1.4fr auto;
    align-items: end;
  }

  .badge-row,
  .contact-grid,
  .form-grid,
  .action-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notice-action {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .modal-shell {
    place-items: center;
    padding: 24px;
  }

  .scope-builder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }

  .scope-builder-toolbar {
    align-items: start;
  }

  .scope-group-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .group-lead-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .group-lead-status {
    grid-column: auto;
    justify-self: end;
  }

  .result-main {
    grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr) auto;
    align-items: center;
  }

  .result-action-pill {
    justify-self: end;
  }
}

@media (min-width: 1024px) {
  body {
    padding: 24px;
  }

  .hero {
    grid-template-columns: minmax(0, 1.5fr) auto;
    align-items: start;
    gap: 16px 20px;
  }

  .hero-side {
    grid-template-columns: minmax(260px, 320px) minmax(150px, 172px) minmax(210px, 240px);
    align-items: stretch;
    gap: 10px;
  }

.hero-metric,
.session-card {
  min-height: 100%;
  padding: 14px 16px;
  border-radius: 16px;
}

  .hero-metric strong {
    margin-top: 6px;
    font-size: 1.1rem;
    line-height: 1.15;
  }

  .session-card strong {
    font-size: 1rem;
    line-height: 1.25;
  }

  .session-card .button.small {
    margin-top: 0;
    width: fit-content;
  }

  .layout {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
  }

  .sidebar-stack {
    position: sticky;
    top: 24px;
  }

  .panel-queue {
    min-height: 680px;
  }

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

  .queue-topline {
    gap: 20px;
  }

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

  .agenda-card {
    grid-template-columns: auto 1fr;
    align-items: start;
  }

  .agenda-card .button {
    grid-column: 2;
    width: fit-content;
  }

  .modal-dialog {
    padding: 24px;
  }

  .mobile-panel-toggle {
    cursor: default;
  }

  .mobile-panel-icon {
    display: none;
  }

  .panel-queue > .panel-head {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .queue-head-actions {
    display: flex;
    width: auto;
    margin-left: auto;
    flex-wrap: nowrap;
    align-self: flex-start;
  }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-side {
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.7fr) minmax(210px, 0.9fr);
  }
}

/* Metro Light Theme */
:root {
  --bg: #f2f6fb;
  --bg-deep: #e8eef6;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: rgba(255, 255, 255, 0.99);
  --surface-soft: rgba(242, 247, 252, 0.9);
  --ink: #14283d;
  --muted: #5f7994;
  --line: rgba(0, 120, 212, 0.16);
  --brand: #0078d4;
  --brand-strong: #005ea6;
  --brand-soft: rgba(0, 120, 212, 0.12);
  --gold: #9f7a22;
  --warm: #8c6c1e;
  --danger: #cf3d3d;
  --shadow: 0 12px 28px rgba(52, 92, 140, 0.1);
  --shadow-strong: 0 18px 40px rgba(52, 92, 140, 0.14);
  --radius: 18px;
  --font-body: "Segoe UI Variable Text", "Segoe UI Variable", "Aptos", "Segoe UI", sans-serif;
  --font-display:
    "Segoe UI Variable Display",
    "Segoe UI Variable",
    "Aptos Display",
    "Aptos",
    "Segoe UI",
    sans-serif;
}

html,
body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 58%, #e8eef6 100%);
}

body::before {
  inset: -8% -10%;
  background:
    radial-gradient(circle at 14% 10%, rgba(0, 120, 212, 0.12), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(0, 164, 239, 0.1), transparent 20%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(238, 245, 251, 0.36) 48%, rgba(223, 234, 245, 0.52) 100%);
  filter: blur(18px) saturate(105%);
  opacity: 1;
  transform: none;
}

body::after {
  background:
    linear-gradient(90deg, rgba(0, 120, 212, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 120, 212, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.55;
  mix-blend-mode: normal;
}

input::placeholder,
textarea::placeholder {
  color: #86a0b9;
}

input[type="date"],
input[type="time"] {
  color-scheme: light;
}

.auth-card,
.hero,
.hero-metric,
.session-card,
.panel,
.panel-lite,
.lead-card,
.lead-address-card,
.list-card,
.result-card,
.agenda-card,
.timeline-entry,
.detail-item,
.history-entry,
.mapping-row,
.badge,
.modal-dialog,
.scope-group-card,
.group-lead-row {
  border-color: rgba(0, 120, 212, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98));
  box-shadow: var(--shadow);
  color: var(--ink);
}

.auth-card,
.modal-dialog {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 249, 255, 0.99));
}

.hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(0, 120, 212, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 250, 255, 0.98) 62%, rgba(235, 244, 255, 0.98) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  top: -36px;
  right: -42px;
  width: 220px;
  height: 220px;
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(0, 120, 212, 0.2), rgba(0, 164, 239, 0.08));
  transform: rotate(18deg);
}

.hero > *,
.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card h1,
.panel h2,
.panel h3,
.hero h1,
.list-card h3,
.result-card h3,
.agenda-card h3,
.timeline-head strong,
.group-lead-copy strong,
.mapping-header,
.empty-state h3 {
  color: #10263d;
}

.auth-copy,
.hero-copy,
.muted-copy,
.muted-copy.compact,
.history-entry time,
.agenda-date,
.field span,
.field-label,
.badge span,
.contact-item span,
.hero-metric span,
.session-card span {
  color: var(--muted);
}

.eyebrow {
  color: #4f7b9f;
}

.auth-tab,
.tab {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 120, 212, 0.14);
  color: #42607e;
  box-shadow: none;
}

.auth-tab.active,
.tab.active {
  background: linear-gradient(135deg, #0078d4, #1493ea);
  border-color: rgba(0, 120, 212, 0.48);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.2);
}

.field input,
.field select,
.field textarea {
  border-color: rgba(0, 120, 212, 0.16);
  background: rgba(255, 255, 255, 0.96);
  color: #17304a;
  box-shadow: none;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: rgba(0, 120, 212, 0.28);
  background: #ffffff;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: rgba(0, 120, 212, 0.56);
  background: #ffffff;
  box-shadow:
    0 0 0 3px rgba(0, 120, 212, 0.12),
    0 10px 20px rgba(0, 120, 212, 0.08);
}

.button,
.call-button {
  border-color: rgba(0, 120, 212, 0.48);
  background: linear-gradient(135deg, #0078d4, #1493ea);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.18);
}

.copy-button {
  border-color: rgba(0, 120, 212, 0.18);
  background: #f4f9ff;
  color: #0f609f;
  box-shadow: none;
}

.button.muted {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 120, 212, 0.18);
  color: #0b5a99;
}

.lead-address-card {
  border-color: rgba(0, 120, 212, 0.16);
  background: linear-gradient(180deg, rgba(249, 252, 255, 0.98), rgba(241, 247, 255, 0.96));
}

.button.danger {
  background: #fff3f3;
  border-color: rgba(207, 61, 61, 0.22);
  color: #b13131;
}

.notice {
  border-color: rgba(0, 120, 212, 0.14);
  background: #eef6ff;
  color: #16558d;
}

.notice.warm {
  border-color: rgba(159, 122, 34, 0.2);
  background: #fff8e3;
  color: #86651a;
}

.result-contact {
  color: #10263d;
}

.result-status-row {
  color: #5f7b97;
}

.result-action-pill {
  border-color: rgba(0, 120, 212, 0.48);
  background: linear-gradient(135deg, #0078d4, #1493ea);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.14);
}

.result-status-chip.outcome-open {
  border-color: rgba(0, 120, 212, 0.2);
  background: #f7fbff;
  color: #4d6f93;
}

.result-status-chip.outcome-sale {
  border-color: rgba(40, 156, 100, 0.24);
  background: #effcf4;
  color: #1c8a57;
}

.result-status-chip.outcome-appointment {
  border-color: rgba(0, 120, 212, 0.24);
  background: #edf6ff;
  color: #0f63a4;
}

.result-status-chip.outcome-not-interested,
.result-status-chip.outcome-bad-number,
.result-status-chip.outcome-hang-up {
  border-color: rgba(207, 61, 61, 0.22);
  background: #fff1f1;
  color: #b53a3a;
}

.result-status-chip.outcome-no-answer,
.result-status-chip.outcome-voicemail {
  border-color: rgba(177, 137, 27, 0.24);
  background: #fff8df;
  color: #9a7313;
}

.scope-count,
.scope-tag,
.agenda-time,
.timeline-badge,
.group-lead-status {
  border-color: rgba(0, 120, 212, 0.12);
  background: #eef6ff;
  color: #0f5f9f;
}

.timeline-priority {
  border-color: rgba(0, 120, 212, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 251, 255, 0.98));
  box-shadow: var(--shadow);
}

.timeline-priority-bad-number,
.timeline-entry.outcome-bad-number,
.timeline-badge.outcome-bad-number {
  border-color: rgba(207, 61, 61, 0.24);
  background: #fff1f1;
  color: #b53a3a;
}

.timeline-entry.outcome-bad-number .timeline-head strong,
.timeline-priority-bad-number strong {
  color: #b53a3a;
}

.timeline-badge.outcome-sale,
.timeline-entry.outcome-sale {
  border-color: rgba(40, 156, 100, 0.24);
  background: #effcf4;
  color: #1c8a57;
}

.timeline-badge.outcome-appointment,
.timeline-entry.outcome-appointment {
  border-color: rgba(0, 120, 212, 0.24);
  background: #edf6ff;
  color: #0f63a4;
}

.timeline-badge.outcome-not-interested,
.timeline-badge.outcome-hang-up,
.timeline-entry.outcome-not-interested,
.timeline-entry.outcome-hang-up {
  border-color: rgba(207, 61, 61, 0.22);
  background: #fff3f3;
  color: #b53a3a;
}

.timeline-badge.outcome-no-answer,
.timeline-badge.outcome-voicemail,
.timeline-entry.outcome-no-answer,
.timeline-entry.outcome-voicemail {
  border-color: rgba(177, 137, 27, 0.24);
  background: #fff8df;
  color: #9a7313;
}

.group-lead-status.outcome-open {
  border-color: rgba(0, 120, 212, 0.2);
  background: #f7fbff;
  color: #4d6f93;
}

.group-lead-status.outcome-sale {
  border-color: rgba(40, 156, 100, 0.24);
  background: #effcf4;
  color: #1c8a57;
}

.group-lead-status.outcome-appointment {
  border-color: rgba(0, 120, 212, 0.24);
  background: #edf6ff;
  color: #0f63a4;
}

.group-lead-status.outcome-not-interested,
.group-lead-status.outcome-bad-number,
.group-lead-status.outcome-hang-up {
  border-color: rgba(207, 61, 61, 0.22);
  background: #fff1f1;
  color: #b53a3a;
}

.group-lead-status.outcome-no-answer,
.group-lead-status.outcome-voicemail {
  border-color: rgba(177, 137, 27, 0.24);
  background: #fff8df;
  color: #9a7313;
}

.builder-counts span,
.builder-filter-panel,
.builder-save-actions {
  border-color: rgba(0, 120, 212, 0.14);
  background: #f7fbff;
  color: #5a7390;
}

.builder-counts strong {
  color: #10263d;
}

.state-filter-chip {
  border-color: rgba(0, 120, 212, 0.14);
  background: #f4f9ff;
  color: #17406a;
}

.state-filter-chip span {
  color: #6283a7;
}

.state-filter-chip.active {
  border-color: rgba(0, 120, 212, 0.48);
  background: linear-gradient(135deg, #0078d4, #1493ea);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.18);
}

.state-filter-chip.active span {
  color: rgba(255, 255, 255, 0.9);
}

.mini-meta {
  color: #5a7390;
}

.scope-pill {
  border-color: rgba(0, 120, 212, 0.14);
  background: #f4f9ff;
  color: #17406a;
}

.scope-pill span {
  color: #6283a7;
}

.scope-pill.active,
.chip.active {
  border-color: rgba(0, 120, 212, 0.48);
  background: linear-gradient(135deg, #0078d4, #1493ea);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.18);
}

.scope-pill.active span {
  color: rgba(255, 255, 255, 0.9);
}

.badge,
.lead-card,
.empty-state,
.timeline-icon,
.timeline-icon.confirm,
.timeline-icon.cancel,
table,
.mapping-row,
.group-lead-row.selected,
.scope-group-card.current-open {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(244, 249, 255, 0.98));
}

.badge,
.lead-card,
.empty-state,
.mapping-row,
table {
  border-color: rgba(0, 120, 212, 0.14);
}

.badge strong,
.contact-item strong,
.detail-item strong,
.hero-metric strong,
.session-card strong,
.lead-phone,
.lead-email,
.lead-city,
.lead-state {
  color: #10263d;
}

.chip {
  border-color: rgba(0, 120, 212, 0.14);
  background: #f3f8fe;
  color: #1d4874;
}

.empty-state {
  background: rgba(255, 255, 255, 0.72);
  border-style: solid;
}

.timeline-head time,
.timeline-note {
  color: #5d7894;
}

.timeline-icon {
  border-color: rgba(0, 120, 212, 0.16);
  background: #ffffff;
  color: #0f609f;
  box-shadow: none;
}

.timeline-icon.confirm {
  border-color: rgba(40, 156, 100, 0.22);
  background: #f0fff6;
  color: #1c8a57;
}

.timeline-icon.cancel {
  border-color: rgba(207, 61, 61, 0.22);
  background: #fff2f2;
  color: #b53a3a;
}

.scope-group-card.phone-active,
.group-lead-row.selected {
  border-color: rgba(0, 120, 212, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 120, 212, 0.08),
    var(--shadow);
}

.modal-backdrop {
  background: rgba(227, 236, 247, 0.7);
  backdrop-filter: blur(6px);
}

th,
td {
  border-bottom-color: rgba(0, 120, 212, 0.12);
}

th {
  background: #f6f9fd;
  color: #547495;
}

td {
  color: #18324c;
}

.toast {
  border-color: rgba(0, 120, 212, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: #14304a;
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(207, 61, 61, 0.22);
  background: rgba(255, 244, 244, 0.98);
  color: #9f2f2f;
}

@media (hover: hover) {
  .mobile-panel-toggle:hover .mobile-panel-icon {
    border-color: rgba(0, 120, 212, 0.26);
    background: #f2f8ff;
    color: #0e639c;
    box-shadow: 0 8px 18px rgba(0, 120, 212, 0.08);
  }

  .auth-card:hover,
  .hero:hover,
  .hero-metric:hover,
  .session-card:hover,
  .panel:hover,
  .panel-lite:hover,
  .lead-card:hover,
  .list-card:hover,
  .result-card:hover,
  .agenda-card:hover,
  .timeline-entry:hover,
  .detail-item:hover,
  .history-entry:hover,
  .mapping-row:hover,
  .badge:hover,
  .scope-group-card:hover,
  .group-lead-row:hover,
  .modal-dialog:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 120, 212, 0.24);
    box-shadow:
      0 0 0 1px rgba(0, 120, 212, 0.06),
      var(--shadow-strong);
  }

  .field input:hover,
  .field select:hover,
  .field textarea:hover {
    box-shadow:
      0 0 0 1px rgba(0, 120, 212, 0.06),
      0 8px 18px rgba(0, 120, 212, 0.06);
  }

  .button:hover:not(:disabled),
  .call-button:hover {
    border-color: rgba(0, 120, 212, 0.62);
    background: linear-gradient(135deg, #0a86e4, #1ba2f5);
    box-shadow:
      0 14px 28px rgba(0, 120, 212, 0.2),
      0 0 0 1px rgba(0, 120, 212, 0.08);
    filter: none;
  }

  .copy-button:hover {
    border-color: rgba(0, 120, 212, 0.28);
    background: #edf6ff;
    color: #0d67ad;
    box-shadow: 0 8px 18px rgba(0, 120, 212, 0.08);
  }

  .button.muted:hover:not(:disabled) {
    background: #f2f8ff;
    border-color: rgba(0, 120, 212, 0.28);
    color: #0d67ad;
    box-shadow: 0 10px 22px rgba(0, 120, 212, 0.08);
  }

  .button.danger:hover:not(:disabled) {
    background: #ffeceb;
    border-color: rgba(207, 61, 61, 0.28);
    color: #aa2d2d;
    box-shadow: 0 10px 22px rgba(207, 61, 61, 0.08);
  }

  .auth-tab:hover:not(.active),
  .tab:hover:not(.active),
  .scope-pill:hover,
  .chip:hover,
  .timeline-icon:hover {
    border-color: rgba(0, 120, 212, 0.26);
    background: #f2f8ff;
    color: #0e639c;
    box-shadow: 0 8px 18px rgba(0, 120, 212, 0.08);
  }

  .auth-tab.active:hover,
  .tab.active:hover,
  .scope-pill.active:hover,
  .chip.active:hover {
    background: linear-gradient(135deg, #0a86e4, #1ba2f5);
    box-shadow: 0 14px 28px rgba(0, 120, 212, 0.2);
  }

  .timeline-icon.confirm:hover {
    background: #e7fff0;
    border-color: rgba(40, 156, 100, 0.3);
    color: #187b4d;
  }

  .timeline-icon.cancel:hover {
    background: #ffeaea;
    border-color: rgba(207, 61, 61, 0.3);
    color: #aa2f2f;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #040913;
  --bg-deep: #020611;
  --bg-panel: rgba(8, 20, 42, 0.9);
  --surface: rgba(10, 24, 49, 0.88);
  --surface-strong: rgba(15, 32, 61, 0.96);
  --surface-soft: rgba(18, 37, 68, 0.74);
  --ink: #eef4ff;
  --muted: #8ea7c9;
  --line: rgba(67, 122, 202, 0.3);
  --brand: #2f7fd1;
  --brand-strong: #173f71;
  --brand-soft: rgba(47, 127, 209, 0.2);
  --gold: #d7bf70;
  --warm: #c7b06a;
  --danger: #d06a66;
  --shadow: 0 28px 60px rgba(0, 5, 18, 0.5);
  --shadow-strong: 0 34px 78px rgba(0, 5, 18, 0.58);
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  color: var(--ink);
  background: linear-gradient(180deg, #09152a 0%, #040913 42%, #02050d 100%);
}

html[data-theme="dark"] body::before {
  inset: -10% -18%;
  background:
    radial-gradient(circle at 18% 18%, rgba(77, 120, 189, 0.42), transparent 24%),
    radial-gradient(circle at 72% 12%, rgba(19, 40, 88, 0.64), transparent 30%),
    radial-gradient(circle at 82% 78%, rgba(66, 101, 156, 0.32), transparent 24%),
    radial-gradient(circle at 14% 72%, rgba(13, 29, 66, 0.44), transparent 26%),
    linear-gradient(124deg, rgba(99, 142, 208, 0.26) 0%, rgba(18, 34, 67, 0.18) 28%, rgba(3, 8, 19, 0.72) 52%, rgba(56, 86, 136, 0.24) 76%, rgba(4, 10, 22, 0.82) 100%);
  filter: blur(34px) saturate(110%);
  opacity: 0.96;
  transform: scale(1.08);
}

html[data-theme="dark"] body::after {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.028), transparent 36%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 2px,
      transparent 2px,
      transparent 9px
    );
  opacity: 0.22;
  mix-blend-mode: screen;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #627da4;
}

html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"] {
  color-scheme: dark;
}

html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .hero,
html[data-theme="dark"] .hero-metric,
html[data-theme="dark"] .session-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .panel-lite,
html[data-theme="dark"] .lead-card,
html[data-theme="dark"] .lead-address-card,
html[data-theme="dark"] .list-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .agenda-card,
html[data-theme="dark"] .timeline-entry,
html[data-theme="dark"] .detail-item,
html[data-theme="dark"] .history-entry,
html[data-theme="dark"] .mapping-row,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .modal-dialog,
html[data-theme="dark"] .scope-group-card,
html[data-theme="dark"] .group-lead-row {
  border-color: rgba(74, 124, 203, 0.22);
  background: linear-gradient(180deg, rgba(15, 32, 61, 0.96), rgba(10, 24, 49, 0.94));
  box-shadow: var(--shadow);
  color: var(--ink);
}

html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .modal-dialog {
  background:
    radial-gradient(circle at top center, rgba(69, 109, 176, 0.24), transparent 32%),
    linear-gradient(145deg, rgba(12, 27, 54, 0.97), rgba(8, 18, 38, 0.98));
}

html[data-theme="dark"] .hero {
  border-color: rgba(52, 104, 178, 0.28);
  background:
    radial-gradient(circle at 18% 0%, rgba(70, 109, 175, 0.2), transparent 32%),
    linear-gradient(135deg, rgba(10, 23, 45, 0.98), rgba(6, 14, 30, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(162, 199, 255, 0.08),
    var(--shadow);
}

html[data-theme="dark"] .hero::after {
  background: linear-gradient(135deg, rgba(47, 127, 209, 0.24), rgba(23, 63, 113, 0.08));
}

html[data-theme="dark"] .theme-toggle-track {
  border-color: rgba(71, 119, 191, 0.28);
  background: rgba(10, 24, 49, 0.94);
  color: #dbe8fb;
  box-shadow: 0 14px 28px rgba(0, 8, 24, 0.32);
}

html[data-theme="dark"] .auth-card h1,
html[data-theme="dark"] .panel h2,
html[data-theme="dark"] .panel h3,
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .list-card h3,
html[data-theme="dark"] .result-card h3,
html[data-theme="dark"] .agenda-card h3,
html[data-theme="dark"] .timeline-head strong,
html[data-theme="dark"] .group-lead-copy strong,
html[data-theme="dark"] .mapping-header,
html[data-theme="dark"] .empty-state h3,
html[data-theme="dark"] .lead-address-head h4 {
  color: #f4f8ff;
}

html[data-theme="dark"] .auth-copy,
html[data-theme="dark"] .hero-copy,
html[data-theme="dark"] .muted-copy,
html[data-theme="dark"] .muted-copy.compact,
html[data-theme="dark"] .history-entry time,
html[data-theme="dark"] .agenda-date,
html[data-theme="dark"] .field span,
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .badge span,
html[data-theme="dark"] .contact-item span,
html[data-theme="dark"] .hero-metric span,
html[data-theme="dark"] .session-card span,
html[data-theme="dark"] .detail-address-line.secondary,
html[data-theme="dark"] .lead-dob-meta {
  color: #9eb8db;
}

html[data-theme="dark"] .eyebrow {
  color: #7e99bf;
}

html[data-theme="dark"] .badge strong,
html[data-theme="dark"] .contact-item strong,
html[data-theme="dark"] .detail-item strong,
html[data-theme="dark"] .hero-metric strong,
html[data-theme="dark"] .session-card strong,
html[data-theme="dark"] .detail-address-line {
  color: #f4f8ff;
}

html[data-theme="dark"] .metric-mini-grid span {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .metric-popover {
  border-color: rgba(71, 119, 191, 0.26);
  background: #102342;
  color: #dbe8fb;
  box-shadow: 0 18px 38px rgba(0, 8, 24, 0.36);
}

html[data-theme="dark"] .metric-popover-head {
  border-bottom-color: rgba(71, 119, 191, 0.18);
}

html[data-theme="dark"] .metric-popover-head strong,
html[data-theme="dark"] .metric-history-row strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .metric-popover-head span,
html[data-theme="dark"] .metric-history-row span {
  color: #9eb8db;
}

html[data-theme="dark"] .metric-history-row {
  background: rgba(16, 34, 64, 0.72);
}

html[data-theme="dark"] .metric-history-row.current {
  border-color: rgba(86, 151, 231, 0.36);
  background: rgba(21, 80, 142, 0.28);
}

html[data-theme="dark"] .auth-tab,
html[data-theme="dark"] .tab {
  background: rgba(14, 30, 57, 0.74);
  border-color: rgba(64, 114, 188, 0.22);
  color: #abc0dc;
  box-shadow: none;
}

html[data-theme="dark"] .auth-tab.active,
html[data-theme="dark"] .tab.active {
  background: linear-gradient(135deg, rgba(28, 60, 110, 0.94), rgba(18, 39, 74, 0.98));
  border-color: rgba(90, 145, 228, 0.42);
  color: #f3f7ff;
  box-shadow: inset 0 1px 0 rgba(192, 222, 255, 0.08);
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(18, 37, 68, 0.74);
  color: #eef4ff;
  box-shadow: none;
}

html[data-theme="dark"] .field input:hover,
html[data-theme="dark"] .field select:hover,
html[data-theme="dark"] .field textarea:hover {
  border-color: rgba(113, 166, 245, 0.34);
  background: rgba(19, 40, 73, 0.82);
}

html[data-theme="dark"] .field input:focus-visible,
html[data-theme="dark"] .field select:focus-visible,
html[data-theme="dark"] .field textarea:focus-visible {
  border-color: rgba(133, 183, 255, 0.64);
  background: rgba(21, 42, 75, 0.92);
  box-shadow:
    0 0 0 3px rgba(62, 131, 214, 0.18),
    0 16px 30px rgba(5, 16, 36, 0.24);
}

html[data-theme="dark"] .button,
html[data-theme="dark"] .call-button {
  border-color: rgba(67, 122, 202, 0.42);
  background: linear-gradient(135deg, #3484d7, #205ea5);
  color: #f7fbff;
  box-shadow:
    inset 0 1px 0 rgba(223, 238, 255, 0.12),
    0 10px 24px rgba(10, 33, 76, 0.32);
}

html[data-theme="dark"] .copy-button {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(19, 38, 68, 0.08);
  color: #8ebfff;
  box-shadow: none;
}

html[data-theme="dark"] .button.muted {
  background: rgba(19, 38, 68, 0.86);
  border-color: rgba(71, 119, 191, 0.28);
  color: #dbe8fb;
}

html[data-theme="dark"] .button.danger {
  background: rgba(90, 34, 38, 0.84);
  border-color: rgba(180, 84, 92, 0.28);
  color: #ffd7d3;
}

html[data-theme="dark"] .hero-metric,
html[data-theme="dark"] .session-card,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .lead-address-card {
  border-color: rgba(74, 124, 203, 0.3);
  background: linear-gradient(180deg, rgba(20, 39, 73, 0.94), rgba(11, 26, 52, 0.96));
}

html[data-theme="dark"] .notice {
  border-color: rgba(69, 125, 208, 0.26);
  background: rgba(19, 41, 76, 0.72);
  color: #cfe0f8;
}

html[data-theme="dark"] .notice.warm {
  border-color: rgba(195, 169, 98, 0.24);
  background: rgba(67, 54, 24, 0.58);
  color: #f0dfaa;
}

html[data-theme="dark"] .scope-count,
html[data-theme="dark"] .scope-tag,
html[data-theme="dark"] .agenda-time,
html[data-theme="dark"] .timeline-badge,
html[data-theme="dark"] .group-lead-status,
html[data-theme="dark"] .detail-copy-chip {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
}

html[data-theme="dark"] .empty-state {
  border-color: rgba(74, 128, 208, 0.28);
  background: rgba(12, 25, 47, 0.72);
}

html[data-theme="dark"] .scope-pill {
  border-color: rgba(69, 118, 194, 0.28);
  background: rgba(16, 35, 64, 0.84);
  color: #dbe7fa;
}

html[data-theme="dark"] .scope-pill span {
  color: #8ca8ce;
}

html[data-theme="dark"] .scope-pill.active,
html[data-theme="dark"] .chip.active {
  border-color: rgba(101, 154, 236, 0.46);
  background: linear-gradient(135deg, rgba(41, 88, 154, 0.98), rgba(18, 44, 86, 0.98));
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(214, 232, 255, 0.1),
    0 14px 28px rgba(8, 24, 57, 0.26);
}

html[data-theme="dark"] .chip {
  border-color: rgba(62, 109, 182, 0.28);
  background: rgba(20, 39, 69, 0.88);
  color: #d9e7fb;
}

html[data-theme="dark"] .group-lead-status.outcome-open {
  border-style: dashed;
}

html[data-theme="dark"] .group-lead-status.outcome-sale,
html[data-theme="dark"] .timeline-badge.outcome-sale,
html[data-theme="dark"] .timeline-entry.outcome-sale {
  border-color: rgba(38, 156, 98, 0.28);
  background: rgba(12, 92, 57, 0.16);
  color: #c6ffe0;
}

html[data-theme="dark"] .group-lead-status.outcome-appointment,
html[data-theme="dark"] .timeline-badge.outcome-appointment,
html[data-theme="dark"] .timeline-entry.outcome-appointment {
  border-color: rgba(0, 120, 212, 0.32);
  background: rgba(0, 120, 212, 0.14);
  color: #d9efff;
}

html[data-theme="dark"] .group-lead-status.outcome-not-interested,
html[data-theme="dark"] .group-lead-status.outcome-bad-number,
html[data-theme="dark"] .group-lead-status.outcome-hang-up,
html[data-theme="dark"] .timeline-badge.outcome-not-interested,
html[data-theme="dark"] .timeline-badge.outcome-bad-number,
html[data-theme="dark"] .timeline-badge.outcome-hang-up,
html[data-theme="dark"] .timeline-entry.outcome-not-interested,
html[data-theme="dark"] .timeline-entry.outcome-bad-number,
html[data-theme="dark"] .timeline-entry.outcome-hang-up,
html[data-theme="dark"] .timeline-priority-bad-number {
  border-color: rgba(207, 61, 61, 0.26);
  background: rgba(207, 61, 61, 0.12);
  color: #ffd9d9;
}

html[data-theme="dark"] .group-lead-status.outcome-no-answer,
html[data-theme="dark"] .group-lead-status.outcome-voicemail,
html[data-theme="dark"] .timeline-badge.outcome-no-answer,
html[data-theme="dark"] .timeline-badge.outcome-voicemail,
html[data-theme="dark"] .timeline-entry.outcome-no-answer,
html[data-theme="dark"] .timeline-entry.outcome-voicemail {
  border-color: rgba(167, 131, 40, 0.26);
  background: rgba(185, 145, 38, 0.12);
  color: #ffefb7;
}

html[data-theme="dark"] .timeline-entry.outcome-bad-number .timeline-head strong,
html[data-theme="dark"] .timeline-priority-bad-number strong {
  color: #ffd9d9;
}

@media (hover: hover) {
  html[data-theme="dark"] .auth-card:hover,
  html[data-theme="dark"] .hero:hover,
  html[data-theme="dark"] .hero-metric:hover,
  html[data-theme="dark"] .session-card:hover,
  html[data-theme="dark"] .panel:hover,
  html[data-theme="dark"] .panel-lite:hover,
  html[data-theme="dark"] .lead-card:hover,
  html[data-theme="dark"] .lead-address-card:hover,
  html[data-theme="dark"] .list-card:hover,
  html[data-theme="dark"] .result-card:hover,
  html[data-theme="dark"] .agenda-card:hover,
  html[data-theme="dark"] .timeline-entry:hover,
  html[data-theme="dark"] .detail-item:hover,
  html[data-theme="dark"] .history-entry:hover,
  html[data-theme="dark"] .mapping-row:hover,
  html[data-theme="dark"] .badge:hover,
  html[data-theme="dark"] .scope-group-card:hover,
  html[data-theme="dark"] .group-lead-row:hover,
  html[data-theme="dark"] .modal-dialog:hover {
    border-color: rgba(113, 166, 245, 0.46);
    box-shadow:
      inset 0 1px 0 rgba(182, 216, 255, 0.08),
      var(--shadow-strong),
      0 0 0 1px rgba(112, 168, 255, 0.12),
      0 0 28px rgba(44, 102, 184, 0.12);
  }

  html[data-theme="dark"] .field input:hover,
  html[data-theme="dark"] .field select:hover,
  html[data-theme="dark"] .field textarea:hover {
    box-shadow:
      0 0 0 1px rgba(112, 168, 255, 0.08),
      0 8px 18px rgba(0, 8, 24, 0.18);
  }

  html[data-theme="dark"] .copy-button:hover {
    border-color: rgba(113, 166, 245, 0.34);
    background: rgba(24, 47, 84, 0.92);
    color: #dce9fb;
    box-shadow: 0 8px 18px rgba(0, 8, 24, 0.18);
  }

  html[data-theme="dark"] .button.muted:hover:not(:disabled) {
    background: rgba(24, 47, 84, 0.92);
    border-color: rgba(113, 166, 245, 0.34);
    color: #eef4ff;
    box-shadow: 0 10px 22px rgba(0, 8, 24, 0.18);
  }

  html[data-theme="dark"] .button.danger:hover:not(:disabled) {
    background: rgba(112, 41, 48, 0.88);
    border-color: rgba(213, 102, 109, 0.34);
    color: #ffe4e2;
    box-shadow: 0 10px 22px rgba(49, 10, 14, 0.18);
  }

  html[data-theme="dark"] .auth-tab:hover:not(.active),
  html[data-theme="dark"] .tab:hover:not(.active),
  html[data-theme="dark"] .scope-pill:hover,
  html[data-theme="dark"] .chip:hover,
  html[data-theme="dark"] .timeline-icon:hover {
    border-color: rgba(113, 166, 245, 0.34);
    background: rgba(24, 47, 84, 0.92);
    color: #eef4ff;
    box-shadow: 0 8px 18px rgba(0, 8, 24, 0.18);
  }

  html[data-theme="dark"] .timeline-icon.confirm:hover {
    background: rgba(18, 83, 53, 0.88);
    border-color: rgba(84, 196, 136, 0.34);
    color: #d9ffe9;
  }

  html[data-theme="dark"] .timeline-icon.cancel:hover {
    background: rgba(98, 29, 36, 0.88);
    border-color: rgba(213, 102, 109, 0.34);
    color: #ffe4e2;
  }
}

/* Batch outcome stats */
.modal-backdrop {
  background: rgba(7, 18, 36, 0.58);
  backdrop-filter: blur(12px) saturate(90%);
  -webkit-backdrop-filter: blur(12px) saturate(90%);
}

.scope-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.scope-stat-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 999px;
  background: #f4f9ff;
  color: #17406a;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.scope-stat-icon,
.scope-stat-icon svg {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.scope-stat-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scope-stat-bad-number,
.scope-stat-not-interested {
  border-color: rgba(207, 61, 61, 0.22);
  background: #fff1f1;
  color: #b53a3a;
}

.scope-stat-no-answer {
  border-color: rgba(177, 137, 27, 0.24);
  background: #fff8df;
  color: #9a7313;
}

.scope-stat-appointment {
  border-color: rgba(0, 120, 212, 0.2);
  background: #eef7ff;
  color: #0d67ad;
}

.scope-stat-dials {
  border-color: rgba(0, 120, 212, 0.18);
  background: #eef6ff;
  color: #0f5f9f;
}

.scope-stat-sale {
  border-color: rgba(40, 156, 100, 0.24);
  background: #effcf4;
  color: #1c8a57;
}

html[data-theme="dark"] .modal-backdrop {
  background: rgba(1, 7, 18, 0.68);
  backdrop-filter: blur(12px) saturate(90%);
  -webkit-backdrop-filter: blur(12px) saturate(90%);
}

html[data-theme="dark"] .scope-stat-chip {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
}

html[data-theme="dark"] .scope-stat-bad-number,
html[data-theme="dark"] .scope-stat-not-interested {
  border-color: rgba(207, 61, 61, 0.26);
  background: rgba(207, 61, 61, 0.12);
  color: #ffd9d9;
}

html[data-theme="dark"] .scope-stat-no-answer {
  border-color: rgba(167, 131, 40, 0.26);
  background: rgba(185, 145, 38, 0.12);
  color: #ffefb7;
}

html[data-theme="dark"] .scope-stat-appointment {
  border-color: rgba(86, 151, 231, 0.34);
  background: rgba(21, 80, 142, 0.22);
  color: #bfe0ff;
}

html[data-theme="dark"] .scope-stat-dials {
  border-color: rgba(0, 120, 212, 0.32);
  background: rgba(0, 120, 212, 0.14);
  color: #d9efff;
}

html[data-theme="dark"] .scope-stat-sale {
  border-color: rgba(38, 156, 98, 0.28);
  background: rgba(12, 92, 57, 0.16);
  color: #c6ffe0;
}

html[data-theme="dark"] .builder-counts span,
html[data-theme="dark"] .builder-filter-panel,
html[data-theme="dark"] .builder-save-actions {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.54);
  color: #9eb8db;
}

html[data-theme="dark"] .builder-counts strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .state-filter-chip {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
}

html[data-theme="dark"] .state-filter-chip span {
  color: #9eb8db;
}

html[data-theme="dark"] .state-filter-chip.active {
  border-color: rgba(101, 154, 236, 0.46);
  background: linear-gradient(135deg, rgba(41, 88, 154, 0.98), rgba(18, 44, 86, 0.98));
  color: #ffffff;
}

html[data-theme="dark"] .state-filter-chip.active span {
  color: #e4efff;
}

@media (hover: hover) {
  html[data-theme="dark"] .state-filter-chip:hover {
    border-color: rgba(113, 166, 245, 0.34);
    background: rgba(24, 47, 84, 0.92);
    color: #eef4ff;
    box-shadow: 0 8px 18px rgba(0, 8, 24, 0.18);
  }
}

/* Compact list accordion */
.list-grid {
  display: grid;
  gap: 10px;
}

.list-accordion {
  position: relative;
  overflow: visible;
  padding: 0;
  border-radius: 14px;
}

.list-accordion.active {
  border-color: rgba(0, 120, 212, 0.28);
  box-shadow:
    0 0 0 1px rgba(0, 120, 212, 0.06),
    var(--shadow);
}

.list-row-toggle {
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.list-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
}

.list-name-stack {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.list-name-stack strong {
  overflow: hidden;
  color: #10263d;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-name-stack span,
.list-row-summary,
.list-active-summary {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.list-row-summary {
  display: block;
  margin-top: 8px;
}

.list-chevron {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.list-chevron::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #5f7994;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.list-accordion.expanded .list-chevron::before {
  transform: rotate(225deg);
}

.list-card-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.list-expanded-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-expanded-meta .muted-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-actions.compact {
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 2px;
}

.list-actions.compact > .button {
  flex: 1;
}

.list-overflow {
  position: relative;
  flex: 0 0 auto;
}

.list-menu-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 120, 212, 0.18);
  border-radius: 999px;
  background: #f4f9ff;
  color: #0b5a99;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.list-overflow-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 150px;
  padding: 6px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(52, 92, 140, 0.18);
}

.list-overflow-menu button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #17406a;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.list-overflow-menu button.danger {
  color: #b13131;
}

@media (hover: hover) {
  .list-row-toggle:hover .list-name-stack strong {
    color: #005ea6;
  }

  .list-menu-button:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 120, 212, 0.28);
    background: #edf6ff;
    color: #0d67ad;
    box-shadow: 0 8px 18px rgba(0, 120, 212, 0.08);
  }

  .list-overflow-menu button:hover {
    background: #eef6ff;
    color: #0d67ad;
  }

  .list-overflow-menu button.danger:hover {
    background: #fff1f1;
    color: #aa2d2d;
  }
}

html[data-theme="dark"] .list-accordion.active {
  border-color: rgba(101, 154, 236, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(214, 232, 255, 0.08),
    var(--shadow);
}

html[data-theme="dark"] .list-name-stack strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .list-name-stack span,
html[data-theme="dark"] .list-row-summary,
html[data-theme="dark"] .list-active-summary {
  color: #9eb8db;
}

html[data-theme="dark"] .list-chevron::before {
  color: #9eb8db;
}

html[data-theme="dark"] .list-menu-button {
  border-color: rgba(71, 119, 191, 0.28);
  background: rgba(19, 38, 68, 0.86);
  color: #dbe8fb;
}

html[data-theme="dark"] .list-overflow-menu {
  border-color: rgba(71, 119, 191, 0.26);
  background: #102342;
  box-shadow: 0 18px 38px rgba(0, 8, 24, 0.36);
}

html[data-theme="dark"] .list-overflow-menu button {
  color: #dbe8fb;
}

html[data-theme="dark"] .list-overflow-menu button.danger {
  color: #ffd7d3;
}

@media (hover: hover) {
  html[data-theme="dark"] .list-row-toggle:hover .list-name-stack strong {
    color: #dceaff;
  }

  html[data-theme="dark"] .list-menu-button:hover,
  html[data-theme="dark"] .list-overflow-menu button:hover {
    border-color: rgba(113, 166, 245, 0.34);
    background: rgba(24, 47, 84, 0.92);
    color: #eef4ff;
  }

  html[data-theme="dark"] .list-overflow-menu button.danger:hover {
    background: rgba(112, 41, 48, 0.88);
    color: #ffe4e2;
  }
}

/* Batch modal polish */
.modal-dialog-scope {
  width: min(900px, 100%);
}

.scope-modal-head {
  align-items: flex-start;
  gap: 16px;
}

.scope-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.scope-modal-actions .button {
  white-space: nowrap;
}

.scope-group-card {
  position: relative;
  overflow: visible;
  gap: 14px;
  padding: 16px;
  border-color: rgba(0, 120, 212, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 255, 0.98));
}

.scope-group-card.current-open {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(241, 248, 255, 0.98));
}

.scope-group-card.phone-active {
  border-color: rgba(0, 120, 212, 0.34);
  box-shadow:
    0 0 0 1px rgba(0, 120, 212, 0.08),
    0 16px 36px rgba(53, 101, 153, 0.12);
}

.scope-group-card.phone-active::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0078d4, #62b7f8);
  box-shadow: 0 0 18px rgba(0, 120, 212, 0.28);
}

.scope-group-copy {
  min-width: 0;
  gap: 10px;
}

.scope-group-head {
  align-items: flex-start;
}

.scope-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.scope-status,
.scope-phone-active {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.scope-status {
  border: 1px solid rgba(0, 120, 212, 0.13);
  background: #eef6ff;
  color: #16558d;
}

.scope-phone-active {
  border: 1px solid rgba(0, 120, 212, 0.2);
  background: #dff1ff;
  color: #075f9e;
}

.scope-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 120, 212, 0.09);
}

.scope-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0078d4, #55b8f6);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scope-group-stats {
  min-width: 0;
}

.scope-group-stats .scope-stat-row {
  margin-top: 0;
}

.scope-group-actions {
  align-items: center;
  justify-content: flex-start;
}

.scope-overflow {
  z-index: 4;
}

.scope-overflow-menu {
  right: 0;
}

@media (min-width: 720px) {
  .modal-dialog-scope {
    width: min(900px, calc(100vw - 48px));
    padding: 24px;
  }

  .scope-group-card {
    grid-template-columns: minmax(245px, 1.05fr) minmax(210px, 0.75fr) auto;
    align-items: center;
    gap: 18px;
  }

  .scope-group-stats {
    display: flex;
    align-items: center;
  }

  .scope-group-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .scope-group-actions > .button {
    min-width: 116px;
  }
}

@media (max-width: 540px) {
  .scope-modal-head {
    align-items: stretch;
  }

  .scope-modal-actions {
    width: 100%;
    justify-content: stretch;
    margin-left: 0;
  }

  .scope-modal-actions .button {
    flex: 1;
  }
}

html[data-theme="dark"] .modal-dialog-scope {
  background: linear-gradient(180deg, rgba(12, 27, 53, 0.98), rgba(7, 17, 36, 0.98));
}

html[data-theme="dark"] .scope-group-card {
  border-color: rgba(71, 119, 191, 0.24);
  background: linear-gradient(180deg, rgba(15, 32, 61, 0.94), rgba(10, 24, 49, 0.94));
}

html[data-theme="dark"] .scope-group-card.current-open {
  background: linear-gradient(180deg, rgba(19, 40, 75, 0.96), rgba(10, 24, 49, 0.96));
}

html[data-theme="dark"] .scope-group-card.phone-active {
  border-color: rgba(97, 158, 244, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(214, 232, 255, 0.08),
    0 0 0 1px rgba(97, 158, 244, 0.1),
    0 20px 40px rgba(0, 8, 24, 0.26);
}

html[data-theme="dark"] .scope-group-card.phone-active::before {
  background: linear-gradient(180deg, #50a6f4, #286fc9);
  box-shadow: 0 0 20px rgba(80, 166, 244, 0.3);
}

html[data-theme="dark"] .scope-status {
  border-color: rgba(71, 119, 191, 0.24);
  background: rgba(16, 34, 64, 0.76);
  color: #cfe0f8;
}

html[data-theme="dark"] .scope-phone-active {
  border-color: rgba(95, 159, 244, 0.3);
  background: rgba(34, 101, 184, 0.22);
  color: #dcebff;
}

html[data-theme="dark"] .scope-progress {
  background: rgba(3, 12, 28, 0.64);
}

html[data-theme="dark"] .scope-progress span {
  background: linear-gradient(90deg, #2f83d8, #63b7ff);
}

/* Group builder smart filters */
.builder-quick-filter-panel {
  gap: 10px;
}

.quick-filter-row,
.builder-lead-stat-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.quick-filter-chip,
.builder-lead-stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 999px;
  background: #f3f8ff;
  color: #19527f;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.quick-filter-chip {
  min-height: 34px;
  padding: 7px 10px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.quick-filter-chip span {
  color: #6b86a1;
  font-size: 0.76rem;
  font-weight: 750;
}

.quick-filter-chip.active {
  border-color: rgba(0, 120, 212, 0.3);
  background: linear-gradient(135deg, #0f8fe5, #0b72bd);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.16);
}

.quick-filter-chip.active span {
  color: rgba(255, 255, 255, 0.84);
}

.builder-lead-stat-row {
  gap: 6px;
}

.builder-lead-stat-chip {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

.builder-lead-stat-icon,
.builder-lead-stat-icon svg {
  display: inline-flex;
  width: 13px;
  height: 13px;
}

.builder-lead-stat-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.builder-lead-stat-chip.stat-open {
  border-style: dashed;
  background: #f7fbff;
  color: #668099;
}

.builder-lead-stat-chip.stat-dials {
  border-color: rgba(0, 120, 212, 0.18);
  background: #eef6ff;
  color: #0f5f9f;
}

.builder-lead-stat-chip.stat-bad-number,
.builder-lead-stat-chip.stat-not-interested {
  border-color: rgba(207, 61, 61, 0.22);
  background: #fff1f1;
  color: #b53a3a;
}

.builder-lead-stat-chip.stat-no-answer {
  border-color: rgba(177, 137, 27, 0.24);
  background: #fff8df;
  color: #9a7313;
}

.builder-lead-stat-chip.stat-appointment {
  border-color: rgba(0, 120, 212, 0.2);
  background: #eef7ff;
  color: #0d67ad;
}

.builder-lead-stat-chip.stat-sale {
  border-color: rgba(40, 156, 100, 0.24);
  background: #effcf4;
  color: #1c8a57;
}

@media (hover: hover) {
  .quick-filter-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 120, 212, 0.26);
    background: #edf6ff;
    color: #0d67ad;
    box-shadow: 0 8px 18px rgba(0, 120, 212, 0.08);
  }

  .quick-filter-chip.active:hover {
    background: linear-gradient(135deg, #1599ee, #0a70ba);
    color: #ffffff;
  }
}

html[data-theme="dark"] .quick-filter-chip,
html[data-theme="dark"] .builder-lead-stat-chip {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
}

html[data-theme="dark"] .quick-filter-chip span {
  color: #9eb8db;
}

html[data-theme="dark"] .quick-filter-chip.active {
  border-color: rgba(101, 154, 236, 0.46);
  background: linear-gradient(135deg, rgba(41, 88, 154, 0.98), rgba(18, 44, 86, 0.98));
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 8, 24, 0.22);
}

html[data-theme="dark"] .quick-filter-chip.active span {
  color: #e4efff;
}

html[data-theme="dark"] .builder-lead-stat-chip.stat-open {
  border-color: rgba(95, 126, 172, 0.3);
  background: rgba(11, 24, 46, 0.54);
  color: #9eb8db;
}

html[data-theme="dark"] .builder-lead-stat-chip.stat-dials {
  border-color: rgba(0, 120, 212, 0.32);
  background: rgba(0, 120, 212, 0.14);
  color: #d9efff;
}

html[data-theme="dark"] .builder-lead-stat-chip.stat-bad-number,
html[data-theme="dark"] .builder-lead-stat-chip.stat-not-interested {
  border-color: rgba(207, 61, 61, 0.26);
  background: rgba(207, 61, 61, 0.12);
  color: #ffd9d9;
}

html[data-theme="dark"] .builder-lead-stat-chip.stat-no-answer {
  border-color: rgba(167, 131, 40, 0.26);
  background: rgba(185, 145, 38, 0.12);
  color: #ffefb7;
}

html[data-theme="dark"] .builder-lead-stat-chip.stat-appointment {
  border-color: rgba(86, 151, 231, 0.34);
  background: rgba(21, 80, 142, 0.22);
  color: #bfe0ff;
}

html[data-theme="dark"] .builder-lead-stat-chip.stat-sale {
  border-color: rgba(38, 156, 98, 0.28);
  background: rgba(12, 92, 57, 0.16);
  color: #c6ffe0;
}

@media (hover: hover) {
  html[data-theme="dark"] .quick-filter-chip:hover {
    border-color: rgba(113, 166, 245, 0.34);
    background: rgba(24, 47, 84, 0.92);
    color: #eef4ff;
  }
}

/* Account menu and admin foundation */
.hero {
  position: relative;
  z-index: 60;
  overflow: visible;
}

.hero::after {
  pointer-events: none;
}

.tabs,
main {
  position: relative;
  z-index: 1;
}

.hero-side,
.session-card {
  position: relative;
  z-index: 70;
}

.account-menu {
  position: relative;
  z-index: 90;
}

.account-button {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 3px;
  padding: 0 28px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.account-kicker {
  display: block;
  color: #9eb8db;
  font-size: 0.78rem;
  font-weight: 800;
}

.account-chevron {
  position: absolute;
  top: 50%;
  right: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #8eb0d8;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 180ms ease;
}

.account-button[aria-expanded="true"] .account-chevron {
  transform: translateY(-35%) rotate(225deg);
}

.role-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 999px;
  background: #eef6ff;
  color: #0f5f9f;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1;
}

.role-badge.admin {
  border-color: rgba(40, 156, 100, 0.24);
  background: #effcf4;
  color: #1c8a57;
}

.role-badge.upline {
  border-color: rgba(0, 120, 212, 0.24);
  background: #eaf5ff;
  color: #0d67ad;
}

.account-menu-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 12px);
  right: 0;
  display: grid;
  min-width: min(290px, calc(100vw - 48px));
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 18px;
  background: #ffffff;
  color: #16314d;
  box-shadow: 0 22px 48px rgba(39, 82, 130, 0.2);
  animation: surface-enter 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.account-menu-head {
  display: grid;
  gap: 4px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(0, 120, 212, 0.12);
}

.account-menu-head strong {
  color: #10263d;
  word-break: break-word;
}

.account-menu-head span {
  color: #5f7b97;
  font-size: 0.82rem;
}

.account-menu-popover button {
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #17406a;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.account-menu-popover button.danger {
  color: #b13131;
}

.account-menu-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 12px;
  color: #5f7b97;
  font-size: 0.88rem;
  font-weight: 800;
}

.account-detail-grid,
.admin-summary-grid {
  display: grid;
  gap: 12px;
}

.admin-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.admin-metric {
  background: #f7fbff;
  color: #10263d;
}

.admin-metric span {
  color: #5f7b97;
}

.admin-metric strong {
  color: #10263d;
}

.admin-placeholder {
  border-style: solid;
}

.invite-note {
  padding: 10px 12px;
  border: 1px solid rgba(0, 120, 212, 0.18);
  border-radius: 14px;
  background: #eef7ff;
  color: #17406a;
  font-size: 0.9rem;
  font-weight: 750;
}

.invite-note.error {
  border-color: rgba(190, 54, 54, 0.24);
  background: #fff4f2;
  color: #a93434;
}

.admin-toolbar {
  display: grid;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.admin-toolbar > div {
  display: grid;
  gap: 4px;
}

.admin-toolbar strong {
  color: #10263d;
  font-size: 1rem;
}

.admin-search-field {
  margin: 0;
}

.admin-toolbar-controls {
  display: grid;
  gap: 10px;
}

.admin-month-card {
  display: grid;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(239, 248, 255, 0.94), rgba(255, 255, 255, 0.86));
  box-shadow: 0 14px 34px rgba(39, 82, 130, 0.08);
}

.admin-month-card > div {
  display: grid;
  gap: 4px;
}

.admin-month-card strong {
  color: #10263d;
  font-size: 1.12rem;
}

.admin-month-kicker {
  color: #5f7b97;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-month-field {
  margin: 0;
}

.admin-user-list,
.admin-list-stack,
.admin-group-stack {
  display: grid;
  gap: 12px;
}

.admin-user-card,
.admin-list-card,
.admin-group-card {
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 34px rgba(39, 82, 130, 0.08);
}

.admin-user-card.expanded {
  border-color: rgba(0, 120, 212, 0.3);
}

.admin-user-head {
  display: grid;
  width: 100%;
  gap: 8px;
  padding: 14px 16px;
  border: 0;
  background: transparent;
  color: #10263d;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.admin-user-head > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-user-subline {
  color: #5f7b97;
  font-size: 0.86rem;
  font-weight: 700;
}

.admin-user-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.admin-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition:
    grid-template-rows 220ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.admin-collapse.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateY(0);
}

.admin-collapse-inner {
  min-height: 0;
  overflow: hidden;
}

.admin-user-summary {
  padding: 0 16px 14px;
}

.admin-metric-row,
.admin-stat-groups {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-stat-groups {
  grid-template-columns: 1fr;
}

.admin-stat-group {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 16px;
  background: rgba(247, 251, 255, 0.8);
}

.admin-stat-title {
  color: #5f7b97;
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.admin-stat-grid,
.admin-list-report-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-list-report-row {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.admin-list-report-row.compact {
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.admin-list-report-row .admin-mini-metric {
  padding: 8px 10px;
}

.admin-list-report-row.compact .admin-mini-metric {
  padding: 7px 9px;
}

.admin-mini-metric {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 14px;
  background: #f7fbff;
}

.admin-mini-metric-action {
  width: 100%;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.admin-mini-metric-action:hover,
.admin-mini-metric-action:focus-visible {
  border-color: rgba(0, 120, 212, 0.42);
  background: #eef7ff;
  box-shadow: 0 10px 22px rgba(0, 120, 212, 0.12);
  transform: translateY(-1px);
}

.admin-mini-metric-action:focus-visible {
  outline: 3px solid rgba(0, 120, 212, 0.22);
  outline-offset: 2px;
}

.admin-mini-metric span {
  color: #5f7b97;
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-mini-metric strong {
  color: #10263d;
  font-size: 1rem;
}

.modal-dialog-drilldown {
  width: min(780px, 100%);
}

.drilldown-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.drilldown-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 18px;
  background: #f7fbff;
}

.drilldown-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drilldown-card-head div {
  display: grid;
  gap: 3px;
}

.drilldown-card-head strong {
  color: #10263d;
  font-size: 1.02rem;
}

.drilldown-card-head span,
.drilldown-meta span,
.drilldown-note {
  color: #5f7b97;
}

.drilldown-date-pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid rgba(0, 120, 212, 0.18);
  border-radius: 999px;
  background: #eef7ff;
  color: #0d67ad;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.drilldown-date-pill.sale {
  border-color: rgba(40, 156, 100, 0.22);
  background: #effcf4;
  color: #1c8a57;
}

.drilldown-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.drilldown-meta span {
  display: grid;
  gap: 2px;
  font-size: 0.86rem;
}

.drilldown-meta strong,
.drilldown-note strong {
  color: #5f7b97;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.drilldown-money-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drilldown-note {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(0, 120, 212, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

@media (max-width: 540px) {
  .drilldown-card-head {
    display: grid;
  }

  .drilldown-date-pill {
    justify-self: start;
    white-space: normal;
  }

  .drilldown-money-grid {
    grid-template-columns: 1fr;
  }
}

.admin-user-controls {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 16px;
  background: #f7fbff;
}

.field.compact {
  gap: 6px;
  margin: 0;
}

.field.compact select,
.field.compact input {
  min-height: 40px;
}

.admin-list-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.admin-list-head {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  user-select: none;
}

.admin-list-head > span:first-child {
  display: grid;
  gap: 3px;
}

.admin-list-head .muted-copy {
  margin: 0;
}

.admin-list-head-meta {
  grid-column: 1;
  color: #5f7b97;
  font-size: 0.84rem;
  font-weight: 850;
}

.admin-list-chevron {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: relative;
  width: 11px;
  height: 11px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  color: #7b99b6;
  justify-self: end;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.admin-list-card.expanded .admin-list-chevron {
  transform: rotate(225deg);
}

.admin-list-head:focus-visible {
  outline: 3px solid rgba(0, 120, 212, 0.22);
  outline-offset: 6px;
  border-radius: 12px;
}

.admin-list-card strong,
.admin-group-card span:first-child {
  color: #10263d;
}

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

.admin-list-meta > span,
.admin-group-card > span:nth-child(2) {
  color: #5f7b97;
  font-size: 0.84rem;
  font-weight: 750;
}

.admin-group-stack {
  padding-top: 2px;
}

.admin-group-card {
  display: grid;
  gap: 8px;
  padding: 11px 12px;
  background: #fbfdff;
}

.team-overview,
.team-leaderboard {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 14px 34px rgba(39, 82, 130, 0.08);
}

.team-section-head {
  display: grid;
  gap: 3px;
}

.team-section-head h3,
.leaderboard-card h4 {
  margin: 0;
  color: #10263d;
}

.team-summary-grid,
.leaderboard-grid {
  display: grid;
  gap: 12px;
}

.team-summary-card,
.leaderboard-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(0, 120, 212, 0.14);
  border-radius: 16px;
  background: #f7fbff;
}

.team-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.team-summary-head strong {
  color: #5f7b97;
  font-size: 0.84rem;
}

.team-summary-card .admin-stat-groups {
  grid-template-columns: 1fr;
}

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

.leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(0, 120, 212, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.leaderboard-rank {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #eef6ff;
  color: #0f5f9f;
  font-size: 0.78rem;
  font-weight: 900;
}

.leaderboard-email {
  overflow: hidden;
  color: #10263d;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row strong {
  color: #17406a;
  font-size: 0.9rem;
  white-space: nowrap;
}

.admin-invite-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-invite-strip span {
  padding: 7px 10px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 999px;
  background: #f7fbff;
  color: #5f7b97;
  font-size: 0.82rem;
  font-weight: 800;
}

@media (min-width: 720px) {
  .account-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  }

  .admin-metric-row {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .admin-toolbar-controls {
    grid-template-columns: 1fr;
    align-items: end;
  }

  .admin-month-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  }

  .admin-stat-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .admin-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  }

  .admin-user-controls {
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.35fr) auto auto;
    align-items: end;
  }

  .admin-list-card {
    grid-template-columns: 1fr;
  }

  .admin-list-head {
    grid-template-columns: minmax(180px, 0.8fr) auto 16px;
  }

  .admin-list-head-meta,
  .admin-list-chevron {
    grid-column: auto;
    grid-row: auto;
  }

  .admin-group-stack {
    grid-column: 1 / -1;
  }
}

@media (hover: hover) {
  .account-button:hover .account-kicker,
  .account-button:hover .account-chevron {
    color: #d9eaff;
  }

  .account-menu-popover button:hover,
  .account-menu-row:hover {
    background: #eef6ff;
    color: #0d67ad;
  }

  .account-menu-popover button.danger:hover {
    background: #fff1f1;
    color: #aa2d2d;
  }

  .admin-list-head:hover strong,
  .admin-list-head:hover .admin-list-chevron {
    color: #0d67ad;
  }
}

html[data-theme="dark"] .account-kicker {
  color: #9eb8db;
}

html[data-theme="dark"] .role-badge {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
}

html[data-theme="dark"] .role-badge.admin {
  border-color: rgba(38, 156, 98, 0.28);
  background: rgba(12, 92, 57, 0.16);
  color: #c6ffe0;
}

html[data-theme="dark"] .role-badge.upline {
  border-color: rgba(86, 151, 231, 0.34);
  background: rgba(21, 80, 142, 0.3);
  color: #bfe0ff;
}

html[data-theme="dark"] .account-menu-popover {
  border-color: rgba(71, 119, 191, 0.26);
  background: #102342;
  color: #dbe8fb;
  box-shadow: 0 18px 38px rgba(0, 8, 24, 0.36);
}

html[data-theme="dark"] .account-menu-head {
  border-bottom-color: rgba(71, 119, 191, 0.18);
}

html[data-theme="dark"] .account-menu-head strong,
html[data-theme="dark"] .account-menu-popover button {
  color: #dbe8fb;
}

html[data-theme="dark"] .account-menu-head span,
html[data-theme="dark"] .account-menu-row {
  color: #9eb8db;
}

html[data-theme="dark"] .account-menu-popover button.danger {
  color: #ffd7d3;
}

html[data-theme="dark"] .admin-metric {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #f4f8ff;
}

html[data-theme="dark"] .admin-metric span {
  color: #9eb8db;
}

html[data-theme="dark"] .admin-metric strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .invite-note {
  border-color: rgba(86, 151, 231, 0.28);
  background: rgba(18, 48, 90, 0.78);
  color: #dbe8fb;
}

html[data-theme="dark"] .invite-note.error {
  border-color: rgba(244, 105, 105, 0.3);
  background: rgba(89, 28, 38, 0.72);
  color: #ffd9d6;
}

html[data-theme="dark"] .admin-toolbar strong,
html[data-theme="dark"] .admin-user-head,
html[data-theme="dark"] .admin-list-card strong,
html[data-theme="dark"] .admin-group-card span:first-child,
html[data-theme="dark"] .admin-month-card strong,
html[data-theme="dark"] .team-section-head h3,
html[data-theme="dark"] .leaderboard-card h4,
html[data-theme="dark"] .leaderboard-email,
html[data-theme="dark"] .admin-stat-title,
html[data-theme="dark"] .drilldown-card-head strong,
html[data-theme="dark"] .admin-mini-metric strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .admin-user-card,
html[data-theme="dark"] .admin-list-card,
html[data-theme="dark"] .admin-group-card,
html[data-theme="dark"] .admin-month-card,
html[data-theme="dark"] .admin-stat-group,
html[data-theme="dark"] .team-overview,
html[data-theme="dark"] .team-leaderboard,
html[data-theme="dark"] .team-summary-card,
html[data-theme="dark"] .leaderboard-card,
html[data-theme="dark"] .admin-mini-metric,
html[data-theme="dark"] .drilldown-card,
html[data-theme="dark"] .admin-user-controls,
html[data-theme="dark"] .admin-invite-strip span {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.72);
}

html[data-theme="dark"] .leaderboard-row {
  border-color: rgba(71, 119, 191, 0.18);
  background: rgba(8, 20, 42, 0.46);
}

html[data-theme="dark"] .leaderboard-rank {
  background: rgba(0, 120, 212, 0.18);
  color: #d9efff;
}

html[data-theme="dark"] .leaderboard-row strong {
  color: #dbe8fb;
}

html[data-theme="dark"] .admin-user-card.expanded {
  border-color: rgba(86, 151, 231, 0.42);
}

html[data-theme="dark"] .admin-user-subline,
html[data-theme="dark"] .admin-list-head-meta,
html[data-theme="dark"] .admin-list-chevron,
html[data-theme="dark"] .admin-month-kicker,
html[data-theme="dark"] .team-summary-head strong,
html[data-theme="dark"] .admin-mini-metric span,
html[data-theme="dark"] .drilldown-card-head span,
html[data-theme="dark"] .drilldown-meta span,
html[data-theme="dark"] .drilldown-note,
html[data-theme="dark"] .drilldown-meta strong,
html[data-theme="dark"] .drilldown-note strong,
html[data-theme="dark"] .admin-list-meta > span,
html[data-theme="dark"] .admin-group-card > span:nth-child(2),
html[data-theme="dark"] .admin-invite-strip span {
  color: #9eb8db;
}

html[data-theme="dark"] .admin-mini-metric-action:hover,
html[data-theme="dark"] .admin-mini-metric-action:focus-visible {
  border-color: rgba(97, 158, 244, 0.48);
  background: rgba(23, 52, 94, 0.92);
  box-shadow: 0 12px 24px rgba(0, 8, 24, 0.26);
}

html[data-theme="dark"] .drilldown-date-pill {
  border-color: rgba(86, 151, 231, 0.34);
  background: rgba(21, 80, 142, 0.22);
  color: #bfe0ff;
}

html[data-theme="dark"] .drilldown-date-pill.sale {
  border-color: rgba(60, 190, 126, 0.28);
  background: rgba(38, 144, 91, 0.18);
  color: #adf1cb;
}

html[data-theme="dark"] .drilldown-note {
  border-color: rgba(71, 119, 191, 0.18);
  background: rgba(8, 20, 42, 0.44);
}

@media (prefers-reduced-motion: reduce) {
  .admin-collapse,
  .admin-list-chevron {
    transition: none;
  }
}

@media (hover: hover) {
  html[data-theme="dark"] .account-menu-popover button:hover,
  html[data-theme="dark"] .account-menu-row:hover {
    background: rgba(24, 47, 84, 0.92);
    color: #eef4ff;
  }

  html[data-theme="dark"] .account-menu-popover button.danger:hover {
    background: rgba(112, 41, 48, 0.88);
    color: #ffe4e2;
  }

  html[data-theme="dark"] .admin-list-head:hover strong,
  html[data-theme="dark"] .admin-list-head:hover .admin-list-chevron {
    color: #bfe0ff;
  }
}

/* Admin/upline text-led cleanup */
.admin-user-list {
  gap: 16px;
}

.admin-user-card {
  overflow: hidden;
  border-color: rgba(83, 143, 202, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 38px rgba(45, 86, 126, 0.08);
}

.admin-user-card.expanded {
  border-color: rgba(0, 120, 212, 0.32);
}

.admin-user-head {
  padding: 16px 18px 10px;
}

.admin-user-head > span:first-child strong {
  font-size: 1rem;
}

.admin-user-summary {
  padding: 0 18px 16px;
}

.admin-stat-groups {
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 120, 212, 0.12);
  border-radius: 16px;
  background: rgba(248, 252, 255, 0.76);
}

.admin-stat-group {
  gap: 10px;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid rgba(0, 120, 212, 0.11);
  border-radius: 0;
  background: transparent;
}

.admin-stat-group:last-child {
  border-bottom: 0;
}

.admin-stat-grid,
.admin-list-report-row {
  gap: 8px 16px;
  grid-template-columns: 1fr;
}

.admin-mini-metric {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.admin-mini-metric span {
  min-width: 0;
  color: #65819d;
  font-size: 0.76rem;
  line-height: 1.25;
}

.admin-mini-metric strong {
  color: #0e253d;
  font-size: 0.98rem;
  line-height: 1.2;
  text-align: right;
}

.admin-mini-metric-action {
  margin: -6px -8px;
  padding: 6px 8px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 11px;
  background: rgba(238, 247, 255, 0.72);
}

.admin-mini-metric-action:hover,
.admin-mini-metric-action:focus-visible {
  border-color: rgba(0, 120, 212, 0.42);
  background: #eaf6ff;
  box-shadow: 0 8px 18px rgba(0, 120, 212, 0.1);
}

.team-overview,
.team-leaderboard {
  border-color: rgba(83, 143, 202, 0.18);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 34px rgba(45, 86, 126, 0.08);
}

.team-summary-card,
.leaderboard-card {
  border-color: rgba(0, 120, 212, 0.12);
  background: rgba(248, 252, 255, 0.7);
  box-shadow: none;
}

.team-summary-card .admin-stat-groups {
  border-color: rgba(0, 120, 212, 0.1);
  background: rgba(255, 255, 255, 0.46);
}

.admin-user-body {
  gap: 12px;
  padding: 0 18px 18px;
}

.admin-list-stack {
  gap: 10px;
}

.admin-list-card {
  gap: 10px;
  padding: 14px 16px;
  border-color: rgba(0, 120, 212, 0.13);
  background: rgba(247, 251, 255, 0.7);
  box-shadow: none;
}

.admin-list-card.expanded {
  border-color: rgba(0, 120, 212, 0.26);
  background: rgba(242, 249, 255, 0.86);
}

.admin-list-head {
  gap: 10px;
}

.admin-list-head > span:first-child {
  gap: 4px;
}

.admin-list-head-meta {
  font-size: 0.8rem;
}

.admin-list-meta {
  gap: 9px;
}

.admin-list-report-row .admin-mini-metric,
.admin-list-report-row.compact .admin-mini-metric {
  padding: 0;
}

.admin-list-report-row .admin-mini-metric strong,
.admin-list-report-row.compact .admin-mini-metric strong {
  font-size: 0.92rem;
}

.admin-group-stack {
  display: grid;
  gap: 0;
  padding: 4px 0 0 10px;
  border-left: 1px solid rgba(0, 120, 212, 0.16);
}

.admin-group-card {
  gap: 9px;
  padding: 12px 0 12px 14px;
  border: 0;
  border-top: 1px solid rgba(0, 120, 212, 0.1);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-group-card:first-child {
  border-top: 0;
}

.admin-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.admin-group-head span:first-child {
  color: #10263d;
  font-weight: 850;
}

.admin-group-head span:nth-child(2) {
  color: #65819d;
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-list-meta .scope-stat-row,
.admin-group-card .scope-stat-row {
  margin-top: 0;
}

@media (min-width: 720px) {
  .admin-stat-groups {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-stat-group {
    border-right: 1px solid rgba(0, 120, 212, 0.11);
    border-bottom: 0;
  }

  .admin-stat-group:last-child {
    border-right: 0;
  }

  .admin-list-report-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .admin-list-card {
    grid-template-columns: minmax(200px, 0.78fr) minmax(0, 1.22fr);
    align-items: center;
  }

  .admin-list-head {
    grid-template-columns: minmax(0, 1fr) auto 16px;
  }

  .admin-list-meta {
    align-content: center;
  }

  .admin-list-groups-collapse {
    grid-column: 1 / -1;
  }
}

html[data-theme="dark"] .admin-user-card {
  border-color: rgba(97, 158, 244, 0.2);
  background: rgba(9, 23, 45, 0.86);
  box-shadow: 0 18px 42px rgba(0, 7, 18, 0.22);
}

html[data-theme="dark"] .admin-user-card.expanded {
  border-color: rgba(97, 158, 244, 0.38);
}

html[data-theme="dark"] .admin-stat-groups {
  border-color: rgba(97, 158, 244, 0.16);
  background: rgba(8, 20, 40, 0.46);
}

html[data-theme="dark"] .admin-stat-group {
  border-color: rgba(97, 158, 244, 0.13);
  background: transparent;
}

html[data-theme="dark"] .admin-mini-metric,
html[data-theme="dark"] .admin-stat-group {
  background: transparent;
}

html[data-theme="dark"] .admin-mini-metric span,
html[data-theme="dark"] .admin-stat-title,
html[data-theme="dark"] .admin-user-subline,
html[data-theme="dark"] .admin-list-head-meta,
html[data-theme="dark"] .admin-group-head span:nth-child(2) {
  color: #9fb7d4;
}

html[data-theme="dark"] .admin-mini-metric strong,
html[data-theme="dark"] .admin-group-head span:first-child {
  color: #f6f9ff;
}

html[data-theme="dark"] .admin-mini-metric-action {
  border-color: rgba(88, 150, 230, 0.22);
  background: rgba(20, 47, 84, 0.58);
}

html[data-theme="dark"] .admin-mini-metric-action:hover,
html[data-theme="dark"] .admin-mini-metric-action:focus-visible {
  border-color: rgba(112, 176, 255, 0.5);
  background: rgba(30, 69, 119, 0.72);
  box-shadow: 0 10px 24px rgba(0, 8, 24, 0.28);
}

html[data-theme="dark"] .team-overview,
html[data-theme="dark"] .team-leaderboard {
  border-color: rgba(97, 158, 244, 0.2);
  background: rgba(9, 23, 45, 0.72);
  box-shadow: 0 18px 42px rgba(0, 7, 18, 0.2);
}

html[data-theme="dark"] .team-summary-card,
html[data-theme="dark"] .leaderboard-card {
  border-color: rgba(97, 158, 244, 0.15);
  background: rgba(11, 27, 52, 0.5);
}

html[data-theme="dark"] .team-summary-card .admin-stat-groups {
  border-color: rgba(97, 158, 244, 0.12);
  background: rgba(5, 14, 29, 0.32);
}

html[data-theme="dark"] .admin-list-card {
  border-color: rgba(97, 158, 244, 0.16);
  background: rgba(14, 32, 59, 0.62);
}

html[data-theme="dark"] .admin-list-card.expanded {
  border-color: rgba(97, 158, 244, 0.3);
  background: rgba(16, 38, 70, 0.76);
}

html[data-theme="dark"] .admin-group-stack {
  border-left-color: rgba(97, 158, 244, 0.18);
}

html[data-theme="dark"] .admin-group-card {
  border-top-color: rgba(97, 158, 244, 0.12);
  background: transparent;
}

/* Light-mode Admin/Upline hierarchy refinement */
html:not([data-theme="dark"]) .admin-month-card,
html:not([data-theme="dark"]) .team-overview,
html:not([data-theme="dark"]) .team-leaderboard {
  border-color: rgba(57, 120, 184, 0.22);
  background:
    linear-gradient(135deg, rgba(241, 248, 255, 0.96), rgba(255, 255, 255, 0.9));
  box-shadow: 0 18px 44px rgba(39, 82, 130, 0.1);
}

html:not([data-theme="dark"]) .team-overview,
html:not([data-theme="dark"]) .team-leaderboard {
  margin-bottom: 18px;
  padding: 16px;
}

html:not([data-theme="dark"]) .admin-user-list {
  gap: 18px;
}

html:not([data-theme="dark"]) .admin-user-card {
  position: relative;
  border-color: rgba(43, 106, 171, 0.22);
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow:
    0 18px 42px rgba(39, 82, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

html:not([data-theme="dark"]) .admin-user-card::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, #0f8bdb, #62b7f8);
  opacity: 0.78;
}

html:not([data-theme="dark"]) .admin-user-card.expanded {
  border-color: rgba(15, 139, 219, 0.38);
  box-shadow:
    0 22px 48px rgba(39, 82, 130, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

html:not([data-theme="dark"]) .admin-user-head {
  background:
    linear-gradient(90deg, rgba(230, 243, 255, 0.64), rgba(255, 255, 255, 0));
  border-bottom: 1px solid rgba(43, 106, 171, 0.08);
}

html:not([data-theme="dark"]) .admin-user-head strong,
html:not([data-theme="dark"]) .team-section-head h3,
html:not([data-theme="dark"]) .leaderboard-card h4,
html:not([data-theme="dark"]) .admin-list-card strong,
html:not([data-theme="dark"]) .admin-group-head span:first-child {
  color: #0c2239;
}

html:not([data-theme="dark"]) .admin-user-subline,
html:not([data-theme="dark"]) .admin-mini-metric span,
html:not([data-theme="dark"]) .admin-list-head-meta,
html:not([data-theme="dark"]) .admin-group-head span:nth-child(2),
html:not([data-theme="dark"]) .team-summary-head strong,
html:not([data-theme="dark"]) .admin-stat-title {
  color: #4f6f8f;
}

html:not([data-theme="dark"]) .admin-stat-groups {
  border-color: rgba(56, 118, 181, 0.16);
  background: rgba(238, 247, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

html:not([data-theme="dark"]) .admin-stat-group {
  border-color: rgba(56, 118, 181, 0.12);
}

html:not([data-theme="dark"]) .admin-mini-metric strong {
  color: #071f36;
}

html:not([data-theme="dark"]) .team-summary-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(43, 106, 171, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(39, 82, 130, 0.08);
}

html:not([data-theme="dark"]) .team-summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(0, 120, 212, 0.76), rgba(98, 183, 248, 0.26));
}

html:not([data-theme="dark"]) .team-summary-card:nth-child(2)::before {
  background: linear-gradient(90deg, rgba(40, 156, 100, 0.72), rgba(146, 224, 183, 0.28));
}

html:not([data-theme="dark"]) .team-summary-card:nth-child(3)::before {
  background: linear-gradient(90deg, rgba(215, 162, 58, 0.76), rgba(244, 213, 139, 0.3));
}

html:not([data-theme="dark"]) .team-summary-card .admin-stat-groups {
  border-color: rgba(56, 118, 181, 0.12);
  background: rgba(246, 251, 255, 0.72);
}

html:not([data-theme="dark"]) .leaderboard-card {
  border-color: rgba(43, 106, 171, 0.15);
  background: rgba(255, 255, 255, 0.76);
}

html:not([data-theme="dark"]) .admin-list-card {
  position: relative;
  border-color: rgba(43, 106, 171, 0.18);
  background: rgba(233, 245, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html:not([data-theme="dark"]) .admin-list-card.expanded {
  border-color: rgba(15, 139, 219, 0.3);
  background: rgba(224, 240, 255, 0.86);
}

html:not([data-theme="dark"]) .admin-list-card::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: rgba(15, 139, 219, 0.34);
}

html:not([data-theme="dark"]) .admin-list-report-row {
  padding-top: 8px;
  border-top: 1px solid rgba(43, 106, 171, 0.12);
}

html:not([data-theme="dark"]) .admin-list-meta .scope-stat-row {
  padding-top: 2px;
}

html:not([data-theme="dark"]) .admin-group-stack {
  margin-left: 8px;
  padding-left: 14px;
  border-left-color: rgba(15, 139, 219, 0.28);
}

html:not([data-theme="dark"]) .admin-group-card {
  padding-left: 0;
  border-top-color: rgba(43, 106, 171, 0.12);
}

html:not([data-theme="dark"]) .admin-mini-metric-action {
  border-color: rgba(15, 139, 219, 0.2);
  background: rgba(235, 247, 255, 0.92);
}

html:not([data-theme="dark"]) .admin-mini-metric-action:hover,
html:not([data-theme="dark"]) .admin-mini-metric-action:focus-visible {
  border-color: rgba(15, 139, 219, 0.48);
  background: #e2f3ff;
  box-shadow: 0 10px 22px rgba(15, 139, 219, 0.14);
}

/* Upline/Admin polish and archived downlines */
.admin-month-card {
  align-items: start;
}

@media (min-width: 720px) {
  .admin-month-card {
    align-items: start;
  }
}

.admin-month-card > div,
.admin-month-field {
  align-self: start;
}

.admin-stat-group,
.admin-stat-grid {
  align-content: start;
}

.admin-stat-group {
  gap: 6px;
  padding-block: 10px;
}

.admin-stat-grid {
  gap: 5px 16px;
}

.admin-stat-title {
  line-height: 1.05;
}

.admin-user-card,
.admin-list-card {
  position: relative;
}

.admin-user-card::before,
html:not([data-theme="dark"]) .admin-user-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #0f8bdb, #62b7f8);
  opacity: 0.9;
}

.admin-list-card::before,
html:not([data-theme="dark"]) .admin-list-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 16px 0 0 16px;
  background: rgba(15, 139, 219, 0.48);
}

html[data-theme="dark"] .admin-user-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: linear-gradient(180deg, #4fa8ff, #77d0ff);
  opacity: 0.88;
}

html[data-theme="dark"] .admin-list-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  border-radius: 16px 0 0 16px;
  background: rgba(97, 181, 255, 0.56);
}

.admin-user-card.archived::before {
  background: linear-gradient(180deg, #7c8da1, #b7c5d4);
}

html[data-theme="dark"] .admin-user-card.archived::before {
  background: linear-gradient(180deg, #51647c, #93a6bd);
}

.admin-user-head.static {
  cursor: default;
}

.admin-user-head.static:hover strong {
  color: inherit;
}

.upline-user-controls {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.upline-user-controls strong {
  color: #10263d;
}

.archived-downlines {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(83, 143, 202, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px rgba(45, 86, 126, 0.08);
}

.admin-user-list.archived {
  gap: 12px;
}

html[data-theme="dark"] .upline-user-controls strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .archived-downlines {
  border-color: rgba(97, 158, 244, 0.18);
  background: rgba(9, 23, 45, 0.66);
  box-shadow: 0 18px 42px rgba(0, 7, 18, 0.18);
}

/* Premium tracker and reporting cleanup */
.premium-head {
  align-items: start;
  gap: 18px;
}

.premium-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.premium-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
}

.premium-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.premium-summary-card {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(114, 181, 238, 0.34);
  border-radius: 14px;
  background: rgba(244, 250, 255, 0.78);
}

.premium-summary-card span {
  color: #527291;
  font-size: 0.8rem;
  font-weight: 750;
}

.premium-summary-card strong {
  color: #10263d;
  font-size: 1.12rem;
}

.premium-summary-card small {
  color: #6383a1;
  font-size: 0.78rem;
  font-weight: 750;
}

.premium-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(114, 181, 238, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
}

.premium-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.premium-table th,
.premium-table td {
  padding: 10px 11px;
  border-bottom: 1px solid rgba(114, 181, 238, 0.18);
  text-align: left;
  vertical-align: top;
}

.premium-table th {
  color: #4e6f8f;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(232, 244, 255, 0.8);
}

.premium-table tbody tr:last-child td {
  border-bottom: 0;
}

.premium-table input,
.premium-table textarea {
  width: 100%;
  min-width: 130px;
  border: 1px solid rgba(114, 181, 238, 0.42);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #10263d;
  font: inherit;
  padding: 8px 9px;
}

.premium-table textarea {
  min-width: 220px;
  resize: vertical;
}

.premium-row-note {
  margin: 6px 0 0;
  color: #527291;
  font-size: 0.78rem;
  line-height: 1.35;
}

.session-activity-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(232, 244, 255, 0.56);
}

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

.session-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid rgba(114, 181, 238, 0.22);
}

.session-activity-row:first-child {
  border-top: 0;
}

.session-activity-row span {
  display: grid;
  gap: 2px;
}

.session-activity-row small {
  color: #5f7f9d;
  font-weight: 700;
}

.admin-mini-metric-action {
  min-height: 34px;
  margin: 0;
  padding: 7px 10px;
  box-sizing: border-box;
}

.admin-stat-groups {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-stat-group {
  gap: 4px;
}

.admin-stat-grid {
  gap: 4px 14px;
}

.admin-stat-title {
  margin-bottom: 2px;
}

.admin-month-card {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
  align-items: start;
}

.admin-month-card > div {
  align-self: start;
}

.admin-user-card::before,
html:not([data-theme="dark"]) .admin-user-card::before,
html[data-theme="dark"] .admin-user-card::before {
  top: 0;
  bottom: 0;
  left: 0;
  height: auto;
  border-radius: 18px 0 0 18px;
}

.admin-list-card::before,
html:not([data-theme="dark"]) .admin-list-card::before,
html[data-theme="dark"] .admin-list-card::before {
  top: 0;
  bottom: 0;
  left: 0;
  height: auto;
  border-radius: 16px 0 0 16px;
}

html[data-theme="dark"] .premium-summary-card,
html[data-theme="dark"] .premium-table-wrap,
html[data-theme="dark"] .session-activity-panel {
  border-color: rgba(97, 158, 244, 0.22);
  background: rgba(10, 30, 58, 0.72);
}

html[data-theme="dark"] .premium-summary-card span,
html[data-theme="dark"] .premium-summary-card small,
html[data-theme="dark"] .premium-row-note,
html[data-theme="dark"] .session-activity-row small {
  color: #9fb9d6;
}

html[data-theme="dark"] .premium-summary-card strong,
html[data-theme="dark"] .premium-table td,
html[data-theme="dark"] .session-activity-row strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .premium-table th {
  color: #9fb9d6;
  background: rgba(10, 30, 58, 0.9);
}

html[data-theme="dark"] .premium-table th,
html[data-theme="dark"] .premium-table td,
html[data-theme="dark"] .session-activity-row {
  border-color: rgba(97, 158, 244, 0.16);
}

html[data-theme="dark"] .premium-table input,
html[data-theme="dark"] .premium-table textarea {
  border-color: rgba(97, 158, 244, 0.28);
  background: rgba(5, 17, 35, 0.72);
  color: #f4f8ff;
}

.lead-custom-card {
  margin-top: 12px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 18px;
  background: rgba(247, 251, 255, 0.82);
  overflow: hidden;
}

.lead-custom-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.lead-custom-card summary::-webkit-details-marker {
  display: none;
}

.lead-custom-card summary::after {
  content: "v";
  color: #5c82a8;
  font-weight: 900;
  transition: transform 180ms ease;
}

.lead-custom-card[open] summary::after {
  transform: rotate(180deg);
}

.lead-custom-card .eyebrow {
  display: block;
  margin-bottom: 4px;
}

.lead-custom-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.lead-custom-item,
.lead-custom-empty {
  padding: 12px;
  border: 1px solid rgba(0, 120, 212, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.lead-custom-item span {
  display: block;
  margin-bottom: 6px;
  color: #5f7f9d;
  font-size: 0.82rem;
  font-weight: 650;
}

.lead-custom-item .copy-line {
  align-items: center;
}

.lead-custom-item strong {
  color: #10263d;
}

.lead-custom-item .detail-copy-chip {
  min-height: 30px;
  padding: 6px 9px;
}

.lead-custom-item .detail-copy-chip span {
  display: none;
}

.lead-custom-empty {
  grid-column: 1 / -1;
  color: #5f7f9d;
  font-weight: 650;
}

.mapping-header-row,
.mapping-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.mapping-header-row .muted-copy {
  margin: 4px 0 0;
}

.mapping-controls {
  align-items: center;
}

.mapping-controls select {
  flex: 1 1 260px;
}

.mapping-visible-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  color: #486b8e;
  font-size: 0.9rem;
  font-weight: 700;
}

.mapping-visible-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.mapping-row.ignored {
  opacity: 0.74;
}

.cleanup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(0, 120, 212, 0.16);
  border-radius: 999px;
  background: rgba(232, 244, 255, 0.86);
  color: #226395;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.cleanup-empty,
.cleanup-duplicate-blank,
.cleanup-agent-fill-in {
  border-color: rgba(96, 112, 128, 0.18);
  background: rgba(235, 241, 247, 0.86);
  color: #697b8f;
}

.cleanup-recommended {
  border-color: rgba(0, 120, 212, 0.18);
  background: rgba(225, 243, 255, 0.9);
  color: #0069b8;
}

html[data-theme="dark"] .lead-custom-card {
  border-color: rgba(74, 124, 203, 0.3);
  background: linear-gradient(180deg, rgba(20, 39, 73, 0.94), rgba(11, 26, 52, 0.96));
}

html[data-theme="dark"] .lead-custom-item,
html[data-theme="dark"] .lead-custom-empty {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(9, 22, 45, 0.72);
}

html[data-theme="dark"] .lead-custom-item span,
html[data-theme="dark"] .lead-custom-empty,
html[data-theme="dark"] .mapping-visible-toggle {
  color: #9fb9d6;
}

html[data-theme="dark"] .lead-custom-item strong {
  color: #f4f8ff;
}

html[data-theme="dark"] .lead-custom-card summary::after {
  color: #9fb9d6;
}

html[data-theme="dark"] .cleanup-badge {
  border-color: rgba(71, 119, 191, 0.22);
  background: rgba(16, 34, 64, 0.82);
  color: #dce8fa;
}

html[data-theme="dark"] .cleanup-empty,
html[data-theme="dark"] .cleanup-duplicate-blank,
html[data-theme="dark"] .cleanup-agent-fill-in {
  border-color: rgba(96, 112, 128, 0.22);
  background: rgba(31, 43, 59, 0.74);
  color: #aebdd0;
}

@media (max-width: 900px) {
  .premium-toolbar,
  .admin-month-card {
    grid-template-columns: 1fr;
  }

  .premium-summary,
  .admin-stat-groups {
    grid-template-columns: 1fr;
  }

  .premium-head-actions {
    justify-content: stretch;
  }

  .premium-head-actions .button {
    flex: 1 1 140px;
  }

  .mapping-header-row,
  .mapping-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mapping-visible-toggle {
    min-width: 0;
  }
}
