/*
  frontend/style.css — El Trader-BOT
  Diseño para inversores principiantes: claro, intuitivo, llamativo.
*/

/* ====== Variables del sistema de diseño ====== */
:root {
    --bg-main: #080B11;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-solid: #111827;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-bright: rgba(255, 255, 255, 0.12);

    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;

    --color-up: #10B981;
    --color-up-rgb: 16, 185, 129;
    --color-down: #EF4444;
    --color-down-rgb: 239, 68, 68;
    --color-neutral: #EAB308;
    --color-neutral-rgb: 234, 179, 8;
    --color-info: #06B6D4;
    --color-accent: #3B82F6;
    --color-accent-rgb: 59, 130, 246;
    --color-purple: #8B5CF6;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* ====== Reset base ====== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(16, 185, 129, 0.06) 0%, transparent 60%);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #080B11; }
::-webkit-scrollbar-thumb { background: #1F2937; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #374151; }

/* ====== HEADER ====== */
.app-header {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--color-up);
    text-shadow: 0 0 16px rgba(var(--color-up-rgb), 0.5);
    flex-shrink: 0;
}

.logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.tag-paper {
    font-size: 0.6rem;
    background: rgba(6, 182, 212, 0.12);
    color: var(--color-info);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.status-indicator {
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    background: var(--color-up);
    box-shadow: 0 0 8px var(--color-up);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.dot-label { color: var(--color-up); font-weight: 700; }

.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-control {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-down);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-control:hover {
    background: var(--color-down);
    color: white;
    box-shadow: 0 0 12px rgba(var(--color-down-rgb), 0.4);
}
.btn-control.paused {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-up);
    border-color: rgba(16, 185, 129, 0.3);
}
.btn-control.paused:hover {
    background: var(--color-up);
    color: white;
}

/* ====== LAYOUT PRINCIPAL ====== */
.dashboard-grid {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.grid-card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.card-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-up);
    background: rgba(var(--color-up-rgb), 0.08);
    border: 1px solid rgba(var(--color-up-rgb), 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: rgba(var(--color-up-rgb), 0.12);
    color: var(--color-up);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge.paused {
    background: rgba(239,68,68,0.12);
    color: var(--color-down);
    border-color: rgba(239,68,68,0.25);
}

/* ====== SECCIÓN COMPLETA (OPORTUNIDADES) ====== */
.full-width-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ---- Banner explicativo para principiantes ---- */
.beginner-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(139,92,246,0.08));
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.beginner-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.beginner-banner-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.beginner-banner-text strong {
    color: var(--text-primary);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.3rem;
}

.signal-example {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    margin: 0 2px;
}
.signal-example.buy { background: rgba(16,185,129,0.2); color: var(--color-up); }
.signal-example.hold { background: rgba(234,179,8,0.15); color: var(--color-neutral); }
.signal-example.sell { background: rgba(239,68,68,0.15); color: var(--color-down); }

.btn-ask-ai {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn-ask-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.45);
}

/* ---- Barra de perfil ---- */
.profile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
}

.profile-bar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mode-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-info);
    background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.select-premium-inline {
    background: #0d1117;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

/* ---- Score del Comité ---- */
.committee-score-banner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.score-left { display: flex; flex-direction: column; gap: 0.3rem; }
.score-label { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.score-big {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #38bdf8;
    line-height: 1;
}
.score-explanation { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; }

.score-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

.alert-box {
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    line-height: 1.5;
}
.alert-risk { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; }
.alert-catalyst { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }

/* ---- Veredicto del Comité ---- */
.committee-verdict-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
}
.verdict-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.verdict-signal {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 1px;
}
.verdict-detail { font-size: 0.72rem; color: var(--text-secondary); }

/* ====== SECCIÓN: OPORTUNIDADES DEL DÍA ====== */
.opportunities-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.opportunities-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-tag {
    font-size: 0.65rem;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.opportunities-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Grid de oportunidades: 4 columnas en desktop */
.opportunities-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

/* Tarjeta de oportunidad */
.opportunity-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.opportunity-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-bright);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

/* Borde lateral de color según señal */
.opportunity-card.signal-buy { border-left: 3px solid var(--color-up); }
.opportunity-card.signal-hold { border-left: 3px solid var(--color-neutral); }
.opportunity-card.signal-sell { border-left: 3px solid var(--color-down); }

.opportunity-card.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 0.5rem;
}

.loading-pulse {
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.opp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.opp-ticker {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.opp-type {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* Badge señal grande */
.signal-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.signal-badge.buy {
    background: rgba(16,185,129,0.15);
    color: var(--color-up);
    border: 1px solid rgba(16,185,129,0.3);
    text-shadow: 0 0 8px rgba(var(--color-up-rgb), 0.4);
}
.signal-badge.hold {
    background: rgba(234,179,8,0.12);
    color: var(--color-neutral);
    border: 1px solid rgba(234,179,8,0.3);
}
.signal-badge.sell {
    background: rgba(239,68,68,0.12);
    color: var(--color-down);
    border: 1px solid rgba(239,68,68,0.3);
}

.opp-price {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.opp-change {
    font-size: 0.72rem;
    font-weight: 600;
}

.opp-reason {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
    background: rgba(255,255,255,0.02);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.5rem;
}

.opp-confidence {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.confidence-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-up));
    transition: width 0.5s ease;
}

/* ====== SECCIÓN: DÓLAR ====== */
.dolar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.dolar-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s;
}
.dolar-card:hover { border-color: var(--border-bright); }

.dolar-card .name {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-info);
    text-transform: uppercase;
}

.dolar-card .prices {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dolar-card .lbl {
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-right: 0.3rem;
}

.price-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ====== GRÁFICO ====== */
.chart-section { gap: 0.75rem; }

.chart-title { flex: 1; }

.chart-header-enhanced {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

@media (min-width: 900px) {
    .chart-header-enhanced {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
}

.chart-asset-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.crypto-select-wrapper {
    position: relative;
    display: inline-block;
}

.select-crypto-dropdown {
    background: #0b1329;
    color: #38bdf8;
    border: 1px solid #1e293b;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.select-crypto-dropdown:hover, .select-crypto-dropdown:focus {
    border-color: #38bdf8;
    background: #0f172a;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.chart-price {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--color-up);
}

.chart-controls-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.chart-style-toggle {
    display: flex;
    gap: 0.25rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.chart-style-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.chart-style-btn:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.chart-style-btn.active {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.chart-periods {
    display: flex;
    gap: 0.35rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.tf-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    transition: all 0.2s;
}

.tf-btn:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.tf-btn.active {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 0 10px rgba(var(--color-accent-rgb), 0.35);
}

.chart-indicators-toggle {
    display: flex;
    gap: 0.35rem;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.indicator-btn {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.indicator-btn:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.indicator-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.chart-wrapper {
    background: #0b0f19;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 440px;
    height: auto;
    padding: 0.5rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-heading-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.active-crypto-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(56, 189, 248, 0.12));
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    color: #e2e8f0;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
    transition: all 0.3s ease;
}

.active-crypto-badge.is-scanning {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(56, 189, 248, 0.18));
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.25);
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseGlow 1.5s infinite;
}

.active-crypto-badge.is-scanning .pulse-indicator {
    background-color: #a855f7;
    box-shadow: 0 0 8px #a855f7;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; filter: brightness(1.3); }
    100% { transform: scale(0.95); opacity: 0.7; }
}

.badge-prefix {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 500;
}

.badge-name {
    color: #38bdf8;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.active-crypto-badge.is-scanning .badge-name {
    color: #c084fc;
}

/* TradingView Realtime Legend & HUD Bar */
.tv-hud-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: rgba(15, 23, 42, 0.75);
    border-radius: 6px;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tv-hud-symbol-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tv-hud-symbol-icon {
    font-size: 0.95rem;
}

.tv-hud-symbol {
    font-weight: 800;
    color: #f8fafc;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.tv-hud-coin-name {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.76rem;
}

.tv-hud-scanner-pill {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
    animation: pulseGlow 2s infinite;
}

.tv-hud-tf {
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.tv-hud-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.tv-hud-lbl {
    color: #64748b;
    font-weight: 600;
}

.tv-hud-val {
    font-weight: 600;
    color: #e2e8f0;
}

.tv-hud-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.tv-badge-ema20 {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
}

.tv-badge-ema50 {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
}

.btn-fullscreen-chart {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.42rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-fullscreen-chart:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-fullscreen-chart.active {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

#trading-chart {
    width: 100%;
    height: 400px;
    position: relative;
}

/* ============================================================
   NUEVOS MENÚS DESPLEGABLES DE HERRAMIENTAS Y TEMPORALIDAD
   ============================================================ */
.timeframe-dropdown-wrapper {
    display: none; /* Visible en pantalla completa y responsive móvil */
    position: relative;
}

.select-timeframe-dropdown {
    background: #0b1329;
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    height: 30px;
    transition: all 0.2s;
}

.select-timeframe-dropdown:focus, .select-timeframe-dropdown:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.tools-dropdown-wrapper {
    position: relative;
    display: none; /* Visible en pantalla completa y responsive móvil */
}

.btn-tools-dropdown {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    transition: all 0.2s;
}

.btn-tools-dropdown:hover, .btn-tools-dropdown.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

/* Panel flotante popover de Herramientas e Indicadores */
.tools-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85);
    z-index: 100010;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    animation: fadeInTools 0.2s ease;
}

@keyframes fadeInTools {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.tools-panel-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tools-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tools-options-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tool-btn {
    padding: 0.25rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.tool-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.tool-btn.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.45);
}

.tools-panel-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 2px 0;
}

/* ============================================================
   MODO PANTALLA COMPLETA NATIVO ULTRA-COMPACTO (TRADINGVIEW THEME)
   ============================================================ */
.chart-section.fullscreen-active,
.chart-section:fullscreen,
.chart-section:-webkit-full-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    z-index: 99999 !important;
    background: #070b14 !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    box-shadow: none !important;
}

/* Ocultar elementos redundantes en pantalla completa horizontal */
.chart-section.fullscreen-active .chart-heading-group,
.chart-section:fullscreen .chart-heading-group,
.chart-section:-webkit-full-screen .chart-heading-group {
    display: none !important;
}

/* Ocultar los botones extendidos de estilos/indicadores/períodos (ahora están en los menús desplegables) */
.chart-section.fullscreen-active .chart-controls-group,
.chart-section:fullscreen .chart-controls-group,
.chart-section:-webkit-full-screen .chart-controls-group {
    display: none !important;
}

/* Cabecera de 1 sola fila fija de 32px */
.chart-section.fullscreen-active .card-header,
.chart-section:fullscreen .card-header,
.chart-section:-webkit-full-screen .card-header {
    flex-shrink: 0 !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    margin-bottom: 2px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
    width: 100% !important;
    overflow: visible !important;
}

.chart-section.fullscreen-active .chart-title,
.chart-section:fullscreen .chart-title,
.chart-section:-webkit-full-screen .chart-title {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    overflow: visible !important;
}

.chart-section.fullscreen-active .chart-asset-info,
.chart-section:fullscreen .chart-asset-info,
.chart-section:-webkit-full-screen .chart-asset-info {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 6px !important;
    margin: 0 !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

/* Activar los selectores desplegables en pantalla completa */
.chart-section.fullscreen-active .timeframe-dropdown-wrapper,
.chart-section:fullscreen .timeframe-dropdown-wrapper,
.chart-section:-webkit-full-screen .timeframe-dropdown-wrapper {
    display: inline-flex !important;
}

.chart-section.fullscreen-active .tools-dropdown-wrapper,
.chart-section:fullscreen .tools-dropdown-wrapper,
.chart-section:-webkit-full-screen .tools-dropdown-wrapper {
    display: inline-flex !important;
}

.chart-section.fullscreen-active .select-crypto-dropdown,
.chart-section:fullscreen .select-crypto-dropdown,
.chart-section:-webkit-full-screen .select-crypto-dropdown {
    height: 28px !important;
    padding: 0.15rem 0.5rem !important;
    font-size: 0.74rem !important;
    max-width: 145px !important;
}

.chart-section.fullscreen-active .select-timeframe-dropdown,
.chart-section:fullscreen .select-timeframe-dropdown,
.chart-section:-webkit-full-screen .select-timeframe-dropdown {
    height: 28px !important;
    padding: 0.15rem 0.45rem !important;
    font-size: 0.74rem !important;
}

.chart-section.fullscreen-active .btn-tools-dropdown,
.chart-section:fullscreen .btn-tools-dropdown,
.chart-section:-webkit-full-screen .btn-tools-dropdown {
    height: 28px !important;
    padding: 0.15rem 0.5rem !important;
    font-size: 0.72rem !important;
}

.chart-section.fullscreen-active .btn-manual-trade,
.chart-section:fullscreen .btn-manual-trade,
.chart-section:-webkit-full-screen .btn-manual-trade {
    height: 28px !important;
    padding: 0.15rem 0.5rem !important;
    font-size: 0.72rem !important;
}

.chart-section.fullscreen-active .btn-fullscreen-chart,
.chart-section:fullscreen .btn-fullscreen-chart,
.chart-section:-webkit-full-screen .btn-fullscreen-chart {
    height: 28px !important;
    padding: 0.15rem 0.5rem !important;
    font-size: 0.72rem !important;
}

.chart-section.fullscreen-active .chart-price,
.chart-section:fullscreen .chart-price,
.chart-section:-webkit-full-screen .chart-price {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    margin: 0 4px !important;
}

/* Banners de Posición Activa y Alerta Cartera en Pantalla Completa */
.chart-section.fullscreen-active .active-position-banner,
.chart-section:fullscreen .active-position-banner,
.chart-section:-webkit-full-screen .active-position-banner {
    padding: 1px 6px !important;
    margin-bottom: 2px !important;
    gap: 6px !important;
    border-radius: 4px !important;
    flex-wrap: nowrap !important;
    height: 24px !important;
}

.chart-section.fullscreen-active .active-position-banner .pos-details,
.chart-section:fullscreen .active-position-banner .pos-details,
.chart-section:-webkit-full-screen .active-position-banner .pos-details {
    font-size: 0.68rem !important;
}

.chart-section.fullscreen-active .active-position-banner .pos-pnl-value,
.chart-section:fullscreen .active-position-banner .pos-pnl-value,
.chart-section:-webkit-full-screen .active-position-banner .pos-pnl-value {
    font-size: 0.75rem !important;
}

.chart-section.fullscreen-active .active-position-banner .btn-close-pos,
.chart-section:fullscreen .active-position-banner .btn-close-pos,
.chart-section:-webkit-full-screen .active-position-banner .btn-close-pos {
    padding: 0.1rem 0.4rem !important;
    font-size: 0.65rem !important;
    height: 20px !important;
}

.chart-section.fullscreen-active .cross-position-banner,
.chart-section:fullscreen .cross-position-banner,
.chart-section:-webkit-full-screen .cross-position-banner {
    padding: 1px 6px !important;
    margin-bottom: 2px !important;
    gap: 6px !important;
    border-radius: 4px !important;
    flex-wrap: nowrap !important;
    height: 24px !important;
}

.chart-section.fullscreen-active .cross-pos-text,
.chart-section:fullscreen .cross-pos-text,
.chart-section:-webkit-full-screen .cross-pos-text {
    font-size: 0.68rem !important;
}

.chart-section.fullscreen-active .btn-cross-switch,
.chart-section.fullscreen-active .btn-cross-close,
.chart-section:fullscreen .btn-cross-switch,
.chart-section:fullscreen .btn-cross-close,
.chart-section:-webkit-full-screen .btn-cross-switch,
.chart-section:-webkit-full-screen .btn-cross-close {
    padding: 0.1rem 0.4rem !important;
    font-size: 0.65rem !important;
    height: 20px !important;
}

/* HUD flotante superpuesto en la esquina superior izquierda del gráfico */
.chart-section.fullscreen-active .tv-hud-bar,
.chart-section:fullscreen .tv-hud-bar,
.chart-section:-webkit-full-screen .tv-hud-bar {
    position: absolute !important;
    top: 6px !important;
    left: 8px !important;
    z-index: 20 !important;
    background: rgba(11, 15, 25, 0.75) !important;
    backdrop-filter: blur(6px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px !important;
    padding: 2px 8px !important;
    margin: 0 !important;
    font-size: 0.65rem !important;
    gap: 6px !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    max-width: calc(100% - 16px) !important;
    overflow: hidden !important;
}

/* Área del gráfico maximizada al 100% */
.chart-section.fullscreen-active .chart-wrapper,
.chart-section:fullscreen .chart-wrapper,
.chart-section:-webkit-full-screen .chart-wrapper {
    flex: 1 1 auto !important;
    height: calc(100vh - 38px) !important;
    width: 100% !important;
    min-height: 220px !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(51, 65, 85, 0.4) !important;
    border-radius: 4px !important;
    background: #0b0f19 !important;
    overflow: hidden !important;
}

.chart-section.fullscreen-active #trading-chart,
.chart-section:fullscreen #trading-chart,
.chart-section:-webkit-full-screen #trading-chart {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* ApexCharts Toolbar Centered at Bottom */
.apexcharts-toolbar {
    top: auto !important;
    bottom: -8px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(15, 23, 42, 0.92) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(51, 65, 85, 0.85) !important;
    border-radius: 24px !important;
    padding: 4px 14px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
    z-index: 10 !important;
}

.apexcharts-toolbar > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 26px !important;
    height: 26px !important;
    margin: 0 2px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.apexcharts-toolbar > div:hover {
    background: rgba(56, 189, 248, 0.15) !important;
}

.apexcharts-toolbar > div svg {
    fill: #94a3b8 !important;
    width: 14px !important;
    height: 14px !important;
    transition: fill 0.2s ease !important;
}

.apexcharts-toolbar > div:hover svg {
    fill: #38bdf8 !important;
}

.apexcharts-toolbar > div.apexcharts-selected {
    background: rgba(14, 165, 233, 0.25) !important;
}

.apexcharts-toolbar > div.apexcharts-selected svg {
    fill: #38bdf8 !important;
}

.apexcharts-menu {
    top: auto !important;
    bottom: 38px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;
    background: #0f172a !important;
    border: 1px solid #334155 !important;
    color: #f8fafc !important;
    border-radius: 8px !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.65) !important;
    padding: 6px 0 !important;
    min-width: 130px !important;
    text-align: center !important;
}

.apexcharts-menu-item {
    padding: 7px 16px !important;
    font-size: 12px !important;
}

.apexcharts-menu-item:hover {
    background: #1e293b !important;
    color: #38bdf8 !important;
}



/* ====== TABS DE MERCADO ====== */
.tab-header {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--text-primary);
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.25);
}

.table-help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(234,179,8,0.06);
    border: 1px solid rgba(234,179,8,0.15);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.45;
    word-break: normal;
    overflow-wrap: break-word;
}

.table-help-text i {
    flex-shrink: 0;
    margin-top: 2px;
    color: #eab308;
}

.table-wrapper {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.market-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}

.market-table th, .market-table td {
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.market-table th:nth-child(1), .market-table td:nth-child(1) {
    width: 44%;
    text-align: left;
}

.market-table th:nth-child(2), .market-table td:nth-child(2) {
    width: 32%;
    text-align: right;
}

.market-table th:nth-child(3), .market-table td:nth-child(3) {
    width: 24%;
    text-align: right;
}

.market-table th {
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 2;
}
    top: 0;
}

/* ====== COMITÉ DE AGENTES ====== */
.agents-explainer {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(59,130,246,0.05);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
}

.bot-status-mini {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.status-mini-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 100px;
}

.mini-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.mini-value { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }

.agent-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.agent-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.agent-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-bright);
}

.agent-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 1rem;
    flex-shrink: 0;
}

.agent-body { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.agent-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.agent-role { font-size: 0.68rem; color: var(--text-muted); }
.agent-vote { font-size: 0.8rem; font-weight: 800; }
.agent-confidence { font-size: 0.65rem; color: var(--text-muted); }
.agent-reason { font-size: 0.7rem; color: var(--text-secondary); line-height: 1.3; }

/* Clases de texto de voto */
.text-up { color: var(--color-up); text-shadow: 0 0 6px rgba(var(--color-up-rgb), 0.25); }
.text-down { color: var(--color-down); text-shadow: 0 0 6px rgba(var(--color-down-rgb), 0.25); }
.text-neutral { color: var(--color-neutral); }

/* ====== NOTICIAS ====== */
.news-feed {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 320px;
    overflow-y: auto;
}

.news-card {
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.2s ease;
}
.news-card:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.news-card .source {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--color-info);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card .title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
}

.news-card .title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.news-card .title a:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.news-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.news-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #38bdf8;
    text-decoration: none;
    padding: 0.25rem 0.55rem;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.news-link-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
    transform: translateY(-1px);
}

.impact-badge {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}
.impact-badge.alcista { background: rgba(16,185,129,0.12); color: var(--color-up); }
.impact-badge.bajista { background: rgba(239,68,68,0.12); color: var(--color-down); }
.impact-badge.neutral { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

/* ====== CONSOLA ====== */
.console-section {}

.console-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-style: italic;
}

.console-output {
    background: #020617;
    border: 1px solid rgba(30, 41, 59, 0.8);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-family: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    height: 380px;
    min-height: 320px;
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
}

.console-output::-webkit-scrollbar {
    width: 6px;
}
.console-output::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}
.console-output::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.8);
    border-radius: 3px;
}
.console-output::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

.log-line { 
    line-height: 1.5; 
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-word;
    border-left: 2px solid transparent;
}
.log-line:hover {
    background: rgba(255, 255, 255, 0.03);
}
.log-line.text-system { color: #60A5FA; border-left-color: #3b82f6; }
.log-line.text-up { color: #34D399; border-left-color: #10b981; }
.log-line.text-down { color: #F87171; border-left-color: #ef4444; }
.log-line.text-neutral { color: #94A3B8; border-left-color: #64748b; }
.log-line.text-error { color: #FCA5A5; background: rgba(239, 68, 68, 0.08); border-left-color: #ef4444; }

/* ====== FOOTER ====== */
.app-footer {
    background: rgba(8,11,17,0.95);
    border-top: 1px solid var(--border-color);
    padding: 0.8rem 2rem;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ====== MODAL DE CHAT ====== */
.chat-modal-content {
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    padding: 1.5rem;
    box-shadow: 0 24px 48px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0.75rem;
}

.chat-modal-header h3 {
    margin: 0;
    color: #38bdf8;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.btn-close-modal:hover { color: white; }

.chat-instructions {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(234,179,8,0.06);
    border: 1px solid rgba(234,179,8,0.15);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    line-height: 1.5;
}

.chat-instructions em { color: #38bdf8; }

.chat-response-box {
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    padding: 1rem;
    height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.chat-input-row {
    display: flex;
    gap: 0.6rem;
}

.chat-input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: white;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--color-accent); }

.btn-send-chat {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    border: none;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.btn-send-chat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(2,132,199,0.35);
}

/* ====== SELECTS ====== */
.select-premium {
    background: #0d1117;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    width: 100%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.select-premium:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 8px rgba(var(--color-accent-rgb), 0.25);
}

/* ====== RESPONSIVE & MOBILE ADAPTIVE ENGINE ====== */
@media (max-width: 1200px) {
    .opportunities-grid { grid-template-columns: repeat(2, 1fr); }
    .committee-score-banner { grid-template-columns: 1fr 1fr; }
    .committee-verdict-box { grid-column: 1 / -1; flex-direction: row; }
    .agent-cards-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .logo {
        justify-content: flex-start;
    }
    .header-status {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.4rem;
    }
    .status-indicator {
        font-size: 0.68rem;
        padding: 0.25rem 0.5rem;
    }
    .btn-header-action, .btn-control {
        font-size: 0.72rem;
        padding: 0.4rem 0.65rem;
    }
    .dashboard-grid {
        padding: 0.75rem 0.75rem 110px 0.75rem !important;
        gap: 0.85rem;
    }
    .opportunities-grid {
        grid-template-columns: 1fr;
    }
    .dolar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .committee-score-banner {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    .committee-verdict-box {
        grid-column: 1;
        flex-direction: column;
        padding: 0.75rem;
    }
    .verdict-signal {
        font-size: 1.25rem !important;
        line-height: 1.2;
    }
    .agent-cards-row {
        grid-template-columns: 1fr;
    }
    .beginner-banner {
        flex-direction: column;
        text-align: left;
        padding: 1rem;
        gap: 0.75rem;
    }
    .btn-ask-ai {
        width: 100%;
        justify-content: center;
    }
    .chart-wrapper {
        min-height: 360px;
        height: auto;
        padding-bottom: 2rem;
    }
    .chart-header-enhanced {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .chart-asset-info {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
        width: 100%;
    }
    .crypto-select-wrapper {
        width: 100%;
    }
    .select-crypto-dropdown {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.45rem 0.65rem;
    }
    .chart-controls-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    .chart-style-selector {
        display: flex;
        width: 100%;
        gap: 0.3rem;
    }
    .chart-style-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.7rem;
        padding: 0.35rem 0.3rem;
        text-align: center;
    }
    .chart-timeframe-selector {
        display: flex;
        width: 100%;
        gap: 0.25rem;
        justify-content: space-between;
    }
    .tf-btn {
        flex: 1;
        justify-content: center;
        font-size: 0.68rem;
        padding: 0.3rem 0.15rem;
        text-align: center;
    }
    .tab-header {
        display: flex;
        overflow-x: auto;
        gap: 0.35rem;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .tab-header::-webkit-scrollbar {
        display: none;
    }
    .tab-btn {
        white-space: nowrap;
        font-size: 0.72rem;
        padding: 0.35rem 0.6rem;
    }
    .profile-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .profile-bar-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        width: 100%;
    }
    .select-premium-inline {
        width: 100%;
    }
    .profile-bar-right {
        width: 100%;
        display: flex;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 0.6rem 0.65rem;
    }
    .logo h1 {
        font-size: 1.05rem;
    }
    .header-subtitle {
        font-size: 0.65rem;
    }
    .dashboard-grid {
        padding: 0.5rem 0.5rem 115px 0.5rem !important;
        gap: 0.75rem;
    }
    .grid-card {
        padding: 0.85rem;
        border-radius: var(--radius-md);
    }
    .score-big {
        font-size: 1.85rem;
    }
    .verdict-signal {
        font-size: 1.15rem !important;
    }
    .dolar-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .dolar-card {
        padding: 0.5rem;
    }
    .dolar-card .name {
        font-size: 0.65rem;
    }
    .price-value {
        font-size: 0.8rem;
    }
    .wallet-cards-grid, .profile-buttons-grid, .form-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }
    .modal-card, .modal-large {
        max-width: 96vw !important;
        max-height: 88vh !important;
        border-radius: var(--radius-md);
    }
    .modal-body {
        padding: 0.85rem;
        max-height: calc(88vh - 55px);
        overflow-y: auto;
    }
}

/* ====== MODALES Y FICHAS DE INSTRUMENTOS ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(5px);
    z-index: 100005 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    color: var(--text-primary);
    animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-large {
    max-width: 760px;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    background: #1e293b;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.btn-close-modal:hover { color: #f87171; }

.modal-body {
    padding: 1.25rem;
    max-height: 80vh;
    overflow-y: auto;
}

/* Grilla de Transacción en Modal */
.tx-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background: #020617;
    border: 1px solid #1e293b;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.tx-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.tx-summary-item .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.tx-summary-item .value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-reasoning-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.agent-reasoning-card {
    background: #020617;
    border: 1px solid #1e293b;
    border-left: 3px solid var(--color-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.4;
}

.instrument-tag {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(37, 99, 235, 0.3);
    text-transform: uppercase;
    display: inline-block;
}

.inst-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #020617;
    border: 1px solid #1e293b;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.inst-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.inst-change {
    font-size: 0.82rem;
    font-weight: 700;
}

.inst-verdict-pill {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.inst-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .inst-grid { grid-template-columns: 1fr; }
    .inst-hero { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

.inst-card {
    background: #020617;
    border: 1px solid #1e293b;
    padding: 1rem;
    border-radius: var(--radius-md);
}

.inst-card h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.inst-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #1e293b;
    padding-bottom: 0.4rem;
}

.detail-row span { color: var(--text-muted); }

.ai-diagnosis-box {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.score-circle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.score-circle-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.inst-reasoning-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
    background: rgba(255,255,255,0.02);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    margin: 0;
}

.tx-row-clickable {
    cursor: pointer;
    transition: background 0.15s ease;
}
.tx-row-clickable:hover {
    background: rgba(37, 99, 235, 0.08) !important;
}

/* Estilos del Gráfico de Velas en el Modal */
.inst-chart-card {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.inst-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inst-chart-header h4 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.modal-tf-periods {
    display: flex;
    gap: 0.3rem;
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
}

.modal-tf-btn {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    border: none;
    transition: all 0.2s;
}

.modal-tf-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.modal-tf-btn.active {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    font-weight: 700;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

.inst-chart-wrapper {
    height: 240px;
    width: 100%;
    overflow: hidden;
}

/* Estilos del Módulo de Debate Alcista vs Bajista (Toro vs Oso) */
.debate-container {
    margin-top: 1.5rem;
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 1rem;
}

.debate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.debate-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debate-score-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: rgba(37, 99, 235, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.debate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .debate-grid {
        grid-template-columns: 1fr;
    }
}

.debate-card {
    background: #0f172a;
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    border-left: 3px solid transparent;
}

.debate-bull {
    border-left-color: #10b981;
}

.debate-bear {
    border-left-color: #ef4444;
}

.debate-card-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}


/* ====== BANNER DE ALERTA DE IP BINANCE ====== */
.ip-alert-banner {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-md);
    margin: 0.75rem 1rem 0 1rem;
    padding: 0.85rem 1.25rem;
    animation: pulseAlert 2s infinite ease-in-out;
}

@keyframes pulseAlert {
    0%, 100% { border-color: rgba(239, 68, 68, 0.4); }
    50% { border-color: rgba(245, 158, 11, 0.8); box-shadow: 0 0 12px rgba(245, 158, 11, 0.2); }
}

.ip-alert-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.ip-alert-icon {
    font-size: 1.5rem;
    color: #f59e0b;
}

.ip-alert-text {
    flex: 1;
    min-width: 260px;
}

.ip-alert-text strong {
    color: #fca5a5;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.2rem;
}

.ip-alert-text p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ip-alert-text code {
    background: #1e293b;
    color: #f59e0b;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
}

.btn-copy-ip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.15s, opacity 0.15s;
}

.btn-copy-ip:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}


/* ====== BOTONES DEL HEADER PARA BILLETERA Y CONFIG ====== */
.btn-header-action {
    background: #1e293b;
    color: var(--text-primary);
    border: 1px solid #334155;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-header-action:hover {
    background: #334155;
    color: white;
    border-color: #475569;
}

/* ====== PANEL DESPLEGABLE BILLETERA (DRAWER) ====== */
.wallet-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

.wallet-drawer.open {
    display: block;
    pointer-events: auto;
}

.wallet-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wallet-drawer.open .wallet-drawer-backdrop {
    opacity: 1;
}

.wallet-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 480px;
    background: #0f172a;
    border-left: 1px solid #1e293b;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.wallet-drawer.open .wallet-drawer-content {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.25rem;
    background: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.drawer-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drawer-icon {
    font-size: 1.4rem;
    color: var(--color-primary);
}

.drawer-header-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.broker-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    cursor: pointer;
}
.btn-close-drawer:hover { color: #f87171; }

.drawer-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.wallet-summary-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.w-card {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.w-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.w-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0.2rem 0;
}

.w-value.highlight {
    color: #34d399;
}

.w-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.allocation-section {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
}

.allocation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
}

.btn-refresh-wallet {
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.allocation-bar-container {
    height: 10px;
    background: #1e293b;
    border-radius: 5px;
    display: flex;
    overflow: hidden;
}

.alloc-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.holdings-table-container h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.holdings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.holdings-table th {
    text-align: left;
    color: var(--text-muted);
    border-bottom: 1px solid #1e293b;
    padding: 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.holdings-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #0f172a;
}

/* ====== MODAL CONFIGURACION ====== */
.settings-tabs-header {
    display: flex;
    gap: 0.35rem;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.settings-tabs-header::-webkit-scrollbar {
    display: none;
}

.settings-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.settings-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: rgba(37, 99, 235, 0.08);
}

.settings-tab-pane {
    display: none;
}
.settings-tab-pane.active {
    display: block;
}

.config-card {
    background: #020617;
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.config-card h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #1e293b;
}

.live-warning-banner {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fca5a5;
    font-size: 0.8rem;
}

.profile-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.btn-profile-option {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-profile-option.active {
    border-color: var(--color-primary);
    background: rgba(37, 99, 235, 0.15);
}

.btn-profile-option span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input {
    background: #0f172a;
    border: 1px solid #334155;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.status-summary-box {
    background: #0f172a;
    border: 1px solid #1e293b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.8rem;
}

.sum-row {
    display: flex;
    justify-content: space-between;
}

.settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #1e293b;
}

.btn-save-settings {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.15s;
}

.btn-save-settings:hover {
    transform: translateY(-1px);
}

/* Switch iOS Style */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #334155;
    transition: .3s;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
}
input:checked + .slider { background-color: #10b981; }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 24px; }
.slider.round:before { border-radius: 50%; }

/* ============================================================
   BANNER DE POSICIÓN ACTIVA & PnL EN VIVO
   ============================================================ */
.active-position-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: fadeInPos 0.3s ease-in-out;
}

@keyframes fadeInPos {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pos-info-left {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.pos-badge {
    font-size: 0.68rem;
    font-weight: 800;
    color: #60a5fa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pos-details {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pos-info-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pos-pnl-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
}

.pos-pnl-value {
    font-size: 1rem;
    font-weight: 800;
    font-family: var(--font-mono);
}

.pos-pnl-value.pnl-positive {
    color: #10b981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.pos-pnl-value.pnl-negative {
    color: #ef4444;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.pos-info-right {
    display: flex;
    gap: 0.5rem;
}

.btn-close-pos {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-close-pos:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-1px);
}

/* Banner de Alerta Multi-Activo (Posición en otro par de cartera) */
.cross-position-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    gap: 0.75rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    animation: fadeInPos 0.3s ease-in-out;
}

.cross-pos-left {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.cross-pos-badge {
    font-size: 0.66rem;
    font-weight: 800;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.cross-pos-text {
    font-size: 0.82rem;
    color: var(--text-primary);
}

.cross-pos-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-cross-switch {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.btn-cross-switch:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-1px);
}

.btn-cross-close {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.btn-cross-close:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-1px);
}

.btn-manual-trade {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: white;
    border: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.btn-manual-trade:hover {
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    transform: translateY(-1px);
}

/* Insignia oficial de Binance en Noticias */
.badge-binance {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ============================================================
   ESTILOS DE GESTIÓN DE FONDOS BINANCE (DEPÓSITOS Y RETIROS)
   ============================================================ */
.wallet-nav-tabs {
    display: flex;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.8);
    padding: 0.35rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.55rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.wallet-tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.04);
}

.wallet-tab-btn.active {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.wallet-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1rem 0;
}

.btn-wallet-action {
    padding: 0.65rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.btn-wallet-action.deposit {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.btn-wallet-action.deposit:hover {
    background: rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-wallet-action.withdraw {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.3);
}

.btn-wallet-action.withdraw:hover {
    background: rgba(56, 189, 248, 0.25);
    transform: translateY(-1px);
}

.funding-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1.2rem;
}

.funding-card h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.funding-subtitle {
    color: #94a3b8;
    font-size: 0.8rem;
    margin: 0 0 1rem 0;
}

.form-group-funding {
    margin-bottom: 1rem;
}

.form-group-funding label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.35rem;
}

.qr-deposit-box {
    display: flex;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    align-items: center;
    margin: 1rem 0;
}

.qr-code-wrapper img {
    border-radius: 6px;
    background: #ffffff;
    padding: 4px;
    width: 130px;
    height: 130px;
}

.deposit-address-container {
    flex: 1;
}

.deposit-label {
    font-size: 0.78rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.35rem;
}

.address-copy-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
}

.address-copy-row code {
    font-family: monospace;
    font-size: 0.78rem;
    color: #38bdf8;
    word-break: break-all;
    flex: 1;
}

.btn-copy-address {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 0.35rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-copy-address:hover {
    background: #1d4ed8;
}

.deposit-tip {
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.3;
    display: block;
}

.p2p-banner-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.9rem 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    gap: 0.8rem;
}

.p2p-banner-left {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.p2p-banner-left i {
    font-size: 1.5rem;
    color: #fbbf24;
}

.p2p-banner-left strong {
    color: #fbbf24;
    font-size: 0.85rem;
    display: block;
}

.p2p-banner-left p {
    margin: 0.2rem 0 0 0;
    font-size: 0.75rem;
    color: #cbd5e1;
}

.btn-open-p2p {
    background: #f59e0b;
    color: #0f172a;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-open-p2p:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.withdraw-pct-buttons {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.btn-w-pct {
    flex: 1;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 0.35rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-w-pct:hover {
    color: #38bdf8;
    border-color: #38bdf8;
}

.withdraw-summary-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem;
    border-radius: 6px;
    margin: 0.75rem 0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 0.3rem;
}

.summary-line.highlight {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 800;
}

.btn-submit-withdraw {
    width: 100%;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    transition: all 0.2s;
}

.btn-submit-withdraw:hover {
    background: linear-gradient(135deg, #0369a1, #1d4ed8);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .qr-deposit-box {
        flex-direction: column;
        text-align: center;
    }
    .p2p-banner-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   ESTILOS DE AUTENTICACIÓN GOOGLE & MULTI-TENANT
   ============================================================ */
.auth-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-google-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-google-login:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.user-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #3b82f6;
}

.user-name {
    font-weight: 600;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout-icon {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.btn-logout-icon:hover {
    color: #ef4444;
}

/* ============================================================
   REGLAS DEFINITIVAS DE PANTALLA COMPLETA NATIVA (TRADINGVIEW PRO)
   Garantiza 1 sola fila superior para menús desplegables y controles,
   impidiendo que cualquier media query responsive lo apile en columnas.
   ============================================================ */
.chart-section.fullscreen-active .card-header,
.chart-section:fullscreen .card-header,
.chart-section:-webkit-full-screen .card-header {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin-bottom: 2px !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.chart-section.fullscreen-active .chart-asset-info,
.chart-section:fullscreen .chart-asset-info,
.chart-section:-webkit-full-screen .chart-asset-info {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 6px !important;
    margin: 0 !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
}

.chart-section.fullscreen-active .crypto-select-wrapper,
.chart-section:fullscreen .crypto-select-wrapper,
.chart-section:-webkit-full-screen .crypto-select-wrapper {
    width: auto !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.chart-section.fullscreen-active .select-crypto-dropdown,
.chart-section:fullscreen .select-crypto-dropdown,
.chart-section:-webkit-full-screen .select-crypto-dropdown {
    height: 28px !important;
    padding: 0.15rem 0.5rem !important;
    font-size: 0.74rem !important;
    max-width: 135px !important;
    width: auto !important;
}

.chart-section.fullscreen-active .timeframe-dropdown-wrapper,
.chart-section:fullscreen .timeframe-dropdown-wrapper,
.chart-section:-webkit-full-screen .timeframe-dropdown-wrapper {
    display: inline-flex !important;
    flex-shrink: 0 !important;
}

.chart-section.fullscreen-active .tools-dropdown-wrapper,
.chart-section:fullscreen .tools-dropdown-wrapper,
.chart-section:-webkit-full-screen .tools-dropdown-wrapper {
    display: inline-flex !important;
    flex-shrink: 0 !important;
}

.chart-section.fullscreen-active .chart-action-buttons,
.chart-section:fullscreen .chart-action-buttons,
.chart-section:-webkit-full-screen .chart-action-buttons {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex-shrink: 0 !important;
}









