html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  overflow-x: hidden;
}

/* Estilos para el menú lateral */
.wrapper {
  display: flex;
  align-items: stretch;
  perspective: 1500px;
}

/* Imagen de fondo para la pantalla de inicio */
body {
  background-image: url('/images/FondoSistema.png');
  background-size: 100% 100%;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

#content {
  background: transparent;
  position: relative;
}

/* Asegurar que el contenido principal tenga fondo transparente */
.container {
  background: transparent;
  position: relative;
  z-index: 2;
}

/* Hacer que el sidebar sea transparente para que se vea la imagen detrás */
#sidebar {
  min-width: 250px;
  max-width: 250px;
  min-height: 100vh;
  background: rgba(52, 58, 64, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  transition: all 0.3s;
}

#sidebar.active {
  margin-left: -250px;
}

#sidebar .sidebar-header {
  padding: 20px;
  background: #2a2f34;
}

#sidebar ul.components {
  padding: 20px 0;
  border-bottom: 1px solid #4c545c;
}

#sidebar ul p {
  color: #fff;
  padding: 10px;
}

#sidebar ul li a {
  padding: 10px 20px;
  font-size: 1.1em;
  display: block;
  color: #fff;
  text-decoration: none;
  white-space: normal;
  line-height: 1.3;
  word-wrap: break-word;
  min-height: 44px;
}

#sidebar ul li a:hover {
  color: #fff;
  background: #258cfb;
}

#sidebar ul li.active > a,
a[aria-expanded="true"] {
  color: #fff;
  background: #258cfb;
}

#content {
  width: 100%;
  padding: 20px;
  min-height: 100vh;
  transition: all 0.3s;
}

@media (max-width: 768px) {
  #sidebar {
    margin-left: -250px;
  }
  #sidebar.active {
    margin-left: 0;
  }
  #sidebarCollapse span {
    display: none;
  }
}

/* Estilos para el navbar que contiene el botón de colapso */
.navbar {
  padding: 15px 10px;
  background: transparent !important;
  border: none;
  border-radius: 0;
  margin-bottom: 20px;
  box-shadow: none;
}

.navbar * {
  background: transparent !important;
}

.navbar-btn {
  box-shadow: none;
  outline: none !important;
  border: none;
  background: transparent !important;
}

#sidebarCollapse {
  background: transparent !important;
  border: none;
}

/* Modificaciones del estilo general */
.card {
  margin-bottom: 20px;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: none;
}

.btn {
  border-radius: 0.25rem;
}

.footer {
  background-color: #f8f9fa;
  padding: 1rem 0;
  text-align: center;
}

/* Mejoras para las tablas DataTables */
.dataTables_wrapper .dataTables_paginate .paginate_button.current, 
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #258cfb !important;
  color: white !important;
  border: 1px solid #258cfb !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #e9ecef !important;
  color: #258cfb !important;
  border: 1px solid #e9ecef !important;
}

/* Estilos adicionales para los submenús */
#sidebar ul ul.collapse {
  padding-left: 0;
}

#sidebar ul ul.collapse li a {
  padding: 8px 10px 8px 40px;
  font-size: 0.95em;
  background: #404952;
  transition: all 0.3s;
  white-space: normal;
  line-height: 1.3;
  word-wrap: break-word;
}

#sidebar ul ul.collapse li a:hover {
  background: #258cfb;
}

#sidebar ul ul.collapse li.active a {
  background: #258cfb;
}

/* Ajustar la flecha del menú desplegable */
#sidebar .dropdown-toggle {
  position: relative;
  padding-right: 30px;  /* Espacio adicional a la derecha para la flecha */
}

#sidebar .dropdown-toggle .float-end {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
}

/* Recuperar el estilo para la flecha dropdown */
#sidebar .dropdown-toggle::after {
  display: none; /* Ocultar la flecha predeterminada de Bootstrap */
}

/* Ajustes para los iconos en las opciones de menú */
#sidebar ul li a i.me-2 {
  margin-right: 8px;
  vertical-align: middle;
  display: inline-block;
  min-width: 18px;
}

#sidebar a[aria-expanded="true"]::after {
  content: '\f106'; /* Código de la flecha arriba de Font Awesome cuando está expandido */
  transform: translateY(-50%);
}

/* Actualizar estilos cuando está expandido */
#sidebar a[aria-expanded="true"] {
  background: #31373d;
}

/* Estilos para filtros y ordenamiento */
.filter-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.filter-card .card-header {
  background: #e9ecef;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
}

.filter-card .card-header h5 {
  margin: 0;
  color: #495057;
  font-size: 1rem;
  font-weight: 600;
}

.filter-card .card-body {
  padding: 1rem;
}

.filter-form .form-group {
  margin-bottom: 0.5rem;
}

.filter-form .form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
}

.filter-form .form-control {
  font-size: 0.875rem;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-form .form-control:focus {
  border-color: #258cfb;
  box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.25);
}

/* Estilos para enlaces de ordenamiento */
.sort-link {
  color: #495057;
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.15s ease-in-out;
}

.sort-link:hover {
  color: #258cfb;
  background-color: #f8f9fa;
  text-decoration: none;
}

.sort-link.active {
  color: #258cfb;
  background-color: #e3f2fd;
}

.sort-link i {
  margin-left: 0.5rem;
  font-size: 0.875rem;
}

.sort-link .fas.fa-sort {
  color: #6c757d;
}

.sort-link .fas.fa-sort-up,
.sort-link .fas.fa-sort-down {
  color: #258cfb;
}

/* Estilos para la tabla */
.table-sortable th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  padding: 0.75rem 0.5rem;
  font-weight: 600;
  color: #495057;
}

.table-sortable th a {
  color: inherit;
  text-decoration: none;
}

.table-sortable tbody tr:hover {
  background-color: #f8f9fa;
}

/* Estilos para los badges de estado */
.badge-success {
  background-color: #28a745;
  color: white;
}

.badge-danger {
  background-color: #dc3545;
  color: white;
}

.badge-secondary {
  background-color: #6c757d;
  color: white;
}

/* Estilos para los botones de acción */
.btn-group .btn {
  margin-right: 0.25rem;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

/* Responsive para filtros */
@media (max-width: 768px) {
  .filter-form .row > div {
    margin-bottom: 1rem;
  }
  
  .filter-form .col-md-2 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .sort-link {
    font-size: 0.875rem;
    padding: 0.25rem;
  }
  
  .table-responsive {
    font-size: 0.875rem;
  }
}

/* Animaciones para los filtros */
.filter-form .form-control {
  transition: all 0.2s ease-in-out;
}

.filter-form .form-control:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Estilos para el contador de resultados */
.results-count {
  background: #e9ecef;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #495057;
  border-left: 4px solid #258cfb;
}

/* Estilos para mensajes de estado */
.no-results {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
  font-style: italic;
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* ===== ESTILOS PARA TIPOS DE IVA ===== */

/* Mejorar apariencia de los botones de acciones */
.btn-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  margin: 0.1rem;
  white-space: nowrap;
}

/* Hover effects para los botones */
.btn-info:hover {
  background-color: #17a2b8;
  border-color: #17a2b8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-warning:hover {
  background-color: #ffc107;
  border-color: #ffc107;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Transiciones suaves */
.btn {
  transition: all 0.2s ease-in-out;
}

/* Mejorar apariencia de la tabla */
.table th {
  background-color: #f8f9fa;
  border-top: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
}

.table td {
  vertical-align: middle;
}

/* Estilos para los badges */
.badge {
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

/* Mejorar apariencia de las tarjetas */
.card-header {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.card-title {
  color: #495057;
  font-weight: 600;
  margin-bottom: 0;
}

/* Estilos para los filtros */
.filter-section {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Responsive para botones en pantallas pequeñas */
@media (max-width: 768px) {
  .btn-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
  
  .btn-sm i {
    margin-right: 0.2rem;
  }
}

/* Mejorar espaciado en la tabla */
.table-responsive {
  border-radius: 0.375rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Estilos para el DataTable */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-top: 1rem;
}

/* Personalización de paginación */
.page-link {
  color: #007bff;
  border-color: #dee2e6;
}

.page-link:hover {
  color: #0056b3;
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
}