/* HowiePulse Hub — Sales Reports v2 (Hungry Howie's yellow / orange / charcoal / red) */
.sx { display: flex; flex-direction: column; gap: 1rem; }
.sx-titlebar {
  text-align: center; background: var(--hh-charcoal); color: var(--hh-yellow);
  border-radius: var(--radius); padding: .8rem 1rem .7rem; box-shadow: 4px 4px 0 var(--hh-yellow);
  border: 2px solid var(--hh-charcoal);
}
.sx-titlebar h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 2rem; letter-spacing: .06em; line-height: 1; }
.sx-titlebar .sx-sub { font-size: .74rem; color: rgba(255,242,0,.85); font-weight: 600; margin-top: .3rem; }
.sx-titlebar .sx-stale { display: inline-block; margin-left: .4rem; color: #ff6b81; font-weight: 800; font-size: .68rem; }
.sx-toolbar {
  display: flex; flex-wrap: wrap; gap: .55rem .8rem; align-items: flex-end;
  background: #fff; border: 2px solid var(--hh-charcoal); border-radius: 12px; padding: .65rem .75rem;
}
.sx-toolbar .sx-presets { display: flex; flex-wrap: wrap; gap: .3rem; }
.sx-toolbar .sx-presets button { padding: .38rem .6rem; font-size: .72rem; }
.sx-toolbar label { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: flex; flex-direction: column; gap: .2rem; }
.sx-toolbar input[type=date], .sx-toolbar select { padding: .35rem .5rem; font-size: .8rem; }
.sx-toolbar .sx-spacer { flex: 1 1 auto; }
.sx-range-note { font-size: .74rem; font-weight: 600; color: var(--hh-muted); width: 100%; }
.sx-range-note b { color: var(--hh-charcoal); }

.sx-kpis { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); }
.sx-kpi { background: #fff; border: 1.5px solid rgba(18,18,18,.35); border-radius: 10px; padding: .55rem .7rem .6rem; position: relative; overflow: hidden; }
.sx-kpi .k-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--hh-muted); font-weight: 700; }
.sx-kpi .k-value { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.05; margin-top: .1rem; letter-spacing: .02em; }
.sx-kpi .k-value.ok { color: #1b6e20; } .sx-kpi .k-value.bad { color: #b0001f; } .sx-kpi .k-value.warn { color: #9a6700; }
.sx-kpi .k-comps { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .35rem; }
.sx-chip { font-size: .64rem; font-weight: 700; border-radius: 999px; padding: .1rem .42rem; border: 1.2px solid rgba(18,18,18,.25); background: transparent; white-space: nowrap; }
.sx-chip.up { color: #1b6e20; }
.sx-chip.down { color: #b0001f; }
.sx-chip.flat, .sx-chip.na { color: var(--hh-muted); }
.sx-kpi .k-sub { font-size: .66rem; color: var(--hh-muted); margin-top: .25rem; font-weight: 500; }

.sx-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sx-grid .sx-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .sx-grid { grid-template-columns: 1fr; } }
.sx .panel { padding: .9rem 1rem 1rem; min-width: 0; }
.sx .panel h2 { font-size: 1.3rem; margin-bottom: .6rem; }
.sx .panel h2 .badge.alt { background: #fff; }
.sx .sx-note { font-size: .72rem; color: var(--hh-muted); margin: -.25rem 0 .5rem; font-weight: 500; }
.sx .chart-wrap { height: 280px; }
.sx .chart-wrap.tall { height: 340px; }
.sx .chart-wrap.short { height: 220px; }
.sx-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .8rem; align-items: start; }
@media (max-width: 700px) { .sx-split { grid-template-columns: 1fr; } }
.sx-empty { font-size: .8rem; color: var(--hh-muted); padding: 1.2rem .4rem; text-align: center; font-weight: 600; }

.sx table { font-size: .78rem; }
.sx th, .sx td { padding: .4rem .45rem; white-space: nowrap; }
.sx td.num, .sx th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sx .tbl-wrap { overflow: auto; max-height: 560px; border: 1px solid rgba(18,18,18,.12); border-radius: 8px; }
.sx .tbl-wrap thead th { position: sticky; top: 0; z-index: 1; }
.sx .tbl-wrap.short { max-height: 360px; }
.sx td.pos { color: #1b6e20; font-weight: 700; } .sx td.neg { color: #b0001f; font-weight: 700; }
.sx tr.sx-sel td { font-weight: 800; } .sx tr.sx-sel td:first-child { box-shadow: inset 3px 0 0 var(--hh-charcoal); }
.sx tr.sx-total td { font-weight: 700; background: #fff; border-top: 2px solid var(--hh-charcoal); }
.sx th.sortable { cursor: pointer; user-select: none; }
.sx th.sortable.sort-asc::after { content: " ▲"; } .sx th.sortable.sort-desc::after { content: " ▼"; }
.sx-table-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .55rem; }
.sx-table-tools .toggle-group button { padding: .3rem .55rem; font-size: .7rem; }
.sx-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; border: 1px solid rgba(0,0,0,.2); }

.sx-heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: .68rem; }
.sx-heat th { background: none; padding: .15rem .25rem; font-size: .62rem; text-align: center; }
.sx-heat td { text-align: center; padding: .28rem .1rem; border-radius: 4px; border: none; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.4rem; }
.sx-heat td.h-label { text-align: right; font-weight: 700; color: var(--hh-muted); background: none; padding-right: .35rem; min-width: 3.2rem; }
.sx-heat tr:hover td { filter: brightness(.96); }
.sx-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .7rem; font-weight: 600; margin-top: .4rem; color: var(--hh-muted); }
.sx-sources { font-size: .72rem; color: var(--hh-muted); line-height: 1.5; }
.sx-sources table { font-size: .72rem; }
.sx-loading { padding: 2rem; text-align: center; font-weight: 700; }
@media (max-width: 600px) {
  .sx-titlebar h2 { font-size: 1.55rem; }
  .sx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-kpi .k-value { font-size: 1.4rem; }
  .sx .chart-wrap { height: 240px; }
  .sx .chart-wrap.tall { height: 300px; }
  .sx-toolbar { padding: .55rem; }
  .sx-toolbar label { flex: 1 1 42%; }
  .sx-toolbar input[type=date], .sx-toolbar select { width: 100%; }
  .sx .panel { padding: .75rem .65rem .8rem; }
}
@media (min-width: 1200px) { .sx-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.sx .sx-wide .sx-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 700px) { .sx .sx-wide .sx-split { grid-template-columns: 1fr; } }
/* Global header filter bar replaces the old in-page toolbar (v2.2) */
/* range summary: small muted footer line at the end of the Sales page (no box, no fill) */
.sx > .sx-range-note.sx-foot { background: transparent; border: 0; padding: .9rem .1rem .2rem; margin-top: .4rem; font-size: .68rem; font-weight: 500; color: var(--hh-muted); text-align: center; }
.sx > .sx-range-note.sx-foot b { color: var(--hh-muted); font-weight: 700; }
/* second KPI group ("Operations"): subtle label, no fill */
.sx-kpi-group { font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--hh-muted); margin: .25rem 0 -.3rem .1rem; background: transparent; }
.sx-range-note .sx-clamp { color: #b05a00; }
.sx-range-note .sx-asof { color: var(--hh-muted); }
/* Missing-data honesty */
.sx > .sx-missing { background: #fff; border: 2px solid #b0001f; color: #8a0018; border-radius: 10px; padding: .5rem .75rem; font-size: .78rem; font-weight: 600; display: grid; gap: .2rem; }
.sx > .sx-missing b { color: #8a0018; }
.sx > .sx-missing.is-info { background: #fff; border-color: #9a6700; color: #7a5200; }
.sx > .sx-missing[hidden] { display: none; }
.sx-kpi .k-value.na { font-size: 1.05rem; color: #8a0018; }
.sx-kpi.is-na { border-style: dashed; }
.sx-na-row td { color: #8a0018; font-style: italic; background: #fff; }
.sx-chip.partial { border-style: dashed; }
/* KPI cards v2.6 (Oct 10 2026): merged Net/Orders lead cards with vs LY on the top line + value colour rules.
   Site-wide rule (Brian): NEVER highlight behind text. Status = text colour only — green / yellow / red.
   No fills, no tinted cards, no coloured stripes. Colours chosen for >= 4.5:1 contrast on white. */
.sx-kpis { --t-green: #1b6e20; --t-yellow: #9a6700; --t-red: #b0001f; }
.sx-kpi .k-value.t-green { color: var(--t-green); }
.sx-kpi .k-value.t-yellow { color: var(--t-yellow); }
.sx-kpi .k-value.t-red { color: var(--t-red); }
.sx-kpi .k-value { display: inline-block; }
.sx-kpi .k-value.na { font-family: inherit; font-weight: 700; letter-spacing: 0; }
.sx-kpi .k-rule { font-size: .7rem; color: var(--hh-muted); cursor: help; text-transform: none; letter-spacing: 0; }
/* lead cards (Net sales, Orders): value + vs LY on one line, comparison bubbles below */
.sx-kpi .k-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .45rem; margin-top: .1rem; }
.sx-kpi .k-head .k-value { margin-top: 0; }
/* vs LY = top-line data point: plain inline text on the value's baseline, ~65% of the value size (Brian, Oct 10) */
.sx-kpi .k-ly { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.05; font-weight: 700; letter-spacing: .02em; white-space: nowrap; color: var(--hh-muted); }
.sx-kpi .k-ly small { font-family: Montserrat, system-ui, sans-serif; font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-left: .12rem; }
.sx-kpi .k-ly.up { color: #1b6e20; } .sx-kpi .k-ly.down { color: #b0001f; }
.sx-kpi .k-ly.flat { color: var(--hh-charcoal, #121212); }
.sx-kpi .k-ly.na { color: var(--hh-muted, #5a5a5a); font-size: .95rem; }
.sx-kpi .k-ly.partial { text-decoration: underline dotted; text-underline-offset: 3px; }
.sx-chip.ref { color: var(--hh-charcoal, #121212); }

/* colour legend under the KPI grid */
.sx-kpi-legend { font-size: .7rem; color: var(--hh-muted); margin-top: -.45rem; }
.sx-kpi-legend summary { cursor: pointer; font-weight: 700; list-style-position: inside; }
.sx-kpi-legend ul { margin: .35rem 0 0; padding-left: 1.1rem; display: grid; gap: .12rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.sx-kpi-legend b { color: var(--hh-charcoal, #121212); }
.sx-tones { margin-left: .5rem; font-weight: 600; }
.sx-tones b { margin-left: .5rem; font-weight: 800; }
.sx-tones .t-green { color: #1b6e20; } .sx-tones .t-yellow { color: #9a6700; } .sx-tones .t-red { color: #b0001f; }
@media (max-width: 600px) { .sx-kpi.k-lead { grid-column: 1 / -1; } .sx-kpi .k-ly { font-size: 1rem; } }

/* Orders by channel Count / % toggle (2.9.8): sits at the right end of the card title */
.sx .panel h2 .sx-h2-toggle { margin-left: auto; gap: .25rem; }
.sx .panel h2 .sx-h2-toggle button { padding: .22rem .55rem; font-size: .68rem; min-width: 2.4rem; letter-spacing: .03em; }
