:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #172033;
  --muted: #657289;
  --line: #d9e1ee;
  --paper: #ffffff;
  --soft: #f5f7fb;
  --accent: #6f52bd;
  --accent-dark: #50368f;
  --teal: #0f766e;
  --gold: #d89b28;
  --shadow: 0 18px 48px rgba(23, 32, 51, 0.09);
  --shadow-soft: 0 10px 28px rgba(23, 32, 51, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(111, 82, 189, 0.12), rgba(15, 118, 110, 0.05) 330px, transparent 520px),
    #eef3f6;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card,
.panel,
.metric-card,
.report-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 420px);
  padding: 26px;
  border-top: 5px solid var(--accent);
}

.logo {
  width: 132px;
  height: 132px;
  border-radius: 8px;
  object-fit: cover;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

h3 {
  font-size: 1.05rem;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 10px 12px;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 10px 12px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 14px;
}

button:hover {
  background: var(--accent-dark);
}

.ghost-button {
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--accent);
  background: #ffffff;
}

.app-shell {
  display: grid;
  gap: 20px;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.report-card,
.panel {
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 5px solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand .logo {
  width: 62px;
  height: 62px;
  box-shadow: var(--shadow-soft);
}

.brand .client-logo {
  background: #ffffff;
  object-fit: contain;
  padding: 6px;
}

.reports-list,
.report-body,
.stats-group {
  display: grid;
  gap: 16px;
}

.stats-group {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--section-line, var(--line));
  border-left: 8px solid var(--section-accent, var(--accent));
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--section-bg, #ffffff), #ffffff 58%);
  box-shadow: var(--shadow-soft);
  padding: 20px;
}

.stats-group::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 180px;
  height: 180px;
  background: var(--section-glow, rgba(111, 82, 189, 0.08));
  border-radius: 999px;
  content: "";
  pointer-events: none;
  transform: translate(58px, -88px);
}

.stats-group h3 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--section-title, var(--ink));
}

.section-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--section-accent, var(--accent));
  color: #ffffff;
  box-shadow: 0 10px 22px var(--section-glow, rgba(111, 82, 189, 0.14));
}

.section-icon svg {
  width: 19px;
  height: 19px;
}

.stats-reach {
  --section-accent: #1f6fff;
  --section-bg: #eaf2ff;
  --section-glow: rgba(31, 111, 255, 0.16);
  --section-line: #b9d0ff;
  --section-title: #0f3f9b;
}

.stats-feedback {
  --section-accent: #009b7b;
  --section-bg: #e9faf5;
  --section-glow: rgba(0, 155, 123, 0.16);
  --section-line: #afe6d7;
  --section-title: #006b55;
}

.stats-interactions {
  --section-accent: #8b3ff4;
  --section-bg: #f3ecff;
  --section-glow: rgba(139, 63, 244, 0.16);
  --section-line: #d3baff;
  --section-title: #5423a4;
}

.stats-geolocation {
  --section-accent: #8b6f3d;
  --section-bg: #f8f5ee;
  --section-glow: rgba(139, 111, 61, 0.09);
  --section-line: #ddd3bf;
  --section-title: #5b4724;
}

.stats-investment {
  --section-accent: #e13d5f;
  --section-bg: #fff0f4;
  --section-glow: rgba(225, 61, 95, 0.16);
  --section-line: #f3b9c6;
  --section-title: #9e1f3b;
}

.report-selector {
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}

.period-nav {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 14px;
}

.period-arrow {
  min-height: 52px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 2rem;
  line-height: 1;
  padding: 0;
}

.period-arrow:hover {
  border-color: var(--accent);
  background: #f5f1ff;
}

.period-arrow:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.period-arrow:disabled:hover {
  border-color: var(--line);
  background: #ffffff;
}

.period-current {
  display: grid;
  gap: 4px;
  min-height: 52px;
  border: 1px solid #ccd7e8;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8faff);
  padding: 10px 14px;
}

.period-current span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.period-current strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.report-selector label {
  gap: 10px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 950;
}

.report-selector select {
  min-height: 50px;
  border-color: #ccd7e8;
  background:
    linear-gradient(180deg, #ffffff, #f8faff);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
}

.video-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-left: 6px solid var(--accent);
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 51, 0.72);
  padding: 22px;
}

.video-dialog {
  width: min(100%, 960px);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.video-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: #111827;
}

.video-frame.document-frame {
  height: min(78vh, 760px);
  aspect-ratio: auto;
  background: #ffffff;
}

.video-frame iframe,
.video-frame video {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-fallback {
  display: grid;
  place-items: center;
  gap: 12px;
  color: #ffffff;
  padding: 22px;
  text-align: center;
}

.video-fallback a {
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
  padding: 10px 14px;
  text-decoration: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.metric-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 126px;
  overflow: visible;
  padding: 18px;
  border-top: 4px solid var(--section-accent, rgba(111, 82, 189, 0.72));
  box-shadow: var(--shadow-soft);
}

.metric-card .metric-label {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.25;
}

.metric-card strong {
  color: var(--ink);
  font-size: clamp(1.7rem, 3vw, 2.15rem);
  line-height: 1.05;
}

.metric-card small {
  color: var(--muted);
  font-weight: 750;
}

.comparison-line {
  display: block;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 8px;
}

.comparison-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.comparison-item span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.change-badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 950;
}

.change-badge.positive {
  background: #dff7eb;
  color: #146c43;
}

.change-badge.negative {
  background: #fde4e8;
  color: #9f2738;
}

.change-badge.neutral {
  background: #edf2f7;
  color: #596579;
}

.zone-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.zone-row {
  display: grid;
  gap: 12px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 16px;
  box-shadow: 0 5px 16px rgba(23, 32, 51, 0.04);
}

.zone-row strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.zone-total {
  color: var(--ink);
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}

.zone-breakdown {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.zone-breakdown span {
  border-radius: 999px;
  background: #eef3f6;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  padding: 6px 9px;
}

.geo-history-callout {
  --section-accent: #8b6f3d;
  --section-bg: #f8f5ee;
  --section-glow: rgba(139, 111, 61, 0.09);
  --section-line: #ddd3bf;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--section-line, var(--line));
  border-left: 8px solid var(--section-accent);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--section-bg), #ffffff 58%);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
}

.geo-history-callout::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: var(--section-glow);
  border-radius: 999px;
  content: "";
  pointer-events: none;
  transform: translate(50px, -78px);
}

.geo-history-callout p {
  position: relative;
  margin: 0;
  color: var(--ink);
  font-weight: 850;
  line-height: 1.25;
}

.geo-history-callout button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--section-accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 900;
  padding: 9px 13px;
  text-decoration: none;
  white-space: nowrap;
}

.geo-summary-grid {
  grid-template-columns: minmax(260px, 420px);
}

.info-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  background: #eef0ff;
  color: var(--accent-dark);
  cursor: help;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  vertical-align: text-top;
}

.info-dot:hover::after,
.info-dot:focus::after {
  position: absolute;
  z-index: 10;
  bottom: calc(100% + 10px);
  left: 50%;
  width: min(280px, 80vw);
  border: 1px solid rgba(23, 32, 51, 0.12);
  border-radius: 8px;
  background: #172033;
  color: #ffffff;
  box-shadow: var(--shadow);
  content: attr(data-tip);
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.35;
  padding: 10px 12px;
  text-align: left;
  transform: translateX(-50%);
  white-space: normal;
}

.info-dot:hover::before,
.info-dot:focus::before {
  position: absolute;
  z-index: 11;
  bottom: calc(100% + 4px);
  left: 50%;
  width: 10px;
  height: 10px;
  background: #172033;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.form-error,
.empty {
  color: var(--muted);
  font-weight: 800;
}

.section-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.feedback-note {
  border-top: 1px solid var(--section-line, var(--line));
  padding-top: 12px;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .period-nav {
    grid-template-columns: 44px 1fr 44px;
    gap: 8px;
  }

  .period-arrow {
    min-height: 46px;
    font-size: 1.6rem;
  }

  .zone-row {
    grid-template-columns: 1fr;
  }

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

  .geo-history-callout {
    align-items: flex-start;
    flex-direction: column;
  }
}
