:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-2: #edf3f8;
  --surface-3: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --accent: #00a6d6;
  --accent-dark: #006d91;
  --accent-ink: #003347;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #9a6700;
  --warning-soft: #fff8df;
  --success: #11845b;
  --line: rgba(17, 24, 39, 0.12);
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --radius: 20px;
  --ease: cubic-bezier(.2,.9,.2,1);
}

/* Compact dashboard context */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar {
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  margin-top: 5px;
  font-size: clamp(2rem, 3.1vw, 2.55rem);
  line-height: 1.08;
}

.topbar .lead {
  max-width: 720px;
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.compact-action {
  min-height: 40px;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.compact-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-action.is-loading svg {
  animation: context-spin 900ms linear infinite;
}

@keyframes context-spin {
  to {
    transform: rotate(360deg);
  }
}

.context-toolbar {
  position: sticky;
  top: 10px;
  z-index: 70;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.05);
}

.context-toolbar-scroll {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  padding: 9px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  overscroll-behavior-inline: contain;
}

.context-toolbar-scroll::-webkit-scrollbar {
  height: 5px;
}

.context-toolbar-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(0, 109, 145, 0.22);
}

.context-control,
.context-sync,
.context-custom-range {
  min-width: 0;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.context-control {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 58px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  padding: 0 9px 0 3px;
}

.context-control.has-active-filter {
  border-radius: 8px;
  background: rgba(0, 109, 145, 0.065);
}

.context-control.has-active-filter .context-control-label {
  color: var(--accent-ink);
}

.context-control-label {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.context-control-label svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.context-toolbar select,
.context-toolbar input {
  width: 100%;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: 0;
  background: var(--surface-3);
  color: var(--ink);
  padding: 6px 28px 6px 8px;
  font-size: 0.73rem;
  font-weight: 850;
}

.context-toolbar select:hover,
.context-toolbar input:hover {
  border-color: rgba(0, 109, 145, 0.2);
  background: #fff;
}

.context-toolbar select:focus-visible,
.context-toolbar input:focus-visible,
.view-mode-button:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(0, 157, 204, 0.18);
  outline-offset: 1px;
}

.context-toolbar select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.context-mode-control {
  flex-basis: 202px;
}

.context-account-control {
  flex: 1 1 210px;
  min-width: 190px;
}

.context-period-control {
  flex-basis: 190px;
}

.context-channel-control {
  flex-basis: 128px;
}

.context-status-control {
  flex-basis: 122px;
}

.context-filter-group {
  display: contents;
}

.context-toolbar .view-mode-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(0, 109, 145, 0.12);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 2px;
}

.context-toolbar .view-mode-button {
  min-height: 30px;
  min-width: 0;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 0.67rem;
  white-space: nowrap;
}

.context-toolbar .view-mode-button.active {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 5px 12px rgba(0, 84, 111, 0.19);
}

.context-range {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.59rem;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-custom-range {
  display: flex;
  align-items: end;
  gap: 5px;
  min-height: 58px;
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  padding-right: 8px;
}

.context-custom-range label {
  display: grid;
  flex: 0 0 118px;
  gap: 4px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 900;
  text-transform: uppercase;
}

.context-custom-range input {
  padding-right: 6px;
}

.context-custom-range .ghost-button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
}

.context-sync {
  display: flex;
  flex-basis: 108px;
  align-items: center;
  gap: 6px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  line-height: 1.25;
}

.sync-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #18a66a;
  box-shadow: 0 0 0 4px rgba(24, 166, 106, 0.11);
}

.context-sync.is-warning .sync-dot {
  background: #d99a1b;
  box-shadow: 0 0 0 4px rgba(217, 154, 27, 0.12);
}

.context-scroll-hint {
  display: none;
}

@media (max-width: 1180px) {
  .context-toolbar-scroll {
    padding-bottom: 11px;
  }

  .context-scroll-hint {
    position: absolute;
    z-index: 2;
    right: 9px;
    bottom: 1px;
    display: block;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent-ink);
    padding: 2px 7px;
    font-size: 0.55rem;
    font-weight: 900;
    pointer-events: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar h1 {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    font-size: clamp(1.25rem, 5.6vw, 1.45rem);
    overflow-wrap: anywhere;
    text-wrap: balance;
    white-space: pre-line !important;
    word-break: normal;
  }

  .topbar .lead {
    display: none;
  }

  .top-actions {
    display: flex;
    gap: 7px;
  }

  .top-actions .compact-action {
    min-height: 38px;
    width: auto;
    padding-inline: 11px;
  }

  .context-toolbar {
    top: 62px;
    margin-bottom: 14px;
    border-radius: 10px;
  }

  .context-toolbar-scroll {
    gap: 5px;
    padding: 7px 7px 11px;
  }

  .context-control {
    min-height: 56px;
  }

  .context-mode-control {
    flex-basis: 198px;
  }

  .context-account-control {
    flex: 0 0 236px;
  }

  .context-period-control {
    flex-basis: 202px;
  }

  .context-channel-control,
  .context-status-control {
    flex-basis: 155px;
  }

  .context-sync {
    flex-basis: 116px;
  }
}

@media screen and (max-width: 0px) {
  .context-toolbar {
    display: none !important;
  }

  .topbar {
    margin-bottom: 10px !important;
  }

  .top-actions {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .context-toolbar-scroll {
    scroll-behavior: auto;
  }

  .compact-action.is-loading svg {
    animation: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(0, 166, 214, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 48%, #ffffff 100%);
  font-family: "Inter", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
canvas {
  max-width: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100vh;
  padding: 26px 22px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(0, 109, 145, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(0, 166, 214, 0.08)),
    #f8fafc;
  padding: 18px;
  box-shadow: 0 16px 46px rgba(15, 23, 42, 0.08);
}

.brand span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand img {
  width: min(156px, 100%);
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
  height: auto;
  display: block;
}

.brand img[src*="logo-nutribullet"],
.account-logo[src*="logo-nutribullet"] {
  border: 1px solid rgba(0, 166, 214, 0.16);
  border-radius: 999px;
  background: #071827;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 28px rgba(7, 24, 39, 0.14);
}

.brand img[src*="logo-nutribullet"] {
  width: min(190px, 100%);
  max-height: 60px;
  padding: 10px 16px;
}

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

.is-hidden {
  display: none !important;
}

.nav-item {
  border-radius: 14px;
  color: var(--muted);
  font-weight: 800;
  padding: 13px 14px;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.nav-item:hover,
.nav-item.active {
  color: var(--accent-ink);
  background: var(--surface-2);
}

.account-card {
  display: grid;
  gap: 7px;
  margin-top: auto;
  border: 1px solid rgba(0, 109, 145, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.06), rgba(0, 166, 214, 0.08)),
    #f8fafc;
  padding: 16px;
}

.account-logo {
  width: min(132px, 100%);
  max-height: 38px;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 4px;
}

.account-logo[src*="logo-nutribullet"] {
  width: min(172px, 100%);
  max-height: 54px;
  padding: 8px 14px;
  margin-bottom: 6px;
}

.account-card span,
.section-kicker {
  color: var(--accent-dark);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.account-card strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.25rem;
}

.account-card small,
.lead,
.metric-card small,
.funnel-step small {
  color: var(--muted);
}

.dashboard {
  padding: 32px;
}

.topbar,
.account-switcher,
.filter-panel,
.hero-panel,
.metric-grid,
.comparison-panel,
.content-grid {
  max-width: 1200px;
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

h1,
h2 {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  letter-spacing: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
}

.lead {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.6;
}

.top-actions,
.period-filter,
.custom-range,
.select-grid {
  display: flex;
  gap: 12px;
}

.top-actions {
  white-space: nowrap;
}

.account-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  align-items: end;
  gap: 18px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.92);
  padding: 22px;
  box-shadow: 0 16px 54px rgba(15, 23, 42, 0.08);
}

.account-switcher strong {
  display: block;
  margin-top: 5px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.25rem;
}

.account-switcher span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.view-mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 4px;
}

.view-mode-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 9px 13px;
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 180ms var(--ease);
}

.view-mode-button:hover {
  transform: translateY(-1px);
}

.view-mode-button.active {
  background: #fff;
  color: var(--accent-ink);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.account-switcher label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.account-switcher select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  padding: 8px 12px;
}

.account-switcher select:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.primary-button,
.ghost-button,
.filter-chip {
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 13px 18px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #111827, var(--accent-dark));
  box-shadow: 0 18px 40px rgba(0, 109, 145, 0.22);
}

.primary-button[disabled],
.ghost-button[disabled] {
  cursor: wait;
  opacity: 0.65;
}

.ghost-button {
  color: var(--accent-ink);
  border: 1px solid var(--line);
  background: #fff;
}

.ghost-button.small {
  padding: 10px 14px;
}

.primary-button:hover,
.ghost-button:hover,
.nav-item:hover,
.filter-chip:hover {
  transform: translateY(-2px);
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.9);
  padding: 22px;
  box-shadow: 0 16px 54px rgba(15, 23, 42, 0.08);
}

.filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.filter-panel strong {
  display: block;
  margin-top: 5px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.35rem;
}

.filter-panel span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.collapse-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 109, 145, 0.18);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-ink);
  font-weight: 900;
  padding: 12px 16px;
  white-space: nowrap;
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}

.collapse-button:hover {
  transform: translateY(-2px);
}

.collapse-button .collapse-button-label {
  display: inline;
  margin: 0;
  color: inherit;
}

.collapse-button::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-ink);
  line-height: 1;
}

.filter-panel:not(.collapsed) .collapse-button::after {
  content: "-";
}

.filter-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.filter-panel.collapsed .filter-body {
  display: none;
}

.period-filter {
  max-width: 340px;
}

.period-filter label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.period-filter select {
  min-height: 44px;
  border: 1px solid rgba(0, 109, 145, 0.22);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  padding: 9px 42px 9px 13px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

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

.custom-range {
  flex-wrap: wrap;
  align-items: end;
}

.custom-range.is-hidden {
  display: none;
}

.custom-range label,
.select-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.custom-range input,
.select-grid select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  padding: 8px 12px;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
  overflow: hidden;
  border: 1px solid rgba(0, 166, 214, 0.22);
  border-radius: 28px;
  background:
    linear-gradient(135deg, #0f172a 0%, #07364b 58%, #008db8 100%);
  color: #fff;
  padding: 34px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.2);
}

.hero-panel .section-kicker {
  color: #8ee8ff;
}

.hero-panel h2 {
  margin-top: 8px;
  max-width: 790px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.04;
}

.hero-panel p:last-child {
  margin: 14px 0 0;
  max-width: 680px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.hero-indicators {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.goal-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 176px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #0f172a 69%, transparent 70%),
    conic-gradient(#8ee8ff 0 var(--roas-progress, 46%), rgba(255,255,255,0.2) var(--roas-progress, 46%) 100%);
  flex: 0 0 auto;
  text-align: center;
}

.goal-ring span {
  font-family: "Manrope", Arial, sans-serif;
  max-width: 74%;
  font-size: clamp(1.78rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 0.94;
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  white-space: nowrap;
}

.goal-ring small {
  color: #d9f8ff;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.investment-share {
  display: grid;
  gap: 4px;
  width: min(218px, 100%);
  border: 1px solid rgba(142, 232, 255, 0.38);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  padding: 14px 16px;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.investment-share span {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.investment-share small {
  color: #d9f8ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.18;
  max-width: 170px;
  justify-self: center;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 16px 54px rgba(15, 23, 42, 0.08);
}

.metric-card {
  display: grid;
  align-content: center;
  gap: 12px;
  min-height: 126px;
  padding: 24px 22px;
}

.metric-card.highlight {
  background:
    linear-gradient(180deg, rgba(0, 166, 214, 0.1), transparent 48%),
    #fff;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
}

.metric-card strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.analytics-view {
  display: grid;
  gap: 16px;
  max-width: 1200px;
  margin-inline: auto;
}

.analytics-state {
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 900;
  padding: 16px;
}

.analytics-disclaimer {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(0, 84, 111, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(0, 166, 214, 0.08), transparent 58%),
    #fff;
  color: var(--muted);
  margin-top: 14px;
  padding: 16px;
}

.analytics-disclaimer p {
  margin: 6px 0 0;
  font-size: 0.93rem;
  font-weight: 800;
  line-height: 1.5;
}

.analytics-disclaimer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.analytics-disclaimer li {
  border: 1px solid rgba(0, 84, 111, 0.1);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 7px 10px;
}

.analytics-disclaimer strong {
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.analytics-metrics {
  margin-bottom: 0;
}

.analytics-insights,
.analytics-decision-grid {
  display: grid;
  gap: 16px;
}

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

.analytics-insight-card {
  display: grid;
  gap: 9px;
  min-height: 136px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 16px 36px rgba(5, 24, 44, 0.06);
}

.analytics-insight-card span,
.analytics-insight-card small {
  color: var(--muted);
  font-weight: 900;
}

.analytics-insight-card span {
  font-size: 0.72rem;
  text-transform: uppercase;
}

.analytics-insight-card strong {
  align-self: end;
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.05rem;
  line-height: 1.12;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.analytics-insight-card small {
  font-size: 0.82rem;
  line-height: 1.25;
}

.analytics-insight-card.scale {
  border-color: rgba(24, 147, 107, 0.25);
  background: linear-gradient(180deg, rgba(34, 197, 136, 0.11), #fff 72%);
}

.analytics-insight-card.warning {
  border-color: rgba(210, 144, 35, 0.28);
  background: linear-gradient(180deg, rgba(245, 168, 54, 0.14), #fff 72%);
}

.analytics-insight-card.danger {
  border-color: rgba(216, 74, 74, 0.28);
  background: linear-gradient(180deg, rgba(248, 98, 98, 0.12), #fff 72%);
}

.analytics-insight-card.monitor {
  border-color: rgba(0, 166, 214, 0.22);
  background: linear-gradient(180deg, rgba(0, 166, 214, 0.1), #fff 72%);
}

.analytics-decision-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.75fr);
  align-items: stretch;
}

.analytics-trend-panel,
.analytics-recommendations-panel {
  min-height: 100%;
  min-width: 0;
  overflow: hidden;
}

.trend-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.trend-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  padding: 9px 12px;
}

.trend-button.active,
.trend-button:hover {
  border-color: rgba(0, 84, 111, 0.18);
  background: rgba(0, 166, 214, 0.12);
  color: var(--accent-ink);
}

.trend-chart {
  position: relative;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.trend-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trend-summary div {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  background: var(--surface-3);
  min-width: 0;
  padding: 11px 12px;
}

.trend-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-summary strong {
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(0.98rem, 1.6vw, 1.08rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.trend-summary .positive strong {
  color: #13835f;
}

.trend-summary .negative strong {
  color: #bd4141;
}

.trend-plot-shell {
  position: relative;
  min-width: 0;
  border-radius: 18px;
}

.trend-svg {
  display: block;
  width: 100%;
  height: clamp(190px, 24vw, 248px);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(0, 166, 214, 0.08), transparent 72%),
    var(--surface-3);
  overflow: hidden;
}

.trend-area {
  fill: rgba(0, 166, 214, 0.13);
}

.trend-bar {
  fill: rgba(0, 84, 111, 0.13);
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
}

.trend-point {
  fill: #fff;
  stroke: var(--accent-ink);
  stroke-width: 3;
  cursor: pointer;
  outline: none;
  transition: r 160ms ease, stroke-width 160ms ease, filter 160ms ease;
}

.trend-point:hover,
.trend-point:focus {
  filter: drop-shadow(0 4px 10px rgba(0, 84, 111, 0.25));
  r: 7;
  stroke-width: 4;
}

.trend-tooltip {
  position: absolute;
  z-index: 5;
  width: min(230px, calc(100% - 20px));
  border: 1px solid rgba(0, 84, 111, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 34px rgba(5, 24, 44, 0.16);
  color: var(--ink);
  opacity: 0;
  padding: 12px;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.trend-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.trend-tooltip span {
  color: var(--accent-ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-tooltip strong {
  display: block;
  margin-top: 4px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.12;
}

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

.trend-tooltip div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trend-tooltip dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trend-tooltip dd {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.trend-axis {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.analytics-recommendations {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.recommendation-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-left: 5px solid rgba(0, 166, 214, 0.5);
  border-radius: 16px;
  background: var(--surface-3);
  min-width: 0;
  padding: 13px 14px;
}

.recommendation-item span {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.recommendation-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.recommendation-item.scale {
  border-left-color: #22a579;
}

.recommendation-item.warning {
  border-left-color: #e1a12d;
}

.recommendation-item.danger {
  border-left-color: #d95050;
}

.journey-funnel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.journey-step {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 132px;
  border-radius: 18px;
  background: var(--surface-3);
  padding: 18px 16px;
}

.journey-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 18px;
  height: 2px;
  background: rgba(0, 166, 214, 0.28);
}

.journey-step:last-child::after {
  display: none;
}

.journey-step span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
}

.journey-step strong {
  align-self: end;
  color: var(--accent-ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.journey-step small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
}

.journey-step em {
  justify-self: start;
  border-radius: 999px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  padding: 6px 9px;
}

.journey-step.is-healthy em {
  background: rgba(34, 197, 136, 0.14);
  color: #126d50;
}

.journey-step.is-warning em {
  background: rgba(245, 168, 54, 0.17);
  color: #8b5b0f;
}

.journey-step.is-critical em {
  background: rgba(248, 98, 98, 0.15);
  color: #9f2f2f;
}

.journey-reference {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.comparison-panel {
  margin-bottom: 22px;
  width: 100%;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}

.comparison-grid-primary {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.comparison-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-3);
  padding: 14px 16px;
}

.comparison-card > span,
.comparison-card small,
.comparison-chip > span,
.comparison-chip small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
}

.comparison-card > span,
.comparison-chip > span {
  text-transform: uppercase;
}

.comparison-card strong,
.comparison-chip strong {
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  line-height: 1;
  overflow-wrap: anywhere;
}

.comparison-card strong {
  font-size: clamp(1rem, 1.35vw, 1.22rem);
}

.comparison-card small,
.comparison-chip small {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.comparison-card small span:first-child,
.comparison-chip small span:first-child {
  color: inherit;
}

.comparison-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.comparison-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  padding: 9px 12px;
}

.comparison-chip strong {
  font-size: 0.98rem;
  line-height: 1;
}

.comparison-card.positive {
  border-color: rgba(34, 165, 121, 0.24);
  background: linear-gradient(180deg, rgba(34, 197, 136, 0.08), var(--surface-3) 76%);
}

.comparison-card.positive small,
.comparison-chip.positive small {
  color: #126d50;
}

.comparison-card.neutral,
.comparison-chip.neutral {
  border-color: rgba(100, 116, 139, 0.16);
  background: linear-gradient(180deg, rgba(100, 116, 139, 0.045), var(--surface-3) 76%);
}

.comparison-card.attention,
.comparison-card.negative,
.comparison-chip.attention,
.comparison-chip.negative {
  border-color: rgba(210, 144, 35, 0.18);
  background: linear-gradient(180deg, rgba(245, 168, 54, 0.075), var(--surface-3) 76%);
}

.comparison-card.attention small,
.comparison-card.negative small,
.comparison-chip.attention small,
.comparison-chip.negative small {
  color: #8b5b0f;
}

.comparison-card.critical,
.comparison-chip.critical {
  border-color: rgba(216, 74, 74, 0.22);
  background: linear-gradient(180deg, rgba(248, 98, 98, 0.065), var(--surface-3) 76%);
}

.comparison-card.critical small,
.comparison-chip.critical small {
  color: #9f2f2f;
}

.analytics-geo-device-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.analytics-geo-panel,
.analytics-device-panel {
  min-width: 0;
  overflow: hidden;
}

.geo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.geo-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(280px, 0.78fr);
  gap: 16px;
  align-items: start;
}

.geo-map-shell {
  position: relative;
  min-width: 0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(0, 166, 214, 0.08), transparent 72%),
    var(--surface-3);
  padding: 12px;
}

.geo-map {
  display: block;
  width: 100%;
  height: clamp(280px, 34vw, 360px);
}

.geo-map-ibge {
  overflow: visible;
}

.geo-country-shadow {
  fill: rgba(0, 84, 111, 0.08);
  filter: drop-shadow(0 16px 28px rgba(5, 24, 44, 0.12));
  transform: translate(8px, 10px);
}

.geo-state path {
  stroke: rgba(0, 84, 111, 0.28);
  stroke-width: 1.35;
  vector-effect: non-scaling-stroke;
  transition: filter 160ms ease, stroke-width 160ms ease, transform 160ms ease;
}

.geo-state text {
  fill: var(--accent-ink);
  font-size: 0.72px;
  font-weight: 900;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-linejoin: round;
  stroke-width: 0.16px;
}

.geo-state:hover path,
.geo-state:focus path {
  filter: drop-shadow(0 8px 14px rgba(0, 84, 111, 0.22));
  stroke: rgba(0, 84, 111, 0.55);
  stroke-width: 2;
}

.geo-state path[fill*="0."] {
  filter: drop-shadow(0 6px 12px rgba(0, 84, 111, 0.08));
}

.geo-map-shell p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.geo-tooltip {
  position: absolute;
  z-index: 5;
  width: min(240px, calc(100% - 20px));
  border: 1px solid rgba(0, 84, 111, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 34px rgba(5, 24, 44, 0.16);
  color: var(--ink);
  opacity: 0;
  padding: 12px;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.geo-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.geo-tooltip span,
.geo-tooltip dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.geo-tooltip strong {
  display: block;
  margin-top: 4px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.05rem;
}

.geo-tooltip dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.geo-tooltip dd {
  margin: 0;
  font-weight: 900;
}

.geo-rankings,
.geo-ranking-list,
.device-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.geo-more {
  margin-top: 10px;
}

.geo-rankings h3 {
  margin: 0 0 8px;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
}

.geo-fallback {
  display: grid;
  gap: 10px;
}

.geo-fallback p {
  margin: 0;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.4;
  padding: 12px;
}

.geo-fallback h3 {
  margin: 4px 0 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
}

.geo-rank-item,
.device-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-3);
  padding: 12px;
}

.geo-rank-item strong,
.device-card strong {
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.geo-rank-item span {
  color: var(--accent-ink);
  font-weight: 900;
}

.geo-rank-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.device-card > div:first-child {
  display: grid;
  gap: 5px;
}

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

.device-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 84, 111, 0.14);
}

.device-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.device-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.device-card dt {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.device-card dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

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

.analytics-ranking-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.analytics-ranking {
  display: grid;
  gap: 10px;
}

.analytics-rank-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-3);
  padding: 14px;
}

.rank-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rank-title strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.15;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rank-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(0, 166, 214, 0.12);
  color: var(--accent-ink);
  font-size: 0.64rem;
  font-weight: 900;
  padding: 5px 8px;
  text-transform: uppercase;
}

.analytics-rank-item.is-scale {
  border-color: rgba(34, 165, 121, 0.26);
}

.analytics-rank-item.is-scale .rank-badge {
  background: rgba(34, 197, 136, 0.16);
  color: #126d50;
}

.analytics-rank-item.is-good-revenue {
  border-color: rgba(0, 166, 214, 0.24);
}

.analytics-rank-item.is-good-revenue .rank-badge {
  background: rgba(0, 166, 214, 0.13);
  color: var(--accent-ink);
}

.analytics-rank-item.is-opportunity .rank-badge {
  background: rgba(245, 168, 54, 0.18);
  color: #8b5b0f;
}

.analytics-rank-item.is-investigate .rank-badge {
  background: rgba(248, 98, 98, 0.15);
  color: #9f2f2f;
}

.rank-description {
  margin: -3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rank-bars {
  display: grid;
  gap: 4px;
}

.rank-bar {
  display: block;
  height: 5px;
  min-width: 8px;
  border-radius: 999px;
}

.rank-bar.revenue {
  background: var(--accent);
}

.rank-bar.traffic {
  background: rgba(0, 84, 111, 0.22);
}

.analytics-rank-item dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.analytics-rank-item div {
  display: grid;
  gap: 3px;
}

.analytics-rank-item dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.analytics-rank-item dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 900;
}

.analytics-rank-more {
  display: grid;
  gap: 10px;
}

.analytics-rank-more summary {
  cursor: pointer;
  border: 1px dashed rgba(0, 84, 111, 0.25);
  border-radius: 14px;
  color: var(--accent-ink);
  font-weight: 900;
  list-style: none;
  padding: 12px;
  text-align: center;
}

.analytics-rank-more .summary-less {
  display: none;
}

.analytics-rank-more[open] .summary-more {
  display: none;
}

.analytics-rank-more[open] .summary-less {
  display: inline;
}

.analytics-rank-more summary::-webkit-details-marker {
  display: none;
}

.analytics-rank-more[open] summary {
  margin-bottom: 10px;
}

.panel {
  padding: 24px;
}

.panel-large,
#funil,
#canais,
#campanhas {
  grid-column: 1 / -1;
}

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

.panel-header h2 {
  margin-top: 6px;
  font-size: 1.55rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 8px 12px;
  white-space: nowrap;
}

.funnel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.funnel-step {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 138px;
  border-radius: 18px;
  background: var(--surface-3);
  padding: 18px 16px;
  min-width: 0;
}

.funnel-step::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 18px;
  height: 2px;
  background: rgba(0, 166, 214, 0.28);
}

.funnel-step:last-child::after {
  display: none;
}

.funnel-step span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.funnel-step strong {
  align-self: end;
  color: var(--accent-ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.32rem, 2vw, 1.95rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.funnel-step small {
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.channel-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-3);
  padding: 16px;
}

.channel-card-header {
  display: grid;
  gap: 8px;
}

.channel-card-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.channel-card-header strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.25rem;
  line-height: 1.05;
}

.channel-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e6ee;
}

.channel-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.channel-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.channel-metrics div {
  display: grid;
  gap: 4px;
}

.channel-metrics dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.channel-metrics dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

.empty-state {
  grid-column: 1 / -1;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 900;
  padding: 18px;
}

.creative-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.creative-state {
  grid-column: 1 / -1;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--muted);
  font-weight: 900;
  padding: 18px;
}

.creative-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.creative-media {
  display: grid;
  place-items: center;
  min-height: 220px;
  background: var(--surface-3);
}

.creative-media img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.creative-placeholder {
  color: var(--muted);
  font-weight: 900;
  padding: 18px;
  text-align: center;
}

.creative-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.creative-body > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.35;
}

.creative-body h3 {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.12rem;
  line-height: 1.16;
}

.creative-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.creative-metrics div {
  display: grid;
  gap: 4px;
  border-radius: 14px;
  background: var(--surface-3);
  padding: 10px;
}

.creative-metrics dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.creative-metrics dd {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 900;
}

.creative-link {
  width: fit-content;
}

.creative-link-unavailable {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 10px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  max-width: 360px;
  text-align: left;
  white-space: normal;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  font-weight: 800;
}

.campaign-name {
  display: grid;
  gap: 4px;
}

.campaign-name small {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .metric-grid,
  .secondary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .funnel,
  .journey-funnel,
  .channel-grid,
  .comparison-grid,
  .comparison-grid-primary,
  .analytics-insights,
  .analytics-decision-grid,
  .analytics-ranking-grid,
  .analytics-geo-device-grid,
  .geo-layout,
  .creative-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-decision-grid,
  .analytics-geo-device-grid,
  .geo-layout {
    grid-template-columns: 1fr;
  }

  .funnel-step,
  .journey-step {
    min-height: auto;
  }

  .funnel-step::after,
  .journey-step::after {
    display: none;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    align-items: center;
    grid-template-columns: 1fr auto;
  }

  .brand img {
    width: 126px;
  }

  .account-card {
    margin-top: 0;
  }

  .nav-list {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .nav-item {
    text-align: center;
    white-space: nowrap;
  }

  .topbar,
  .account-switcher,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .hero-indicators {
    justify-self: center;
  }

  .goal-ring {
    width: 164px;
  }

  .investment-share {
    width: min(218px, 100%);
  }
}

@media (max-width: 680px) {
  body {
    background:
      linear-gradient(135deg, rgba(0, 166, 214, 0.09), transparent 34%),
      linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  }

  .dashboard,
  .sidebar {
    padding: 14px;
  }

  .sidebar {
    gap: 14px;
  }

  .brand {
    grid-template-columns: 1fr;
    border-radius: 16px;
  }

  .brand img {
    width: 118px;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    margin-inline: -2px;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.84);
    padding: 10px 12px;
    font-size: 0.86rem;
  }

  .topbar {
    gap: 16px;
    margin-bottom: 16px;
  }

  h1 {
    margin-top: 6px;
    font-size: clamp(2.2rem, 13vw, 3.1rem);
    line-height: 0.98;
  }

  .lead {
    margin-top: 12px;
    font-size: 0.96rem;
    line-height: 1.48;
  }

  .top-actions,
  .account-switcher,
  .filter-summary,
  .period-filter,
  .custom-range {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .select-grid,
  .metric-grid,
  .secondary-metrics,
  .content-grid,
  .funnel,
  .channel-grid,
  .creative-grid {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  .collapse-button,
  .account-switcher label,
  .account-switcher select,
  .period-filter,
  .period-filter label,
  .period-filter select,
  .custom-range label,
  .custom-range input,
  .select-grid label,
  .select-grid select {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    justify-content: center;
    padding: 12px 16px;
  }

  .hero-panel,
  .panel,
  .metric-card,
  .filter-panel {
    border-radius: 18px;
    padding: 16px;
  }

  .filter-panel {
    margin-bottom: 16px;
  }

  .filter-panel strong {
    font-size: 1.15rem;
  }

  .filter-panel span {
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .filter-body {
    gap: 14px;
    margin-top: 14px;
  }

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

  .filter-chip {
    padding: 10px 8px;
    text-align: center;
  }

  .hero-panel {
    gap: 18px;
    margin-bottom: 16px;
  }

  .hero-panel h2 {
    font-size: clamp(1.72rem, 8.5vw, 2.35rem);
    line-height: 1.04;
  }

  .hero-panel p:last-child {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .goal-ring {
    width: 148px;
    gap: 7px;
  }

  .goal-ring span {
    font-size: 2.1rem;
    max-width: 76%;
  }

  .goal-ring small {
    font-size: 0.8rem;
  }

  .investment-share {
    width: min(204px, 100%);
    padding: 12px 14px;
  }

  .investment-share span {
    font-size: 1.3rem;
  }

  .investment-share small {
    font-size: 0.68rem;
  }

  .metric-grid,
  .secondary-metrics,
  .content-grid,
  .analytics-view {
    gap: 12px;
    margin-bottom: 12px;
  }

  .metric-card {
    gap: 10px;
    min-height: 112px;
  }

  .analytics-disclaimer {
    padding: 14px;
  }

  .analytics-disclaimer p,
  .analytics-disclaimer strong {
    font-size: 0.84rem;
  }

  .analytics-disclaimer ul {
    display: grid;
    grid-template-columns: 1fr;
  }

  .analytics-disclaimer li {
    border-radius: 12px;
    line-height: 1.25;
  }

  .metric-card span {
    font-size: 0.82rem;
  }

  .metric-card strong {
    font-size: 1.6rem;
    line-height: 1.05;
  }

  .journey-funnel,
  .analytics-insights,
  .analytics-decision-grid,
  .analytics-ranking-grid,
  .comparison-grid,
  .comparison-grid-primary,
  .analytics-geo-device-grid,
  .geo-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .comparison-chips {
    display: grid;
    grid-template-columns: 1fr;
  }

  .comparison-chip {
    align-items: flex-start;
    border-radius: 14px;
    flex-direction: column;
  }

  .analytics-insight-card {
    min-height: 116px;
  }

  .trend-summary {
    grid-template-columns: 1fr;
  }

  .trend-svg {
    height: 190px;
  }

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

  .trend-button {
    padding: 10px 8px;
    text-align: center;
  }

  .trend-tooltip {
    position: static;
    width: 100%;
    margin-top: 10px;
    opacity: 1;
    transform: none;
  }

  .trend-tooltip:not(.is-visible) {
    display: none;
  }

  .geo-map {
    height: 300px;
  }

  .geo-state text {
    display: none;
  }

  .geo-tooltip {
    position: static;
    width: 100%;
    margin-top: 10px;
    opacity: 1;
    transform: none;
  }

  .geo-tooltip:not(.is-visible) {
    display: none;
  }

  .device-card dl {
    grid-template-columns: 1fr;
  }

  .rank-title {
    display: grid;
  }

  .rank-badge {
    justify-self: start;
  }

  .analytics-rank-item dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card small {
    line-height: 1.35;
  }

  .panel-header {
    display: block;
    margin-bottom: 18px;
  }

  .panel-header h2 {
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .panel-header .pill {
    margin-top: 10px;
  }

  .funnel {
    gap: 10px;
  }

  .funnel-step {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    border-radius: 16px;
    padding: 14px;
  }

  .funnel-step strong {
    grid-row: span 2;
    font-size: 1.35rem;
    text-align: right;
  }

  .table-wrap {
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-3);
    padding: 12px;
  }

  td,
  td:first-child {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    max-width: none;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    padding: 10px 0;
    text-align: right;
    white-space: normal;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    flex: 0 0 82px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  td:first-child {
    display: block;
    text-align: left;
  }

  td:first-child::before {
    display: block;
    margin-bottom: 8px;
  }

  .campaign-name strong {
    font-size: 0.98rem;
    line-height: 1.25;
  }

  .creative-media,
  .creative-media img {
    min-height: 190px;
    height: 190px;
  }

  .creative-body {
    padding: 14px;
  }

  .creative-metrics {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 0px) {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  body {
    background: #fff;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .sidebar,
  .top-actions,
  .filter-body,
  .collapse-button {
    display: none !important;
  }

  .dashboard {
    padding: 0;
    width: 281mm;
    max-width: 281mm;
    margin: 0 auto;
  }

    .topbar,
  .account-switcher,
  .filter-panel,
  .hero-panel,
  .metric-grid,
  .comparison-panel,
  .content-grid {
    max-width: none;
  }

  .topbar {
    display: block;
    margin-bottom: 8px;
  }

  .account-switcher {
    margin-bottom: 8px;
    padding: 8px 12px;
    box-shadow: none;
  }

  .account-switcher strong {
    font-size: 1rem;
  }

  .account-switcher span,
  .account-switcher label {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.85rem;
    line-height: 1;
  }

  .lead {
    max-width: none;
    margin-top: 6px;
    font-size: 0.74rem;
    line-height: 1.35;
  }

  .filter-panel {
    margin-bottom: 8px;
    padding: 8px 12px;
    box-shadow: none;
  }

  .filter-panel strong {
    font-size: 1rem;
  }

  .filter-panel span {
    font-size: 0.7rem;
  }

  .hero-panel,
  .metric-card,
  .panel {
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    margin-bottom: 8px;
    border-radius: 18px;
    padding: 14px 16px;
  }

  .hero-panel h2 {
    max-width: none;
    font-size: 1.42rem;
  }

  .hero-panel p:last-child {
    margin-top: 8px;
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .goal-ring {
    width: 104px;
    gap: 5px;
  }

  .goal-ring span {
    font-size: 1.36rem;
    max-width: 76%;
  }

  .goal-ring small {
    font-size: 0.62rem;
  }

  .investment-share {
    width: min(174px, 100%);
    gap: 3px;
    padding: 9px 10px;
  }

  .investment-share span {
    font-size: 1.1rem;
  }

  .investment-share small {
    max-width: 128px;
    font-size: 0.56rem;
    line-height: 1.08;
  }

  .metric-grid,
  .secondary-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
  }

  .metric-card,
  .panel {
    border-radius: 14px;
    padding: 9px 10px;
  }

  .metric-card {
    gap: 4px;
    min-height: 58px;
  }

  .metric-card span {
    font-size: 0.62rem;
  }

  .metric-card strong {
    font-size: 0.95rem;
    line-height: 1.05;
  }

  .metric-card small {
    font-size: 0.56rem;
    line-height: 1.2;
  }

  .content-grid {
    gap: 6px;
  }

  .panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .panel-header h2 {
    margin-top: 2px;
    font-size: 1rem;
  }

  .section-kicker {
    font-size: 0.56rem;
  }

  .pill {
    padding: 5px 8px;
    font-size: 0.56rem;
  }

  .funnel {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .funnel-step {
    min-height: 72px;
    border-radius: 12px;
    padding: 8px;
  }

  .funnel-step::after {
    display: none;
  }

  .funnel-step span {
    font-size: 0.55rem;
  }

  .funnel-step strong {
    font-size: 0.96rem;
  }

  .funnel-step small {
    font-size: 0.54rem;
    line-height: 1.15;
  }

  .channel-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .channel-card {
    gap: 6px;
    border-radius: 12px;
    padding: 8px;
  }

  .channel-card-header strong {
    font-size: 0.78rem;
  }

  .channel-metrics {
    gap: 4px;
  }

  .channel-metrics dt {
    font-size: 0.48rem;
  }

  .channel-metrics dd {
    font-size: 0.58rem;
  }

  .creative-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .creative-card {
    border-radius: 12px;
    box-shadow: none;
  }

  .creative-media,
  .creative-media img {
    min-height: 76px;
    height: 76px;
  }

  .creative-body {
    gap: 5px;
    padding: 8px;
  }

  .creative-body > span {
    font-size: 0.5rem;
  }

  .creative-body h3 {
    font-size: 0.66rem;
  }

  .creative-metrics {
    gap: 4px;
  }

  .creative-metrics div {
    border-radius: 8px;
    padding: 5px;
  }

  .creative-metrics dt {
    font-size: 0.48rem;
  }

  .creative-metrics dd {
    font-size: 0.62rem;
  }

  .creative-link,
  .creative-link-unavailable {
    display: none;
  }

  table {
    min-width: 0;
    font-size: 0.55rem;
    table-layout: fixed;
  }

  th,
  td {
    padding: 5px 3px;
    line-height: 1.2;
  }

  th:first-child,
  td:first-child {
    width: 34%;
    max-width: none;
  }

  .campaign-name {
    gap: 2px;
  }

  .campaign-name small {
    font-size: 0.48rem;
    line-height: 1.15;
  }
}

/* Modular workspace shell */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.route-hidden,
.journey-section-hidden {
  display: none !important;
}

.print-report-meta {
  display: none;
}

.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  transition: grid-template-columns 220ms var(--ease);
}

.sidebar {
  gap: 16px;
  padding: 18px 14px;
  overflow: hidden;
  background: rgba(250, 252, 253, 0.96);
  box-shadow: 12px 0 36px rgba(15, 23, 42, 0.04);
  transition: width 220ms var(--ease), padding 220ms var(--ease), transform 220ms var(--ease);
}

.sidebar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.sidebar .brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  padding: 8px;
}

.sidebar .brand img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.sidebar .brand span {
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0;
  white-space: nowrap;
  text-transform: none;
}

.sidebar-collapse-button,
.sidebar-close-button,
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  transition: color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.sidebar-collapse-button:hover,
.sidebar-close-button:hover,
.icon-button:hover {
  color: var(--accent-ink);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.sidebar-collapse-button svg,
.sidebar-close-button svg,
.icon-button svg,
.nav-item svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-close-button,
.mobile-appbar,
.sidebar-backdrop {
  display: none;
}

.nav-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group {
  display: grid;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.nav-group-label {
  padding: 2px 12px 5px;
  color: #8a98aa;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 10px 11px;
  text-align: left;
  white-space: nowrap;
}

.nav-item::before {
  content: "";
  position: absolute;
  inset-block: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}

.nav-item:hover {
  transform: none;
}

.nav-item.active {
  color: #fff;
  background: var(--accent-dark);
  box-shadow: 0 10px 24px rgba(0, 84, 111, 0.18);
}

.nav-item.active::before {
  background: #8ee8ff;
}

.nav-item svg {
  flex: 0 0 19px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sidebar-pdf-button {
  border: 1px solid rgba(0, 109, 145, 0.16);
  background: #fff;
  color: var(--accent-ink);
}

.sidebar .account-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin: 0;
  border-radius: 12px;
  padding: 10px;
  box-shadow: none;
}

.sidebar .account-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.account-card-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.sidebar .account-card span {
  font-size: 0.62rem;
}

.sidebar .account-card strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .account-card small {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: 76px minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  padding-inline: 10px;
}

body.sidebar-collapsed .sidebar-head {
  grid-template-columns: 1fr;
}

body.sidebar-collapsed .sidebar .brand,
body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .sidebar .account-card {
  justify-content: center;
}

body.sidebar-collapsed .sidebar .brand {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse-button {
  margin-inline: auto;
  transform: rotate(180deg);
}

body.sidebar-collapsed .sidebar-label,
body.sidebar-collapsed .nav-group-label {
  display: none;
}

body.sidebar-collapsed .nav-item {
  height: 42px;
  padding-inline: 0;
}

body.sidebar-collapsed .sidebar .account-card {
  padding: 8px;
}

.dashboard {
  min-width: 0;
  padding: 28px clamp(20px, 3vw, 44px) 48px;
}

.topbar,
.account-switcher,
.filter-panel,
.hero-panel,
.metric-grid,
.comparison-panel,
.content-grid,
.executive-overview,
.media-trend-panel {
  width: 100%;
  max-width: 1440px;
}

.account-switcher,
.filter-panel {
  padding: 16px 18px;
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.055);
}

.account-switcher {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  margin-bottom: 12px;
}

.filter-panel {
  margin-bottom: 18px;
}

.filter-summary {
  align-items: end;
}

.filter-panel strong {
  font-size: 1.08rem;
}

.filter-body {
  grid-template-columns: minmax(200px, 280px) minmax(320px, 1fr);
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}

.custom-range {
  grid-column: 1 / -1;
}

.executive-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.72fr);
  gap: 16px;
  margin: 0 auto 18px;
}

.executive-lead-card,
.executive-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.07);
}

.executive-lead-card {
  grid-row: span 2;
  display: grid;
  align-content: space-between;
  gap: 24px;
  min-height: 330px;
  overflow: hidden;
  padding: 26px;
  background:
    radial-gradient(circle at 88% 12%, rgba(142, 232, 255, 0.22), transparent 28%),
    linear-gradient(135deg, #071827 0%, #07364b 60%, #006b8c 100%);
  color: #fff;
}

.executive-lead-card .section-kicker {
  color: #8ee8ff;
}

.executive-lead-card h2 {
  max-width: 620px;
  margin-top: 8px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.executive-lead-card p:last-child {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
}

.executive-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
}

.executive-score-grid div {
  display: grid;
  gap: 8px;
  min-width: 0;
  background: rgba(4, 23, 35, 0.76);
  padding: 16px;
}

.executive-score-grid dt {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-score-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(1.05rem, 1.8vw, 1.55rem);
  font-weight: 900;
  line-height: 1.05;
}

.executive-panel {
  padding: 18px;
}

.panel-header.compact {
  margin-bottom: 14px;
}

.panel-header.compact h2 {
  font-size: 1.12rem;
}

.executive-highlights,
.platform-breakdown {
  display: grid;
  gap: 9px;
}

.executive-highlight-item {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 9px;
}

.executive-highlight-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.executive-highlight-item span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-highlight-item strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.executive-highlight-item small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.platform-row {
  display: grid;
  gap: 6px;
}

.platform-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
}

.platform-row > div:first-child span,
.platform-row small {
  color: var(--muted);
  font-weight: 700;
}

.platform-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce8ee;
}

.platform-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
}

.platform-row small {
  font-size: 0.68rem;
}

.media-trend-panel {
  margin: 0 auto 16px;
}

.media-trend-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 4px;
}

.media-trend-tabs button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  padding: 8px 11px;
}

.media-trend-tabs button.active {
  color: #fff;
  background: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(0, 84, 111, 0.2);
}

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

.media-trend-summary > div {
  display: grid;
  gap: 5px;
  border-radius: 10px;
  background: var(--surface-3);
  padding: 12px;
}

.media-trend-summary span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.media-trend-summary strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 1.05rem;
}

.campaign-react-root {
  min-width: 0;
}

.campaign-table-toolbar,
.campaign-pagination {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.campaign-search {
  display: grid;
  width: min(440px, 100%);
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.campaign-search input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: none;
}

.campaign-search input:focus-visible {
  outline: 3px solid rgba(0, 157, 204, 0.2);
  border-color: var(--accent);
}

.campaign-table-desktop {
  max-height: min(66vh, 760px);
  overflow: auto;
}

.campaign-table-desktop thead {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #fff;
}

.campaign-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.campaign-sort-button svg {
  width: 13px;
  height: 13px;
}

.campaign-cards-mobile {
  display: none;
}

.campaign-mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.campaign-mobile-metrics div {
  min-width: 0;
}

.campaign-mobile-metrics dt {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.campaign-mobile-metrics dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.campaign-pagination {
  align-items: center;
  justify-content: flex-end;
}

.campaign-pagination span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .executive-overview {
    grid-template-columns: 1fr 1fr;
  }

  .executive-lead-card {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 280px;
  }

  .filter-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body {
    padding-top: 58px;
  }

  .mobile-appbar {
    position: fixed;
    z-index: 60;
    inset: 0 0 auto;
    display: flex;
    height: 58px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    padding: 0 14px;
    backdrop-filter: blur(14px);
  }

  .mobile-appbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
  }

  .mobile-appbar-brand img {
    width: 28px;
    height: 28px;
  }

  .mobile-appbar-brand strong {
    font-size: 0.9rem;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    height: 100dvh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-104%);
  }

  body.mobile-sidebar-open {
    overflow: hidden;
  }

  body.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close-button {
    display: inline-grid;
  }

  .sidebar-collapse-button {
    display: none;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(2, 12, 20, 0.52);
    backdrop-filter: blur(3px);
  }

  body.mobile-sidebar-open .sidebar-backdrop {
    display: block;
  }

  body.sidebar-collapsed .sidebar-label,
  body.sidebar-collapsed .nav-group-label {
    display: initial;
  }

  body.sidebar-collapsed .sidebar .brand {
    display: flex;
  }

  body.sidebar-collapsed .sidebar-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  body.sidebar-collapsed .nav-item,
  body.sidebar-collapsed .sidebar .brand,
  body.sidebar-collapsed .sidebar .account-card {
    justify-content: flex-start;
  }

  .nav-list {
    display: grid;
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 0;
  }

  .nav-item {
    border: 0;
    background: transparent;
    text-align: left;
  }

  .dashboard {
    padding: 20px 18px 42px;
  }
}

@media (max-width: 680px) {
  .topbar h1 {
    font-size: clamp(1.85rem, 10vw, 2.55rem);
  }

  .account-switcher,
  .filter-panel {
    padding: 14px;
  }

  .executive-overview {
    grid-template-columns: 1fr;
  }

  .executive-lead-card {
    min-height: 0;
    padding: 20px;
  }

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

  .media-trend-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 12px;
  }

  .media-trend-summary {
    grid-template-columns: 1fr;
  }

  .media-trend-react .journey-chart {
    height: 250px !important;
  }

  .campaign-table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .campaign-table-desktop {
    display: none;
  }

  .campaign-cards-mobile {
    display: grid;
    gap: 10px;
  }

  .campaign-pagination {
    justify-content: space-between;
  }
}

@media screen and (max-width: 0px) {
  .mobile-appbar,
  .sidebar-backdrop,
  .sidebar,
  .media-trend-tabs {
    display: none !important;
  }

  .campaign-search,
  .campaign-pagination {
    display: none !important;
  }

  .campaign-table-desktop {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .campaign-cards-mobile {
    display: none !important;
  }

  body {
    padding-top: 0 !important;
  }

  .app-shell,
  body.sidebar-collapsed .app-shell {
    display: block !important;
  }

  .route-hidden {
    display: none !important;
  }

  .executive-overview,
  .media-trend-panel {
    max-width: none !important;
  }

  .executive-lead-card,
  .executive-panel,
  .media-trend-panel {
    box-shadow: none !important;
    break-inside: avoid;
  }

  .media-trend-react .journey-chart {
    height: 210px !important;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .dashboard,
  .sidebar,
  .account-switcher,
  .filter-panel,
  .hero-panel,
  .panel,
  .metric-card,
  .creative-card,
  .channel-card {
    min-width: 0;
  }

  .dashboard {
    padding-inline: clamp(10px, 3.5vw, 16px);
  }

  .topbar {
    align-items: stretch;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .top-actions .ghost-button,
  .top-actions .primary-button {
    min-height: 42px;
    padding-inline: 10px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 2.8rem);
    letter-spacing: 0;
  }

  .lead {
    max-width: 100%;
  }

  .account-switcher,
  .filter-panel {
    padding: clamp(14px, 4vw, 18px);
  }

  .view-mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .view-mode-button {
    min-width: 0;
    justify-content: center;
    padding-inline: 8px;
    text-align: center;
    white-space: normal;
  }

  .period-filter label,
  .select-grid label,
  .custom-range label {
    min-width: 0;
  }

  .period-filter select,
  .select-grid select,
  .custom-range input {
    min-height: 42px;
  }

  .hero-panel h2,
  .metric-card strong,
  .channel-card strong,
  .comparison-value,
  [data-metric] {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .hero-panel h2 {
    font-size: clamp(1.55rem, 7.6vw, 2.15rem);
  }

  .hero-indicators {
    width: 100%;
  }

  .goal-ring {
    margin-inline: auto;
  }

  .metric-grid,
  .secondary-metrics {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 104px;
  }

  .metric-card strong {
    font-size: clamp(1.45rem, 9vw, 2rem);
  }

  .channel-card,
  .creative-card,
  .comparison-card {
    break-inside: avoid;
  }
}

@media (max-width: 420px) {
  .dashboard,
  .sidebar {
    padding: 10px;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  .view-mode-toggle {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .panel,
  .metric-card,
  .filter-panel,
  .account-switcher {
    border-radius: 16px;
    padding: 14px;
  }

  .goal-ring {
    width: 136px;
  }

  .goal-ring span {
    font-size: 1.86rem;
  }

  td,
  td:first-child {
    gap: 8px;
  }

  td::before {
    flex-basis: 72px;
  }
}

@media screen and (max-width: 0px) {
  html,
  body {
    width: auto;
    max-width: none;
    overflow: visible !important;
  }

  body {
    color: #0f172a;
    font-size: 9pt;
  }

  .dashboard {
    width: auto;
    max-width: none;
    margin: 0;
  }

  .app-shell,
  .dashboard,
  .analytics-view,
  .content-grid {
    overflow: visible !important;
  }

  .topbar,
  .account-switcher,
  .filter-panel,
  .hero-panel,
  .metric-grid,
  .secondary-metrics,
  .comparison-panel,
  .content-grid,
  .analytics-view {
    width: 100%;
    max-width: none;
  }

  .account-switcher select,
  .view-mode-toggle,
  .period-filter,
  .select-grid,
  .custom-range,
  .creative-link,
  .creative-link-unavailable {
    display: none !important;
  }

  .account-switcher,
  .filter-panel,
  .hero-panel,
  .metric-card,
  .panel,
  .channel-card,
  .creative-card {
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: none !important;
  }

  .hero-panel,
  .comparison-panel,
  .panel-large,
  .content-grid > *,
  .creative-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

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

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

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

  .table-wrap {
    overflow: visible !important;
  }

  table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
  }

  thead {
    display: table-header-group;
  }

  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  th,
  td {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  #campanhas,
  #campanhas.panel,
  #campanhas .table-wrap,
  .analytics-react-root {
    break-inside: auto;
    page-break-inside: auto;
  }

  #campanhas tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Final compact context overrides: keep these after legacy responsive rules. */
.topbar {
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.topbar h1 {
  margin-top: 5px;
  font-size: clamp(2rem, 3.1vw, 2.55rem);
  line-height: 1.08;
}

.topbar .lead {
  max-width: 720px;
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.top-actions .compact-action {
  min-height: 40px;
  width: auto;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.context-custom-range {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 5px;
}

.context-custom-range.is-hidden {
  display: none;
}

.context-custom-range label {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 900;
  text-transform: uppercase;
}

.context-custom-range input {
  min-height: 34px;
  border-radius: 8px;
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }

  .topbar h1 {
    font-size: clamp(1.7rem, 8vw, 2.15rem);
  }

  .topbar .lead {
    display: none;
  }

  .top-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    grid-template-columns: none;
    gap: 7px;
  }

  .top-actions .compact-action {
    min-height: 38px;
    width: auto;
    padding-inline: 11px;
  }
}

@media screen and (max-width: 0px) {
  .context-toolbar,
  .top-actions {
    display: none !important;
  }

  .print-report-meta {
    color: #475569;
    display: block !important;
    font-size: 8.5pt;
    font-weight: 700;
    line-height: 1.35;
    margin: 5px 0 0;
  }

  body.is-printing .route-hidden,
  body.is-printing .journey-section-hidden {
    display: none !important;
  }
}
