
/* Google Fonts Import Link */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0; /* Color de fondo opcional */
    box-sizing: border-box; /* Asegura que el padding y border se incluyan en el tamaño total del elemento */
    overflow-y: scroll;
}

h1 {
    text-align: left; /* Alinea el título a la izquierda */
    top: -50px;
    font-size: 18px; /* Ajusta el tamaño de la fuente del título */
    color: #265da3; /* Color del texto del título */
    margin-left: 15px; /* Ajusta el espacio desde el borde izquierdo */
    position: relative;
}

.container {
    flex-direction: column; /* Alinea los elementos en una columna */
    justify-content: center; /* Centra el formulario verticalmente */
    top: 30px;
    position: relative;
    margin-left: 15px;
    max-width: 92%;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: calc(100% - 290px); /* Ajusta el ancho del formulario */
    transition: all 0.5s ease;
    left: 250px;
    box-sizing: border-box; /* Incluye padding y border en el tamaño total */
    border-radius: 10px;
}

.sidebar.close ~  .container {
    left: 70px;
    width: calc(100% - 60px); /* Ajusta el ancho para el espacio restante */
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.container header {
    border-collapse: collapse;
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h2 {
    margin: 0;
}

button {
    padding: 8px 10px;
    border: none;
    border-radius: 5px;
    background-color: #747f8b;
    color: white;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #0056b3;
}

.search-bar {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

#search-input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 5px;
    flex: none; /* Desactiva el comportamiento flexible */
    width: 400px; /* Ajusta el ancho según tus necesidades */
}

#search-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 10px;
}

#search-btn i {
    font-size: 20px;
    color: #007bff;
}

#search-btn:hover i {
    color: #0056b3;
}

.table-container {
    overflow-x: auto;
    margin-top: -25px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background: #132d52;
    color: #f5f7f8;
    font-size: 14px;
}

/* Estilos para los botones de acciones en la tabla */
.action-buttons button {
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    margin-right: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: auto;
}

.action-buttons button i,
.action-buttons button svg {
    font-size: 15px;
    width: 15px;
    height: 15px;
    line-height: 1;
}

/* Botón de editar (azul) */
.btn-edit {
    background: linear-gradient(135deg, #004080 0%, #004080 100%);
    color: white;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 142, 145, 0.4);
}

/* Botón de eliminar (rojo) */
.btn-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 206, 206, 0.4);
}

/* Botón de ver (gris) */
.btn-ver {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-ver:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}




/* Estilo específico para el botón de agregar */
#add-conceptos-btn {
    padding: 8px 20px;
    background-color: #717572; /* Verde para el agregar */
    color: white;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
}

#add-conceptos-btn:hover {
    background-color: #218838; /* Verde más oscuro */
}

/* Estilo para los íconos dentro de los botones */
.edit-btn i, .delete-btn i {
    font-size: 16px; /* Tamaño de icono adecuado */
}

/* Estilos para el Modal */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    overflow-y: auto;
    backdrop-filter: blur(3px);
    padding-top: 50px;
}

/* Contenedor principal del modal */
.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 15px;
    width: 50%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: slideDown 0.3s ease;
}

/* Animación suave al abrir */
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Título del modal */
.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #265da3;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

/* Estilos para los formularios */
.form-group_1 {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

/* ===== Multiempresa: selector de empresas (modales usuarios) ===== */
.ts-empresas-box {
    max-height: 200px;
    overflow: auto;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    background: #fff;
}

@media (max-width: 700px) {
    .ts-empresas-box {
        grid-template-columns: 1fr;
    }
}

.ts-empresa-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

.ts-empresa-item input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}

.ts-empresa-nombre {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.15;
}

.form-group_1 label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 13px;
}

.form-group_1 input,
.form-group_1 select {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
}

.form-group_1 input:focus,
.form-group_1 select:focus {
    outline: none;
    border-color: #265da3;
    box-shadow: 0 0 0 3px rgba(38, 93, 163, 0.1);
}

/* Botón cerrar mejorado */
.Cerrar {
    color: #999;
    float: right;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    line-height: 20px;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: transparent;
}

.Cerrar:hover {
    color: #fff;
    background-color: #dc3545;
    transform: rotate(90deg);
}

/* Botones dentro del modal */
.modal-content button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

button[type="submit"] {
    background-color: #265da3;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

button[type="submit"]:hover {
    background-color: #1a4378;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(38, 93, 163, 0.3);
}

/* Estilo general para los controles de paginación */
.pagination {
    margin: 20px 0;
    text-align: center;
}

/* Eliminar el subrayado de los enlaces dentro de los botones */
.pagination button a {
    text-decoration: none; /* Remueve el subrayado */
    color: inherit;        /* El enlace hereda el color del texto del botón */
}

.pagination-btn {
    padding: 10px 18px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    margin: 0 5px;
}

.pagination-btn:hover {
    background-color: #0056b3;
}

.pagination-btn:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
}

#page-info {
    font-size: 16px;
    font-weight: bold;
}

/* Icono para ordenar datos */
.sort-icon {
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.8em;
    display: inline-block;
}

/* Estilos para los botones de exportación */
.export-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    justify-content: flex-end;
}

.export-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.export-btn i {
    font-size: 16px;
}

#excel-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

#excel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

#pdf-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

#pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

/* Botón para crear usuario */
#btnCrearUsuario {
    padding: 8px 20px;
    background-color: #747f8b; /* Verde para el crear */
    color: white;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    margin-bottom: 20px;
}

#btnCrearUsuario:hover {
    background-color: #0056b3; /* Verde más oscuro */
}




/* Icono para ordenar datos */
.sort-icon {
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.8em;
    display: inline-block;
}





/* Estilos para los botones de switch (sliders) */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.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: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Estilo para el contenedor de accesos */
.access-controls {
  margin-top: 20px;
}

/* Permisos por sección (slim) */
.access-sections {
    margin-top: 18px;
}

.access-section {
    border: 1px solid #eee;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.access-section > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    color: #265da3;
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.access-section > summary::-webkit-details-marker {
    display: none;
}

.access-section[open] > summary {
    background: #ffffff;
}

.access-section__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 14px;
}

@media (max-width: 900px) {
    .modal-content {
        width: 92%;
    }
    .access-section__grid {
        grid-template-columns: 1fr;
    }
}

.access-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px 12px 4px;
    background: #ffffff;
}

.access-card__title {
    font-weight: 600;
    color: #132d52;
    margin-bottom: 10px;
}

.access-card .control-item {
    margin-bottom: 12px;
}

.control-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

/* En permisos por sección, algunos textos son muy largos (p.ej. Maestros/Parámetros).
   Permitimos wrap del label y evitamos que el switch se salga/oculte. */
.access-card .control-item {
    gap: 12px;
}

.access-card .control-item > label:not(.switch) {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.access-card .control-item > .switch {
    flex: 0 0 auto;
}

/* Estilos para los switches tipo slider */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.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: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.slider.round {
    border-radius: 22px;
}

/* Estilos personalizados para SweetAlert2 */
.swal2-popup {
    font-family: 'Poppins', sans-serif;
    border-radius: 15px;
}

.swal2-title {
    color: #265da3;
    font-size: 24px;
    font-weight: 600;
}

.swal2-html-container {
    color: #2c3e50;
    font-size: 14px;
}

.swal2-confirm {
    background-color: #265da3 !important;
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.swal2-confirm:hover {
    background-color: #1a4378 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 93, 163, 0.3);
}

.swal2-cancel {
    background-color: #6c757d !important;
    border-radius: 6px;
    padding: 10px 24px;
    font-weight: 500;
}

.swal2-cancel:hover {
    background-color: #5a6268 !important;
}

/* Estilo para el modal de ver detalle */
.swal-ver-detalle {
    border-radius: 15px;
}

/* Estilos para los toasts de SweetAlert */
.swal-toast-custom {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Poppins', sans-serif;
}

.swal-toast-title {
    font-size: 14px;
    font-weight: 500;
}

/* ===== ESTILOS DE PAGINACIÓN ===== */

/* Estilo general para los controles de paginación */
.pagination {
    margin: 24px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* Eliminar el subrayado de los enlaces dentro de los botones */
.pagination button a {
    text-decoration: none;
    color: inherit;
}

/* Estilos específicos para botones de paginación */
.pagination button {
    padding: 6px 14px;
    border: 1px solid #3b82f6;
    border-radius: 5px;
    background: white;
    color: #3b82f6;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.pagination button:not(:disabled):hover {
    background: #3b82f6;
    color: white;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
}

/* Números de paginación */
.page-numbers {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0 10px;
}

.page-number {
    padding: 6px 12px;
    border: 1px solid #3b82f6;
    border-radius: 5px;
    background: white;
    color: #3b82f6;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    min-width: 35px;
    text-align: center;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #3b82f6;
    color: white;
}

.page-number.active {
    background: #3b82f6;
    color: white;
}

/* Responsivo */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 20px;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    #search-input {
        width: 100%;
    }
}

/* RESPONSIVE - Media Queries Completas para usuario.css */

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .container {
        width: calc(100% - 20px);
        left: 10px;
        padding: 12px;
    }
    #search-input { width: 100%; }
    .form-group_1 input, .form-group_1 select { width: 100% !important; }
    .modal-content { width: 95%; margin: 8% auto; padding: 12px; }
    .export-buttons { margin-top: -30px; justify-content: flex-end; }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container { width: calc(100% - 120px); left: 100px; padding: 14px; }
    .form-group_1 input, .form-group_1 select { width: 75% !important; }
    .modal-content { width: 70%; max-width: 720px; }
    .export-buttons { margin-top: -35px; }
}

/* Desktop (≥1024px) */
@media (min-width: 1024px) {
    .container { width: calc(100% - 290px); left: 250px; }
    .form-group_1 input, .form-group_1 select { width: 70% !important; }
    .export-buttons { margin-top: 0; }
}