:root,
[data-bs-theme=light] {
    --bs-primary: #3b3b3b; /* Black Olive */
    --bs-secondary: #d6d8db; /* Gainsboro */

    --bs-primary-rgb: 59, 59, 59;
    --bs-secondary-rgb: 214, 216, 219;

    --bs-primary-text-emphasis: #1e1e1e;
    --bs-secondary-text-emphasis: #8d8f91;

    --bs-primary-bg-subtle: #e4e4e4;
    --bs-secondary-bg-subtle: #f4f5f6;

    --bs-primary-border-subtle: #b3b3b3;
    --bs-secondary-border-subtle: #e0e1e2;

    --bs-link-color: #3b3b3b;
    --bs-link-hover-color: var(--bs-primary-text-emphasis);
}

.dropdown-menu {
    --bs-dropdown-link-active-bg: #3b3b3b; /* Black Olive */
    --bs-dropdown-link-hover-bg: #e4e4e4; /* Light Gray */
}

.pagination {
    --bs-pagination-focus-box-shadow: not set;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #3b3b3b; /* Black Olive */
    --bs-btn-border-color: #3b3b3b;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #2e2e2e;
    --bs-btn-hover-border-color: #292929;
    --bs-btn-focus-shadow-rgb: 91, 91, 91;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #292929;
    --bs-btn-active-border-color: #252525;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #9f9f9f;
    --bs-btn-disabled-bg: #3b3b3b;
    --bs-btn-disabled-border-color: #3b3b3b;
}

.btn-outline-primary {
    --bs-btn-color: #3b3b3b;
    --bs-btn-border-color: #3b3b3b;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #3b3b3b;
    --bs-btn-hover-border-color: #3b3b3b;
    --bs-btn-focus-shadow-rgb: 59, 59, 59;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #2e2e2e;
    --bs-btn-active-border-color: #2e2e2e;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #9f9f9f;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #3b3b3b;
    --bs-gradient: none;
}

.btn-secondary {
    --bs-btn-color: #000;
    --bs-btn-bg: #d6d8db; /* Gainsboro */
    --bs-btn-border-color: #d6d8db;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #c0c2c4;
    --bs-btn-hover-border-color: #b7b9bb;
    --bs-btn-focus-shadow-rgb: 180, 182, 184;
    --bs-btn-active-color: #000;
    --bs-btn-active-bg: #b7b9bb;
    --bs-btn-active-border-color: #aeb0b2;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #9f9f9f;
    --bs-btn-disabled-bg: #d6d8db;
    --bs-btn-disabled-border-color: #d6d8db;
}

.btn-outline-secondary {
    --bs-btn-color: #626262; /** No se puede usar el d6d8db porque es muy clarito y no se lee */
    --bs-btn-border-color: #d6d8db;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #d6d8db;
    --bs-btn-hover-border-color: #d6d8db;
    --bs-btn-focus-shadow-rgb: 214, 216, 219;
    --bs-btn-active-color: #000;
    --bs-btn-active-bg: #c0c2c4;
    --bs-btn-active-border-color: #c0c2c4;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #9f9f9f;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #d6d8db;
    --bs-gradient: none;
}

.btn-link {
    --bs-btn-font-weight: 400;
    --bs-btn-color: var(--bs-primary);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--bs-primary-text-emphasis);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-color: var(--bs-primary-text-emphasis);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-color: #d6d8db;
    --bs-btn-disabled-border-color: transparent;
    --bs-btn-box-shadow: 0 0 0 #000;
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    text-decoration: underline;
}

.card-light,
.bg-light,
.text-bg-light {
    --lte-card-variant-bg: #f0f0f0;
    --lte-card-variant-bg-rgb: 240, 240, 240;
    --lte-card-variant-color: #000;
    --lte-card-variant-color-rgb: 0, 0, 0;
}

html, body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

.navbar .btn-link {
    color: rgb(96, 107, 133);
    text-decoration: none;
}

.sidebar-wrapper .nav-treeview > .nav-item > .nav-link {
    font-size: 12px;
    /*padding-left: 21px;*/
}

.btn-company-select {
    box-sizing: border-box;
    padding: 0.25rem 0.5rem;
    min-width: 0px;
    -webkit-box-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    align-items: center;
    border: unset;
    border-radius: 4px;
    column-gap: 0.25rem;
    display: flex;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
    max-width: max-content;
    appearance: none;
    background: none rgb(255, 255, 255);
    outline: none;
    font-family: inherit;
    position: relative;
    color: rgb(18, 28, 45);
    box-shadow: rgb(225, 227, 234) 0px 0px 0px 1px;
}

.dropdown-menu {
    font-size: 13px;
    padding: 0px 0px 0px 0px;
}

footer {
    background-color: #f8f9fa;
    padding: 1rem;
    text-align: center;
}

.form-input, .form-control {
    font-size: 13px;
    padding: 3px 0px 3px 7px;
}

.form-select {
    font-size: 13px;
    background-position: right;
    padding: 3px 15px 3px 7px;
}

.form-label {
    margin-bottom: 3px;
    font-size: 14px;
}

.select2-container--default .select2-results__option, .select2-selection__rendered {
    font-size: 13px; /* Ajusta el tamaño de fuente según lo necesites */
}
.select2-container--open {
    z-index: 9999; /* Asegura que el dropdown esté por encima en los popups */
}


i.bi-exclamation-triangle-fill, i.bi.bi-x-circle-fill {
    color: red;
}

.style-badge {
    color: #000 !important;
    font-weight: 400 !important;
}

@media (max-width: 540px) {
    .c-cabecera-tabla {
        flex-direction: column;
        align-items: center;
        font-weight: bold;
    }

    .c-cabecera-tabla br {
        content: "";
        display: block;
        line-height: 0.5;
        margin: 0.25rem 0;
    }

    .c-cargando-loading {
        justify-content: center !important;
    }
}

/* Estilos para el menú de usuario */
.user-menu .dropdown-menu {
    width: 280px;
    padding: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}

.user-menu .user-header {
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Estilos para el selector de empresa */
.company-selector {
    transition: all 0.2s ease;
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

.company-selector:hover, .company-selector:focus {
    background-color: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
}

.company-badge {
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

/* Limitar ancho del nombre de empresa y añadir ellipsis si es muy largo */
.company-name {
    max-width: 210px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

@media (max-width: 768px) {
    .company-name {
        max-width: 100px;
    }
}

/* Pagination styles */
.pagination-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.pagination {
    margin-bottom: 0;
}

/* Style for active page in pagination */
.pagination .page-item.active .page-link {
    background-color: var(--bs-secondary) !important;
    color: #fff !important;
    border-color: var(--bs-secondary) !important;
    z-index: 3;
}

.student-row-completed > td,
.student-row-completed > th {
    background-color: #e6f9ec !important; /* verde más claro */
}
.student-row-inprogress > td,
.student-row-inprogress > th {
    background-color: #fffbe6 !important; /* amarillo muy claro */
}
.student-row-notstarted > td,
.student-row-notstarted > th {
    background-color: #ffeaea !important; /* rojo más claro */
}
@media (max-width: 768px) {
    .pagination-container {
        flex-wrap: wrap;
    }

    .pagination-container > div {
        margin-bottom: 0.5rem;
    }
}

.status-dot {
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.3em;
}
/* Colores pastel personalizados */
.status-dot[style*="background-color:pastel-blue"] { background-color: #6fa8dc !important; }
.status-dot[style*="background-color:pastel-yellow"] { background-color: #ffe599 !important; }
.status-dot[style*="background-color:teal"] { background-color: #20c997 !important; }
.status-dot[style*="background-color:green"] { background-color: #28a745 !important; }
.status-dot[style*="background-color:orange"] { background-color: #f6b26b !important; }
.status-dot[style*="background-color:red"] { background-color: #dc3545 !important; }
.status-dot[style*="background-color:gray"] { background-color: #adb5bd !important; }

/* Business page */
.business-table .business-name {
    line-height: 1.2;
}

.business-table .business-cif {
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
}

.business-detail-field {
    display: flex;
    gap: 0.35rem;
    align-items: baseline;
}

.business-detail-label {
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.business-detail-value {
    word-break: break-word;
}

.business-edit-section {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: var(--bs-body-bg);
}

.business-edit-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

@media (max-width: 576px) {
    .business-edit-section {
        padding: 0.85rem;
    }
}

@media (max-width: 768px) {
    #businesses.responsive-stack thead {
        display: none;
    }

    #businesses.responsive-stack tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 0.75rem;
        padding: 0.5rem 0.75rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    }

    #businesses.responsive-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--bs-border-color);
        padding: 0.35rem 0;
    }

    #businesses.responsive-stack tbody td:first-child {
        border-top: none;
    }

    #businesses.responsive-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--bs-secondary-color);
        margin-right: 0.75rem;
        text-transform: none;
    }

    #businesses.responsive-stack tbody td[data-label="Acciones"] {
        justify-content: flex-start;
    }
}

.layout-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease-out;
}

.layout-loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-content .spinner-border {
    border-width: 0.3rem;
}

.loading-content p {
    font-size: 1rem;
    margin: 0;
}
