/* The RST look for the app BODIES — after The Shade Store, Suzanne's choice: premium AND minimal.
   The Home page (home_static/home.css) is the reference: white, hairline rules instead of boxes,
   no shadows. Type: Jost for the words, the system font for the data — the TYPE block below.

   🔑 SCOPED TO .rst-theme, the class on an app's outermost container. An app opts in by adding
   the class — that is how the pilot (Technician Evaluation, 2026-10-21) ships alone before the
   rollout (Alberto, 2026-10-20: screenshots first, then the other apps).
   🔴 ONLY THE FRAME CHANGES. Chart and number colours keep their meaning (red/green = bad/good)
   and are never set here — a KPI value's colour is written inline by its callback and wins.
   🔴 The ⏻ button, the profile badge and the logo block are shared controls (UI_STANDARDS.md) —
   nothing below touches .logout-button, .user-profile-badge or .header-brand-*.
   Many base rules in style.css are inline styles or !important, hence the !important here. */

.rst-theme {
  --rst-bg: #ffffff;
  --rst-ink: #1b1d20;
  --rst-muted: #6b6f75;
  --rst-rule: #e6e6e3;
  --rst-soft: #f7f7f5;
  --rst-sans: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  /* The big numbers keep the apps' original bold system font (Alberto, 2026-10-21 — he tried the
     serif and went back). */
  --rst-numbers: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  background: var(--rst-bg);
  color: var(--rst-ink);
  font-family: var(--rst-sans);
  -webkit-font-smoothing: antialiased;
}
body:has(.rst-theme) { background: #ffffff; }
/* The footer sits at the bottom of the window on a short page (Report Uploads, 2026-10-22) instead of
   floating mid-screen over white: the themed page is a column.
   The element just before the footer grows, so the footer keeps its own 60px gap on a long page. */
.rst-theme { display: flex; flex-direction: column; }
.rst-theme > :has(+ .site-footer) { flex-grow: 1; }
/* 🔴 A flex item's min-width is `auto` — its widest table — so without this one wide table makes the
   whole page wider than a phone (the SF dashboard went 1152px wide in a 390px screen). */
.rst-theme > * { min-width: 0; }
/* …and a page container's `margin: 0 auto` stops a flex item stretching, so it would shrink-wrap to
   its content; full width, its own max-width still centres it. */
.rst-theme > .dashboard-container { width: 100%; }

/* ── the header: ONE light-grey band — logo │ title, the badge and ⏻ at its right ──────────
   Alberto, 2026-10-26: "use only the space needed for the users and log-out button… a light gray…
   the Main Title Font to Black… the grey band will reach the Logo too… keep the separator". Until
   then a white logo block stood beside a 160px dark photo band. */
.rst-theme .dashboard-header {
  background: #efefed; border: none; border-radius: 0; box-shadow: none;
  padding: 0; margin-bottom: 28px; align-items: center; gap: 28px;
}
/* the separator, a shade darker than the band so it still reads on grey */
.rst-theme .dashboard-header > .header-logo { align-self: center; border-right-color: #cdcdc8; }
.rst-theme .dashboard-header .dashboard-title {
  margin: 0; padding: 0; text-align: left;
  /* The app bar's own voice — Jost, capitals, tracked (Alberto, 2026-10-22); black on the grey band. */
  font-family: var(--rst-sans); font-weight: 500; font-size: 20px;
  letter-spacing: .14em; text-transform: uppercase; line-height: 1.2; color: #000000; text-shadow: none;
}
/* FIRST on the page, edge to edge (Alberto, 2026-10-21), 60px — 80px until 2026-10-27 (Alberto: "reduce
   and optimize the vertical space we are using at the top") — with 150px kept free on the right for the
   badge and ⏻. 🔑 Their own blocks stay verbatim (style.css, pinned by test_logout_button/test_profile_badge);
   only their height in THIS band is set here, centred: badge 42px at 9, ⏻ 36-40px at 11. */
.rst-theme > .dashboard-header { display: flex; margin: 0; min-height: 60px; padding: 0 150px 0 28px; gap: 28px; }
.rst-theme > .user-profile-badge { top: 9px; }
.rst-theme > .logout-button,
.rst-theme > a > .logout-button { top: 11px; }
.rst-theme > .dashboard-header > .header-title { flex: 1; min-width: 0; }

/* "Data Snapshot Fetched At" — under the app bar, right (Alberto, 2026-10-26: the band has no room
   for it), ending where the page content ends: the page container's own width and gutter (below).
   components/layout.get_data_snapshot. */
.rst-theme .data-snapshot-row { display: flex; justify-content: flex-end; padding: 10px 28px 0; }
@media (min-width: 769px) {
  .rst-theme .data-snapshot-row { box-sizing: border-box; width: 100%; max-width: 1620px; margin: 0 auto; padding: 10px 120px 0; }
}
.rst-theme .data-snapshot { font-size: 12px; letter-spacing: .06em; color: var(--rst-muted); white-space: nowrap; }

/* ── panels: no boxes, no shadows — a hairline rule and white space ──────────── */
.rst-theme .filter-panel {
  background: var(--rst-bg); border: none; border-top: 1px solid var(--rst-rule);
  border-bottom: 1px solid var(--rst-rule); border-radius: 0; box-shadow: none; padding: 10px 0;
  margin-bottom: 12px;
}
/* The title row carries an inline 16px bottom margin — empty space while the panel is closed. */
.rst-theme .filter-panel > div:first-child { margin-bottom: 0 !important; }
.rst-theme #filters-content { padding-top: 12px; }
.rst-theme .filter-panel-title { font-weight: 500 !important; letter-spacing: .2em !important; font-size: 13px !important; }
.rst-theme #filters-toggle-btn,
.rst-theme #sf-filters-toggle-btn {
  background: transparent !important; color: var(--rst-ink) !important;
  border: 1px solid var(--rst-ink) !important; border-radius: 0 !important; padding: 2px 10px !important; font-size: 12px !important;
}
.rst-theme #filters-toggle-btn:hover,
.rst-theme #sf-filters-toggle-btn:hover { background: var(--rst-ink) !important; color: #ffffff !important; }
.rst-theme .period-preset-btn { background: var(--rst-bg); border-radius: 0; border-color: var(--rst-rule); font-weight: 500; }
.rst-theme .period-preset-btn:hover { border-color: var(--rst-ink); color: var(--rst-ink); }
.rst-theme .period-preset-btn.active { background: var(--rst-ink); border-color: var(--rst-ink); color: #ffffff; }

.rst-theme .chart-card,
.rst-theme .silver-sheet {
  background: var(--rst-bg) !important; border: none !important; border-top: 1px solid var(--rst-rule) !important;
  border-radius: 0 !important; box-shadow: none !important;
}
.rst-theme .chart-card { padding: 20px 0 4px; margin-bottom: 12px; }
.rst-theme .silver-sheet { padding: 24px 0 0; }
.rst-theme .modal .silver-sheet { border-top: none !important; padding-top: 0; }
.rst-theme .silver-sheet .dash-header { background-color: var(--rst-soft) !important; color: var(--rst-ink) !important; font-weight: 500 !important; }
/* Every data table's header row: the soft grey, not the slate the tables set inline. */
.rst-theme .dash-spreadsheet .dash-header { background-color: var(--rst-soft) !important; }
.rst-theme .js-plotly-plot .plotly .bg { fill: #ffffff !important; }

/* The two section bands (Q&A, Salesforce): a title on a rule, not a tinted box. */
.rst-theme #new-system-section-header,
.rst-theme .sf-section-header {
  background: transparent !important; border: none !important; border-radius: 0 !important;
  border-top: 1px solid var(--rst-ink) !important; padding: 18px 0 !important;
}
.rst-theme #new-system-section-header > span,
.rst-theme .sf-section-header > div:first-child > span { color: var(--rst-muted) !important; letter-spacing: .04em; }
.rst-theme #new-system-section-body { border: none !important; background: transparent !important; padding: 0 !important; }

/* ── KPI cards: a hairline frame, compact (Alberto, 2026-10-21: "use the vertical space better") ── */
.rst-theme #kpi-grid-container { gap: 12px !important; margin-bottom: 8px !important; }
.rst-theme .kpi-card { border-radius: 0 !important; box-shadow: none !important; padding: 10px 16px !important; }
.rst-theme .kpi-card:hover { transform: none !important; box-shadow: none !important; }
/* 🔴 A `kpi-status` card's fill and border ARE its meaning (the SF dashboard's red / amber / green
   against target, written inline by its callback) — the theme never paints over them. */
.rst-theme .kpi-card:not(.kpi-status) {
  background: var(--rst-bg) !important; border: 1px solid var(--rst-rule) !important;
  border-top: 1px solid var(--rst-rule) !important;
}
.rst-theme .kpi-card:not(.kpi-status):hover { background: var(--rst-bg) !important; border-color: var(--rst-ink) !important; }
.rst-theme .kpi-title { font-weight: 500; letter-spacing: .16em; color: var(--rst-muted); margin-bottom: 2px; }
.rst-theme .kpi-value,
.rst-theme .kpi-value-dual {
  font-family: var(--rst-numbers); font-weight: 700; font-size: 30px; line-height: 1.1; margin: 4px 0 0;
}
.rst-theme .kpi-value-dual { font-size: 22px; }

/* ── generic roles for apps whose cards are INLINE-styled (rollout, 2026-10-22: the Address Code
   File first). Their markup carries a role class instead of .kpi-card / .chart-card, whose base
   rules bring a pointer cursor and centring meant for the dashboards' clickable KPI tiles.
     rst-panel — a section: a hairline on top, white space, no box   (= .chart-card here)
     rst-stat  — a small number card: a hairline frame               (= .kpi-card here)
     rst-btn   — an action button: outlined text                     (= .btn-export here)
   !important because the cards' own looks are inline styles. ── */
.rst-theme .rst-panel {
  background: var(--rst-bg) !important; border: none !important; border-top: 1px solid var(--rst-rule) !important;
  border-radius: 0 !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important;
}
.rst-theme .rst-stat {
  background: var(--rst-bg) !important; border: 1px solid var(--rst-rule) !important; border-radius: 0 !important;
  box-shadow: none !important; padding: 10px 16px !important; height: 100%;
}
.rst-theme .rst-btn,
.rst-theme .action-button {
  background: var(--rst-bg) !important; color: var(--rst-ink) !important; border: 1px solid var(--rst-ink) !important;
  border-radius: 0 !important; box-shadow: none !important; font-family: var(--rst-sans); font-size: 11px !important;
  font-weight: 500 !important; letter-spacing: .14em; text-transform: uppercase; padding: 10px 18px !important;
}
.rst-theme .rst-btn:hover:not(:disabled),
.rst-theme .action-button:hover:not(:disabled) { background: var(--rst-ink) !important; color: #ffffff !important; }
.rst-theme .rst-btn:disabled { opacity: .4; cursor: not-allowed !important; }
/* rst-dropzone — a file drop area (Report Uploads): a dashed hairline on the soft grey, square. */
.rst-theme .rst-dropzone {
  border: 1px dashed var(--rst-muted) !important; border-radius: 0 !important; background: var(--rst-soft) !important;
  font-size: 14px !important; letter-spacing: .02em;
}
.rst-theme .rst-dropzone:hover { border-color: var(--rst-ink) !important; }
/* A tab's one-line purpose, now that the app has one header for all its tabs. */
.rst-theme .rst-tab-note { margin: 0 0 18px; }

/* ── tabs (dbc.Tabs): the app bar's voice — capitals, tracked, an underline for the open one.
   The old .nav-item rule in style.css (written for the retired floating nav) was deleted with this
   restyle; the reset below stays so Bootstrap's own nav-item spacing cannot creep back. ── */
.rst-theme .nav-tabs { border-bottom: 1px solid var(--rst-rule); gap: 28px; margin-bottom: 22px; flex-wrap: wrap; }
.rst-theme .nav-tabs .nav-item {
  margin: 0; padding: 0; border-radius: 0; overflow: visible; color: inherit; font-size: inherit;
}
.rst-theme .nav-tabs .nav-item:hover { background: transparent; }
.rst-theme .nav-tabs .nav-link {
  font-family: var(--rst-sans); font-size: 13px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rst-muted); background: transparent; border: none; border-bottom: 1px solid transparent;
  border-radius: 0; padding: 14px 0 10px; margin: 0 0 -1px; box-shadow: none; transform: none;
}
.rst-theme .nav-tabs .nav-link:hover { color: var(--rst-ink); border-bottom-color: var(--rst-ink); box-shadow: none; transform: none; }
.rst-theme .nav-tabs .nav-link.active { color: var(--rst-ink); font-weight: 500; background: transparent; border-bottom-color: var(--rst-ink); box-shadow: none; transform: none; }
/* dbc.Tabs puts the page-container class on the tab LIST itself, and each tab's page is a page
   container of its own — together two paddings of empty band around one row of tabs. */
.rst-theme .nav-tabs.dashboard-container { padding-top: 4px; padding-bottom: 0; }
.rst-theme .tab-content > .tab-pane > .dashboard-container { padding-top: 0; }

/* ── buttons: the export pair as quiet outlined text, Home's call-to-action voice ── */
.rst-theme .btn-export {
  background: var(--rst-bg); color: var(--rst-ink); border: 1px solid var(--rst-ink); border-radius: 0;
  box-shadow: none; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 16px;
}
.rst-theme .btn-export:hover { background: var(--rst-ink); color: #ffffff; box-shadow: none; }

/* ── phones: the band stays one row (the brand shows its symbol alone — style.css .header-brand-name) ── */
@media (max-width: 768px) {
  .rst-theme > .dashboard-header { min-height: 60px; padding: 0 130px 0 16px; gap: 14px; }
  .rst-theme .dashboard-header > .header-logo { padding-right: 14px; }
  .rst-theme .dashboard-header .dashboard-title { font-size: 14px; letter-spacing: .1em; }
  .rst-theme .data-snapshot-row { padding: 8px 16px 0; }
  .rst-theme .kpi-value { font-size: 26px; }
  /* the snapshot line wraps rather than widening the page */
  .rst-theme .data-snapshot { white-space: normal; text-align: right; }
}
/* The SF dashboard's two portal-window chips (a flex row written inline): they wrap on a phone. */
.rst-theme .portal-dates-bar { flex-wrap: wrap; }

/* ── the small headline counts beside a visual's title (Q&A, Reviewer Check, Training Monitor) ── */
.rst-theme .mini-kpi { border-radius: 0 !important; border-color: var(--rst-rule) !important; background: var(--rst-bg) !important; }
.rst-theme .mini-kpi-value { font-family: var(--rst-numbers); }

/* The Q&A section's wrapper pads 20px all round; here the page's own gutter is enough. */
.rst-theme div:has(> #new-system-section) { padding: 0 !important; }

/* 🔑 THE SIDE GUTTER FOR THE CHAT AND GRACIE BUBBLES (Alberto, 2026-10-26: "work with the margins to
   make the proper space for the chats"). The bubbles are position:fixed 24px from each edge and 56px
   wide, so they float over the page at every scroll position; the page content keeps 120px clear on
   both sides — the footer's own gutter — and the max-width grows by the same 120px so a wide screen
   loses no content width (1500 - 2x60 = 1620 - 2x120). Only the OUTERMOST page container carries it:
   a nested one (a tab's page) would add a second gutter. A phone keeps its 16px — no room to reserve.
   Pinned in a browser by scripts/diagnostics/rst_theme_browser_check.py (no bubble inside the content). */
@media (min-width: 769px) {
  .rst-theme .dashboard-container { max-width: 1620px; padding-left: 120px; padding-right: 120px; }
  .rst-theme .dashboard-container .dashboard-container { max-width: none; padding-left: 0; padding-right: 0; }
}
/* Phones: a 16px gutter (the base stylesheet allows 4px — fine on grey, cramped on white). */
@media (max-width: 599px) {
  .rst-theme .dashboard-container { padding: 8px 16px; }
}

/* ── The team chat on the LEFT, Gracie alone on the right (Alberto, 2026-10-22: "that way Gracie and
   the regular chat will not interfere with each other"). The chat bubble sits above the
   "Updating… / Ready" pill (bottom-left, 12px) and its panel opens to the right of it; Gracie drops
   into the bottom-right corner the chat used to hold. Positions only — the widgets are shared
   modules (surface #3), restyled nowhere. */
.rst-theme .chat-widget-root { left: 24px; right: auto; bottom: 56px; }
.rst-theme .chat-panel { left: 0; right: auto; }
.rst-theme .gracie-root { bottom: 24px; }
@media (max-width: 768px) {
  .rst-theme .chat-widget-root { left: 16px; right: auto; bottom: 52px; }
  .rst-theme .gracie-root { bottom: 16px; }
}

/* rst-stack — a side-by-side row that stacks on a phone (Scorecards' History list + preview). */
@media (max-width: 768px) {
  .rst-theme .rst-stack { flex-direction: column !important; }
  .rst-theme .rst-stack > * { flex-basis: auto !important; width: 100%; }
}

/* ── Scorecards (rollout 2026-10-22, its own tree — this file is a byte-identical copy there) ──
   Its page container is padded (.editor-container), so the header, the app bar and the footer
   bleed back to the window's edges. Its pages are a menu in the app bar since 2026-10-27. Its logo is app/auth.get_header_brand — the
   same markup as the BI apps' since 2026-10-26, so it needs no slot of its own.
   Only the FRAME changes: a score cell's colour is its meaning and nothing here touches the grid's. */
.rst-theme.editor-container { max-width: none; padding: 0 16px; }
.rst-theme.editor-container > .dashboard-header,
.rst-theme.editor-container > .app-bar,
.rst-theme.editor-container > .site-footer { margin-left: -16px; margin-right: -16px; }
.rst-theme.editor-container > .app-bar { margin-bottom: 20px; }
.rst-theme .control-panel {
  background: var(--rst-bg) !important; background-image: none !important; backdrop-filter: none !important;
  border: none !important; border-top: 1px solid var(--rst-rule) !important; border-bottom: 1px solid var(--rst-rule) !important;
  border-radius: 0 !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important;
}
/* the grid's white card: a hairline on top, like every other panel */
.rst-theme .grid-container { border-radius: 0; box-shadow: none; border-top: 1px solid var(--rst-rule); padding: 16px 0; }

/* ══ TYPE — one rule, two families (Alberto, 2026-10-22: "replace these complex fonts for more
   simple ones… be sure all the used fonts in this app have consistency"). The serif is gone.
     WORDS that frame the page — titles, labels, buttons, notes: Jost, the app bar's voice.
     DATA — every number, table cell, chart label and survey comment: the system font, bold for
       the headline numbers (his choice for the KPI cards, 2026-10-21, now applied to ALL data).
   Five frame roles, each ONE style: page title (header) · section title · visual title ·
   label · note. 🔴 Sizes and families only — a number's COLOUR is its meaning and is never
   set here (pinned by test_the_theme_never_colours_a_number). ══ */

/* section title — the two bands: "New System (July 2026+)", "Salesforce · …" */
.rst-theme #new-system-section-header .chart-title,
.rst-theme .sf-section-header .chart-title {
  font-family: var(--rst-sans); font-size: 20px !important; font-weight: 400 !important; letter-spacing: .14em !important;
  text-transform: uppercase; line-height: 1.25; color: var(--rst-ink);
}
/* visual title — every visual's own name */
.rst-theme .chart-title,
.rst-theme .visual-title {
  font-family: var(--rst-sans); font-size: 15px !important; font-weight: 500 !important; letter-spacing: .14em !important;
  text-transform: uppercase; line-height: 1.3; color: var(--rst-ink) !important;
}
/* note — the line under a section or visual title */
.rst-theme #new-system-section-header > span,
.rst-theme .sf-section-header > div:first-child > span {
  font-size: 12px !important; font-weight: 400 !important; letter-spacing: .02em; text-transform: none;
}
/* label — card names, control names, column headers, the board's three columns */
.rst-theme .kpi-title,
.rst-theme .filter-label,
.rst-theme .filter-panel-title,
.rst-theme .sf-comments-control-label,
.rst-theme .fault-legend-title,
.rst-theme .detail-title,
.rst-theme .qc-legend-label,
.rst-theme .te-label,
.rst-theme .control-label,
.rst-theme .mini-kpi > div:last-child {
  font-family: var(--rst-sans); font-size: 12px !important; font-weight: 500 !important;
  letter-spacing: .14em !important; text-transform: uppercase;
}
.rst-theme th {
  font-family: var(--rst-sans) !important; font-size: 12px !important; font-weight: 500 !important; letter-spacing: .06em;
}

/* DATA — numbers, cells, charts and comments in the one data font */
.rst-theme td,
.rst-theme .dash-cell,
.rst-theme .sentiment-column,
.rst-theme .ag-cell,
.rst-theme .headline-number { font-family: var(--rst-numbers) !important; }
.rst-theme .js-plotly-plot .plotly text { font-family: var(--rst-numbers) !important; }
/* headline numbers: one weight; the KPI cards 30px, the small counts beside a title 20px,
   a featured number inside a visual (Commercial, the NPS) 30px */
.rst-theme .mini-kpi-value { font-weight: 700 !important; }
.rst-theme .headline-number { font-weight: 700 !important; font-size: 30px !important; }

/* note — every explanatory line: one size, plain (the italics were scattered, not a role) */
.rst-theme .te-note,
.rst-theme .fault-legend-note {
  font-family: var(--rst-sans); font-size: 12px !important; font-weight: 400; font-style: normal !important;
  letter-spacing: .02em; color: var(--rst-muted) !important;
}
/* control — Help and Multipliers, the "View detailed table" toggles, the view switch: one voice */
.rst-theme .btn:has(> .fa-question-circle),
.rst-theme #qna-multipliers-open { font-size: 13px !important; font-weight: 500 !important; }
.rst-theme .accordion-button {
  font-family: var(--rst-sans); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
}
.rst-theme .te-view-bar { font-weight: 500; }
