/* ==========================================
   VARIABLES Y BASE
   ========================================== */
:root {
    --sidebar-bg: #1e293b;
    --sidebar-active: rgba(255, 255, 255, 0.1);
    --main-bg: #f8fafc;
    --accent: #3b82f6;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
    /* Colores para acciones */
    --color-edit: #0ea5e9;    /* Celeste vibrante */
    --color-delete: #f43f5e;  /* Rojo coral */
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--main-bg);
    margin: 0;
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ==========================================
   SIDEBAR (CORREGIDO PARA EVITAR BLOQUEOS)
   ========================================== */
.sidebar {
    width: 80px; 
    height: 100vh;
    background-color: var(--sidebar-bg) !important;
    color: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 4px 0 10px rgba(0,0,0,0.05);
    z-index: 1050; /* Un poco más alto que el estándar */
}

.sidebar-brand {
    height: 80px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-link {
    color: rgba(255, 255, 255, 0.7) !important; /* Más brillo */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

/* Hover solo en PC */
@media (hover: hover) {
    .nav-link:hover {
        color: var(--white) !important;
        background-color: var(--sidebar-active);
    }
}

.nav-link.active {
    color: var(--white) !important;
    background-color: var(--sidebar-active);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 4px;
    background-color: var(--accent);
    border-radius: 0 4px 4px 0;
}

/* ==========================================
   CONTENIDO PRINCIPAL
   ========================================== */
.content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    background-color: var(--main-bg);
}

/* ==========================================
   TARJETAS Y TABLAS
   ========================================== */
.data-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    margin-bottom: 2rem;
}

.table thead th {
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

/* ==========================================
   BOTONES DE ACCIÓN
   ========================================== */
.btn-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--white) !important;
    transition: all 0.2s ease;
}

.bg-edit     { background-color: var(--color-edit) !important; }
.bg-delete   { background-color: var(--color-delete) !important; }

/* ==========================================
   SOLUCIÓN AL MENÚ OPACO / BLOQUEADO (MÓVIL)
   ========================================== */

/* 1. Eliminar la sombra oscura que bloquea la vista al navegar */
.offcanvas-backdrop {
    display: none !important; /* Desactiva la capa negra por completo */
}

/* 2. Evitar que el cuerpo quede bloqueado (sin scroll) al cerrar el menú */
body.offcanvas-open, 
body[style*="overflow: hidden"] {
    overflow: auto !important;
    padding-right: 0 !important;
}

@media (max-width: 768px) {
    body { flex-direction: column; }

    .content {
        padding: 1.5rem 1rem;
        height: calc(100vh - 72px);
    }

    /* AQUÍ SE APLICÓ LA CORRECCIÓN DE ALINEACIÓN PARA MÓVILES */
    .sidebar.offcanvas-md {
        width: 250px !important; /* Hacemos el menú un poco más angosto para que no ocupe toda la pantalla */
        background-color: var(--sidebar-bg) !important;
    }

    .sidebar .nav-link {
        justify-content: flex-start;
        padding: 1rem 1.5rem; /* Reducimos el espacio a los lados para alinear a la izquierda */
        gap: 15px; /* Forzamos una separación exacta e igual entre el icono y el texto */
    }

    /* Forzar que el sidebar móvil esté siempre encima pero sin sombra */
    .offcanvas {
        box-shadow: 10px 0 30px rgba(0,0,0,0.2) !important;
    }
}