/*
 * Elevate UI/UX Financial Number Standard — UI03
 * Functional baseline: R37
 * Builds on UI01 tokens + UI02 typography.
 *
 * SAFETY CONTRACT
 * - Presentation only: numeric glyph alignment and table/input text alignment.
 * - No JavaScript formatting functions, calculations, data sources, schemas,
 *   positive/negative logic, P&L logic, Wealth/FIRE logic or order logic change.
 * - R37's existing number strings (₹ / % / decimals / signs) remain authoritative.
 * - Numeric string normalization is intentionally deferred to module-by-module
 *   migration so this task cannot alter values or business semantics.
 */

/* Use equal-width lining numerals throughout operational financial screens. */
.dashboard-page,
.account-setup-page,
.wealth-manual-page {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Numeric entry is consistently scanned from the right edge. */
.dashboard-page input[type="number"],
.account-setup-page input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Important financial values stay visually stable as digits change. */
.dashboard-page .market-ticker strong,
.dashboard-page #portfolio-summary strong,
.dashboard-page .portfolio-pnl-cluster strong,
.dashboard-page .wizard-metric strong,
.dashboard-page .oi-stat strong,
.dashboard-page .wealth-summary-card strong,
.dashboard-page .wealth-history-kpis strong,
.dashboard-page .wb-r4-kpi-grid strong,
.dashboard-page .wb-sustainability-kpis strong,
.dashboard-page .wb-r6-derived-amount,
.dashboard-page .wb-r6-readonly-pct {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Main Portfolio Analyzer table: labels/actions left, measures right. */
.dashboard-page #portfolio-table-wrap > table.portfolio-table th,
.dashboard-page #portfolio-table-wrap > table.portfolio-table td {
  text-align: right;
}
.dashboard-page #portfolio-table-wrap > table.portfolio-table th:nth-child(1),
.dashboard-page #portfolio-table-wrap > table.portfolio-table td:nth-child(1),
.dashboard-page #portfolio-table-wrap > table.portfolio-table th:nth-child(2),
.dashboard-page #portfolio-table-wrap > table.portfolio-table td:nth-child(2),
.dashboard-page #portfolio-table-wrap > table.portfolio-table th:nth-child(4),
.dashboard-page #portfolio-table-wrap > table.portfolio-table td:nth-child(4) {
  text-align: left;
}

/* Open-leg selector: checkbox centered, symbol left, measures right. */
.dashboard-page table.open-leg-table th,
.dashboard-page table.open-leg-table td {
  text-align: right;
}
.dashboard-page table.open-leg-table th:first-child,
.dashboard-page table.open-leg-table td:first-child {
  text-align: center;
}
.dashboard-page table.open-leg-table th:nth-child(2),
.dashboard-page table.open-leg-table td:nth-child(2) {
  text-align: left;
}

/* OI tables are measure-led; every populated column is numeric. */
.dashboard-page table.oi-table thead th,
.dashboard-page table.oi-table tbody td:not(.hint) {
  text-align: right;
}

/* Moving-average numeric cells already carry .num; make the intent explicit. */
.dashboard-page table.forecast-table td.num,
.dashboard-page table.forecast-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
}

/* Wizard result table: stage/decision labels left, financial measures right. */
.dashboard-page .wizard-table-wrap table th,
.dashboard-page .wizard-table-wrap table td {
  text-align: right;
}
.dashboard-page .wizard-table-wrap table th:first-child,
.dashboard-page .wizard-table-wrap table td:first-child,
.dashboard-page .wizard-table-wrap table th:last-child,
.dashboard-page .wizard-table-wrap table td:last-child {
  text-align: left;
}

/* Wealth Builder financial grids: preserve label column, align all measures. */
.dashboard-page #wealth-builder-view .wb-r4-asset-table th:not(:first-child),
.dashboard-page #wealth-builder-view .wb-r4-asset-table td,
.dashboard-page #wealth-builder-view .wb-r4-expense-table th:not(:first-child),
.dashboard-page #wealth-builder-view .wb-r4-expense-table td,
.dashboard-page #wealth-builder-view .wb-table th:not(:first-child),
.dashboard-page #wealth-builder-view .wb-table td:not(:first-child) {
  text-align: right;
}
.dashboard-page #wealth-builder-view .wb-r4-asset-table th:first-child,
.dashboard-page #wealth-builder-view .wb-r4-expense-table th:first-child,
.dashboard-page #wealth-builder-view .wb-table th:first-child,
.dashboard-page #wealth-builder-view .wb-table td:first-child {
  text-align: left;
}

/* Utilities for later module migrations; inert until explicitly used. */
.elevate-number,
.elevate-money,
.elevate-percent {
  font-variant-numeric: tabular-nums lining-nums;
}
.elevate-number,
.elevate-money,
.elevate-percent {
  text-align: right;
}
