* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0c10;
    color: #eef2ff;
    font-family: 'Inter', sans-serif;
    padding: 24px 32px;
}

/* Fondo profesional de trading */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(90deg, rgba(96,165,250,0.03) 1px, transparent 1px),
        linear-gradient(0deg, rgba(96,165,250,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(96,165,250,0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.dashboard {
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 16, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #0f1119;
    border: 1px solid #2a2c38;
    border-radius: 32px;
    padding: 48px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8);
}

.login-card h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #c084fc, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
}

.login-card p {
    color: #8b8ea6;
    margin-bottom: 32px;
    text-align: center;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #b9c3dd;
}

.input-group input, .input-group select {
    width: 100%;
    background: #1a1c24;
    border: 1px solid #353a44;
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
}

.input-group input:focus, .input-group select:focus {
    border-color: #60a5fa;
}

.login-btn {
    width: 100%;
    background: linear-gradient(105deg, #3b82f6, #2563eb);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    transition: 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.error-msg {
    color: #f87171;
    font-size: 0.8rem;
    margin-top: 12px;
    text-align: center;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.logo-area h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.logo-area p {
    font-size: 0.8rem;
    color: #8b8ea6;
    margin-top: 4px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #111217;
    padding: 8px 20px;
    border-radius: 60px;
    border: 1px solid #2a2c38;
}

.user-info i {
    color: #60a5fa;
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a1c24;
    padding: 4px 12px;
    border-radius: 40px;
    border: 1px solid #353a44;
}

.user-balance span {
    font-weight: 700;
    color: #4ade80;
}

.settings-btn {
    background: #2d2f3a;
    border: none;
    color: #60a5fa;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: #3d3f4a;
    transform: rotate(90deg);
}

.logout-btn {
    background: #2d2f3a;
    border: none;
    color: #f87171;
    padding: 6px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.logout-btn:hover {
    background: #3d3f4a;
}

.status-pill {
    background: #111217;
    border-radius: 80px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #2a2c38;
}

.status-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: #9ca3af;
}

#status {
    font-weight: 700;
    font-size: 0.9rem;
}

.running-badge { color: #22c55e; }
.stopped-badge { color: #ef4444; }

/* Control Card */
.control-card {
    background: #0f1117;
    border: 1px solid #232530;
    border-radius: 28px;
    padding: 20px 28px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #090b10;
    padding: 6px 12px;
    border-radius: 60px;
    border: 1px solid #2d2f3a;
}

.mode-selector span {
    font-weight: 500;
    font-size: 0.85rem;
    color: #9ca3af;
}

select {
    background: #1a1c24;
    border: 1px solid #353a44;
    color: white;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.85rem;
    outline: none;
}

.btn-control {
    padding: 10px 28px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.btn-start {
    background: linear-gradient(105deg, #0e7c3a, #0a5c2c);
    color: white;
    box-shadow: 0 4px 12px rgba(14,124,58,0.3);
}

.btn-start:hover {
    transform: translateY(-2px);
}

.btn-stop {
    background: linear-gradient(105deg, #991b1b, #7f1a1a);
    color: white;
    box-shadow: 0 4px 12px rgba(153,27,27,0.3);
}

.btn-stop:hover {
    transform: translateY(-2px);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #0f1119;
    border: 1px solid #232530;
    border-radius: 28px;
    padding: 20px;
    transition: 0.2s;
}

.stat-card:hover {
    border-color: #3b3f54;
    transform: translateY(-3px);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-header i {
    font-size: 1.6rem;
    color: #60a5fa;
}

.stat-header h3 {
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9aa2b5;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-sub {
    font-size: 0.7rem;
    color: #6b7280;
}

.profit-positive { color: #4ade80; }
.profit-negative { color: #f87171; }

/* Panel de Configuración */
.settings-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #0f1119;
    border-left: 1px solid #2a2c38;
    z-index: 1001;
    transition: right 0.3s ease;
    padding: 30px;
    overflow-y: auto;
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2c38;
}

.settings-header h2 {
    font-size: 1.5rem;
    color: #60a5fa;
}

.close-settings {
    background: none;
    border: none;
    color: #f87171;
    font-size: 1.5rem;
    cursor: pointer;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #eef2ff;
}

.setting-item input {
    width: 100%;
    background: #1a1c24;
    border: 1px solid #353a44;
    color: white;
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
}

.risk-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-top: 8px;
}

.risk-low { background: rgba(34,197,94,0.2); color: #4ade80; }
.risk-medium { background: rgba(249,115,22,0.2); color: #f97316; }
.risk-high { background: rgba(239,68,68,0.2); color: #f87171; }

.save-settings {
    width: 100%;
    background: linear-gradient(105deg, #0e7c3a, #0a5c2c);
    color: white;
    padding: 12px;
    border: none;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: 0.2s;
}

.save-settings:hover {
    transform: translateY(-2px);
}

/* Tabla */
.section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title i {
    font-size: 1.2rem;
    color: #60a5fa;
}

.section-title h2 {
    font-weight: 600;
    font-size: 1.3rem;
}

.section-title span {
    color: #6c7289;
    font-size: 0.75rem;
}

.table-wrapper {
    background: #0c0e14;
    border-radius: 28px;
    border: 1px solid #232530;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #0a0c12;
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    color: #b9c3dd;
    border-bottom: 1px solid #262a36;
    font-size: 0.8rem;
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid #1b1e28;
}

.win-row {
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid #22c55e;
}

.loss-row {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid #ef4444;
}

.badge-call, .badge-put {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-call {
    color: #4ade80;
    background: rgba(74,222,128,0.12);
}

.badge-put {
    color: #f97316;
    background: rgba(249,115,22,0.12);
}

.footer-note {
    margin-top: 24px;
    text-align: center;
    font-size: 0.7rem;
    color: #4a4f6e;
}

/* Responsive */
@media (max-width: 680px) {
    body {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stats-grid {
        gap: 12px;
    }
    
    .user-info {
        flex-wrap: wrap;
        padding: 8px 12px;
    }
    
    .settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .control-card {
        flex-direction: column;
    }
    
    .mode-selector {
        width: 100%;
        justify-content: center;
    }
    
    select, .btn-control {
        width: 100%;
    }
}