:root {
  --awa-bg: #f6f7f9;
  --awa-panel: #ffffff;
  --awa-border: #d9dee7;
  --awa-text: #1f2937;
  --awa-muted: #667085;
  --awa-accent: #1f6feb;
  --awa-ok: #198754;
  --awa-warn: #b7791f;
  --awa-risk: #c2410c;
}

body {
  background: var(--awa-bg);
  color: var(--awa-text);
  font-size: 15px;
  letter-spacing: 0;
}

.navbar-brand {
  font-weight: 700;
}

.brand-mark {
  align-items: center;
  background: #e9f2ff;
  border: 1px solid #cfe1ff;
  border-radius: 8px;
  color: var(--awa-accent);
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.auth-gate {
  align-items: center;
  display: flex;
  min-height: calc(100vh - 58px);
  padding: 24px;
}

.auth-card {
  background: var(--awa-panel);
  border: 1px solid var(--awa-border);
  border-radius: 8px;
  margin: 0 auto;
  max-width: 520px;
  padding: 28px;
  text-align: center;
}

.auth-icon {
  align-items: center;
  background: #e9f2ff;
  border: 1px solid #cfe1ff;
  border-radius: 8px;
  color: var(--awa-accent);
  display: inline-flex;
  font-size: 24px;
  height: 48px;
  justify-content: center;
  margin-bottom: 16px;
  width: 48px;
}

.toolbar,
.panel,
.metric {
  background: var(--awa-panel);
  border: 1px solid var(--awa-border);
  border-radius: 8px;
}

.toolbar {
  padding: 16px;
}

.filter-switch {
  align-items: center;
  border: 1px solid var(--awa-border);
  border-radius: 8px;
  display: flex;
  min-height: 38px;
  padding: 7px 12px 7px 44px;
}

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

.metric {
  min-height: 92px;
  padding: 16px;
}

.metric-label {
  color: var(--awa-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.metric-note {
  color: var(--awa-muted);
  font-size: 13px;
  margin-top: 6px;
}

.panel-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--awa-border);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.panel-tabs {
  padding: 0 16px;
}

.panel-tabs .nav-link {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  min-height: 48px;
}

.table {
  --bs-table-bg: transparent;
  font-size: 14px;
}

.table thead th {
  background: #f9fafb;
  border-bottom: 1px solid var(--awa-border);
  color: #475467;
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  max-width: 380px;
  vertical-align: top;
}

.cell-main {
  font-weight: 650;
}

.cell-sub {
  color: var(--awa-muted);
  font-size: 12px;
  margin-top: 2px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge-provider {
  border: 1px solid transparent;
  font-weight: 600;
}

.provider-google-fonts,
.provider-bunny-fonts,
.provider-fontshare {
  background: #e9f8ef;
  border-color: #bfe8cb;
  color: #146c43;
}

.provider-adobe-fonts {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.provider-monotype {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.provider-local,
.provider-embedded,
.provider-unknown {
  background: #f2f4f7;
  border-color: #d0d5dd;
  color: #344054;
}

.risk-pill {
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  min-width: 44px;
  padding: 4px 10px;
  text-align: center;
}

.risk-low {
  background: #e9f8ef;
  color: var(--awa-ok);
}

.risk-medium {
  background: #fff8e5;
  color: var(--awa-warn);
}

.risk-high {
  background: #fff1e8;
  color: var(--awa-risk);
}

.risk-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.risk-item {
  color: inherit;
  display: grid;
  gap: 8px;
  width: 100%;
}

.risk-item-top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.risk-bar {
  background: #eef2f6;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.risk-bar-fill {
  background: linear-gradient(90deg, #1f6feb, #c2410c);
  height: 100%;
}

.insights-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.insight {
  border: 1px solid var(--awa-border);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.insight-title {
  font-weight: 700;
}

.insight-body {
  color: var(--awa-muted);
  font-size: 13px;
}

.empty-state {
  color: var(--awa-muted);
  padding: 36px !important;
  text-align: center;
}

.empty-state .bi {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}

.history-view {
  padding: 16px;
}

.history-domain {
  border: 1px solid var(--awa-border);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 12px;
}

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

.detail-box {
  background: #f9fafb;
  border: 1px solid var(--awa-border);
  border-radius: 8px;
  padding: 12px;
}

.detail-box dt {
  color: var(--awa-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.detail-box dd {
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

button.link-button {
  background: transparent;
  border: 0;
  color: var(--awa-accent);
  padding: 0;
  text-align: left;
}

button.link-button:hover {
  text-decoration: underline;
}

.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@media (min-width: 1400px) {
  .metrics-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .metric-value {
    font-size: 23px;
  }

  .panel-header {
    display: block;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
