/* ---- Dashboard components ------------------------------------------
   Tables, stats, facts and chart marks. Colours resolve through --sm-* tokens (theme.css; index.html
   overrides them per theme). Numeric cells use --sm-face-num, a face with tabular figures, so decimal
   columns align. ------------------------------------------------------ */

:root {
  /* --- faces. Numeric content MUST use --sm-face-num (see tnum note). --- */
  --sm-face-label: var(--cond);
  --sm-face-body:  var(--sans);
  --sm-face-num:   var(--f-figure);

  /* --- measured sizes (see header) --- */
  --sm-fs-label: 10.7px;
  --sm-fs-cell:  11.3px;
  --sm-fs-body:  12px;
  --sm-fs-stat:  24.7px;
  --sm-fs-micro: 8.7px;

  --sm-tr-label: .12em;

  /* --- component roles. Retune these per scope, never the rules below. --- */
  --sm-rule:          var(--sm-band);
  --sm-rule-strong:   var(--sm-navy);
  --sm-band:          var(--sm-page-tint);
  --sm-label-ink:     var(--sm-warm-grey);
  --sm-value-ink:     var(--sm-navy-near-black);
  --sm-head-bg:       var(--sm-page-tint);
  --sm-head-ink:      var(--sm-warm-grey);
  --sm-emphasis:      var(--sm-orange);

  --sm-row-pad-y: 5.2px;
  --sm-cell-pad-x: 8px;
}

/* ============================================================
   TableFacts — label/value pairs.
   Property facts, summary fields, KEY DETAILS. Not a matrix:
   for anything with periods or multiple value columns use
   TableFinancial instead.
   ============================================================ */

.sm-facts {
  display: grid;
  grid-template-columns: repeat(var(--sm-facts-cols, 1), minmax(0, 1fr));
  gap: 0 30px;
}

/* Navy header band spanning every column. Property facts only; financial
   tables never take a header fill. */
.sm-facts__head {
  grid-column: 1 / -1;
  background: var(--sm-navy);
  color: var(--sm-white);
  font-family:var(--cond-bold-family);
  font-weight:var(--cond-bold-weight);
  font-size: var(--sm-fs-label);
  letter-spacing: var(--sm-tr-label);
  text-transform: uppercase;
  padding: var(--sm-row-pad-y) var(--sm-cell-pad-x);
}

.sm-facts__label, .sm-facts__value { margin: 0 }

.sm-facts__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: var(--sm-row-pad-y) 0;
  border-bottom: 1px solid var(--sm-rule);
}

/* Last row in each column loses its rule. :last-child alone is wrong in a
   multi-column grid -- it only clears the final cell of the final column. */
.sm-facts--flush .sm-facts__row:last-child { border-bottom: 0 }

.sm-facts__label {
  font-family:var(--cond-medium-family);
  font-weight:var(--cond-medium-weight);
  font-size: var(--sm-fs-label);
  letter-spacing: var(--sm-tr-label);
  text-transform: uppercase;
  color: var(--sm-label-ink);
  white-space: nowrap;
}

.sm-facts__value {
  font-family:var(--figure-bold-family);
  font-weight:var(--figure-bold-weight);
  font-size: var(--sm-fs-cell);
  color: var(--sm-value-ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   TableFinancial — the matrix. Proformas, rent rolls, comps.
   A real <table> so a row is one element: it can carry a
   background and a rule, and fill_deal.py can clone it.
   ============================================================ */

.sm-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family:var(--figure-bold-family);font-weight:var(--figure-bold-weight);
  font-size: var(--sm-fs-cell);
  color: var(--sm-value-ink);
  font-variant-numeric: tabular-nums;
}

.sm-table th,
.sm-table td {
  padding: var(--sm-row-pad-y) var(--sm-cell-pad-x);
  border-bottom: 1px solid var(--sm-rule);
  vertical-align: baseline;
  overflow-wrap: break-word;
}

/* No vertical rules, ever. See the taxonomy note in the header. */
.sm-table th:first-child,
.sm-table td:first-child { padding-left: 0 }
.sm-table th:last-child,
.sm-table td:last-child  { padding-right: 0 }

.sm-table thead th {
  font-family:var(--cond-bold-family);
  font-weight:var(--cond-bold-weight);
  font-size: var(--sm-fs-label);
  letter-spacing: var(--sm-tr-label);
  text-transform: uppercase;
  text-align: left;
  background: none;
  color: var(--sm-navy);
  border-bottom: 1px solid var(--sm-rule);
}

/* The label column reads as text; every other column is a figure. */
.sm-table__col--num,
.sm-table th.sm-table__col--num { text-align: right }

/* --- variant: emphasis. Retired 2026-09-24: financial tables never take a
   header fill. The class is kept so existing markup does not break. --- */

/* --- banding. Retired 2026-09-24: rows are never shaded. Class kept so
   existing markup does not break. --- */

/* --- summary rows --- */
.sm-table__row--subtotal td {
  font-family:var(--figure-bold-family);font-weight:var(--figure-bold-weight);
  border-top: 1px solid var(--sm-rule);
}

.sm-table__row--total td {
  font-family:var(--figure-bold-family);font-weight:var(--figure-bold-weight);
  color: var(--sm-navy);
  border-top: 1.5px solid var(--sm-rule-strong);
  border-bottom: 0;
}

/* A row the template repeats. Kept visible in the blank template on purpose:
   verify.py checks 6 and 7 need live, extractable text on every page. */
.sm-table__row--proto { }

/* ============================================================
   StatBlock — the data callout.
   One figure, one label, an optional caption. Use for the
   number a page is arguing; do not build a grid of six.
   ============================================================ */

.sm-stats {
  display: grid;
  grid-template-columns: repeat(var(--sm-stats-cols, 3), minmax(0, 1fr));
  gap: 18px;
}

.sm-stat__label {
  font-family:var(--cond-medium-family);
  font-weight:var(--cond-medium-weight);
  font-size: var(--sm-fs-label);
  letter-spacing: var(--sm-tr-label);
  text-transform: uppercase;
  color: var(--sm-navy);
  margin-bottom: 6px;
}

.sm-stat__value {
  font-family:var(--sans-medium-family);
  font-weight:var(--sans-medium-weight);
  font-size: var(--sm-fs-stat);
  line-height: 1.05;
  color: var(--sm-navy);
  font-variant-numeric: tabular-nums;
}

/* The one figure being argued for. Once per page, like the chart rule. */
.sm-stat--emphasis .sm-stat__value { color: var(--sm-emphasis) }

.sm-stat__caption {
  font-family:var(--sans-regular-family);font-weight:var(--sans-regular-weight);
  font-size: var(--sm-fs-micro);
  line-height: 1.3;
  color: var(--sm-label-ink);
  margin-top: 4px;
}

/* On a navy panel. */
.sm-stat--on-dark .sm-stat__label,
.sm-stat--on-dark .sm-stat__value { color: var(--sm-white) }
.sm-stat--on-dark .sm-stat__caption { color: var(--sm-taupe) }

/* A tinted tray behind a stat row, as the comps summary uses. */
.sm-stats--tray {
  background: var(--sm-band);
  padding: 16px 20px;
  box-sizing: border-box;
}

/* ============================================================
   Charts — shared furniture.
   Geometry is per-chart; these are the parts every chart shares
   so a waterfall and a valuation summary cannot disagree.

   The palette rule is brand-colors.css's own: step through the
   navy ramp for 4+ categories before ever adding a hue, and let
   orange mark the one series being argued for, once per chart.
   ============================================================ */

.sm-chart {
  font-family:var(--figure-bold-family);font-weight:var(--figure-bold-weight);
  font-size: var(--sm-fs-label);
  color: var(--sm-value-ink);
  font-variant-numeric: tabular-nums;
}

.sm-chart__axis { stroke: var(--sm-chart-axis); stroke-width: 1 }
.sm-chart__reference { stroke: var(--sm-chart-reference); stroke-dasharray: 3 3 }
.sm-chart__leader { stroke: var(--sm-chart-leader); stroke-width: 1 }

.sm-chart__label {
  font-family:var(--cond-regular-family);font-weight:var(--cond-regular-weight);
  font-size: var(--sm-fs-label);
  letter-spacing: var(--sm-tr-label);
  text-transform: uppercase;
  fill: var(--sm-label-ink);
}

.sm-chart__value {
  font-family:var(--figure-bold-family);
  font-size: var(--sm-fs-cell);
  font-weight:var(--figure-bold-weight);
  fill: var(--sm-value-ink);
  font-variant-numeric: tabular-nums;
}

/* Series fills. Bars step through the ramp; --emphasis is spent once. */
.sm-chart__bar          { fill: var(--sm-chart-series-1) }
.sm-chart__bar--2       { fill: var(--sm-chart-series-2) }
.sm-chart__bar--3       { fill: var(--sm-chart-series-3) }
.sm-chart__bar--emphasis{ fill: var(--sm-chart-emphasis) }

/* Waterfall: a bar that subtracts reads muted, not red. This book does not
   use red -- the palette has no negative colour and inventing one would be
   the first hue added outside the ramp. */
.sm-chart__bar--decrease { fill: var(--sm-chart-navy-200) }
.sm-chart__connector     { stroke: var(--sm-chart-leader); stroke-width: 1; stroke-dasharray: 2 2 }
