/* ============================================================
   Revenue Dashboard - Wireframe Styles
   Light theme, Docusign brand-compliant per Brand Identity
   Guidelines v2.0 (Logo + palette sections).
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --cobalt:        #4C00FF;
  --cobalt-tint:   #EEE5FF;
  --cobalt-soft:   #D5C2FF;
  --poppy:         #FF5252;
  --poppy-tint:    #FFE5E5;
  --inkwell:       #000000;
  --white:         #FFFFFF;
  --ecru:          #FAF7EE;

  --gray-50:       #F7F7F8;
  --gray-100:      #EDEDF0;
  --gray-150:      #E2E2E8;
  --gray-200:      #DCDCE2;
  --gray-300:      #C3C3CC;
  --gray-400:      #9C9CA6;
  --gray-500:      #6E6E78;
  --gray-700:      #3D3D45;
  --gray-900:      #1A1A1F;

  --positive:      #1F7A3F;
  --positive-tint: #E5F4EB;
  /* Tonal variant of Poppy used for delta text, slightly desaturated so a
     single negative tile next to multiple positives doesn't dominate visually
     (v1.1 expert-review feedback, Cairo principle). The brand-pure #FF5252
     stays in --poppy for tints, badges, and disclaimers. */
  --negative:      #E85555;
  --negative-tint: var(--poppy-tint);
  --neutral:       var(--gray-500);

  --radius-sm:  3px;
  --radius-md:  4px;
  --radius-lg:  6px;

  --shadow-sm: 0 1px 0 rgba(0,0,0,0.04);
  --shadow-md: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);

  --container-max: 1440px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--ecru);
  color: var(--inkwell);
  font-family: Arial, Helvetica, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

button {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
button:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

h1, h2, h3, h4 { color: var(--inkwell); margin: 0; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- LAYOUT ---------- */
.page {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px 64px;
  background: var(--ecru);
}

.section { margin-top: 24px; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title h2 {
  font-size: 16px;
  font-weight: 700;
}
.section-title .section-sub {
  font-size: 12px;
  color: var(--gray-500);
}

/* ---------- HEADER ---------- */
.app-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}
.app-header__left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.app-header__logo {
  display: inline-flex;
  align-items: center;
  /* Min 52px wide per Brand Identity Guidelines v2.0; clear space = Nexus icon width */
  min-width: 130px;
  padding-right: 16px;
  border-right: 1px solid var(--gray-200);
}
.app-header__logo svg { display: block; height: 26px; width: auto; }
.app-header__title-block { line-height: 1.15; }
.app-header__title-block h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.app-header__phase {
  display: block;
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.app-header__right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-header__badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--inkwell);
  color: var(--white);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.app-header__as-of {
  font-size: 12px;
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}

/* ---------- GLOBAL PERIOD BAR ----------
   Sits between header and tabs nav. Single source of truth for period
   grain, current period, and comparison period. Pattern adopted from
   the prior dashboard convention: [Grain] [Current] vs. [Comparison].
   ----------------------------------------- */
.global-period-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: var(--container-max);
  margin: 0 auto;
  font-size: 13px;
}
.global-period-bar__label {
  font-weight: 700;
  color: var(--inkwell);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding-right: 4px;
}
.global-period-bar select {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--inkwell);
  min-width: 140px;
  cursor: pointer;
}
.global-period-bar select:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 1px;
  border-color: var(--cobalt);
}
.global-period-bar__connector {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  padding: 0 2px;
}
.global-period-bar__hint {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray-500);
  font-style: italic;
}
@media (max-width: 900px) {
  .global-period-bar__hint { display: none; }
}

/* ---------- TABS ---------- */
.tabs {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  gap: 0;
  padding: 0 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  overflow-x: auto;
}
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.tabs a:hover {
  color: var(--inkwell);
  background: var(--gray-50);
  text-decoration: none;
}
.tabs a.is-active {
  color: var(--inkwell);
  border-bottom-color: var(--cobalt);
}
.tabs .tab-num {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 700;
}
.tabs a.is-active .tab-num { color: var(--cobalt); }

/* ---------- PAGE CONTROLS ---------- */
.page-controls {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 13px;
}
.control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.control-group label {
  color: var(--gray-700);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.control-group select,
.control-group input[type="text"] {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--inkwell);
  min-width: 110px;
}

/* ---------- TOGGLE GROUP ---------- */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}
.toggle-group button {
  background: var(--white);
  border: none;
  border-right: 1px solid var(--gray-200);
  color: var(--gray-700);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}
.toggle-group button:last-child { border-right: none; }
.toggle-group button:hover { background: var(--gray-50); color: var(--inkwell); }
.toggle-group button.is-active {
  background: var(--inkwell);
  color: var(--white);
}

/* ---------- DASHBOARD QUESTIONS DISCLOSURE ----------
   Collapsed-by-default reference panel that lists the stakeholder priority
   questions this tab answers. Pattern modeled on the GDT Vital Few
   "Six questions this dashboard answers" disclosure. Native <details>
   element provides the collapse/expand without JS.
   ----------------------------------------------------- */
.dashboard-questions {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-top: 16px;
}
.dashboard-questions > summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--inkwell);
  user-select: none;
}
.dashboard-questions > summary::-webkit-details-marker { display: none; }
.dashboard-questions > summary:hover { background: var(--gray-50); }
.dashboard-questions[open] > summary {
  border-bottom: 1px solid var(--gray-150);
  background: var(--gray-50);
}
.dashboard-questions__caret {
  width: 0;
  height: 0;
  border-top:    4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left:   6px solid var(--gray-500);
  flex-shrink: 0;
}
.dashboard-questions[open] .dashboard-questions__caret {
  border-top:    6px solid var(--gray-500);
  border-bottom: 0;
  border-left:   4px solid transparent;
  border-right:  4px solid transparent;
}
.dashboard-questions__title {
  font-weight: 700;
  letter-spacing: -0.005em;
}
.dashboard-questions__list {
  margin: 0;
  padding: 12px 18px 14px 38px;
  list-style: decimal;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.55;
}
.dashboard-questions__list li {
  padding: 3px 0;
}
.dashboard-questions__list li::marker {
  color: var(--gray-500);
}
.dashboard-questions__list strong {
  color: var(--inkwell);
  font-weight: 700;
}

/* ---------- TAKEAWAY CALLOUT (v1.1 expert-review addition) ----------
   Single-sentence explanatory headline above the KPI scorecard. Addresses
   Knaflic / Few / Cairo principle: a dashboard without a takeaway is
   exploratory, not explanatory. Kept subtle so it does not compete with
   the KPI values below. */
.takeaway-callout {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  background: #F4F0FF; /* ~6% Cobalt over white */
  border-radius: var(--radius-md);
  padding: 16px 22px;
  margin-top: 16px;
}
.takeaway-callout__icon {
  width: 24px;
  height: 24px;
  color: var(--cobalt);
  display: flex;
  align-items: center;
  justify-content: center;
}
.takeaway-callout__icon svg { width: 22px; height: 22px; display: block; }
.takeaway-callout__copy {
  font-size: 16px;
  line-height: 1.45;
  color: var(--inkwell);
  margin: 0;
  font-weight: 400; /* deliberately not bold so it does not compete with KPI values */
  letter-spacing: -0.005em;
}
.takeaway-callout__copy strong { font-weight: 700; }
.takeaway-callout__meta {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  white-space: nowrap;
  align-self: center;
}
.takeaway-callout__annotation {
  font-size: 11px;
  font-style: italic;
  color: var(--gray-500);
  margin: 6px 0 0 22px;
  line-height: 1.4;
}
@media (max-width: 1000px) {
  .takeaway-callout { grid-template-columns: 28px 1fr; }
  .takeaway-callout__meta { grid-column: 2; align-self: start; }
}

/* ---------- KPI STRIP ---------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 1280px) {
  .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.kpi-tile {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 138px;
}
.kpi-tile__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.kpi-tile__label-block { display: flex; flex-direction: column; gap: 2px; }
.kpi-tile__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--inkwell);
  letter-spacing: -0.005em;
}
.kpi-tile__sublabel {
  font-size: 11px;
  color: var(--gray-500);
}
.kpi-tile__q-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--cobalt);
  background: var(--cobalt-tint);
  padding: 2px 5px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  align-self: flex-start;
}
.kpi-tile__value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--inkwell);
  font-variant-numeric: tabular-nums;
}
.kpi-tile__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kpi-tile__delta--positive { color: var(--positive); }
.kpi-tile__delta--negative { color: var(--negative); }
.kpi-tile__delta--neutral  { color: var(--neutral); }
.kpi-tile__delta-arrow { font-size: 11px; line-height: 1; }
.kpi-tile__compare {
  font-size: 10px;
  color: var(--gray-500);
}
.kpi-tile__bullet {
  margin-top: auto;
  height: 24px;
}
.kpi-tile__bullet svg { display: block; width: 100%; height: 100%; }

/* ---------- ROW COUNT METER (Tab 3 filter rail) ---------- */
.row-count-meter {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.row-count-meter--warn {
  background: var(--poppy-tint);
  border-color: var(--poppy);
}
.row-count-meter--ok {
  background: var(--positive-tint);
  border-color: var(--positive);
}
.row-count-meter__head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  font-weight: 700;
}
.row-count-meter__count {
  font-size: 18px;
  font-weight: 700;
  color: var(--inkwell);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.row-count-meter--warn .row-count-meter__count { color: var(--poppy); }
.row-count-meter--ok   .row-count-meter__count { color: var(--positive); }
.row-count-meter__msg {
  font-size: 11px;
  color: var(--gray-700);
  line-height: 1.4;
}
.row-count-meter--warn .row-count-meter__msg strong { color: var(--poppy); }

/* ---------- TIER DISCLAIMER (bottom-of-dashboard, AP convention) ---------- */
.tier-disclaimer {
  margin-top: 32px;
  padding: 14px 18px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--inkwell);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
}
.tier-disclaimer strong { color: var(--inkwell); }
.tier-disclaimer__label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--inkwell);
  background: var(--white);
  padding: 2px 6px;
  border: 1px solid var(--inkwell);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ---------- PRIORITY BADGE (P0 / P1) ---------- */
.priority-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.priority-badge--p0 { background: var(--cobalt); color: var(--white); }
.priority-badge--p1 { background: var(--gray-100); color: var(--gray-700); border: 1px dashed var(--gray-300); }

.tab-card__priority-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- ENTITY TYPE TOGGLE (Tab 4) ---------- */
.entity-type-toggle {
  display: inline-flex;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--white);
}
.entity-type-toggle button {
  background: var(--white);
  border: none;
  border-right: 1px solid var(--gray-200);
  color: var(--gray-700);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.entity-type-toggle button:last-child { border-right: none; }
.entity-type-toggle button.is-active {
  background: var(--cobalt);
  color: var(--white);
}
.entity-type-toggle button.is-primary::before {
  content: "★ ";
  font-size: 10px;
}

/* ---------- RELATED RCS TABLE (Tab 4 Account view) ---------- */
.related-rcs-section {
  margin-top: 16px;
}
.related-rcs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.related-rcs-table th {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 700;
  background: var(--gray-50);
}
.related-rcs-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.related-rcs-table .num { text-align: right; }
.related-rcs-table tfoot td {
  border-top: 2px solid var(--gray-300);
  font-weight: 700;
  background: var(--gray-50);
}

/* Banner for P1 / may-cut tabs */
.banner-may-cut {
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-700);
  margin-top: 16px;
}
.banner-may-cut strong { color: var(--inkwell); }

/* ---------- PANEL / CARD ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.panel__title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.panel__sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

/* ---------- HORIZONTAL BAR LIST (segmentation, small multiples) ---------- */
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 96px 70px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-row__name {
  font-weight: 600;
  color: var(--inkwell);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-row__bar {
  position: relative;
  height: 14px;
  background: var(--gray-100);
  border-radius: 2px;
  /* No overflow:hidden so the PYTD tick can extend above and below */
}
.bar-row__bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--cobalt);
  border-radius: 2px;
}
.bar-row__bar-fill--negative {
  background: var(--negative);
}
.bar-row__bar-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  margin-left: -1.5px;
  background: var(--inkwell);
  border-radius: 1px;
  pointer-events: none;
}
.bar-row__value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--inkwell);
}
.bar-row__delta {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.delta-pos { color: var(--positive); }
.delta-neg { color: var(--negative); }
.delta-zero { color: var(--neutral); }

/* ---------- TWO-COL LAYOUT (Tab 1 hero + segmentation) ---------- */
.row-2col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 1100px) { .row-2col { grid-template-columns: 1fr; } }

/* ---------- HERO CHART ---------- */
.hero-chart-container {
  width: 100%;
  height: 280px;
  position: relative;
}
.hero-chart-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- SMALL MULTIPLES GRID ---------- */
.small-multiples-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) { .small-multiples-grid { grid-template-columns: 1fr; } }

/* ---------- TAB 3 - RESEARCH LAYOUT ---------- */
.research-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-top: 16px;
}
@media (max-width: 1100px) { .research-layout { grid-template-columns: 1fr; } }

.filter-rail {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.filter-rail__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.filter-rail__head h2 { font-size: 14px; }
.filter-rail__legend { font-size: 11px; color: var(--gray-500); }
.filter-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gray-100);
}
.filter-section:last-of-type { border-bottom: none; }
.filter-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  font-weight: 700;
}
.filter-section h3 .req {
  color: var(--poppy);
  font-weight: 700;
  margin-left: 2px;
}
.filter-control {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.filter-control label {
  font-size: 12px;
  color: var(--gray-700);
  font-weight: 600;
}
.filter-control select,
.filter-control input {
  font-family: inherit;
  font-size: 12px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  color: var(--inkwell);
}
.filter-control input::placeholder { color: var(--gray-400); }
.filter-control--required label::after {
  content: " *";
  color: var(--poppy);
  font-weight: 700;
}

.filter-rail__buttons {
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: var(--white);
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
}
.btn-primary {
  background: var(--cobalt);
  color: var(--white);
  border: 1px solid var(--cobalt);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  flex-grow: 1;
}
.btn-primary:hover { background: #3F00D6; border-color: #3F00D6; }
.btn-secondary {
  background: var(--white);
  color: var(--inkwell);
  border: 1px solid var(--gray-300);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
}
.btn-secondary:hover { background: var(--gray-50); }

/* ---------- TAB 3 - RESULT AREA ---------- */
.results-area {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 480px;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-150);
  background: var(--gray-50);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}
.results-header__left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.results-header__right { display: flex; align-items: center; gap: 8px; }
.row-count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--gray-700);
}
.row-count strong { color: var(--inkwell); }

.demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.export-btn {
  background: var(--white);
  border: 1px solid var(--gray-300);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--inkwell);
}
.export-btn:hover { background: var(--gray-50); }

.empty-state {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--gray-500);
}
.empty-state__icon {
  width: 56px;
  height: 56px;
  border: 2px dashed var(--gray-300);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--gray-400);
  font-size: 24px;
  font-weight: 700;
}
.empty-state__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--inkwell);
  margin-bottom: 6px;
}
.empty-state__msg {
  font-size: 13px;
  max-width: 480px;
  margin-bottom: 12px;
}
.empty-state__req-list {
  font-size: 12px;
  color: var(--gray-700);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
  list-style: none;
  margin: 0;
}
.empty-state__req-list li { padding: 2px 0; }
.empty-state__req-list li::before { content: "* "; color: var(--poppy); font-weight: 700; }

.result-table-wrap { overflow-x: auto; }
.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.result-table thead th {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  text-align: left;
  padding: 8px 10px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  white-space: nowrap;
}
.result-table tbody td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.result-table tbody tr:hover { background: var(--gray-50); }
.result-table .num { text-align: right; }
.result-table .id-cell { color: var(--cobalt); font-weight: 700; }

.results-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--gray-150);
  font-size: 11px;
  color: var(--gray-500);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- TAB 4 - DRILL-DOWN ---------- */
.rc-search {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 16px;
}
.rc-search__current {
  font-size: 12px;
  color: var(--gray-500);
}
.rc-search__current strong { color: var(--inkwell); }

.rc-header-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 16px;
}
.rc-header-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.rc-header-card__ids {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rc-header-card__rcid {
  font-size: 18px;
  font-weight: 700;
  color: var(--inkwell);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.rc-header-card__rcid .arrow-link { color: var(--cobalt); margin-left: 6px; font-size: 12px; }
.rc-header-card__oppid { font-size: 13px; color: var(--gray-500); font-variant-numeric: tabular-nums; }
.rc-header-card__account {
  font-size: 14px;
  font-weight: 600;
  color: var(--inkwell);
}
.rc-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--positive-tint);
  color: var(--positive);
}
.rc-status-chip::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--positive);
  border-radius: 50%;
}
.rc-header-card__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1000px) { .rc-header-card__grid { grid-template-columns: repeat(3, 1fr); } }
.rc-stat { display: flex; flex-direction: column; gap: 2px; }
.rc-stat__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  font-weight: 700;
}
.rc-stat__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--inkwell);
  font-variant-numeric: tabular-nums;
}
.rc-stat__value--big { font-size: 18px; }

/* ---------- WATERFALL ---------- */
.waterfall-container {
  width: 100%;
  height: 240px;
}
.waterfall-legend {
  display: flex;
  gap: 18px;
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.waterfall-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  vertical-align: middle;
}
.swatch--cobalt    { background: var(--cobalt); }
.swatch--cobalt-soft { background: var(--cobalt-soft); }
.swatch--gray      { background: var(--gray-300); }
.swatch--ink       { background: var(--inkwell); }
.swatch--poppy     { background: var(--poppy); }
.swatch--positive  { background: var(--positive); }

/* ---------- PRODUCT TABLE ---------- */
.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.product-table thead th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 700;
  white-space: nowrap;
}
.product-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--gray-100);
}
.product-table tbody td.num { text-align: right; }
.product-table tbody td.spark { width: 130px; }
.product-table tbody tr:last-child td { border-bottom: none; }
.product-table tfoot td {
  padding: 9px 10px;
  border-top: 2px solid var(--gray-300);
  font-weight: 700;
  background: var(--gray-50);
}
.product-table tfoot td.num { text-align: right; }

/* ---------- FUTURE SCHEDULE ---------- */
.future-schedule__caveat {
  background: var(--cobalt-tint);
  border: 1px solid var(--cobalt-soft);
  color: var(--inkwell);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 12px;
}
.future-schedule__caveat strong { color: var(--cobalt); }
.future-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.future-schedule-table th, .future-schedule-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}
.future-schedule-table .num { text-align: right; }
.future-schedule-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 700;
}

/* ---------- INDEX (landing) ---------- */
.landing-hero {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-top: 24px;
}
.landing-hero h1 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.landing-hero p { color: var(--gray-700); margin: 0; }
.landing-hero__meta {
  margin-top: 14px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--gray-500);
}
.landing-hero__meta strong { color: var(--inkwell); }

.tab-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}
@media (max-width: 1000px) { .tab-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .tab-card-grid { grid-template-columns: 1fr; } }

.tab-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--inkwell);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.1s, transform 0.1s;
}
.tab-card:hover {
  border-color: var(--cobalt);
  text-decoration: none;
}
.tab-card__num {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--cobalt);
  font-weight: 700;
}
.tab-card__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tab-card__desc {
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
}
.tab-card__audience {
  margin-top: auto;
  font-size: 11px;
  color: var(--gray-500);
  border-top: 1px solid var(--gray-100);
  padding-top: 8px;
}

/* ---------- READ ME (Tab 5) ---------- */
.readme-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin-top: 16px;
}
@media (max-width: 900px) { .readme-grid { grid-template-columns: 1fr; } }
.readme-toc {
  position: sticky;
  top: 12px;
  align-self: start;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.readme-toc h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 8px;
}
.readme-toc ol {
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: toc;
  font-size: 13px;
}
.readme-toc ol li { counter-increment: toc; padding: 3px 0; }
.readme-toc ol li::before {
  content: counter(toc) ". ";
  color: var(--gray-500);
  font-weight: 700;
}
.readme-toc a { color: var(--inkwell); }
.readme-toc a:hover { color: var(--cobalt); }
.readme-body { display: flex; flex-direction: column; gap: 16px; }
.readme-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.readme-section h2 {
  font-size: 16px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.readme-section h3 {
  font-size: 13px;
  margin-top: 14px;
  margin-bottom: 6px;
}
.readme-section p, .readme-section ul, .readme-section ol {
  font-size: 13px;
  color: var(--gray-700);
  margin: 0 0 10px 0;
}
.readme-section ul, .readme-section ol { padding-left: 20px; }
.readme-section li { padding: 2px 0; }
.readme-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 6px;
}
.readme-table th, .readme-table td {
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
.readme-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
  font-weight: 700;
  background: var(--gray-50);
}

/* ---------- PILL / TAG ---------- */
.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.tag--cobalt { background: var(--cobalt-tint); color: var(--cobalt); }
.tag--ink    { background: var(--inkwell); color: var(--white); }
.tag--gray   { background: var(--gray-100); color: var(--gray-700); }
.tag--poppy  { background: var(--poppy-tint); color: var(--poppy); }
.tag--green  { background: var(--positive-tint); color: var(--positive); }

/* ---------- UTILITIES ---------- */
.muted { color: var(--gray-500); }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.hidden { display: none !important; }

.callout-note {
  background: var(--cobalt-tint);
  border-left: 3px solid var(--cobalt);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--inkwell);
}
.callout-note strong { color: var(--cobalt); }

/* ---------- FOOTNOTE under any chart ---------- */
.chart-footnote {
  font-size: 10px;
  color: var(--gray-500);
  margin-top: 8px;
  line-height: 1.4;
}

/* ---------- PRINT (for screenshot capture) ---------- */
@media print {
  body { background: var(--white); }
  .tabs, .filter-rail__buttons { display: none !important; }
}
