/* style.css — The Vast Expanses Network Explorer */

/* ===== TYPE SCALE ===== */
:root {
  --text-xs:   clamp(0.6875rem, 0.65rem + 0.2vw, 0.75rem);
  --text-sm:   clamp(0.8125rem, 0.78rem + 0.2vw, 0.875rem);
  --text-base: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-lg:   clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-2xl:  clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);

  /* SPACING */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* FONTS */
  --font-display: 'DM Sans', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* RADIUS */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* TRANSITIONS */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* SIDEBAR WIDTH */
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
}

/* ===== LIGHT MODE ===== */
:root, [data-theme="light"] {
  --color-bg:             #f5f4f0;
  --color-surface:        #faf9f6;
  --color-surface-2:      #ffffff;
  --color-surface-offset: #eeecea;
  --color-surface-offset-2: #e6e4e0;
  --color-surface-dynamic: #dddbd7;
  --color-divider:        #d4d1cc;
  --color-border:         #c8c5be;

  --color-text:           #1a1a1a;
  --color-text-muted:     #6b6963;
  --color-text-faint:     #a8a59e;
  --color-text-inverse:   #f5f4f0;

  --color-primary:        #b8860b;
  --color-primary-hover:  #9a7009;
  --color-primary-active: #7a5907;
  --color-primary-highlight: #f0e6cc;

  --color-secondary:      #0d7377;
  --color-secondary-hover:#0b5f63;
  --color-secondary-active:#094b4e;
  --color-secondary-highlight: #d0ecee;

  --color-success:        #3d8b37;
  --color-success-hover:  #2d6a28;
  --color-success-highlight: #d4e8d2;
  --color-error:          #c23b3b;
  --color-error-hover:    #a02e2e;
  --color-error-highlight: #f0d4d4;
  --color-warning:        #c97d1a;
  --color-warning-hover:  #a86614;
  --color-warning-highlight: #f0e3cc;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 60 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 60 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 60 / 0.12);
}

/* ===== DARK MODE (default) ===== */
[data-theme="dark"] {
  --color-bg:             #0d1117;
  --color-surface:        #131921;
  --color-surface-2:      #171e28;
  --color-surface-offset: #141a22;
  --color-surface-offset-2: #1a212b;
  --color-surface-dynamic: #222a36;
  --color-divider:        #1e2633;
  --color-border:         #2a3344;

  --color-text:           #e0ddd8;
  --color-text-muted:     #8b8a86;
  --color-text-faint:     #515865;
  --color-text-inverse:   #0d1117;

  --color-primary:        #e5a832;
  --color-primary-hover:  #f0be52;
  --color-primary-active: #c48e20;
  --color-primary-highlight: #2a2418;

  --color-secondary:      #45b8bd;
  --color-secondary-hover:#66cdd2;
  --color-secondary-active:#2e9ca0;
  --color-secondary-highlight: #172a2c;

  --color-success:        #5cb85c;
  --color-success-hover:  #4cae4c;
  --color-success-highlight: #1a2e1a;
  --color-error:          #e05555;
  --color-error-hover:    #c94444;
  --color-error-highlight: #2e1a1a;
  --color-warning:        #e8a938;
  --color-warning-hover:  #d49730;
  --color-warning-highlight: #2a2418;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0d1117; --color-surface: #131921; --color-surface-2: #171e28;
    --color-surface-offset: #141a22; --color-surface-offset-2: #1a212b;
    --color-surface-dynamic: #222a36; --color-divider: #1e2633; --color-border: #2a3344;
    --color-text: #e0ddd8; --color-text-muted: #8b8a86; --color-text-faint: #515865;
    --color-text-inverse: #0d1117;
    --color-primary: #e5a832; --color-primary-hover: #f0be52; --color-primary-active: #c48e20;
    --color-primary-highlight: #2a2418;
    --color-secondary: #45b8bd; --color-secondary-hover: #66cdd2; --color-secondary-active: #2e9ca0;
    --color-secondary-highlight: #172a2c;
    --color-success: #5cb85c; --color-success-highlight: #1a2e1a;
    --color-error: #e05555; --color-error-highlight: #2e1a1a;
    --color-warning: #e8a938; --color-warning-highlight: #2a2418;
    --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.25);
    --shadow-md: 0 4px 12px oklch(0 0 0 / 0.35);
    --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.45);
  }
}

/* ===== DASHBOARD LAYOUT ===== */
html, body { height: 100%; overflow: hidden; margin: 0; }

.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr;
  height: 100dvh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-row: 1 / -1;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: width var(--transition-interactive);
  z-index: 20;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}

.sidebar-brand svg {
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.3;
}

.sidebar-nav {
  padding: var(--space-3) var(--space-2);
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--color-text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-interactive),
              color var(--transition-interactive);
  margin-bottom: var(--space-1);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}

.nav-item.active {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
  font-weight: 500;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== HEADER ===== */
.header {
  grid-column: 2;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-10);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}

.header-search input::placeholder { color: var(--color-text-faint); }
.header-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}

.header-search .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}

.header-search .search-shortcut {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-faint);
  background: var(--color-surface-dynamic);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive),
              background var(--transition-interactive);
}
.icon-btn:hover {
  background: var(--color-surface-dynamic);
  color: var(--color-text);
}
.icon-btn svg { width: 18px; height: 18px; }

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
}

/* ===== MAIN CONTENT ===== */
.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  transition: box-shadow var(--transition-interactive);
}

.kpi-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--color-text);
  line-height: 1.2;
}

.kpi-delta {
  font-size: var(--text-xs);
  font-weight: 500;
  margin-top: var(--space-1);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.kpi-delta.positive { color: var(--color-success); }
.kpi-delta.negative { color: var(--color-error); }
.kpi-delta.neutral  { color: var(--color-text-muted); }

/* ===== CHARTS ===== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.chart-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.chart-card canvas {
  width: 100% !important;
  max-height: 260px;
}

/* ===== TABLES ===== */
.table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.table-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.table-filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-btn {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  background: transparent;
  transition: all var(--transition-interactive);
}
.filter-btn:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.filter-btn.active { background: var(--color-primary-highlight); color: var(--color-primary); border-color: var(--color-primary); }

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  font-size: var(--text-sm);
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 500;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  background: var(--color-surface-offset);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-interactive);
}

.data-table th:hover { color: var(--color-text); }
.data-table th.sorted { color: var(--color-primary); }
.data-table th .sort-indicator { margin-left: var(--space-1); opacity: 0.5; }
.data-table th.sorted .sort-indicator { opacity: 1; }

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  font-variant-numeric: tabular-nums lining-nums;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-interactive);
  cursor: pointer;
}
.data-table tbody tr:hover {
  background: var(--color-surface-offset);
}
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===== HEX VALUES ===== */
.hex-value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-secondary);
}

.hex-truncated {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.copy-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-faint);
  transition: all var(--transition-interactive);
  flex-shrink: 0;
}
.copy-btn:hover { color: var(--color-primary); background: var(--color-primary-highlight); }
.copy-btn svg { width: 12px; height: 12px; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.badge-active { background: var(--color-success-highlight); color: var(--color-success); }
.badge-closed { background: var(--color-error-highlight); color: var(--color-error); }
.badge-pending { background: var(--color-warning-highlight); color: var(--color-warning); }
.badge-full { background: var(--color-primary-highlight); color: var(--color-primary); }
.badge-compact { background: var(--color-secondary-highlight); color: var(--color-secondary); }
.badge-heartbeat { background: var(--color-surface-dynamic); color: var(--color-text-muted); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* ===== ACTIVITY FEED ===== */
.activity-feed {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.activity-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}

.activity-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

.activity-list {
  max-height: 400px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  transition: background var(--transition-interactive);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { background: var(--color-surface-offset); }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-icon svg { width: 16px; height: 16px; }
.activity-icon.checkpoint { background: var(--color-primary-highlight); color: var(--color-primary); }
.activity-icon.channel-open { background: var(--color-success-highlight); color: var(--color-success); }
.activity-icon.channel-close { background: var(--color-error-highlight); color: var(--color-error); }
.activity-icon.node-announce { background: var(--color-secondary-highlight); color: var(--color-secondary); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.4;
}

.activity-meta {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ===== DETAIL PANEL / MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.detail-panel {
  width: min(560px, 90vw);
  height: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open .detail-panel {
  transform: translateX(0);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-divider);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}

.panel-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}

.panel-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.panel-close:hover { background: var(--color-surface-dynamic); color: var(--color-text); }

.panel-body {
  padding: var(--space-5);
}

.detail-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  width: 120px;
  flex-shrink: 0;
}

.detail-value {
  font-size: var(--text-sm);
  color: var(--color-text);
  word-break: break-all;
}

/* ===== NETWORK GRAPH ===== */
.graph-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.graph-controls {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  z-index: 5;
}

.graph-controls button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.graph-controls button:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.graph-controls button.active { background: var(--color-primary-highlight); color: var(--color-primary); }

.graph-tooltip {
  position: fixed;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  z-index: 50;
  font-size: var(--text-sm);
  max-width: 250px;
  opacity: 0;
  transition: opacity 100ms ease;
}
.graph-tooltip.visible { opacity: 1; }
.graph-tooltip .tooltip-alias {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.graph-tooltip .tooltip-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ===== SEARCH INPUT ===== */
.search-bar {
  position: relative;
  margin-bottom: var(--space-4);
}

.search-bar input {
  width: 100%;
  max-width: 480px;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-10);
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text);
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.search-bar input::placeholder { color: var(--color-text-faint); }
.search-bar input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-highlight);
}
.search-bar .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}
.search-bar .search-icon svg { width: 16px; height: 16px; }

/* ===== SKELETON LOADING ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-offset) 25%,
    var(--color-surface-dynamic) 50%,
    var(--color-surface-offset) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text { height: 1em; margin-bottom: var(--space-2); width: 80%; }
.skeleton-text:last-child { width: 55%; }
.skeleton-heading { height: 1.5em; width: 40%; margin-bottom: var(--space-4); }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--color-text-muted);
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-4);
  color: var(--color-text-faint);
}
.empty-state h3 {
  color: var(--color-text);
  font-family: var(--font-display);
  margin-bottom: var(--space-2);
}
.empty-state p {
  max-width: 36ch;
  font-size: var(--text-sm);
}

/* ===== TOKEN CARDS ===== */
.token-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* ===== TIMESTAMP TOOLTIP ===== */
.timestamp {
  cursor: default;
  position: relative;
}
.timestamp:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  white-space: nowrap;
  z-index: 40;
  box-shadow: var(--shadow-md);
}

/* ===== EXTERNAL LINK ===== */
a.external-link {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color var(--transition-interactive);
}
a.external-link:hover { color: var(--color-secondary-hover); text-decoration: underline; }

/* ===== VIEW TRANSITIONS ===== */
.view { display: none; }
.view.active { display: block; }

.view.active {
  animation: fadeIn 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 30;
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: oklch(0 0 0 / 0.5);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }

  .header { grid-column: 1; }
  .main { grid-column: 1; padding: var(--space-4); }

  .mobile-menu-btn { display: flex; }

  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }

  .header-search { display: none; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .main { padding: var(--space-3); }
}

/* ===== COLOR DOT ===== */
.node-color-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  flex-shrink: 0;
}

/* ===== TABS ===== */
.view-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 0;
}

.view-tab {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 450;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-interactive);
}
.view-tab:hover { color: var(--color-text); }
.view-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 500;
}

/* ===== VDF SECTION ===== */
.vdf-section {
  margin-bottom: var(--space-6);
}

.vdf-kpi-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

.kpi-card-vdf {
  border-left: 3px solid #a855f7;
}

.vdf-icon {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

[data-theme="light"] .vdf-icon {
  background: rgba(139, 60, 220, 0.10);
  color: #7c3aed;
}

.section-tag-vdf {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  border-color: #a855f7;
}

[data-theme="light"] .section-tag-vdf {
  color: #7c3aed;
  background: rgba(139, 60, 220, 0.10);
  border-color: #7c3aed;
}

[data-theme="light"] .kpi-card-vdf {
  border-left-color: #7c3aed;
}

.badge-vdf {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
}

[data-theme="light"] .badge-vdf {
  background: rgba(139, 60, 220, 0.10);
  color: #7c3aed;
}

/* Security Twin Grid — PoW + VDF side by side */
.security-twin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.security-twin-grid .pow-section,
.security-twin-grid .vdf-section {
  margin-bottom: 0;
}

@media (max-width: 1024px) {
  .security-twin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .vdf-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== POW SECTION ===== */
.pow-section {
  margin-bottom: var(--space-6);
}

.section-header-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.section-header-row .section-title {
  margin-bottom: 0;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--color-primary);
  background: var(--color-primary-highlight);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-full);
  padding: 2px 8px;
  letter-spacing: 0.04em;
}

.pow-kpi-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

.kpi-card-pow {
  border-left: 3px solid var(--color-primary);
}

.kpi-icon-row {
  margin-bottom: var(--space-2);
}

.kpi-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}
.kpi-icon svg {
  width: 18px;
  height: 18px;
}

.pow-icon {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}

/* PoW difficulty tier badges */
.badge-pow-earth {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
.badge-pow-cislunar {
  background: var(--color-secondary-highlight);
  color: var(--color-secondary);
}
.badge-pow-mars {
  background: var(--color-warning-highlight);
  color: var(--color-warning);
}
.badge-pow-deep_space {
  background: var(--color-error-highlight);
  color: var(--color-error);
}

@media (max-width: 480px) {
  .pow-kpi-grid {
    grid-template-columns: 1fr;
  }
}
