:root {
  --bg: #06111d;
  --panel: #0d1c2b;
  --panel-2: #11263a;
  --panel-3: #102031;
  --line: rgba(58, 191, 210, 0.38);
  --line-soft: rgba(117, 196, 220, 0.18);
  --text: #eef8ff;
  --muted: #9fc0ce;
  --cyan: #57d9f4;
  --teal: #32c5bc;
  --gold: #ffe36f;
  --gold-2: #b87413;
  --green: #7bec91;
  --red: #ff6f70;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  zoom: 0.95;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(2, 7, 15, 0.76), rgba(2, 7, 15, 0.54)),
    linear-gradient(180deg, rgba(2, 7, 15, 0.40), rgba(2, 7, 15, 0.88)),
    url("./assets/alert1-background.png") center center / cover fixed no-repeat,
    #050b13;
}

button,
select {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100vw - 30px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 18px 0 6px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 620px;
  font-size: clamp(1.85rem, 3.4vw, 3.25rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.08rem;
  text-transform: uppercase;
}

.toolbar,
.status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar {
  justify-content: flex-end;
  max-width: 620px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 20, 32, 0.8);
}

.segment,
.control-button,
select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 28, 43, 0.86);
  color: var(--text);
}

.segment {
  border: 0;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 800;
}

.segment.active {
  background: linear-gradient(135deg, #3dd8e6, #2ba09e);
  color: #03151b;
}

.control-button,
select {
  padding: 0 14px;
}

.control-button {
  cursor: pointer;
  font-weight: 800;
}

.sound-button {
  min-width: 110px;
}

.status-strip {
  margin: 14px 0 18px;
}

.pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 28, 43, 0.80);
  color: var(--cyan);
  font-size: 0.88rem;
  font-weight: 800;
}

.pill strong {
  color: var(--text);
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric {
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(87, 217, 244, 0.08), rgba(10, 25, 39, 0.25)),
    rgba(8, 20, 34, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 15px 42px rgba(0, 0, 0, 0.24);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--gold);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.95;
}

.leader-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 100%;
}

.side-panels {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 16px;
  min-width: 0;
}

.leader-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.goal-panel,
.coverage-panel,
.dialer-panel,
.podium,
.leaderboard {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(6, 15, 28, 0.88);
  backdrop-filter: blur(3px);
}

.goal-panel {
  padding: 18px;
  overflow: hidden;
}

.goal-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--cyan), var(--teal));
}

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

.goal-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-focus {
  margin-top: 22px;
}

.goal-focus span,
.goal-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-focus strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: clamp(3.2rem, 7vw, 5rem);
  line-height: 0.9;
}

.goal-progress {
  width: 100%;
  height: 12px;
  margin-top: 16px;
  border: 1px solid rgba(87, 217, 244, 0.28);
  border-radius: 999px;
  background: rgba(5, 12, 22, 0.82);
  overflow: hidden;
}

.goal-progress > div {
  width: var(--goal-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--gold));
  transition: width 280ms ease;
}

.goal-progress-text {
  margin-top: 10px;
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 900;
}

.goal-stats {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.goal-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(11, 25, 39, 0.76);
}

.goal-stats strong {
  color: var(--text);
  font-size: 1.22rem;
  font-weight: 900;
}

.goal-caption {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
}

.coverage-panel,
.dialer-panel {
  padding: 16px;
}

.coverage-header,
.dialer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coverage-header span,
.dialer-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coverage-counts {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.coverage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(11, 25, 39, 0.76);
}

.coverage-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.coverage-card strong {
  font-size: 1.45rem;
  line-height: 1;
}

.coverage-ready strong {
  color: var(--green);
}

.coverage-not-ready strong {
  color: var(--gold);
}

.coverage-logged-out strong {
  color: var(--red);
}

.coverage-caption,
.dialer-caption {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.35;
}

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

.dialer-summary div {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(11, 25, 39, 0.76);
  text-align: center;
}

.dialer-summary span,
.dialer-row-meta span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

.dialer-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--cyan);
  font-size: 1.05rem;
  line-height: 1;
}

.dialer-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.dialer-row {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(5, 12, 22, 0.72);
}

.dialer-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.dialer-row-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialer-role-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 5px;
  border: 1px solid rgba(87, 217, 244, 0.32);
  border-radius: 6px;
  color: var(--cyan);
  font-size: 0.62rem;
  font-weight: 900;
  vertical-align: 1px;
}

.dialer-row-percent {
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 900;
}

.dialer-bar {
  height: 8px;
  margin-top: 8px;
  border: 1px solid rgba(87, 217, 244, 0.22);
  border-radius: 999px;
  background: rgba(2, 7, 14, 0.8);
  overflow: hidden;
}

.dialer-bar > div {
  width: var(--dialer-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
}

.dialer-row-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.dialer-row-meta strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.podium {
  padding: 18px;
}

.podium-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.podium-card {
  min-height: 148px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 8px 12px;
  padding: 15px;
  border: 1px solid rgba(255, 227, 111, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(177, 106, 10, 0.62), rgba(34, 26, 6, 0.72)),
    var(--panel-2);
}

.podium-rank-2 {
  border-color: rgba(87, 217, 244, 0.45);
  background:
    linear-gradient(135deg, rgba(42, 129, 147, 0.42), rgba(15, 35, 47, 0.78)),
    var(--panel-2);
}

.podium-rank-3 {
  border-color: rgba(50, 197, 188, 0.45);
  background:
    linear-gradient(135deg, rgba(33, 126, 104, 0.42), rgba(15, 35, 47, 0.78)),
    var(--panel-2);
}

.rank-medal {
  min-width: 44px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold);
  font-weight: 900;
}

.podium-card > div:nth-child(2) {
  min-width: 0;
}

.podium-name {
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.podium-name-row,
.agent-name-line {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.conversion-badge {
  display: inline-flex;
  min-width: 48px;
  height: 23px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.conversion-metric {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.leads-used-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.conversion-low {
  border-color: rgba(255, 111, 112, 0.52);
  background: rgba(129, 31, 37, 0.52);
  color: #ffb0b0;
}

.conversion-mid {
  border-color: rgba(255, 227, 111, 0.5);
  background: rgba(116, 86, 16, 0.5);
  color: #ffe36f;
}

.conversion-high {
  border-color: rgba(123, 236, 145, 0.5);
  background: rgba(26, 103, 59, 0.52);
  color: #9cf5ad;
}

.conversion-pending {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.podium-points {
  grid-column: 1 / -1;
  color: var(--text);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  font-weight: 900;
}

.podium-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.streak-badge {
  grid-column: 1 / -1;
  align-self: end;
  justify-self: start;
  padding: 5px 10px;
  border: 1px solid rgba(255, 227, 111, 0.38);
  border-radius: 999px;
  background: rgba(255, 227, 111, 0.08);
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.streak-conversion {
  border-color: rgba(123, 236, 145, 0.5);
  background: rgba(26, 103, 59, 0.42);
  color: #9cf5ad;
}

.streak-rapid {
  border-color: rgba(255, 130, 89, 0.55);
  background: rgba(132, 45, 22, 0.48);
  color: #ffb08f;
}

.streak-pay-today {
  border-color: rgba(87, 217, 244, 0.52);
  background: rgba(22, 91, 111, 0.5);
  color: #8feaff;
}

.streak-leader {
  border-color: rgba(255, 227, 111, 0.55);
  background: rgba(116, 86, 16, 0.46);
  color: #ffe36f;
}

.streak-closer,
.streak-pursuit {
  border-color: rgba(111, 191, 255, 0.48);
  background: rgba(32, 77, 126, 0.44);
  color: #a7d7ff;
}

.streak-moves {
  border-color: rgba(177, 160, 255, 0.46);
  background: rgba(69, 52, 122, 0.42);
  color: #d2c8ff;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.section-header div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

th button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 900;
}

tbody tr {
  background: linear-gradient(90deg, rgba(87, 217, 244, 0.06), transparent var(--score-pct));
}

tbody tr.top-rank {
  background: linear-gradient(90deg, rgba(255, 227, 111, 0.16), rgba(87, 217, 244, 0.04) var(--score-pct), transparent);
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.035);
}

tbody tr[data-agent-key] {
  cursor: pointer;
}

.rank {
  color: var(--gold);
  font-weight: 900;
  white-space: nowrap;
}

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

.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--teal));
  color: #04141a;
  font-size: 0.78rem;
  font-weight: 900;
}

.agent-name {
  overflow-wrap: anywhere;
}

.agent-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.agent-toggle:hover {
  color: var(--cyan);
}

.agent-email {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.points {
  min-width: 122px;
  color: var(--gold);
  font-size: 1.2rem;
  font-weight: 900;
}

.points span {
  display: inline-block;
  min-width: 34px;
}

.score-bar {
  display: inline-block;
  width: var(--score-pct);
  max-width: 74px;
  height: 7px;
  margin-left: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}

.phone-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.phone-status-ready {
  border-color: rgba(123, 236, 145, 0.45);
  background: rgba(32, 112, 61, 0.28);
  color: var(--green);
}

.phone-status-not-ready {
  border-color: rgba(255, 227, 111, 0.42);
  background: rgba(151, 108, 16, 0.25);
  color: var(--gold);
}

.phone-status-logged-out {
  border-color: rgba(255, 111, 112, 0.42);
  background: rgba(117, 28, 35, 0.30);
  color: var(--red);
}

.phone-status-unknown {
  color: var(--muted);
}

.details-row,
.details-row:hover {
  background: rgba(5, 10, 20, 0.72);
}

.details-row > td {
  padding: 10px 12px 14px;
}

.sales-detail {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(3, 9, 19, 0.72);
}

.sales-detail-title {
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.sales-detail-table {
  min-width: 620px;
  background: rgba(6, 16, 28, 0.72);
}

.sales-detail-table th,
.sales-detail-table td {
  padding: 10px 12px;
}

.sales-detail-table th {
  color: var(--cyan);
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 36px;
}

.sale-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: min(390px, calc(100vw - 36px));
  min-height: 128px;
  padding: 22px 24px;
  border: 1px solid rgba(255, 227, 111, 0.58);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 227, 111, 0.20), transparent 34%),
    linear-gradient(135deg, rgba(19, 53, 78, 0.98), rgba(8, 18, 34, 0.98));
  color: var(--text);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.48), 0 0 34px rgba(87, 217, 244, 0.18);
  transform: translateY(130%);
  transition: transform 260ms ease;
  z-index: 40;
}

.sale-toast.show {
  transform: translateY(0);
}

.sale-toast span {
  display: block;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sale-toast strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.sale-toast small {
  display: block;
  margin-top: 10px;
  color: var(--cyan);
  font-size: 0.95rem;
  font-weight: 800;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  pointer-events: none;
}

.confetti-canvas.active {
  display: block;
}

@media (max-width: 920px) {
.topbar {
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
    max-width: none;
  }

  .score-grid,
  .podium-list,
  .leader-layout {
    grid-template-columns: 1fr;
  }

  .side-panels {
    position: relative;
    top: auto;
  }

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

@media (max-width: 680px) {
  .app-shell {
    width: min(100vw - 24px, 1180px);
    padding-top: 20px;
  }

  .score-grid {
    gap: 9px;
  }

  .metric {
    min-height: 92px;
  }

  .segmented,
  select,
  .control-button {
    width: 100%;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-header div {
    justify-content: flex-start;
  }

  .goal-stats {
    grid-template-columns: 1fr;
  }
}
