/**
 * Ajustes responsive para móvil y WebView Capacitor.
 */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
  height: auto;
}

@media (max-width: 576px) {
  .content-wrapper,
  .content-wrapper > .content,
  .container-fluid {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .card-body {
    padding: 0.65rem;
  }

  .btn-group-vertical .btn,
  .btn-block-sm {
    width: 100%;
  }

  .col-form-label {
    padding-bottom: 0.25rem;
  }

  .form-row > [class*='col-'],
  .row > [class*='col-'] .form-control,
  .row > [class*='col-'] .custom-select,
  .row > [class*='col-'] select.form-control {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    width: 100%;
  }

  .table {
    font-size: 0.875rem;
  }

  .table td,
  .table th {
    padding: 0.5rem 0.35rem;
    white-space: nowrap;
  }

  .table-responsive .table td,
  .table-responsive .table th {
    white-space: normal;
  }

  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    float: none;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  .dataTables_wrapper .dataTables_paginate {
    float: none;
    text-align: center;
    margin-top: 0.75rem;
  }

  .dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
  }

  .main-header .navbar-nav {
    flex-wrap: wrap;
  }
}

/* Cards de pagos y listas con min-width fijo */
@media (max-width: 576px) {
  .card-pago,
  .pago-card-actions,
  [class*='card-pago'] {
    min-width: 0 !important;
    width: 100%;
  }
}

body.capacitor-app {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body.capacitor-app .main-header.navbar,
body.capacitor-app.layout-navbar-fixed .main-header {
  min-height: 3.25rem;
  box-sizing: border-box;
}

body.capacitor-app .btn,
body.capacitor-app .nav-link,
body.capacitor-app .page-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.capacitor-app .btn-sm {
  min-height: 36px;
}

body.capacitor-app .content-wrapper {
  min-height: 0;
}

body.capacitor-app textarea.form-control {
  min-height: 120px;
  width: 100%;
}
