/* styles.css */

/* Resetear márgenes y paddings predeterminados para html y body, y asegurar altura total */
html, body {
    margin: 0;
    padding: 0;
    height: 100%; /* Asegura que html y body tomen la altura completa */
    font-family: Arial, sans-serif; /* Mantener la fuente */
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body, #react-entry-point, #page-content {
    width: 100%;
    min-width: 0;
}

#page-content > .container-fluid,
#page-content .row > *,
.card,
.card-body,
.modal-content,
.modal-body {
    min-width: 0;
}

body {
    /* Las propiedades flexbox se moverán al contenedor principal de Dash en main.py */
    /* Eliminar o comentar estas líneas si no están comentadas en tu archivo */
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
    /* height: 100vh; */
    flex-direction: column; /* Mantener si aún necesitas esta dirección para algún otro contenido directo en body */
}

.Img {
    margin-bottom: 10px; /* Corregido de 10x a 10px */
    margin-top: 200px;
    width: 300px; 
    height: auto;
    display: block; 
    margin-left: auto; 
    margin-right: auto; 
}

.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.menu-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000; /* Asegura que esté encima de todo */
}

.container {
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 100%; /* fluid */
    margin: 20px auto;  
}


.container2{
    background: rgba(255, 255, 255, 0.9);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 100%; /* fluid */
    margin: 20px auto;  
}

.module-table-wrapper,
.supervisor-table-wrapper,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.module-table-wrapper .table,
.supervisor-table-wrapper .table,
.table-responsive .table {
    margin-bottom: 0;
}

.module-header-actions {
    z-index: 10 !important;
}

@media (max-width: 991.98px) {
    #page-content > .container-fluid:not(.login-screen) {
        padding: 20px 16px !important;
    }

    #page-content .module-header-actions {
        position: static !important;
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        margin-bottom: 16px;
    }

    .module-header-actions .btn {
        margin: 0 !important;
    }

    .modal-dialog {
        width: calc(100% - 24px);
        max-width: calc(100% - 24px);
        margin: 12px auto;
    }

    .modal-content {
        max-height: calc(100dvh - 24px);
    }

    .modal-body {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        gap: 8px;
    }

    .modal-footer > .d-flex {
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer .btn {
        margin: 0 !important;
    }

    .card-header,
    .modal-title,
    .modal-header {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 575.98px) {
    #page-content > .container-fluid:not(.login-screen) {
        padding: 12px !important;
    }

    .container,
    .container2 {
        padding: 16px;
    }

    #page-content .module-header-actions {
        justify-content: stretch;
    }

    .module-header-actions .btn {
        flex: 1 1 100%;
        min-height: 44px;
        white-space: normal;
    }

    #page-content > .container-fluid > .btn {
        width: 100%;
        white-space: normal;
    }

    .card-body {
        padding: 16px;
    }

    .card-body .row > [class*="col-"] {
        margin-bottom: 10px;
    }

    .modal-dialog {
        width: calc(100% - 12px);
        max-width: calc(100% - 12px);
        margin: 6px auto;
    }

    .modal-content {
        max-height: calc(100dvh - 12px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 12px;
    }

    .modal-footer .btn,
    .modal-footer > .d-flex .btn {
        flex: 1 1 140px;
        min-height: 44px;
        white-space: normal;
    }

    .modal-body .table,
    .card-body .table,
    .module-table-wrapper .table {
        font-size: 0.875rem;
    }

    .modal-body .table {
        width: max-content;
        min-width: 100%;
    }

    .modal-body .table th,
    .modal-body .table td {
        white-space: nowrap;
    }

    .table input[type="number"] {
        min-width: 76px;
    }

    .supervisor-title {
        font-size: 1.25rem;
    }

    .Img {
        margin-top: 40px;
        width: 200px;
    }

    .login-panel {
        padding: 24px !important;
    }

    .login-screen {
        min-height: 100dvh !important;
    }
}

input[type="number"] {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}


button:not(.btn):not(.btn-close) {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:not(.btn):not(.btn-close):hover {
    background: #0056b3;
}

h1 {
    color: #333;
    margin-top: 20px;
}

label {
    display: block;
    margin-top: 10px;
    font-size: 16px;
}

h2 {
    margin-top: 20px;
}


/* --- CORRECCIONES ESPECÍFICAS PARA dcc.Dropdown --- */

/* Fondo del área de selección del Dropdown (donde se muestra el valor elegido) */
.Select-control {
    background-color: #fff !important; /* Blanco opaco */
    opacity: 1 !important;
    color: #333 !important; /* <--- AÑADIDO: Color de texto oscuro para el control */
}

/* Fondo del menú desplegable de opciones */
.Select-menu-outer {
    background-color: #fff !important; /* Blanco opaco */
    opacity: 1 !important;
    z-index: 1001 !important; /* Asegurar que esté encima de otros elementos */
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #333 !important; /* <--- AÑADIDO: Color de texto oscuro para el menú */
}

/* Fondo y color de las opciones individuales en el menú */
.Select-option {
    background-color: #fff !important; /* Blanco opaco para las opciones */
    color: #333 !important; /* <--- MODIFICADO: Color de texto oscuro para que se lea bien sobre blanco */
}

/* Color del texto de la opción seleccionada */
.Select-value-label {
    color: #333 !important; /* <--- MODIFICADO: Asegurar que el texto seleccionado sea legible */
}

/* Estilo del input dentro del dropdown, donde se escribe para buscar */
.Select-input > input {
    color: #333 !important; /* <--- AÑADIDO: Asegurar que el texto que se escribe sea visible */
}

/* Color del icono de "x" para limpiar la selección */
.Select-clear-zone {
    color: #999 !important;
}

.Select-clear-zone:hover {
    color: #666 !important;
}

/* Color del icono de flecha del dropdown */
.Select-arrow-zone {
    color: #999 !important;
}

.Select-arrow {
    border-top-color: #999 !important;
}

/* Botones: layout flex global, sin alterar Bootstrap .container base */
.container.buttons,
.buttons.container {
    display: flex;
    flex-wrap: wrap;
}

.container.buttons .item,
.buttons.container .item {
    flex-grow: 1;
    flex-basis: 200px; /* unidad especificada */
}

/* Utilidades opcionales por si prefieres clases dedicadas */
.btn-flex-container {
    display: flex;
    flex-wrap: wrap;
}

.btn-flex-item {
    flex: 1 1 200px;
}

.password-visibility-toggle {
    min-width: 48px;
    font-size: 1.15rem;
    line-height: 1;
}

.provider-allocation-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.provider-allocation-table th,
.provider-allocation-table td {
    vertical-align: middle;
}

.provider-allocation-table th:first-child,
.provider-allocation-table td:first-child {
    min-width: 200px;
}

.provider-allocation-input {
    min-width: 145px;
}

/* --- ESTILOS DE IMPRESIÓN --- */
@media print {
    body * {
        visibility: hidden;
    }
    .modal.show .modal-content, .modal.show .modal-content * {
        visibility: visible;
    }
    .modal.show {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        width: 100%;
        height: auto;
        overflow: visible !important;
    }
    .modal-dialog {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Ocultar botones en la impresión */
    .modal-footer, .btn-close {
        display: none !important;
    }
}
