/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --sidebar-width: 260px;
    --topbar-height: 70px;
}


/* =========================================================
   GENERAL
   ========================================================= */

html {
    font-size: 14px;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f9;
    color: #212529;
    overflow-x: hidden;
}


/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #111827;
    color: white;
    z-index: 1000;
    transition: transform 0.25s ease, opacity 0.25s ease;
}


    /* =========================================================
   SCROLL SIDEBAR
   ========================================================= */

    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.25);
        border-radius: 10px;
    }

        .sidebar::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.45);
        }


/* =========================================================
   HEADER SIDEBAR
   ========================================================= */

.sidebar-header {
    height: 75px;
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #374151;
}

.sidebar-divider {
    height: 1px;
    background: #374151;
}


/* =========================================================
   MARCA
   ========================================================= */

.brand-icon {
    font-size: 32px;
    margin-right: 10px;
}

.brand-title {
    font-weight: 700;
    font-size: 18px;
}

.brand-subtitle {
    font-size: 11px;
    color: #9ca3af;
}


/* =========================================================
   MENU
   ========================================================= */

.sidebar-menu {
    padding: 15px 10px 30px;
}

.menu-section {
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    padding: 15px 12px 7px;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 3px;
    color: #d1d5db;
    text-decoration: none;
    border-radius: 6px;
    transition: 0.2s;
}

    .menu-item:hover {
        background: #1f2937;
        color: white;
    }

.menu-icon {
    width: 24px;
    min-width: 24px;
    text-align: center;
}


/* =========================================================
   CONTENEDOR DERECHO
   ========================================================= */

.main-container {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    transition: margin-left 0.25s ease, width 0.25s ease;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    width: 100%;
    box-sizing: border-box;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.event-status {
    font-size: 13px;
    color: #4b5563;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .user-info small {
        display: block;
        color: #6b7280;
    }

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================================
   BOTÓN SIDEBAR
   ========================================================= */

.sidebar-toggle {
    border: 0;
    background: transparent;
    font-size: 24px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .sidebar-toggle:hover {
        background: #f1f3f5;
    }


/* =========================================================
   CONTENIDO
   ========================================================= */

.content {
    width: 100%;
    max-width: none;
    padding: 30px;
    box-sizing: border-box;
}


/* =========================================================
   CARDS
   ========================================================= */

.dashboard-card {
    background: white;
    border-radius: 10px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    height: 100%;
}

.dashboard-card-title {
    color: #6b7280;
    font-size: 13px;
}

.dashboard-card-value {
    font-size: 30px;
    font-weight: 700;
    margin-top: 5px;
}


/* =========================================================
   SIDEBAR COLAPSADO
   ========================================================= */

body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    opacity: 0;
}


/*
   MUY IMPORTANTE:

   Cuando se oculta el sidebar,
   quitamos completamente el margin-left
   y dejamos el contenido al 100%.
*/

body.sidebar-collapsed .main-container {
    margin-left: 0;
    width: 100%;
}


/* =========================================================
   CONTENIDO COMPLETO AL COLAPSAR
   ========================================================= */

body.sidebar-collapsed .content {
    width: 100%;
    max-width: none;
}


/* =========================================================
   CONTAINER BOOTSTRAP
   ========================================================= */

/*
   Evita que una pantalla como Llaves quede restringida
   cuando se oculta el sidebar.
*/

body.sidebar-collapsed .container-fluid {
    width: 100%;
    max-width: none;
}


/* =========================================================
   LLAVES / BRACKET
   ========================================================= */

body.sidebar-collapsed .bracket-wrapper {
    width: 100%;
    max-width: none;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    /*
       En móvil el contenido siempre ocupa toda la pantalla.
    */

    .main-container {
        margin-left: 0;
        width: 100%;
    }


    /*
       Sidebar comienza oculto fuera de pantalla.
    */

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 5px 0 20px rgba(0, 0, 0, .20);
    }


    /*
       Cuando NO está colapsado, mostramos sidebar.
    */

    body:not(.sidebar-collapsed) .sidebar {
        transform: translateX(0);
        opacity: 1;
    }


    /*
       Si está colapsado, ocultarlo.
    */

    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
        opacity: 0;
    }


    .content {
        padding: 20px;
    }
}


/* =========================================================
   MOVIL PEQUEÑO
   ========================================================= */

@media (max-width: 576px) {

    .content {
        padding: 15px;
    }

    .topbar {
        padding: 0 15px;
    }

    .topbar-right {
        gap: 10px;
    }
}
