:root {
    /* Color extraído del logo */
    --brand-purple: #5c4199; 
    --brand-purple-dark: #453173;
    --brand-light: #f4f6f9;
}

body {
    background-color: var(--brand-light);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* --- ESTILOS DEL LOGIN --- */
.login-page {
    background-color: var(--brand-purple);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-logo {
    max-width: 70%;
    height: auto;
    border-radius: 8px;
}

.btn-brand {
    background-color: var(--brand-purple);
    color: white;
    border: none;
}

.btn-brand:hover {
    background-color: var(--brand-purple-dark);
    color: white;
}

/* --- ESTILOS DEL DASHBOARD --- */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* Menú Lateral (Sidebar) */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--brand-purple);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: var(--brand-purple);
    text-align: center;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

#sidebar .sidebar-logo {
    max-width: 90%;
    border-radius: 5px;
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 12px 20px;
    font-size: 1.1em;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: 0.2s;
}

#sidebar ul li a:hover, #sidebar ul li.active > a {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left: 4px solid #fff;
}

#sidebar ul li a i {
    margin-right: 10px;
}

/* Contenido Principal */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 10px 20px;
}

.avatar-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--brand-purple);
}

.cursor-pointer {
    cursor: pointer;
}

/* Footer General */
.app-footer {
    margin-top: auto;
    background: #fff;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
}

.app-footer a {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: bold;
}

/* Responsividad del Sidebar */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        position: fixed;
        z-index: 999;
    }
    #sidebar.active {
        margin-left: 0;
    }
}

/* ESTILOS GENERALES */
.input-system {
    border: 1px solid #453173;    
}

.btn-table {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.form-check-input:checked {
    background-color: var(--brand-purple-dark);
    border-color:var(--brand-purple-dark);
}

/* Opcional: Cambia el color del resplandor (foco) */
.form-check-input:focus {
    border-color:var(--brand-purple);
}

.form-check-input{
   border-color: var(--brand-purple);
}

.form-check-input, 
.form-check-label {
  cursor: pointer;
}

/* Corrección de Select2 dentro de Bootstrap 5 Input Group */
.input-group > .select2-container {
    flex: 1 1 auto;
    width: auto !important;
}

.input-group > .select2-container .select2-selection--single {
    height: 38px; /* Ajusta según la altura de tus inputs */
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    display: flex;
    align-items: center;
}

/* Borde personalizado para Select2 */
.input-group > .select2-container .select2-selection--single {
    border: 1px solid #453173 !important; /* Tu color personalizado */
    height: 38px; 
    padding: 0.375rem 0.75rem;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    display: flex;
    align-items: center;
}

/* Efecto focus (cuando el usuario hace clic o abre el select) */
.input-group > .select2-container--open .select2-selection--single,
.input-group > .select2-container--focus .select2-selection--single {
    border: 1px solid #453173 !important;
    /* Opcional: una sombra sutil del mismo color al hacer clic, estilo Bootstrap */
    box-shadow: 0 0 0 0.25rem rgba(69, 49, 115, 0.25) !important; 
}

/* Alineación interna del texto y la flecha */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 0;
    color: #495057;
    line-height: normal;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 10px;
}

/* Forzar a Select2 a comportarse como un input normal en el input-group */
.input-group > .select2-container {
    flex: 1 1 auto;
    width: 1% !important; /* El truco mágico de Bootstrap para inputs */
}

/* Evitar que el texto largo rompa el diseño y usar puntos suspensivos (...) */
.select2-container .select2-selection--single .select2-selection__rendered {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-right: 30px; /* Asegura que el texto no se monte sobre la flecha */
}

/* Opcional: Ajustar la altura para que coincida perfectamente con el botón de Bootstrap 5 */
.select2-container .select2-selection--single {
    height: calc(3.5rem + 2px); /* Ajusta este valor si usas inputs más pequeños como form-control-sm */
    display: flex;
    align-items: center;
}


