/*
 * 02-edccomuviv01-foundation.css
 * Estado de Cuenta por Comunidad/Vivienda — Estilos del módulo EdoCta v2
 * TKT-EDC-REDISENO-UI v2 · e004c · 2026-05-01
 * Color corporativo: #6213e2 (morado)
 */

/* ── Modal principal pantalla completa ──────────────────────────────────── */
#edcm-modal-principal .reveal-overlay,
.edcm-overlay {
  z-index: 1050;
}

/* Si se usa un <div> full-screen en lugar de Foundation reveal */
#edcm-pantalla-principal {
  width: 100%;
  min-height: 100%;
}

/* ── Header con toolbox — sticky ──────────────────────────────────── */
#edcm-root > .ic-mini-toolbox {
  margin-bottom: 0;
  border-radius: 4px 4px 0 0;
  border-bottom: none;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

/* Botones deshabilitados en la toolbox */
#edcm-root .ic-mini-toolbox-actions .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Filtros ────────────────────────────────────────────────────────────── */
.edcm-filtros {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 6px;
  background: #f8f5ff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 41px;  /* altura aprox del ic-mini-toolbox */
  z-index: 19;
}

.edcm-filtros .edcm-filtro-grupo {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.edcm-filtros label {
  font-size: 11px;
  font-weight: 600;
  color: #6213e2;
  margin-bottom: 0;
}

.edcm-filtros input,
.edcm-filtros select {
  font-size: 13px;
  border: 1px solid #b8a0e8;
  border-radius: 3px;
  padding: 4px 6px;
  min-width: 80px;
}

.edcm-filtros input:focus,
.edcm-filtros select:focus {
  outline: none;
  border-color: #6213e2;
  box-shadow: 0 0 0 2px rgba(98,19,226,0.18);
}

.edcm-filtros .btn-buscar {
  background: #6213e2;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-end;
}
.edcm-filtros .btn-buscar:hover {
  background: #4d0fbf;
}

/* ── Tabla EdoCta ───────────────────────────────────────────────────────── */
.edcm-tabla-wrapper {
  overflow-x: auto;             /* scroll horizontal */
  overflow-y: auto;             /* scroll vertical — wrapper ES el contenedor de scroll */
  max-height: calc(100vh - 180px); /* toolbox + filtros + pie */
  padding: 0 14px 8px;
}

.edcm-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.edcm-tabla thead tr {
  background: #6213e2;
  color: #fff;
}

.edcm-tabla thead th {
  padding: 7px 8px;
  font-weight: 600;
  border: 1px solid #5010c5;
  white-space: nowrap;
  position: sticky;
  top: 0;      /* sticky relativo al wrapper (el wrapper es el scroll container) */
  z-index: 2;
}

.edcm-tabla thead th .form-check-input {
  accent-color: #fff;
}

.edcm-tabla tbody tr:nth-child(even) {
  background: #f5f0fc;
}

.edcm-tabla tbody tr:hover {
  background: #ece5fb;
  cursor: pointer;
}

.edcm-tabla tbody td {
  padding: 5px 8px;
  border: 1px solid #e0d8f5;
  vertical-align: middle;
}

/* Columna Recibo(s): botones serie-folio */
.edcm-col-recibos {
  min-width: 90px;
}

/* Base compartida */
.edcm-recibo-btn {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 3px;
  padding: 1px 5px;
  margin: 1px 2px 1px 0;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  line-height: 1.5;
}

/* E — Borrador: amarillo / negro */
.edcm-recibo-E {
  background: #fff3cd;
  color: #212529;
  border-color: #ffc107;
}
.edcm-recibo-E:hover {
  background: #ffc107;
  color: #212529;
  border-color: #e0a800;
}

/* A — Aplicado: morado institucional / blanco */
.edcm-recibo-A {
  background: #6213e2;
  color: #fff;
  border-color: #4e0fb5;
}
.edcm-recibo-A:hover {
  background: #4e0fb5;
  color: #fff;
  border-color: #3a0a87;
}

/* C — Cancelado: rojo / blanco */
.edcm-recibo-C {
  background: #dc3545;
  color: #fff;
  border-color: #b02a37;
}
.edcm-recibo-C:hover {
  background: #b02a37;
  color: #fff;
  border-color: #86212c;
}

/* ── Badge de recibo en filas de abono (no-clickable, en columna concepto) ── */
.edcm-recibo-badge {
  display: inline-block;
  background: #6213e2;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 0px 6px;
  border-radius: 10px;
  vertical-align: middle;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.edcm-abono-prefix {
  color: #6213e2;
  font-size: 11px;
  margin-right: 2px;
}

/* ── Sin datos ──────────────────────────────────────────────────────────── */
#edcm-sin-datos {
  text-align: center;
  padding: 28px;
  color: #888;
  font-size: 14px;
}

/* ── Info totales + spinner ─────────────────────────────────────────────── */
.edcm-pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 14px;
  border-top: 1px solid #e0d8f5;
  background: #f8f5ff;
}

#edcm-info-total {
  font-size: 12px;
  color: #555;
}

#edcm-cargando {
  font-size: 12px;
  color: #6213e2;
  font-weight: 600;
}

/* ── Paginación ─────────────────────────────────────────────────────────── */
#edcm-paginacion {
  display: flex;
  justify-content: flex-end;
  padding: 6px 14px;
}

#edcm-pager {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
}

#edcm-pager .page-item .page-link {
  display: inline-block;
  padding: 4px 9px;
  font-size: 12px;
  border: 1px solid #b8a0e8;
  border-radius: 3px;
  color: #6213e2;
  cursor: pointer;
  text-decoration: none;
  background: #fff;
  transition: background 0.12s;
}

#edcm-pager .page-item.active .page-link {
  background: #6213e2;
  color: #fff;
  border-color: #6213e2;
}

#edcm-pager .page-item.disabled .page-link {
  color: #aaa;
  cursor: not-allowed;
}

#edcm-pager .page-item .page-link:hover:not(.active):not(.disabled) {
  background: #ece5fb;
}

/* ════════════════════════════════════════════════════════════════════════
 * MODAL N1 — RECIBO DE PAGO
 * ════════════════════════════════════════════════════════════════════════ */

/* Ajuste de header */
#edcm-modal-recibo .reveal-header,
.edcm-rec-header {
  background: #6213e2;
  color: #fff;
  padding: 10px 14px;
  border-radius: 4px 4px 0 0;
}

#edcm-modal-recibo .reveal-header h5,
.edcm-rec-header h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

#edcm-rec-lbl-serifolio {
  font-size: 13px;
  opacity: 0.88;
}

/* Tabla de detalle del recibo */
#edcm-rec-tbody-lineas td {
  vertical-align: middle;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #e0d8f5;
}

/* Celda Pago editable — amarillo pálido (igual que legacy) */
.edcm-inp-pago {
  background: #fffacd !important;
  border: 1px solid #c8b800 !important;
  text-align: right;
  font-size: 13px;
  width: 100%;
  min-width: 80px;
}

.edcm-inp-pago:focus {
  outline: none;
  border-color: #6213e2 !important;
  box-shadow: 0 0 0 2px rgba(98,19,226,0.18) !important;
}

/* Totales */
#edcm-rec-total-saldo,
#edcm-rec-total-pago {
  font-weight: 700;
  font-size: 14px;
  color: #6213e2;
}

/* Spinner del modal recibo */
#edcm-rec-spinner {
  font-size: 12px;
  color: #6213e2;
}

/* Mensaje de estado del modal */
#edcm-rec-msg {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 3px;
  margin-top: 6px;
}
