/* ============================================================================
   PolyHunter brand system — shared by /bot/dashboard, /portal/, /portal/admin
   Lifted from the landing's ph-styles.css so the dashboards match the marketing
   site. Keep tokens here as source of truth; templates should only style their
   own internal layout with `.card`, `.btn-gold`, `.stat-hero`, etc.
   ============================================================================ */

:root {
  --bg:        #0A0E1A;
  --bg-2:      #0F1424;
  --surface:   #141B2D;
  --surface-2: #1A2238;
  --line:      #1E2638;
  --line-soft: rgba(255,255,255,0.06);
  --gold:      #FFC857;
  --gold-deep: #E2A93C;
  --mint:      #6EE7B7;
  --coral:     #F87171;
  --ink:       #F5F5F4;
  --ink-soft:  #CBD5E1;
  --muted:     #94A3B8;
  --muted-dim: #64748B;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Satoshi','Inter',system-ui,sans-serif;
  font-feature-settings: "ss01","cv01";
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Typography helpers */
.font-display { font-family: 'Satoshi','Inter',sans-serif; letter-spacing: -0.025em; }
.font-mono, .num, code, pre {
  font-family: 'Geist Mono','JetBrains Mono',ui-monospace,'SFMono-Regular',monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  font-feature-settings: "tnum","ss01","zero";
}

/* Colors */
.text-gold  { color: var(--gold); }
.text-mint  { color: var(--mint); }
.text-coral { color: var(--coral); }
.text-ink   { color: var(--ink); }
.text-muted { color: var(--muted); }
.bg-bg      { background: var(--bg); }
.bg-bg2     { background: var(--bg-2); }
.bg-surface { background: var(--surface); }

.pos { color: var(--mint); }
.neg { color: var(--coral); }

/* Surfaces */
.card {
  background: linear-gradient(135deg, rgba(20,27,45,0.9), rgba(15,20,36,0.7));
  border: 1px solid rgba(255,200,87,0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.30);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card.compact { padding: 16px; border-radius: 14px; }
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.40), 0 0 24px rgba(255,200,87,0.05);
}
.card.flat { box-shadow: none; }
.card.flat:hover { transform: none; box-shadow: none; }

.glow-gold { box-shadow: 0 0 24px rgba(255,200,87,0.15); }
.glow-mint { box-shadow: 0 0 24px rgba(110,231,183,0.15); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s ease, transform .1s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
  line-height: 1;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #0A0E1A;
  font-weight: 700;
  border: none;
}
.btn-gold:hover { filter: brightness(1.08); transform: scale(1.01); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost:hover { border-color: rgba(255,200,87,0.6); color: var(--gold); }
.btn-mint {
  background: linear-gradient(135deg, var(--mint), #34d399);
  color: #0A0E1A;
  font-weight: 700;
  border: none;
}
.btn-coral {
  background: rgba(248,113,113,0.10);
  color: var(--coral);
  border: 1px solid rgba(248,113,113,0.30);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; filter: none; }

/* Hero number — for primary KPI cards (current value, NAV, etc.) */
.stat-hero {
  font-family: 'Satoshi',sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, var(--gold), var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-label {
  font-family: 'Geist Mono',monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--muted);
}
.stat-value {
  font-family: 'Geist Mono',monospace;
  font-variant-numeric: tabular-nums slashed-zero;
  font-weight: 700;
  font-size: 28px;
  color: var(--ink);
}
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Live dot */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint);
  display: inline-block;
  animation: ph-pulse 2s infinite;
  box-shadow: 0 0 8px rgba(110,231,183,0.6);
}
@keyframes ph-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Tables */
table.ph {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Geist Mono',monospace;
  font-size: 13px;
}
table.ph th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
table.ph td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
table.ph tr:last-child td { border-bottom: none; }
table.ph tr.clickable { cursor: pointer; transition: background .15s; }
table.ph tr.clickable:hover { background: rgba(255,200,87,0.04); }

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'Geist Mono',monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.pill-gold  { background: rgba(255,200,87,0.10); color: var(--gold); border: 1px solid rgba(255,200,87,0.20); }
.pill-mint  { background: rgba(110,231,183,0.10); color: var(--mint); border: 1px solid rgba(110,231,183,0.20); }
.pill-coral { background: rgba(248,113,113,0.10); color: var(--coral); border: 1px solid rgba(248,113,113,0.20); }
.pill-ghost { background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--line); }

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Geist Mono',monospace;
}
.chip-yes { background: #14532d; color: #bbf7d0; }
.chip-no  { background: #7f1d1d; color: #fecaca; }

/* Filter tabs (range selector) */
.tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: all .15s ease;
}
.tab:hover { color: var(--ink); border-color: rgba(255,200,87,0.20); }
.tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #0A0E1A;
  border-color: transparent;
}

/* Inputs */
input.ph, select.ph, textarea.ph {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 14px;
  font-family: 'Geist Mono',monospace;
  outline: none;
  transition: border-color .15s ease;
  width: 100%;
}
input.ph:focus, select.ph:focus, textarea.ph:focus { border-color: rgba(255,200,87,0.5); }

/* Section spacing */
.section { margin-bottom: 28px; }
.section-title {
  font-family: 'Satoshi',sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

/* Header / navigation */
.ph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.ph-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Satoshi',sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.ph-logo span.brand { color: var(--gold); }
.ph-nav { display: flex; gap: 18px; align-items: center; }
.ph-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .15s;
}
.ph-nav a:hover { color: var(--ink); }
.ph-nav a.active { color: var(--gold); }

/* Mobile tabs (bottom bar) */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  z-index: 50;
}
.tab-bar a {
  flex: 1; text-align: center;
  font-size: 10px;
  font-family: 'Geist Mono',monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.tab-bar a.on { color: var(--gold); }
.tab-bar a div { font-size: 20px; margin-bottom: 4px; }

/* Layout helpers */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 640px; margin: 0 auto; padding: 0 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Utility */
.muted { color: var(--muted); }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.uppercase { text-transform: uppercase; }
.tracking { letter-spacing: 0.08em; }
.tracking-wider { letter-spacing: 0.2em; }

/* Scrollbar (subtle gold) */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,200,87,0.30); }

/* Modal overlay (for wallet-detail / row-detail) */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 80;
  padding: 16px;
}
.modal-bg.open { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid rgba(255,200,87,0.15);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
}
