/* ═══════════════════════════════════════════════════════════
   CryptoRunAi — Neon Glassmorphism Dark Theme
   Neural Trading Intelligence v2.0
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@300;400;500;700&display=swap');

:root {
  /* ─── Backgrounds ─── */
  --bg:      #040812;
  --bg2:     #060d1a;
  --bg3:     #080f20;

  /* ─── Glass layers ─── */
  --glass:        rgba(8, 18, 38, 0.7);
  --glass-bright: rgba(10, 22, 46, 0.85);
  --glass-modal:  rgba(5, 12, 28, 0.92);

  /* ─── Neon Colors ─── */
  --neon-cyan:    #00f5ff;
  --neon-blue:    #0ea5e9;
  --neon-green:   #06ffa5;
  --neon-red:     #ff2d55;
  --neon-yellow:  #fbbf24;
  --neon-purple:  #a855f7;
  --neon-violet:  #7c3aed;
  --neon-pink:    #ec4899;

  /* ─── Borders ─── */
  --border:        rgba(0, 245, 255, 0.08);
  --border-md:     rgba(0, 245, 255, 0.16);
  --border-bright: rgba(0, 245, 255, 0.35);
  --border-green:  rgba(6, 255, 165, 0.3);
  --border-red:    rgba(255, 45, 85, 0.3);

  /* ─── Text ─── */
  --text:     #d0e4f4;
  --text-dim: #4a6a8a;
  --text-muted: #2a4060;

  /* ─── Fonts ─── */
  --font-mono:    'JetBrains Mono', monospace;
  --font-display: 'Syne', sans-serif;
  --font-code:    'Space Mono', monospace;

  /* ─── Glows ─── */
  --glow-cyan:   0 0 16px rgba(0,245,255,0.5), 0 0 40px rgba(0,245,255,0.2);
  --glow-green:  0 0 16px rgba(6,255,165,0.5), 0 0 40px rgba(6,255,165,0.2);
  --glow-red:    0 0 16px rgba(255,45,85,0.5), 0 0 30px rgba(255,45,85,0.2);
  --glow-purple: 0 0 16px rgba(168,85,247,0.5), 0 0 40px rgba(168,85,247,0.2);

  /* ─── Radii ─── */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ═══════════════════════════
   BACKGROUND SYSTEM
═══════════════════════════ */

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,245,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,245,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 25s linear infinite;
}
@keyframes gridDrift { to { background-position: 48px 48px; } }

.bg-scanlines {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 3px,
    rgba(0,245,255,0.012) 3px, rgba(0,245,255,0.012) 6px
  );
}

.bg-orb {
  position: fixed; border-radius: 50%; pointer-events: none;
  filter: blur(80px); z-index: 0; opacity: 0.12;
}
.orb-1 {
  width: 600px; height: 600px;
  top: -200px; left: -150px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  animation: orbFloat1 20s ease-in-out infinite;
}
.orb-2 {
  width: 500px; height: 500px;
  top: 40%; right: -200px;
  background: radial-gradient(circle, #00f5ff 0%, transparent 70%);
  animation: orbFloat2 18s ease-in-out infinite reverse;
}
.orb-3 {
  width: 400px; height: 400px;
  bottom: -100px; left: 40%;
  background: radial-gradient(circle, #06ffa5 0%, transparent 70%);
  animation: orbFloat3 22s ease-in-out infinite;
}
@keyframes orbFloat1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,30px)} }
@keyframes orbFloat2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-30px,40px)} }
@keyframes orbFloat3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(20px,-30px)} }

/* ═══════════════════════════
   PERMISSION MODAL
═══════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,5,14,0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-box {
  position: relative;
  background: var(--glass-modal);
  border: 1px solid var(--border-md);
  border-radius: var(--r-xl);
  padding: 0;
  max-width: 620px; width: 92%;
  box-shadow:
    0 0 0 1px rgba(0,245,255,0.05),
    0 32px 80px rgba(0,0,0,0.6),
    0 0 80px rgba(0,245,255,0.06),
    inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  animation: modalIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity:0; transform:scale(0.88) translateY(24px); }
  to   { opacity:1; transform:scale(1) translateY(0); }
}

.modal-glow-bar {
  height: 2px; width: 100%;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-purple), var(--neon-cyan), transparent);
  background-size: 200% 100%;
  animation: barShimmer 3s linear infinite;
}
@keyframes barShimmer { to { background-position: -200% 0; } }

.modal-header {
  padding: 32px 40px 24px;
  text-align: center;
}

.modal-brand {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-bottom: 16px;
}

.brand-orb {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: rgba(0,245,255,0.05);
  border: 1px solid var(--border-md);
  border-radius: 50%;
  box-shadow: var(--glow-cyan);
  animation: orbPulse 3s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes orbPulse {
  0%,100% { box-shadow: var(--glow-cyan); }
  50% { box-shadow: 0 0 28px rgba(0,245,255,0.8), 0 0 60px rgba(0,245,255,0.3); }
}

.brand-name {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 800;
  color: var(--text); letter-spacing: -1px;
  line-height: 1;
}
.brand-ai {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-family: var(--font-code); font-size: 10px;
  color: var(--text-dim); letter-spacing: 4px; margin-top: 4px;
}

.modal-desc {
  font-size: 13px; color: var(--text-dim); line-height: 1.6;
  max-width: 480px; margin: 0 auto;
}

/* Permissions List */
.permission-list {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 36px;
  margin-bottom: 20px;
}

.perm-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: rgba(0,245,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all 0.25s ease;
}
.perm-item:hover {
  border-color: var(--border-md);
  background: rgba(0,245,255,0.06);
}

.perm-icon-wrap {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.perm-icon-wrap.notify  { background: rgba(251,191,36,0.1); color: var(--neon-yellow); border: 1px solid rgba(251,191,36,0.2); }
.perm-icon-wrap.storage { background: rgba(0,245,255,0.1);  color: var(--neon-cyan);   border: 1px solid rgba(0,245,255,0.2); }
.perm-icon-wrap.market  { background: rgba(6,255,165,0.1);  color: var(--neon-green);  border: 1px solid rgba(6,255,165,0.2); }
.perm-icon-wrap.ai      { background: rgba(168,85,247,0.1); color: var(--neon-purple); border: 1px solid rgba(168,85,247,0.2); }
.perm-icon-wrap.trade   { background: rgba(14,165,233,0.1); color: var(--neon-blue);   border: 1px solid rgba(14,165,233,0.2); }

.perm-info { flex: 1; min-width: 0; }
.perm-info strong { display: block; font-size: 13px; font-weight: 600; color: var(--text); font-family: var(--font-display); }
.perm-info span   { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

.perm-status {
  font-family: var(--font-code); font-size: 10px; padding: 3px 10px;
  border-radius: 4px; white-space: nowrap; letter-spacing: 1px;
  background: rgba(251,191,36,0.08); color: var(--neon-yellow);
  border: 1px solid rgba(251,191,36,0.25);
}
.perm-status.granted {
  background: rgba(6,255,165,0.08); color: var(--neon-green);
  border-color: rgba(6,255,165,0.25);
}

/* Modal Setup */
.modal-setup {
  display: flex; gap: 12px; padding: 0 36px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.setup-row { flex: 1; min-width: 150px; }
.setup-row label {
  display: block; font-size: 11px; color: var(--text-dim);
  margin-bottom: 6px; font-family: var(--font-code); letter-spacing: 0.5px;
}
.setup-row input, .setup-row select {
  width: 100%;
  background: rgba(0,245,255,0.04);
  border: 1px solid var(--border-md);
  color: var(--neon-cyan); font-family: var(--font-code); font-size: 12px;
  padding: 9px 12px; border-radius: var(--r-sm); outline: none;
  transition: all 0.2s;
  -webkit-appearance: none;
}
.setup-row input:focus, .setup-row select:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0,245,255,0.1), var(--glow-cyan);
  background: rgba(0,245,255,0.07);
}

/* Grant Button */
.btn-grant {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: calc(100% - 72px); margin: 0 36px 14px;
  padding: 15px 24px;
  font-family: var(--font-code); font-size: 13px; letter-spacing: 2px; font-weight: 700;
  background: linear-gradient(135deg, rgba(0,245,255,0.15), rgba(124,58,237,0.15));
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan); border-radius: var(--r-md);
  cursor: pointer; transition: all 0.3s;
  position: relative; overflow: hidden;
  box-shadow: 0 0 24px rgba(0,245,255,0.12), inset 0 1px 0 rgba(255,255,255,0.08);
}
.btn-grant::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,245,255,0.25), rgba(124,58,237,0.25));
  opacity: 0; transition: opacity 0.3s;
}
.btn-grant:hover::before { opacity: 1; }
.btn-grant:hover {
  box-shadow: var(--glow-cyan);
  transform: translateY(-1px);
}
.btn-grant:active { transform: translateY(0); }

.modal-disclaimer {
  text-align: center; font-size: 10px; color: var(--text-dim);
  font-family: var(--font-code); padding-bottom: 28px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ═══════════════════════════
   HEADER
═══════════════════════════ */

.header {
  position: relative; z-index: 10;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(4,8,18,0.9);
  border-bottom: 1px solid var(--border-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0,245,255,0.05), 0 4px 20px rgba(0,0,0,0.5);
}

.logo-area { display: flex; align-items: center; gap: 12px; }

.logo-crystal {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,245,255,0.06);
  border: 1px solid var(--border-md);
  border-radius: 12px;
  box-shadow: var(--glow-cyan);
  animation: crystalPulse 3s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes crystalPulse {
  0%,100% { box-shadow: var(--glow-cyan); }
  50% { box-shadow: 0 0 24px rgba(0,245,255,0.7), 0 0 50px rgba(0,245,255,0.3); }
}

.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px; line-height: 1;
}
.logo-ai {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-sub {
  font-family: var(--font-code); font-size: 8px;
  color: var(--text-dim); letter-spacing: 3px; margin-top: 3px;
}

/* Pills */
.header-pills { display: flex; gap: 6px; flex: 1; justify-content: center; flex-wrap: wrap; }

.pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,245,255,0.04);
  border: 1px solid var(--border);
  border-radius: 24px; padding: 5px 12px;
  font-family: var(--font-code); font-size: 10px; color: var(--text-dim);
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.pill:hover { border-color: var(--border-md); color: var(--text); }
.pill svg { opacity: 0.6; }

.pill-status { border-color: var(--border-md); }
.pill-status.active {
  border-color: rgba(6,255,165,0.4); color: var(--neon-green);
  background: rgba(6,255,165,0.05);
  box-shadow: 0 0 12px rgba(6,255,165,0.1);
}

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--neon-red); box-shadow: 0 0 6px var(--neon-red);
  flex-shrink: 0;
}
.dot.green { background: var(--neon-green); box-shadow: 0 0 6px var(--neon-green); }
.dot.pulse { animation: dotPulse 1s ease-in-out infinite; }
@keyframes dotPulse { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* Header Buttons */
.header-btns { display: flex; gap: 6px; }

.btn-hdr {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px; font-family: var(--font-code);
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  border-radius: var(--r-sm); cursor: pointer;
  transition: all 0.2s; border: 1px solid;
}
.btn-start {
  background: rgba(6,255,165,0.1); border-color: var(--neon-green);
  color: var(--neon-green);
}
.btn-start:hover { background: rgba(6,255,165,0.2); box-shadow: var(--glow-green); transform: translateY(-1px); }

.btn-stop {
  background: rgba(255,45,85,0.1); border-color: var(--neon-red);
  color: var(--neon-red);
}
.btn-stop:hover { background: rgba(255,45,85,0.2); box-shadow: var(--glow-red); transform: translateY(-1px); }

.btn-reset {
  background: rgba(0,245,255,0.06); border-color: var(--border-md);
  color: var(--text-dim);
}
.btn-reset:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); transform: translateY(-1px); }

/* ═══════════════════════════
   STATS BAR
═══════════════════════════ */

.stats-bar {
  position: relative; z-index: 5;
  display: flex; gap: 4px; padding: 6px 8px;
  background: rgba(4,8,18,0.8);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; flex-wrap: wrap;
}
.stats-bar::-webkit-scrollbar { height: 0; }

.stat-card {
  display: flex; flex-direction: column; align-items: flex-start;
  flex: 1; min-width: 100px;
  padding: 9px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  backdrop-filter: blur(10px);
  transition: all 0.25s;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0;
  right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,245,255,0.2), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.stat-card:hover::after { opacity: 1; }
.stat-card:hover { border-color: var(--border-md); background: var(--glass-bright); }

.stat-card.accent-green { border-color: rgba(6,255,165,0.2); }
.stat-card.accent-cyan  { border-color: rgba(0,245,255,0.2); }
.stat-card.accent-yellow{ border-color: rgba(251,191,36,0.2); }

.stat-ico { margin-bottom: 2px; opacity: 0.5; color: var(--text-dim); }
.stat-ico.green-ico { color: var(--neon-green); opacity: 0.8; }
.stat-ico.red-ico   { color: var(--neon-red); opacity: 0.8; }

.sl {
  font-family: var(--font-code); font-size: 9px;
  color: var(--text-dim); letter-spacing: 1px; white-space: nowrap;
  text-transform: uppercase;
}
.sv {
  font-family: var(--font-code); font-size: 15px;
  font-weight: 700; color: var(--text); white-space: nowrap;
  margin-top: 1px;
}
.sv.green  { color: var(--neon-green);  }
.sv.red    { color: var(--neon-red);    }
.sv.cyan   { color: var(--neon-cyan);   }
.sv.yellow { color: var(--neon-yellow); }

/* ═══════════════════════════
   MAIN GRID
═══════════════════════════ */

.main-grid {
  position: relative; z-index: 5;
  display: grid;
  grid-template-columns: 300px 1fr 260px;
  grid-template-rows: calc(100vh - 210px);
  gap: 4px; padding: 4px;
  min-height: 400px;
}

/* ═══════════════════════════
   PANELS (base glass style)
═══════════════════════════ */

.panel {
  display: flex; flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.3s;
}
.panel:hover { border-color: var(--border-md); }
.panel::before {
  content: ''; position: absolute;
  top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,245,255,0.15), transparent);
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(0,245,255,0.02);
}

.ph-left { display: flex; align-items: center; gap: 8px; }

/* Panel icon badges */
.p-icon-badge {
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ai-badge        { background: rgba(168,85,247,0.15); color: var(--neon-purple); border: 1px solid rgba(168,85,247,0.25); }
.market-badge    { background: rgba(0,245,255,0.12);  color: var(--neon-cyan);   border: 1px solid rgba(0,245,255,0.2); }
.portfolio-badge { background: rgba(6,255,165,0.12);  color: var(--neon-green);  border: 1px solid rgba(6,255,165,0.2); }
.chart-badge     { background: rgba(14,165,233,0.12); color: var(--neon-blue);   border: 1px solid rgba(14,165,233,0.2); }
.trades-badge    { background: rgba(0,245,255,0.1);   color: var(--neon-cyan);   border: 1px solid rgba(0,245,255,0.18); }
.log-badge       { background: rgba(74,106,138,0.2);  color: var(--text-dim);    border: 1px solid rgba(74,106,138,0.3); }

.ptitle {
  font-family: var(--font-code); font-size: 10px; font-weight: 700;
  letter-spacing: 2px; color: var(--text); text-transform: uppercase;
}

/* ═══════════════════════════
   AI BRAIN PANEL
═══════════════════════════ */

.thinking-indicator { display: flex; gap: 4px; align-items: center; }
.think-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--neon-cyan); opacity: 0;
  animation: thinkPulse 1.4s ease-in-out infinite;
}
.think-dot:nth-child(2) { animation-delay: 0.2s; }
.think-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkPulse { 0%,80%,100%{opacity:0;transform:scale(0.8)} 40%{opacity:1;transform:scale(1)} }

.ai-log-box {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 1px;
  min-height: 80px;
}
.ai-log-box::-webkit-scrollbar { width: 3px; }
.ai-log-box::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.al-entry {
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5;
  padding: 2px 5px; border-radius: 3px; word-break: break-word;
}
.al-entry.sys  { color: var(--text-dim); }
.al-entry.net  { color: var(--neon-blue); }
.al-entry.mdl  { color: var(--neon-purple); }
.al-entry.data { color: var(--text); }
.al-entry.buy  { color: var(--neon-green); background: rgba(6,255,165,0.05); }
.al-entry.sell { color: var(--neon-red); background: rgba(255,45,85,0.05); }
.al-entry.hold { color: var(--neon-yellow); background: rgba(251,191,36,0.05); }
.al-entry.err  { color: #ff6b00; }

/* Decision Box */
.decision-box {
  flex-shrink: 0; padding: 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,20,0.4);
}
.db-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.db-title {
  font-family: var(--font-code); font-size: 9px; color: var(--text-dim);
  letter-spacing: 3px;
}
.db-live {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-code); font-size: 9px; color: var(--neon-green); letter-spacing: 1px;
}
.live-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--neon-green); box-shadow: 0 0 6px var(--neon-green);
  animation: dotPulse 1.2s ease-in-out infinite;
}

.db-signal {
  font-family: var(--font-display); font-size: 30px; font-weight: 800;
  letter-spacing: 4px; margin-bottom: 4px; line-height: 1;
}
.db-signal.waiting { color: var(--text-dim); }
.db-signal.buy  { color: var(--neon-green); text-shadow: var(--glow-green); animation: signalPulse 1.2s ease-in-out infinite; }
.db-signal.sell { color: var(--neon-red);   text-shadow: var(--glow-red);   animation: signalPulse 1.2s ease-in-out infinite; }
.db-signal.hold { color: var(--neon-yellow); }
@keyframes signalPulse { 0%,100%{opacity:1} 50%{opacity:0.55} }

.db-coin  { font-family: var(--font-code); font-size: 13px; color: var(--neon-cyan); margin-bottom: 2px; }
.db-model { font-family: var(--font-mono); font-size: 10px; color: var(--neon-purple); margin-bottom: 6px; }
.db-reason{ font-size: 11px; color: var(--text-dim); margin-bottom: 10px; line-height: 1.5; font-family: var(--font-mono); }

.conf-row { display: flex; align-items: center; gap: 8px; }
.conf-lbl { font-family: var(--font-code); font-size: 9px; color: var(--text-dim); white-space: nowrap; }
.conf-bar {
  flex: 1; height: 4px; border-radius: 4px;
  background: rgba(0,245,255,0.08);
  overflow: hidden;
}
.conf-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 6px var(--neon-cyan);
}
.conf-pct { font-family: var(--font-code); font-size: 10px; color: var(--neon-cyan); min-width: 28px; text-align: right; }

.db-metrics { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.metric-tag {
  font-family: var(--font-mono); font-size: 9px; padding: 2px 7px;
  border-radius: 4px; border: 1px solid var(--border-md);
  color: var(--text-dim); background: rgba(0,245,255,0.03);
}

/* ═══════════════════════════
   MARKET PANEL
═══════════════════════════ */

.refresh-lbl { font-family: var(--font-code); font-size: 9px; color: var(--text-dim); }

.market-grid {
  flex: 1; overflow-y: auto; padding: 8px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px; align-content: start;
}
.market-grid::-webkit-scrollbar { width: 3px; }
.market-grid::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.mkt-loading {
  grid-column: 1/-1; text-align: center; padding: 50px 20px;
  color: var(--text-dim); font-family: var(--font-code); font-size: 11px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.spin-ring {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border-md);
  border-top-color: var(--neon-cyan);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Coin Cards */
.coin-card {
  background: rgba(0,245,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px;
  cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden;
}
.coin-card:hover {
  border-color: var(--border-md);
  background: rgba(0,245,255,0.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.coin-card.watching { border-color: rgba(0,245,255,0.4); box-shadow: inset 0 0 20px rgba(0,245,255,0.04); }
.coin-card.buy-signal  { border-color: rgba(6,255,165,0.5); box-shadow: 0 0 12px rgba(6,255,165,0.15); }
.coin-card.sell-signal { border-color: rgba(255,45,85,0.5); box-shadow: 0 0 12px rgba(255,45,85,0.15); }

.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cc-sym  { font-family: var(--font-code); font-size: 11px; font-weight: 700; color: var(--neon-cyan); }
.cc-rank { font-family: var(--font-mono); font-size: 9px; color: var(--text-muted); }
.cc-price  { font-family: var(--font-code); font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.cc-change { font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.cc-change.up   { color: var(--neon-green); }
.cc-change.down { color: var(--neon-red); }
.cc-vol  { font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); margin-top: 2px; }

.cc-signal-badge {
  position: absolute; top: 6px; right: 6px;
  font-family: var(--font-code); font-size: 8px; padding: 2px 5px;
  border-radius: 4px; font-weight: 700; letter-spacing: 1px;
}
.cc-signal-badge.buy  { background: rgba(6,255,165,0.15); color: var(--neon-green); border: 1px solid rgba(6,255,165,0.3); }
.cc-signal-badge.sell { background: rgba(255,45,85,0.15); color: var(--neon-red); border: 1px solid rgba(255,45,85,0.3); }

/* ═══════════════════════════
   PORTFOLIO PANEL
═══════════════════════════ */

.cash-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cash-label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-code); font-size: 10px; color: var(--text-dim);
}
.cash-val { font-family: var(--font-code); font-size: 15px; font-weight: 700; color: var(--neon-green); }

.holdings-list { flex: 1; overflow-y: auto; padding: 6px; min-height: 60px; }
.holdings-list::-webkit-scrollbar { width: 3px; }
.holdings-list::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.empty-hold {
  text-align: center; padding: 20px 10px;
  color: var(--text-dim); font-family: var(--font-code); font-size: 10px; line-height: 1.6;
}

.holding-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: var(--r-sm); margin-bottom: 4px;
  background: rgba(0,245,255,0.03); border: 1px solid var(--border);
  transition: all 0.2s;
}
.holding-item:hover { border-color: var(--border-md); background: rgba(0,245,255,0.06); }
.hi-sym { font-family: var(--font-code); font-size: 12px; color: var(--neon-cyan); }
.hi-qty { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.hi-val { font-family: var(--font-code); font-size: 12px; color: var(--text); }
.hi-pnl { font-family: var(--font-mono); font-size: 10px; }
.hi-pnl.up { color: var(--neon-green); }
.hi-pnl.dn { color: var(--neon-red); }

.chart-box { flex: 1; padding: 8px; min-height: 90px; }

/* ═══════════════════════════
   TRADES PANEL
═══════════════════════════ */

.trades-panel {
  position: relative; z-index: 5;
  margin: 0 4px 4px; max-height: 260px;
}

.filter-row { display: flex; gap: 4px; }

.fbtn {
  font-family: var(--font-code); font-size: 9px; padding: 4px 11px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 5px; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.5px;
}
.fbtn:hover  { border-color: var(--border-bright); color: var(--neon-cyan); background: rgba(0,245,255,0.06); }
.fbtn.active { border-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(0,245,255,0.1); }
.fbtn.fbtn-win:hover, .fbtn.fbtn-win.active  { border-color: var(--neon-green); color: var(--neon-green); background: rgba(6,255,165,0.08); }
.fbtn.fbtn-loss:hover, .fbtn.fbtn-loss.active { border-color: var(--neon-red); color: var(--neon-red); background: rgba(255,45,85,0.08); }

.tbl-wrap { flex: 1; overflow: auto; }
.tbl-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.trade-tbl {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-mono); font-size: 10.5px;
}
.trade-tbl th {
  position: sticky; top: 0; z-index: 2;
  background: rgba(4,8,18,0.98); color: var(--text-dim);
  font-size: 9px; letter-spacing: 1.5px; padding: 7px 10px;
  border-bottom: 1px solid var(--border-md); text-align: left; white-space: nowrap;
  font-family: var(--font-code);
}
.trade-tbl td {
  padding: 6px 10px; border-bottom: 1px solid rgba(0,245,255,0.03); white-space: nowrap;
}
.trade-tbl tr:hover td { background: rgba(0,245,255,0.03); }
.empty-msg { text-align: center; color: var(--text-dim); padding: 24px; font-family: var(--font-code); font-size: 11px; }

.td-buy   { color: var(--neon-green); font-weight: 700; font-family: var(--font-code); }
.td-sell  { color: var(--neon-red); font-weight: 700; font-family: var(--font-code); }
.td-win   { color: var(--neon-green); }
.td-loss  { color: var(--neon-red); }
.td-cyan  { color: var(--neon-cyan); font-family: var(--font-code); }
.td-dim   { color: var(--text-dim); }
.td-reason { max-width: 200px; overflow: hidden; text-overflow: ellipsis; color: var(--text-dim); font-size: 9px; }

/* ═══════════════════════════
   LOG PANEL
═══════════════════════════ */

.log-panel {
  position: relative; z-index: 5;
  margin: 0 4px 4px; max-height: 200px;
}

.btn-clr {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-code); font-size: 9px; padding: 4px 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); border-radius: 5px; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.5px;
}
.btn-clr:hover { border-color: var(--neon-red); color: var(--neon-red); background: rgba(255,45,85,0.06); }

.log-box { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 1px; }
.log-box::-webkit-scrollbar { width: 3px; }
.log-box::-webkit-scrollbar-thumb { background: var(--border-md); border-radius: 2px; }

.log-entry {
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5;
  padding: 2px 5px; border-radius: 3px;
}
.log-entry.sys    { color: var(--text-dim); }
.log-entry.info   { color: var(--neon-blue); }
.log-entry.buy    { color: var(--neon-green); }
.log-entry.sell   { color: var(--neon-red); }
.log-entry.ai     { color: var(--neon-purple); }
.log-entry.warn   { color: var(--neon-yellow); }
.log-entry.err    { color: #ff6b00; }
.log-entry.profit { color: var(--neon-green); background: rgba(6,255,165,0.05); }
.log-entry.loss   { color: var(--neon-red); background: rgba(255,45,85,0.05); }

/* ═══════════════════════════
   FOOTER
═══════════════════════════ */

.app-footer {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-code); font-size: 10px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(4,8,18,0.6);
  letter-spacing: 0.5px;
}
.footer-ai {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sep { opacity: 0.3; }

/* ═══════════════════════════
   SCROLLBARS (global)
═══════════════════════════ */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,245,255,0.18); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,245,255,0.35); }

/* ═══════════════════════════
   RESPONSIVE
═══════════════════════════ */

@media (max-width: 1200px) {
  .main-grid { grid-template-columns: 280px 1fr; height: auto; grid-template-rows: auto; }
  .portfolio-panel { grid-column: 1 / -1; max-height: 300px; flex-direction: row; }
  .portfolio-panel .holdings-list { flex: 1; }
  .portfolio-panel .chart-box { width: 220px; min-height: 120px; }
}

@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .ai-panel, .market-panel, .portfolio-panel { max-height: 350px; }
}

@media (max-width: 680px) {
  .header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 14px; }
  .header-pills { justify-content: flex-start; }
  .stats-bar { gap: 3px; }
  .stat-card { min-width: 85px; padding: 7px 10px; }
  .sv { font-size: 13px; }
  .modal-box { padding: 0; }
  .modal-header, .permission-list { padding-left: 20px; padding-right: 20px; }
  .modal-setup { padding: 0 20px; }
  .btn-grant { width: calc(100% - 40px); margin: 0 20px 14px; }
  .modal-disclaimer { padding: 0 20px 24px; }
  .brand-name { font-size: 26px; }
  .main-grid { gap: 3px; padding: 3px; }
  .trades-panel, .log-panel { margin: 0 3px 3px; }
}
