/* =============================== */
/* Estilo para mensajes de error   */
/* =============================== */
.error-message {
  color: red !important;         /* Texto en rojo */
  font-size: 0.6rem !important;   /* Fuente pequeña */
  margin-left: 8px !important;    /* Espacio a la derecha */
  display: inline-block !important;
}

/* Estilo para campos obligatorios */
form label::after {
  content: " *";
  color: red;
  margin-left: 2px;
  font-weight: bold;
  font-size: 0.75em; /* Tamaño reducido respecto al texto del label */
  display: inline;
}

form label:not([for])::after {
  content: "";
}

form label:has(+ input[required]),
form label:has(+ select[required]),
form label:has(+ textarea[required]) {
  position: relative;
}

form label:has(+ input[required])::after,
form label:has(+ select[required])::after,
form label:has(+ textarea[required])::after {
  content: " *";
  color: red;
  margin-left: 2px;
  font-weight: bold;
  font-size: 0.75em; /* Mismo tamaño reducido */
}

.sticky-toolbar-custom {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(to right, #f9f9f9, #ffffff); /* Ligera diferencia para elegancia */
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #6c757d;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  backdrop-filter: blur(4px);
  font-size: 0.95rem;
  gap: 0.75rem;
  row-gap: 0.75rem;
  width: 100%; /* ✅ Hace que ocupe todo el ancho */
  flex-wrap: wrap; /* ✅ Para que se adapte en pantallas pequeñas */
  display: flex; /* ✅ Importante para que flex funcione */
}


/* Estilo uniforme para el texto del checkbox */
.form-check-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  line-height: 1.2;
  margin-left: 0.25rem;
}

/* Estilo compacto para pestañas */
.nav-tabs .nav-link {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.1;
  height: 2rem;
}

.nav-tabs {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

/* Campos de formulario compactos y elegantes tipo ERP */
.form-control,
.form-select,
textarea {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  background-color: #ffffff; /* ← corregido: blanco limpio */
  transition: all 0.2s ease-in-out;
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  line-height: 1.2;
  height: calc(1.8em + 0.6rem + 2px);
}

/* Tamaño del texto dentro del <select> y select2 */
.form-select,
select,
.select2-container--bootstrap4 .select2-selection__rendered {
  font-size: 0.85rem !important;
  line-height: 1.2 !important;
}

/* Altura y alineación de Select2 */
.select2-container--bootstrap4 .select2-selection {
  min-height: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 0.5rem !important;
}

/* Tamaño del dropdown (opciones) */
.select2-container--bootstrap4 .select2-results__option {
  font-size: 0.85rem !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
  background-color: #ffffff; /* ← blanco al enfocar también */
}

label.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #495057;
}

/* Placeholder refinado */
.form-control::placeholder {
  color: #adb5bd;
  font-style: italic;
}

/* Imágenes preview */
.preview-container img {
  border-radius: 0.25rem;
  border: 1px solid #dee2e6;
  padding: 3px;
  background-color: #fff;
}

/* Tablas estilo ERP: compactas, elegantes y legibles */
table.dataTable {
  font-size: 0.85rem;
  line-height: 1.3;
}

table.dataTable thead th {
  padding: 0.5rem 0.6rem;
  font-weight: 600;
}

table.dataTable tbody td {
  padding: 0.4rem 0.6rem;
}

/* Botones de acción dentro de las tablas */
table.dataTable .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.4rem;
  line-height: 1;
}

/* Estilo compacto para botones de DataTables */
div.dt-buttons .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.80rem;
  line-height: 1;
  border-radius: 0.25rem;
}

/* Estilo compacto para el input de búsqueda */
.dataTables_filter input {
  height: calc(1.8em + 0.4rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
  background-color: #ffffff; /* ← corregido */
}

/* Compactar el select de cantidad de registros */
div.dataTables_length label select {
  font-size: 0.85rem !important;
  padding: 0.25rem 0.4rem !important;
  height: calc(1.5em + 0.4rem + 2px) !important;
  border-radius: 0.375rem !important;
  border: 1px solid #ced4da !important;
  background-color: #ffffff !important; /* ← corregido */
  line-height: 1.2 !important;
}

.dataTables_length label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
}

/* Títulos de modal */
.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: #343a40;
}

/* Inputs y selects dentro del modal */
.modal .form-control,
.modal .form-select,
.modal textarea {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  border-radius: 0.375rem;
  background-color: #ffffff; /* ← corregido */
}

/* Botones del modal */
.modal-footer .btn,
.modal .btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
}

/* Texto dentro del modal */
.modal-body {
  font-size: 0.85rem;
  color: #495057;
}

/* Tamaño de texto para ítems del menú navbar */
.navbar-nav .nav-link {
  font-size: 1rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  color: #e0e0e0; /* Color elegante para buena visibilidad sobre el navbar */
}


/*Titulo de los formualrios*/
.titulo_blade {
  color: #2A3F54; /* Mismo color del nav */
  font-weight: 600; /* Un poco más de peso para destacar */
  font-size: 1.3rem; /* Tamaño ligeramente mayor para dar jerarquía */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}



html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    overflow-y: auto;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(135deg, #263747, #1b2733); /* combinación elegante */
  color: #fff;
  border-top: 1px solid #3a4b5c;
  padding: 5px 0;
  z-index: 1000;
  text-align: center;
  font-size: 0.9rem;
}


.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.nav-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    border-bottom: none;
    background-color: #f0f2f5;
    padding: 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

.nav-tabs .nav-link {
    background-color: #dee2e6;
    border: 1px solid #ccc;
    border-radius: 0.5rem 0.5rem 0 0;
    margin-right: 4px;
    color: #333;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
}

.nav-tabs .nav-link:hover {
    background-color: #ced4da;
}

.nav-tabs .nav-link.active {
    background-color: #fff;
    border-bottom-color: transparent;
    font-weight: 500;
}

.tab-content {
    background-color: #fff;
    border-radius: 0 0 0.5rem 0.5rem;
    border: 1px solid #ccc;
    padding: 1rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.03);
    flex: 1;
    overflow-y: hidden;
}

.btn-close-tab {
    background: transparent;
    border: none;
    font-size: 1rem;
    color: #999;
}

.btn-close-tab:hover {
    color: #dc3545;
}

/* Loader global */
#loaderOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255,255,255,0.7); /* Fondo translúcido se mantiene */
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

#loaderOverlay .spinner-border {
  color: #2A3F54; /* Color del spinner combinado con navbar y footer */
}


#loaderOverlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    .nav-tabs {
        font-size: 0.85rem;
        padding-left: 0.3rem;
    }
}

/* ================================ */
/* ESTILOS EXCLUSIVOS PARA VISTAS POWER BI */
/* ================================ */

html, body, main, #mainContent, .tab-content, .tab-pane.active {
  height: 100% !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.powerbi-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 0;  
  padding-bottom: 32px;  
  overflow: hidden;
}

.powerbi-container iframe {
  flex: 1;
  width: 100%;
  border: none;
  display: block;
}