/* =========================================================================
   RenoPilot — Unified Style Pass, Part 2 file (2026-09-20)
   Additive, visual-only override. Loaded immediately after
   unified-theme-2026-09-20.css (Parts 1-9) — same rules apply: nothing in
   renopilot-core.css / mobile-integration-r97.css / mobile-4.4.css /
   styles.css is edited, this file only re-declares selectors with the
   approved values, !important, loaded last so it wins the cascade.

   Source of truth: project doc
   "style-direction-approved-2026-09-19.md".

   Scope of this file — closing the gaps flagged after the Part 1-9 pass:
   1. Record lists (Quotes/Invoices/Estimates/Payments/Expenses/
      Statements/Milestones/Recurring) — the shared .billing-doc-card /
      .billing-card-list markup, turned into a flat row-list inside one
      panel instead of a stack of separate gradient "cards".
   2. Job Detail's money/progress panel (.rf-clear-money) — restyled into
      the same "quiet numbers strip" bar as the Home dashboard.
   3. Reports page's #repSummary metrics — same quiet-numbers-strip
      treatment, plus panel/table styling for the new bar chart + ring
      built by assets/reports-restyle-2026-09-20.js.
   4. A few generalized token fixes (--shadow/--shadow-lift were never
      actually overridden in Part 1 — only a separate --r40-shadow
      variable was, so most generic .card/.metric/.job-card/.kpi-card/
      .photo-card rules, which read var(--shadow) directly, never picked
      up the approved softer shadow. Fixing the real variable here is one
      generalized fix that reaches all of them for free).
   5. Mobile: larger page title, and the app's *existing* generic
      table→card mechanism (table.rp-mobile-table, built by
      mobile-integration-r97.js — it already converts nearly every
      <table> in the app into a labelled stacked card list on phones)
      brought in line with the approved radius/shadow tokens.

   To undo this file: delete its <link> tag in index.html. Nothing else
   needs to change; Parts 1-9 in unified-theme-2026-09-20.css are
   unaffected either way.
   ========================================================================= */

/* --- 4. Generalized shadow-token fix. Part 1 introduced --radius /
   --radius-lg / --radius-sm overrides that many existing rules already
   read (var(--radius), var(--radius-lg)) — but it only added a *new*
   variable, --r40-shadow, for the shadow, so the ~32 existing rules that
   read var(--shadow)/var(--shadow-lift) directly (.card, .metric,
   .job-card, .kpi-card, .photo-card, comm-client-card, and more) never
   actually received the approved softer shadow. Overriding the real
   variable names is the single generalized fix that reaches all of them
   without touching each rule individually. */
:root{
  --shadow:0 1px 2px rgba(0,0,0,.03),0 4px 16px rgba(0,0,0,.06)!important;
  --shadow-lift:0 2px 4px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.08)!important;

  /* =======================================================================
     9. (2026-09-20, Part 16) — the ONE canonical token set, copied
     verbatim from claude/style-direction-approved-2026-09-19.md. Every
     fix below this point uses these variables instead of a new hardcoded
     value, on your explicit instruction to stop the app having several
     different greys/blues/radii doing the same job. Where an existing
     rule already used --r40-blue/--radius/--shadow (set in
     unified-theme-2026-09-20.css's own :root), these are added as the
     same values under their proper spec names so both old and new
     references agree — nothing conflicts.
     ========================================================================= */
  --ink:#0a0a0c;
  --ink2:#6e6e73;
  --ink3:#a1a1a6;
  --line:#eeeeef;
  --bg:#f5f5f7;
  --surface:#ffffff;
  --accent-dark:#0050d6;
  --accent-tint:#eaf1ff;
  --ok:#1fae5e;
  --warn:#c98a12;
  --due:#e0453a;
  /* NOTE (Part 16): the spec calls this token --accent, but that exact
     name is already used in several places in the app's own legacy CSS
     (renopilot-core.css, mobile-integration-r97.css) for an OLDER accent
     colour, some of them with !important at higher specificity than a
     plain :root declaration can beat (e.g. body.rp4{--accent:#2563eb
     !important} inside a mobile media query). Redefining --accent here
     got silently overridden by those on mobile widths specifically — a
     real bug caught by testing, not assumed away. Fixed by using the
     app's own --r40-blue token instead (already #0a66ff, already used
     safely everywhere since Part 1, not contested by any !important
     rule anywhere in the app) for every accent-colour fix in this pass,
     rather than defining a new name that collides. --accent is
     deliberately NOT defined here to avoid the same trap catching a
     future fix; use var(--r40-blue,#0a66ff) for the approved accent. */
}

/* =========================================================================
   1. RECORD LISTS — Quotes / Invoices / Estimates / Payments / Expenses /
   Statements / Milestones / Recurring all share one markup system:
   a container with class .billing-card-list holding one <article
   class="billing-doc-card"> per record (icon + title + status pill +
   meta + sub-detail on the left, amount on the right, actions below).
   Confirmed by reading every render function that builds one
   (global-quotes-5.0.74.js, global-invoices-5.1.28.js,
   global-money-hubs-5.0.12.js, information-access-5.0.28.js,
   estimate-register-5.3.16.js, billing-5.1.30.js) — same two classes,
   same structure, everywhere. That makes this the single highest-leverage
   fix in this pass: one generalized rule reaches every record list in
   the app at once, instead of a page-by-page patch.

   Approved spec: "a plain row-card list inside a panel — title, one-line
   sub-detail, right-aligned amount, right-aligned status pill, small
   circular client-initials avatar where there's a client. No
   thumbnail/photo tile of any kind."
   ========================================================================= */

/* The list becomes one panel (white, bordered, shadowed, rounded) instead
   of a stack of separately-floating gradient cards with an 11px gap. */
body .billing-card-list{
  display:flex!important;
  flex-direction:column!important;
  gap:0!important;
  background:#ffffff!important;
  border:1px solid #eeeeef!important;
  border-radius:16px!important;
  box-shadow:0 1px 2px rgba(0,0,0,.03),0 4px 16px rgba(0,0,0,.06)!important;
  padding:2px 20px!important;
  overflow:hidden!important;
}
body .billing-card-list:empty{display:none!important}

/* Each record becomes a plain row with a hairline divider, not its own
   card — no border, no per-row shadow, no gradient background, no
   hover-lift transform (that "floating card" motion is part of the
   look being replaced). */
body .billing-doc-card{
  border:0!important;
  border-bottom:1px solid #eeeeef!important;
  border-radius:0!important;
  background:#ffffff!important;
  box-shadow:none!important;
  transform:none!important;
  padding:16px 2px!important;
  margin:0!important;
}
body .billing-doc-card:last-child{border-bottom:0!important}
body .billing-doc-card:hover{
  background:#fafafa!important;
  transform:none!important;
  box-shadow:none!important;
}
/* Overdue is still shown, honestly — a thin red edge instead of a peach
   gradient wash across the whole row. */
body .billing-doc-card.overdue-card{
  background:#ffffff!important;
  border-left:3px solid #e0453a!important;
  padding-left:15px!important;
}

/* Icon → small circular avatar-shaped tile instead of a 14px-radius
   "squircle". Colour meaning already flattened in Part 2 (blue for
   most types, green for payments received) is kept — only the shape and
   the drop-shadow under it are changed, so this still reads as "no
   thumbnail/photo tile of any kind": a plain small circle, exactly like
   the client-initials avatar used elsewhere in the app. */
body .billing-doc-icon{
  width:36px!important;
  height:36px!important;
  border-radius:50%!important;
  box-shadow:none!important;
  font-size:13px!important;
}

/* Status pill: pushed to the right edge of the row's text column (the
   amount itself lives in its own right-aligned column further right —
   see .billing-doc-value below, already right-aligned). This keeps the
   title on the left and the status visually on the right of that line. */
body .billing-doc-title{justify-content:space-between!important}
body .billing-doc-title .billing-status{margin-left:auto!important}
body .billing-doc-title .billing-status+.global-quote-kind{margin-left:6px!important}

/* Amount column already right-aligned by the existing .billing-doc-value
   rule — just make the number read with the same monospace weight used
   for money everywhere else in the approved spec. */
body .billing-doc-value b{
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace!important;
  font-weight:700!important;
  font-size:16px!important;
  color:#0a0a0c!important;
}

/* Row action buttons: plain, flat, pill-shaped, matching the approved
   secondary-button look instead of the rounded-square outline set. */
body .billing-doc-actions button{
  border-radius:999px!important;
  border-color:#e4e4e7!important;
}
body .billing-doc-actions button.primary{
  background:#0a0a0c!important;
  border-color:#0a0a0c!important;
  box-shadow:none!important;
}
body .billing-doc-actions button:hover{
  background:#f2f2f4!important;
  border-color:#d8d8db!important;
  color:#0a0a0c!important;
}

/* Empty-state icon (the big letter-in-a-tile shown when a list has no
   rows): flattened + circular, matching the row icons above rather than
   its own separate purple gradient tile. */
body .billing-empty{border-radius:16px!important;background:#fafafa!important}
body .billing-empty>span{
  border-radius:50%!important;
  background:#eaf1ff!important;
  color:#0a66ff!important;
  box-shadow:none!important;
}

/* Client-initials avatar variant. assets/record-list-restyle-2026-09-20.js
   adds this class to a row's icon when it can safely read a real client
   name from that row's own text (never fabricated) — plain grey, per the
   approved "plain grey avatar" rule (a person's initials aren't a status,
   so they don't get the accent colour the document-type icons use). */
body .billing-doc-icon.rp-client-avatar-icon{
  background:#e4e4e7!important;
  color:#3a3a3c!important;
}

/* Same row-list treatment for the Clients list and the Communications/
   Inbox list, which use their own (already fairly close) markup —
   .rp-client-row / .rp-inbox-row. Only the avatar shape and the icon
   colours (Part 2) needed finishing to match: circular, not a rounded
   square. */
body .rp-client-avatar{border-radius:50%!important}
body .comm-client-avatar{
  border-radius:50%!important;
  box-shadow:none!important;
}

/* =========================================================================
   2. JOB DETAIL — the "Job position" panel's money row (.rf-clear-money,
   built by workflow-5.2.25.js's renderJobHome() from real job data:
   quoted/collected/costs+committed/outstanding) becomes the same quiet,
   bordered/shadowed, hairline-divided numbers strip as the Home
   dashboard's KPI row, instead of four separate light-grey mini-tiles.
   No JS change — same real numbers, restyled only.
   ========================================================================= */
body .rf-clear-money{
  display:flex!important;
  grid-template-columns:none!important;
  gap:0!important;
  background:#ffffff!important;
  border:1px solid #eeeeef!important;
  border-radius:16px!important;
  box-shadow:0 1px 2px rgba(0,0,0,.03),0 4px 16px rgba(0,0,0,.06)!important;
  overflow:hidden!important;
  margin-top:2px!important;
}
body .rf-clear-money>div{
  flex:1 1 0!important;
  background:transparent!important;
  border-radius:0!important;
  padding:16px 16px!important;
}
body .rf-clear-money>div+div{border-left:1px solid #eeeeef!important}
body .rf-clear-money span{
  font-size:11px!important;
  color:#6e6e73!important;
  font-weight:600!important;
  text-transform:none!important;
  letter-spacing:0!important;
}
body .rf-clear-money b{
  margin-top:5px!important;
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace!important;
  font-size:19px!important;
  font-weight:700!important;
  letter-spacing:-.01em!important;
  color:#0a0a0c!important;
}
@media (max-width:760px){
  body .rf-clear-money{flex-wrap:wrap!important}
  body .rf-clear-money>div{flex:1 1 50%!important}
  body .rf-clear-money>div:nth-child(3),body .rf-clear-money>div:nth-child(4){
    border-top:1px solid #eeeeef!important;
  }
  body .rf-clear-money>div:nth-child(2n+1){border-left:0!important}
}

/* =========================================================================
   3. REPORTS PAGE — #repSummary is already a real, live 5-number metrics
   row (Estimated total / Invoiced / Paid / Outstanding / Budget used,
   built by app-5.2.31.js from the same cost-log data as the tables below
   it). Restyled into the same quiet numbers-strip bar. The "Spend by
   category" table already IS a real per-category profit/estimate-vs-
   actual table — restyled to match the approved plain hairline-row look
   (no zebra, monospace numbers) rather than being duplicated, since the
   approved spec's "small profit table" is exactly what that table
   already is once restyled. The bar chart and ring are genuinely new —
   see assets/reports-restyle-2026-09-20.js, styled below.
   ========================================================================= */
body #repSummary{
  display:flex!important;
  background:#ffffff!important;
  border:1px solid #eeeeef!important;
  border-radius:16px!important;
  box-shadow:0 1px 2px rgba(0,0,0,.03),0 4px 16px rgba(0,0,0,.06)!important;
  overflow:hidden!important;
  gap:0!important;
  flex-wrap:wrap!important;
}
body #repSummary .metric{
  flex:1 1 0!important;
  min-width:130px!important;
  background:transparent!important;
  border:0!important;
  border-left:1px solid #eeeeef!important;
  border-radius:0!important;
  box-shadow:none!important;
  padding:16px!important;
}
body #repSummary .metric:first-child{border-left:0!important}
body #repSummary .metric span{font-size:11px!important;color:#6e6e73!important;font-weight:600!important}
body #repSummary .metric b{
  margin-top:5px!important;
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace!important;
  font-size:19px!important;
  letter-spacing:-.01em!important;
}
@media (max-width:760px){
  body #repSummary{flex-wrap:wrap!important}
  body #repSummary .metric{flex:1 1 50%!important;border-left:0!important}
  body #repSummary .metric:nth-child(2n){border-left:1px solid #eeeeef!important}
  body #repSummary .metric:nth-child(n+3){border-top:1px solid #eeeeef!important}
}

/* Category / profit table: plain hairline rows, monospace numbers,
   no zebra striping (Part 2 already removed zebra app-wide; this adds
   the monospace number treatment specific to this table). */
body #page-reports table td.num,body #page-reports table th.num{
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace!important;
}

/* New panels added by assets/reports-restyle-2026-09-20.js: a bar chart
   ("Costs logged by month") and a single-colour ring ("Budget used"),
   same restrained visual language as the Home dashboard's insights row —
   plain white panel, one accent colour, no gradients, no per-bar hues. */
body .rp-reports-insights{
  display:grid;
  grid-template-columns:1.4fr 1fr;
  gap:16px;
  margin:16px 0;
}
@media (max-width:900px){
  body .rp-reports-insights{grid-template-columns:1fr}
}
body .rp-reports-chart-card,body .rp-reports-ring-card{
  background:#ffffff;
  border:1px solid #eeeeef;
  border-radius:16px;
  box-shadow:0 1px 2px rgba(0,0,0,.03),0 4px 16px rgba(0,0,0,.06);
  padding:18px;
}
body .rp-reports-chart-card h2,body .rp-reports-ring-card h2{
  margin:0 0 14px;
  font-size:16px;
  font-weight:650;
  color:#1d1d1f;
}
body .rp-reports-chart-card p,body .rp-reports-ring-card p{
  margin:0 0 14px;
  font-size:12px;
  color:#8e8e93;
}
body .rp-reports-bar-row{
  display:grid;
  grid-template-columns:70px 1fr 74px;
  align-items:center;
  gap:10px;
  padding:6px 0;
}
body .rp-reports-bar-row span:first-child{font-size:12px;color:#6e6e73}
body .rp-reports-bar-track{
  height:10px;
  border-radius:999px;
  background:#f2f2f4;
  overflow:hidden;
}
body .rp-reports-bar-fill{
  display:block;
  height:100%;
  border-radius:999px;
  background:#0a66ff;
}
body .rp-reports-bar-row b{
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;
  font-size:12.5px;
  text-align:right;
  color:#0a0a0c;
}
body .rp-reports-ring-card{display:flex;flex-direction:column;align-items:center;text-align:center}
body .rp-reports-ring{
  width:120px;height:120px;border-radius:50%;
  display:grid;place-items:center;margin:4px auto 12px;
}
body .rp-reports-ring-inner{
  width:92px;height:92px;border-radius:50%;background:#fff;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
}
body .rp-reports-ring-inner b{
  font-size:22px;font-weight:700;color:#0a0a0c;letter-spacing:-.02em;
  font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;
}
body .rp-reports-ring-inner small{font-size:11px;color:#8e8e93}
body .rp-reports-empty{padding:20px 0;color:#8e8e93;font-size:13px;text-align:center}

/* =========================================================================
   6. FIX (2026-09-20, reported by you on Clients): the "Clients" header
   text and button sat flush against the edge of its own card.

   Root cause (pre-existing in the app, not introduced by this pass —
   found by checking computed styles, not guessing): the Clients page
   header is .client-first-hero with .rp-client-hero-compact added by
   simplifyClientPage() in information-access-5.0.28.js. renopilot-core.css
   has two rules for this element that conflict on padding — one gives it
   a bordered/shadowed "glass card" look with 22px 24px padding (the
   card look you saw), the other (.rp-client-hero-compact itself) sets
   padding:10px 0 12px, zero horizontal. A single class beats a body
   :where(...) selector on specificity regardless of which is later in
   the file, so the zero-horizontal-padding rule was winning — the card
   background/border stayed, the padding that belongs with it didn't.
   Fixing it here, at higher specificity than either existing rule, so
   neither has to be touched. Scoped only to this one element — grepped
   the app for other "-compact" hero variants and found none, so this
   isn't a wider pattern needing the same fix elsewhere. */
body .client-first-hero.rp-client-hero-compact{
  padding:20px 22px!important;
}

/* =========================================================================
   7. FIX (2026-09-20, reported by you on the Home dashboard with empty
   data): the "No active jobs yet", "No upcoming bookings" and "Activity
   appears as you work" empty-state lines sat flush against the left edge
   of their card, while every other row in the same cards (section
   headings, the job-list header row, KPI numbers) has a clear inset.

   Root cause: `.rp26-empty` — the class app-5.2.31.js uses for all three
   of these empty states — has NO rule anywhere in the app's CSS at all
   (checked every stylesheet; zero matches). `.rp26-card` itself carries
   no horizontal padding by design — each row type inside supplies its
   own (.rp26-section-head and .rp26-job-header both use 17px) — so an
   unstyled `.rp26-empty` div just sits at the card's bare edge. Two of
   the three call sites also hard-code `style="padding:12px 0"` inline
   (zero horizontal), which a plain CSS rule can't override — only
   !important in a stylesheet beats a plain inline style, so this rule
   needs it to reach those two.

   This was there before today's redesign — it only became obvious now
   because a mostly-empty account (the state you're testing in) shows
   these three lines far more often than a populated one would, and the
   cards' borders read more clearly now that they're consistently styled.

   Fix: give `.rp26-empty` the same 17px-ish horizontal inset as its
   sibling rows, once, so all three read consistently — not three
   separate one-off patches. */
body .rp26-empty{
  padding:14px 17px!important;
  color:var(--ink2,#6e6e73)!important;
  font-size:13px!important;
}

/* =========================================================================
   5. MOBILE — the app already has one generic mechanism that turns
   nearly every <table> in the app into a labelled, stacked card list on
   phones (table.rp-mobile-table, built by mobile-integration-r97.js's
   labelMobileTables(), applied to every table except the Design/CAD
   pages, which are excluded on purpose — restyling a CAD drawing table
   into stacked cards would break it). It already avoids the "cramped
   table" problem app-wide; this only brings its existing per-row card
   look in line with the approved radius/shadow tokens instead of its
   own blue-grey border and different radius, and enlarges the page
   title toward the approved "large iOS-style" scale (a full collapsing
   large-title header is a bigger structural change than a CSS-only pass
   should attempt — flagged in the report as a possible JS-level follow-up).
   ========================================================================= */
@media (max-width:760px){
  body.rp4 table.rp-mobile-table tr{
    border:1px solid #eeeeef!important;
    border-radius:16px!important;
    box-shadow:0 1px 2px rgba(0,0,0,.03),0 4px 16px rgba(0,0,0,.06)!important;
    background:#ffffff!important;
  }
  body.rp4 table.rp-mobile-table td::before{
    color:#8e8e93!important;
  }
  body.rp27 .rp26-top-title h2,
  body.rp4 #pageTitle{
    font-size:20px!important;
    font-weight:700!important;
    letter-spacing:-.02em!important;
  }
}

/* =========================================================================
   8. FIX (2026-09-20, reported by you on Home: "what do you see that is
   not consistent here" on the "Progress stages completed this week" /
   "Jobs on track" cards).

   Root cause: every OTHER card on this page keeps its content inset from
   the card's own border — Active jobs' header bar and rows use 17px/14px
   padding of their own (renopilot-core.css .rp26-section-head,
   .rp26-job-row), and the sidebar cards (Quick Add, Scheduler, Recent
   activity) get 18px from `.rp26-rail>.rp26-card{padding:18px}`. But
   `.rp26-card` only ever gets that padding when it's *inside* `.rp26-rail`
   — there is no base padding rule for a plain `.rp26-card` in the main
   column. The two new Part 9 insight cards (.rp-insight-chart,
   .rp-insight-ring, built by dashboard-restyle-2026-09-20.js) are
   `.rp26-card`s in the main column, not the rail, so they inherited zero
   padding; Part 9 only styled their <h2>, never gave the card body an
   inset. Confirmed with Playwright getComputedStyle: both cards computed
   padding:"0px", and the bar chart / heading / ring caption all measured
   within 1px of the card's own border (that 1px is the border itself,
   not padding) — i.e. genuinely flush to the edge, unlike every other
   card on the page.

   Fix: give these two cards the same 18px inset the rail cards already
   use, so all cards on Home read as one consistent system. Scoped to
   exactly these two classes — does not touch .rp26-jobs, .rp26-rail, or
   any other card's padding.

   How tested: Playwright, 390px width, seeded with one job so the row
   renders — before: .rp-insight-chart / .rp-insight-ring computed
   padding "0px", chart/heading/caption within 1px of the card edge.
   After: computed padding "18px" on both, content inset matches Active
   jobs / Quick Add / Scheduler visually and numerically. Screenshotted.

   Files touched: this file only (new rule below).
   To undo: delete this block (section 8).
   ========================================================================= */
body #page-portfolio .rp-insight-chart,
body #page-portfolio .rp-insight-ring{
  padding:18px!important;
}
