/* ── BX Reports · Shared Stylesheet ── */

:root {
  --bg: #0b0f17;
  --panel: #111827;
  --panel-strong: #0f1624;
  --border: #1f2633;
  --border-strong: #2d3544;
  --text: #e6edf7;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #f2ae4e;
  --accent-light: #f8c56d;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --info: #38bdf8;
  --purple: #8b5cf6;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
body { font-family: "Helvetica Neue", Arial, sans-serif; margin: 20px; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.handle-link {
  display: inline-block;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ── Release notice and footer ── */
.release-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid rgba(242, 174, 78, 0.34);
  border-radius: 8px;
  background: #15131a;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
.report-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.report-footer a { color: var(--accent-light); font-weight: 700; }
.footer-separator { color: var(--muted-2); }

/* ── Navigation ── */
.nav-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; align-items: center; }
.nav-bar h1 { margin: 0 8px 0 0; font-size: 22px; color: var(--accent); }
.btn { display: inline-block; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; }
.btn:hover { background: #1a2333; }
.btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* ── Meta bar ── */
.meta { margin-bottom: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* ── Stat grid ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat-box { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; }
.stat-value {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Cards & sections ── */
.card { background: var(--panel-strong); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: 0 6px 16px rgba(0,0,0,0.35); }
.section-title { font-weight: 700; color: var(--accent); margin-bottom: 8px; font-size: 16px; }
.subtitle { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.section-desc { color: var(--muted); font-size: 12px; margin-bottom: 12px; }

/* ── Layout utilities ── */
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 12px; }
.grid-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 12px; }
.ellipsis { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.empty-card { padding: 18px 20px; background: var(--panel-strong); border: 1px solid var(--border); border-radius: 10px; color: var(--muted); margin-bottom: 20px; }

/* ── Tables ── */
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 12px; }
.table-status { font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--panel); color: var(--accent); position: sticky; top: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; z-index: 1; }
tr:nth-child(even) td { background: var(--panel-strong); }
tr:nth-child(odd) td { background: #0b111d; }
tr:hover td { background: #1a2333; }

/* ── Domain badges ── */
.domain-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.domain-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 0.2px; }
.badge-whale { background: #3b82f6; color: #fff; }
.badge-privacy { background: #8b5cf6; color: #fff; }
.badge-anomaly { background: #ef4444; color: #fff; }
.badge-network { background: #22c55e; color: #062814; }
.badge-mining { background: #f59e0b; color: var(--bg); }

/* ── Tags ── */
.tag { display: inline-block; padding: 2px 6px; margin: 1px; border-radius: 4px; font-size: 10px; }
.addr-link { color: #60a5fa; }
.addr-link:hover { text-decoration: underline; }

/* ── Direction colors ── */
.direction-sent { color: #ef4444; }
.direction-received { color: #22c55e; }
.value-sent { color: #f87171; }
.value-recv { color: #4ade80; }

/* ── Inline charts (DOM-based) ── */
.chart-container { height: 200px; position: relative; margin: 10px 0; overflow: hidden; }
.chart-bar { position: absolute; bottom: 30px; border-radius: 2px 2px 0 0; min-width: 1px; }
.chart-label { position: absolute; bottom: 5px; font-size: 10px; color: var(--muted); text-align: center; }
.chart-value { position: absolute; font-size: 9px; color: var(--text); text-align: center; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-color { width: 12px; height: 12px; border-radius: 2px; }

/* ── SVG chart containers ── */
.chart-wrap { margin: 16px 0; overflow: visible; }
.chart-wrap svg { display: block; width: 100%; }

/* ── Bar components ── */
.bar-container { height: 20px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bar { height: 100%; border-radius: 4px; transition: width 0.3s ease; }

/* ── Loading skeletons ── */
.skeleton { background: linear-gradient(90deg, var(--panel-strong) 25%, #182030 50%, var(--panel-strong) 75%); background-size: 200% 100%; animation: skeleton-pulse 1.5s ease-in-out infinite; border-radius: 6px; }
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-stat { height: 60px; }
.skeleton-row { height: 40px; margin-bottom: 4px; }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 60%; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

/* ── Score coloring ── */
.score-bad { color: var(--bad); }
.score-good { color: var(--good); }

/* ── Print ── */
@media print {
  body { background: #fff; color: #111; margin: 10mm; }
  .nav-bar, .btn, .release-banner { display: none !important; }
  .card, .stat-box, .meta, .chart-wrap { border-color: #ddd; background: #f9f9f9; box-shadow: none; }
  .stat-value, .section-title, th { color: #333; }
  a { color: #333; }
  tr:hover td { background: inherit; }
  .domain-badge { border: 1px solid #999; }
  .skeleton { display: none; }
}

@media (max-width: 640px) {
  .table-tools { flex-direction: column; align-items: flex-start; }
}
