/*
⚠️ IMPORTANTE: Sigue las directrices del framework Vibe.
Ver: /.github/copilot-instructions.md
Futures V2 - Estilos
*/

/* ===== LAYOUT ===== */
.fv2-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

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

.fv2-header-left { flex: 1; }

.fv2-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fv2-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #06B6D4 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.25rem;
}

.fv2-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== SECTION ===== */
.fv2-section {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.fv2-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TABLE ===== */
.fv2-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fv2-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
}

.fv2-table thead th {
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #334155;
    white-space: nowrap;
}

.fv2-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
    vertical-align: middle;
}

.fv2-table tbody tr:hover td {
    background: rgba(51, 65, 85, 0.3);
}

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

/* ===== CELLS ===== */
.fv2-ticker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fv2-symbol {
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Monaco', monospace;
    color: var(--text-primary);
}

.fv2-exchange {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.2);
    color: #06B6D4;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-futures {
    background: rgba(139, 92, 246, 0.2);
    color: #8B5CF6;
    border-color: rgba(139, 92, 246, 0.3);
}

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

.fv2-qty {
    font-weight: 700;
    font-size: 1rem;
    font-family: 'Monaco', monospace;
}

.fv2-number {
    font-family: 'Monaco', monospace;
    font-size: 0.875rem;
}

.fv2-pnl {
    font-weight: 700;
    font-family: 'Monaco', monospace;
    font-size: 0.9rem;
}

.text-green { color: #10B981; }
.text-red   { color: #EF4444; }

.fv2-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* ===== ACTION BUTTONS ===== */
.fv2-actions {
    display: flex;
    gap: 0.375rem;
    justify-content: flex-end;
}

.fv2-btn-action {
    background: rgba(51, 65, 85, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    min-height: 32px;
}

.fv2-btn-action:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* ===== PRIMARY / SECONDARY BUTTONS ===== */
.fv2-btn-primary {
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #06B6D4 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 40px;
    white-space: nowrap;
}

.fv2-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.fv2-btn-secondary {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 40px;
}

.fv2-btn-secondary:hover {
    background: var(--bg-quaternary);
}

/* ===== SELECT ===== */
.fv2-select {
    padding: 0.625rem 0.875rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    min-height: 40px;
}

.fv2-select:focus {
    outline: none;
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* ===== MODAL ===== */
.fv2-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fv2-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.fv2-modal-wide { max-width: 900px; }

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

.fv2-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.fv2-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
}

.fv2-modal-close:hover { color: var(--text-primary); }

.fv2-modal-body {
    padding: 1.5rem;
}

.fv2-modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ===== FORM ===== */
.fv2-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fv2-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    position: relative;
}

.fv2-form-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fv2-input {
    padding: 0.625rem 0.875rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition-fast);
    min-height: 40px;
}

.fv2-input:focus {
    outline: none;
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.fv2-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* ===== SUGGESTIONS AUTOCOMPLETE ===== */
.fv2-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
    box-shadow: var(--shadow-lg);
}

.fv2-suggestion-item {
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.1s;
}

.fv2-suggestion-item:hover,
.fv2-suggestion-item.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--text-primary);
}

.fv2-suggestion-item small {
    color: var(--text-dim);
    font-size: 0.7rem;
}

/* ===== PNL PREVIEW ===== */
.fv2-pnl-preview {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== ERROR ===== */
.fv2-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #F87171;
    font-size: 0.875rem;
}

/* ===== HISTORY TABLE ===== */
.fv2-history-table {
    width: 100%;
    border-collapse: collapse;
}

.fv2-history-table th,
.fv2-history-table td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 0.8rem;
}

.fv2-history-table th {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fv2-history-table td { color: var(--text-secondary); }

.badge-trade-open    { color: #10B981; font-weight: 700; }
.badge-trade-add     { color: #06B6D4; font-weight: 700; }
.badge-trade-reduce  { color: #F59E0B; font-weight: 700; }
.badge-trade-close   { color: #EF4444; font-weight: 700; }
.badge-trade-reverse { color: #8B5CF6; font-weight: 700; }

/* ===== FORM GROUP FULL WIDTH ===== */
.fv2-form-group-full {
    grid-column: 1 / -1;
}

/* ===== EXPIRY DROPDOWN: TRIMESTRAL RESALTADO ===== */
.fv2-expiry-select {
    width: 100%;
}

/* Opciones trimestrales con color especial (soportado en Firefox/Chrome nativo) */
.fv2-expiry-quarterly {
    color: #06B6D4;
    font-weight: 600;
}

/* Leyenda 🔷 = trimestral junto al label */
.fv2-quarterly-legend {
    font-size: 0.65rem;
    color: #06B6D4;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    margin-left: 0.25rem;
    opacity: 0.85;
}

/* Toggle de modo manual del expiry */
.fv2-expiry-manual-toggle {
    margin-top: 0.375rem;
}

.fv2-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.fv2-checkbox-label:hover {
    color: var(--text-muted);
}

.fv2-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    accent-color: #06B6D4;
    width: 13px;
    height: 13px;
}

/* ===== YAHOO TICKER ROW ===== */
.fv2-ticker-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fv2-ticker-input {
    flex: 1;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #06B6D4;
}

.fv2-ticker-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.fv2-ticker-input:focus {
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Indicador de estado del ticker (auto / manual / vacío) */
.fv2-ticker-status {
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    min-width: 64px;
    text-align: center;
}

.fv2-ticker-status-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.fv2-ticker-status-manual {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.fv2-ticker-status-warn {
    background: rgba(239, 68, 68, 0.1);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Hint inline junto al label */
.fv2-hint-inline {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.25rem;
}

/* ===== DRIVER DE PRECIOS TOGGLE ===== */
.fv2-driver-toggle {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Ocultar radio nativo */
.fv2-driver-toggle input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.fv2-driver-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 38px;
    user-select: none;
}

.fv2-driver-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

/* Estado activo (radio checked) */
.fv2-driver-toggle input[type="radio"]:checked + .fv2-driver-yahoo {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.5);
    color: #06B6D4;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.fv2-driver-toggle input[type="radio"]:checked + .fv2-driver-eodhd {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10B981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.fv2-driver-toggle input[type="radio"]:checked + .fv2-driver-manual {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #F59E0B;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

/* Hint del ticker con referencia continuo vs específico */
.fv2-ticker-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.375rem;
    line-height: 1.5;
}

.fv2-ticker-hint em {
    color: var(--text-muted);
    font-style: normal;
    font-weight: 600;
}

.fv2-ticker-hint strong {
    font-family: 'Monaco', 'Courier New', monospace;
    color: #06B6D4;
    font-size: 0.8rem;
}

/* Sufijo driver label */
.fv2-driver-label-suffix {
    font-size: 0.65rem;
    color: #06B6D4;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    margin-left: 0.25rem;
}

/* Separador en select de vencimientos */
.fv2-expiry-separator {
    color: var(--text-dim) !important;
    font-style: italic;
    font-size: 0.8rem;
    background: rgba(51, 65, 85, 0.4);
    padding: 0.25rem 0.5rem;
}

/* ===== FORM CARD (open_trade.html) ===== */
.fv2-form-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    max-width: 800px;
    margin: 0 auto;
}

.fv2-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.fv2-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.fv2-form-group-lg { grid-column: span 2; }
.fv2-form-group-sm { min-width: 100px; }

.fv2-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

.fv2-label .req {
    color: #EF4444;
    margin-left: 0.2rem;
}

.fv2-textarea {
    padding: 0.625rem 0.875rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}

.fv2-textarea:focus {
    outline: none;
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

/* Contrato info card */
.fv2-contract-info-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.fv2-contract-info-label {
    font-size: 0.875rem;
    color: #10B981;
    font-weight: 600;
    flex: 1;
}

.fv2-multiplier-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    color: #8B5CF6;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.fv2-currency-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    background: rgba(6, 182, 212, 0.15);
    color: #06B6D4;
    border-radius: var(--radius-full);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Value preview */
.fv2-value-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.fv2-value-label { color: var(--text-muted); }
.fv2-value-amount {
    font-weight: 700;
    color: #06B6D4;
    font-family: 'Monaco', monospace;
    font-size: 1rem;
}
.fv2-value-currency { color: var(--text-dim); font-size: 0.8rem; }

/* Form actions */
.fv2-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.btn-fv2-primary {
    padding: 0.75rem 1.75rem;
    background: linear-gradient(135deg, #06B6D4 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-fv2-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.btn-fv2-primary:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.btn-fv2-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-fv2-secondary:hover {
    background: var(--bg-quaternary);
    color: var(--text-primary);
}

/* Form error */
.fv2-form-error {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #F87171;
    font-size: 0.875rem;
}

/* Back link */
.fv2-back-link {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.15s;
}

.fv2-back-link:hover {
    color: #06B6D4;
}

/* ===== LOADING STATE ===== */
.fv2-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 1.5rem;
    font-size: 0.875rem;
}

/* ===================================================================
   MODAL GLOBAL SUMMARY (fv2-sum-*) — usado en layout.html global
   =================================================================== */

/* Overlay/backdrop */
.fv2-sum-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

/* Caja del modal */
.fv2-sum-modal {
    background: var(--bg-secondary, #1E293B);
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
    border-radius: var(--radius-xl, 20px);
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 40px rgba(6,182,212,0.1);
    position: relative;
}

/* Header */
.fv2-sum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, rgba(148,163,184,0.2));
    background: linear-gradient(135deg, rgba(6,182,212,0.08) 0%, rgba(139,92,246,0.08) 100%);
    border-radius: var(--radius-xl, 20px) var(--radius-xl, 20px) 0 0;
}

.fv2-sum-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #06B6D4 0%, #8B5CF6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fv2-sum-close {
    background: none;
    border: none;
    color: var(--text-muted, #94A3B8);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: var(--radius-sm, 6px);
    transition: all 0.15s;
}

.fv2-sum-close:hover {
    color: var(--text-primary, #F1F5F9);
    background: var(--bg-tertiary, #334155);
}

/* Body */
.fv2-sum-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Footer */
.fv2-sum-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, rgba(148,163,184,0.2));
}

/* Sección interna */
.fv2-sum-section {
    background: rgba(15,23,42,0.4);
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
    border-radius: var(--radius-md, 12px);
    padding: 1rem 1.25rem;
}

.fv2-sum-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted, #94A3B8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

/* Grid de campos */
.fv2-sum-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

/* Campo individual */
.fv2-sum-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.fv2-sum-field-sym   { grid-column: 1; }
.fv2-sum-field-expiry { grid-column: 2; }
.fv2-sum-field-full  { grid-column: 1 / -1; }

/* Label */
.fv2-sum-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted, #94A3B8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input / Select */
.fv2-sum-input {
    padding: 0.5rem 0.75rem;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
    border-radius: var(--radius-md, 12px);
    color: var(--text-primary, #F1F5F9);
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 38px;
    width: 100%;
    box-sizing: border-box;
}

.fv2-sum-input:focus {
    outline: none;
    border-color: #06B6D4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.fv2-sum-select { cursor: pointer; }

.fv2-input-symbol {
    font-family: 'Monaco', 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: #06B6D4;
    letter-spacing: 0.05em;
}

.fv2-expiry-custom { font-family: 'Monaco', monospace; }

/* Sugerencias autocomplete */
.fv2-sum-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--bg-secondary, #1E293B);
    border: 1px solid var(--border-hover, rgba(102,126,234,0.4));
    border-radius: var(--radius-md, 12px);
    max-height: 180px;
    overflow-y: auto;
    margin-top: 2px;
    box-shadow: var(--shadow-lg, 0 10px 15px rgba(0,0,0,0.1));
}

.fv2-sum-suggestion-item {
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary, #CBD5E1);
    transition: background 0.1s;
}

.fv2-sum-suggestion-item:hover,
.fv2-sum-suggestion-item.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--text-primary, #F1F5F9);
}

/* Badge de contrato */
.fv2-contract-badge {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(6,182,212,0.1);
    border: 1px solid rgba(6,182,212,0.3);
    border-radius: var(--radius-md, 12px);
    font-size: 0.8rem;
    font-weight: 700;
    color: #06B6D4;
    font-family: 'Monaco', monospace;
}

/* Detalles del contrato */
.fv2-contract-details {
    margin-top: 0.75rem;
}

/* Driver options */
.fv2-driver-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fv2-driver-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
    border-radius: var(--radius-md, 12px);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted, #94A3B8);
    transition: all 0.15s;
    user-select: none;
}

.fv2-driver-option:has(input:checked) {
    border-color: rgba(6,182,212,0.5);
    background: rgba(6,182,212,0.12);
    color: #06B6D4;
}

.fv2-driver-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.fv2-driver-ticker-note {
    font-size: 0.7rem;
    color: var(--text-dim, #64748B);
    margin-top: 0.25rem;
    display: block;
}

/* Toggle acción COMPRAR/VENDER */
.fv2-sum-action-toggle {
    display: flex;
    gap: 0.5rem;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
}

.fv2-sum-action-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    background: rgba(15,23,42,0.5);
    color: var(--text-muted, #94A3B8);
}

.fv2-sum-action-btn.fv2-buy.active {
    background: rgba(16,185,129,0.2);
    color: #10B981;
    box-shadow: inset 0 0 0 1px rgba(16,185,129,0.4);
}

.fv2-sum-action-btn.fv2-sell.active {
    background: rgba(239,68,68,0.2);
    color: #EF4444;
    box-shadow: inset 0 0 0 1px rgba(239,68,68,0.4);
}

.fv2-sum-action-btn:hover:not(.active) {
    background: var(--bg-tertiary, #334155);
    color: var(--text-secondary, #CBD5E1);
}

/* Info row (multiplicador, nocional) */
.fv2-sum-info-row {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(6,182,212,0.06);
    border-radius: var(--radius-md, 12px);
    border: 1px solid rgba(6,182,212,0.15);
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.fv2-sum-info-item {
    font-size: 0.8rem;
    color: var(--text-muted, #94A3B8);
}

.fv2-sum-info-item strong {
    color: #06B6D4;
    font-family: 'Monaco', monospace;
}

/* Error / Success */
.fv2-sum-error {
    padding: 0.75rem 1rem;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: var(--radius-md, 12px);
    color: #F87171;
    font-size: 0.875rem;
}

.fv2-sum-success {
    padding: 0.75rem 1rem;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.3);
    border-radius: var(--radius-md, 12px);
    color: #34D399;
    font-size: 0.875rem;
}

/* Botones del footer */
.fv2-sum-btn-cancel {
    padding: 0.625rem 1.25rem;
    background: var(--bg-tertiary, #334155);
    color: var(--text-secondary, #CBD5E1);
    border: 1px solid var(--border-color, rgba(148,163,184,0.2));
    border-radius: var(--radius-md, 12px);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 40px;
}

.fv2-sum-btn-cancel:hover {
    background: var(--bg-quaternary, #475569);
    color: var(--text-primary, #F1F5F9);
}

.fv2-sum-btn-save {
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, #06B6D4 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md, 12px);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px;
    box-shadow: 0 4px 15px rgba(6,182,212,0.3);
}

.fv2-sum-btn-save:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6,182,212,0.5);
}

.fv2-sum-btn-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Mobile responsive para el modal summary */
@media (max-width: 600px) {
    .fv2-sum-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-lg, 16px);
    }

    .fv2-sum-grid {
        grid-template-columns: 1fr;
    }

    .fv2-sum-field-sym,
    .fv2-sum-field-expiry {
        grid-column: 1;
    }

    .fv2-sum-header,
    .fv2-sum-body,
    .fv2-sum-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .fv2-driver-options {
        flex-direction: column;
    }

    .fv2-sum-action-toggle {
        flex-direction: column;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .fv2-container { padding: 0.75rem; }
    .fv2-header { flex-direction: column; }
    .fv2-form-grid { grid-template-columns: 1fr; }
    .fv2-title { font-size: 1.375rem; }
    .fv2-form-group-full { grid-column: 1; }
    .fv2-ticker-row { flex-wrap: wrap; }
    .fv2-ticker-status { min-width: unset; }
}
