/* Controles compactos inspirados en la paginación de mada_aws. */
div.dt-container .dt-length,
div.dt-container .dt-search,
div.dt-container .dt-info,
div.dt-container .dt-paging {
  color: #334155;
  font-size: 15px;
}

div.dt-container .dt-length select,
div.dt-container .dt-search input {
  border: 1px solid #cfdbe3;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  background: #fff;
}

div.dt-container .dt-search input:focus {
  border-color: #2f7891;
  box-shadow: 0 0 0 3px rgba(47, 120, 145, .12);
}

div.dt-container .dt-paging ul.pagination {
  margin: 2px 0;
  gap: 2px;
}

div.dt-container .dt-paging .page-link {
  min-width: 36px;
  padding: 7px 11px;
  border-radius: 8px !important;
  font-size: 14px;
  text-align: center;
  color: #000000;
}

div.dt-container .dt-paging .page-item.active .page-link {
  border-color: #8f3d25;
  background: #8f3d25;
  color: #fff;
}

div.dt-container .dt-paging .page-item:not(.active):not(.disabled) .page-link:hover {
  border-color: #e5c5b6;
  background: #f7e8de;
  color: #713018;
}

/* Separa los controles del encabezado en todas las tablas paginadas. */
div.dt-container .dt-layout-row:first-child {
  margin-bottom: 16px;
}

table[data-datatable] {
  margin-top: 0 !important;
  table-layout: fixed;
  width: 100% !important;
}

table[data-datatable] th,
table[data-datatable] td {
  overflow-wrap: break-word;
}

table[data-datatable] thead th {
  --bs-table-bg: #e8ded3;
  --bs-table-accent-bg: #e8ded3;
  background-color: #e8ded3 !important;
  box-shadow: none !important;
  color: #40382f;
  padding: 9px 12px;
  font-weight: 600;
  vertical-align: middle;
  border-color: #d5c5b4;
}

/* Da más espacio a observaciones y reduce contrato y netos en ventasLista. */
table.ventas-lista-pendientes thead th:nth-child(5),
table.ventas-lista-pendientes colgroup col:nth-child(5) {
  width: 4.5% !important;
}

table.ventas-lista-pendientes thead th:nth-child(6),
table.ventas-lista-pendientes colgroup col:nth-child(6),
table.ventas-lista-pendientes thead th:nth-child(7),
table.ventas-lista-pendientes colgroup col:nth-child(7) {
  width: 5% !important;
}

table.ventas-lista-pendientes thead th:nth-child(13),
table.ventas-lista-pendientes colgroup col:nth-child(13) {
  width: 12.5% !important;
}

/* Enlaces de las tablas de cobranza, sin subrayado ni azul intenso. */
table.reporte-enlaces tbody a,
table.reporte-enlaces tbody a:visited {
  color: #244b70;
  text-decoration: none;
  font-weight: 600;
}

table.reporte-enlaces tbody a:hover,
table.reporte-enlaces tbody a:focus-visible {
  color: #173653;
  text-decoration: none;
}

table.reporte-enlaces .btn-seguimiento {
  border-color: #8f3d25;
  background-color: #8f3d25;
  color: #fff;
}

table.reporte-enlaces .btn-seguimiento:hover,
table.reporte-enlaces .btn-seguimiento:focus-visible {
  border-color: #d97945;
  background-color: #d97945;
  color: #2c1b12;
}

/* Botones de acción compactos para la lista de ventas. */
.ventas-accion {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.ventas-accion-editar {
  background: #0ea5e9;
  border-color: #0284c7;
}

.ventas-accion-editar:hover {
  background: #0284c7;
}

.ventas-accion-documento {
  background: #2563a6;
  border-color: #1d4f86;
}

.ventas-accion-documento:hover {
  background: #1d4f86;
}

.ventas-accion-eliminar {
  background: #dc3545;
  border-color: #b02a37;
}

.ventas-accion-eliminar:hover {
  background: #b02a37;
}

/* Filtros e indicadores del listado de facturas. */
.ventas-dashboard .ventas-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fafc;
}

.ventas-dashboard .ventas-filtros label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 12px;
}

.ventas-dashboard .ventas-filtros input,
.ventas-dashboard .ventas-filtros select {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1e293b;
}

.ventas-dashboard .ventas-filtros input[type="search"] {
  min-width: 190px;
}

.ventas-dashboard .ventas-resumen-periodo {
  margin: 0 0 10px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.ventas-dashboard .ventas-resumen {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.ventas-dashboard .ventas-resumen-pagadas {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ventas-dashboard .ventas-resumen-card {
  display: grid;
  gap: 5px;
  padding: 17px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #fff;
  color: #1e293b;
}

.ventas-dashboard .ventas-resumen-card strong {
  font-size: 23px;
}

.ventas-dashboard .ventas-resumen-card small {
  color: #64748b;
}

.ventas-dashboard .dt-search {
  display: none;
}

@media (max-width: 900px) {
  .ventas-dashboard .ventas-resumen {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .ventas-dashboard .ventas-resumen,
  .ventas-dashboard .ventas-resumen-pagadas {
    grid-template-columns: 1fr;
  }
}
