/* Cleriva dashboard theme — read by app/theme.py, loaded after every kit
   stylesheet. Values come from the storefront's theme variables and custom
   sections (brand-identity/latest/identity.json, mcp-brand-guide/visual-identity.md,
   read 2026-09-30), so this is derived from cleriva.com, pending owner approval.
   Surface: the brand's LIGHT surface (white page, ink text, red accent, black
   main button, as on the NovaFlow 2.0 landing page); the sidebar and sign-in
   ground use the store's near-black #191919 with the white wordmark. */

@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_n4.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_n5.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_n6.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_n7.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_n8.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_i4.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Montserrat"; src: url("/theme/fonts/montserrat_i7.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  /* surfaces */
  --parchment: #F2F2F2;            /* page ground: the store's off-white (--regular-bg-color) */
  --stone: #E6E6E9;
  --slate: #141414;                /* --ink on the 2.0 landing page */
  --bg: #F2F2F2;
  --card: #FFFFFF;
  --surface-2: #F7F7F8;
  --surface-3: #EFEFF2;
  --line: #E1E1E6;
  --line-strong: #CFCFD6;
  --row-line: #ECECF0;
  /* type */
  --ink: #141414;
  --ink-soft: #5F5F66;             /* 6.3:1 on white */
  --ink-faint: #A0A0A8;
  --ink-rgb: 20, 20, 20;
  --serif: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* actions and accent */
  --accent: #141414;               /* main button: black on the light surface */
  --accent-ink: #FFFFFF;
  --accent-hover: #2A2A2E;
  --brand: #BE1820;                /* Cleriva red, theme --color-base-accent-1 */
  --brand-ink: #8F1016;            /* --red-deep: red type on light surfaces, 9.3:1 */
  --focus: #141414;             /* a red ring on a field reads as an error; ink instead */
  --taupe: #8A8A92;                /* the store's grey */
  --radius: 6px;                   /* theme button radius */
  --card-radius: 10px;             /* cards and panels */
  --shadow: 0 1px 2px rgba(20, 20, 20, .04), 0 8px 24px rgba(20, 20, 20, .05);
  /* status (semantic, kept distinct from the brand red) */
  --ok: #1F6B3A;  --ok-bg: #E6F1EA;  --ok-line: #BFD9C8;
  --warn: #8A5A00; --warn-bg: #FBF0D9;
  --err: #8F1016;  --err-bg: #FCEDED; --err-line: #EFC2C4;   /* oxblood on the brand's blush tint */
  --info: #2F5A8A; --info-bg: #E4ECF5;
  /* sidebar and sign-in: the store's dark ground */
  --sidebar-bg: #191919;
  --sidebar-rgb: 255, 255, 255;
  --sidebar-ink: #C4C4CC;          /* secondary type on dark, 10:1 */
  --sidebar-ink-strong: #FFFFFF;
  --sidebar-ink-soft: #AEAEB6;     /* tier-3 rows: 8:1 on the ground */
  --sidebar-label: #8A8A92;        /* 5.1:1 */
  --sidebar-sub: #8A8A92;
  --sidebar-active-bg: #BE1820;    /* white on Cleriva red, 6.3:1 */
  --sidebar-active-ink: #FFFFFF;
  --brand-mark: #FFFFFF;
  --brand-sub: #8A8A92;
  --auth-bg: #191919;
  --auth-card: #FFFFFF;
  /* charts: validated with the dataviz palette checker (light, surface #FFFFFF) */
  --chart-grid: #E6E6EA;
  --chart-tick: #6B6B73;
  --chart-ink: #141414;
  --chart-1: #C98500;              /* warm bars, the role bronze had */
  --chart-2: #2A6FBF;
  --chart-3: #1F7A4E;
  --chart-4: #6F56B8;
  --chart-5: #BE1820;
  --chart-muted: #8A8A92;
  --chart-neg: #BE1820;            /* spend and the negative side in brand red */
  --chart-brand: #C98500;          /* secondary emphasis series in amber, so it never shares a hue with spend */
  --chart-bars: #8A8A92;           /* single-series bars in the store's grey (histograms, Shopify Health) */
  --chart-info: #2F5A8A;
  --chart-tooltip-bg: #191919;
  --chart-tooltip-ink: #FFFFFF;
}

/* logo: the CLERIVA wordmark (vector, Montserrat Bold at -0.055em, derived from the
   storefront header logo); 5.8:1 aspect, so a little wider than the kit's mark */
.brand .logo { width: 136px; }
.auth-brand .logo { width: 176px; }
.logo-img { display: block; height: auto; }
.brand-sub { letter-spacing: .3em; }

/* type: Montserrat everywhere; headings bold, numbers semi-bold, caps tracked */
body { font-size: 14.5px; }
.page-title { font-weight: 700; letter-spacing: .06em; font-size: 19px; }
.card-head h2 { font-weight: 700; letter-spacing: .03em; font-size: 14.5px; }
.card-title { font-weight: 700; letter-spacing: .01em; font-size: 20px; }
.kpi-value, .social-metric-value, .snap-val, .corr-r, .klw-coverage-count, .klw-callout-number, .klw-qa-facts strong, .rank-metric {
  font-weight: 600; letter-spacing: -.01em;
}
/* value size: the kit scales it to the card (clamp 16-29px) */
.user-chip { font-weight: 700; }
.nav-group { font-weight: 600; letter-spacing: .24em; }
.nav-link { font-size: 13.5px; }
.nav-link.t1 { font-weight: 600; }
.nav-link.active { font-weight: 700; }
.social-metric-group-title, .rank-sub, .pub-cal-title, .klw-header h2, .klw-qa-intro h2 { font-weight: 700; }

/* buttons: pill, as on the store */
.btn { border-radius: 999px; font-weight: 700; letter-spacing: .12em; }
.btn-small { border-radius: 999px; }
.btn-secondary { background: #FFFFFF; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-3); }
/* a ghost button is outlined in white on the dark ground and in grey on a card */
.sidebar .btn-ghost, .auth-shell .btn-ghost { border-color: rgba(255, 255, 255, .28); }
.content .btn-ghost { border-color: var(--line-strong); }
.sidebar-footer .btn-ghost { color: var(--sidebar-ink); }
.sidebar-footer .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #FFFFFF; }

/* fields and cards */
.field input, .field select, .search-input, .inline-edit input[type=number], .role-select { border-radius: 6px; }
.card.kpi { border-radius: var(--card-radius); }
.flash { border-radius: 8px; }
.auth-card { border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }

/* links in prose: ink with a red underline, red on hover. Scoped to text
   containers so tabs, chips, table controls, names and handles keep their own
   colour. */
.content :is(p, li, dd, td, .kv-val, .small, .muted, .card-note, .card-sub) a:not(.btn):not(.subtab):not(.range-chip):not(.range-pill) {
  text-decoration-color: rgba(190, 24, 32, .45);
}
.content :is(p, li, dd, .kv-val, .small, .muted, .card-note, .card-sub) a:not(.btn):hover { color: var(--brand-ink); text-decoration-color: var(--brand-ink); }

/* heatmaps and fills on the brand colour */
:root {
  --heat-rgb: 255, 91, 91;         /* signal red light end: dark type stays readable at full intensity */
  --heat-2-rgb: 255, 91, 91;
  --brand-contrast: #FFFFFF;       /* white type on Cleriva red */
}

/* Montserrat runs wider than the kit's default sans: tighten tracked caps so
   fixed-width table headers and chips keep their words apart */
.table th, .nav-group, .kpi-label, .field span, .pub-label, .funnel-label { letter-spacing: .1em; }
.table th { font-size: 10px; }
.badge { letter-spacing: .06em; }

/* segmented controls match the pill buttons beside them */
.range-pill, .sa-seg { border-radius: 999px; }
/* the end segments take the pill's radius on their outer side only */
.sa-seg-btn:first-child { border-radius: 999px 0 0 999px; }
.sa-seg-btn:last-child { border-radius: 0 999px 999px 0; }
.range-pills { gap: 6px; }
.sa-seg { overflow: hidden; }
.cohort-range-option:first-of-type { border-radius: 999px 0 0 999px; }
.cohort-range-option:last-child { border-radius: 0 999px 999px 0; }

/* the sign-in footer line reads at 6:1 */
.auth-foot { color: #9A9AA2; }

/* selection and focus */
::selection { background: rgba(190, 24, 32, .18); }
.nav-link:focus-visible, .nav-group:focus-visible, .sidebar-close:focus-visible { outline-color: #FFFFFF; }

/* a plain .btn (no variant) is the white secondary pill */
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-ghost):not(.btn-danger-ghost) { background: #FFFFFF; color: var(--ink); border-color: var(--line-strong); }
.btn:not(.btn-primary):not(.btn-secondary):not(.btn-ghost):not(.btn-danger-ghost):hover { background: var(--surface-3); }

/* phones: the two-line title rule in app.css needs the smaller size to apply here too */
@media (max-width: 620px) {
  .page-title { font-size: 14px; letter-spacing: .08em; }
}

/* the preset group is a pill: its end chips take the pill's radius so an active
   chip at either end keeps its corners */
.range-chip:first-child { border-radius: 999px 0 0 999px; }
.range-chip:last-child { border-radius: 0 999px 999px 0; }
/* phones: the wrapped preset group is a rounded box, so its chips are square */
@media (max-width: 620px) {
  .range-chip:first-child, .range-chip:last-child { border-radius: 0; }
}

/* Montserrat is wider than the kit's default face: 16 px more keeps "Marketing Performance"
   and an active "LTV & Unit Economics" on one line. Desktop only; the drawer has its own width. */
@media (min-width: 921px) {
  .sidebar { width: 254px; flex-basis: 254px; }
}

/* jump chips are pills, not prose links */
.content .int-jump a:not(.btn):not(.subtab):not(.range-chip):not(.range-pill) { text-decoration: none; }
