/* index.css - VERSIÓN FINAL: MENÚ HAMBURGUESA + FULL WIDTH */

/* --- Importación de Fuentes y Animaciones --- */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ESTILOS GENERALES (DARK MODE) --- */
body {
    background-color: #121212 !important; 
    color: #ffffff !important; 
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden; /* Evita scroll horizontal por animaciones */
}

/* --- NUEVO LAYOUT (Full Width - Sin Sidebar Fijo) --- */
#main-layout {
    display: block; /* Antes era grid, ahora es bloque simple */
    width: 100%;
    min-height: 100vh;
    position: relative;
}

#cuerpo {
    width: 100%;
    max-width: 1600px; /* Tope para monitores ultra anchos */
    margin: 0 auto;
    padding: 20px 30px;
    box-sizing: border-box;
    background-color: transparent !important;
}

/* ======================================================
   NUEVO MENÚ HAMBURGUESA & HEADER
   ====================================================== */

/* Header Superior Fijo */
.header-principal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #1e1e1e;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

.logo-container h1 {
    margin: 0;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.reloj-mini {
    color: #00bcd4;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

/* Botón Hamburguesa (Las 3 rayitas) */
.hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
    z-index: 2001;
}

.hamburger-btn .bar {
    width: 30px;
    height: 3px;
    background-color: #fff;
    border-radius: 5px;
    transition: 0.3s;
}

.hamburger-btn:hover .bar { 
    background-color: #00bcd4; 
    box-shadow: 0 0 8px #00bcd4; 
}

/* Panel Lateral Deslizante */
.sidebar-menu {
    position: fixed;
    top: 0;
    right: -320px; /* Oculto a la derecha */
    width: 300px;
    height: 100vh;
    background-color: #1a1a1a;
    box-shadow: -5px 0 20px rgba(0,0,0,0.8);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1); /* Animación suave */
    display: flex;
    flex-direction: column;
    padding: 25px;
    box-sizing: border-box;
    border-left: 1px solid #333;
}

.sidebar-menu.active { 
    right: 0; /* Mostrar */
}

/* Elementos dentro del Menú */
.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.admin-info { display: flex; align-items: center; gap: 15px; color: white; }
.status-dot {
    width: 10px; height: 10px;
    background-color: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff88;
}
.admin-info h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.admin-info p { margin: 0; font-size: 0.85rem; color: #888; }

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1;
}
.close-btn:hover { color: #ff4d4d; transform: rotate(90deg); }

.menu-links { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.menu-links li { margin-bottom: 10px; }

.menu-links a {
    text-decoration: none;
    color: #e0e0e0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.menu-links a i { width: 25px; text-align: center; color: #00bcd4; }

.menu-links a:hover {
    background-color: rgba(0, 188, 212, 0.1);
    color: #00bcd4;
    transform: translateX(5px);
}

.menu-footer { margin-top: auto; }
.btn-logout {
    text-decoration: none;
    color: #ff4d4d;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-radius: 8px;
    transition: 0.3s;
    font-weight: 600;
}
.btn-logout:hover { background-color: rgba(255, 77, 77, 0.1); border-color: #ff4d4d; }

/* Fondo Oscuro al abrir menú */
.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 1500;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.menu-overlay.active { display: block; opacity: 1; }


/* ======================================================
   ESTILOS DE TABLA GLOBALES (CORREGIDOS)
   ====================================================== */
table, .table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin-top: 20px;
    color: #e0e0e0 !important;
    background-color: #1e1e1e !important;
    --bs-table-bg: #1e1e1e;
    --bs-table-color: #e0e0e0;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #333 !important;
}

thead th {
    background-color: #111 !important;
    color: #00bcd4 !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9em;
}

tbody tr {
    background-color: #252525 !important;
    transition: background-color 0.3s ease;
}

tbody tr:hover {
    background-color: #3a3a3a !important;
    color: #fff !important;
}

.btn-ver-expediente {
    cursor: pointer; border: none; padding: 8px 16px;
    border-radius: 5px; font-size: 0.9em; font-weight: 500;
    transition: all 0.3s ease; background-color: #00bcd4; color: #121212;
}
.btn-ver-expediente:hover { background-color: #0097a7; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }


/* ======================================================
   ESTILOS DE MODAL (DARK MODE)
   ====================================================== */
.modal {
    visibility: hidden; opacity: 0; position: fixed; z-index: 3000; /* Z-index MUY alto */
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8) !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex; align-items: center; justify-content: center;
}

.modal.modal-show { visibility: visible; opacity: 1; }

.modal-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border: 1px solid #333;
    margin: 20px; max-height: 90vh; overflow-y: auto; padding: 25px;
    border-radius: 8px; width: 90%; max-width: 600px; position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
}

.closeBtn { color: #888; position: absolute; top: 10px; right: 15px; font-size: 28px; font-weight: bold; cursor: pointer; }
.closeBtn:hover { color: #fff; }

.form-group input, .form-group textarea, .form-group select {
    background-color: #2c2c2c !important;
    border: 1px solid #444 !important;
    color: #fff !important;
}

 /* ESTILOS DEL PIE DE PÁGINA */
#pie {
    background-color: #1a1a1a;
    color: #888;
    border-top: 1px solid #333;
    padding: 20px 0;
    margin-top: auto; /* Empuja el footer hacia abajo */
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
}

#pie strong {
    color: #00bcd4; /* Color Cyan para resaltar */
}

/* Ajuste para que el layout principal ocupe toda la altura */
#main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#cuerpo {
    flex: 1; /* Esto hace que el cuerpo crezca y empuje el footer */
}

/* =======================================================
   RESPONSIVE (AJUSTADO PARA EL NUEVO DISEÑO)
   ======================================================= */
@media screen and (max-width: 768px) {
    
    .header-principal {
        padding: 10px 15px;
    }

    .logo-container h1 {
        font-size: 1.2rem;
    }

    #cuerpo {
        padding: 15px;
    }

    /* Tablas Deslizables */
    .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        border: 1px solid #333;
    }
    
    table { min-width: 600px; }

    /* Modales y Formularios */
    .modal-content {
        width: 95% !important;
        margin: 5% auto !important;
        max-height: 85vh;
    }
    
    .form-columns {
        display: flex;
        flex-direction: column !important;
        gap: 15px;
    }
    
    .form-group { width: 100% !important; }

    h2, h3 { font-size: 1.4rem !important; text-align: center; }
    
    .btn-cyan, .btn-secondary, button {
        width: 100% !important;
        margin-bottom: 10px;
        padding: 12px !important;
    }
}