/**
 * RT Panel - Adaptación responsive (móvil / tablet)
 */

/* Evitar desbordes horizontales */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.content-wrapper,
.content,
.container-fluid {
  max-width: 100%;
}

/* Cabeceras de página: apilar título y acciones */
.rt-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 767.98px) {
  .content-header h1 {
    font-size: 1.35rem;
  }

  .content-header .breadcrumb {
    display: none;
  }

  .rt-page-actions {
    justify-content: flex-start;
    width: 100%;
    margin-top: 0.5rem;
  }

  .rt-page-actions .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 0.4rem);
  }

  /* Navbar: menos ruido en móvil */
  .main-header .nav-link .rt-user-name,
  .main-header .nav-link .fa-caret-down {
    display: none;
  }

  .main-header [data-widget="fullscreen"],
  .main-header [data-widget="navbar-search"] {
    display: none !important;
  }

  /* Info boxes más compactas */
  .info-box {
    min-height: 70px;
  }

  .info-box .info-box-number {
    font-size: 1.25rem;
  }

  /* Filtros form-inline → columna */
  .form-inline.rt-filters,
  .card-body > .form-inline {
    display: block !important;
  }

  .form-inline.rt-filters label,
  .card-body > .form-inline label {
    display: block;
    margin: 0.35rem 0 0.15rem;
  }

  .form-inline.rt-filters .form-control,
  .card-body > .form-inline .form-control {
    width: 100% !important;
    margin: 0 0 0.5rem 0 !important;
  }

  /* Tablas: scroll horizontal suave */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive > .table {
    min-width: 640px;
  }

  /* Botones de acción en filas: no apretar */
  td .btn-sm,
  td .btn-xs {
    margin-bottom: 2px;
  }

  /* Cards de acciones en formularios */
  .card-footer .btn {
    margin-bottom: 0.35rem;
  }

  /* Footer más limpio */
  .main-footer {
    text-align: center;
    font-size: 0.85rem;
  }

  /* SweetAlert más cómodo en pantallas chicas */
  .swal2-popup {
    width: calc(100% - 1.5rem) !important;
    margin: 0.75rem !important;
  }

  /* Login */
  .login-box {
    width: 92% !important;
    margin-top: 10vh;
  }
}

@media (max-width: 575.98px) {
  .content-wrapper > .content {
    padding: 0.75rem 0.5rem !important;
  }

  .content-header {
    padding: 0.75rem 0.5rem 0 !important;
  }

  .rt-page-actions .btn .rt-btn-label {
    display: none;
  }

  .rt-page-actions .btn {
    min-width: 0;
    flex: 0 0 auto;
  }

  .info-box-text {
    font-size: 0.8rem;
  }

  .small-box .inner h3 {
    font-size: 1.6rem;
  }

  /* Monitor / cards: padding reducido */
  .card-header .card-title {
    font-size: 1rem;
  }
}

/* Overlay del sidebar: área táctil clara */
body.sidebar-open .content-wrapper::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999;
}

@media (min-width: 992px) {
  body.sidebar-open .content-wrapper::before {
    display: none;
  }
}
