/**
 * Shared styling for the standard scorecard (std-cards.js), the summary tables
 * (std-tables.js) and compact filter controls — one look across every Think Big
 * client page, keyed to the CLS report and the command-center hubs.
 *
 * Self-contained on purpose: the 13 pages define the same palette under three
 * different custom-property naming conventions (--canvas2 / --canvas-2 / --f),
 * so depending on any page's tokens would style 13 pages 13 ways. The values
 * below ARE the shared Think Big palette every page already uses.
 */

:root {
  --std-panel: #140A62;
  --std-panel2: #1F1371;
  --std-grid: #2B2177;
  --std-text: #FFFFFF;
  --std-muted: #A9A8C4;
  --std-quiet: #7770A8;
  --std-accent: #2FC168;
  --std-mono: "IBM Plex Mono", SFMono-Regular, Consolas, monospace;
  --std-body: "Poppins", "Inter", Arial, sans-serif;
  --std-display: "Poppins", "Montserrat", "Arial Black", sans-serif;
}

/* ---- Overall Toplines cards -------------------------------------------- */

#std-metrics-sec > .label {
  font-family: var(--std-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--std-accent);
  border-bottom: 1px solid var(--std-grid);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

#std-metrics.std-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(172px, 1fr));
  gap: 12px;
}
.std-card {
  background: var(--std-panel);
  border: 1px solid var(--std-grid);
  border-radius: 14px;
  padding: 15px 16px 13px;
  display: flex;
  flex-direction: column;
  text-align: center;
  min-width: 0;
}
.std-card .lab {
  font-family: var(--std-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--std-quiet);
  margin-bottom: 7px;
}
.std-card .val {
  font-family: var(--std-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--std-text);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.std-card .dlt {
  display: inline-block;
  margin: 7px auto 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--std-grid);
  color: var(--std-muted);
}
.std-card .dlt.up { color: #4ade80; }
.std-card .dlt.dn { color: #f87171; }
.std-card .def {
  margin-top: auto;
  padding-top: 9px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--std-muted);
  opacity: .75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#std-metrics-note, .std-range-note {
  font-family: var(--std-mono);
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--std-quiet);
  margin-top: 10px;
  text-transform: uppercase;
}

/* ---- Summary tables ------------------------------------------------------ */

.std-tblwrap { overflow-x: auto; }
table.std-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--std-body);
}
table.std-table th, table.std-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--std-grid);
  font-size: 12.5px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--std-text);
}
table.std-table th {
  font-family: var(--std-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--std-quiet);
  font-weight: 600;
}
table.std-table th:first-child, table.std-table td:first-child {
  text-align: left;
}
table.std-table td:first-child { font-weight: 600; }
table.std-table tr:last-child td { border-bottom: 0; }
table.std-table tr.total td {
  border-top: 1px solid var(--std-grid);
  font-weight: 700;
}
.std-table-note {
  font-size: 11.5px;
  color: var(--std-quiet);
  margin-top: 10px;
  line-height: 1.55;
}

/* ---- Compact filters ----------------------------------------------------- */
/* One slim row of controls instead of stacked chip walls: selects and button
   groups sized to their content, wrapping only when the viewport forces it. */

.std-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
.std-filters label {
  font-family: var(--std-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--std-quiet);
}
.std-filters select, .std-filters .std-seg {
  background: var(--std-panel);
  border: 1px solid var(--std-grid);
  border-radius: 999px;
  color: var(--std-text);
  font-family: var(--std-body);
  font-size: 12px;
  padding: 6px 12px;
  max-width: 240px;
}
.std-seg { display: inline-flex; overflow: hidden; padding: 0; }
.std-seg button {
  font-family: var(--std-mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: none;
  border: 0;
  color: var(--std-quiet);
  padding: 7px 12px;
  cursor: pointer;
}
.std-seg button.on, .std-seg button.active {
  background: var(--std-panel2);
  color: var(--std-text);
}

@media (max-width: 900px) {
  #std-metrics.std-grid { grid-template-columns: repeat(2, 1fr); }
  .std-card .val { font-size: 18px; }
  table.std-table th, table.std-table td { font-size: 11px; padding: 8px 5px; }
}
@media (max-width: 480px) {
  .std-tblwrap { -webkit-overflow-scrolling: touch; }
}
