/* ====================================================
   BINANCE SPOT DASHBOARD & TERMINAL - STYLESHEET
   Design System: Deep Dark Palette, Binance Yellow & Glassmorphism
   ==================================================== */

:root {
  --bg-main: #0b0e11;
  --bg-card: #181a20;
  --bg-card-hover: #1e2329;
  --bg-subtle: #2b313a;
  --border-color: #2f3540;
  --border-focus: #F0B90B;

  --primary-gold: #F0B90B;
  --primary-gold-hover: #fcd535;
  --buy-green: #0ECB81;
  --buy-green-bg: rgba(14, 203, 129, 0.12);
  --sell-red: #F6465D;
  --sell-red-bg: rgba(246, 70, 93, 0.12);

  --text-main: #EAECEF;
  --text-muted: #848E9C;
  --text-dim: #5E6673;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
  --transition-fast: 0.18s ease;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ==========================================
   NAVBAR
   ========================================== */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(24, 26, 32, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 185, 11, 0.12);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-gold);
}

.brand-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(240, 185, 11, 0.15);
  color: var(--primary-gold);
  border: 1px solid rgba(240, 185, 11, 0.3);
}

.badge-version {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.badge-version:hover {
  background: rgba(240, 185, 11, 0.15);
  color: var(--primary-gold);
  border-color: rgba(240, 185, 11, 0.4);
  transform: translateY(-1px);
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background-color: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #0b0e11;
  background: var(--primary-gold);
  box-shadow: 0 2px 8px rgba(240, 185, 11, 0.35);
}

.navbar-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.meta-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.meta-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.meta-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-main);
}

.btn-refresh,
.btn-navbar-action {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-refresh svg {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-refresh:hover {
  color: var(--primary-gold);
  border-color: var(--primary-gold);
}

.btn-refresh:hover svg {
  transform: rotate(180deg);
}

.btn-refresh:active svg {
  transform: rotate(360deg);
}

.btn-refresh.loading {
  pointer-events: none;
}

.btn-refresh.loading svg {
  animation: spin-refresh 0.8s linear infinite;
}

.btn-help {
  color: var(--text-muted);
}

.btn-help:hover {
  color: var(--primary-gold);
  border-color: rgba(240, 185, 11, 0.4);
  background: rgba(240, 185, 11, 0.08);
}

.btn-help:active {
  transform: scale(0.95);
}

.btn-logout {
  color: var(--text-muted);
}

.btn-logout:hover {
  color: #f6465d;
  border-color: rgba(246, 70, 93, 0.4);
  background: rgba(246, 70, 93, 0.08);
}

.btn-logout:active {
  transform: scale(0.95);
}

/* ==========================================
   APP CONTAINER & LAYOUT
   ========================================== */

.app-container {
  flex: 1;
  max-width: 1380px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

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

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

/* ==========================================
   STATUS BANNER & ACCOUNT TAB
   ========================================== */

.status-banner {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(24, 26, 32, 0.95), rgba(30, 35, 41, 0.85));
}

.status-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.val-group {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.value-highlight {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
}

.value-large {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-gold);
  font-family: var(--font-mono);
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-success {
  background: var(--buy-green-bg);
  color: var(--buy-green);
  border: 1px solid rgba(14, 203, 129, 0.3);
}

.permissions-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.chip.chip-active {
  color: var(--buy-green);
  border-color: rgba(14, 203, 129, 0.3);
  background: var(--buy-green-bg);
}

/* ==========================================
   SECTIONS & DATA TABLES
   ========================================== */

.card-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.search-box input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  width: 280px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--primary-gold);
}

.table-responsive {
  overflow-x: auto;
  padding: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(47, 53, 64, 0.4);
  color: var(--text-main);
}

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

.val-mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

.color-buy {
  color: var(--buy-green) !important;
}

.color-sell {
  color: var(--sell-red) !important;
}

.loading-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem !important;
}

/* ==========================================
   HISTORIAL TAB & FILTERS
   ========================================== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ====================================================
   FORM CONTROLS & DESIGN SYSTEM INPUTS (UNIFIED DARK)
   ==================================================== */

input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
.form-control {
  background-color: var(--bg-main);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.4;
  outline: none;
  transition: all var(--transition-fast);
  width: 100%;
}

input[type="number"] {
  font-family: var(--font-mono);
}

input[type="text"]:hover,
input[type="number"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
textarea:hover,
.form-control:hover {
  border-color: rgba(240, 185, 11, 0.4);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus,
.form-control:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}

.form-select,
select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.55rem 2.2rem 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23848E9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
}

.form-select:hover,
select:hover {
  border-color: rgba(240, 185, 11, 0.4);
}

.form-select:focus,
select:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.form-select option,
select option {
  background-color: #181a20;
  color: var(--text-main);
  padding: 8px;
}

/* ==========================================
   TRADING TAB
   ========================================== */

.trade-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

.trade-col-market {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.2rem;
}

.select-large {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
}

.live-ticker-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

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

.ticker-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.ticker-price {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--buy-green);
}

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

.ticker-change {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.ticker-change.up {
  color: var(--buy-green);
  background: var(--buy-green-bg);
}

.ticker-change.down {
  color: var(--sell-red);
  background: var(--sell-red-bg);
}

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

.stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
}

/* Mini Table */
.open-orders-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sub-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sub-title {
  font-size: 1rem;
  font-weight: 600;
}

.mini-table th, .mini-table td {
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
}

/* Order Placement Form Column */
.trade-col-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.order-side-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.side-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.side-btn.side-buy.active {
  background: var(--buy-green);
  color: #fff;
  box-shadow: 0 2px 10px rgba(14, 203, 129, 0.4);
}

.side-btn.side-sell.active {
  background: var(--sell-red);
  color: #fff;
  box-shadow: 0 2px 10px rgba(246, 70, 93, 0.4);
}

.order-type-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding: 0 0 0.5rem 0;
  margin-bottom: 0.75rem;
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
}

.order-type-tabs::-webkit-scrollbar {
  display: none;
}

.type-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  padding: 0.4rem 0.65rem 0.45rem 0.65rem;
  margin-bottom: -0.5rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.type-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.type-tab.active {
  color: var(--primary-gold);
  font-weight: 700;
  border-bottom: 2px solid var(--primary-gold);
  background: rgba(240, 185, 11, 0.08);
  box-shadow: 0 2px 8px rgba(240, 185, 11, 0.15);
}

.order-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.avail-balance-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.input-addon-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition-fast);
  width: 100%;
}

.input-addon-wrap:hover {
  border-color: rgba(240, 185, 11, 0.4);
}

.input-addon-wrap:focus-within {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.input-addon-wrap .form-input,
.input-addon-wrap .form-control,
.input-addon-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.65rem 0.8rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  width: auto;
}

.form-input {
  flex: 1;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:hover {
  border-color: rgba(240, 185, 11, 0.4);
}

.form-input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.input-addon {
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}

/* Quick Percentage Capital Allocation (25%, 50%, 75%, 100%) */
.percentage-buttons-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: -0.25rem;
  margin-bottom: 0.25rem;
}

.pct-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  text-align: center;
}

.pct-btn:hover {
  background: rgba(240, 185, 11, 0.1);
  border-color: rgba(240, 185, 11, 0.5);
  color: var(--primary-gold);
  transform: translateY(-1px);
}

.pct-btn.active {
  background: rgba(240, 185, 11, 0.18);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  box-shadow: 0 0 10px rgba(240, 185, 11, 0.25);
  font-weight: 700;
}

.pct-btn:active {
  transform: translateY(0);
}

.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--primary-gold);
  color: #0b0e11;
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-order {
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.5rem;
}

.btn-buy {
  background: var(--buy-green);
}

.btn-buy:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(14, 203, 129, 0.3);
}

.btn-sell {
  background: var(--sell-red);
}

.btn-sell:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px rgba(246, 70, 93, 0.3);
}

.btn-cancel {
  background: transparent;
  border: 1px solid rgba(246, 70, 93, 0.4);
  color: var(--sell-red);
  padding: 2px 8px;
  font-size: 0.75rem;
}

.badge-oco {
  background: rgba(240, 185, 11, 0.15);
  color: var(--primary-gold);
  border: 1px solid rgba(240, 185, 11, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-cancel-oco {
  background: rgba(246, 70, 93, 0.1);
  border: 1px solid rgba(246, 70, 93, 0.5);
  color: var(--sell-red);
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel-oco:hover {
  background: var(--sell-red);
  color: #fff;
  box-shadow: 0 0 8px rgba(246, 70, 93, 0.4);
}

/* ==========================================
   TOOLTIPS SYSTEM
   ========================================== */

[data-tooltip] {
  position: relative;
  cursor: help;
}

/* Tooltip Base (Hacia Arriba por defecto) */
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1e2329;
  color: #EAECEF;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  padding: 6px 11px;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  border: 1px solid #363c4e;
  border-top: 2px solid var(--primary-gold);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
  line-height: 1.35;
  text-align: center;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #363c4e;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 9999;
}

[data-tooltip]:hover::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ----------------------------------------------------
   ORIENTACIÓN HACIA ABAJO (Para Navbar, bordes superiores y tablas)
   ---------------------------------------------------- */
[data-tooltip-pos="bottom"]::before,
.tooltip-down::before,
.navbar [data-tooltip]::before {
  bottom: auto;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  border-top: 1px solid #363c4e;
  border-bottom: 2px solid var(--primary-gold);
  z-index: 10000;
}

[data-tooltip-pos="bottom"]::after,
.tooltip-down::after,
.navbar [data-tooltip]::after {
  bottom: auto;
  top: calc(100% + 1px);
  border-top-color: transparent;
  border-bottom-color: #363c4e;
  z-index: 10000;
}

[data-tooltip-pos="bottom"]:hover::before,
.tooltip-down:hover::before,
.navbar [data-tooltip]:hover::before {
  transform: translateX(-50%) translateY(0);
}

/* ----------------------------------------------------
   ALINEACIÓN LATERAL DERECHA (Para evitar salirse de pantalla derecha)
   ---------------------------------------------------- */
.tooltip-align-right::before,
.navbar-meta [data-tooltip]::before,
.btn-refresh[data-tooltip]::before {
  left: auto;
  right: 0;
  transform: translateY(-4px);
  text-align: right;
}

.tooltip-align-right::after,
.navbar-meta [data-tooltip]::after,
.btn-refresh[data-tooltip]::after {
  left: auto;
  right: 12px;
  transform: none;
}

.tooltip-align-right:hover::before,
.navbar-meta [data-tooltip]:hover::before,
.btn-refresh[data-tooltip]:hover::before {
  transform: translateY(0);
}

/* ----------------------------------------------------
   ALINEACIÓN LATERAL IZQUIERDA (Para elementos pegados al margen izquierdo)
   ---------------------------------------------------- */
.tooltip-align-left::before,
.brand-badge[data-tooltip]::before {
  left: 0;
  right: auto;
  transform: translateY(-4px);
  text-align: left;
}

.tooltip-align-left::after,
.brand-badge[data-tooltip]::after {
  left: 14px;
  right: auto;
  transform: none;
}

.tooltip-align-left:hover::before,
.brand-badge[data-tooltip]:hover::before {
  transform: translateY(0);
}

/* ----------------------------------------------------
   ORIENTACIÓN HACIA LA IZQUIERDA (Para botones en columnas derechas)
   ---------------------------------------------------- */
[data-tooltip-pos="left"]::before,
.tooltip-left::before {
  bottom: 50%;
  left: auto;
  right: calc(100% + 8px);
  transform: translateY(50%) translateX(4px);
  border-top: 1px solid #363c4e;
  border-left: 2px solid var(--primary-gold);
}

[data-tooltip-pos="left"]::after,
.tooltip-left::after {
  bottom: 50%;
  left: auto;
  right: calc(100% + 2px);
  transform: translateY(50%);
  border-top-color: transparent;
  border-left-color: #363c4e;
}

[data-tooltip-pos="left"]:hover::before,
.tooltip-left:hover::before {
  transform: translateY(50%) translateX(0);
}

.info-icon {
  font-size: 0.75rem;
  color: var(--text-dim);
  cursor: help;
  display: inline-block;
}

/* ==========================================
   MODAL & TOAST
   ========================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-box {
  width: 90%;
  max-width: 440px;
  background: #181a20;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.7);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.confirm-summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.modal-warning {
  font-size: 0.8rem;
  color: var(--primary-gold);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 300;
}

.toast {
  background: #181a20;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-gold);
  color: var(--text-main);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  font-size: 0.85rem;
  animation: slideInRight 0.25s ease-out;
}

.toast.toast-success {
  border-left-color: var(--buy-green);
}

.toast.toast-error {
  border-left-color: var(--sell-red);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================
   SCROLL TO TOP FLOATING BUTTON
   ========================================== */

.btn-scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 35, 41, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s, background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn-scroll-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.btn-scroll-top:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  box-shadow: 0 6px 20px rgba(240, 185, 11, 0.25);
  transform: translateY(-2px) scale(1.05);
}

.btn-scroll-top:active {
  transform: translateY(0) scale(0.95);
}

/* ==========================================
   CANDLESTICK CHART (TRADINGVIEW)
   ========================================== */

.chart-section {
  background: rgba(18, 22, 28, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-fast);
}

.chart-section:hover {
  border-color: rgba(240, 185, 11, 0.2);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.chart-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.chart-legend .legend-item strong {
  color: var(--text-main);
  font-weight: 500;
}

.legend-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

.legend-badge.up {
  background: var(--buy-green-bg);
  color: var(--buy-green);
}

.legend-badge.down {
  background: var(--sell-red-bg);
  color: var(--sell-red);
}

.chart-timeframe-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.tf-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tf-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.tf-btn.active {
  color: #000;
  background: var(--primary-gold);
  box-shadow: 0 2px 6px rgba(240, 185, 11, 0.3);
}

.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.chart-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(18, 22, 28, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================
   FAVORITES (WATCHLIST) STYLES
   ========================================== */

.favorites-section {
  margin-bottom: 2rem;
  border-left: 3px solid var(--primary-gold);
}

.header-with-badge {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.badge-gold {
  background: rgba(240, 185, 11, 0.15);
  color: var(--primary-gold);
  border: 1px solid rgba(240, 185, 11, 0.35);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  width: fit-content;
}

.favorites-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-add-wrap {
  min-width: 180px;
}

.select-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-dim);
  transition: transform 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.star-btn:hover {
  transform: scale(1.25);
  color: var(--primary-gold-hover);
}

.star-btn.star-active {
  color: var(--primary-gold);
  text-shadow: 0 0 8px rgba(240, 185, 11, 0.4);
}

.badge-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-change.up {
  background: var(--buy-green-bg);
  color: var(--buy-green);
}

.badge-change.down {
  background: var(--sell-red-bg);
  color: var(--sell-red);
}

/* ==========================================
   ORDER BOOK & SPREAD DEPTH STYLES
   ========================================== */

.order-book-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

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

.ob-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ob-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ob-view-modes {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.ob-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ob-mode-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.ob-mode-btn.active {
  color: #000;
  background: var(--primary-gold);
  box-shadow: 0 1px 4px rgba(240, 185, 11, 0.25);
}

.select-xs {
  padding: 3px 6px;
  font-size: 0.75rem;
  height: 28px;
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--border-color);
}

.order-book-table-container {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ob-table-header {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.ob-col-header.text-right {
  text-align: right;
}

.ob-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ob-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  align-items: center;
  position: relative;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.12s ease;
}

.ob-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.depth-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
  transition: width 0.2s ease-out;
}

.depth-bar-ask {
  background: rgba(246, 70, 93, 0.14);
}

.depth-bar-bid {
  background: rgba(14, 203, 129, 0.14);
}

.ob-cell {
  position: relative;
  z-index: 2;
}

.ob-cell.text-right {
  text-align: right;
}

.ob-price-ask {
  color: var(--sell-red);
  font-weight: 600;
}

.ob-price-bid {
  color: var(--buy-green);
  font-weight: 600;
}

.ob-qty {
  color: var(--text-main);
}

.ob-total {
  color: var(--text-muted);
}

.ob-spread-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  margin: 4px 0;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 4px;
}

.ob-spread-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.ob-mid-price {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.ob-mid-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.ob-spread-right {
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.ob-spread-val {
  color: var(--text-muted);
}

.ob-spread-pct {
  color: var(--primary-gold);
  font-weight: 600;
}

.ob-loading {
  text-align: center;
  padding: 0.8rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================
   CALCULADORA DE RIESGO / BENEFICIO (R:R)
   ========================================== */

.risk-reward-card {
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(18, 22, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.25s ease;
}

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

.rr-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-rr {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-rr-favorable {
  background: rgba(14, 203, 129, 0.18);
  color: var(--buy-green);
  border: 1px solid rgba(14, 203, 129, 0.35);
}

.badge-rr-moderate {
  background: rgba(240, 185, 11, 0.18);
  color: var(--primary-gold);
  border: 1px solid rgba(240, 185, 11, 0.35);
}

.badge-rr-risky {
  background: rgba(246, 70, 93, 0.18);
  color: var(--sell-red);
  border: 1px solid rgba(246, 70, 93, 0.35);
}

.rr-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.rr-metric-box {
  padding: 0.6rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rr-metric-box.rr-risk {
  border-left: 3px solid var(--sell-red);
}

.rr-metric-box.rr-reward {
  border-left: 3px solid var(--buy-green);
}

.rr-metric-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.rr-metric-val {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
}

.rr-risk .rr-metric-val {
  color: var(--sell-red);
}

.rr-reward .rr-metric-val {
  color: var(--buy-green);
}

.rr-metric-pct {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rr-ratio-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rr-ratio-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-gold);
}

.rr-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  overflow: hidden;
}

.rr-bar-fill-risk {
  height: 100%;
  background: var(--sell-red);
  transition: width 0.3s ease;
}

.rr-bar-fill-reward {
  height: 100%;
  background: var(--buy-green);
  transition: width 0.3s ease;
}

/* ==========================================
   ESTILOS WEBSOCKET STREAMING & ANIMACIONES
   ========================================== */

.badge-ws {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  transition: all 0.25s ease;
  position: relative;
}

.badge-ws .badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-ws-live {
  background: rgba(14, 203, 129, 0.15);
  border-color: rgba(14, 203, 129, 0.4);
  color: var(--buy-green);
  box-shadow: 0 0 8px rgba(14, 203, 129, 0.2);
}

.badge-ws-live .badge-dot {
  background: var(--buy-green);
  box-shadow: 0 0 6px var(--buy-green);
  animation: ws-pulse 1.8s infinite ease-in-out;
}

.badge-ws-reconnecting {
  background: rgba(240, 185, 11, 0.15);
  border-color: rgba(240, 185, 11, 0.4);
  color: var(--primary-gold);
}

.badge-ws-reconnecting .badge-dot {
  background: var(--primary-gold);
  animation: ws-blink 1s infinite alternate;
}

.badge-ws-rest {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
}

.badge-ws-rest .badge-dot {
  background: var(--sell-red, #f6465d);
}

@keyframes ws-pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}

@keyframes ws-blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

/* Micro-animaciones en display de precios al recibir ticks */
.price-tick-up {
  animation: flash-tick-green 0.6s ease-out;
}

.price-tick-down {
  animation: flash-tick-red 0.6s ease-out;
}

@keyframes flash-tick-green {
  0% {
    color: #0ECB81;
    text-shadow: 0 0 12px rgba(14, 203, 129, 0.8);
    transform: scale(1.03);
  }
  100% {
    text-shadow: none;
    transform: scale(1);
  }
}

@keyframes flash-tick-red {
  0% {
    color: #F6465D;
    text-shadow: 0 0 12px rgba(246, 70, 93, 0.8);
    transform: scale(1.03);
  }
  100% {
    text-shadow: none;
    transform: scale(1);
  }
}

.ob-row.ob-row-flash {
  animation: row-flash-bg 0.4s ease-out;
}

@keyframes row-flash-bg {
  0% {
    background-color: rgba(255, 255, 255, 0.08);
  }
  100% {
    background-color: transparent;
  }
}

/* ==========================================
   MÓDULO DE COMPRAS RECURRENTES DCA
   ========================================== */

.dca-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dca-metric-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
}

.dca-metric-card .metric-icon {
  font-size: 2.2rem;
  line-height: 1;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dca-metric-card .metric-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.dca-metric-card .metric-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dca-metric-card .metric-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.dca-metric-card .metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dca-layout-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.dca-form-card {
  padding: 1.25rem;
}

.dca-table-card {
  padding: 1.25rem;
}

.dca-preset-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.btn-dca-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-dca-preset:hover,
.btn-dca-preset.active {
  background: rgba(240, 185, 11, 0.18);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
}

.badge-dca-active {
  background: rgba(14, 203, 129, 0.15);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-dca-paused {
  background: rgba(240, 185, 11, 0.15);
  color: #F0B90B;
  border: 1px solid rgba(240, 185, 11, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-dca-completed {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-dca-cancelled {
  background: rgba(246, 70, 93, 0.15);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.dca-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.btn-dca-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-dca-action:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-dca-trigger {
  background: rgba(14, 203, 129, 0.2);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.4);
}

.btn-dca-pause {
  background: rgba(240, 185, 11, 0.2);
  color: #F0B90B;
  border: 1px solid rgba(240, 185, 11, 0.4);
}

.btn-dca-history {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-dca-cancel {
  background: rgba(246, 70, 93, 0.2);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.4);
}

/* ==========================================
   GRID TRADING BOT STYLES (REDISEÑO MEJORADO)
   ========================================== */

.grid-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.grid-metric-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-left: 3px solid var(--primary-gold);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.grid-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-left-color: var(--primary-gold-hover, #fcd535);
}

.grid-metric-card .metric-icon {
  font-size: 2.2rem;
  line-height: 1;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grid-metric-card .metric-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.grid-metric-card .metric-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grid-metric-card .metric-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.grid-metric-card .metric-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.grid-layout-grid {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.grid-form-card {
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}

.grid-form-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.grid-form-body .form-group {
  margin-bottom: 0.25rem;
}

.grid-form-body .form-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.grid-form-body .form-input,
.grid-form-body .form-control {
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
}

/* Quick chips bar & Symbol wrapper */
.symbol-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition-fast);
  width: 100%;
}

.symbol-input-wrapper:hover {
  border-color: rgba(240, 185, 11, 0.4);
}

.symbol-input-wrapper:focus-within {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.symbol-input-wrapper .form-input,
.symbol-input-wrapper .form-control,
.symbol-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0.6rem 0.8rem;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.btn-input-action {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-left: 1px solid var(--border-color);
  color: var(--primary-gold);
  padding: 0.6rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-input-action:hover {
  background: rgba(240, 185, 11, 0.15);
  color: #fff;
}

.quick-symbols-bar,
.quick-amounts-bar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.btn-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: rgba(240, 185, 11, 0.15);
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  transform: translateY(-1px);
}

.btn-chip:active {
  transform: translateY(0);
}

/* Segmented mode selector */
.grid-mode-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-mode-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-mode-tab.active {
  background: rgba(240, 185, 11, 0.18);
  color: var(--primary-gold);
  border: 1px solid rgba(240, 185, 11, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Preview Box & Levels Bar Track */
.grid-preview-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(240, 185, 11, 0.35);
  border-radius: 8px;
  padding: 0.85rem;
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.preview-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.preview-metric-row strong {
  font-family: var(--font-mono);
}

.grid-levels-bar-track {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 0.35rem;
}

.grid-levels-bar-buy {
  height: 100%;
  background: var(--buy-green, #0ECB81);
  transition: width 0.3s ease;
}

.grid-levels-bar-sell {
  height: 100%;
  background: var(--sell-red, #F6465D);
  transition: width 0.3s ease;
}

.grid-checkbox-group {
  margin-top: 0.85rem;
}

.grid-checkbox-label {
  font-size: 0.85rem;
}

.grid-form-actions {
  margin-top: 1rem;
}

.d-none {
  display: none !important;
}

.text-right {
  text-align: right !important;
}

.btn-create-grid {
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(240, 185, 11, 0.25);
}

/* Grid Table Card */
.grid-table-card {
  padding: 1.25rem;
}

.badge-grid-status {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
}

.badge-grid-active {
  background: rgba(14, 203, 129, 0.15);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.35);
  box-shadow: 0 0 8px rgba(14, 203, 129, 0.15);
}

.badge-grid-paused {
  background: rgba(240, 185, 11, 0.15);
  color: #F0B90B;
  border: 1px solid rgba(240, 185, 11, 0.35);
}

.badge-grid-completed {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.badge-grid-cancelled {
  background: rgba(246, 70, 93, 0.15);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.35);
}

.grid-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-grid-action {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-grid-action:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-grid-detail {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-grid-pause {
  background: rgba(240, 185, 11, 0.2);
  color: #F0B90B;
  border: 1px solid rgba(240, 185, 11, 0.4);
}

.btn-grid-stop {
  background: rgba(246, 70, 93, 0.2);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.4);
}

.btn-grid-delete {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-grid-check {
  background: rgba(14, 203, 129, 0.2);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.4);
}

.grid-modal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 1024px) {
  .grid-layout-grid {
    grid-template-columns: 1fr;
  }
  .grid-form-card {
    position: static;
  }
}

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

/* ==========================================
   ALERTAS DE PRECIO (PRICE ALERTS)
   ========================================== */

.btn-alerts-bell {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-alerts-bell:hover {
  background: rgba(240, 185, 11, 0.15);
  border-color: rgba(240, 185, 11, 0.4);
  transform: translateY(-1px);
}

.alerts-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #F0B90B;
  color: #0b0e11;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(240, 185, 11, 0.6);
  animation: badge-pulse 2s infinite ease-in-out;
}

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

.alerts-settings-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.25rem;
}

.setting-toggle-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

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

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .3s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent, #F0B90B);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
  background-color: #0b0e11;
}

.create-alert-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.form-subsection-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent, #F0B90B);
  margin-bottom: 0.75rem;
}

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

.modal-subtabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.modal-subtab {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-subtab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.modal-subtab.active {
  color: var(--accent, #F0B90B);
  background: rgba(240, 185, 11, 0.12);
}

.alerts-list-container {
  max-height: 280px;
  overflow-y: auto;
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.alert-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  transition: all 0.2s ease;
}

.alert-item-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.alert-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.alert-item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-item-note {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.badge-condition-up {
  background: rgba(14, 203, 129, 0.15);
  color: #0ECB81;
  border: 1px solid rgba(14, 203, 129, 0.3);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
}

.badge-condition-down {
  background: rgba(246, 70, 93, 0.15);
  color: #F6465D;
  border: 1px solid rgba(246, 70, 93, 0.3);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
}

.badge-alert-active {
  background: rgba(33, 150, 243, 0.15);
  color: #2196F3;
  border: 1px solid rgba(33, 150, 243, 0.3);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.badge-alert-triggered {
  background: rgba(240, 185, 11, 0.15);
  color: #F0B90B;
  border: 1px solid rgba(240, 185, 11, 0.3);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.badge-alert-disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}

.alert-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-alert-action {
  padding: 0.25rem 0.45rem;
  font-size: 0.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-alert-action:hover {
  opacity: 0.8;
}

/* ==========================================
   MANUAL DE OPERACIÓN & HELP MODAL
   ========================================== */

.help-modal-backdrop {
  z-index: 9998;
}

.modal-box-large {
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.help-modal-body {
  overflow-y: auto;
  padding-right: 0.5rem;
}

.help-section {
  margin-bottom: 1.25rem;
}

.help-section-title {
  color: var(--primary-gold, #F0B90B);
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

.help-section-text {
  font-size: 0.85rem;
  color: var(--text-muted, #848e9c);
  line-height: 1.5;
}

.help-section-highlight {
  background: rgba(240, 185, 11, 0.08);
  border: 1px solid rgba(240, 185, 11, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
}

.help-section-highlight-title {
  color: #F0B90B;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.help-section-highlight-text {
  font-size: 0.82rem;
  color: var(--text-main, #eaecef);
  margin-bottom: 0.5rem;
}

.btn-help-doc {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  text-decoration: none;
}

/* ==========================================
   RESPONSIVE DESIGN & SPLIT-SCREEN LAYOUTS
   ========================================== */

/* Tablas con scroll horizontal suave y seguro en cualquier contenedor */
.table-responsive,
.table-container,
.mini-table-wrap,
.order-book-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 185, 11, 0.25) transparent;
}

.table-responsive::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.mini-table-wrap::-webkit-scrollbar,
.order-book-table-container::-webkit-scrollbar,
.nav-tabs::-webkit-scrollbar {
  height: 5px;
}

.table-responsive::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.mini-table-wrap::-webkit-scrollbar-thumb,
.order-book-table-container::-webkit-scrollbar-thumb,
.nav-tabs::-webkit-scrollbar-thumb {
  background: rgba(240, 185, 11, 0.25);
  border-radius: 4px;
}

/* Breakpoint 1: Split-screen (DevTools / Multiventana) & Laptops Medianas (<= 1200px) */
@media (max-width: 1200px) {
  .app-container {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .navbar {
    flex-wrap: wrap;
    gap: 0.85rem;
    padding: 0.75rem 1.25rem;
  }

  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .nav-tab {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }

  .grid-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .grid-form-card {
    position: static;
    max-width: 100%;
  }

  .trade-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dca-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .grid-summary-grid,
  .dca-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
  }
}

/* Breakpoint 2: Tablets y Ventanas Reducidas (<= 900px) */
@media (max-width: 900px) {
  .status-banner {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .market-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.5rem;
  }

  .chart-canvas-container {
    height: 320px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .chart-timeframe-toolbar {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .favorites-toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .filter-bar {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* Breakpoint 3: Móviles y Pantallas Compactas (<= 600px) */
@media (max-width: 600px) {
  .navbar {
    padding: 0.5rem 0.75rem;
  }

  .navbar-brand .brand-title {
    font-size: 1.1rem;
  }

  .brand-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
  }

  .grid-summary-grid,
  .dca-summary-grid {
    grid-template-columns: 1fr;
  }

  .form-row-2col {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .be-metrics-grid {
    grid-template-columns: 1fr;
  }

  .quick-symbols-bar {
    flex-wrap: wrap;
  }

  .order-side-toggle {
    flex-direction: row;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.78rem;
  }
}

/* ==========================================
   BREAK-EVEN & TARGET MONITOR & CALCULATOR
   ========================================== */

.breakeven-card {
  background: rgba(240, 185, 11, 0.05);
  border: 1px solid rgba(240, 185, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: fadeIn 0.2s ease-in-out;
}

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

.be-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.be-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-gold);
}

.badge-be-info {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary-gold);
  background: rgba(240, 185, 11, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

.be-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.be-metric-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.be-breakeven {
  border-left: 3px solid #388bfd;
}

.be-target {
  border-left: 3px solid var(--buy-green);
}

.be-metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.be-metric-val {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2px 0;
}

.be-metric-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.be-card-actions {
  display: flex;
  justify-content: flex-end;
}

.btn-outline-gold {
  background: transparent;
  border: 1px solid rgba(240, 185, 11, 0.4);
  color: var(--primary-gold);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline-gold:hover {
  background: rgba(240, 185, 11, 0.15);
  border-color: var(--primary-gold);
}

/* Badges de estado en tiempo real en la tabla de órdenes abiertas */
.badge-be-below {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--sell-red-bg);
  color: var(--sell-red);
  border: 1px solid rgba(246, 70, 93, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-be-feezone {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(240, 185, 11, 0.12);
  color: #e3b341;
  border: 1px solid rgba(240, 185, 11, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-be-profit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--buy-green-bg);
  color: var(--buy-green);
  border: 1px solid rgba(14, 203, 129, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-be-target {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(240, 185, 11, 0.2);
  color: #ffdf00;
  border: 1px solid #f0b90b;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  box-shadow: 0 0 8px rgba(240, 185, 11, 0.3);
}

.text-pnl-pos {
  color: var(--buy-green);
  font-weight: 600;
}

.text-pnl-neg {
  color: var(--sell-red);
  font-weight: 600;
}

.text-pnl-neu {
  color: var(--text-muted);
}
