#typeahead .empty-message {
  padding: 5px 10px;
  text-align: center;
  background-color: white;
}

.twitter-typeahead {
  display: block !important;
}

/* ===== ESTILOS RESPONSIVOS PARA MÓVILES ===== */

/* Asegurar que todo el contenido sea responsive */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  font-size: 16px; /* Tamaño base para mejor legibilidad */
}

body {
  min-width: 320px;
  overflow-x: hidden;
  font-size: 1rem; /* Usar rem para escalabilidad */
}

/* Mejorar legibilidad en móviles */
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  h4 {
    font-size: 1.1rem;
  }
  
  h5, h6 {
    font-size: 1rem;
  }
  
  /* Mejorar tablas en móviles */
  .table {
    font-size: 0.85rem;
  }
  
  .table-sm {
    font-size: 0.75rem;
  }
  
  /* Hacer que las tablas tengan scroll horizontal si es necesario */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Mejorar botones en móviles */
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .btn-block {
    width: 100%;
  }
  
  /* Mejorar formularios en móviles */
  .form-control {
    font-size: 1rem;
    padding: 0.5rem 0.75rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  /* Mejorar modales en móviles */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  .modal-footer {
    padding: 0.75rem;
  }
  
  /* Mejorar cards en móviles */
  .card {
    margin-bottom: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Mejorar navegación en móviles */
  .breadcrumb {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
  
  /* Mejorar dropdowns en móviles */
  .dropdown-menu {
    font-size: 0.9rem;
  }
  
  .dropdown-item {
    padding: 0.5rem 1rem;
  }
  
  /* Asegurar que el contenedor no sea demasiado ancho */
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Mejorar espaciado de filas */
  .row {
    margin-left: -10px;
    margin-right: -10px;
  }
  
  .row > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Hacer que los elementos de lista sean más grandes para tocar */
  .list-group-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Mejorar alertas en móviles */
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Asegurar que las imágenes sean responsivas */
  img {
    max-width: 100%;
    height: auto;
  }
  
  /* Mejorar badges en móviles */
  .badge {
    font-size: 0.8rem;
    padding: 0.35em 0.65em;
  }
}

/* Estilos para tablets */
@media (min-width: 768px) and (max-width: 991px) {
  body {
    font-size: 15px;
  }
  
  .container {
    max-width: 100%;
  }
}

/* Asegurar que las tablas siempre tengan scroll en móviles */
@media (max-width: 767px) {
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Hacer que los encabezados de tabla sean sticky si es posible */
  thead {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
  }
}

/* ===== MEJORAS ADICIONALES PARA RESPONSIVE ===== */

/* Asegurar que los inputs sean del tamaño correcto en iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea,
select {
  font-size: 16px !important; /* Evita el zoom automático en iOS */
}

/* Mejorar el espaciado en pantallas pequeñas */
@media (max-width: 575px) {
  .container,
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Hacer que los botones sean más fáciles de tocar */
  .btn {
    min-height: 44px; /* Tamaño mínimo recomendado para touch */
    padding: 0.6rem 1.2rem;
  }
  
  /* Mejorar el espaciado de las columnas */
  .col,
  [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
  }
  
  /* Hacer que las tablas sean más legibles */
  .table {
    font-size: 0.9rem;
  }
  
  .table td,
  .table th {
    padding: 0.5rem;
  }
  
  /* Mejorar los modales en pantallas muy pequeñas */
  .modal-dialog {
    margin: 0.25rem;
    max-width: calc(100% - 0.5rem);
  }
  
  .modal-title {
    font-size: 1.1rem;
  }
}

/* Estilos para pantallas extra pequeñas */
@media (max-width: 375px) {
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.3rem;
  }
  
  h3 {
    font-size: 1.15rem;
  }
  
  .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
  }
}

/* Mejorar la navegación en móviles */
@media (max-width: 767px) {
  .navbar-nav {
    margin-top: 0.5rem;
  }
  
  .navbar-nav .nav-item {
    margin-bottom: 0.25rem;
  }
  
  .navbar-toggler {
    padding: 0.5rem 0.75rem;
    font-size: 1.1rem;
  }
}

/* Asegurar que el contenido no se desborde */
* {
  max-width: 100%;
}

/* Excepciones para elementos que necesitan desbordarse */
html,
body,
.container,
.container-fluid,
.row,
[class*="col-"] {
  max-width: none;
}
/* ===== NAVBAR PROFILE PHOTO STYLES ===== */

/* Profile photo in navbar */
.navbar-profile-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6fccff;
  transition: all 0.3s ease;
}

.navbar-profile-photo:hover {
  border-color: #0092d4;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0, 146, 212, 0.5);
}

/* Profile placeholder (when no photo) */
.navbar-profile-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0092d4, #6fccff);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  border: 2px solid #6fccff;
  transition: all 0.3s ease;
}

.navbar-profile-placeholder:hover {
  background: linear-gradient(135deg, #6fccff, #0092d4);
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0, 146, 212, 0.5);
}

/* Profile link styling */
.item-sesion .nav-link {
  padding: 0.5rem 1rem !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-sesion .nav-link:hover {
  background-color: rgba(111, 204, 255, 0.1);
  border-radius: 8px;
}

/* Mobile adjustments for profile photo */
@media (max-width: 991px) {
  .navbar-profile-photo,
  .navbar-profile-placeholder {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .item-sesion .nav-link {
    padding: 0.75rem 1rem !important;
  }
  
  /* Show username on mobile */
  .item-sesion .nav-link span {
    display: inline !important;
  }
}

/* Desktop - larger screens */
@media (min-width: 1200px) {
  .navbar-profile-photo,
  .navbar-profile-placeholder {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

/* Animation for profile photo load */
@keyframes fadeInProfile {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.navbar-profile-photo,
.navbar-profile-placeholder {
  animation: fadeInProfile 0.3s ease;
}

/* ===== NAVBAR RESPONSIVE FIXES ===== */


/* Ensure user session info is visible on mobile */
.navbar-nav.ml-md-auto {
  display: flex !important;
}

/* Mobile navbar adjustments */
@media (max-width: 991px) {
  /* Stack navbar items vertically on mobile */
  .navbar-collapse .navbar-nav {
    flex-direction: column;
    width: 100%;
  }
  
  .navbar-collapse .navbar-nav.ml-md-auto {
    flex-direction: column;
    margin-left: 0 !important;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .navbar-collapse .navbar-nav.ml-md-auto .nav-item {
    width: 100%;
    text-align: left;
  }
  
  .navbar-collapse .navbar-nav.ml-md-auto .nav-link {
    padding: 0.75rem 1rem;
    display: block;
    width: 100%;
  }
  
  /* Make the welcome message and logout more prominent on mobile */
  .navbar-nav.ml-md-auto .item-sesion .nav-link {
    font-weight: 500;
    font-size: 1rem;
  }
  
  /* Style the logout link on mobile */
  .navbar-nav.ml-md-auto li:last-child .nav-link {
    background-color: rgba(0, 146, 212, 0.1);
    border-radius: 4px;
    margin-top: 0.5rem;
    font-weight: 600;
  }
  
  /* Remove flex-row on mobile */
  .navbar-nav.flex-row {
    flex-direction: column !important;
  }
}

/* Desktop navbar - keep horizontal layout */
@media (min-width: 992px) {
  .navbar-nav.ml-md-auto {
    flex-direction: row !important;
    align-items: center;
  }
  
  .navbar-nav.ml-md-auto .nav-item {
    margin-left: 0.5rem;
  }
}

/* Improve navbar toggler button */
.navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 0.75rem;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(0, 146, 212, 0.5);
}

.navbar-toggler-icon {
  width: 1.5em;
  height: 1.5em;
}

/* Ensure navbar brand is visible */
.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

/* Improve navbar collapse animation */
.navbar-collapse {
  transition: height 0.3s ease;
}

/* Add padding to collapsed navbar content */
@media (max-width: 991px) {
  .navbar-collapse {
    padding: 1rem 0;
  }
}

/* ===== INPUT GROUP BUTTON FIXES ===== */


/* Ensure buttons in input groups match the input height exactly */
.input-group .btn {
  height: auto;
  line-height: 1.5;
  padding: 0.375rem 0.75rem;
  border: 1px solid #ced4da;
}

.input-group-append .btn {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Match form-control height */
.input-group .form-control,
.input-group .btn {
  height: calc(1.5em + 0.75rem + 2px);
}

/* Ensure proper alignment */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group > .form-control,
.input-group > .input-group-append {
  display: flex;
  align-items: stretch;
}

.input-group-append {
  display: flex;
}

/* Fix for outline buttons in input groups */
.input-group .btn-outline-secondary,
.input-group .btn-outline-success,
.input-group .btn-outline-primary,
.input-group .btn-outline-info {
  border-color: #ced4da;
}

.input-group .btn-outline-secondary:hover,
.input-group .btn-outline-success:hover,
.input-group .btn-outline-primary:hover,
.input-group .btn-outline-info:hover {
  border-color: #ced4da;
}

/* Mobile adjustments for input groups */
@media (max-width: 767px) {
  .input-group {
    flex-wrap: wrap;
  }
  
  .input-group .form-control {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .input-group-append {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  
  .input-group-append .btn {
    flex: 1;
    min-height: 48px;
  }
}

/* ===== BUTTON STYLING - FULL WIDTH DROPDOWNS ===== */

/* ===== BUTTON STYLING - FULL WIDTH DROPDOWNS ===== */

/* Make dropdown buttons full width with proper spacing */
.btn-group {
  width: 100%;
  margin-bottom: 0.75rem;
}

.btn-group .btn {
  width: 100%;
}

.btn-group.dropup,
.btn-group.dropdown {
  display: block;
  width: 100%;
}

/* Dropdown toggle buttons */
.dropdown-toggle {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Dropdown menu positioning */
.dropdown-menu {
  width: 100%;
  margin-top: 0.25rem;
}

/* Button spacing in general */
.btn {
  margin-bottom: 0.5rem;
}

.btn:last-child {
  margin-bottom: 0;
}

/* Specific styling for action dropdowns */
#btnGroupDrop-acciones,
[id^="btnGroup-"] {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Ensure dropdown items have proper padding */
.dropdown-item {
  padding: 0.5rem 1rem;
  white-space: normal;
}

/* Mobile specific adjustments */
@media (max-width: 767px) {
  .btn-group {
    margin-bottom: 1rem;
  }
  
  .dropdown-toggle {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
  
  .dropdown-menu {
    font-size: 0.95rem;
  }
}

/* ===== TABLE DROPDOWN BUTTONS - SPECIAL HANDLING ===== */

/* Keep table dropdowns compact but touchable */
table .btn-group {
  width: auto;
  margin-bottom: 0;
  display: inline-block;
}

table .btn-group .btn {
  width: auto;
  min-width: 44px; /* Minimum touch target */
  min-height: 44px;
}

table .btn-group.dropup .dropdown-menu,
table .btn-group.dropdown .dropdown-menu {
  min-width: 200px;
  width: auto;
}

/* On mobile, make table dropdown menus wider */
@media (max-width: 767px) {
  table .btn-group .dropdown-menu {
    min-width: 250px;
    max-width: 90vw;
  }
  
  table .btn-group .btn {
    min-width: 50px;
    min-height: 50px;
    padding: 0.5rem;
  }
  
  table .dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* ===== BUTTON GROUPS IN FORMS ===== */

/* Search and action button groups */
.form .btn-group,
form .btn-group {
  margin-bottom: 0.5rem;
}

/* Ensure buttons in button groups have proper spacing */
.btn-group > .btn:not(:last-child) {
  margin-right: 0;
  border-right: 0;
}

/* ===== MODAL BUTTONS ===== */

.modal-footer .btn {
  margin-bottom: 0;
  margin-left: 0.5rem;
}

.modal-footer .btn:first-child {
  margin-left: 0;
}

@media (max-width: 575px) {
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
    margin-left: 0;
    margin-bottom: 0.5rem;
  }
  
  .modal-footer .btn:last-child {
    margin-bottom: 0;
  }
}

/* ===== UTILITY CLASSES FOR BUTTONS ===== */

/* Force full width on any button */
.btn-full-width {
  width: 100% !important;
  display: block;
}

/* Proper spacing for button groups */
.btn-group-spaced {
  margin-bottom: 1rem;
}

.btn-group-spaced .btn {
  margin-bottom: 0.5rem;
}

/* Better touch targets for mobile */
@media (max-width: 767px) {
  .btn-touch {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
  }
}

/* ===== SPECIFIC FIXES FOR COMMON PATTERNS ===== */

/* Fix for buttons next to inputs in same row */
.row .btn {
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .row .btn {
    margin-bottom: 0;
  }
}

/* Ensure submit buttons are prominent */
button[type="submit"],
input[type="submit"] {
  min-height: 44px;
  padding: 0.6rem 1.5rem;
  font-weight: 500;
}

@media (max-width: 767px) {
  button[type="submit"],
  input[type="submit"] {
    width: 100%;
    min-height: 50px;
    font-size: 1.05rem;
  }
}

/* ===== DROPDOWN MENU IMPROVEMENTS ===== */

/* Better dropdown positioning on mobile */
@media (max-width: 767px) {
  .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
  }
  
  .dropdown-divider {
    margin: 0.5rem 0;
  }
  
  /* Make dropdown items more touchable */
  .dropdown-item {
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
  }
  
  .dropdown-item:active {
    background-color: #007bff;
    color: white;
  }
}

/* Ensure dropdown menus don't overflow viewport */
.dropdown-menu {
  max-width: 95vw;
  overflow-x: hidden;
}

/* ===== BUTTON ALIGNMENT FIXES ===== */

/* Fix float-right on mobile */
@media (max-width: 767px) {
  .float-right,
  .float-left {
    float: none !important;
  }
  
  .btn-group.float-right,
  .btn-group.float-left {
    width: 100%;
  }
}
