/* Institutional Data Registry — Obsidian Glassmorphic & Tabular Matrix Standard */

body {
  background:
    radial-gradient(ellipse 75% 360px at 50% 0%, rgba(2, 132, 199, 0.1), transparent 72%),
    #0A0D12;
  color: #ECEFF1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.layout {
  width: 100%;
  max-width: 1120px;
  margin: 24px auto 40px;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1 0 auto;
}

.registry-main {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Top Bar & Branding */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #FFFFFF;
}

.brand:hover {
  text-decoration: none;
}

.brand-wordmark {
  font-family: var(--font-brand);
  font-weight: 400;
  letter-spacing: 0.4px;
}

.title {
  font-size: 20px;
  color: #FFFFFF;
  margin: 0;
}

.subtitle {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 500;
}

.badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-registry {
  background: rgba(2, 136, 209, 0.22);
  color: #7DD3FC;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.badge-edge {
  background: rgba(16, 185, 129, 0.16);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-fail-safe {
  background: rgba(249, 115, 22, 0.18);
  color: #FDBA74;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

/* Navigation link pills */
.nav-links {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-size);
  font-size: 12px;
  color: #CBD5E1;
  text-decoration: none;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  font-weight: 700;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-pill:hover {
  color: #FFFFFF;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.14);
}

.nav-pill.active,
.nav-pill[aria-current="page"] {
  color: #FFFFFF;
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(249, 115, 22, 0.68);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.2);
}

@media (forced-colors: active) {
  .nav-pill[aria-current="page"] {
    outline: 2px solid Highlight;
    text-decoration: underline;
  }
}

/* Cards */
.card {
  background: rgba(18, 22, 31, 0.94);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.52), inset 0 1px 0 0 rgba(255, 255, 255, 0.07);
}

.card-title {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.card-heading {
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}

.card-subtitle {
  font-size: 13.5px;
  color: #94A3B8;
  margin-bottom: 16px;
  line-height: 1.5;
}

/* Telemetry Ribbon / Key Counters */
.counters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.counter-item {
  background: rgba(18, 22, 31, 0.94);
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-top: 3px solid #38BDF8;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
}

.counter-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.counter-val {
  font-size: 26px;
  font-weight: 900;
  color: #FFFFFF;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter-sub {
  font-size: 11.5px;
  color: #6EE7B7;
  margin-top: 4px;
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  display: inline-block;
}

.status-dot.active {
  box-shadow: 0 0 8px #10B981;
}

/* Action Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filters {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #CBD5E1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 13px;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #0369A1;
  color: #FFFFFF;
  border-color: #38BDF8;
}

.search-box {
  background: #0B101B;
  border: 1px solid #283548;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  min-height: 38px;
  border-radius: 10px;
  width: min(100%, 260px);
  outline: none;
}

.search-box:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

/* Action Buttons */
.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 7px 14px;
  min-height: 34px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s ease, background-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-compact {
  font-size: 11px;
  padding: 5px 11px;
  min-height: 30px;
}

.btn-probe {
  min-height: 42px;
}

.btn-primary {
  background: #0369A1;
  border-color: #38BDF8;
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #075985;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
  border-color: rgba(148, 163, 184, 0.25);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.btn-warning {
  background: #C2410C;
  border-color: rgba(251, 146, 60, 0.5);
  color: #FFFFFF;
}

.btn-warning:hover {
  background: #EA580C;
}

/* Data Table */
.table-container {
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  background: #0B0F17;
}

.table-loading-cell {
  text-align: center;
  color: #94A3B8;
  padding: 24px;
}

.statutes-scroll-box {
  max-height: 460px;
  overflow-y: auto;
}

.statutes-scroll-box thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(8px);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

th {
  background: #111827;
  color: #94A3B8;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 12px 14px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.35);
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  color: #E2E8F0;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}

/* Table Badges */
.mode-pill,
.status-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-block;
  white-space: nowrap;
}

.mode-auto {
  background: rgba(16, 185, 129, 0.16);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.mode-statute {
  background: rgba(56, 189, 248, 0.16);
  color: #7DD3FC;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.mode-scraper {
  background: rgba(249, 115, 22, 0.16);
  color: #FDBA74;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.mode-manual {
  background: rgba(168, 85, 247, 0.16);
  color: #D8B4FE;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.status-active {
  background: rgba(16, 185, 129, 0.16);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-planned {
  background: rgba(245, 158, 11, 0.16);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.status-degraded {
  background: rgba(239, 68, 68, 0.16);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Roadmap & Gaps Tier Matrix */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.tier-card {
  background: rgba(15, 22, 34, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tier-title {
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
}

.tier-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
}

.tier-desc {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.5;
}

.tier-list {
  list-style: none;
  padding: 0;
  margin-top: 6px;
  font-size: 12px;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tier-list li {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.check {
  color: #6EE7B7;
  font-weight: 800;
}

.pending {
  color: #FDBA74;
  font-weight: 800;
}

/* Live Test Probe */
.probe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 11px;
  font-weight: 700;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.input {
  background: #0B101B;
  border: 1px solid #283548;
  color: #F8FAFC;
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  min-height: 42px;
  border-radius: 9px;
  outline: none;
}

.input:focus {
  border-color: #38BDF8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.probe-result {
  display: none;
  margin-top: 14px;
  background: #06090E;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  color: #E2E8F0;
}
.probe-summary-card { display: flex; flex-direction: column; gap: 10px; }
.probe-summary-hdr { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid rgba(148, 163, 184, 0.16); padding-bottom: 8px; }
.probe-reasons-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.45; }
.probe-meteo-line { font-family: var(--font-mono); font-size: 11.5px; }
.probe-raw-details summary { cursor: pointer; font-size: 11.5px; font-weight: 700; }
.probe-raw-details pre { margin: 8px 0 0; font-family: var(--font-mono); font-size: 11px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; }

/* Live Log Console */
.console-box {
  background: #06090E;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #86EFAC;
  min-height: 76px;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Global Administrative Hierarchy Coverage Explorer */
.hierarchy-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.hierarchy-stat-pill { background: #0B101B; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.hierarchy-stat-label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: #94A3B8; text-transform: uppercase; letter-spacing: 0.5px; }
.hierarchy-stat-value { font-size: 20px; font-weight: 800; line-height: 1.1; }
.hierarchy-breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding: 8px 12px; background: #0B101B; border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 10px; }
.hierarchy-crumb { background: transparent; border: 1px solid transparent; color: #7DD3FC; font-family: inherit; font-size: 12.5px; font-weight: 700; padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.hierarchy-crumb:hover { background: rgba(56, 189, 248, 0.14); color: #FFFFFF; }
.hierarchy-crumb.active { color: #FFFFFF; background: rgba(2, 132, 199, 0.26); border-color: rgba(56, 189, 248, 0.45); }
.hierarchy-crumb-sep { color: #64748B; font-size: 13px; }
.hierarchy-drill-btn { background: transparent; border: none; padding: 0; color: #7DD3FC; font-family: inherit; font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hierarchy-drill-btn:hover { color: #FFFFFF; }
.hierarchy-node-sub { font-family: var(--font-mono); font-size: 11px; color: #94A3B8; margin-top: 3px; }
.status-merged { background: rgba(139, 92, 246, 0.18); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.45); }
