/* Governance overlay styles. All elements are appended to document.body as
   position:fixed so they're independent of React's DOM tree. The native
   Metabase error remains visible underneath the centered card — accepted by
   the spec. */

.gov-card,
.gov-toast,
.gov-profile-card {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Error cards ─────────────────────────────────────────────────────────── */

.gov-card {
  position: fixed;
  z-index: 100;
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border-left: 6px solid #c92a2a;
  max-width: 640px;
  animation: gov-card-in 0.18s ease-out;
}

.gov-card-block {
  background: #fff5f5;
  border-left-color: #c92a2a;
}

.gov-card-amber {
  background: #fff8f0;
  border-left-color: #e67700;
}

.gov-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
  padding-right: 24px;
}

.gov-card-body {
  color: #495057;
  margin-bottom: 10px;
}

.gov-card-fix {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 5px;
  padding: 8px 10px;
  margin-bottom: 10px;
  color: #212529;
}

.gov-card-fix-label {
  font-weight: 700;
  color: #1a1a1a;
}

.gov-card-countdown {
  font-weight: 600;
  color: #c92a2a;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}

.gov-card-countdown-ready {
  color: #2f9e44;
}

.gov-card-help {
  color: #868e96;
  font-size: 12px;
  margin-top: 6px;
}

.gov-card-dismiss {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #868e96;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.gov-card-dismiss:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #212529;
}

@keyframes gov-card-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Overlay anchored to native error block ────────────────────────────────
   Positioned via JS on top of Metabase's native error container. We don't
   modify React's tree at all — just hide its block with visibility:hidden
   and float ours on top. */

.gov-overlay {
  position: fixed;
  /* Below typical app modal layers (Mantine defaults to ~400 for Modal,
     ~300 for Popover). Above static page content. If Metabase ever opens
     a modal, its backdrop covers the card naturally — the user's not left
     with a governance card peeking through the dim. */
  z-index: 100;
  background: #fff5f5;
  border-radius: 8px;
  padding: 14px 18px 16px;
  border-left: 6px solid #c92a2a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-align: left;
  box-sizing: border-box;
}

.gov-overlay-block {
  background: #fff5f5;
  border-left-color: #c92a2a;
}

.gov-overlay-amber {
  background: #fff8f0;
  border-left-color: #e67700;
}

/* ── Warn toast (top-right) ──────────────────────────────────────────────── */

.gov-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: #fff9db;
  border-left: 4px solid #e67700;
  border-radius: 6px;
  padding: 12px 14px 14px;
  width: 360px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  animation: gov-toast-in 0.2s ease-out;
}

.gov-toast-title {
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  padding-right: 22px;
}

.gov-toast-body {
  color: #495057;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.gov-toast-fix {
  font-size: 12.5px;
  color: #212529;
}

.gov-toast-dismiss {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 18px;
  color: #868e96;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
}

.gov-toast-dismiss:hover {
  color: #212529;
}

@keyframes gov-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Profile stats card ──────────────────────────────────────────────────── */

.gov-profile-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

.gov-profile-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 14px;
}

.gov-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gov-stat {
  text-align: center;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px 8px;
}

.gov-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #1971c2;
  font-variant-numeric: tabular-nums;
}

.gov-stat-val.gov-red   { color: #c92a2a; }
.gov-stat-val.gov-amber { color: #e67700; }

.gov-stat-label {
  font-size: 10.5px;
  color: #868e96;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.gov-profile-qpm {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f3f5;
  color: #c92a2a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.gov-profile-qpm-ok {
  color: #2f9e44;
}
