/* =====================================================================
 * BancNet — Fase 2: AI Strategies, track record y Futures.
 * Usa los tokens --zn-* de app.css; cada estrategia define --strategy-accent.
 * ===================================================================== */

.is-up { color: var(--zn-success) !important; }
.is-down { color: var(--zn-danger) !important; }

/* ---- Tarjetas de estrategia ---------------------------------------- */
.strategy-card {
    --strategy-accent: #22d3ee;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: var(--zn-radius);
    background: var(--zn-panel);
    border: 1px solid var(--zn-border);
    box-shadow: var(--zn-shadow);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.strategy-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--strategy-accent) 55%, transparent);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .5), 0 0 0 1px color-mix(in srgb, var(--strategy-accent) 25%, transparent);
}

.strategy-cover {
    position: relative;
    display: block;
    aspect-ratio: 16 / 8;
    overflow: hidden;
    background: #061020;
}

.strategy-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.strategy-card:hover .strategy-cover img { transform: scale(1.04); }

.strategy-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 9, 20, 0) 45%, rgba(5, 9, 20, .85) 100%);
}

.strategy-risk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    backdrop-filter: blur(8px);
}

.strategy-cover .strategy-risk {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 1;
}

.strategy-invested {
    position: absolute;
    right: 14px;
    bottom: 12px;
    z-index: 1;
    font-size: .78rem;
    font-weight: 600;
    color: var(--zn-success);
}

.risk-low { color: #6ee7b7; background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .35); }
.risk-moderate { color: #7dd3fc; background: rgba(14, 165, 233, .16); border-color: rgba(14, 165, 233, .35); }
.risk-high { color: #fcd34d; background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .38); }
.risk-very-high { color: #fda4af; background: rgba(244, 63, 94, .2); border-color: rgba(244, 63, 94, .5); }

.strategy-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    padding: 20px 22px 22px;
}

.strategy-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.strategy-title-row h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.strategy-kind {
    font-size: .72rem;
    color: var(--zn-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.strategy-desc {
    margin: 0;
    color: var(--zn-muted);
    font-size: .92rem;
    min-height: 2.8em;
}

.strategy-range {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--strategy-accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--strategy-accent) 28%, transparent);
}

.strategy-range span {
    font-size: .8rem;
    color: var(--zn-muted);
}

.strategy-range strong {
    font-size: 1.45rem;
    color: var(--strategy-accent);
    font-weight: 800;
}

.strategy-split {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.strategy-split > div {
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--zn-border);
    text-align: center;
}

.strategy-split small {
    display: block;
    font-size: .7rem;
    color: var(--zn-muted);
}

.strategy-split strong {
    font-size: 1rem;
    color: var(--zn-gold-2);
}

.strategy-split-lg {
    grid-template-columns: repeat(4, 1fr);
}

.strategy-split-lg > div:first-child strong { color: var(--strategy-accent); }

.strategy-record {
    margin-top: auto;
}

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

.strategy-record-stats small {
    display: block;
    font-size: .7rem;
    color: var(--zn-muted);
}

.strategy-record-stats strong { font-size: .98rem; }

.strategy-spark { height: 64px; }

.strategy-record-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    border: 1px dashed var(--zn-border);
    color: var(--zn-muted);
    font-size: .85rem;
}

.strategy-record-empty i { color: var(--strategy-accent); }

/* ---- Gráficos SVG --------------------------------------------------- */
.strategy-chart {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.strategy-chart-wrap {
    height: 320px;
}

.strategy-chart .chart-grid {
    stroke: rgba(255, 255, 255, .07);
    stroke-dasharray: 3 5;
    vector-effect: non-scaling-stroke;
}

.strategy-chart .chart-label {
    fill: var(--zn-muted);
    font-size: 12px;
}

.strategy-chart .chart-dot {
    stroke: #07111f;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

/* ---- Detalle ---------------------------------------------------------- */
.strategy-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: var(--zn-muted);
    text-decoration: none;
}

.strategy-back:hover { color: var(--zn-text); }

.strategy-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 28px;
    align-items: center;
}

.strategy-detail-cover {
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid color-mix(in srgb, var(--strategy-accent) 30%, transparent);
}

.strategy-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.strategy-stat {
    height: 100%;
    padding: 16px 18px;
}

.strategy-stat small {
    display: block;
    color: var(--zn-muted);
    font-size: .76rem;
    margin-bottom: 4px;
}

.strategy-stat strong { font-size: 1.25rem; }

.strategy-months th,
.strategy-months td {
    text-align: center;
    white-space: nowrap;
    font-size: .82rem;
}

.month-cell.up { background: rgba(44, 229, 155, var(--cell-alpha, .2)) !important; color: #eafff5 !important; }
.month-cell.down { background: rgba(255, 95, 109, var(--cell-alpha, .2)) !important; color: #fff0f1 !important; }
.month-cell.empty { color: rgba(255, 255, 255, .2) !important; }
.month-cell.total { font-weight: 700; background: transparent !important; }
.month-cell.total.up { color: var(--zn-success) !important; }
.month-cell.total.down { color: var(--zn-danger) !important; }

.allocation-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--zn-border);
}

.allocation-mini small {
    display: block;
    color: var(--zn-muted);
}

/* ---- Futures: IA activa --------------------------------------------- */
.ai-run-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    height: 100%;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid color-mix(in srgb, var(--strategy-accent) 30%, transparent);
}

.ai-run-cover {
    width: 100%;
    height: 100%;
    min-height: 140px;
    object-fit: cover;
    border-radius: 12px;
}

.ai-run-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-run-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ai-run-head h4 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.ai-run-head small { color: var(--zn-muted); }

.ai-run-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 600;
}

.ai-run-status.running { color: var(--zn-success); }
.ai-run-status.running i { font-size: .5rem; animation: aiPulse 1.6s ease-in-out infinite; }
.ai-run-status.paused { color: var(--zn-gold-2); }

@keyframes aiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.ai-run-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ai-run-grid small {
    display: block;
    font-size: .7rem;
    color: var(--zn-muted);
}

.ai-run-grid strong { font-size: .95rem; }

.ai-run-note {
    font-size: .8rem;
    color: var(--zn-gold-2);
}

.ai-run-split {
    font-size: .78rem;
    color: var(--zn-muted);
}

.ai-run-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.ai-run-actions .btn-glass {
    padding: 8px 14px;
    font-size: .82rem;
}

.btn-glass.danger:hover {
    color: var(--zn-danger);
    border-color: rgba(255, 95, 109, .45);
}

.strategy-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--strategy-accent);
}

.futures-manual-soon {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    background:
        radial-gradient(circle at 85% 20%, rgba(0, 194, 255, .16), transparent 55%),
        var(--zn-panel);
}

.futures-manual-soon h3 { margin: 0; }
.futures-manual-soon p { margin: 0; color: var(--zn-muted); }

/* ---- Admin ------------------------------------------------------------ */
.admin-strategy-thumb {
    width: 72px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
}

.results-grid input.zn-input { min-width: 110px; }

@media (max-width: 1199.98px) {
    .strategy-detail-hero { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
    .strategy-split-lg { grid-template-columns: repeat(2, 1fr); }
    .ai-run-card { grid-template-columns: 1fr; }
    .ai-run-cover { min-height: 120px; max-height: 160px; }
    .ai-run-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .strategy-chart-wrap { height: 240px; }
}

/* ---- Fase 3: operativa manual (GMX) ---------------------------------- */
.trade-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.trade-market {
    display: flex;
    align-items: center;
    gap: 16px;
}

.trade-market select { width: auto; min-width: 140px; font-weight: 700; }
.trade-market strong { display: block; font-size: 1.45rem; line-height: 1.1; }
.trade-market small { color: var(--zn-muted); font-size: .75rem; }

.trade-periods {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--zn-border);
}

.trade-periods button {
    border: 0;
    background: transparent;
    color: var(--zn-muted);
    padding: 5px 10px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
}

.trade-periods button.active { background: rgba(0, 194, 255, .16); color: var(--zn-text); }

.trade-chart {
    height: 470px;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0, 0, 0, .18);
    border: 1px solid var(--zn-border);
}

.trade-form {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--zn-border);
}

.trade-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 4px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .25);
}

.trade-side label { margin: 0; cursor: pointer; }
.trade-side input { position: absolute; opacity: 0; pointer-events: none; }

.trade-side span {
    display: block;
    padding: 9px 0;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    color: var(--zn-muted);
    transition: background .2s ease, color .2s ease;
}

.trade-side .long input:checked + span { background: rgba(44, 229, 155, .18); color: var(--zn-success); }
.trade-side .short input:checked + span { background: rgba(255, 95, 109, .18); color: var(--zn-danger); }

.trade-range { accent-color: var(--zn-gold); }

.trade-summary {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .2);
    font-size: .85rem;
}

.trade-summary div { display: flex; justify-content: space-between; gap: 10px; }
.trade-summary span { color: var(--zn-muted); }

.trade-submit.is-short {
    background: linear-gradient(135deg, #ff5f6d, #ff8a7a) !important;
    color: #fff !important;
}

.trade-tab-buttons {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--zn-border);
    margin-bottom: 8px;
}

.trade-tab-buttons button {
    border: 0;
    background: transparent;
    color: var(--zn-muted);
    padding: 10px 14px;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.trade-tab-buttons button.active { color: var(--zn-text); border-bottom-color: var(--zn-gold); }

.trade-tab-buttons span {
    display: inline-block;
    min-width: 20px;
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    font-size: .72rem;
}

.trade-panel .btn-glass { padding: 6px 12px; font-size: .8rem; }

@media (max-width: 767.98px) {
    .trade-chart { height: 280px; }
}
