/* =====================================================
   Coinbase Design System — Theme CSS
   Based on DESIGN.md specification
   ===================================================== */

/* --- Design Tokens --- */
:root {
  /* Brand */
  --cb-primary: #0052ff;
  --cb-primary-active: #003ecc;
  --cb-primary-disabled: #a8b8cc;
  --cb-ink: #0a0b0d;
  --cb-body: #5b616e;
  --cb-body-strong: #0a0b0d;
  --cb-muted: #7c828a;
  --cb-muted-soft: #a8acb3;
  --cb-hairline: #dee1e6;
  --cb-hairline-soft: #eef0f3;
  --cb-border-color: #dee1e6;
  --cb-canvas: #ffffff;
  --cb-surface-soft: #f7f7f7;
  --cb-surface-card: #ffffff;
  --cb-surface-strong: #eef0f3;
  --cb-surface-dark: #0a0b0d;
  --cb-surface-dark-elevated: #16181c;
  --cb-on-primary: #ffffff;
  --cb-on-dark: #ffffff;
  --cb-on-dark-soft: #a8acb3;
  --cb-semantic-up: #05b169;
  --cb-semantic-down: #cf202f;
  --cb-accent-yellow: #f4b000;

  /* Typography */
  --cb-font-display: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --cb-font-sans: 'Inter', -apple-system, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --cb-font-mono: 'JetBrains Mono', 'Geist Mono', 'SF Mono', ui-monospace, monospace;

  /* Rounded */
  --cb-radius-xs: 4px;
  --cb-radius-sm: 8px;
  --cb-radius-md: 12px;
  --cb-radius-lg: 16px;
  --cb-radius-xl: 24px;
  --cb-radius-pill: 100px;
  --cb-radius-full: 9999px;

  /* Spacing */
  --cb-space-xxs: 4px;
  --cb-space-xs: 8px;
  --cb-space-sm: 12px;
  --cb-space-base: 16px;
  --cb-space-md: 20px;
  --cb-space-lg: 24px;
  --cb-space-xl: 32px;
  --cb-space-xxl: 48px;
  --cb-space-section: 96px;

  /* Elevation */
  --cb-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.04);
  --cb-shadow-nav: 0 1px 0 var(--cb-hairline-soft);
  --cb-card-bg: #ffffff;
  --cb-modal-backdrop: rgba(0, 0, 0, 0.4);
  --cb-shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.25);

  /* Component sizes */
  --cb-nav-height: 64px;
  --cb-btn-height: 44px;
  --cb-btn-pill-cta-height: 56px;
  --cb-input-height: 48px;
  --cb-search-height: 44px;
}

/* --- Dark Mode Overrides --- */
:root[data-theme="dark"] {
  --cb-primary: #3b82f6;
  --cb-primary-active: #60a5fa;
  --cb-primary-disabled: #1e3a5f;
  --cb-ink: #f1f3f5;
  --cb-body: #9ca3af;
  --cb-body-strong: #f1f3f5;
  --cb-muted: #6b7280;
  --cb-muted-soft: #4b5563;
   --cb-hairline: #2d333b;
   --cb-hairline-soft: #22272e;
   --cb-border-color: #2d333b;
   --cb-canvas: #0d1117;
  --cb-surface-soft: #161b22;
  --cb-surface-card: #161b22;
  --cb-surface-strong: #21262d;
  --cb-surface-dark: #010409;
  --cb-surface-dark-elevated: #161b22;
  --cb-on-primary: #ffffff;
  --cb-on-dark: #f1f3f5;
  --cb-on-dark-soft: #8b949e;
  --cb-shadow-card: 0 4px 12px rgba(0, 0, 0, 0.3);
  --cb-shadow-nav: 0 1px 0 var(--cb-hairline-soft);
  --cb-card-bg: #161b22;
  --cb-modal-backdrop: rgba(0, 0, 0, 0.6);
  --cb-shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* =====================================================
   Base Reset
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--cb-font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--cb-body);
  background: var(--cb-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--cb-primary);
  text-decoration: none;
}
a:hover {
  color: var(--cb-primary-active);
  text-decoration: underline;
}

/* =====================================================
   Typography
   ===================================================== */
.cb-display-mega {
  font-family: var(--cb-font-display);
  font-size: 80px;
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -2px;
}
.cb-display-xl {
  font-family: var(--cb-font-display);
  font-size: 64px;
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -1.6px;
}
.cb-display-lg {
  font-family: var(--cb-font-display);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -1.3px;
}
.cb-display-md {
  font-family: var(--cb-font-display);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.09;
  letter-spacing: -1px;
}
.cb-display-sm {
  font-family: var(--cb-font-sans);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.11;
  letter-spacing: -0.5px;
}
.cb-title-lg {
  font-family: var(--cb-font-sans);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.13;
  letter-spacing: -0.4px;
}
.cb-title-md {
  font-family: var(--cb-font-sans);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.33;
}
.cb-title-sm {
  font-family: var(--cb-font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}
.cb-body {
  font-family: var(--cb-font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}
.cb-body-strong {
  font-family: var(--cb-font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}
.cb-body-sm {
  font-family: var(--cb-font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
.cb-caption {
  font-family: var(--cb-font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.cb-caption-strong {
  font-family: var(--cb-font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.cb-number {
  font-family: var(--cb-font-mono);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
}
.cb-number-sm {
  font-family: var(--cb-font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

/* =====================================================
   Navigation
   ===================================================== */
.cb-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--cb-nav-height);
  padding: 0 var(--cb-space-lg);
  background: var(--cb-canvas);
  border-bottom: 1px solid var(--cb-hairline-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.cb-nav-inner {
  display: flex;
  align-items: center;
  gap: var(--cb-space-lg);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.cb-nav-brand {
  font-family: var(--cb-font-display);
  font-size: 20px;
  font-weight: 400;
  color: var(--cb-ink);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.3px;
}
.cb-nav-brand:hover {
  color: var(--cb-ink);
  text-decoration: none;
}
.cb-nav-brand em {
  font-style: normal;
  color: var(--cb-primary);
}

.cb-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--cb-space-sm);
  margin-left: auto;
}

.cb-nav-user {
  font-family: var(--cb-font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--cb-body);
  padding-right: var(--cb-space-sm);
  border-right: 1px solid var(--cb-hairline-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =====================================================
   Buttons
   ===================================================== */
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--cb-font-sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.15;
  border: none;
  cursor: pointer;
  padding: 12px 20px;
  height: var(--cb-btn-height);
  border-radius: var(--cb-radius-pill);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.cb-btn:hover {
  text-decoration: none;
}
.cb-btn:active {
  transform: scale(0.98);
}

.cb-btn-primary {
  background: var(--cb-primary);
  color: var(--cb-on-primary);
}
.cb-btn-primary:hover {
  background: var(--cb-primary-active);
  color: var(--cb-on-primary);
}
.cb-btn-primary:disabled {
  background: var(--cb-primary-disabled);
  color: var(--cb-on-primary);
  cursor: not-allowed;
  transform: none;
}

.cb-btn-secondary {
  background: var(--cb-surface-strong);
  color: var(--cb-ink);
}
.cb-btn-secondary:hover {
  background: var(--cb-hairline);
  color: var(--cb-ink);
}

.cb-btn-ghost {
  background: transparent;
  color: var(--cb-body);
  padding: 8px 12px;
  height: auto;
}
.cb-btn-ghost:hover {
  background: var(--cb-surface-strong);
  color: var(--cb-ink);
}

.cb-btn-sm {
  padding: 8px 16px;
  height: 36px;
  font-size: 14px;
}

.cb-btn-xs {
  padding: 4px 12px;
  height: 28px;
  font-size: 13px;
  border-radius: var(--cb-radius-pill);
}

.cb-btn-pill-cta {
  height: var(--cb-btn-pill-cta-height);
  padding: 16px 32px;
  font-size: 18px;
}

/* Semantic buttons */
.cb-btn-success {
  background: var(--cb-semantic-up);
  color: #fff;
}
.cb-btn-success:hover {
  background: #059a5a;
  color: #fff;
}
.cb-btn-danger {
  background: var(--cb-semantic-down);
  color: #fff;
}
.cb-btn-danger:hover {
  background: #b01b28;
  color: #fff;
}

.cb-btn-outline {
  background: transparent;
  color: var(--cb-ink);
  border: 1px solid var(--cb-hairline);
}
.cb-btn-outline:hover {
  border-color: var(--cb-body);
  color: var(--cb-ink);
}

/* =====================================================
   Cards
   ===================================================== */
.cb-card {
  background: var(--cb-surface-card);
  border-radius: var(--cb-radius-xl);
  padding: var(--cb-space-xl);
  border: 1px solid var(--cb-hairline-soft);
  transition: box-shadow 0.2s;
}

.cb-card-hover:hover {
  box-shadow: var(--cb-shadow-card);
}

.cb-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--cb-space-base);
  gap: var(--cb-space-sm);
}

.cb-card-title {
  font-family: var(--cb-font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--cb-ink);
  margin: 0;
}

.cb-card-subtitle {
  font-size: 14px;
  color: var(--cb-muted);
}

/* =====================================================
   Form Controls
   ===================================================== */
.cb-input {
  font-family: var(--cb-font-sans);
  font-size: 16px;
  font-weight: 400;
  color: var(--cb-ink);
  background: var(--cb-canvas);
  border: 1px solid var(--cb-hairline);
  border-radius: var(--cb-radius-md);
  padding: 14px 16px;
  height: var(--cb-input-height);
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cb-input:focus {
  border-color: var(--cb-primary);
  box-shadow: 0 0 0 2px rgba(0, 82, 255, 0.15);
}
.cb-input::placeholder {
  color: var(--cb-muted-soft);
}

.cb-select {
  font-family: var(--cb-font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--cb-ink);
  background: var(--cb-canvas);
  border: 1px solid var(--cb-hairline);
  border-radius: var(--cb-radius-pill);
  padding: 8px 16px;
  height: 36px;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235b616e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color 0.15s;
}
.cb-select:focus {
  border-color: var(--cb-primary);
}

.cb-search-input {
  display: flex;
  align-items: center;
  background: var(--cb-surface-strong);
  border-radius: var(--cb-radius-pill);
  padding: 0 20px;
  height: var(--cb-search-height);
  gap: 8px;
}
.cb-search-input .cb-search-icon {
  color: var(--cb-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.cb-search-input input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--cb-font-sans);
  font-size: 16px;
  color: var(--cb-ink);
  width: 100%;
  height: 100%;
}
.cb-search-input input::placeholder {
  color: var(--cb-muted-soft);
}

/* =====================================================
   Labels & Badges
   ===================================================== */
.cb-label {
  display: inline-block;
  font-family: var(--cb-font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--cb-body);
  margin-bottom: 6px;
}

.cb-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--cb-font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--cb-radius-pill);
  background: var(--cb-surface-strong);
  color: var(--cb-ink);
  white-space: nowrap;
}

.cb-badge-success {
  background: rgba(5, 177, 105, 0.12);
  color: var(--cb-semantic-up);
}
.cb-badge-danger {
  background: rgba(207, 32, 47, 0.12);
  color: var(--cb-semantic-down);
}
.cb-badge-warning {
  background: rgba(244, 176, 0, 0.15);
  color: #b8860b;
}
.cb-badge-info {
  background: rgba(0, 82, 255, 0.1);
  color: var(--cb-primary);
}
.cb-badge-neutral {
  background: var(--cb-surface-strong);
  color: var(--cb-muted);
}

/* =====================================================
   Tables
   ===================================================== */
.cb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cb-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--cb-font-sans);
  font-size: 14px;
  color: var(--cb-body);
}
.cb-table thead th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--cb-muted);
  padding: 12px var(--cb-space-base);
  border-bottom: 1px solid var(--cb-hairline-soft);
  text-align: left;
  white-space: nowrap;
}
.cb-table tbody td {
  padding: 14px var(--cb-space-base);
  border-bottom: 1px solid var(--cb-hairline-soft);
  vertical-align: middle;
}
.cb-table tbody tr:last-child td {
  border-bottom: none;
}
.cb-table tbody tr:hover {
  background: var(--cb-surface-soft);
}

/* =====================================================
   Stats Grid
   ===================================================== */
.cb-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--cb-space-base);
}

.cb-stat-card {
  background: var(--cb-surface-card);
  border-radius: var(--cb-radius-xl);
  padding: var(--cb-space-lg);
  border: 1px solid var(--cb-hairline-soft);
  position: relative;
  overflow: hidden;
}

.cb-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--cb-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--cb-space-sm);
  color: #fff;
  font-size: 18px;
}
.cb-stat-icon.blue { background: var(--cb-primary); }
.cb-stat-icon.green { background: var(--cb-semantic-up); }
.cb-stat-icon.amber { background: #f4b000; }
.cb-stat-icon.gray { background: var(--cb-muted); }

.cb-stat-number {
  font-family: var(--cb-font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--cb-ink);
  line-height: 1.2;
  margin-bottom: 2px;
}

.cb-stat-label {
  font-size: 14px;
  color: var(--cb-muted);
}

/* =====================================================
   Alerts
   ===================================================== */
.cb-alert {
  padding: var(--cb-space-base) var(--cb-space-lg);
  border-radius: var(--cb-radius-md);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: var(--cb-space-sm);
}
.cb-alert-danger {
  background: rgba(207, 32, 47, 0.08);
  color: var(--cb-semantic-down);
  border: 1px solid rgba(207, 32, 47, 0.15);
}
.cb-alert-warning {
  background: rgba(244, 176, 0, 0.1);
  color: #b8860b;
  border: 1px solid rgba(244, 176, 0, 0.15);
}
.cb-alert-info {
  background: rgba(0, 82, 255, 0.08);
  color: var(--cb-primary);
  border: 1px solid rgba(0, 82, 255, 0.12);
}

/* =====================================================
   Page Layout
   ===================================================== */
.cb-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--cb-space-xl) var(--cb-space-lg);
}

.cb-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--cb-space-xl);
  flex-wrap: wrap;
  gap: var(--cb-space-sm);
  background: var(--cb-surface-card);
  border: 1px solid var(--cb-hairline-soft);
  border-radius: var(--cb-radius-xl);
  padding: var(--cb-space-lg) var(--cb-space-xl);
}

.cb-page-title {
  font-family: var(--cb-font-sans);
  font-size: 24px;
  font-weight: 600;
  color: var(--cb-ink);
  margin: 0;
}

.cb-section {
  margin-bottom: var(--cb-space-xl);
}

.cb-section-title {
  font-family: var(--cb-font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--cb-ink);
  margin: 0 0 var(--cb-space-base) 0;
}

/* =====================================================
   Toolbar
   ===================================================== */
.cb-toolbar {
  display: flex;
  align-items: center;
  gap: var(--cb-space-sm);
  flex-wrap: wrap;
}

/* =====================================================
   Grid helpers
   ===================================================== */
.cb-row {
  display: grid;
  gap: var(--cb-space-base);
}
.cb-row-2 { grid-template-columns: repeat(2, 1fr); }
.cb-row-3 { grid-template-columns: repeat(3, 1fr); }
.cb-row-4 { grid-template-columns: repeat(4, 1fr); }

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1024px) {
  .cb-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cb-nav {
    padding: 0 var(--cb-space-base);
    height: 56px;
  }
  .cb-page {
    padding: var(--cb-space-base);
  }
  .cb-stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--cb-space-xs);
  }
  .cb-stat-number {
    font-size: 22px;
  }
  .cb-row-2, .cb-row-3, .cb-row-4 {
    grid-template-columns: 1fr;
  }
  .cb-card {
    padding: var(--cb-space-base);
    border-radius: var(--cb-radius-lg);
  }
  .cb-btn-sm-responsive {
    padding: 6px 12px;
    font-size: 13px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .cb-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cb-nav-brand {
    font-size: 17px;
  }
  .cb-page-title {
    font-size: 20px;
  }
}

/* =====================================================
   DataTables overrides for Coinbase look
   ===================================================== */
.dataTables_wrapper .dataTables_length select {
  font-family: var(--cb-font-sans);
  font-size: 14px;
  padding: 4px 24px 4px 8px;
  border: 1px solid var(--cb-hairline);
  border-radius: var(--cb-radius-pill);
  background: var(--cb-canvas);
  color: var(--cb-ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%235b616e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.dataTables_wrapper .dataTables_filter input {
  font-family: var(--cb-font-sans);
  font-size: 14px;
  padding: 8px 16px;
  border: 1px solid var(--cb-hairline);
  border-radius: var(--cb-radius-pill);
  background: var(--cb-surface-strong);
  color: var(--cb-ink);
  outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--cb-primary);
}

.dataTables_wrapper .dataTables_info {
  font-size: 13px;
  color: var(--cb-muted);
  padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate {
  padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  font-family: var(--cb-font-sans);
  font-size: 13px;
  padding: 4px 12px !important;
  border-radius: var(--cb-radius-pill) !important;
  border: 1px solid var(--cb-hairline-soft) !important;
  background: transparent !important;
  color: var(--cb-body) !important;
  margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--cb-primary) !important;
  color: var(--cb-on-primary) !important;
  border-color: var(--cb-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--cb-surface-strong) !important;
  border-color: var(--cb-hairline) !important;
}

/* =====================================================
   Utility
   ===================================================== */
.cb-mono { font-family: var(--cb-font-mono); }
.cb-muted { color: var(--cb-muted); }
.cb-text-body { color: var(--cb-body); }
.cb-text-ink { color: var(--cb-ink); }
.cb-mt-sm { margin-top: var(--cb-space-sm); }
.cb-mt-base { margin-top: var(--cb-space-base); }
.cb-mt-lg { margin-top: var(--cb-space-lg); }
.cb-mb-sm { margin-bottom: var(--cb-space-sm); }
.cb-mb-base { margin-bottom: var(--cb-space-base); }
.cb-mb-lg { margin-bottom: var(--cb-space-lg); }
.cb-gap-sm { gap: var(--cb-space-sm); }
.cb-gap-base { gap: var(--cb-space-base); }
.cb-flex { display: flex; }
.cb-flex-center { display: flex; align-items: center; }
.cb-flex-between { display: flex; align-items: center; justify-content: space-between; }
.cb-flex-wrap { flex-wrap: wrap; }
.cb-hidden { display: none; }
.cb-text-center { text-align: center; }
.cb-fw-bold { font-weight: 600; }

/* =====================================================
   Login page specific
   ===================================================== */
.cb-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cb-canvas);
  padding: var(--cb-space-base);
}

.cb-login-card {
  background: var(--cb-surface-card);
  border-radius: var(--cb-radius-xl);
  padding: var(--cb-space-xxl);
  max-width: 400px;
  width: 100%;
  border: 1px solid var(--cb-hairline-soft);
}

.cb-login-header {
  text-align: center;
  margin-bottom: var(--cb-space-xl);
}

.cb-login-header .cb-logo {
  font-family: var(--cb-font-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: var(--cb-ink);
  margin-bottom: 4px;
}
.cb-login-header .cb-logo em {
  font-style: normal;
  color: var(--cb-primary);
}
.cb-login-header p {
  font-size: 14px;
  color: var(--cb-muted);
  margin: 0;
}

.cb-input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.cb-input-group .cb-input-icon {
  position: absolute;
  left: 16px;
  color: var(--cb-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.cb-input-group .cb-input {
  padding-left: 44px;
}

/* =====================================================
   Empty state
   ===================================================== */
.cb-empty {
  text-align: center;
  padding: var(--cb-space-xxl) var(--cb-space-lg);
  color: var(--cb-muted);
}
.cb-empty-icon {
  font-size: 40px;
  margin-bottom: var(--cb-space-base);
  opacity: 0.4;
}

/* =====================================================
   Animations — page transitions & micro-interactions
   ===================================================== */

/* ── Page entrance ── */
.cb-page {
  animation: cbPageIn 0.35s ease-out;
}
@keyframes cbPageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Staggered card entry ── */
.cb-stagger > * {
  animation: cbSlideUp 0.4s ease-out both;
}
.cb-stagger > *:nth-child(1) { animation-delay: 0.00s; }
.cb-stagger > *:nth-child(2) { animation-delay: 0.05s; }
.cb-stagger > *:nth-child(3) { animation-delay: 0.10s; }
.cb-stagger > *:nth-child(4) { animation-delay: 0.15s; }
.cb-stagger > *:nth-child(5) { animation-delay: 0.20s; }
.cb-stagger > *:nth-child(6) { animation-delay: 0.25s; }
.cb-stagger > *:nth-child(7) { animation-delay: 0.30s; }
.cb-stagger > *:nth-child(8) { animation-delay: 0.35s; }
.cb-stagger > *:nth-child(9) { animation-delay: 0.40s; }
.cb-stagger > *:nth-child(10) { animation-delay: 0.45s; }
@keyframes cbSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Card hover lift ── */
.cb-card {
  transition: box-shadow 0.2s, transform 0.2s;
}
.cb-card-hover:hover {
  transform: translateY(-2px);
}

/* ── Nav active underline animation ── */
.cb-nav-link {
  position: relative;
}
.cb-nav-link-active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--cb-primary);
  animation: cbNavIn 0.3s ease-out;
}
@keyframes cbNavIn {
  from { width: 0; opacity: 0; }
  to { width: 16px; opacity: 1; }
}

/* ── Stat number scale-in ── */
.cb-stat-number {
  animation: cbCountIn 0.5s ease-out both;
}
.cb-stat-card:nth-child(1) .cb-stat-number { animation-delay: 0.05s; }
.cb-stat-card:nth-child(2) .cb-stat-number { animation-delay: 0.10s; }
.cb-stat-card:nth-child(3) .cb-stat-number { animation-delay: 0.15s; }
.cb-stat-card:nth-child(4) .cb-stat-number { animation-delay: 0.20s; }
@keyframes cbCountIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Skeleton shimmer ── */
.cb-skeleton {
  background: linear-gradient(
    90deg,
    var(--cb-surface-strong) 25%,
    var(--cb-hairline-soft) 50%,
    var(--cb-surface-strong) 75%
  );
  background-size: 200% 100%;
  animation: cbShimmer 1.5s ease-in-out infinite;
  border-radius: var(--cb-radius-sm);
}
@keyframes cbShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Refresh icon spin ── */
.cb-spin-icon {
  display: inline-flex;
  transition: transform 0.3s;
}
.cb-spin-icon.spinning {
  animation: cbSpinIcon 0.6s ease-in-out infinite;
}
@keyframes cbSpinIcon {
  to { transform: rotate(360deg); }
}

/* ── Pulse dot for status ── */
.cb-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cb-semantic-up);
  animation: cbPulse 1.5s ease-in-out infinite;
}
.cb-pulse-dot.warn { background: var(--cb-accent-yellow); }
.cb-pulse-dot.err { background: var(--cb-semantic-down); }
@keyframes cbPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ── Fade-in helper ── */
.cb-fade-in {
  animation: cbFadeIn 0.3s ease-out;
}
@keyframes cbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Slide-down (mobile nav) ── */
.cb-slide-down {
  animation: cbSlideDown 0.2s ease-out;
}
@keyframes cbSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Row hover transition ── */
.cb-table tbody tr {
  transition: background 0.15s;
}

/* =====================================================
   Loading spinner
   ===================================================== */
.cb-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--cb-hairline);
  border-top-color: var(--cb-primary);
  border-radius: 50%;
  animation: cb-spin 0.6s linear infinite;
}
@keyframes cb-spin {
  to { transform: rotate(360deg); }
}

.cb-loading {
  text-align: center;
  padding: var(--cb-space-xxl);
  color: var(--cb-muted);
}

/* =====================================================
   Page specific: log viewer (scheduler)
   ===================================================== */
.cb-log-viewer {
  border: 1px solid var(--cb-hairline-soft);
  border-radius: var(--cb-radius-md);
  background: var(--cb-canvas);
  padding: var(--cb-space-base);
  height: 65vh;
  overflow: auto;
}
.cb-log-viewer pre {
  margin: 0;
  font-family: var(--cb-font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--cb-body);
  white-space: pre-wrap;
}

/* =====================================================
   Page specific: source map
   ===================================================== */
.cb-map-wrap {
  position: relative;
  width: 100%;
  height: clamp(320px, 40vw, 500px);
  min-height: 320px;
}
#source-map {
  width: 100%;
  height: 100%;
}
#source-map-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cb-muted);
  pointer-events: none;
}
#source-map-empty.cb-hidden {
  display: none;
}

/* =====================================================
   Mobile cards (dashboard)
   ===================================================== */
.cb-mobile-card {
  background: var(--cb-surface-card);
  border: 1px solid var(--cb-hairline-soft);
  border-radius: var(--cb-radius-lg);
  padding: var(--cb-space-base);
  margin-bottom: var(--cb-space-sm);
}

.cb-mobile-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cb-ink);
  margin-bottom: var(--cb-space-xs);
  word-break: break-word;
}

.cb-mobile-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--cb-muted);
  margin-bottom: var(--cb-space-sm);
}

.cb-mobile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =====================================================
   Dark hero band (Coinbase signature pattern)
   ===================================================== */
.cb-hero-dark {
  background: var(--cb-surface-dark);
  color: var(--cb-on-dark);
  padding: var(--cb-space-section) var(--cb-space-lg);
  text-align: center;
}

/* =====================================================
   Source badges
   ===================================================== */
.cb-source-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--cb-radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 82, 255, 0.08);
  color: var(--cb-primary);
}

/* =====================================================
   Section label (badge-pill style)
   ===================================================== */
.cb-section-label {
  display: inline-block;
  font-family: var(--cb-font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--cb-radius-pill);
  background: var(--cb-surface-strong);
  color: var(--cb-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--cb-space-sm);
}

/* =====================================================
   Responsive card grid for mobile view
   ===================================================== */
.cb-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--cb-space-base);
}

@media (max-width: 768px) {
  #table-container { display: none !important; }
  .cb-card-grid { display: grid; }
}

/* Hide CB card grid on desktop (only shown on mobile as table replacement) */
.cb-card-grid.cb-only-mobile {
  display: none;
}
@media (max-width: 768px) {
  .cb-card-grid.cb-only-mobile {
    display: grid;
  }
}