
/* =====================================================
   INVESTOR-GRADE DASHBOARD STYLES
   ===================================================== */

:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Layout */
.dashboard-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.dashboard-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.dashboard-header .last-update {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.card-body {
  padding: 20px;
}

/* Narrative Section */
.narrative-section {
  margin-bottom: 24px;
}

.narrative-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(99, 102, 241, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.narrative-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.narrative-icon {
  font-size: 1.5rem;
}

.narrative-title {
  font-weight: 600;
  flex: 1;
}

.narrative-time {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.narrative-content {
  padding: 16px 20px;
}

.narrative-item {
  margin: 8px 0;
  padding-left: 16px;
  border-left: 3px solid var(--primary);
  color: var(--text-secondary);
}

.narrative-item.warning {
  border-left-color: var(--warning);
}

.narrative-item.danger {
  border-left-color: var(--danger);
}

/* Hero KPIs */
.hero-kpis {
  margin-bottom: 24px;
}

.kpi-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-row.primary {
  grid-template-columns: repeat(4, 1fr);
}

.kpi-row.secondary {
  grid-template-columns: repeat(6, 1fr);
}

.kpi-row.period {
  grid-template-columns: repeat(4, 1fr);
}

.kpi-card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.kpi-card.hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(99, 102, 241, 0.15) 100%);
  border-color: rgba(99, 102, 241, 0.4);
}

.kpi-card.success {
  border-left: 4px solid var(--success);
}

.kpi-card.danger {
  border-left: 4px solid var(--danger);
}

.kpi-card.warning {
  border-left: 4px solid var(--warning);
}

.kpi-card.mini {
  padding: 16px;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.kpi-card.period-card {
  padding: 16px;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  background: rgba(0,0,0,0.2);
}

.kpi-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
}

.kpi-content {
  flex: 1;
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-card.mini .kpi-value {
  font-size: 1.25rem;
}

.kpi-value.positive { color: var(--success); }
.kpi-value.negative { color: var(--danger); }

.kpi-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Charts */
.charts-section {
  margin-bottom: 24px;
}

.chart-container {
  height: 350px;
}

.chart-controls {
  display: flex;
  gap: 8px;
}

.chart-period-select, .filter-select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 6px 12px;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Risk Section */
.risk-section {
  margin-bottom: 24px;
}

.risk-card .card-header {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%);
}

.risk-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-badge.normal {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.risk-badge.defensive {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.risk-badge.cooldown, .risk-badge.paused {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.risk-item {
  text-align: center;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.risk-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.risk-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.risk-value.warning {
  color: var(--warning);
}

.risk-reasons {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.reasons-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.reason-item {
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--warning);
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.875rem;
}

/* Bots Section */
.bots-section {
  margin-bottom: 24px;
}

.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.bot-card {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--border);
}

.bot-card.active {
  border-color: rgba(34, 197, 94, 0.4);
}

.bot-card.inactive {
  opacity: 0.6;
}

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

.bot-name {
  font-weight: 600;
}

.bot-status {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.bot-status.online {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.bot-status.offline {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.bot-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bot-stat {
  text-align: center;
}

.bot-stat .label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bot-stat .value {
  font-weight: 600;
  font-size: 0.875rem;
}

.bot-triggers {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.trigger {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.trigger.down {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.trigger.up {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

/* Tables */
.table-container {
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  background: var(--bg-secondary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: 'SF Mono', Monaco, monospace; }
.positive { color: var(--success); }
.negative { color: var(--danger); }
.empty { color: var(--text-muted); text-align: center; padding: 40px !important; }

/* Trades Table */
.trades-table-container {
  max-height: 500px;
}

.trade-row.buy {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.05) 0%, transparent 30%);
}

.trade-row.sell {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.05) 0%, transparent 30%);
}

.trade-time {
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.trade-symbol {
  font-weight: 600;
}

.side-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.side-badge.buy {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.side-badge.sell {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.fee {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.result-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
}

.result-badge.win {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.result-badge.loss {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Positions */
.asset-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-icon {
  font-size: 1.25rem;
}

/* Allocation */
.allocation-section {
  margin-bottom: 24px;
}

.allocation-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  align-items: center;
}

.allocation-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.legend-label {
  flex: 1;
  font-weight: 500;
}

.legend-value {
  color: var(--text-secondary);
}

/* Live Feed */
.feed-section {
  margin-bottom: 24px;
}

.live-feed {
  max-height: 300px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-time {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: monospace;
}

.feed-type {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-primary);
}

.feed-item.trade .feed-type { color: var(--primary); }
.feed-item.risk .feed-type { color: var(--warning); }
.feed-item.error .feed-type { color: var(--danger); }

.feed-message {
  flex: 1;
  font-size: 0.875rem;
}

.feed-status {
  font-size: 0.75rem;
}

.feed-status.connected { color: var(--success); }
.feed-status.disconnected { color: var(--danger); }

.feed-placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

/* Clients Table */
.profile-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.profile-badge.conservative {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.profile-badge.balanced {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.profile-badge.aggressive {
  background: rgba(249, 115, 22, 0.15);
  color: #f97316;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Badges */
.badge {
  background: var(--primary);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
}

/* Error Card */
.error-card {
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.error-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-message {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1200px) {
  .kpi-row.primary { grid-template-columns: repeat(2, 1fr); }
  .kpi-row.secondary { grid-template-columns: repeat(3, 1fr); }
  .risk-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .dashboard-wrapper { padding: 16px; }
  .kpi-row.primary, .kpi-row.secondary, .kpi-row.period { grid-template-columns: 1fr; }
  .allocation-grid { grid-template-columns: 1fr; }
  .bots-grid { grid-template-columns: 1fr; }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Button Outline */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: var(--bg-hover);
}

/* ==================== SYSTEM STATUS SECTION ==================== */
.system-section {
  margin-top: 2rem;
}

.system-section .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-indicator {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-indicator.healthy {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-indicator.degraded {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.status-indicator.warning {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.system-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.system-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.system-value {
  font-weight: 500;
}

.system-value.badge {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* ==================== LIVE FEED IMPROVEMENTS ==================== */
.feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.875rem;
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.02);
}

.feed-time {
  color: #64748b;
  font-family: monospace;
  font-size: 0.75rem;
  min-width: 60px;
}

.feed-icon {
  font-size: 1rem;
}

.feed-message {
  color: #e2e8f0;
  flex: 1;
}

.feed-item.success .feed-message {
  color: #10b981;
}

.feed-item.warning .feed-message {
  color: #f59e0b;
}

.feed-item.danger .feed-message {
  color: #ef4444;
}

.feed-item.buy .feed-message {
  color: #10b981;
}

.feed-item.sell .feed-message {
  color: #ef4444;
}

.feed-item.info .feed-message {
  color: #94a3b8;
}

/* ==================== PROFILE SELECTOR ==================== */
.profile-selector {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-label {
  display: block;
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.profile-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.profile-btn.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.profile-btn.active.conservative {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.profile-btn.active.aggressive {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.profile-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.profile-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.profile-name {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.875rem;
}

.profile-desc {
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* ==================== NOTIFICATIONS ==================== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  background: #1e293b;
  color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  z-index: 9999;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid #10b981;
}

.notification.error {
  border-left: 4px solid #ef4444;
}

/* Responsive */
@media (max-width: 640px) {
  .profile-buttons {
    grid-template-columns: 1fr;
  }
}

/* Claude AI Section */
.claude-section {
  margin: 20px 0;
}

.claude-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.claude-card .card-header {
  border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.claude-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .claude-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.claude-stat {
  text-align: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.claude-stat .stat-label {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.claude-stat .stat-value {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #f1f5f9;
}

.claude-actions-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.claude-action-badge {
  flex: 1;
  max-width: 120px;
  text-align: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.claude-action-badge.buy {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.claude-action-badge.sell {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.claude-action-badge.hold {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Allocation List Styles */
.allocation-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.allocation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.allocation-asset {
  min-width: 60px;
  font-weight: 600;
  font-size: 14px;
  color: #f1f5f9;
}

.allocation-bar-container {
  flex: 1;
  height: 24px;
  background: rgba(100, 116, 139, 0.2);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.allocation-bar {
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
  transition: width 0.5s ease;
  min-width: 2px;
}

.allocation-item:nth-child(1) .allocation-bar {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.allocation-item:nth-child(2) .allocation-bar {
  background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
}

.allocation-item:nth-child(3) .allocation-bar {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.allocation-item:nth-child(4) .allocation-bar {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.allocation-item:nth-child(5) .allocation-bar {
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.allocation-pct {
  min-width: 60px;
  text-align: right;
  font-weight: 600;
  font-size: 14px;
  color: #94a3b8;
}

/* Market Intelligence Section */
.market-intel-section {
  margin: 20px 0;
}

.market-intel-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 16px;
}

@media (max-width: 992px) {
  .market-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
  .market-grid { grid-template-columns: 1fr; }
}

.market-item {
  text-align: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.market-label {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.market-value {
  font-size: 24px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.market-value.big {
  font-size: 36px;
}

.market-value.extreme-fear { color: #ef4444; }
.market-value.fear { color: #f59e0b; }
.market-value.neutral { color: #94a3b8; }
.market-value.greed { color: #84cc16; }
.market-value.extreme-greed { color: #10b981; }

.market-sub {
  font-size: 12px;
  color: #64748b;
}

.market-sub.positive { color: #10b981; }
.market-sub.negative { color: #ef4444; }

.fear-greed-bar {
  margin-top: 12px;
  height: 8px;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 25%, #94a3b8 50%, #84cc16 75%, #10b981 100%);
  border-radius: 4px;
  position: relative;
}

.fear-greed-indicator {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.market-indicators {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.indicator-badge {
  padding: 6px 14px;
  background: rgba(100, 116, 139, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

.indicator-badge.squeeze-active {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  animation: pulse-squeeze 2s infinite;
}

@keyframes pulse-squeeze {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}


/* ========== Exposure Widget ========== */
.exposure-widget {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

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

.exposure-label {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}

.exposure-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.exposure-status.ok {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.exposure-status.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    animation: pulse-warning 2s infinite;
}

.exposure-status.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.exposure-bar-container {
    position: relative;
    width: 100%;
    height: 28px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    overflow: visible;
    margin-bottom: 8px;
}

.exposure-bar {
    height: 100%;
    border-radius: 14px;
    transition: width 0.5s ease, background 0.3s ease;
    background: linear-gradient(90deg,
        #10b981 0%,
        #10b981 60%,
        #f59e0b 80%,
        #ef4444 100%
    );
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.exposure-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.marker-90 {
    position: absolute;
    top: -20px;
    transform: translateX(-50%);
    font-size: 10px;
    color: #f59e0b;
    font-weight: 600;
}

.marker-90::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 28px;
    background: rgba(245, 158, 11, 0.5);
    border-radius: 1px;
}

.exposure-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exposure-current {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.exposure-limit {
    font-size: 12px;
    color: #94a3b8;
}

/* ============================================
   CLIENT MANAGEMENT SECTION - IMPROVED STYLES
   ============================================ */

.clients-section {
  margin-top: 2rem;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.client-card {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid #334155;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.client-card.halted {
  border-color: #ef4444;
  background: linear-gradient(135deg, #450a0a 0%, #1e293b 100%);
}

.client-card.active {
  border-color: #10b981;
}

.client-card.inactive {
  border-color: #f59e0b;
  opacity: 0.85;
}

.client-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.client-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.client-card .client-name {
  font-weight: 700;
  font-size: 1.25rem;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.client-card .client-id {
  font-size: 0.75rem;
  color: #64748b;
  font-family: 'Monaco', 'Consolas', monospace;
  background: #1e293b;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.client-status .status-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.client-status .status-badge.success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.client-status .status-badge.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  animation: pulse-danger 2s infinite;
}

.client-status .status-badge.warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1e293b;
}

@keyframes pulse-danger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* KPIs Grid */
.client-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.client-kpi {
  background: rgba(15, 23, 42, 0.6);
  padding: 0.875rem;
  border-radius: 10px;
  border: 1px solid #1e293b;
}

.client-kpi .kpi-label {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
}

.client-kpi .kpi-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Monaco', 'Consolas', monospace;
  color: #f8fafc;
}

.client-kpi .kpi-value.positive {
  color: #10b981;
}

.client-kpi .kpi-value.negative {
  color: #ef4444;
}

/* Details Section */
.client-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 10px;
  border: 1px solid #1e293b;
}

.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.detail-label {
  color: #94a3b8;
}

.detail-value {
  color: #f8fafc;
  font-weight: 600;
}

/* Profile Badge */
.client-details .profile-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-badge.conservative {
  background: #3b82f6;
  color: white;
}

.profile-badge.balanced {
  background: #8b5cf6;
  color: white;
}

.profile-badge.aggressive {
  background: #f97316;
  color: white;
}

/* Risk Mode */
.risk-mode {
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.risk-mode.normal {
  background: #10b981;
  color: white;
}

.risk-mode.defensive {
  background: #f59e0b;
  color: #1e293b;
}

.risk-mode.cooldown {
  background: #f97316;
  color: white;
}

.risk-mode.halted,
.risk-mode.liquidated {
  background: #ef4444;
  color: white;
}

/* Alerts Section */
.client-alerts {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 0.875rem;
  margin-bottom: 1rem;
}

.alert-header {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.alert-reason {
  font-size: 0.7rem;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-family: 'Monaco', 'Consolas', monospace;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Action Buttons */
.client-actions {
  display: flex;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
}

.client-actions .btn {
  flex: 1;
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.client-actions .btn-sm {
  background: #334155;
  color: #f8fafc;
}

.client-actions .btn-sm:hover {
  background: #475569;
  transform: translateY(-1px);
}

.client-actions .btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.client-actions .btn-success:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
}

/* Modal for Client Details */
.client-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.client-modal {
  background: #1e293b;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid #334155;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.client-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}

.client-modal-header h2 {
  margin: 0;
  color: #f8fafc;
}

.client-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.client-modal-close:hover {
  color: #f8fafc;
}

.client-modal-body {
  color: #e2e8f0;
}

.client-modal-section {
  margin-bottom: 1.5rem;
}

.client-modal-section h3 {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.snapshot-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.9rem;
}

.snapshot-date {
  color: #94a3b8;
}

.snapshot-value {
  color: #f8fafc;
  font-weight: 600;
  font-family: monospace;
}

/* Additional modal styles */
.detail-grid {
  display: grid;
  gap: 0.5rem;
}

.detail-grid .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1e293b;
}

.detail-grid .detail-row span:first-child {
  color: #94a3b8;
}

.detail-grid .detail-row span:last-child {
  color: #f8fafc;
  font-weight: 600;
}

.bot-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.bot-badge {
  background: #3b82f6;
  color: white;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.snapshots-list {
  max-height: 200px;
  overflow-y: auto;
}

.text-muted {
  color: #64748b;
  font-style: italic;
}

/* ============================================
   CLIENTS TABLE - Consistent with site style
   ============================================ */

.clients-table {
  width: 100%;
}

.clients-table th {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
}

.clients-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  vertical-align: middle;
}

.clients-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.clients-table .row-danger {
  background: rgba(239, 68, 68, 0.1);
}

.clients-table .row-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Client name cell */
.client-name-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.client-name-cell .name {
  font-weight: 600;
  color: #f8fafc;
}

.client-name-cell .id {
  font-size: 0.7rem;
  color: #64748b;
  font-family: monospace;
}

/* Profile badges - smaller for table */
.clients-table .profile-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

.profile-badge.conservative {
  background: #3b82f6;
  color: white;
}

.profile-badge.balanced {
  background: #8b5cf6;
  color: white;
}

.profile-badge.aggressive {
  background: #f97316;
  color: white;
}

/* Action buttons */
.actions-cell {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  background: #334155;
  border: none;
  color: #94a3b8;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-action:hover {
  background: #475569;
  color: #f8fafc;
}

.btn-action.btn-restore {
  background: #10b981;
  color: white;
}

.btn-action.btn-restore:hover {
  background: #059669;
}

/* ============================================
   MODAL FIX - Higher specificity
   ============================================ */

div.client-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.85) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 9999 !important;
  backdrop-filter: blur(8px);
}

div.client-modal-overlay .client-modal {
  background: #1e293b !important;
  border-radius: 16px !important;
  padding: 1.5rem !important;
  max-width: 550px !important;
  width: 90% !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

div.client-modal-overlay .client-modal-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 1.5rem !important;
  padding-bottom: 1rem !important;
  border-bottom: 1px solid #334155 !important;
}

div.client-modal-overlay .client-modal-header h2 {
  margin: 0 !important;
  color: #f8fafc !important;
  font-size: 1.25rem !important;
}

div.client-modal-overlay .client-modal-close {
  background: #334155 !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 1.5rem !important;
  cursor: pointer !important;
  padding: 0.25rem 0.6rem !important;
  border-radius: 6px !important;
  line-height: 1 !important;
}

div.client-modal-overlay .client-modal-close:hover {
  background: #475569 !important;
  color: #f8fafc !important;
}

div.client-modal-overlay .client-modal-section {
  margin-bottom: 1.25rem !important;
}

div.client-modal-overlay .client-modal-section h3 {
  font-size: 0.75rem !important;
  color: #64748b !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  margin-bottom: 0.75rem !important;
  font-weight: 600 !important;
}

div.client-modal-overlay .detail-grid {
  background: rgba(15, 23, 42, 0.5) !important;
  border-radius: 8px !important;
  padding: 0.75rem !important;
}

div.client-modal-overlay .detail-grid .detail-row {
  display: flex !important;
  justify-content: space-between !important;
  padding: 0.4rem 0 !important;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5) !important;
  font-size: 0.85rem !important;
}

div.client-modal-overlay .detail-grid .detail-row:last-child {
  border-bottom: none !important;
}

div.client-modal-overlay .detail-grid .detail-row span:first-child {
  color: #94a3b8 !important;
}

div.client-modal-overlay .detail-grid .detail-row span:last-child {
  color: #f8fafc !important;
  font-weight: 500 !important;
}

/* Bot badges with gap */
div.client-modal-overlay .bot-list {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
}

div.client-modal-overlay .bot-badge {
  background: #3b82f6 !important;
  color: white !important;
  padding: 0.3rem 0.6rem !important;
  border-radius: 6px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
}

/* Snapshots list */
div.client-modal-overlay .snapshots-list {
  background: rgba(15, 23, 42, 0.5) !important;
  border-radius: 8px !important;
  padding: 0.5rem !important;
  max-height: 180px !important;
  overflow-y: auto !important;
}

div.client-modal-overlay .snapshot-item {
  display: flex !important;
  justify-content: space-between !important;
  padding: 0.35rem 0.5rem !important;
  font-size: 0.8rem !important;
}

div.client-modal-overlay .snapshot-item:nth-child(odd) {
  background: rgba(51, 65, 85, 0.3) !important;
  border-radius: 4px !important;
}

div.client-modal-overlay .snapshot-date {
  color: #94a3b8 !important;
}

div.client-modal-overlay .snapshot-value {
  color: #10b981 !important;
  font-weight: 600 !important;
  font-family: monospace !important;
}

/* ==================== P&L REPORT ==================== */
.pnl-section .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pnl-period-selector {
  display: flex;
  gap: 0.5rem;
}

.btn-period {
  padding: 0.25rem 0.75rem;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-period:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

.btn-period.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
}

.pnl-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .pnl-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.pnl-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid #334155;
}

.pnl-card.income {
  border-color: #10b981;
}

.pnl-card.expenses {
  border-color: #ef4444;
}

.pnl-card.net {
  border-color: #3b82f6;
}

.pnl-card.breakeven {
  border-color: #f59e0b;
}

.pnl-card-header {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pnl-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f1f5f9;
  font-family: 'JetBrains Mono', monospace;
}

.pnl-card-value.positive {
  color: #10b981;
}

.pnl-card-value.negative {
  color: #ef4444;
}

.pnl-card-label {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.pnl-breakdown {
  background: #1e293b;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.pnl-breakdown h4 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 600px) {
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: #0f172a;
  border-radius: 6px;
}

.breakdown-label {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.breakdown-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #f1f5f9;
  font-family: 'JetBrains Mono', monospace;
}

.breakdown-detail {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.pnl-chart-container {
  background: #1e293b;
  border-radius: 8px;
  padding: 1rem;
}

.pnl-chart-container h4 {
  margin: 0 0 1rem 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

#pnl-chart {
  max-height: 250px;
}

.loading-placeholder {
  text-align: center;
  padding: 2rem;
  color: #64748b;
}

/* ==================== ELITE PORTFOLIO SECTION ==================== */
.elite-section {
  margin-bottom: 1.5rem;
}

.elite-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.elite-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.elite-label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.elite-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e2e8f0;
}

.elite-value.positive { color: #10b981; }
.elite-value.negative { color: #ef4444; }

.elite-positions-list {
  margin-top: 1rem;
}

.elite-position {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.pos-symbol {
  font-weight: 600;
  color: #e2e8f0;
}

.pos-side {
  text-align: center;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.pos-side.long {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.pos-side.short {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.pos-size {
  text-align: right;
  color: #94a3b8;
}

.pos-pnl {
  text-align: right;
  font-weight: 500;
}

.pos-pnl.positive { color: #10b981; }
.pos-pnl.negative { color: #ef4444; }

.no-positions {
  text-align: center;
  color: #64748b;
  padding: 1rem;
  font-style: italic;
}

.elite-status {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: #64748b;
}

.btn-refresh {
  background: transparent;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.btn-refresh:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

@media (max-width: 768px) {
  .elite-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .elite-position {
    grid-template-columns: 1fr 1fr;
  }
}

/* =====================================================
   DECISIONING SECTION - PREMIUM DESIGN
   ===================================================== */

.decisioning-section {
  margin-top: 24px;
}

.decisioning-section .card {
  background: linear-gradient(135deg, #1e293b 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  overflow: hidden;
}

.decisioning-section .card-header {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.15) 0%, transparent 100%);
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.decisioning-section .card-header h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  margin-right: 10px;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.blockers-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blocker-item {
  display: grid;
  grid-template-columns: 180px 60px 1fr;
  gap: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
  border-radius: 10px;
  border-left: 4px solid var(--danger);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.blocker-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.05));
  pointer-events: none;
}

.blocker-item:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.04) 100%);
  transform: translateX(4px);
}

.blocker-reason {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 4px;
  display: inline-block;
}

.blocker-count {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 20px;
  text-align: center;
}

.blocker-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.why-not-box {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.why-status {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.why-suggestion {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.why-blockers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.why-blocker {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.why-blocker:hover {
  background: rgba(255, 255, 255, 0.05);
}

.why-blocker small {
  color: var(--text-muted);
  font-family: monospace;
  font-size: 0.75rem;
}

.decisions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.decision-item {
  display: grid;
  grid-template-columns: 55px 30px 95px 95px 1fr;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 8px;
  font-size: 0.85rem;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.decision-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.decision-item.blocked {
  border-left: 3px solid var(--danger);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.06) 0%, transparent 30%);
}

.decision-item.executed {
  border-left: 3px solid var(--success);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.06) 0%, transparent 30%);
}

.decision-time {
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.75rem;
}

.decision-symbol {
  font-weight: 600;
  color: var(--text-primary);
}

.decision-result {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.decision-reason {
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   EFFICIENCY SECTION - PREMIUM DESIGN
   ===================================================== */

.efficiency-section {
  margin-top: 24px;
}

.efficiency-section .card {
  background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.efficiency-section .card-header {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, transparent 100%);
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.efficiency-section .card-header h3::before {
  content: "⚡";
  margin-right: 8px;
}

.efficiency-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.eff-kpi {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.15);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.eff-kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

.eff-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.eff-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.eff-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'SF Mono', Monaco, monospace;
}

.eff-value.highlight {
  color: var(--primary);
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.breakdown-item {
  display: grid;
  grid-template-columns: 160px 1fr 80px;
  gap: 16px;
  align-items: center;
}

.breakdown-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.breakdown-bar-container {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), #fbbf24);
  border-radius: 5px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.breakdown-bar.danger {
  background: linear-gradient(90deg, var(--danger), #f87171);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.breakdown-bar.success {
  background: linear-gradient(90deg, var(--success), #34d399);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.breakdown-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  font-family: 'SF Mono', Monaco, monospace;
}

.saved-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  border-radius: 12px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  transition: all 0.2s ease;
}

.saved-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
}

.saved-icon {
  font-size: 2rem;
  animation: bounce-gentle 2s infinite;
}

@keyframes bounce-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.saved-text {
  color: var(--success);
  font-weight: 600;
  font-size: 1.1rem;
}

.saved-amount {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

/* =====================================================
   SHADOW OUTCOME SECTION - PREMIUM DESIGN
   ===================================================== */

.shadow-section {
  margin-top: 24px;
}

.shadow-section .card {
  background: linear-gradient(135deg, #1e293b 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
  overflow: hidden;
}

.shadow-section .card-header {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15) 0%, transparent 100%);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.shadow-section .card-header h3::before {
  content: "👻";
  margin-right: 8px;
}

.shadow-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.shadow-stat {
  text-align: center;
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.shadow-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.shadow-stat.saved {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.02) 100%);
  border-color: rgba(34, 197, 94, 0.3);
}

.shadow-stat.saved::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--success), #34d399);
}

.shadow-stat.missed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.02) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.shadow-stat.missed::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--danger), #f87171);
}

.shadow-stat.net {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.shadow-stat.net::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'SF Mono', Monaco, monospace;
}

.stat-value.positive { color: var(--success); }
.stat-value.negative { color: var(--danger); }

.stat-pct {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.phantom-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.phantom-item {
  display: grid;
  grid-template-columns: 55px 85px 60px 85px 1fr;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 8px;
  font-size: 0.85rem;
  align-items: center;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.phantom-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.phantom-item.saved {
  border-left: 3px solid var(--success);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.06) 0%, transparent 30%);
}

.phantom-item.missed {
  border-left: 3px solid var(--danger);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.06) 0%, transparent 30%);
}

.phantom-item.pending {
  border-left: 3px solid var(--warning);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06) 0%, transparent 30%);
}

.phantom-time {
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.75rem;
}

.phantom-symbol {
  font-weight: 600;
  color: var(--text-primary);
}

.phantom-dir {
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  text-align: center;
}

.phantom-price {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.8rem;
}

.phantom-outcome {
  font-size: 0.8rem;
  font-weight: 500;
}

.phantom-outcome.saved {
  color: var(--success);
}

.phantom-outcome.missed {
  color: var(--danger);
}

.phantom-outcome.pending {
  color: var(--warning);
}

/* =====================================================
   GOVERNANCE SECTION - PREMIUM DESIGN
   ===================================================== */

.governance-section {
  margin-top: 24px;
}

.governance-section .card {
  background: linear-gradient(135deg, #1e293b 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
  overflow: hidden;
}

.governance-section .card-header {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15) 0%, transparent 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
}

.governance-section .card-header h3::before {
  content: "📜";
  margin-right: 8px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.rule-item:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
}

.rule-icon {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
}

.rule-text {
  color: var(--text-secondary);
  line-height: 1.5;
}

.rule-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.audit-files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audit-file {
  display: grid;
  grid-template-columns: 110px 90px 90px;
  gap: 16px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.audit-file:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.audit-date {
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text-primary);
  font-weight: 500;
}

.audit-size, .audit-lines {
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.8rem;
}

.no-data {
  color: var(--text-muted);
  font-style: italic;
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.loading-small {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading-small::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   RISK-ADJUSTED RETURN (BUSSOLA)
   ===================================================== */

.rar-bussola {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.rar-bussola h4 {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.rar-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.rar-main {
  display: flex;
  align-items: center;
  gap: 16px;
}

.rar-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.rar-value {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: monospace;
}

.rar-value.positive {
  color: var(--success);
}

.rar-value.marginal {
  color: var(--warning);
}

.rar-value.negative {
  color: var(--danger);
}

.rar-value.neutral {
  color: var(--text-muted);
}

.rar-status {
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.rar-status.tradable {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.rar-status.marginal {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.rar-status.not-tradable {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.rar-status.no-drawdown-data {
  background: rgba(99, 102, 241, 0.15);
  color: var(--info);
}

.rar-formula {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* =====================================================
   GOVERNANCE SECTION STYLES - PREMIUM DESIGN
   ===================================================== */

/* Lock Status Box */
.lock-status-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 2px solid var(--border);
  transition: all 0.2s ease;
}

.lock-status-box.locked {
  border-color: var(--danger);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.lock-status-box.unlocked {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
}

.lock-emoji {
  font-size: 2.5rem;
  animation: lock-pulse 3s infinite;
}

@keyframes lock-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.lock-text {
  font-weight: 700;
  font-size: 1.2rem;
}

.lock-since {
  display: block;
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 0.85rem;
}

.drawdown-indicator {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawdown-indicator.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.drawdown-indicator.warning::before {
  content: "⚠️";
}

/* Budget Grid */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.budget-item {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.budget-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.budget-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--success), #34d399);
}

.budget-item.exhausted {
  border-color: var(--danger);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.03) 100%);
}

.budget-item.exhausted::before {
  background: linear-gradient(90deg, var(--danger), #f87171);
}

.budget-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.budget-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'SF Mono', Monaco, monospace;
  margin: 4px 0;
}

.budget-remaining {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Budget Progress Bar */
.budget-progress {
  margin-top: 10px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.budget-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #34d399);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.budget-item.exhausted .budget-progress-bar {
  background: linear-gradient(90deg, var(--danger), #f87171);
}

/* Lock Period Box */
.lock-period-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.lock-period-box.active {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.1);
}

.period-icon {
  font-size: 1.5rem;
}

.period-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.period-end {
  color: var(--text-muted);
  margin-left: auto;
  font-size: 0.85rem;
  font-family: 'SF Mono', Monaco, monospace;
}

/* Change Log */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 90px 36px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.changelog-entry:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.entry-time {
  color: var(--text-muted);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.75rem;
}

.entry-emoji {
  text-align: center;
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 8px;
}

.entry-type {
  font-weight: 600;
  color: var(--text-primary);
}

.entry-reason {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.entry-hash {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Integrity Badge */
.integrity-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.integrity-badge.valid {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0.1) 100%);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.integrity-badge.valid::before {
  content: "✓";
}

.integrity-badge.invalid {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.1) 100%);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.integrity-badge.invalid::before {
  content: "✗";
}

/* Error Box */
.error-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  color: var(--danger);
}

.error-box::before {
  content: "⚠️";
  font-size: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .efficiency-kpis,
  .shadow-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .decision-item,
  .phantom-item {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .blocker-item {
    grid-template-columns: 1fr;
  }

  .budget-grid {
    grid-template-columns: 1fr;
  }

  .changelog-entry {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }
}

/* ============================================
   COPY TRADING PROFILE SECTION
   ============================================ */

.copytrading-section {
  margin-top: 1.5rem;
}

.copytrading-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .copytrading-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ct-kpi {
  background: rgba(30, 41, 59, 0.6);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.ct-kpi.highlight {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.ct-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.ct-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ct-value.positive {
  color: var(--success);
}

.ct-value.negative {
  color: var(--danger);
}

.ct-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .ct-detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ct-detail {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.ct-detail-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.ct-detail-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.copytrading-link .btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.copytrading-link .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
