/* ==========================================================================
   PORTOBALANCE DESIGN SYSTEM — LUXURY FINTECH & GLASSMORPHYSIC DARK THEME (v4)
   ========================================================================== */

:root {
  /* Core Backgrounds */
  --bg-canvas: #090c12;
  --bg-surface: rgba(17, 23, 36, 0.72);
  --bg-surface-elevated: rgba(26, 34, 52, 0.75);
  --bg-surface-subtle: rgba(255, 255, 255, 0.03);
  --bg-surface-hover: rgba(255, 255, 255, 0.06);

  /* Glassmorphism Borders & Shadows */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 255, 255, 0.16);
  --border-focus: rgba(99, 102, 241, 0.5);
  --shadow-ambient: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow-blue: 0 0 25px rgba(59, 130, 246, 0.25);
  --shadow-glow-green: 0 0 25px rgba(16, 185, 129, 0.25);

  /* Accent & Action Colors */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-glow: rgba(59, 130, 246, 0.4);
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  --emerald-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);

  --crimson: #ef4444;
  --crimson-glow: rgba(239, 68, 68, 0.35);

  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.35);

  --purple: #8b5cf6;

  /* Typography Colors */
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --text-inverse: #0b0f19;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Transitions */
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.45s cubic-bezier(0.16, 1, 0.3, 1);

  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glow Spheres */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  animation: pulseSlow 12s infinite alternate ease-in-out;
}
.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
  top: -150px;
  left: -100px;
}
.glow-2 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28) 0%, transparent 70%);
  top: 30%;
  right: -200px;
  animation-delay: -4s;
}
.glow-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  bottom: -150px;
  left: 25%;
  animation-delay: -8s;
}

@keyframes pulseSlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
  50% { transform: scale(1.15) translate(20px, 30px); opacity: 0.55; }
  100% { transform: scale(0.95) translate(-15px, -20px); opacity: 0.35; }
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1720px;
  width: 96%;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Glass Panel Reusable Utility */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.glass-panel:hover {
  border-color: var(--border-glass-bright);
}

/* --------------------------------------------------------------------------
   TOP NAVIGATION BAR
   -------------------------------------------------------------------------- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(15, 20, 32, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.35);
  letter-spacing: 0.05em;
  -webkit-text-fill-color: #60a5fa;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 0.9rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #e2e8f0;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 10px var(--emerald);
}

.live-dot.pulse {
  animation: livePulse 1.8s infinite ease-out;
}

@keyframes livePulse {
  0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.last-sync {
  font-size: 0.72rem;
  color: var(--emerald);
  font-weight: 600;
  font-family: var(--font-mono);
  border-left: 1px solid var(--border-glass);
  padding-left: 0.75rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-exchange-info {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}
.btn-exchange-info:hover {
  color: #ffffff;
  border-color: var(--border-glass-bright);
  background: rgba(255, 255, 255, 0.09);
}

/* Currency Toggle */
.currency-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
}

.curr-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.curr-btn:hover { color: var(--text-main); }
.curr-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

/* Icon Buttons */
.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-glass-bright);
  transform: translateY(-1px);
}

.btn-icon.spinning svg {
  animation: spin 1s linear infinite;
}

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

/* --------------------------------------------------------------------------
   KPI HIGHLIGHTS GRID
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.kpi-card {
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.kpi-card.highlight-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-gradient);
}

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

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.kpi-tag {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.kpi-subvalue {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-faint);
}

.kpi-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.badge-good {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-alert {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-action {
  background: rgba(99, 102, 241, 0.18);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.sync-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.sync-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--emerald-gradient);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 0.8rem;
}

.kpi-change {
  font-family: var(--font-mono);
  font-weight: 600;
}
.kpi-change.positive { color: var(--emerald); }
.kpi-change.negative { color: var(--crimson); }

.kpi-note {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}
.btn-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   MAIN WORKSPACE LAYOUT (TOP SPLIT ANALYTICS + BOTTOM FULL HOLDINGS TABLE)
   -------------------------------------------------------------------------- */
.main-workspace {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  width: 100%;
}

.workspace-row-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  width: 100%;
}

.workspace-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  width: 100%;
}

/* Card Component Base */
.card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.full-width-card {
  width: 100%;
}

#sectionHoldings {
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.card-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.table-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.source-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dot-stream {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.badge-icon-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.p-0 { padding: 0 !important; }

/* --------------------------------------------------------------------------
   COMPACT GROUPED POOL CONTROL STRIP
   -------------------------------------------------------------------------- */
.grouped-pool-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.95rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
  animation: fadeIn 0.2s ease-out;
}

.pool-compact-desc {
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.pool-compact-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pool-tag-mini {
  font-size: 0.78rem;
  font-weight: 700;
  color: #818cf8;
}

.pool-mini-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.highlight-pool-mini {
  color: #34d399;
  font-weight: 600;
}

.table-input-target-mini {
  width: 52px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-glass-bright);
  border-radius: 6px;
  padding: 2px 6px;
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: right;
}
.table-input-target-mini:focus {
  outline: none;
  border-color: var(--primary);
}

.target-mode-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.target-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.target-mode-btn:hover { color: #ffffff; }

.target-mode-btn.active {
  background: rgba(99, 102, 241, 0.22);
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem;
}

.currency-indicator-note {
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   CHARTS VISUALIZATION SECTION & 100% ALLOCATION STRIP
   -------------------------------------------------------------------------- */
.chart-view-toggle {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

#sectionCharts .card-body {
  min-height: 345px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.charts-comparison-wrapper {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 310px;
}

.chart-subpanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.subpanel-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.target-ind { background: var(--primary); }
.actual-ind { background: var(--emerald); }

.chart-canvas-box {
  width: 100%;
  max-width: 250px;
  height: 250px;
  position: relative;
}

.chart-divider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

/* 100% Horizontal Allocation Strip Styles */
.strip-charts-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0;
  min-height: 310px;
  justify-content: center;
}

.strip-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.strip-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.strip-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.horizontal-strip-bar {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass-bright);
  display: flex;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.strip-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  white-space: nowrap;
  padding: 0 4px;
}
.strip-segment:hover {
  filter: brightness(1.15);
}

.strip-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.unallocated-segment {
  background: repeating-linear-gradient(
    45deg,
    rgba(51, 65, 85, 0.75),
    rgba(51, 65, 85, 0.75) 10px,
    rgba(30, 41, 59, 0.75) 10px,
    rgba(30, 41, 59, 0.75) 20px
  ) !important;
  color: #94a3b8 !important;
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

/* Drift Gap Bar */
.drift-chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 310px;
  justify-content: center;
}

.drift-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-canvas-box-bar {
  width: 100%;
  height: 220px;
}

.chart-footnote {
  font-size: 0.75rem;
  color: var(--text-faint);
  text-align: center;
  font-style: italic;
}

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   STREAMLINED ALL-IN-ONE HOLDINGS TABLE (With Dual Price Display)
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

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

/* Explicit fixed column width distribution */
.col-asset { width: 16%; }
.col-price { width: 17%; }
.col-change { width: 8%; }
.col-amount { width: 15%; }
.col-total { width: 16%; }
.col-weight { width: 8%; }
.col-target { width: 8%; }
.col-drift { width: 8%; }
.col-action { width: 4%; }

.data-table th {
  padding: 0.85rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table td {
  padding: 0.75rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.data-table tr:hover td {
  background: var(--bg-surface-subtle);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* Realtime Tick Animations */
td.flash-up {
  background-color: rgba(16, 185, 129, 0.22) !important;
  color: #34d399 !important;
}

td.flash-down {
  background-color: rgba(239, 68, 68, 0.22) !important;
  color: #f87171 !important;
}

/* Dual Price Box */
.price-dual-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.price-primary-text {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
  font-size: 0.82rem;
  white-space: nowrap;
}

.price-secondary-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Asset Row & Binance Verify Link */
.asset-identity {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.coin-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: white;
  background: #334155;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.coin-btc { background: linear-gradient(135deg, #f7931a, #ffb347); }
.coin-eth { background: linear-gradient(135deg, #627eea, #8ca5ff); }
.coin-sol { background: linear-gradient(135deg, #9945ff, #14f195); }
.coin-bnb { background: linear-gradient(135deg, #f3ba2f, #ffd15c); }
.coin-usdt { background: linear-gradient(135deg, #26a17b, #50d2a8); }
.coin-usdc { background: linear-gradient(135deg, #2775ca, #5ea8ff); }

.asset-names {
  display: flex;
  flex-direction: column;
}

.asset-symbol-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.asset-symbol {
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-mono);
}

.binance-verify-link {
  color: var(--text-faint);
  font-size: 0.72rem;
  text-decoration: none;
  padding: 1px 3px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}
.binance-verify-link:hover {
  color: #f3ba2f;
  background: rgba(243, 186, 47, 0.15);
}

.asset-category-tag {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
  width: fit-content;
}
.tag-core { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.tag-alts { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }
.tag-cash { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }

/* Numeric Mono cells */
.mono-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.table-input-amount, .table-input-target {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: right;
  transition: all var(--transition-fast);
}

.table-input-amount { width: 100%; max-width: 125px; }
.table-input-target { width: 54px; font-weight: 700; color: #60a5fa; }

.table-input-amount:focus, .table-input-target:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.pool-actual-display {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

/* Status Badges in Table */
.drift-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  width: 100%;
  max-width: 88px;
  min-width: 0;
  text-align: center;
  line-height: 1.2;
}

.drift-badge.underweight {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.drift-badge.overweight {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.drift-badge.maintain {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.drift-badge.balanced {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.btn-delete-row {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 5px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}
.btn-delete-row:hover {
  color: var(--crimson);
  background: rgba(239, 68, 68, 0.1);
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid var(--border-glass);
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.forex-info-icon { font-size: 0.95rem; }

.exchange-rate-meta {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-weight: 400;
  margin-left: 0.35rem;
}

.target-total-badge {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.target-total-badge.error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--crimson);
  border-color: rgba(239, 68, 68, 0.3);
}

.text-valid { color: var(--emerald); }
.text-invalid { color: var(--crimson); }

/* --------------------------------------------------------------------------
   FEATURE CARD: SMART INFLOW REBALANCER & LOGIC EXPLAINER
   -------------------------------------------------------------------------- */
.feature-card {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(180deg, rgba(26, 34, 56, 0.85) 0%, rgba(17, 23, 38, 0.8) 100%);
  box-shadow: 0 20px 45px -15px rgba(99, 102, 241, 0.18);
}

.inflow-input-card {
  background: rgba(13, 19, 33, 0.7);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.input-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
}

.currency-tag {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.inflow-input-group {
  display: flex;
  align-items: center;
  position: relative;
  gap: 0.65rem;
}

.inflow-input-group .input-prefix {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.15rem;
  color: #94a3b8;
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.02em;
  user-select: none;
}

.inflow-input-group .inflow-field,
input.styled-input.inflow-field {
  padding: 0.75rem 1.15rem 0.75rem 3.85rem !important;
  height: 52px;
  font-size: 1.25rem !important;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  color: #ffffff;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-sm);
  width: 100%;
}

.inflow-input-group .inflow-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.inflow-input-group .btn-calculate {
  background: var(--primary-gradient);
  border: none;
  color: white;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  height: 52px;
  padding: 0 1.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.inflow-input-group .btn-calculate:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: var(--border-glass-bright);
}
.chip-reset {
  color: var(--crimson);
  border-color: rgba(239, 68, 68, 0.2);
}
.chip-reset:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ff8080;
}

/* Rebalance Mode Selector */
.rebalance-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 0.25rem 0;
}

.mode-btn {
  background: rgba(10, 14, 24, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-glass-bright);
}

.mode-btn.active {
  background: rgba(99, 102, 241, 0.14);
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
}

.mode-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.mode-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Forecast Summary Banner */
.forecast-banner {
  background: rgba(10, 15, 28, 0.65);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  margin: 0.2rem 0;
}

.forecast-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.f-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.f-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.forecast-operator {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 1.1rem;
}

.text-accent { color: #60a5fa !important; }
.text-green { color: var(--emerald) !important; }

/* Floating Trigger Button for Logic Flow (Warm Honey Gold / Amber Theme) */
.logic-flow-trigger-wrap {
  margin: 0.35rem 0;
}

.btn-logic-flow-trigger {
  width: 100%;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  cursor: pointer;
  color: #fef3c7;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.08);
}

.btn-logic-flow-trigger:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.14) 100%);
  border-color: rgba(245, 158, 11, 0.65);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25);
}

.trigger-icon {
  font-size: 1.15rem;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
}

.trigger-label {
  flex: 1;
  text-align: left;
  color: #fef08a;
  letter-spacing: 0.01em;
}

.trigger-badge {
  font-size: 0.74rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.modal-card.modal-logic-flow,
.modal-logic-flow {
  max-width: 1080px !important;
  width: 94vw !important;
  max-height: 90vh !important;
}

/* 2-Column Executive Diagnostic Grid inside Modal */
.logic-flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  align-items: start;
}

.logic-flow-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.logic-flow-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.flow-card {
  background: rgba(13, 19, 33, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.flow-card.highlight-glow {
  border-color: rgba(59, 130, 246, 0.35);
  background: linear-gradient(180deg, rgba(20, 28, 48, 0.9) 0%, rgba(13, 19, 33, 0.85) 100%);
}

.flow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.flow-step-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pill-step-1 {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.pill-step-2 {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-step-3 {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.flow-card-tag {
  font-size: 0.72rem;
  color: var(--text-faint);
  font-weight: 600;
}

.tag-green { color: var(--emerald) !important; font-weight: 700; }
.tag-amber { color: #fbbf24 !important; font-weight: 700; }
.tag-blue { color: #60a5fa !important; font-weight: 700; }
.tag-neutral { color: var(--text-faint) !important; }

.flow-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.flow-stat-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.flow-card-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.5;
}

/* Formula 3-Box in Step 2 */
.flow-formula-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.25fr;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-glass-bright);
  text-align: center;
}

.flow-calc-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flow-calc-box .f-sublabel {
  font-size: 0.66rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flow-calc-box strong {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #ffffff;
}

.flow-calc-box.highlight-box strong {
  font-size: 0.95rem;
}

.flow-calc-operator {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Step 3: Rules Breakdown list */
.flow-rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.flow-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.rule-icon-pill {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.icon-maintain { background: rgba(59, 130, 246, 0.2); }
.icon-buy { background: rgba(16, 185, 129, 0.2); }
.icon-sell { background: rgba(239, 68, 68, 0.2); }
.icon-target { background: rgba(99, 102, 241, 0.2); }
.icon-skip { background: rgba(100, 116, 139, 0.2); }

.rule-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.rule-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.rule-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Diagnostic Items in Step 1 */
.diag-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.diag-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
  line-height: 1.45;
}

.diag-badge-def {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.diag-badge-sur {
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.diag-item-info {
  color: #cbd5e1;
  flex: 1;
  min-width: 0;
}
.diag-item-info strong {
  color: #ffffff;
}

/* Projection Table in Step 3 */
.projection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  overflow: hidden;
}

.projection-table th {
  text-align: left;
  padding: 0.5rem 0.65rem;
  color: var(--text-faint);
  font-size: 0.7rem;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-glass);
}

.projection-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-mono);
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.modal-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
}

.guide-section {
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.15rem;
}
.guide-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.guide-section-title {
  font-size: 0.92rem;
  color: #ffffff;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.guide-text {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.guide-bullet-list {
  margin-top: 0.5rem;
  margin-left: 1.25rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  line-height: 1.45;
}

/* Recommendation Cards List */
.recommendations-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.rec-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

.rec-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Individual Recommendation Action Card */
.action-card-item {
  background: rgba(14, 19, 32, 0.75);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.action-card-item:hover {
  border-color: var(--border-glass-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.action-card-item.priority-buy {
  border-left: 4px solid var(--emerald);
  background: rgba(16, 185, 129, 0.04);
}

.action-card-item.maintain-action {
  border-left: 4px solid #60a5fa;
  background: rgba(59, 130, 246, 0.04);
}

.action-card-item.skip-action {
  border-left: 4px solid var(--text-faint);
  opacity: 0.72;
}

.action-card-item.sell-action {
  border-left: 4px solid var(--crimson);
}

.action-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-asset-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.action-type-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.pill-buy {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.pill-maintain {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.pill-skip {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.pill-sell {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.action-reason-note {
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.35;
  margin-top: 0.4rem;
  display: block;
}

.drift-badge.maintain {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.action-card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.action-amount-display {
  display: flex;
  flex-direction: column;
}

.action-currency-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
}

.action-coin-val {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.action-target-shift {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shift-numbers {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
}

/* Copy Instructions & Feedback */
.action-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.copy-feedback {
  font-size: 0.8rem;
  color: var(--emerald);
  text-align: center;
  font-weight: 600;
  animation: fadeIn 0.2s ease-in;
}

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

/* Edu Card */
.edu-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.65);
}

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

.edu-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.edu-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
}

.edu-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   SEARCH AUTOCOMPLETE FOR 490+ COINS
   -------------------------------------------------------------------------- */
.search-box-wrapper {
  position: relative;
  width: 100%;
}

.coin-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #0f1523;
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-sm);
  z-index: 120;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
}

.coin-search-item {
  padding: 0.6rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  transition: background var(--transition-fast);
}

.coin-search-item:hover {
  background: rgba(59, 130, 246, 0.2);
}

.coin-search-symbol {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
}

.coin-search-tag {
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* --------------------------------------------------------------------------
   EXCHANGE COMPARISON MODAL
   -------------------------------------------------------------------------- */
.exchange-comparison-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exchange-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.exchange-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.exchange-card-title {
  font-size: 0.9rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.exchange-summary-note {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* --------------------------------------------------------------------------
   MODALS
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  background: #111726;
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

.modal-lg { max-width: 680px; }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.65);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #ffffff; }

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.styled-select, .styled-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  width: 100%;
  transition: all var(--transition-fast);
}

.styled-select:focus, .styled-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.uppercase { text-transform: uppercase; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.65);
}

.modal-footer-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: auto;
}

/* Guide modal steps */
.guide-content {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.guide-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.step-desc h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.step-desc p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   BUTTONS & COMMON CONTROLS
   -------------------------------------------------------------------------- */
.btn-primary {
  background: var(--primary-gradient);
  border: none;
  color: white;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glass-bright);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}
.btn-danger:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

/* Modal Confirmation Card */
.modal-confirm-card {
  max-width: 480px;
  width: 92%;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-confirm-msg {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0.5rem 0;
}
.modal-confirm-msg strong {
  color: #ffffff;
}

.w-full { width: 100%; }

/* --------------------------------------------------------------------------
   FOOTER & NOTIFICATIONS
   -------------------------------------------------------------------------- */
.app-footer {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-glass);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-privacy {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 600px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-link-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.footer-link-btn:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.separator { color: var(--border-glass-bright); }

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: #ffffff;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left: 4px solid var(--emerald); }
.toast.error { border-left: 4px solid var(--crimson); }
.toast.info { border-left: 4px solid var(--primary); }

@keyframes slideToast {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES (Mobile & Tablet)
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .workspace-row-split {
    grid-template-columns: 1fr;
  }
  .logic-flow-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .charts-comparison-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .chart-divider {
    display: none;
  }
  .exchange-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-container {
    padding: 0.75rem 0.75rem 2rem;
  }
  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .rebalance-mode-toggle {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
