/* Variables de Identidad - ClemAr Web Solutions */
:root {
    --bg-dark: #0b0f19;
    --sidebar-bg: #161b22;
    --neon-blue: #00d2ff;
    --neon-green: #39ff14;
    --text-main: #e6edf3;
    --text-muted: #8b949e;
    --danger: #ff4d4d;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Fija a la Izquierda */
.sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid rgba(0, 210, 255, 0.2);
    padding: 2rem 1.5rem;
    box-shadow: 4px 0 15px rgba(0, 210, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--neon-green));
}

.sidebar h2 {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Botón Volver al Portafolio Mejorado con Estilo Neón */
.btn-volver {
    display: block;
    color: var(--neon-blue);
    text-shadow: 0 0 5px rgba(0, 210, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--neon-blue);
    background: rgba(11, 15, 25, 0.5);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    margin-top: 10px;
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.1);
    transition: var(--transition);
}

.btn-volver:hover {
    background: var(--neon-blue);
    color: var(--bg-dark);
    text-shadow: none;
    box-shadow: 0 0 15px var(--neon-blue);
    transform: translateY(-1px);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--bg-dark);
    background-color: var(--neon-blue);
    font-weight: 600;
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.4);
}

/* Área de Contenido Principal (Desplazada por la sidebar) */
.main-dashboard {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2.5rem;
    width: calc(100% - 280px);
}

.dashboard-header h1 {
    color: var(--neon-blue);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.8rem;
}

/* Tarjetas del Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: 700;
}

/* Contenedores de Módulos */
.inventory-container {
    background: var(--sidebar-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
}

.inventory-container h3 {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
}

/* Formulario en Cuadrícula */
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 12px;
}

.form-grid input {
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.form-grid input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 5px rgba(0, 210, 255, 0.3);
}

.btn-submit {
    background: var(--neon-green);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.btn-submit:hover {
    box-shadow: 0 0 12px var(--neon-green);
    transform: translateY(-2px);
}

/* Cabecera de la Tabla y Buscador */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#buscador-alimentos {
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-dark);
    color: var(--text-main);
    width: 300px;
    outline: none;
}

#buscador-alimentos:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 5px rgba(0, 210, 255, 0.3);
}

/* Estilos de Tabla */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: rgba(0, 210, 255, 0.15);
    color: var(--neon-blue);
    border-bottom: 2px solid var(--neon-blue);
    padding: 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
}

.prod-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.prod-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 8px var(--neon-blue);
}

.btn-vender {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
}

.btn-vender:hover {
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 8px var(--neon-green);
}

/* Modal Visor Lightbox */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 80px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(5px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 75vh;
    border-radius: 12px;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.4);
    animation: zoom 0.3s ease;
}

@keyframes zoom {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--text-main);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* MODO RESPONSIVO PANTALLAS CHICAS */
@media screen and (max-width: 992px) {
    body { flex-direction: column; }
    .sidebar {
        width: 100%; max-width: 100%; height: auto;
        position: relative; padding: 1.5rem;
        border-right: none; border-bottom: 1px solid rgba(0, 210, 255, 0.2);
    }
    .brand-container { justify-content: center; }
    .sidebar-nav { flex-direction: row; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
    .main-dashboard { margin-left: 0; width: 100%; padding: 1.5rem; }
    .stats-grid, .form-grid { grid-template-columns: 1fr; }
    .table-header { flex-direction: column; align-items: stretch; gap: 1rem; }
    #buscador-alimentos { width: 100%; }
    .inventory-container { overflow-x: auto; }
    .data-table { min-width: 600px; }
}
