/* Variables de color y tipografﾃｭa */
:root {
    --primario: #d63384;
    --primario-hover: #be185d;
    --fondo: #f1f5f9;
    --texto-oscuro: #1e293b;
    --texto-claro: #64748b;
    --blanco: #ffffff;
    --borde: #e2e8f0;
    --error-bg: #fef2f2;
    --error-texto: #b91c1c;
    /* Variables nuevas para el sidebar */
    --sidebar-bg: #1e293b;
    --sidebar-bg-hover: #334155;
    --sidebar-texto: #cbd5e1;
}

/* ERROR CORREGIDO: Se cambiﾃｳ el "-" por "*" */
* {
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--fondo);
    color: var(--texto-oscuro);
    min-height: 100vh;
}

/* Sistema de Login */
.contenedor-centrado {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.tarjeta {
    background: var(--blanco);
    padding: 30px 25px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
}

.text-center { text-align: center; }
.titulo-logo { color: var(--primario); font-size: 32px; font-weight: 900; margin-bottom: 5px; }
.subtitulo { color: var(--texto-claro); font-size: 14px; margin-bottom: 25px; font-weight: 600; }

/* Formularios */
.grupo-form { margin-bottom: 20px; text-align: left; position: relative; }
.grupo-form label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.input-control {
    width: 100%;
    padding: 14px 15px;
    border: 1.5px solid var(--borde);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}
.input-control:focus {
    border-color: var(--primario);
    outline: none;
    box-shadow: 0 0 0 3px rgba(214,51,132,0.1);
}

/* Botones */
.btn-principal {
    width: 100%;
    padding: 15px;
    background-color: var(--primario);
    color: var(--blanco);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-principal:hover { background-color: var(--primario-hover); }
.btn-principal:disabled { background-color: #94a3b8; cursor: not-allowed; }

/* Alertas */
.alerta {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}
.alerta-error {
    background-color: var(--error-bg);
    color: var(--error-texto);
    border: 1px solid #fecaca;
}
.oculto { display: none; }

/* =========================================
   DISEﾃ前 MODERNO DEL SIDEBAR
   ========================================= */
.sidebar {
    position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
    background: #0f172a; color: #cbd5e1;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000; box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    display: flex; flex-direction: column; overflow-y: auto;
}
.sidebar.activo { left: 0; }

.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(3px);
    z-index: 999; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.sidebar-overlay.activo { opacity: 1; visibility: visible; }

.sidebar-header {
    padding: 25px 20px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid #1e293b;
}
.sidebar-header h2 { color: white; font-weight: 900; margin: 0; font-size: 22px; }
.btn-cerrar-menu {
    background: rgba(255,255,255,0.1); border: none; color: white;
    font-size: 20px; width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
}
.btn-cerrar-menu:hover { background: var(--primario); }

/* PERFIL - Forzando display en mﾃｳviles */
.sidebar-perfil { 
    padding: 20px; text-align: center; border-bottom: 1px solid #1e293b; 
    display: flex !important; flex-direction: column; align-items: center; 
}
.perfil-avatar {
    width: 60px; height: 60px; background: linear-gradient(135deg, var(--primario), #f59e0b);
    border-radius: 50%; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: bold; color: white; box-shadow: 0 4px 10px rgba(214, 51, 132, 0.3);
}
.perfil-nombre { color: white; font-weight: 700; font-size: 15px; text-transform: uppercase; margin-bottom: 3px; }
.perfil-rol { font-size: 12px; color: #94a3b8; margin-top: 0; }

/* MENU */
.sidebar-menu { list-style: none; padding: 15px; margin: 0; flex-grow: 1; }
.sidebar-menu li { margin-bottom: 5px; }
.sidebar-menu a {
    display: flex; align-items: center; padding: 12px 15px; color: #94a3b8;
    text-decoration: none; font-size: 14px; font-weight: 600; border-radius: 10px; transition: all 0.3s;
}

/* Selector arreglado para FontAwesome (la etiqueta i) */
.sidebar-menu a .icono {
    font-size: 18px; width: 25px; display: inline-block; margin-right: 10px; text-align: center; transition: 0.3s;
}

.sidebar-menu a:hover { background: rgba(255, 255, 255, 0.05); color: white; transform: translateX(5px); }
.sidebar-menu a:hover .icono { transform: scale(1.2); color: var(--primario); }

.sidebar-menu li.separador { height: 1px; background: #1e293b; margin: 15px 0; }
.menu-bloqueado { opacity: 0.5; cursor: not-allowed !important; }
.menu-bloqueado:hover { transform: none !important; background: transparent !important; }

/* PC */
@media (min-width: 769px) {
    .sidebar { left: 0; }
    .sidebar-overlay { display: none; }
    .btn-cerrar-menu { display: none; }
    .contenido-principal { margin-left: 280px; }
}


/* =========================================
   ESTRUCTURA PRINCIPAL Y TOP-BAR
   ========================================= */
.contenedor-layout {
    display: flex;
    min-height: 100vh;
}

.contenido-principal {
    flex: 1;
    width: 100%;
    transition: margin-left 0.4s;
    /* En celular, el margin-left es 0. En PC se sobreescribe a 280px con el @media que ya tienes */
}

/* Cabecera Móvil y PC */
.top-bar {
    background: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    border-radius: 0 0 15px 15px;
}

.btn-menu-movil {
    background: #f1f5f9;
    border: none;
    font-size: 20px;
    color: #334155;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: 0.2s;
}
.btn-menu-movil:hover {
    background: var(--primario);
    color: white;
}

/* Ocultar botón de menú en PC */
@media (min-width: 769px) {
    .btn-menu-movil { display: none; }
    .top-bar { border-radius: 0; }
}