@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  --canvas: #f5f3ee;
  --paper: #ffffff;
  --paper-soft: #fcfaf5;
  --ink: #141823;
  --ink-soft: #4d5566;
  --ink-muted: #6a7487;
  --navy: #0f1d36;
  --navy-soft: #172947;
  --amber: #efa201;
  --amber-soft: rgba(239, 162, 1, 0.14);
  --amber-border: rgba(239, 162, 1, 0.34);
  --line: rgba(20, 24, 35, 0.12);
  --shadow: 0 24px 60px rgba(15, 29, 54, 0.08);
  --shadow-tight: 0 14px 30px rgba(15, 29, 54, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #faf7ef 24%, var(--canvas) 100%);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", sans-serif;
}

body.modal-open {
  overflow: hidden;
}

.page-shell {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 18px 40px rgba(15, 29, 54, 0.12);
  backdrop-filter: blur(10px);
}

.site-header-main,
.site-filter-bar,
.site-filter-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--navy);
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.site-brand-copy {
  display: grid;
  gap: 2px;
}

.site-brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-brand-copy span,
.site-header-note,
.site-filter-note,
.panel-note,
.hero-card-copy,
.kpi-detail,
.rep-detail,
.delta-pill,
.modal-summary {
  color: var(--ink-muted);
}

.site-filter-bar {
  flex-wrap: wrap;
  justify-content: center;
  padding: 14px 16px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-tight);
}

.site-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.site-nav-link:hover {
  color: var(--ink);
}

.site-nav-link.is-active {
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(15, 29, 54, 0.18);
}

.site-filter-copy {
  display: grid;
  gap: 4px;
}

.site-filter-label,
.eyebrow,
.panel-eyebrow,
.kpi-label,
.hero-card-eyebrow {
  margin: 0;
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

select,
input,
button {
  font: inherit;
}

select,
input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
}

.apply-range-button,
.gap-button,
.modal-close {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.apply-range-button {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  background: var(--amber);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-shell {
  padding-top: 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 28px;
  min-height: 520px;
  padding: 44px 40px 38px;
  background:
    linear-gradient(100deg, rgba(9, 18, 34, 0.96) 0%, rgba(9, 18, 34, 0.84) 48%, rgba(17, 41, 71, 0.75) 100%),
    radial-gradient(circle at top right, rgba(239, 162, 1, 0.24), transparent 36%);
  border-radius: 34px;
  box-shadow: 0 26px 70px rgba(15, 29, 54, 0.18);
}

.hero-content,
.hero-card {
  color: #ffffff;
}

.hero h1,
.hero-card-title,
.panel h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.hero h1 {
  max-width: 620px;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-highlights {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.hero-highlight {
  display: grid;
  gap: 6px;
  padding: 12px 14px 12px 16px;
  border-left: 3px solid var(--amber);
  background: rgba(255, 255, 255, 0.06);
}

.hero-highlight strong {
  font-size: 0.96rem;
}

.hero-highlight span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.9rem;
  line-height: 1.45;
}

.hero-card {
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(58, 47, 32, 0.88) 0%, rgba(38, 31, 22, 0.76) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
}

.hero-card-title {
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.kpi-card,
.panel,
.modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.kpi-card {
  display: grid;
  gap: 10px;
  padding: 24px;
  border-radius: 24px;
}

.kpi-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
}

.panel {
  margin-top: 24px;
  padding: 26px;
  border-radius: 30px;
}

.panel-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel h2 {
  font-size: 2rem;
}

.chart-surface {
  display: grid;
  gap: 12px;
}

.trend-bar-card {
  display: grid;
  gap: 10px;
}

.trend-bar-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
}

.trend-bar-track {
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 29, 54, 0.08);
  overflow: hidden;
}

.trend-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber) 0%, #f5c35f 100%);
}

.rep-table-wrap {
  overflow-x: auto;
}

.rep-table,
.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.rep-table th,
.rep-table td,
.detail-table th,
.detail-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.rep-table th,
.detail-table th {
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rep-name {
  font-weight: 700;
}

.rep-detail,
.delta-pill {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
}

.gap-button {
  min-width: 56px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--ink);
  font-weight: 800;
}

.gap-button:hover,
.apply-range-button:hover,
.modal-close:hover {
  transform: translateY(-1px);
}

.modal-shell.hidden,
.custom-range.hidden {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 34, 0.56);
}

.modal-card {
  position: relative;
  width: min(960px, calc(100vw - 32px));
  margin: 72px auto;
  padding: 26px;
  border-radius: 28px;
}

.modal-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.modal-close {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--navy);
  color: #ffffff;
}

.modal-content {
  margin-top: 20px;
}

.empty-state {
  padding: 28px;
  border-radius: 20px;
  background: var(--paper-soft);
  color: var(--ink-muted);
  text-align: center;
}

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

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

  .site-header-main,
  .site-filter-bar,
  .site-filter-controls,
  .site-nav,
  .panel-header,
  .trend-bar-copy {
    flex-direction: column;
    align-items: start;
  }

  .site-header-actions {
    width: 100%;
    justify-items: start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 0 14px 24px;
  }

  .site-header,
  .hero,
  .panel,
  .modal-card,
  .kpi-card {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .hero h1 {
    font-size: 2.5rem;
  }
}