/* report-view.css — Panel "Listado sin confirmar" coordinación
   01/06/2026 — Diseño moderno: card, filtros, tabla con checkboxes, badges
   Variables heredadas de iwc-theme.css; aliases locales para compatibilidad */

/* ── Aliases sobre tokens iwc-theme (iwc-theme.css debe cargarse antes) ── */
:root {
  --rv-primary:   var(--iwc-primary,   #1565c0);
  --rv-primary-h: var(--iwc-primary-h, #0d47a1);
  --rv-success:   var(--iwc-success,   #2e7d32);
  --rv-danger:    var(--iwc-danger,    #c62828);
  --rv-warning:   var(--iwc-warning,   #e65100);
  --rv-surface:   var(--iwc-surface,   #ffffff);
  --rv-bg:        var(--iwc-bg,        #f4f7fc);
  --rv-border:    var(--iwc-border,    #d0dce8);
  --rv-shadow:    var(--iwc-shadow,    0 2px 8px rgba(0,0,0,.12));
  --rv-radius:    var(--iwc-radius,    8px);
  --rv-sel-bg:    rgba(21,101,192,.07);
}

/* ── Card contenedora ── */
.rv-card {
  background: var(--rv-surface);
  border: 1px solid var(--rv-border);
  border-radius: var(--rv-radius);
  box-shadow: var(--rv-shadow);
  padding: 14px 16px 10px;
  margin-bottom: 12px;
}

/* ── Header: título + contadores ── */
.rv-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.rv-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rv-primary);
  flex: 1 1 auto;
}
.rv-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rv-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
}
.rv-badge-total   { background: #e3eaf6; color: var(--rv-primary); }
.rv-badge-pending { background: #fdecea; color: var(--rv-danger);  }
.rv-badge-sel     { background: #e8f5e9; color: var(--rv-success); }

/* ── Filtros ── */
.rv-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.rv-filter-input {
  flex: 2 1 180px;
  min-width: 140px;
}
.rv-filter-sel {
  flex: 1 1 120px;
  min-width: 110px;
}

/* ── Barra de acciones ── */
.rv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--rv-border);
}
.rv-actions .btn {
  border-radius: 6px;
  font-size: .82rem;
}

/* ── Tabla ── */
.rv-table-wrap {
  margin-top: 4px;
}
.rv-table {
  width: 100%;
  font-size: .85rem;
  border-collapse: collapse;
}
.rv-table thead th {
  background: var(--rv-primary);
  color: #fff;
  padding: 9px 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  border: none;
  white-space: nowrap;
}
.rv-table thead th:first-child {
  width: 36px;
  text-align: center;
}
.rv-table tbody tr {
  border-bottom: 1px solid #e8edf3;
  transition: background .15s;
}
.rv-table tbody tr:nth-child(even) { background: var(--rv-bg); }
.rv-table tbody tr:hover           { background: #ddeffe; }
.rv-table tbody tr.rv-selected     { background: var(--rv-sel-bg) !important; }
.rv-table tbody tr.rv-hidden       { display: none; }
.rv-table td {
  padding: 7px 8px;
  vertical-align: middle;
}

/* ── Badges enviado / confirmado ── */
.rv-st-sent     { display:inline-block; padding:2px 8px; border-radius:12px; font-size:.78rem; background:#e8f5e9; color:var(--rv-success); font-weight:600; }
.rv-st-unsent   { display:inline-block; padding:2px 8px; border-radius:12px; font-size:.78rem; background:#fdecea; color:var(--rv-danger);  font-weight:600; }
.rv-st-conf     { display:inline-block; padding:2px 8px; border-radius:12px; font-size:.78rem; background:#e8f5e9; color:var(--rv-success); font-weight:600; }
.rv-st-pending  { display:inline-block; padding:2px 8px; border-radius:12px; font-size:.78rem; background:#fff3e0; color:var(--rv-warning); font-weight:600; }

/* ── Checkbox alineado ── */
.rv-table td:first-child,
.rv-table th:first-child { text-align: center; }
.rv-row-chk { cursor: pointer; width: 16px; height: 16px; }

/* ── Overlay progreso reenvío masivo ── */
#rv-batch-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rv-batch-box {
  background: var(--rv-surface);
  border-radius: var(--rv-radius);
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
  padding: 28px 32px;
  min-width: 320px;
  max-width: 480px;
  text-align: center;
}
.rv-batch-box p { font-size: 1rem; margin-bottom: 14px; font-weight: 500; }
.rv-batch-bar-wrap {
  background: #e0e0e0;
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.rv-batch-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--rv-primary), #42a5f5);
  width: 0%;
  transition: width .3s ease;
  border-radius: 8px;
}
#rv-batch-log {
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
  font-size: .8rem;
  border: 1px solid var(--rv-border);
  border-radius: 6px;
  padding: 8px;
  background: var(--rv-bg);
}
.rv-log-ok   { color: var(--rv-success); }
.rv-log-fail { color: var(--rv-danger);  }

/* ── Responsive: apilar filtros en pantallas pequeñas ── */
@media (max-width: 768px) {
  .rv-filters { flex-direction: column; }
  .rv-filter-input, .rv-filter-sel { flex: 1 1 100%; }
  .rv-actions { flex-direction: column; align-items: flex-start; }
  .rv-header  { flex-direction: column; align-items: flex-start; }
}

/* ── Overrides específicos del panel: refuerzan iwc-theme en rv-table ── */
/* Sticky header de rv-table tiene z-index más alto para no quedar bajo el overlay */
.rv-table thead th { z-index: 2; }

/* rv-card no hereda el border genérico del reset de .iwc-app div */
.iwc-app .rv-card {
  background: var(--rv-surface) !important;
  border: 1px solid var(--rv-border) !important;
  border-radius: var(--rv-radius) !important;
  box-shadow: var(--rv-shadow);
}

/* rv-batch-box tampoco debe heredar el reset */
.iwc-app .rv-batch-box {
  background: var(--rv-surface) !important;
  border-radius: var(--rv-radius) !important;
}

/* Log de lote */
.iwc-app #rv-batch-log {
  background: var(--rv-bg) !important;
  border: 1px solid var(--rv-border) !important;
}
