:root {
  color-scheme: light;
  --ink: #101b18;
  --muted: #4c5f59;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(16, 27, 24, 0.12);
  --accent: #f2c94c;
  --accent-2: #f2994a;
  --accent-3: #0b3d2e;
  --accent-4: #b86b34;
  --pitch-dark: #0b3d2e;
  --pitch-mid: #0f4f3a;
  --shadow: 0 24px 60px rgba(8, 23, 18, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", "Avenir Next", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.08), transparent 35%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 120px,
      rgba(0, 0, 0, 0) 120px,
      rgba(0, 0, 0, 0) 240px
    ),
    linear-gradient(160deg, var(--pitch-dark), var(--pitch-mid) 60%, #0f5a43 100%);
  min-height: 100vh;
  padding: 40px clamp(18px, 3.5vw, 48px) 40px;
  position: relative;
  overflow-x: hidden;
}

.background-glow {
  position: absolute;
  inset: -20% -10% auto;
  height: 420px;
  background: radial-gradient(circle at 30% 30%, rgba(242, 201, 76, 0.25), transparent 60%),
    radial-gradient(circle at 70% 20%, rgba(242, 153, 74, 0.25), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.hero,
.content,
.footer {
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
  justify-items: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
}

.hero h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "Avenir Next", sans-serif;
  font-size: clamp(28px, 4.5vw, 50px);
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #f9f5e7;
}

.subhead {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  color: #f9f5e7;
  box-shadow: 0 8px 20px rgba(8, 23, 18, 0.25);
}

.content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.panel {
  background: var(--panel-strong);
  border-radius: 20px;
  padding: clamp(16px, 2.5vw, 22px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  max-width: 620px;
  justify-self: center;
}

.panel-wide {
  grid-column: 1 / -1;
}


.panel-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.division {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent-4);
  background: rgba(242, 201, 76, 0.15);
  padding: 4px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

.panel-head h2 {
  margin: 0;
  font-size: clamp(16px, 2.4vw, 22px);
}

.panel-head p {
  margin: 0;
  color: var(--muted);
}

.panel-meta {
  font-size: 11px;
  color: var(--muted);
}

.panel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.panel-controls select {
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(16, 27, 24, 0.12);
  background: #fffaf0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(8, 23, 18, 0.12);
}

.toggle-btn {
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(16, 27, 24, 0.15);
  background: #fffaf0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(8, 23, 18, 0.12);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.toggle-btn:hover {
  background: #fff3d6;
}

.toggle-btn[hidden] {
  display: none;
}

.row-hidden {
  display: none;
}

.row-static {
  animation: none;
  opacity: 1;
  transform: none;
}

.table-wrap {
  overflow-x: auto;
  max-width: 520px;
  margin: 0 auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  table-layout: fixed;
}

.table-wrap th,
.table-wrap td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

.table-wrap th:nth-child(1),
.table-wrap td:nth-child(1) {
  width: 12%;
}

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
  width: 48%;
  overflow: hidden;
}

.table-wrap th:nth-child(3),
.table-wrap td:nth-child(3) {
  width: 15%;
}

.table-wrap th:nth-child(4),
.table-wrap td:nth-child(4) {
  width: 20%;
}

.table-wrap thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.table-wrap thead tr:first-child th {
  background: rgba(11, 61, 46, 0.08);
  color: var(--accent-3);
  font-weight: 700;
}

.table-wrap tbody tr {
  background: transparent;
  transition: background 0.2s ease;
}

.table-wrap tbody tr:hover {
  background: rgba(11, 61, 46, 0.08);
}

.rank {
  font-weight: 700;
  color: var(--accent-3);
}

.agent-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  min-width: 0;
}

.agent-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agent-name-secondary {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-name-primary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight {
  background: linear-gradient(90deg, rgba(242, 201, 76, 0.22), rgba(242, 201, 76, 0));
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: transparent;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6)),
    linear-gradient(135deg, #e6eef0, #cfd9dc);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(8, 23, 18, 0.15);
  position: relative;
  overflow: hidden;
}

.avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><circle cx='32' cy='24' r='12' fill='%230b3d2e'/><path d='M14 58c2-12 12-20 18-20s16 8 18 20' fill='%230b3d2e'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 60%;
  opacity: 0.75;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-lg {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.deal-meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 30, 35, 0.08);
  overflow: hidden;
}

.deal-meter span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.trend-up {
  color: #1b8a4b;
}

.trend-down {
  color: #c0392b;
}

.trend-flat,
.trend-na {
  color: var(--muted);
}

.deal-value {
  font-variant-numeric: tabular-nums;
}


.footer {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  justify-content: center;
  text-align: center;
}

.footer-note {
  color: var(--muted);
}

.fade-up {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.6s ease forwards;
}

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

@media (max-width: 720px) {
  body {
    padding: 32px 16px 36px;
  }

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

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

  .panel {
    max-width: none;
    width: 100%;
  }

  .table-wrap {
    max-width: none;
  }

  .panel-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .table-wrap table {
    min-width: 0;
  }
}

@media (max-width: 600px) {
  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap th,
  .table-wrap td,
  .table-wrap tr {
    display: block;
    width: 100%;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fffdf7;
    box-shadow: 0 8px 18px rgba(8, 23, 18, 0.08);
  }

  .table-wrap td {
    border-bottom: none;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    font-size: 14px;
  }

  .table-wrap td::before {
    content: attr(data-label);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
  }

  .table-wrap td:last-child {
    padding-bottom: 2px;
  }

  .table-wrap td .agent-name {
    justify-content: flex-start;
    text-align: left;
    width: 100%;
  }

  .table-wrap td .agent-text {
    align-items: flex-start;
  }

  .table-wrap td .agent-name-primary,
  .table-wrap td .agent-name-secondary {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }
}
