/* The RBI payment trackers (cards-and-cash, payment-modes, payment-fraud-and-acceptance). Loaded after upi-tracker.css, on those three pages only.
   Calm and data-first: the trend chart leads, then the month's mix and the growth league, then the full table. Theme tokens only, so light and dark both work. */

/* the RBI payment trackers (assets/js/rbi-tracker.js): a 7-column table with group header rows and indented sub-lines */
.rt-table { min-width: 780px; }
.rt-table col.c-plot { width: 58px; } .rt-table col.c-val { width: 170px; } .rt-table col.c-tkt { width: 96px; }
.rt-table td.app b { max-width: 100%; }
.rt-table tr.grp td { height: 38px; padding: 14px 6px 6px; background: var(--surface); border-bottom: 1px solid var(--border); color: var(--text); font-size: .8rem; }
.rt-table tr.grp b { font-weight: 700; } .rt-table tr.grp span { margin-left: 8px; font-size: .72rem; color: var(--text-light); font-weight: 500; }
.rt-table tbody tr.grp:hover td { background: var(--surface); }
.rt-table tr.sub td.app b { font-weight: 500; color: var(--text-secondary); padding-left: 14px; }

/* KPI cards: change as soft pills, a filled sparkline */
.rt .dl { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 600; font-size: .78rem; line-height: 1.6; }
.rt .dl.up { background: rgba(4, 120, 87, .1); } .rt .dl.down { background: rgba(185, 28, 28, .1); } .rt .dl.nil { background: transparent; }
html[data-theme="dark"] .rt .dl.up { background: rgba(52, 211, 153, .14); } html[data-theme="dark"] .rt .dl.down { background: rgba(248, 113, 113, .14); }
.rt .up-table .dl, .rt .up-kd .dl { white-space: nowrap; }
.rt .up-kd { display: grid; grid-template-columns: max-content 1fr; align-items: center; justify-items: start; gap: 5px 8px; margin-top: 10px; } .rt .up-kd small { margin: 0; }
.rt .up-kv { font-size: 1.6rem; }
.rt .up-ks .spk { stroke-width: 2; } .spk path.sa { fill: var(--primary); fill-opacity: .1; stroke: none; }
.rt .up-kpi { transition: border-color .15s; } .rt .up-kpi:hover { border-color: var(--primary); }

/* the trend chart leads the page */
.rt .up-chartcard { padding: 18px 20px 14px; }
.rt .up-chead .up-kl { font-size: .8rem; }
.up-views { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0 12px; }
.up-vl { margin-right: 4px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-light); }
.up-views button { padding: 6px 13px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-secondary); font: inherit; font-size: .84rem; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.up-views button:hover { border-color: var(--primary); color: var(--primary); }
.up-views button[aria-pressed="true"] { border-color: var(--primary); background: rgba(37, 99, 235, .09); color: var(--primary); font-weight: 600; }
html[data-theme="dark"] .up-views button[aria-pressed="true"] { background: rgba(96, 165, 250, .16); }
.up-views button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.rt .up-plotted { margin: 0 0 6px; min-height: 28px; }
.rt .up-note { min-height: 0; margin: 2px 0 0; } .rt .up-note:empty { display: none; }
.rt .up-chart { margin-top: 10px; } .rt .up-chart .grid { stroke-opacity: .75; } .rt .up-chart .axt { font-weight: 600; letter-spacing: .01em; }
.rt .up-chart .zero { stroke: var(--text-light); stroke-width: 1; }
.rt .up-chart .dot.hv { stroke-width: 2.5; } .rt .up-chart .band { transition: opacity .15s; } .rt .up-chart .band:hover { opacity: .8; }
.rt .up-chart .endl { font-size: 11.5px; }
#rt-chart-top { scroll-margin-top: 130px; }

/* two panels: this month's mix and what stands out (left), the growth league (right) */
.rt-row { align-items: stretch; }
.rt-col { display: grid; gap: var(--up-gap); align-content: start; min-width: 0; }
.rt-mlbl { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--bg-gray); border: 1px solid var(--border); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
.mx-bar { display: flex; height: 16px; gap: 2px; border-radius: 8px; overflow: hidden; background: var(--bg-gray); margin: 8px 0 14px; }
.mx-bar i { display: block; height: 100%; min-width: 2px; }
.mx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.mx-list li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; font-size: .88rem; color: var(--text-secondary); }
.mx-list .sw { width: 10px; height: 10px; border-radius: 3px; display: block; }
.mx-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-list b { color: var(--text-primary); font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.mx-list .dl { min-width: 92px; text-align: center; }

.gl { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 7px; }
.gl li { display: grid; grid-template-columns: minmax(100px, 200px) minmax(0, 1fr) 64px; align-items: center; gap: 12px; font-size: .84rem; color: var(--text-secondary); }
.gl-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-t { position: relative; height: 16px; }
.gl-t::before { content: ""; position: absolute; left: var(--z, 0%); top: -3px; bottom: -3px; width: 1px; background: var(--border); }
.gl { --z: 0%; } .gl-t i { position: absolute; top: 3px; height: 10px; border-radius: 5px; }
.gl-t i.pos { background: var(--up-pos); opacity: .75; } .gl-t i.neg { background: var(--up-neg); opacity: .8; }
.gl b { text-align: right; font-variant-numeric: tabular-nums; } .gl b.pos { color: var(--up-pos); } .gl b.neg { color: var(--up-neg); }
.up-leaguecard .up-note, .up-mixcard .up-note { margin-top: 14px; }
.rt .up-insights li { font-size: .9rem; }

/* table: the share column carries a small bar */
.rt-table td.sh { white-space: nowrap; }
.shb { display: inline-block; width: 34px; height: 5px; margin-right: 8px; border-radius: 3px; background: var(--bg-gray); overflow: hidden; vertical-align: middle; }
.shb i { display: block; height: 100%; border-radius: 3px; background: var(--primary); opacity: .6; }
.rt .up-explore { padding-top: 20px; }

/* phones: headline numbers, the chart, the month's mix, then the detailed table */
@media (max-width: 760px) {
  .pt-tool.up.rt > .up-top { order: 0; } .pt-tool.up.rt > .up-bar { order: 1; } .pt-tool.up.rt > .up-kpis { order: 2; } .pt-tool.up.rt > .up-chartcard { order: 3; }
  .pt-tool.up.rt > .up-row2 { order: 4; } .pt-tool.up.rt > .up-explore { order: 5; } .pt-tool.up.rt > .up-src { order: 6; }
}
@media (max-width: 600px) {
  .rt .up-chartcard { padding: 14px; }
  .up-views { flex-wrap: nowrap; overflow-x: auto; margin-right: -14px; padding-right: 14px; scrollbar-width: none; } .up-views::-webkit-scrollbar { display: none; } .up-views button { flex: none; } .up-vl { flex: none; }
  .gl li { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 58px; gap: 8px; }
  .mx-list li { grid-template-columns: 10px minmax(0, 1fr) auto; } .mx-list .dl { display: none; }
}

/* many indicator groups (Payment Modes has nine) must scroll inside their switch, never widen the page */
.up-tools-l, .up-tools-r { min-width: 0; } .up-tools-r { max-width: 100%; } .up-tools-r .up-seg { min-width: 0; max-width: 100%; }
@media (max-width: 1100px) { .up-tools { display: block; } .up-tools-l { margin-bottom: 12px; } .up-tools-r { width: 100%; } .up-tools-r .up-seg { flex: 1 1 100%; } .up-search { flex: 1; } .up-search input { width: 100%; } }
.rt-table col.c-share { width: 108px; } .shb { width: 30px; }
