.typifications-page {
  min-width: 0;
  flex: 0 0 auto;
  gap: 0;
  font-family: Calibri, Aptos, sans-serif;
  letter-spacing: 0;
}

.typifications-page .rk-body {
  flex: none;
  min-width: 0;
  gap: 7px;
}

.typifications-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.typifications-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--metric-border);
  border-radius: 4px;
  background: var(--metric-background);
  color: #d5e4f4;
}

.typifications-metric > span {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
}

.typifications-metric svg {
  width: 12px;
  height: 12px;
  color: var(--metric-color);
}

.typifications-metric strong {
  color: var(--metric-color);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
}

.typifications-metric-calls {
  --metric-background: #163b36;
  --metric-border: #356e61;
  --metric-color: #75dfb5;
}

.typifications-metric-time {
  --metric-background: #382c4c;
  --metric-border: #655481;
  --metric-color: #ccacf5;
}

.typifications-metric-cph {
  --metric-background: #23394e;
  --metric-border: #47617c;
  --metric-color: #9ccfff;
}

.typifications-metric-contactability {
  --metric-background: #143e43;
  --metric-border: #40757b;
  --metric-color: #7fddd7;
}

.typifications-method {
  margin: 0;
  color: #b7cbdc;
  font-size: 11px;
  line-height: 1.4;
}

.typifications-results {
  min-width: 0;
  border: 1px solid #34495e;
  border-radius: 4px;
  background: #101f2e;
}

.typifications-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid #344b62;
  background: #122232;
  color-scheme: dark;
  scrollbar-color: #4a637c #101f2e;
}

.typifications-table-wrap:focus-visible {
  outline: 2px solid #71c8ff;
  outline-offset: 2px;
}

.typifications-table {
  width: 100%;
  min-width: 1712px;
  table-layout: fixed;
  border-spacing: 0;
  background: #122232;
  color: #d5e4f4;
  font-size: 11px;
  line-height: 1.15;
}

.typifications-agency-column { width: 112px; }
.typifications-advisor-column { width: 176px; }
.typifications-status-column { width: 76px; }
.typifications-total-column { width: 80px; }
.typifications-time-column { width: 64px; }
.typifications-contactability-column { width: 112px; }
.typifications-cph-column { width: 72px; }

/* Keep the longest status words intact within their columns. */
.typifications-table col[data-status="4"] { width: 96px; }
.typifications-table col[data-status="6"],
.typifications-table col[data-status="8"],
.typifications-table col[data-status="11"] { width: 88px; }

.typifications-table th,
.typifications-table td {
  height: 17px;
  padding: 1px 4px;
  border-right: 1px solid #2b3e52;
  border-bottom: 1px solid #2b3e52;
  vertical-align: middle;
  text-align: center;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.typifications-table tr > :last-child {
  border-right: 0;
}

.typifications-table tbody tr:last-child > * {
  border-bottom: 0;
}

.typifications-table thead th {
  text-align: center;
  height: auto;
  padding: 2px 4px;
  border-bottom-color: #344b62;
  background: #21354a;
  color: #c9dcef;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  overflow-wrap: normal;
}

.typifications-table tr > :nth-child(-n+2) {
  position: sticky;
  z-index: 1;
}

.typifications-table tbody tr > :nth-child(-n+2) {
  text-align: left;
}

.typifications-table tr > :first-child {
  left: 0;
}

.typifications-table tr > :nth-child(2) {
  left: 112px;
}

.typifications-table tbody td,
.typifications-table tbody th {
  background: #122232;
  font-weight: 400;
}

.typifications-table tbody tr:nth-child(even) > * {
  background: #1a2d40;
}

.typifications-table tbody tr:hover > * {
  background: #243c53;
}

/* Identity and metric columns share a distinct green block. */
.typifications-table thead th:nth-child(-n+6) {
  background: #285445;
  border-color: #3d6658;
  color: #e1f5eb;
}

.typifications-table tbody tr > :nth-child(-n+6) {
  background: #16352f;
  border-color: #305449;
}

.typifications-table tbody tr:nth-child(even) > :nth-child(-n+6) {
  background: #1c4038;
}

.typifications-table tbody tr:hover > :nth-child(-n+6) {
  background: #285348;
}

.typifications-table tr > :nth-child(6) {
  border-right: 2px solid #598d78;
  white-space: nowrap;
}

.typifications-page .typifications-filters {
  grid-template-columns: 72px 100px 82px 112px minmax(120px, 1fr) minmax(145px, 1.4fr) 110px;
  margin: 0;
}

.typifications-page [data-typifications-results] {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.typifications-import-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.typifications-page [data-import-form] input[type="file"] {
  height: auto;
  min-height: 32px;
  padding: 4px;
}

.typifications-page .kpi-preview-table {
  overflow-x: auto;
}

.typifications-page .kpi-preview-table td {
  overflow-wrap: anywhere;
}

.typifications-page .rk-table-footer {
  height: auto;
  flex-wrap: wrap;
}

@media (max-width: 1100px) {
  .typifications-page .typifications-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .typifications-page .typifications-filters .rk-clear {
    grid-column: auto;
  }
}

@media (max-width: 540px) {
  .typifications-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .typifications-page .typifications-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .typifications-page .typifications-filters .rk-clear {
    grid-column: 1 / -1;
    margin: 0;
  }

  .typifications-page .kpi-upload-options {
    flex-wrap: wrap;
  }

  .typifications-page .kpi-upload-options .rk-field {
    flex-basis: 100%;
  }
}

.typifications-table tbody td:first-child,
.typifications-table tbody td:nth-child(6) {
  color: #9ccfff;
}

.typifications-table tbody td:nth-child(3),
.typifications-table tbody td[data-status="10"] {
  color: #62e8ad;
}

@media (max-width: 700px) {
  .typifications-table tr > :nth-child(-n+2) {
    position: static;
  }
}

@media (max-width: 540px) {
  .typifications-page .rk-hero {
    flex-wrap: wrap;
    gap: 8px;
  }

  .typifications-page .rk-scope {
    margin-left: auto;
  }

  .typifications-metric {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 5px;
  }

  .typifications-metric strong {
    font-size: 13px;
  }

  .typifications-metric > span {
    font-size: 9px;
    gap: 3px;
  }

  .typifications-metric svg {
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 400px) {
  .typifications-page .typifications-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
