/* =========================================
   1. VARIABLES DE COLOR (NEGRO Y VERDE NEÓN)
   ========================================= */
:root {
    --bg-dark: #050505;
    --modal-bg: #111111;
    --neon-green: #39ff14;
    --neon-green-dim: rgba(57, 255, 20, 0.2);
    --text-light: #f0f0f0;
    --text-muted: #888888;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   2. ESTRUCTURA DEL PANEL ADMINISTRATIVO
   ========================================= */
.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-dark);
}

.sidebar { 
    width: 250px; 
    background: #050505; 
    border-right: 1px solid var(--neon-green-dim); 
    padding: 20px 0; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
}

.sidebar h2 { 
    color: var(--neon-green); 
    text-align: center; 
    margin-bottom: 30px; 
    text-shadow: 0 0 10px var(--neon-green-dim); 
}

.menu-item { 
    padding: 15px 25px; 
    color: #aaa; 
    text-decoration: none; 
    border-left: 3px solid transparent; 
    transition: all 0.3s ease; 
    display: block; 
    font-size: 15px;
}

.menu-item:hover, .menu-item.activo { 
    background: rgba(57, 255, 20, 0.05); 
    border-left-color: var(--neon-green); 
    color: var(--neon-green); 
}

.contenido-principal { 
    flex: 1; 
    padding: 30px; 
    overflow-y: auto; 
    background: #0a0a0a;
}

.tarjeta-admin { 
    background: #111; 
    padding: 20px; 
    border-radius: 8px; 
    border: 1px solid #222; 
    margin-bottom: 20px; 
}

/* =========================================
   3. INPUTS Y BOTONES GLOBALES
   ========================================= */
.input-neon {
    width: 100%; padding: 12px; margin-bottom: 15px; background: #000; 
    border: 1px solid #333; color: #fff; border-radius: 8px; outline: none; transition: 0.3s;
}
.input-neon:focus { border-color: var(--neon-green); box-shadow: 0 0 10px var(--neon-green-dim); }

.btn-neon {
    padding: 12px; background: transparent; color: var(--neon-green);
    border: 2px solid var(--neon-green); border-radius: 8px; font-weight: bold;
    cursor: pointer; transition: 0.3s; text-transform: uppercase;
}
.btn-neon:hover { background: var(--neon-green); color: #000; box-shadow: 0 0 15px var(--neon-green); }
.btn-neon:disabled { border-color: #555; color: #555; cursor: not-allowed; box-shadow: none; }

/* =========================================
   DISEÑO RESPONSIVO (MÓVILES Y TABLETS)
   ========================================= */
.tabla-contenedor { width: 100%; overflow-x: auto; border-radius: 8px; }

@media (max-width: 768px) {
    /* 1. Forzamos que la estructura sea vertical (Menú arriba, contenido abajo) */
    body:has(.sidebar), .admin-layout { 
        flex-direction: column !important; 
        height: auto !important; 
        overflow-y: auto !important;
    }
    
    /* 2. El menú lateral se transforma en una barra superior deslizable */
    .sidebar { 
        width: 100% !important; 
        height: auto !important;
        flex-direction: row !important; 
        overflow-x: auto !important; 
        padding: 10px !important; 
        border-right: none !important; 
        border-bottom: 1px solid var(--neon-green-dim) !important; 
        flex-shrink: 0;
        white-space: nowrap; /* Evita que los botones se caigan a una segunda línea */
    }
    
    /* Ocultar la barra de scroll visual del menú pero permitir deslizar con el dedo */
    .sidebar::-webkit-scrollbar { display: none; }
    
    /* 3. Ocultamos el logo en móvil para ahorrar espacio */
    .sidebar h2 { display: none !important; }
    
    /* 4. Ajustamos los botones del menú para que estén lado a lado */
    .menu-item { 
        display: inline-block !important;
        padding: 10px 15px !important; 
        font-size: 14px !important; 
        border-left: none !important; 
        border-bottom: 3px solid transparent; 
    }
    .menu-item.activo, .menu-item:hover { 
        border-left: none !important; 
        background: transparent !important;
        border-bottom-color: var(--neon-green) !important; 
    }
    
    /* 5. El contenido principal toma el 100% del ancho */
    .contenido-principal { 
        width: 100% !important;
        padding: 15px !important; 
        overflow-y: visible !important; 
    }
    
    /* 6. Formularios uno debajo del otro */
    .fila-input-ui { flex-direction: column !important; gap: 10px !important; }
    .col-input { width: 100% !important; }
}