:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --accent: #38bdf8;
    --text-light: #f8fafc;
    --muted: #94a3b8;
    --border: #334155;
    --danger: #ef4444;
}

body { background-color: var(--bg-dark); color: var(--text-light); font-family: 'Segoe UI', sans-serif; margin: 0; }

/* --- NUEVA TOP BAR (PANEL) --- */
.top-bar {
    background: #1e293b;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--accent);
}
.top-bar a { text-decoration: none; color: white; font-weight: bold; font-size: 0.9rem; }

/* --- NAVEGACIÓN APP --- */
.navbar { background-color: #111827; padding: 10px 0; border-bottom: 1px solid var(--border); }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: center; gap: 10px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; }
.nav-link:hover, .nav-link.active { color: var(--accent); background: rgba(56, 189, 248, 0.1); }

/* --- CONTENEDORES --- */
.form-container {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 20px auto;
    max-width: 1000px;
    box-sizing: border-box;
}

/* --- INPUTS CORREGIDOS --- */
input, select {
    background: #1e293b !important;
    color: white !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    padding: 10px;
    outline: none;
    box-sizing: border-box; /* IMPORTANTE: evita que se salgan de la caja */
    width: 100%;
}

.btn-submit {
    background: var(--accent);
    color: #0f172a;
    border: none;
    padding: 12px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
}

.btn-danger { background: var(--danger); color: white; padding: 5px 10px; border-radius: 4px; text-decoration: none; font-size: 0.8rem; }

@media (max-width: 768px) {
    .nav-container { gap: 2px; justify-content: space-around; }
    .nav-link { font-size: 0.7rem; padding: 8px 4px; flex: 1; text-align: center; }
}
/* Estilo Profesional para tablas de datos */
.tabla-historico {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem;
    background: var(--bg-card);
}

.tabla-historico thead {
    background: #1e293b;
    position: sticky;
    top: 0;
}

.tabla-historico th {
    padding: 12px 15px;
    text-align: left;
    color: var(--accent);
    border-bottom: 2px solid var(--border);
}

.tabla-historico td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-light);
}

.tabla-historico tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
}

.tabla-historico tr:hover {
    background: rgba(56, 189, 248, 0.1);
}

.scroll-wrapper {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Contenedor responsivo para el gráfico - CORREGIDO */
.chart-container {
    position: relative;
    width: 100%;
    overflow-x: auto; /* El scroll sucede AQUÍ dentro */
    background: rgba(15, 23, 42, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-top: 20px;
    box-sizing: border-box;
}

.chart-inner {
    /* En escritorio se adapta, en móvil mantiene espacio para las barras */
    min-width: 100%; 
    height: 500px;
    padding: 15px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .chart-inner {
        min-width: 900px; /* Forzamos ancho interno solo para las barras */
        height: 400px;
    }
}

/* Asegurar que la caja principal no se deforme */
.form-container {
    overflow: hidden; 
}

/* Estilos para la nueva pestaña de Informes */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-weight: bold;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    cursor: pointer;
}

.checkbox-item input {
    accent-color: var(--accent);
}

.date-range-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 600px) {
    .date-range-picker {
        grid-template-columns: 1fr;
    }
}
