:root {
  --cwi-bg: #f4f6fb;
  --cwi-surface: #ffffff;
  --cwi-surface-2: #f1f4fa;
  --cwi-border: #e2e7f0;
  --cwi-text: #2a3142;
  --cwi-text-muted: #737d94;
  --cwi-primary: #4f7cff;
  --cwi-green: #22a06b;
  --cwi-red: #e0525f;
  --cwi-yellow: #c8971f;
  --cwi-orange: #e07a3f;
  --cwi-purple: #8b5cf6;
  --cwi-teal: #14b8a6;
}

body {
  background: var(--cwi-bg);
  color: var(--cwi-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.92rem;
}

.app-navbar {
  background: var(--cwi-surface);
  border-bottom: 1px solid var(--cwi-border);
  padding: 0.6rem 0;
}

.navbar-brand {
  color: var(--cwi-text) !important;
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 1rem;
}

.nav-link {
  color: var(--cwi-text-muted) !important;
  font-size: 0.88rem;
}

.nav-link.active, .nav-link:hover {
  color: var(--cwi-text) !important;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-active { background: var(--cwi-green); }
.status-inactive { background: var(--cwi-text-muted); }

.card {
  background: var(--cwi-surface);
  border: 1px solid var(--cwi-border);
  border-radius: 10px;
  color: var(--cwi-text);
  box-shadow: 0 1px 3px rgba(42, 49, 66, 0.06);
}

.card .card-body { padding: 1rem 1.1rem; }

.stat-card .stat-label {
  color: var(--cwi-text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card {
  border: 1px solid var(--stat-accent-border, var(--cwi-border));
  border-top: 3px solid var(--stat-accent, var(--cwi-primary));
  background: var(--stat-accent-bg, var(--cwi-surface));
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.15rem;
  color: var(--stat-accent, var(--cwi-text));
}

.stat-card-wallets { --stat-accent: var(--cwi-primary); --stat-accent-bg: #eef3ff; --stat-accent-border: #dbe6ff; }
.stat-card-portfolio { --stat-accent: var(--cwi-purple); --stat-accent-bg: #f4eefe; --stat-accent-border: #e6d9fb; }
.stat-card-buy { --stat-accent: var(--cwi-green); --stat-accent-bg: #eafaf3; --stat-accent-border: #d3f2e3; }
.stat-card-sell { --stat-accent: var(--cwi-red); --stat-accent-bg: #fdedef; --stat-accent-border: #f9d9dd; }
.stat-card-net { --stat-accent: var(--cwi-teal); --stat-accent-bg: #e8f9f6; --stat-accent-border: #cdf0e8; }

/* Soft section accents for the other dashboard panels (left border, not full background). */
.section-panel-chart { border-left: 3px solid var(--cwi-purple); }
.section-panel-activity { border-left: 3px solid var(--cwi-teal); }
.section-panel-signals { border-left: 3px solid var(--cwi-orange); }
.section-panel-wallets { border-left: 3px solid var(--cwi-primary); }

.text-positive { color: var(--cwi-green) !important; }
.text-negative { color: var(--cwi-red) !important; }

.table {
  color: var(--cwi-text);
  font-size: 0.86rem;
}

.table > :not(caption) > * > * {
  background: transparent;
  border-bottom-color: var(--cwi-border);
}

.table thead th {
  color: var(--cwi-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--cwi-border);
}

.table-hover tbody tr:hover {
  background: var(--cwi-surface-2);
}

a { color: var(--cwi-primary); text-decoration: none; }
a:hover { color: #345fd6; }

.badge-type {
  font-size: 0.7rem;
  padding: 0.3em 0.55em;
  border-radius: 5px;
  font-weight: 600;
}

.badge-BUY, .badge-TRANSFER_IN { background: rgba(34,160,107,0.12); color: var(--cwi-green); }
.badge-SELL, .badge-TRANSFER_OUT { background: rgba(224,82,95,0.12); color: var(--cwi-red); }
.badge-SWAP { background: rgba(79,124,255,0.12); color: var(--cwi-primary); }
.badge-APPROVE { background: rgba(200,151,31,0.14); color: var(--cwi-yellow); }
.badge-UNKNOWN { background: rgba(115,125,148,0.12); color: var(--cwi-text-muted); }

.badge-level-INFO { background: rgba(79,124,255,0.12); color: var(--cwi-primary); }
.badge-level-WARNING { background: rgba(200,151,31,0.14); color: var(--cwi-yellow); }
.badge-level-HIGH { background: rgba(224,122,63,0.14); color: var(--cwi-orange); }
.badge-level-CRITICAL { background: rgba(224,82,95,0.16); color: var(--cwi-red); }

.badge-cat-MEME { background: rgba(224,122,63,0.14); color: var(--cwi-orange); }
.badge-cat-ALTCOIN { background: rgba(79,124,255,0.12); color: var(--cwi-primary); }
.badge-cat-STABLECOIN { background: rgba(34,160,107,0.12); color: var(--cwi-green); }
.badge-cat-UNCATEGORIZED { background: rgba(115,125,148,0.12); color: var(--cwi-text-muted); }

.activity-feed-item {
  border-left: 2px solid var(--cwi-border);
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.4rem;
}

.activity-feed-item .time { color: var(--cwi-text-muted); font-size: 0.75rem; }

.form-control, .form-select {
  background: var(--cwi-surface-2);
  border: 1px solid var(--cwi-border);
  color: var(--cwi-text);
}

.form-control:focus, .form-select:focus {
  background: var(--cwi-surface-2);
  color: var(--cwi-text);
  border-color: var(--cwi-primary);
  box-shadow: 0 0 0 0.2rem rgba(79,124,255,0.18);
}

.btn-primary { background: var(--cwi-primary); border-color: var(--cwi-primary); }

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--cwi-text);
}

.text-muted-2 { color: var(--cwi-text-muted); }

.chain-badge {
  font-size: 0.7rem;
  background: var(--cwi-surface-2);
  border: 1px solid var(--cwi-border);
  padding: 0.15em 0.5em;
  border-radius: 5px;
  color: var(--cwi-text-muted);
}
