/* ============================================================
   Overview — page layout, canvas and surfaces (presentation only; loaded last).
   - Width: the column starts ~24px from the sidebar and keeps a ~24px right gutter at normal desktop sizes; it stops
     growing at 1760px of content on ultrawide screens.
   - Canvas: a pale slate-blue page with a faint navy-to-indigo glow behind the welcome panel (the stars stay inside the
     panel). Information cards are clean white with a hairline border — depth from colour and layout, not shadows.
   - Order is unchanged: welcome → Your next 30 days (full width) → Next actions beside Next expected payment (about 2:1
     on desktop, stacked when narrower) → the rest.
   ============================================================ */

/* ---- canvas ---- */
:root[data-theme="app"] body[data-page="overview"]{
  background:linear-gradient(180deg, #DCE4EF 0%, #E0E7F1 45%, #E4EAF3 100%); background-attachment:fixed; background-color:#DFE6F0;
}
#overviewPage{--ovl-card-line:#D6DEE9; --ovl-gap:18px}
#overviewPage #ovV3{position:relative; isolation:isolate; --ov-row-gap:var(--ovl-gap); row-gap:var(--ovl-gap)}
/* the glow: navy at the welcome panel's left, indigo towards its right, fading out before the forecast */
#overviewPage #ovV3::before{content:''; position:absolute; z-index:-1; pointer-events:none; left:-24px; right:-24px; top:-28px; height:440px;
  background:radial-gradient(55% 75% at 18% 18%, rgba(30,52,110,.16), transparent 70%),
             radial-gradient(45% 70% at 78% 8%, rgba(92,78,200,.15), transparent 72%)}

/* ---- light, readable cards ---- */
:root[data-theme="app"] #overviewPage #ovV3 :is(#ovForecast, #ovNextPay, #ovToday, #ovPlan, .ov-briefing, .ov-grid .ov-card, .ov-mid .ov-card, .ov-mid #ovHealth, .ov-actual, .chc){
  background:#FFFFFF; border:1px solid var(--ovl-card-line); box-shadow:0 1px 2px rgba(20,32,58,.05);
  -webkit-backdrop-filter:none; backdrop-filter:none}
:root[data-theme="app"] #overviewPage #ovV3 .ov-briefing{border-radius:18px; padding:16px 18px 14px}
#overviewPage .fp-fig{background:#F7F9FC}
:root[data-theme="app"] #overviewPage #ovV3 :is(#ovToday, #ovPlan).ov-card{padding:16px 18px}
#overviewPage #ovV3 :is(#ovToday, #ovPlan, #ovNextPay) .mp-head{margin-bottom:10px}

/* ---- tighter vertical rhythm (text and tap targets unchanged) ---- */
#overviewPage #ovForecast.ov-card, #overviewPage .ov-top, #overviewPage #ovNextPay.ov-card, #overviewPage #ovToday.ov-card, #overviewPage #ovPlan.ov-card{margin-top:0}
#overviewPage #ovV3 > .ov-sec{margin:6px 0 -6px}

/* ---- Next actions + Next expected payment ---- */
#overviewPage .ov-pair{display:flex; flex-direction:column; gap:var(--ovl-gap)}
#overviewPage .ov-pair > .ov-top{display:block}
@media (min-width:1280px){
  /* side by side, about 2:1, tops aligned; each panel keeps its own height (no forced blank space) */
  #overviewPage .ov-pair:has(> #ovNextPay:not([style*="none"])){display:grid; grid-template-columns:minmax(0, 2fr) minmax(300px, 1fr); align-items:start}
  #overviewPage .ov-pair #ovNextPay .fp-next{flex-wrap:wrap; row-gap:6px}
  /* compact stacked rows: one action per row, its buttons on the right — an odd number never leaves an empty slot */
  #overviewPage .ov-pair .brf{display:flex; flex-direction:column}
  #overviewPage .ov-pair .brf-i{padding:12px 0; border-top:1px solid var(--line-soft)}
  #overviewPage .ov-pair .brf-i:first-child{border-top:none; padding-top:4px}
  #overviewPage .ov-pair .brf-b{display:grid; grid-template-columns:minmax(0, 1fr) auto; column-gap:20px; align-items:center}
  #overviewPage .ov-pair .brf-b > p{grid-column:1}
  #overviewPage .ov-pair .brf-b > .brf-a{grid-column:2; grid-row:1 / span 4; margin-top:0; flex-direction:column; align-items:flex-end; gap:4px}
}
/* stacked (tablets, phones, narrow windows): Next actions stays a single list of rows */
@media (max-width:1279px){
  #overviewPage .ov-pair .brf{display:flex; flex-direction:column}
  #overviewPage .ov-pair .brf-i{padding:12px 0; border-top:1px solid var(--line-soft)}
  #overviewPage .ov-pair .brf-i:first-child{border-top:none; padding-top:4px}
}

/* ---- width and gutters ---- */
@media (min-width:900px){
  :root[data-theme="app"] #overviewPage.overview-page{max-width:calc(1760px + 48px); margin-left:0; margin-right:auto; padding-left:24px; padding-right:24px; padding-top:24px}
  :root[data-theme="app"] body.on-overview #overviewPage .ovh{padding-right:0}
}

/* ---- phones ---- */
@media (max-width:899px){
  #overviewPage{--ovl-gap:14px}
  #overviewPage #ovV3::before{left:-16px; right:-16px; top:-20px; height:320px}
  :root[data-theme="app"] #overviewPage #ovV3 .ov-briefing{padding:16px 16px 12px}
}
