.fd-page { min-width: 0; color: #172033; }
.fd-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dce3eb;
}
.fd-toolbar label { display: grid; gap: 4px; color: #667085; font-size: 11px; }
.fd-toolbar [hidden] { display: none !important; }
.fd-toolbar input {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  box-sizing: border-box;
}
.fd-periods {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid #d8e0e9;
  border-radius: 7px;
  background: #f4f6f8;
}
.fd-periods button {
  min-width: 54px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #667085;
  font-weight: 700;
  cursor: pointer;
}
.fd-periods button.active { background: #fff; color: #172033; box-shadow: 0 1px 3px rgba(23, 32, 51, .12); }
.fd-range { margin-left: auto; color: #667085; font-size: 12px; }
.fd-loading { padding: 44px 12px; text-align: center; color: #667085; }
.fd-error { color: #b42318; }
.fd-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.fd-metric {
  min-width: 0;
  min-height: 88px;
  padding: 12px;
  border: 1px solid #dce3eb;
  border-left: 3px solid #667085;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}
.fd-metric-income, .fd-metric-cpa { border-left-color: #15803d; }
.fd-metric-cps { border-left-color: #2563eb; }
.fd-metric-failed { border-left-color: #dc2626; }
.fd-metric-expense, .fd-metric-labor { border-left-color: #d97706; }
.fd-metric-fixed { border-left-color: #475569; }
.fd-metric-other { border-left-color: #7c3aed; }
.fd-metric span, .fd-metric small { display: block; color: #667085; font-size: 11px; }
.fd-metric strong { display: block; margin: 7px 0 5px; font-size: 19px; overflow-wrap: anywhere; }
.fd-formula {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 3px solid #2563eb;
  background: #f5f8fc;
  color: #344054;
  line-height: 1.55;
}
.fd-formula strong { color: #172033; }
.fd-formula small { grid-column: 2; color: #667085; }
.fd-formula .fd-warning { color: #b54708; }
.fd-section { margin-top: 22px; padding-top: 16px; border-top: 1px solid #dce3eb; }
.fd-section-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.fd-section-head h3 { margin: 0; color: #172033; font-size: 15px; }
.fd-section-head p { margin: 4px 0 0; color: #667085; font-size: 11px; }
.fd-table-wrap { max-height: 440px; overflow: auto; border: 1px solid #dce3eb; border-radius: 6px; }
.fd-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12px; }
.fd-table th, .fd-table td { padding: 9px 10px; border-bottom: 1px solid #edf0f3; text-align: right; white-space: nowrap; }
.fd-table th { position: sticky; top: 0; z-index: 1; background: #f5f7f9; color: #475467; font-weight: 700; }
.fd-table th:first-child, .fd-table td:first-child { text-align: left; }
.fd-table tbody tr:hover td { background: #f8fafc; }
.fd-table td small { display: block; margin-top: 2px; color: #98a2b3; font-size: 10px; }
.fd-empty-cell { padding: 28px !important; color: #667085; text-align: center !important; }
.fd-failed { color: #b42318; font-weight: 700; }
.fd-positive { color: #067647; font-weight: 700; }
.fd-negative { color: #b42318; font-weight: 700; }
.fd-rank { display: inline-grid; min-width: 25px; height: 25px; place-items: center; border-radius: 5px; background: #eef2f6; color: #344054; font-weight: 700; }

@media (max-width: 1180px) {
  .fd-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .fd-toolbar { align-items: stretch; }
  .fd-periods { width: 100%; box-sizing: border-box; }
  .fd-periods button { flex: 1; }
  .fd-toolbar label { flex: 1; }
  .fd-toolbar input { width: 100%; }
  .fd-range { width: 100%; margin-left: 0; }
  .fd-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fd-formula { grid-template-columns: 1fr; }
  .fd-formula small { grid-column: auto; }
}
