/**
 * Estilos responsive para módulo de reportes (body.reportes-module)
 * AdminLTE + Bootstrap 3
 */

.reportes-module .wrapper .content-wrapper {
  overflow-x: auto;
}

.reportes-module .reportes-toolbar__form.form-inline .form-control {
  width: auto;
  display: inline-block;
  max-width: 100%;
}

/* ---------- Barra de título + filtros ---------- */
.reportes-module .content-header.reportes-toolbar {
  padding: 18px 15px 16px;
  background: linear-gradient(180deg, #f7f9fb 0%, #fff 100%);
  border-bottom: 1px solid #e4e8ec;
}

.reportes-module .content-header.reportes-toolbar h1 {
  margin-top: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

@media (max-width: 767px) {
  .reportes-module .content-header.reportes-toolbar h1 {
    font-size: 18px;
  }
  .reportes-module .content-header.reportes-toolbar h1 small {
    display: block;
    margin-top: 4px;
  }
}

.reportes-module .content-header.reportes-toolbar .reportes-toolbar__form {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.reportes-module .content-header.reportes-toolbar form:not(.reportes-toolbar__form) {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.reportes-module .content-header.reportes-toolbar label {
  margin-bottom: 0;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}

.reportes-module .content-header.reportes-toolbar input[type="date"],
.reportes-module .content-header.reportes-toolbar input[type="text"],
.reportes-module .content-header.reportes-toolbar select.form-control {
  min-height: 36px;
  border-radius: 4px;
  max-width: 100%;
}

@media (max-width: 767px) {
  .reportes-module .content-header.reportes-toolbar input[type="date"] {
    flex: 1 1 140px;
    min-width: 0;
  }
  .reportes-module .content-header.reportes-toolbar .btn {
    width: 100%;
    margin-top: 4px;
  }
  .reportes-module .content-header.reportes-toolbar .btn + .btn {
    margin-left: 0;
  }
}

.reportes-module .content-header.reportes-toolbar .btn-reportes-export {
  flex-shrink: 0;
}

/* Headers de reporte sin clase toolbar: al menos formulario flexible */
.reportes-module .content-header:not(.reportes-toolbar) form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 10px;
}

@media (max-width: 767px) {
  .reportes-module .content-header:not(.reportes-toolbar) .btn-primary {
    width: 100%;
  }
}

/* ---------- Secciones y cajas ---------- */
.reportes-module .content {
  padding-left: 10px;
  padding-right: 10px;
}

@media (min-width: 768px) {
  .reportes-module .content {
    padding-left: 15px;
    padding-right: 15px;
  }
}

.reportes-module .box {
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 18px;
}

/* ---------- Tablas: scroll horizontal táctil ---------- */
.reportes-module .box-body.reportes-table-scroll,
.reportes-module .box-body[style*="overflow"] {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.reportes-module .table {
  margin-bottom: 0;
}

.reportes-module .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
}

.reportes-module .table thead th,
.reportes-module .table tbody td {
  white-space: nowrap;
}

@media (max-width: 991px) {
  .reportes-module .table {
    font-size: 12px;
  }
  .reportes-module .table thead th,
  .reportes-module .table tbody td {
    padding: 8px 6px;
  }
}

/* DataTables dentro de reportes */
.reportes-module .dataTables_wrapper {
  padding: 4px 0;
}

@media (max-width: 767px) {
  .reportes-module .dataTables_wrapper .dataTables_length,
  .reportes-module .dataTables_wrapper .dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 10px;
  }
  .reportes-module .dataTables_wrapper .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
  }
  .reportes-module .dataTables_wrapper .dataTables_info,
  .reportes-module .dataTables_wrapper .dataTables_paginate {
    float: none !important;
    text-align: center !important;
    width: 100%;
  }
  .reportes-module .dataTables_wrapper .dataTables_paginate {
    margin-top: 8px;
  }
}

/* ---------- Gráficos Highcharts ---------- */
.reportes-module .box-body [id^="container"],
.reportes-module .box-body [id^="container"] svg {
  max-width: 100% !important;
}

.reportes-module .box-body [id^="container"] {
  width: 100% !important;
  min-height: 220px;
  overflow: hidden;
}

.reportes-module #piramide {
  width: 100% !important;
  min-height: 200px;
}

/* Filas de gráficos: apilar en móvil */
.reportes-module .row > [class*="col-md-6"] {
  margin-bottom: 15px;
}

@media (max-width: 767px) {
  .reportes-module .row {
    margin-left: -8px;
    margin-right: -8px;
  }
  .reportes-module .row > [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* Iframes (p. ej. ADS) */
.reportes-module iframe {
  max-width: 100%;
}

.reportes-module .reportes-iframe-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #e4e8ec;
  background: #fafafa;
}

.reportes-module .reportes-iframe-wrap iframe {
  width: 100%;
  min-height: 400px;
  border: none;
  display: block;
}

/* Formulario de filtros de grabaciones (sin márgenes fijos en móvil) */
.reportes-module .reportes-grabaciones-form {
  padding: 16px 12px;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .reportes-module .reportes-grabaciones-form {
    padding: 20px 24px;
  }
}

/* reportes_general: panel de filtros */
.reportes-module .reportes-filtros-general {
  border: 1px solid #e4e8ec;
  padding: 16px;
  margin: 12px 0;
  background: #fff;
  border-radius: 6px;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .reportes-module .reportes-filtros-general {
    margin-left: auto;
    margin-right: auto;
    max-width: 960px;
  }
}

@media (max-width: 767px) {
  .reportes-module .reportes-iframe-wrap iframe {
    min-height: 320px;
  }
}
