/* stockroom -- Reports (#/reports) and the expense sheet (.sh-expense).
   Scoped under .view-reports or the sheet's own body class. */

/* range chips + custom dates + the span caption */
.view-reports .rp-bar { margin-top: 2px; }
.view-reports .rp-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.view-reports .rp-date { display: grid; gap: 5px; min-width: 0; }
.view-reports .rp-date > span { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.view-reports .rp-date .input { height: 44px; padding: 0 10px; min-width: 0; }
.view-reports .rp-caption { margin: 10px 4px 0; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }

/* phone: one column in spec order; desktop: two columns */
.view-reports .rp-grid { display: flex; flex-direction: column; }
.view-reports .rp-col { display: contents; }
.view-reports .rp-o1 { order: 1; margin-top: 12px; }
.view-reports .rp-o2 { order: 2; }
.view-reports .rp-o3 { order: 3; }
.view-reports .rp-o4 { order: 4; }
.view-reports .rp-o5 { order: 5; }
.view-reports .rp-grid .section { margin-top: 24px; }
@media (min-width: 900px) {
  .view-reports .rp-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .view-reports .rp-col { display: block; }
  .view-reports .rp-col > :first-child { margin-top: 14px; }
}

.view-reports .rp-meta { font: 600 13.5px/1 var(--f-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.view-reports .sec-head .btn.sm { height: 32px; margin: -6px 0; }

/* hero: net profit, margin ring, one stacked bar */
.view-reports .rp-hero-top { display: flex; align-items: center; gap: 14px; }
.view-reports .rp-k { font-size: 13px; font-weight: 600; color: var(--muted); }
.view-reports .rp-hero .big-num { margin-top: 6px; }
.view-reports .rp-hero-sub { margin-top: 8px; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-reports .rp-hero-sub b { color: var(--ink); font-weight: 650; }
.view-reports .rp-stack { display: flex; gap: 3px; height: 12px; margin-top: 18px; border-radius: 99px; overflow: hidden; background: var(--paper-2); }
.view-reports .rp-stack > span { display: block; width: 0; transition: width .7s var(--ease); }
.view-reports .s-cogs  { --sw: var(--faint); }
.view-reports .s-costs { --sw: var(--warn-mid); }
.view-reports .s-net   { --sw: var(--ok); }
.view-reports .rp-stack > span { background: var(--sw); }
.view-reports .rp-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.view-reports .rp-legend .lk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted);
                                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-reports .rp-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--sw); flex: none; }
.view-reports .rp-legend .lv { margin-top: 4px; font: 650 15.5px/1.1 var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-reports .rp-legend .lv span { font: 600 12px/1 var(--f-ui); color: var(--muted); }

/* trend chart */
.view-reports .rp-trend { padding: 14px 12px 8px 14px; }
.view-reports .tc-read { padding: 0 2px 6px; min-height: 44px; }
.view-reports .tc-when { font-weight: 650; font-size: 15px; }
.view-reports .tc-vals { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.view-reports .tc-vals > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.view-reports .tc-vals b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.view-reports .tc-vals b.neg { color: var(--bad); }
.view-reports .tc-rev i { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.view-reports .tc-gp i { width: 12px; height: 3px; border-radius: 2px; background: var(--ok); }
.view-reports .tc-box { width: 100%; min-height: 188px; }
.view-reports .tc-svg { display: block; overflow: visible; }
.view-reports .tc-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.view-reports .tc-base { stroke: var(--line-2); stroke-width: 1; }
.view-reports .tc-y, .view-reports .tc-x { fill: var(--faint); font: 500 11px var(--f-ui); font-variant-numeric: tabular-nums; }
.view-reports .tc-x.on { fill: var(--ink); font-weight: 700; }
.view-reports .tc-bar { fill: var(--brand-mid); transition: fill .2s; }
.view-reports .tc-bar.on { fill: var(--brand); }
.view-reports .tc-line { fill: none; stroke: var(--ok); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.view-reports .tc-dot { fill: var(--card); stroke: var(--ok); stroke-width: 2; }
.view-reports .tc-dot.on { fill: var(--ok); stroke: var(--card); stroke-width: 2; }
.view-reports .tc-val { fill: var(--brand-ink); font: 700 12px var(--f-num); font-variant-numeric: tabular-nums;
                        paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.view-reports .tc-hit { fill: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* breakdown: seg + tappable ranked bars with aligned value/meta columns */
.view-reports .rp-break { padding-bottom: 10px; }
.view-reports .rp-break .seg { margin-bottom: 12px; }
.view-reports .hbars { grid-template-columns: minmax(0, 1fr); }   /* kit grid sizes to its longest name otherwise */
.view-reports .rp-cols { display: flex; justify-content: flex-end; gap: 8px; padding: 0 0 2px; font-size: 11px; font-weight: 650;
                         letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.view-reports .rp-cols span:first-child { min-width: 76px; text-align: right; }
.view-reports .rp-cols span:last-child { width: 56px; text-align: right; }
.view-reports .rp-break .hbars { gap: 0; }
.view-reports .rp-break .hbar { padding: 9px 12px 11px; margin: 0 -12px; border-radius: 12px; min-height: 44px; }
.view-reports .rp-break .hbar .top { align-items: center; }
.view-reports .rp-break .hbar .val { min-width: 76px; text-align: right; }
.view-reports .rp-break .hbar .meta { width: 56px; margin-left: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.view-reports .rp-break .hbar .meta.rp-meta-tone { color: var(--t); }
.view-reports .rp-break .hbar.rp-tap { cursor: pointer; transition: background .15s; }
.view-reports .rp-break .hbar.rp-tap:active { background: var(--paper); }
.view-reports .rp-break .hbar .av.sm { width: 26px; height: 26px; font-size: 10.5px; }
.view-reports .rp-more { display: flex; margin: 6px auto 0; }

/* P&L statement */
.view-reports .rp-statement { padding: 4px 16px 14px; }
.view-reports .st-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: baseline; gap: 8px;
                        padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.view-reports .st-row.first { border-top: 0; }
.view-reports .st-op { color: var(--faint); font-weight: 700; text-align: center; }
.view-reports .st-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-reports .st-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.view-reports .st-row.sub { border-top: 0; padding: 0 0 7px; margin-top: -3px; font-size: 13.5px; color: var(--muted); }
.view-reports .st-row.sub .st-l { padding-left: 12px; }
.view-reports .st-row.total { font-weight: 700; }
.view-reports .st-row.total .st-v { font-family: var(--f-num); }
.view-reports .st-row.grand { border-top: 1.5px solid var(--ink-2); font-size: 17px; padding-top: 12px; }
.view-reports .st-row.grand .st-v { font-size: 19px; }
.view-reports .st-aside { display: grid; gap: 6px; margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--line-2);
                          font-size: 13.5px; color: var(--muted); }
.view-reports .st-aside > div { display: flex; justify-content: space-between; gap: 10px; }
.view-reports .st-aside b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }

/* expenses */
.view-reports .rp-cats .hbar .top { align-items: center; }
.view-reports .rp-cats .hbars { gap: 14px; }
.view-reports .rp-cats .bar > .fill { background: var(--warn-mid); }   /* same sand as "Other costs" in the hero */
.view-reports .rp-exp-list { margin-top: 12px; }

/* ------------------------------------------------------- expense sheet -- */
.sh-expense .exp-amt { display: flex; align-items: center; justify-content: center; gap: 2px; height: 88px; margin-top: 4px;
                       border-radius: 18px; background: var(--paper); border: 1.5px solid var(--line); cursor: text;
                       transition: border-color .15s, box-shadow .15s; }
.sh-expense .exp-amt:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-tint); background: var(--card); }
.sh-expense .exp-amt .cur { font: 700 30px/1 var(--f-num); color: var(--faint); }
.sh-expense .exp-amt-in { width: 5.2ch; max-width: 80%; border: 0; outline: none; background: none; padding: 0;
                          font: 700 42px/1 var(--f-num); letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.sh-expense .exp-amt-in::placeholder { color: var(--line-2); }
.sh-expense .exp-amt.need { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-tint); }
.sh-expense .exp-lbl { margin: 18px 2px 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sh-expense .exp-cats.need .chip { border-color: var(--bad-mid); }
.sh-expense .exp-more { display: grid; gap: 10px; }
.sh-expense .exp-clear { width: 38px; padding: 0; justify-content: center; }
.sh-expense .chip .av.sm { width: 24px; height: 24px; font-size: 10px; }
