/* -------------------------------------------------------------------------- */
/* ------------------------- GOOGLE FONTS & RESET ---------------------------*/
/* -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    font-family: 'Poppins', sans-serif;
    background-color: #d6d9c8;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px; 
}

/* -------------------------------------------------------------------------- */
/* ------------------------- MAIN STRUCTURE ---------------------------------*/
/* -------------------------------------------------------------------------- */
.main-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease; /* Suaviza el empuje del contenido */
}

/* Efecto cuando el sidebar está abierto */
.main-wrapper.shifted {
    transform: translateX(250px);
}

.main-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    max-width: 1100px;
    width: 95%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* -------------------------------------------------------------------------- */
/* ----------------------- HAMBURGER & SIDEBAR ------------------------------*/
/* -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px; /* Escondido */
    width: 250px;
    height: 100%;
    background: #222; /* Fondo oscuro sólido */
    color: #fff;
    display: flex;
    flex-direction: column;
    padding-top: 60px; /* Espacio para que la X no tape el primer link */
    z-index: 2000;
    transition: left .3s ease;
    box-shadow: 4px 0 10px rgba(0,0,0,0.3);
}

.sidebar.open { 
    left: 0; 
}

/* Título superior dentro del Sidebar */
.sidebar .logo {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    padding: 10px 20px;
    border-bottom: 1px solid #444;
    margin-bottom: 10px;
}

/* Contenedor de enlaces para evitar desorden */
.sidebar .menu-items {
    display: flex;
    flex-direction: column;
}

.sidebar a {
    color: #fff;
    text-decoration: none;
    padding: 15px 25px;
    display: flex;
    align-items: center; /* Centra iconos y texto verticalmente */
    gap: 15px;         /* Espacio fijo entre icono y texto */
    transition: background .2s;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar a:hover { 
    background: #2979ff; 
}

/* BOTÓN HAMBURGUESA */
.hamburger-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2100;
    cursor: pointer;
    width: 30px;
    height: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-btn span {
    display: block;
    height: 4px;
    background: #333;
    border-radius: 2px;
    transition: all .3s ease;
}

/* Animación a X y cambio a blanco cuando abre */
.hamburger-btn.open span { background: #fff; }
.hamburger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

/* Overlay (Fondo oscuro tras el menú) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1900;
}
.sidebar-overlay.active { display: block; }

/* -------------------------------------------------------------------------- */
/* -------------------------- COMPONENTES -----------------------------------*/
/* -------------------------------------------------------------------------- */

.navbar {
    display: flex; 
    justify-content: flex-end; 
    padding: 10px 20px; 
    background: #f4f4f4; 
    border-radius: 12px; 
    margin-bottom: 30px;
    align-items: center;
}

.navbar img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #333;
}

/* TABS */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 25px 0;
}

.tabs button {
    padding: 10px 20px;
    border-radius: 25px;
    border: none;
    background: #eee;
    color: #333;
    cursor: pointer;
    font-weight: 600;
    transition: all .3s;
}

.tabs button.active {
    background: #2979ff;
    color: #fff;
}

#tab-info {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 12px;
    border-left: 5px solid #2979ff;
    margin-bottom: 30px;
    font-size: 1rem;
    color: #444;
}

/* TABLAS Y CARDS */
.table-wrapper { overflow-x: auto; margin: 20px 0; }
table { width: 100%; border-collapse: collapse; background: #fff; }
thead th { background: #333; color: #fff; padding: 15px; text-align: left; }
td { padding: 15px; border-bottom: 1px solid #eee; }

.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    display: inline-block;
}

.badge-primary { background: #2979ff; }
.badge-success { background: #4caf50; }
.badge-warning { background: #ff9800; }
.badge-danger  { background: #f44336; }

.card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    margin-bottom: 20px;
}

/* -------------------------------------------------------------------------- */
/* 1. ACORDEÓN (Preguntas Frecuentes) */
/* -------------------------------------------------------------------------- */
.accordion {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
}

.accordion-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header::after {
    content: '▼';
    font-size: 0.8rem;
    color: #666;
}

.accordion-body {
    padding: 15px 20px;
    display: none; /* Se activa con el JS que ya tienes */
    background: #fff;
    border-top: 1px solid #eee;
    color: #555;
    line-height: 1.5;
}

/* -------------------------------------------------------------------------- */
/* 2. MODAL (Ventana Emergente) */
/* -------------------------------------------------------------------------- */
.modal {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Fondo oscuro */
    z-index: 3000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2979ff;
}

.modal-content p {
    margin-bottom: 20px;
    color: #444;
}

/* -------------------------------------------------------------------------- */
/* 3. FORMULARIO Y BOTONES */
/* -------------------------------------------------------------------------- */
.dashboard-form {
    background: #fdfdfd;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.dashboard-form h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #333;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-group div {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #2979ff;
    box-shadow: 0 0 0 3px rgba(41, 121, 255, 0.1);
}

.button {
    background: #2979ff;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.button:hover {
    background: #1c54b2;
    transform: translateY(-2px);
}

.button-secondary {
    background: #666;
    margin-top: 10px;
}

/* -------------------------------------------------------------------------- */
/* 4. FOOTER */
/* -------------------------------------------------------------------------- */
.footer {
    text-align: center;
    padding: 40px 0 20px;
    color: #777;
    font-size: 0.9rem;
}

.footer small {
    color: #999;
}

/* Ajuste para móviles */
@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }
}

/* -------------------------------------------------------------------------- */
/* -------------------------- RESPONSIVE ------------------------------------*/
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .main-wrapper.shifted { transform: translateX(200px); }
    .sidebar { width: 200px; }
    .main-content { padding: 15px; width: 98%; }
    h1 { font-size: 1.6rem; }
    .tabs { flex-direction: column; }
}

