/* The merchant's dashboard (dashboard.html), on top of tokens.css and site.css, which already
   hold its cards, number tiles, chart, legend, table and tooltip. */

/* Channel colours: the same fixed order and hues as the chart on our app page in Shopify,
   validated for colour-blind separation on the light surface (#fff) and, stepped for the dark
   surface (#111), on that one. Three light steps sit below 3:1 on white, so every chart has a
   legend, a tooltip and a table view. */
:root {
  --ch-ai: #2a78d6;
  --ch-organic_search: #eb6834;
  --ch-paid_search: #1baf7a;
  --ch-organic_social: #eda100;
  --ch-paid_social: #e87ba4;
  --ch-email: #008300;
  --ch-referral: #6250d6;
  --ch-direct: #e34948;
  --ch-other: #8f8f8f;
}
:root[data-theme="dark"] {
  --ch-ai: #3987e5;
  --ch-organic_search: #d95926;
  --ch-paid_search: #199e70;
  --ch-organic_social: #c98500;
  --ch-paid_social: #d55181;
  --ch-email: #0ca30c;
  --ch-referral: #9085e9;
  --ch-direct: #e66767;
  --ch-other: #8a8a8a;
}

.dash { padding-block: var(--space-8) var(--space-16); }
.dash__head { margin-bottom: var(--space-2); }
.dash .card { margin-top: var(--space-3); }

.dash-store { margin-bottom: var(--space-1); font: var(--text-caption); color: var(--color-text-tertiary); }
/* Logo left, buttons right: the landing page's middle links column isn't there. */
.nav--app .nav__inner { grid-template-columns: 1fr auto; }
/* Parts shown only once logged in carry `hidden`; component styles (display: flex) must not undo it. */
[hidden] { display: none !important; }
.nav__actions form { display: contents; }

.filters .chip-filter { cursor: pointer; border: 0; }
.filters .chip-filter:hover { background: var(--color-secondary-hover); }
.filters .chip-filter[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--color-focus); font-weight: var(--weight-medium); }
.filters .chip-filter:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.dash-kpis { margin-top: var(--space-4); }
@media (min-width: 1024px) { .dash-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.delta--down { background: var(--color-error-bg); color: var(--color-error-text); }
.delta--flat { background: var(--color-surface-sunken); color: var(--color-text-secondary); }

.dash-legend { width: 100%; margin-top: var(--space-1); }
.dash-legend__total { color: var(--color-text-tertiary); font-variant-numeric: tabular-nums; }

.dash-table-view { margin: 0 var(--space-4) var(--space-3); font: var(--text-caption); }
.dash-table-view summary { cursor: pointer; color: var(--color-text-secondary); width: max-content; }
.dash-table-view summary:hover { color: var(--color-text); }
.dash-table-view .table-scroll { max-height: 360px; margin-top: var(--space-2); overflow: auto; }

.dash-name { display: inline-flex; align-items: center; gap: var(--space-2); }
.dash-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.table td.dash-change { padding-left: 0; }

.dash-path { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; font: var(--text-mono); }
.dash-bar-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: var(--space-2); min-width: 120px; }
.dash-bar { display: inline-block; height: 6px; border-radius: 0 3px 3px 0; background: var(--ch-ai); }

.dash-empty, .dash-message p { padding: 0 var(--space-4) var(--space-4); font: var(--text-ui); color: var(--color-text-secondary); }
.dash-message .card__title { padding: var(--space-4) var(--space-4) var(--space-2); }
.dash-message__action { padding: 0 var(--space-4) var(--space-4); }
.dash-note { margin-top: var(--space-4); max-width: 80ch; font: var(--text-caption); color: var(--color-text-tertiary); }
