/* ==========================
   Variables globales
========================== */
:root {
    --color-bg: #f0f0f0;
    --color-bg-secondary: #ffffff;
    --color-text: #111111;
    --color-primary: #F8AE12;
    --color-border: #e0e0e0;
    --color-hover: rgba(0, 0, 0, 0.05);
    --color-submenu-line: #dcdcdc;
    --transition: 0.25s ease;
    --radius-md: 10px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark {
    --color-bg: #1c1c1c;
    --color-bg-secondary: #232323;
    --color-text: #f5f5f5;
    --color-border: #333;
    --color-hover: rgba(255, 255, 255, 0.06);
    --color-submenu-line: #3a3a3a;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

/* ==========================
   Layout base
========================== */
body {
    margin: 0;
    font-family: "DM Sans", "Poppins", sans-serif;
    letter-spacing: -0.02em;
    background-color: var(--color-bg);
    color: var(--color-text);
    display: flex;
    height: 100vh;
    transition: background var(--transition), color var(--transition);
}

/* Sidebar */
.sidebar {
    width: 330px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow);
    transition: background var(--transition), color var(--transition);
}

.sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ===== Brand / Título principal ===== */
.brand-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text);
    height: 50px;
}

.logo {
    color: var(--color-primary);
    font-size: 1.5rem;
}

/* ===== Menú ===== */
.menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.5rem;
    box-sizing: border-box;
}

.menu i,
.user-profile i {
    font-size: 1.3rem;
}

.menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li {
    margin-bottom: 0.4rem;
}

.menu a,
.menu button {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    text-decoration: none;
    color: var(--color-text);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    box-sizing: border-box;
}

.menu a:hover,
.menu button:hover {
    background: var(--color-hover);
    backdrop-filter: blur(2px);
    font-weight: 600;
}

/* ===== SUBMENÚ ===== */
.submenu {
    width: 90%;
    list-style: none;
    margin: 0.3rem 0 0.3rem 0;
    padding-left: 0;
    border-left: 2px solid var(--color-submenu-line);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
    position: relative;
    left: 1.4rem;
}

.submenu a {
    display: block;
    padding: 0.45rem 0.8rem;
    margin: 0 auto;
    border-radius: var(--radius-md);
    width: 90%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    position: relative;
}

.submenu a:hover {
    background: var(--color-hover);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 90%;
}
.sidebar {
    overflow-x: hidden !important;
}

/* Desplegado */
.has-submenu.open .submenu {
    max-height: 270px;
    opacity: 1;
    transform: translateY(0);
}

.arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.has-submenu.open .arrow {
    transform: rotate(180deg);
}

/* ==========================
   Footer del sidebar
========================== */
.sidebar-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    padding-bottom: 0.5rem;
    transition: background var(--transition), color var(--transition);
}

/* Switch modo oscuro */
.theme-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0.2rem 0.3rem 1rem 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 22px;
    cursor: pointer;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Usuario */
.user-profile {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem; 
    padding: 0.2rem 0.8rem; 
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    transition: background var(--transition), color var(--transition);
}

.user-profile i {
    font-size: 1.6rem;
    color: var(--color-primary); 
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    margin-top: -2px;
    flex-grow: 1; 
}

.user-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--color-text);
    margin: 0;
}

.user-rol {
    font-size: 0.8rem;
    color: rgba(127, 127, 127, 0.8);
    margin: 0;
}


/* ==========================
   Navbar móvil
========================== */
.navbar {
    display: none;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.hamburger {
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1.5rem;
}

/* ==========================
   Contenido
========================== */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--color-bg);
    transition: background var(--transition);
}

/* ==========================
   Responsive
========================== */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left var(--transition);
    }

    .sidebar.active {
        left: 0;
    }

    .navbar {
        display: flex;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1100;
    }

    .content {
        padding-top: 70px;
    }

    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 900;
    }
}

.hidden {
    display: none !important;
}
a{
    text-decoration: none;
}

/* ======== MAIN GENERAL ======== */
main#content {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 60px);
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

* {
    box-sizing: border-box;
}

.btn-logout {
    margin-left: auto;
    background: none;
    rotate: 180deg;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    transition: background var(--transition), color var(--transition);
}
.btn-logout i {
    color: #d9534f;
}

/*botn de desasignacion*/
.btn-desasignar {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-desasignar:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

.btn-desasignar:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(220, 53, 69, 0.3);
}

/*estilos extras qu epueden o no quedarse*/
    .btn-group{
        padding: 20px;
    }

    .btn-selector {
        flex: 1;
        font-weight: 600;
        padding: 10px;
        border-radius: 6px ;
        margin: 8 40px;
        transition: 0.15s ease-in-out;
    }

    .btn-selector:hover {
        background: #318ac9;
        color: #fff;
    }

    .btn-selector.active {
        background: #318ac9 !important;
        color: #fff !important;
        border-color: #318ac9 !important;
        box-shadow: 0 0 10px rgba(13,110,253,.4);
    }

    .form-actions {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

     .form-container {
        max-width: 700px;
        margin: 0 auto;
    }

    /* Inputs con estilo moderno */
    .form-control, .form-check-input, select {
        border-radius: 8px;
        padding: 10px;
        border: 1px solid #ced4da;
        transition: all 0.2s ease-in-out;
        background-color: #fff;
    }

    .form-control:focus, select:focus {
        border-color: #0d6efd;
        box-shadow: 0 0 8px rgba(13,110,253,.3);
    }

    /* Bordes y espaciado de secciones */
    .form-group {
        margin-bottom: 20px;
    }

    /* Botones centrados */
    .form-actions {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin-top: 25px;
    }

    /* Checkbox alineado mejor */
    .form-check-label {
        margin-left: 6px;
        font-weight: 500;
    }
    /* Checkbox Moderno */
.form-check-input {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #6c757d;
    transition: all .2s ease-in-out;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 0 6px rgba(13,110,253,.5);
}

.form-check-label {
    margin-left: 8px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
}

/* Efecto al pasar el mouse */
.form-check-input:hover {
    border-color: #0d6efd;
}

.btn-exportar-excel {
    background: #0A6E39;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-exportar-excel:hover {
    background: #088445;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 110, 57, 0.3);
}