/* ============================================
   NimitExpo AlgoTrading — Dashboard (AlgoRooms Light)
   ============================================ */

/* === LAYOUT === */
.app-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 32px;
}

/* === MODE BANNER === */
.mode-banner {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.mode-banner.paper {
  background: #10b981;
  color: #fff;
}

.mode-banner.live {
  background: #ef4444;
  color: #fff;
}

/* === SIDEBAR (AlgoRooms-style) === */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 32px;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a1a2e;
  text-decoration: none;
}

.sidebar-logo .s-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-main);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 12px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none;
  margin-bottom: 1px;
  position: relative;
}

.nav-item:hover {
  background: #f3f4f6;
  color: #1a1a2e;
  transform: none;
  padding-left: 12px;
}

.nav-item.active {
  background: #4361ee;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(67,97,238,0.25);
}

.nav-item.active::before {
  display: none;
}

.nav-item.active:hover {
  background: #3451d1;
  color: #ffffff;
  padding-left: 12px;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid #e5e7eb;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-user:hover { background: #f3f4f6; }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #fff;
}

.user-info .user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1a1a2e;
}

.user-info .user-role {
  font-size: 0.7rem;
  color: #6b7280;
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 24px 28px;
  min-height: calc(100vh - 32px);
  background: #f5f7fa;
}

/* === TOP BAR === */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.top-bar h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a2e;
  background: none;
  -webkit-text-fill-color: #1a1a2e;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar .market-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #374151;
}

.market-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.market-status .dot.open { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,0.4); animation: pulse 2s infinite; }
.market-status .dot.closed { background: #ef4444; }

.top-bar .kill-switch {
  background: #fff;
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.top-bar .kill-switch:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239,68,68,0.2);
}

/* === STAT CARDS (Clean White) === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  display: none;
}

.stat-card:hover {
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-card .stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 500;
}

.stat-card .stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  color: #1a1a2e;
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
}

.stat-card .stat-change.up { color: #10b981; background: rgba(16,185,129,0.08); }
.stat-card .stat-change.down { color: #ef4444; background: rgba(239,68,68,0.08); }

/* === CARDS (Clean White) === */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #f0f1f3;
  background: #fafbfc;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a2e;
}

.card-body { padding: 18px; }
.card-body.no-pad { padding: 0; }

/* === DATA TABLE (Clean) === */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #374151;
  border-bottom: 1px solid #f0f1f3;
}

.data-table tbody tr:hover td {
  background: #f8f9fb;
}

.data-table .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge.buy { background: rgba(16,185,129,0.08); color: #10b981; }
.badge.sell { background: rgba(239,68,68,0.08); color: #ef4444; }
.badge.active { background: rgba(67,97,238,0.08); color: #4361ee; }
.badge.paused { background: rgba(245,158,11,0.08); color: #f59e0b; }
.badge.executed { background: rgba(16,185,129,0.08); color: #10b981; }
.badge.pending { background: rgba(245,158,11,0.08); color: #f59e0b; }
.badge.cancelled { background: rgba(156,163,175,0.1); color: #6b7280; }
.badge.rejected { background: rgba(239,68,68,0.08); color: #ef4444; }
.badge.paper { background: rgba(16,185,129,0.08); color: #10b981; }
.badge.live { background: rgba(239,68,68,0.08); color: #ef4444; }
.badge.connected { background: rgba(16,185,129,0.08); color: #10b981; }
.badge.disconnected { background: rgba(239,68,68,0.08); color: #ef4444; }

/* === GRID LAYOUTS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }

/* === BROKER CARDS === */
.broker-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.broker-card:hover {
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.broker-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.broker-card .bc-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.broker-card .bc-info h4 { font-size: 0.95rem; color: #1a1a2e; }
.broker-card .bc-info .bc-id { font-size: 0.78rem; color: #6b7280; }

.broker-card .bc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}

.broker-card .bc-stat {
  padding: 8px 10px;
  background: #f5f7fa;
  border-radius: 8px;
}

.broker-card .bc-stat .label { font-size: 0.72rem; color: #6b7280; }
.broker-card .bc-stat .val { font-size: 0.95rem; font-weight: 700; margin-top: 2px; color: #1a1a2e; }

.broker-card .bc-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* === STRATEGY CARDS === */
.strategy-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.strategy-card:hover {
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.strategy-card .sc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.strategy-card .sc-name { font-size: 1rem; font-weight: 700; color: #1a1a2e; }
.strategy-card .sc-type { font-size: 0.78rem; color: #6b7280; margin-top: 4px; }

.strategy-card .sc-symbols {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.sc-symbols .symbol-tag {
  padding: 3px 10px;
  background: rgba(67,97,238,0.06);
  border: 1px solid rgba(67,97,238,0.12);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #4361ee;
}

.strategy-card .sc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.sc-stats .sc-stat {
  text-align: center;
  padding: 8px;
  background: #f5f7fa;
  border-radius: 8px;
}

.sc-stat .label { font-size: 0.68rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; }
.sc-stat .val { font-size: 0.9rem; font-weight: 700; margin-top: 3px; color: #1a1a2e; }

.strategy-card .sc-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* === FORMS === */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-row.full { grid-template-columns: 1fr; }
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #1a1a2e;
  font-size: 0.88rem;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}

.form-control:focus {
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  background-color: #fff;
}

select.form-control option {
  background: #fff;
  color: #1a1a2e;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: #4361ee; color: #fff; box-shadow: 0 2px 6px rgba(67,97,238,0.2); }
.btn-primary:hover { background: #3451d1; box-shadow: 0 4px 12px rgba(67,97,238,0.25); }

.btn-green { background: #10b981; color: #fff; }
.btn-green:hover { background: #059669; }

.btn-red { background: #ef4444; color: #fff; }
.btn-red:hover { background: #dc2626; }

.btn-outline { background: transparent; border: 1px solid #d1d5db; color: #374151; }
.btn-outline:hover { border-color: #4361ee; color: #4361ee; background: rgba(67,97,238,0.04); }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }

/* === CHART === */
.chart-container {
  position: relative;
  height: 300px;
  padding: 16px;
}

/* === ALERTS === */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f1f3;
  transition: background 0.15s ease;
}

.alert-item:hover { background: #f8f9fb; }
.alert-item:last-child { border-bottom: none; }

.alert-item .al-icon {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}

.alert-item .al-icon.info { background: rgba(67,97,238,0.08); }
.alert-item .al-icon.success { background: rgba(16,185,129,0.08); }
.alert-item .al-icon.warning { background: rgba(245,158,11,0.08); }
.alert-item .al-icon.danger { background: rgba(239,68,68,0.08); }

.alert-item .al-text { font-size: 0.83rem; color: #374151; line-height: 1.4; }
.alert-item .al-text strong { color: #1a1a2e; }
.alert-item .al-time { font-size: 0.72rem; color: #6b7280; margin-top: 4px; }

/* === TOGGLE === */
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #d1d5db; border-radius: 12px;
  cursor: pointer; transition: all 0.25s ease;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: #4361ee; }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 50px 20px; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 14px; opacity: 0.3; }
.empty-state h4 { font-size: 1.05rem; margin-bottom: 6px; color: #1a1a2e; }
.empty-state p { color: #6b7280; font-size: 0.85rem; margin-bottom: 18px; }

/* === RISK METER === */
.risk-meter { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.risk-bar { flex: 1; height: 5px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.risk-bar .fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.risk-bar .fill.low { background: #10b981; }
.risk-bar .fill.medium { background: #f59e0b; }
.risk-bar .fill.high { background: #ef4444; }

/* === POSITIONS === */
.position-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #f0f1f3; transition: background 0.15s ease;
}
.position-row:hover { background: #f8f9fb; }
.position-row .pos-symbol { font-weight: 700; font-size: 0.9rem; color: #1a1a2e; }
.position-row .pos-qty { font-size: 0.78rem; color: #6b7280; }
.position-row .pos-pnl { font-weight: 700; font-size: 0.9rem; }

/* === SETTINGS === */
.settings-section { margin-bottom: 28px; }
.settings-section h3 { font-size: 1.05rem; margin-bottom: 6px; }
.settings-section .desc { font-size: 0.82rem; color: #6b7280; margin-bottom: 18px; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid #f0f1f3;
}
.setting-row .setting-info h4 { font-size: 0.88rem; color: #1a1a2e; }
.setting-row .setting-info p { font-size: 0.78rem; color: #6b7280; }

/* === TABS === */
.tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 18px;
}

.tab {
  padding: 10px 20px;
  font-size: 0.84rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  background: none;
  border-top: none; border-left: none; border-right: none;
  font-family: inherit;
}

.tab:hover { color: #374151; }
.tab.active { color: #4361ee; border-bottom-color: #4361ee; font-weight: 600; }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }

.modal {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  width: 90%; max-width: 520px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { font-size: 1.05rem; color: #1a1a2e; }

.modal-close {
  background: #f5f7fa; border: none; color: #6b7280;
  font-size: 1.1rem; cursor: pointer;
  padding: 6px 10px; border-radius: 6px; transition: all 0.15s ease;
}
.modal-close:hover { color: #1a1a2e; background: #e5e7eb; }

.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid #e5e7eb;
}

/* === SIDEBAR MOBILE === */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 40px; left: 12px;
  z-index: 150;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px; cursor: pointer;
  color: #1a1a2e; font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  z-index: 90;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: block; }
  .sidebar.open + .sidebar-overlay { display: block; }

  .main-content { margin-left: 0; padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .top-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .top-bar h1 { font-size: 1.2rem; }
}

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

/* === SCROLLBAR === */
* { scrollbar-width: thin; scrollbar-color: #d1d5db transparent; }

::selection { background: rgba(67,97,238,0.15); color: #1a1a2e; }

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-row, .card, .broker-card, .strategy-card {
  animation: fadeIn 0.35s ease forwards;
}
.stats-row .stat-card:nth-child(2) { animation-delay: 0.05s; }
.stats-row .stat-card:nth-child(3) { animation-delay: 0.1s; }
.stats-row .stat-card:nth-child(4) { animation-delay: 0.15s; }

/* ============================================
   Light Theme Overrides for Feature Pages
   (socialfeed, riskanalytics, backtester, telegram, webhooks,
    marketplace, leaderboard, heatmap)
   ============================================ */

/* Social Feed */
.compose, .post, .trending, .top-traders,
/* Risk Analytics */
.risk-card, .risk-panel,
/* Backtester */
.bt-config, .bt-chart-panel, .bt-stat,
/* Telegram */
.tg-panel, .tg-status-card,
/* Webhooks */
.wh-panel,
/* Marketplace */
.strategy-market-card, .mp-card,
/* Leaderboard */
.lb-card, .podium-card,
/* Heatmap */
.hm-panel {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px;
}

/* Input overrides for dark bg inputs */
.compose textarea,
.bt-field select, .bt-field input,
.tg-field input,
.wh-field select, .wh-field input {
  background: #f5f7fa !important;
  border: 1px solid #d1d5db !important;
  color: #1a1a2e !important;
}

.compose textarea:focus,
.bt-field select:focus, .bt-field input:focus,
.tg-field input:focus,
.wh-field select:focus, .wh-field input:focus {
  border-color: #4361ee !important;
  box-shadow: 0 0 0 3px rgba(67,97,238,0.1) !important;
}

/* Sub-elements with dark bg */
.trade-card, .alert-row, .hook-item, .var-block, .stress-item,
.tg-status-card, .tt-item, .trend-item,
.chat-preview, .code-block {
  background: #f5f7fa !important;
  border-color: #e5e7eb !important;
}

.code-block {
  color: #4361ee !important;
}

/* Tables in feature pages */
.exposure-table th, .cmd-table th, .log-table th, .trades-table th {
  color: #9ca3af !important;
  border-bottom-color: #e5e7eb !important;
  background: #fafbfc !important;
}

.exposure-table td, .cmd-table td, .log-table td, .trades-table td {
  color: #4b5563 !important;
  border-bottom-color: #f0f1f3 !important;
}

.exposure-table tr:hover, .cmd-table tr:hover,
.log-table tr:hover, .trades-table tr:hover {
  background: #f8f9fb !important;
}

/* Bar charts in risk analytics */
.bar-h { background: #e5e7eb !important; }
.meter { background: #e5e7eb !important; }

/* Post actions, attach buttons */
.post-action { color: #9ca3af !important; }
.post-action:hover { color: #4b5563 !important; background: #f0f1f3 !important; }
.post-action.liked { color: #ef4444 !important; }
.attach-btn { color: #9ca3af !important; }
.attach-btn:hover { color: #4b5563 !important; background: #f0f1f3 !important; }

/* Chat messages */
.chat-msg.bot .cm-bubble { background: rgba(67,97,238,0.08) !important; color: #1a1a2e !important; }
.chat-msg.user .cm-bubble { background: rgba(67,97,238,0.12) !important; color: #1a1a2e !important; }

/* Cmd code in telegram */
.cmd-code { background: rgba(67,97,238,0.08) !important; color: #4361ee !important; }

/* Log items */
.log-item .log-type.sent { background: rgba(16,185,129,0.08) !important; color: #10b981 !important; }
.log-item .log-type.recv { background: rgba(67,97,238,0.08) !important; color: #4361ee !important; }
.log-item .log-type.err { background: rgba(239,68,68,0.08) !important; color: #ef4444 !important; }

/* Webhook URL box */
.wh-url-box { background: #f5f7fa !important; border-color: #e5e7eb !important; }
.wh-url-box .url-val { color: #4361ee !important; }
.wh-url-box .copy-btn { background: rgba(67,97,238,0.08) !important; border-color: rgba(67,97,238,0.15) !important; color: #4361ee !important; }

/* Step list numbering */
.step-item::before { background: rgba(67,97,238,0.08) !important; color: #4361ee !important; }

/* Risk card top borders */
.risk-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; border-radius: 12px 12px 0 0; }

/* Misc overrides */
.post-name { color: #111827 !important; }
.post-body { color: #374151 !important; }
.post-time, .cm-time { color: #6b7280 !important; }
.rc-label, .tc-lbl, .vb-label, .bs-label, .si-desc { color: #6b7280 !important; }
.rc-val, .tc-val, .bs-val, .si-impact, .vb-val { color: #111827 !important; }
.rc-sub, .alert-time, .hi-last { color: #6b7280 !important; }
.hi-name, .si-name, .tt-name, .tsi-title { color: #111827 !important; }
.hi-desc, .tsi-sub, .tt-bio, .field-hint { color: #6b7280 !important; }
.ar-name { color: #111827 !important; }
.ar-desc { color: #6b7280 !important; }

/* Hashtags and mentions */
.hashtag { color: #7c3aed !important; }
.mention { color: #4361ee !important; }

/* Trend tags */
.tr-tag { color: #7c3aed !important; }
.tr-ct { color: #9ca3af !important; }

/* Toggle overrides */
.toggle .slider { background: #d1d5db !important; }
.toggle input:checked + .slider { background: #4361ee !important; }

/* Progress bar */
.progress-fill { background: #4361ee !important; }

/* Alert dots */
.alert-dot.critical { background: #ef4444 !important; box-shadow: 0 0 4px rgba(239,68,68,0.3) !important; }
.alert-dot.warning { background: #f59e0b !important; box-shadow: 0 0 4px rgba(245,158,11,0.3) !important; }
.alert-dot.info { background: #4361ee !important; box-shadow: 0 0 4px rgba(67,97,238,0.3) !important; }

/* Hook status */
.hook-item .hi-status.active { background: #10b981 !important; }
.hook-item .hi-status.paused { background: #f59e0b !important; }
.hook-item .hi-status.error { background: #ef4444 !important; }

/* Hook actions */
.hook-actions button { color: #9ca3af !important; }
.hook-actions button:hover { color: #4b5563 !important; background: #f0f1f3 !important; }

/* Post button */
.post-btn { background: #4361ee !important; box-shadow: 0 2px 6px rgba(67,97,238,0.2) !important; }
.post-btn:hover { background: #3451d1 !important; }

/* Run button */
.bt-run { background: #4361ee !important; box-shadow: 0 2px 6px rgba(67,97,238,0.2) !important; }
.bt-run:hover { background: #3451d1 !important; }

/* Follow button */
.tt-follow { border-color: rgba(67,97,238,0.2) !important; color: #4361ee !important; }
.tt-follow:hover { background: rgba(67,97,238,0.06) !important; }

/* Backtester empty state */
.bt-empty { color: #9ca3af !important; }

/* Select option bg */
.bt-field select option, .wh-field select option { background: #fff !important; color: #1a1a2e !important; }

/* SVG text in charts */
.drawdown-chart text, .equity-svg text { fill: #9ca3af !important; }

/* Status dots in tables */
.status-dot.ok { background: #10b981 !important; }
.status-dot.fail { background: #ef4444 !important; }

/* Code copy button */
.code-block .code-copy { background: #e5e7eb !important; color: #6b7280 !important; }
.code-block .code-copy:hover { background: #d1d5db !important; color: #1a1a2e !important; }
