/* pnl-grid-core.css — cell visuals for entity-P&L grids (AOP, forecast).
   Unscoped on purpose: these grids are NOT under .pnl-matrix. The amber
   palette + dark overrides mirror pnl-matrix.css so both grids look the same
   in light and dark mode. */

/* Computed / total rows (COGS, GM, SGA, EBIT, EBITDA): a subtle theme-aware
   surface tint instead of Bootstrap's hardcoded-white .table-light. The
   Phoenix token flips automatically in dark mode; the fallback is light-mode. */
.pnl-row-total td     { background: var(--phoenix-body-highlight-bg, #f5f7fa); }

/* Editable cells: faint amber wash + pointer (light mode). */
.pnl-cell-edit        { cursor: pointer; }
.pnl-cell-edit:hover  { background: #fefce8; }

/* Dirty (staged, unsaved) cells: clear amber highlight (light mode). */
.pnl-cell-dirty       { background: #fef3c7 !important; }

/* Dark-mode overrides — amber values lifted from pnl-matrix.css. */
[data-bs-theme="dark"] .pnl-cell-edit:hover { background: #422006; }
[data-bs-theme="dark"] .pnl-cell-dirty {
  background: #4a2f06 !important;
  color: #fde68a !important;
}

/* ───── Project-P&L matrix styling, transferred ──────────────────────────────
   Band-tone palette + monospace/tabular numbers lifted from pnl-matrix.css so
   the entity grids read like the project P&L table.
   Category → matrix band tone:
     AOP      → FINANCE amber   (#fef3c7 / dark #422006)
     Actuals  → ACTUAL  blue    (#dbeafe / dark #1e3a5f)
     Forecast → FORECAST violet (#ede9fe / dark #2e1065)
   ──────────────────────────────────────────────────────────────────────────── */

/* Quarter subtotal columns: the matrix KPI grey, solid + !important so the
   Q1..Q4 rollup columns read as one grey band over any row tint. */
td.pnl-col-quarter, th.pnl-col-quarter { background-color: #e5e7eb !important; }
[data-bs-theme="dark"] td.pnl-col-quarter,
[data-bs-theme="dark"] th.pnl-col-quarter { background-color: #404040 !important; }

/* Row category tints — matrix band-tone backgrounds. After .pnl-row-total so
   bold totals keep their weight but take the category colour. */
.pnl-cat-aop      td { background-color: #fef3c7; }  /* finance amber  */
.pnl-cat-actual   td { background-color: #dbeafe; }  /* actual blue    */
.pnl-cat-forecast td { background-color: #ede9fe; }  /* forecast violet */
[data-bs-theme="dark"] .pnl-cat-aop      td { background-color: #422006; }
[data-bs-theme="dark"] .pnl-cat-actual   td { background-color: #1e3a5f; }
[data-bs-theme="dark"] .pnl-cat-forecast td { background-color: #2e1065; }

/* Band-label tone colour on the row's first cell (the label), like the matrix
   band labels. Numbers keep the default text colour. */
.pnl-cat-aop      td:first-child { color: #854d0e; }
.pnl-cat-actual   td:first-child { color: #1e3a8a; }
.pnl-cat-forecast td:first-child { color: #5b21b6; }
[data-bs-theme="dark"] .pnl-cat-aop      td:first-child { color: #fcd34d; }
[data-bs-theme="dark"] .pnl-cat-actual   td:first-child { color: #93c5fd; }
[data-bs-theme="dark"] .pnl-cat-forecast td:first-child { color: #c4b5fd; }

/* Entity-P&L tables share fixed column widths so the AOP table and every
   account-forecast table align vertically. The actual width + <colgroup> are
   set inline per render (they depend on which quarters are expanded); this
   rule just enforces fixed layout + clean overflow for all of them. */
.pnl-aop-table { table-layout: fixed; font-variant-numeric: tabular-nums; }
/* Match the project P&L matrix's standard density (~12px) — the default table
   font reads too big for a dense financial grid. */
.pnl-aop-table th, .pnl-aop-table td {
  overflow: hidden; text-overflow: ellipsis;
  font-size: 12px; padding-top: 5px; padding-bottom: 5px;
}
/* Monospace, tabular figures on the numeric (right-aligned) cells — the
   matrix's signature accounting look. Labels stay in the sans body font. */
.pnl-aop-table td.text-end, .pnl-aop-table th.text-end, .pnl-aop-table .pnl-cell {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
