/* ============================================================
   FINANCE DASHBOARD — docs/COMPETITIVE_GAP_PLAN.md 3.1 (gap 6)
   Per-feature CSS file, per D6: uses only existing tokens (var(--…)),
   no literal colours. Gold reserved for the one headline KPI delta only.
   ============================================================ */

.dash-fin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .dash-fin-grid { grid-template-columns: 1fr; }
}

.dash-fin-widget {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.dash-fin-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dash-fin-widget-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--graphite);
}
.dash-fin-widget-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--graphite);
  font-variant-numeric: tabular-nums;
}
.dash-fin-widget-headline .dash-fin-widget-value { color: var(--gold); } /* the single premium moment per screen — the headline KPI only */

.dash-fin-delta { font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: var(--r-pill); white-space: nowrap; }
.dash-fin-delta.good { color: var(--success); background: var(--success-pale); }
.dash-fin-delta.bad  { color: var(--critical); background: var(--critical-pale); }

.dash-fin-chart { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 120px; }
.dash-fin-chart svg { max-width: 100%; height: auto; }

.dash-fin-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
}
.dash-fin-footer a, .dash-fin-open-report {
  color: var(--cobalt);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.dash-fin-footer a:hover, .dash-fin-open-report:hover { text-decoration: underline; }

.dash-fin-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.dash-fin-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.dash-fin-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-soft);
}
.dash-fin-list li:last-child { border-bottom: none; }
.dash-fin-list .num { font-variant-numeric: tabular-nums; }

.dash-fin-period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

/* mizan-charts.js tooltip already uses fixed positioning + its own inline
   styles; nothing feature-specific needed here beyond sizing the host. */

[dir="rtl"] .dash-fin-widget-head { flex-direction: row-reverse; }
[dir="rtl"] .dash-fin-list li { flex-direction: row-reverse; }

@media print {
  .dash-fin-grid { grid-template-columns: 1fr; }
  .dash-fin-widget { break-inside: avoid; }
  .dash-fin-period-row, .dash-fin-open-report { display: none !important; }
}
