html {
  font-size: 15px;
  min-height: 100%;
  position: relative;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background: #f5f7fb;
  color: #18212f;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.navbar {
  background: #ffffff;
}

.dashboard-head {
  display: flex;
  gap: 24px;
  align-items: end;
  justify-content: space-between;
  margin: 28px 0 20px;
}

.dashboard-head h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: #58708f;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #ffffff;
}

.filter-bar label {
  display: grid;
  gap: 4px;
  color: #58708f;
  font-size: .82rem;
  font-weight: 700;
}

.filter-bar input,
.filter-bar button {
  min-height: 40px;
  border-radius: 6px;
  font: inherit;
}

.filter-bar input {
  width: 150px;
  border: 1px solid #ccd7e5;
  padding: 8px 10px;
  color: #18212f;
}

.data-check-form {
  flex: 1;
  max-width: 680px;
}

.data-check-form label {
  flex: 1;
}

.data-check-form input {
  width: 100%;
}

.filter-bar button {
  border: 0;
  padding: 8px 16px;
  background: #136f63;
  color: #ffffff;
  font-weight: 800;
}

.metric-grid,
.content-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.metric-card,
.panel {
  border: 1px solid #dce4ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(31, 45, 61, .06);
}

.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.metric-card span {
  color: #58708f;
  font-weight: 700;
}

.metric-card strong {
  font-size: 2rem;
  line-height: 1;
}

.panel {
  padding: 18px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.panel-title span,
.empty-state,
.setup-panel p {
  color: #667891;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22px, 1fr));
  gap: 8px;
  min-height: 220px;
  align-items: end;
}

.bar-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.bar-track {
  position: relative;
  height: 170px;
  border-radius: 6px;
  background: #edf2f7;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: auto 0 0;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #31a88f, #136f63);
}

.bar-item span {
  color: #667891;
  font-size: .76rem;
  white-space: nowrap;
}

.metric-list {
  display: grid;
  gap: 12px;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 52px;
  gap: 12px;
  align-items: center;
}

.metric-row strong,
.metric-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-row span {
  color: #667891;
  font-size: .86rem;
}

.metric-row em {
  color: #294058;
  font-style: normal;
  text-align: right;
}

.share-bar {
  height: 8px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.share-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #d08b38;
}

.setup-panel {
  margin-top: 14px;
}

.setup-panel pre {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #101827;
  color: #e6edf7;
  white-space: pre-wrap;
}

.notice-panel {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #e6c86e;
  border-radius: 8px;
  background: #fff7dc;
  color: #6b5611;
  font-weight: 700;
}

.notice-panel.compact {
  margin: 14px 0 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 18px;
}

.summary-grid span {
  color: #667891;
}

.summary-grid strong {
  overflow-wrap: anywhere;
}

.path-line {
  color: #58708f;
  overflow-wrap: anywhere;
}

.field-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-chip-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2f7;
  color: #294058;
  font-size: .82rem;
  font-weight: 700;
}

.audit-table-wrap {
  overflow-x: auto;
}

.audit-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.audit-table th,
.audit-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e6edf5;
  vertical-align: top;
}

.audit-table th {
  color: #58708f;
  font-size: .78rem;
  text-transform: uppercase;
}

.audit-table small {
  display: block;
  margin-top: 4px;
  color: #a54735;
}

.status-pill {
  display: inline-flex;
  min-width: 88px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}

.status-ok {
  background: #dff4e8;
  color: #126243;
}

.status-derived {
  background: #e3efff;
  color: #1f5b9c;
}

.status-client {
  background: #f0e7ff;
  color: #6842a0;
}

.status-missing {
  background: #ffe4df;
  color: #9b3424;
}

@media (max-width: 900px) {
  .dashboard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .metric-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar,
  .filter-bar input {
    width: 100%;
  }

  .metric-row {
    grid-template-columns: minmax(0, 1fr) 80px 44px;
  }
}
