/* ============================================================
   VECTOREXEC - DASHBOARD AVANZADO
   ============================================================ */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f7fafc;
    min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */

.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #0D47A1;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #0D47A1;
}

.nav-link.active {
    color: #0D47A1;
    border-bottom-color: #0D47A1;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.username {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.btn-logout {
    padding: 6px 14px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.btn-logout:hover {
    background: #c53030;
}

/* ============================================================
   CONTENIDO
   ============================================================ */

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
}

.page-header .subtitle {
    font-size: 14px;
    color: #718096;
}

.btn-secondary {
    padding: 10px 20px;
    background: #e2e8f0;
    color: #2d3748;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* ============================================================
   TARJETAS DE ESTADÍSTICAS
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 32px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: #718096;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
}

.stat-value.positive {
    color: #276749;
}

.stat-value.negative {
    color: #e53e3e;
}

/* ============================================================
   GRÁFICOS
   ============================================================ */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-card.chart-full {
    grid-column: 1 / -1;
}

.chart-card h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 300px;
}

.chart-card.chart-full .chart-container {
    height: 350px;
}

/* ============================================================
   TABLA DE OPERACIONES
   ============================================================ */

.table-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 32px;
}

.table-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f4f8;
    color: #2d3748;
}

tbody tr:hover {
    background: #f7fafc;
}

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

.text-muted {
    color: #a0aec0;
    font-size: 14px;
}

/* ============================================================
   ESTADO DE LOS BOTS
   ============================================================ */

.bots-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bots-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 16px;
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.bot-card {
    background: #f7fafc;
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid #0D47A1;
}

.bot-card.running {
    border-left-color: #48bb78;
}

.bot-card.stopped {
    border-left-color: #e53e3e;
}

.bot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.bot-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
}

.bot-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.bot-status.running {
    background: #c6f6d5;
    color: #276749;
}

.bot-status.stopped {
    background: #fed7d7;
    color: #9b2c2c;
}

.bot-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bot-detail {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.bot-detail .label {
    color: #718096;
}

.bot-detail .value {
    font-weight: 500;
    color: #2d3748;
}

.bot-strategies {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.bot-strategies-title {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.bot-strategy-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2d3748;
    padding: 4px 0;
}

.bot-strategy-priority {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ebf8ff;
    color: #2b6cb0;
    font-size: 11px;
    font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
        gap: 8px;
    }

    .main-nav {
        flex-wrap: wrap;
        gap: 12px;
    }

    .user-menu {
        margin-left: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header h1 {
        font-size: 22px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 20px;
    }

    .bots-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .main-nav {
        gap: 8px;
    }

    .nav-link {
        font-size: 12px;
        padding: 4px 8px;
    }

    .username {
        font-size: 12px;
    }

    .btn-logout {
        font-size: 11px;
        padding: 4px 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        font-size: 24px;
    }

    .stat-value {
        font-size: 18px;
    }
}
