:root {
  /* Brinqa Design Tokens */
  --primary: #476CFF;
  --primary-dark: #335CFF;
  --primary-light: #EEF2FF;

  --brand-green: #00af66;
  --brand-green-dark: #00875a;

  --navy: #002554;
  --black: #000000;
  --surface: #FFFFFF;
  --background: #F8FAFC;

  --text-main: #0C0C0C;
  --text-muted: #64748B;
  --text-on-dark: #F2F4F4;

  --border-color: #E8EDEF;

  --radius: 4px;

  --header-height: 70px;

  --font-heading: "JetBrains Mono", monospace;
  --font-sans: "Lato", "Inter", "Halyard Display", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  font-family: var(--font-sans);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: var(--header-height) auto 0 auto;
  padding: 40px 24px;
}

/* Navbar */
.navbar {
  height: var(--header-height);
  background: linear-gradient(90deg, var(--navy) 0%, var(--brand-green-dark) 100%);
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .logo {
  height: 32px;
  width: 140px;
  background-image: url("assets/full-logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  filter: brightness(0) invert(1);
  margin-right: 24px;
  padding-right: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar .title {
  color: var(--text-on-dark);
  font-family: var(--font-heading);
  font-size: 20px;
  text-decoration: none;
}

.navbar .pull-right {
  margin-left: auto;
  display: flex;
  gap: 24px;
}

.navbar a {
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.navbar a:hover {
  opacity: 1;
}

.navbar a.active {
  opacity: 1;
}

/* Footer */
.foot {
  background-color: var(--black);
  color: var(--text-on-dark);
  padding: 16px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.foot .container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.foot .logo {
  height: 18px;
  width: 80px;
  background-image: url("assets/full-logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  filter: brightness(0) invert(1);
  opacity: 0.6;
}

.foot .copyright {
  font-size: 12px;
  opacity: 0.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* htmx loading */
.htmx-indicator {
  opacity: 0;
  transition: opacity 0.2s;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

.grid-loading-bar {
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: transparent;
}

.grid-loading-bar .bar-fill {
  height: 100%;
  width: 30%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand-green), var(--primary));
  animation: slide-bar 1.2s ease-in-out infinite;
}

@keyframes slide-bar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Animations */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Connectors Page ===== */
.connectors-page-content {
  width: 100%;
}

#connectors-progress:empty {
  display: none;
}

.page-header {
  margin-bottom: 40px;
  text-align: center;
}

.page-header h1 {
  font-size: 48px;
  margin-bottom: 12px;
  color: var(--navy);
}

.page-header .subtitle {
  font-size: 18px;
  color: var(--text-muted);
}

/* Filters & Search */
.filters-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-bottom: 48px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 8px 20px;
  width: 100%;
  max-width: 600px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.search-bar .search-icon {
  color: var(--text-muted);
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 8px 0;
  font-family: var(--font-sans);
}

.search-bar .clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
}

.search-bar .clear-btn:hover {
  background: var(--background);
  color: var(--text-main);
}

/* Category Chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--surface);
  color: var(--text-main);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
}

.chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.chip.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Results Header */
.results-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.results-info h2 {
  font-size: 20px;
  margin: 0;
}

.results-info .count-badge {
  background: var(--brand-green);
  color: white;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-family: var(--font-heading);
}

/* Connectors Grid */
.connectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.connector-card {
  height: 100%;
}

.connector-card .card {
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: none;
  background: var(--surface);
}

.connector-card .card:hover {
  border-color: var(--brand-green);
  box-shadow: 0 4px 16px rgba(0, 175, 102, 0.1);
}


.connector-card .card-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px;
  height: 100%;
}

.connector-card .card-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  border-radius: var(--radius);
  padding: 12px;
}

.connector-card .card-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.connector-card .card-icon .placeholder-icon {
  color: var(--text-muted);
}

.connector-card .card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connector-card .card-details .name {
  font-family: var(--font-heading);
  font-size: 18px;
  margin: 0;
  color: var(--navy);
}

.connector-card .card-details .version {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--text-muted);
  background: var(--background);
  padding: 2px 8px;
  border-radius: 4px;
  align-self: center;
}

.connector-card .card-footer {
  margin-top: 24px;
}

.connector-card .category-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: white;
  border-radius: var(--radius);
  border: 1px dashed var(--border-color);
}

.empty-state .empty-icon {
  color: var(--text-muted);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.empty-state button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.empty-state button:hover {
  text-decoration: underline;
}

/* Loading Spinner */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.connectors-loading {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.loading-panel {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 32px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(71, 108, 255, 0.06) 0%, rgba(255, 255, 255, 0.98) 48%),
    var(--surface);
  box-shadow: 0 18px 50px rgba(0, 37, 84, 0.06);
}

.loading-copy {
  max-width: 460px;
}

.loading-copy h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 6px;
}

.loading-copy p {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}

.progress-banner {
  max-width: 880px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  border: 1px solid rgba(71, 108, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(71, 108, 255, 0.08), rgba(255, 255, 255, 0.96));
}

.progress-banner-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 10px;
}

.progress-banner-copy strong {
  color: var(--navy);
}

.progress-banner-copy span {
  color: var(--text-muted);
}

.progress-banner-note {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.progress-banner-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(71, 108, 255, 0.12);
  overflow: hidden;
}

.progress-banner-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.3s ease;
}

.loading-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.loading-progress .progress-bar-track {
  flex: 1;
}

.loading-metric {
  min-width: 42px;
  text-align: right;
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--primary);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== Downloads Page ===== */
.downloads-page-content {
  width: 100%;
}

.downloads-page-content .page-header {
  margin-bottom: 48px;
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

.download-card .card {
  height: 100%;
  position: relative;
  padding-bottom: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: none;
  background: var(--surface);
}

.download-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 32px 32px 16px 32px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.download-card .card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 4px;
}

.download-card .card-subtitle {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.download-card .version-badge {
  position: absolute;
  top: 32px;
  right: 32px;
  font-family: var(--font-heading);
  font-size: 12px;
  background: var(--background);
  padding: 4px 12px;
  border-radius: 20px;
  color: var(--text-muted);
}

.download-card .download-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px 16px;
}

.download-card .stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.download-card .stat-row:last-child {
  border-bottom: none;
}

.download-card .download-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-main);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: background 0.2s, border-color 0.2s;
}

.download-card .download-btn svg {
  color: var(--primary);
  flex-shrink: 0;
}

.download-card .download-btn:hover:not(:disabled) {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

.download-card .download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-card .download-btn.downloading {
  opacity: 1;
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* Button spinner (inline, small) */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* Featured Styling for Connect */
.connect-featured .card {
  border-top: 4px solid var(--primary);
}

/* SHA Display */
.sha-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.sha-display svg {
  color: var(--primary);
  flex-shrink: 0;
  opacity: 0.6;
}

.sha-display code {
  word-break: break-all;
  font-size: 11px;
}

/* ===== Download Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  width: 400px;
  max-width: calc(100vw - 48px);
  animation: toastIn 0.3s ease-out forwards;
}

.toast.toast-exit {
  animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

.toast-card {
  padding: 20px 24px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  position: relative;
}

.toast-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: var(--background);
  color: var(--text-main);
}

.toast-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-right: 24px;
}

.toast-header .state {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
}

.toast-header .percent {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--primary);
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--background);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar-fill.indeterminate {
  width: 30%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.toast-hash {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--background);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-muted);
}

.toast-hash svg {
  color: var(--primary);
  flex-shrink: 0;
}

.toast-hash code {
  word-break: break-all;
}

.download-card .file-size {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  margin-left: auto;
}

@media (max-width: 768px) {
  .page-header h1 {
    font-size: 36px;
  }

  .progress-banner-copy {
    flex-direction: column;
    align-items: flex-start;
  }

  .loading-panel {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }

  .navbar {
    padding: 0 16px;
  }

  .navbar .logo {
    width: 110px;
    margin-right: 16px;
    padding-right: 16px;
  }

  .navbar .pull-right {
    gap: 12px;
  }

  .main {
    padding: 24px 16px;
  }

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

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

/* =========================================================================
   Admin console.
   An instrument readout, not a marketing page: left-aligned, hairline rules,
   tabular figures. Everything here is scoped to .admin-console so the public
   Connectors/Downloads pages are untouched.
   ========================================================================= */

.admin-console {
  --ink: #0B1A2B;
  --line: var(--border-color);
  --amber: #B26A00;
  --danger: #B3261E;

  /*
   * The global muted ink (#64748B) is 4.6:1 on this background — it clears AA for body
   * copy, but nearly everything muted on this page is small, uppercase and letter-spaced,
   * which is exactly where that ratio stops being readable. Darken to ~7:1 for the console
   * only. Every muted rule below reads the token, so this is the single lever.
   */
  --text-muted: #475569;

  max-width: 1120px;
}

/* ---- console band: the signature readout ---- */

.console-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: 28px 32px;
  background: var(--ink);
  color: var(--text-on-dark);
  border-radius: var(--radius) var(--radius) 0 0;
}

.console-bar h1 {
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  margin: 0;
}

.console-eyebrow {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(242, 244, 244, 0.72);
  margin-bottom: 6px;
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* the live sweep status line */
.sweep-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 14px;
  color: rgba(242, 244, 244, 0.85);
}

.sweep-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(242, 244, 244, 0.35);
  flex: none;
}

.sweep-status.is-running .sweep-dot {
  background: var(--brand-green);
  animation: sweep-pulse 1.6s ease-in-out infinite;
}

@keyframes sweep-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 175, 102, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(0, 175, 102, 0); }
}

.sweep-when {
  color: rgba(242, 244, 244, 0.7);
  font-size: 13px;
}

.console-signout {
  background: none;
  border: 1px solid rgba(242, 244, 244, 0.25);
  border-radius: var(--radius);
  color: var(--text-on-dark);
  font: inherit;
  font-size: 14px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.console-signout:hover,
.console-signout:focus-visible {
  border-color: rgba(242, 244, 244, 0.6);
  background: rgba(242, 244, 244, 0.08);
}

/* ---- metric strip ---- */

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 56px;
}

.metric {
  padding: 24px 32px;
  border-left: 1px solid var(--line);
}

.metric:first-child {
  border-left: none;
}

.metric-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.metric-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric.is-attention .metric-value {
  color: var(--amber);
}

/* ---- sections ---- */

.admin-section {
  margin-bottom: 56px;
}

/*
 * A section title has to outrank the table captions beneath it. Uppercase muted 13px
 * lost that fight — it read as one more caption. Full-size navy on a hairline, with a
 * short heavy tick under the title, so the eye lands on the title and the rule reads
 * as the boundary it is.
 */
.admin-section > h2 {
  position: relative;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--navy);
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.admin-section > h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 44px;
  height: 2px;
  background: var(--navy);
}

.admin-note {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.admin-empty {
  font-size: 15px;
  color: var(--text-muted);
  padding: 4px 0 8px;
}

.admin-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 48px;
  /* without this the shorter table stretches to the taller one and pads its rows out */
  align-items: start;
}

/* ---- data tables (downloads, store facts, keys) ---- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.data-table caption {
  text-align: left;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 10px;
}

.data-table th {
  text-align: left;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.data-table .num {
  text-align: right;
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  white-space: nowrap;
}

.data-table .mono {
  font-family: var(--font-heading);
  word-break: break-all;
}

/* a timestamp is data, not a quantity: tabular but left-aligned */
.data-table .date {
  font-family: var(--font-heading);
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

/* counts read better next to their label than at the far edge of a wide column */
.stats-table {
  max-width: 440px;
}

/* the name is the only variable-length thing here; don't let it eat the row */
.admin-console .field input#keyName {
  flex: 0 1 300px;
}

/* a full artifact key is ~40 chars; anything narrower truncates the part you're reading */
.admin-console .field input#artifactKey {
  flex: 1 1 420px;
}

/* a form sitting directly above a table needs air, or the header rule reads as its border */
.admin-console form.field {
  margin-bottom: 28px;
}

.data-table .actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

/* ---- controls ---- */

.admin-console .field {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-console label {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-console select,
.admin-console input[type="text"],
.admin-console input[type="password"] {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text-main);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-overflow: ellipsis;
}

.admin-console select:focus-visible,
.admin-console input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

/* wide enough for "ga — latest"; the version strings themselves are far shorter */
.admin-console .short {
  flex: 0 0 175px;
}

.btn {
  padding: 10px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: var(--text-on-dark);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--text-main);
}

.btn-quiet:hover,
.btn-quiet:focus-visible {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}

.btn-danger {
  padding: 6px 12px;
  font-size: 14px;
  background: transparent;
  border-color: var(--line);
  color: var(--text-muted);
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.admin-link {
  font-size: 15px;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.admin-link:hover {
  border-bottom-color: var(--primary);
}

.role-badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ---- the one-time secret: the only accent on the page ---- */

.key-receipt {
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand-green);
  border-radius: var(--radius);
}

.key-receipt-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.key-receipt-label {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-green-dark);
}

.key-receipt-name {
  font-family: var(--font-heading);
  font-weight: 600;
  word-break: break-all;
}

.key-receipt-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.key-secret {
  flex: 1 1 320px;
  min-width: 0;
  padding: 12px 14px;
  font-family: var(--font-heading);
  font-size: 14px;
  background: var(--background);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  word-break: break-all;
}

.key-receipt-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.key-error {
  margin-bottom: 24px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--danger);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
}

/* ---- sign-in ---- */

.auth {
  max-width: 420px;
  margin: 0 auto;
}

.auth h1 {
  font-size: 28px;
  color: var(--navy);
  margin-bottom: 8px;
}

.auth .admin-note {
  margin-bottom: 32px;
}

.auth-form {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius);
}

.auth-form .stack {
  display: grid;
  gap: 6px;
}

.auth-form input {
  width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .sweep-status.is-running .sweep-dot { animation: none; }
  .btn, .console-signout, .admin-link { transition: none; }
}

@media (max-width: 640px) {
  .console-bar { padding: 20px; }
  .metric { padding: 18px 20px; border-left: none; border-top: 1px solid var(--line); }
  .metric:first-child { border-top: none; }
  .admin-cols { gap: 32px; }
}
