﻿
body {
    background: var(--bg-light-page);
}

/* Hero */
.hero-section {
    background: var(--bg-light-card);
    border-radius: var(--radius-xl);
    max-width: var(--container-xl);
    width: 100%;
    padding: var(--space-5);
    margin: var(--space-5) auto; 
    box-shadow: var(--shadow-md);
}

.hero-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--grid-gap);
    align-items: start;
    padding: var(--space-4);
    width: 100%;
}
/* Hero-------- columna 1 */
.hero-col-main h1 {
    background: var(--vigma-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: var(--space-3);
    margin-bottom: var(--space-3);
}
.hero-actions {
    margin-top: var(--space-3);
    margin-bottom: var(--space-3);
}

.services-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    margin-bottom: var(--space-3);
}

.services-card{
    margin-bottom: var(--space-4)
}
.hero-last-update {
    font-size: var(--text-sm);
    color: var(--color-txt-light)
}
.hero-lead {
    max-width: var(--container-md);
}
/* Hero-------- columna 2 */
.hero-col-side {
    background: var(--bg-light-subtle);
    padding: var(--space-4);
    border-radius: var(--radius-sm); /* ← corregido */
}
.services-meta {
    width: 100%;
    border-collapse: collapse; /* ← esto habilita border en tr y td */
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

    .services-meta td {
        padding: var(--space-3) var(--space-2);
        vertical-align: top;
        color: var(--color-txt-light);
        border-top: 4px solid var(--bg-light-card); /* ← cambia bottom por top */
    }

    .services-meta tr:first-child td {
        border-top: none; /* quita la línea del primero */
    }

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr; /* una sola columna */
    }

    .hero-col-side {
        order: 2; /* pasa debajo */
    }

    .hero-col-main {
        order: 1; /* se queda arriba */
    }

    .hero-section {
        margin: var(--space-3);
        padding: var(--space-4);
    }

    .hero-actions {
        flex-wrap: wrap; /* botones se acomodan en varias filas */
    }

    .hero-lead {
        max-width: 100%; /* quita el límite de ancho en móvil */
    }
}

/* metric content */
.metric-content {

    max-width: var(--container-xl);
    width: 100%;
    padding: var(--space-5);
    margin: var(--space-5) auto;

}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columnas */
    gap: var(--grid-gap);
    margin-bottom: var(--space-5);
}

.metric-card {
    background: var(--bg-light-card);
    position: relative;
    height: 10rem;
    border-radius: var(--radius-lg);
    padding: .5rem; /* quita el padding general */
    box-shadow: var(--shadow-md);
    display: grid;
    grid-template-columns: auto 1fr; /* icono | contenido */
    grid-template-rows: 1fr auto; /* contenido | footer */
    overflow: hidden;
}
    .metric-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 15px;
        background: var(--primary-gradient);
    }

    .metric-card.success::before {
        background: var(--success-gradient);
    }

    .metric-card.dark::before {
        background: var(--dark-gradient);
    }

    .metric-card.throughput::before {
        background: var(--throughput-gradient);
    }

    .metric-card.danger::before {
        background: var(--danger-gradient);
    }
.metric-icon {
    grid-column: 1;
    grid-row: 1;
    width: 90px;
    height: 100%;
    border-radius: 0; /* quita el radius — la tarjeta ya lo tiene */
    margin-bottom: 0;
    align-self: stretch;
    align-items: center;
    align-content: center;
    color: var(--bg-light-card);
    text-align: center;
    font-size: var(--text-4xl);
    border-radius: var(--radius-sm)
}

.metric-body {
    font-size: var(--text-2xl);
    grid-column: 2;
    grid-row: 1;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-footer {
    grid-column: 1 / -1; /* spanning todo el ancho */
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--bg-light-muted);
    font-size: var(--text-sm);
}

.metric-footer-success {
    color: var(--color-success);
}

.metric-footer-danger {
    color: var(--color-danger);
}


.metric-card.throughput::before {
    background: var(--throughput-gradient);
}

.metric-card.throughput .metric-value {
    background: var(--throughput-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive métricas */
@media (max-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablet */
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr; /* 1 columna en móvil */
    }

    .metric-card {
        height: auto; /* altura flexible en móvil */
    }
}

.badge-modern {
    padding: 6px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.85rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    margin-top: 30px;
    border: none;
    color: var(--color-txt-ligh)
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.status-online {
    background: rgba(56, 239, 125, 0.1);
    color: #11998e;
    border: 1px solid rgba(56, 239, 125, 0.3);
}

.status-offline {
    background: rgba(255, 65, 108, 0.1);
    color: #ff416c;
    border: 1px solid rgba(255, 65, 108, 0.3);
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

    .pulse.online {
        background: #38ef7d;
        box-shadow: 0 0 0 0 rgba(56, 239, 125, 0.7);
    }

    .pulse.offline {
        background: #ff416c;
        box-shadow: 0 0 0 0 rgba(255, 65, 108, 0.7);
    }

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 239, 125, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(56, 239, 125, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 239, 125, 0);
    }
}

.api-key-display {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 15px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    border: 1px dashed #dee2e6;
    margin-top: 10px;
}

.feature-card {
    background: white;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition-smooth);
    height: 100%;
    position: relative;
    overflow: hidden;
}

    .feature-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--card-hover-shadow);
        border-color: rgba(102, 126, 234, 0.2);
    }

    .feature-card .icon-wrapper {
        width: 60px;
        height: 60px;
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 20px;
        color: #667eea;
        font-size: 24px;
    }

.recent-activity {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.activity-item {
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
}

    .activity-item:last-child {
        border-bottom: none;
    }

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #667eea;
}


/* =============================================================================
   CHART SECTION — sin duplicados
   ============================================================================= */
.chart-section {
    background: var(--bg-light-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
    width: 100%;
    height: 100%;
    margin: var(--space-5) auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-3);
}

.chart-title-group {
    display: flex;
    flex-direction: column;
}

.chart-title {
    font-family: var(--font-titles);
    font-weight: var(--weight-bold);
    font-size: var(--text-xl);
    color: var(--color-dark);
    margin-bottom: var(--space-1);
}

.chart-subtitle {
    font-size: var(--text-sm);
    color: var(--color-dark);
    opacity: 0.5;
}

.chart-select {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-dark);
    border: 1px solid var(--bg-light-muted);
    border-radius: var(--radius-md);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-light-card);
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

    .chart-select:hover {
        border-color: var(--color-vigma);
    }

.chart-legend {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-dark);
    opacity: 0.7;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}


/* ← colores que coinciden exactamente con el script */
.legend-timbrados .legend-dot {
    background: #0f9b8e;
}

.legend-tenants .legend-dot {
    background: #38ef7d;
}

.legend-errores .legend-dot {
    background: #ff416c;
}

.chart-wrapper {
    overflow: hidden;
    width: 100%;
    height: 220px;
}

#actividadChart {
    overflow: hidden;
}

@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        gap: var(--space-3);
    }
}