/* Financial Benchmarks Phase 3B: accessible core dashboard */

.bm3-filter-field {
  display: flex;
  min-width: min(100%, 220px);
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.bm3-filter-field label {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bm3-personalize-action {
  display: flex;
  align-items: flex-end;
}

.bm3-filter-help {
  width: 100%;
  max-width: 760px;
  margin: 4px auto 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  line-height: 1.55;
}

.bm3-dashboard {
  max-width: 1100px;
  margin: 0 auto 32px;
  padding: 0 20px;
}

.bm3-dashboard-head {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(119, 215, 204, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(42, 157, 143, 0.22),
      transparent 36%
    ),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.06),
      rgba(13, 24, 47, 0.74)
    );
  box-shadow: 0 18px 44px rgba(7, 14, 30, 0.2);
}

.bm3-eyebrow {
  margin: 0 0 8px;
  color: #8ce8dd;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bm3-dashboard-head h2 {
  max-width: 780px;
  margin: 0;
  color: #f3f7fb;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  line-height: 1.2;
}

.bm3-dashboard-intro {
  max-width: 800px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.62;
}

.bm3-cohort-status {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(119, 215, 204, 0.26);
  border-left: 4px solid #2a9d8f;
  border-radius: 9px;
  background: rgba(42, 157, 143, 0.09);
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.84rem;
  line-height: 1.55;
}

.bm3-cohort-status[data-state="unavailable"] {
  border-color: rgba(230, 149, 58, 0.38);
  border-left-color: #e6953a;
  background: rgba(230, 149, 58, 0.09);
}

.bm3-cohort-status:focus-visible,
.bm3-table-region:focus-visible {
  outline: 3px solid #8ce8dd;
  outline-offset: 3px;
}

.bm3-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bm3-module-grid[hidden] {
  display: none !important;
}

.bm3-module {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 14px 34px rgba(7, 14, 30, 0.16);
}

.bm3-module[data-state="matched"],
.bm3-module[data-state="partially_matched"] {
  border-color: rgba(119, 215, 204, 0.42);
}

.bm3-module[data-state="unsupported"],
.bm3-module[data-state="invalid_input"] {
  border-color: rgba(230, 149, 58, 0.38);
}

.bm3-module-header {
  padding: 22px 22px 0;
}

.bm3-module-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bm3-module-kicker > span:first-child {
  color: #8ce8dd;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bm3-quality-badge {
  padding: 4px 8px;
  border: 1px solid rgba(119, 215, 204, 0.32);
  border-radius: 999px;
  color: #baf3ec;
  font-size: 0.66rem;
  white-space: nowrap;
}

.bm3-module h3 {
  margin: 0;
  color: #f3f7fb;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.bm3-module-definition {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  line-height: 1.55;
}

.bm3-key-result {
  margin: 18px 22px 0;
  padding: 18px;
  border: 1px solid rgba(42, 157, 143, 0.26);
  border-radius: 13px;
  background: linear-gradient(
    135deg,
    rgba(42, 157, 143, 0.14),
    rgba(42, 157, 143, 0.04)
  );
}

.bm3-selection-label,
.bm3-selection-context {
  display: block;
}

.bm3-selection-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.45;
}

.bm3-selection-value {
  display: block;
  margin: 5px 0 4px;
  color: #f4fbfa;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.bm3-selection-context {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.74rem;
  line-height: 1.52;
}

.bm3-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 22px 0;
}

.bm3-meta div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.bm3-meta dt {
  margin-bottom: 3px;
  color: #8ce8dd;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bm3-meta dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  line-height: 1.42;
}

.bm3-table-region {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  scrollbar-color: rgba(119, 215, 204, 0.55) rgba(255, 255, 255, 0.05);
}

.bm3-table {
  width: 100%;
  min-width: 500px;
  border-collapse: collapse;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.bm3-table caption {
  padding: 14px 22px 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: left;
}

.bm3-table th,
.bm3-table td {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: right;
  white-space: nowrap;
}

.bm3-table thead th {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.bm3-table th:first-child {
  padding-left: 22px;
  text-align: left;
}

.bm3-table td:last-child,
.bm3-table th:last-child {
  padding-right: 22px;
}

.bm3-table tbody th {
  color: rgba(255, 255, 255, 0.84);
  font-weight: 600;
}

.bm3-table tbody tr[aria-current="true"] {
  background: rgba(42, 157, 143, 0.16);
  box-shadow: inset 4px 0 0 #2a9d8f;
}

.bm3-table tbody tr[aria-current="true"] th {
  color: #c8f7f1;
}

.bm3-module-footer {
  padding: 15px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
  line-height: 1.55;
}

.bm3-module-footer p {
  margin: 0;
}

.bm3-module-footer p + p {
  margin-top: 7px;
}

.bm3-module-footer a {
  color: #9aeee4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 820px) {
  .bm3-module-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .bm3-filter-field,
  .bm3-personalize-action,
  .bm3-personalize-action button {
    width: 100%;
  }

  .bm3-dashboard {
    padding-right: 14px;
    padding-left: 14px;
  }

  .bm3-dashboard-head {
    padding: 20px;
  }

  .bm3-module-header,
  .bm3-module-footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .bm3-key-result,
  .bm3-meta {
    margin-right: 18px;
    margin-left: 18px;
  }

  .bm3-meta {
    grid-template-columns: 1fr;
  }
}

@media (forced-colors: active) {
  .bm3-dashboard-head,
  .bm3-module,
  .bm3-key-result,
  .bm3-cohort-status {
    border: 1px solid CanvasText;
  }

  .bm3-table tbody tr[aria-current="true"] {
    outline: 3px solid Highlight;
  }
}

@media print {
  .bm3-dashboard-head,
  .bm3-module,
  .bm3-key-result,
  .bm3-meta div {
    border-color: #777;
    background: transparent;
    box-shadow: none;
  }

  .bm3-dashboard,
  .bm3-dashboard-head h2,
  .bm3-module h3,
  .bm3-selection-value,
  .bm3-table,
  .bm3-table th,
  .bm3-table td {
    color: #111;
  }

  .bm3-module {
    break-inside: avoid;
  }
}
