/* Variables globales - Adaptadas del sitio iecos.com */
:root {
    --primary-color: #004B87; /* Azul principal de iecos */
    --primary-color-dark: #003a6a; /* Azul oscuro para hover */
    --primary-color-light: #1a6ca3; /* Azul claro para elementos secundarios */
    --secondary-color: #3B3C3D; /* Gris oscuro para textos y elementos secundarios */
    --secondary-color-light: #6A6B6C; /* Gris claro para textos secundarios */
    --success-color: #28a745; /* Verde para mensajes de éxito */
    --accent-color: #F49F1F; /* Naranja para acentos - similares a detalles en iecos */
    --light-bg: #f8f9fa; /* Fondo claro */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

/* Temas */
[data-bs-theme="dark"] {
    --bs-body-bg: #1E1E1E;
    --bs-body-color: #e0e0e0;
    --sidebar-bg: #2C2C2C;
    --sidebar-color: #e0e0e0;
    --header-bg: #2C2C2C;
    --card-bg: #2C2C2C;
    --border-color: #444;
}

[data-bs-theme="light"] {
    --bs-body-bg: #f8f9fa;
    --bs-body-color: #3B3C3D;
    --sidebar-bg: #004B87;
    --sidebar-color: #ffffff;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e4e4e4;
}

/* Estilos generales */
body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--bs-body-color);
}

.wrapper {
    display: flex;
}

/* Estilos del Sidebar */
#sidebar {
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    height: 100vh;
    position: fixed;
    z-index: 999;
    transition: all var(--transition-speed);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

    #sidebar:hover {
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
    }

    #sidebar.collapsed {
        min-width: var(--sidebar-collapsed-width);
        max-width: var(--sidebar-collapsed-width);
    }

    #sidebar .sidebar-header {
        padding: 15px;
        height: var(--header-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        overflow: hidden;
    }

    #sidebar ul.components {
        padding: 20px 0;
    }

    #sidebar ul li a {
        padding: 12px 20px;
        display: flex;
        align-items: center;
        color: var(--sidebar-color);
        text-decoration: none;
        transition: all 0.3s;
        border-left: 3px solid transparent;
        overflow: hidden;
        white-space: nowrap;
    }

        #sidebar ul li a:hover {
            background: var(--primary-color-light);
            color: #fff;
            border-left: 3px solid var(--accent-color);
        }

        #sidebar ul li a.active {
            background: var(--primary-color-light);
            color: #fff;
            border-left: 3px solid var(--accent-color);
        }

        #sidebar ul li a i {
            margin-right: 15px;
            width: 20px;
            text-align: center;
            flex-shrink: 0;
        }

        /* Ajustes específicos para texto en sidebar */
        #sidebar #brand-name,
        #sidebar ul li a span,
        #sidebar .sidebar-footer button span {
            white-space: nowrap;
            opacity: 0;
            width: 0;
            overflow: hidden;
            transition: opacity var(--transition-speed);
            display: none;
        }

    #sidebar:hover #brand-name,
    #sidebar:hover ul li a span,
    #sidebar:hover .sidebar-footer button span {
        opacity: 1;
        width: auto;
        display: inline !important;
        transition: opacity var(--transition-speed);
    }

    /* Ajustes para sidebar fijo */
    #sidebar.fixed-open {
        min-width: var(--sidebar-width);
        max-width: var(--sidebar-width);
    }

        #sidebar.fixed-open #brand-name,
        #sidebar.fixed-open ul li a span,
        #sidebar.fixed-open .sidebar-footer button span {
            opacity: 1;
            width: auto;
            display: inline !important;
        }

    /* Estilos para el footer del sidebar */
    #sidebar .sidebar-footer {
        position: absolute;
        bottom: 0;
        width: 100%;
        padding: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

        #sidebar .sidebar-footer button {
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            white-space: nowrap;
            width: 100%;
            background-color: transparent;
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #fff;
        }

            #sidebar .sidebar-footer button:hover {
                background-color: #dc3545;
                border-color: #dc3545;
            }

            #sidebar .sidebar-footer button i {
                margin-right: 15px;
                flex-shrink: 0;
            }

    #sidebar.collapsed .sidebar-footer button {
        padding: 0.375rem 0;
    }

    #sidebar:hover .sidebar-footer button {
        justify-content: flex-start;
    }

/* Estilos del contenido */
#content {
    width: calc(100% - var(--sidebar-collapsed-width));
    min-height: 100vh;
    transition: all var(--transition-speed);
    margin-left: var(--sidebar-collapsed-width);
    background-color: var(--bs-body-bg);
}

    #content.expanded {
        width: calc(100% - var(--sidebar-collapsed-width));
        margin-left: var(--sidebar-collapsed-width);
    }

.header {
    height: var(--header-height);
    background: var(--header-bg);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 99;
    border-bottom: 1px solid var(--border-color);
}

.main-content {
    padding: 20px;
}

/* Estilos de tarjetas adaptados para coincidir con iecos.com */
.card {
    border-radius: 4px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
}

    .card-header.bg-light {
        background-color: rgba(0, 0, 0, 0.03) !important;
    }

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

    .btn-primary:hover, .btn-primary:focus {
        background-color: var(--primary-color-dark) !important;
        border-color: var(--primary-color-dark) !important;
    }

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Theme switcher */
.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

    .theme-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 26px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: .4s;
        border-radius: 50%;
    }

input:checked + .slider {
    background-color: var(--primary-color);
}

    input:checked + .slider:before {
        transform: translateX(26px);
    }

.theme-icon {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    align-items: center;
    height: 100%;
}

/* Responsiveness */
.mobile-header {
    display: none;
}

/* Media queries para responsividad */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
    }

        #sidebar.collapsed {
            margin-left: 0;
            min-width: var(--sidebar-width);
            max-width: var(--sidebar-width);
        }

            #sidebar.collapsed #brand-name,
            #sidebar.collapsed ul li a span,
            #sidebar.collapsed .sidebar-footer button span {
                opacity: 1;
                width: auto;
                display: inline !important;
            }

    #content {
        width: 100%;
        margin-left: 0;
    }

        #content.expanded {
            width: 100%;
            margin-left: 0;
        }

    .mobile-header {
        display: flex !important;
    }
}

/* Estilos para las páginas de autenticación */
.auth-page {
    background-color: var(--light-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.auth-card {
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

    .auth-card .card-body {
        padding: 0;
    }

.auth-side-bg {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
}

.auth-form-side {
    padding: 2rem;
}

.logo {
    max-width: 20% !important;
    height: 30% !important;
    border-radius: 50%;
}

/* Elementos adicionales adaptados al estilo de iecos.com */
.badge {
    font-weight: 500;
    padding: 0.4em 0.6em;
}

    .badge.bg-primary {
        background-color: var(--primary-color) !important;
    }

    .badge.bg-success {
        background-color: var(--success-color) !important;
    }

    .badge.bg-info {
        background-color: var(--primary-color-light) !important;
    }

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(0, 75, 135, 0.25);
}

a {
    color: var(--primary-color);
}

    a:hover {
        color: var(--primary-color-dark);
    }


.toast-top-right {
    top: 70px;
    right: 12px;
}

#toast-container > div {
    opacity: 0.95;
    box-shadow: 0 0 12px rgba(0,0,0,0.2) !important;
    -moz-box-shadow: 0 0 12px rgba(0,0,0,0.2) !important;
    -webkit-box-shadow: 0 0 12px rgba(0,0,0,0.2) !important;
}

#toast-container > .toast-success {
    background-color: #51a351;
}

#toast-container > .toast-error {
    background-color: #bd362f;
}

#toast-container > .toast-info {
    background-color: #2f96b4;
}

#toast-container > .toast-warning {
    background-color: #f89406;
}

.toast-message {
    font-size: 14px;
    line-height: 1.4;
}

.toast-title {
    font-weight: bold;
    font-size: 16px;
}

/* Estilos existentes de Select2 */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    min-height: 80px;
    padding: 6px 8px;
    display: block;
}

    .select2-container--default .select2-selection--multiple .select2-selection__rendered {
        display: block;
        box-sizing: border-box;
        list-style: none;
        margin: 0;
        padding: 0;
        width: 100%;
        min-height: 60px;
    }

    .select2-container--default .select2-selection--multiple .select2-selection__choice {
        background-color: #0d6efd;
        border: none;
        color: white;
        padding: 3px 8px;
        margin: 4px 4px 4px 0;
        border-radius: 4px;
        float: left;
        position: relative;
        max-width: calc(100% - 10px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

.select2-container--default .select2-search--inline .select2-search__field {
    box-sizing: border-box;
    min-width: 100px;
    width: auto !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 6px;
    font-weight: bold;
}

    .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
        color: #ffffff;
    }

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd;
}

.select2-dropdown {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.action-buttons {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.action-button {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .action-button i {
        margin-right: 5px;
    }

.select-all-btn {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
}

    .select-all-btn:hover {
        background-color: rgba(13, 110, 253, 0.2);
    }

.clear-all-btn {
    color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
    border: 1px solid rgba(108, 117, 125, 0.2);
}

    .clear-all-btn:hover {
        background-color: rgba(108, 117, 125, 0.2);
    }

.employee-counter {
    display: inline-block;
    padding: 4px 8px;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-top: 6px;
}

.required::after {
    content: " *";
    color: red;
}

.employee-selection-area {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}
