
/* Módulo POS Reportes */
.pos-admin-terminal-reportes .pos-admin-main,
.pos-reportes-main {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.pos-reportes-filtros {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(7, 89, 112, .14);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  grid-template-columns: 150px 150px 140px minmax(380px,1fr) auto;
  gap: 8px;
  align-items: end;
}

.pos-reportes-quick {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-weight: 900;
  color: #111827;
  text-transform: uppercase;
  font-size: 12px;
}

.pos-rbtn {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 7px;
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
}

.pos-rbtn:hover { border-color: #06b6d4; }
.pos-rbtn.active { background: #e0f7ff; border-color: #06b6d4; color: #075985; }

.pos-reportes-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.pos-reportes-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.pos-reportes-cards > div {
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-left: 4px solid #06b6d4;
}

.pos-reportes-cards span {
  color: #94a3b8;
  font-weight: 1000;
  text-transform: uppercase;
  font-size: 13px;
}

.pos-reportes-cards strong {
  color: #020617;
  font-size: 18px;
  font-weight: 1000;
}

.pos-reportes-tabs {
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(7,89,112,.12);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pos-reportes-tabs button {
  min-height: 38px;
  border: 1px solid #dbe4ef;
  background: #fff;
  border-radius: 7px;
  padding: 0 13px;
  font-weight: 900;
  color: #0f172a;
  cursor: pointer;
}

.pos-reportes-tabs button:hover { border-color: #06b6d4; }
.pos-reportes-tabs button.active { background: linear-gradient(135deg, #4ade80, #16a34a); color: #fff; border-color: #16a34a; }

.pos-reportes-content {
  min-height: 0;
  display: grid;
}

.pos-reportes-tab {
  display: none;
  min-height: 0;
  overflow: hidden;
}
.pos-reportes-tab.active { display: grid; }
.pos-reportes-tab .pos-table-wrap { min-height: 0; overflow: auto; }

.pos-reportes-chart-card {
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  padding: 12px;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.pos-reportes-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 8px;
}

.pos-reportes-chart-head h3 {
  margin: 0;
  color: #111827;
  font-size: 18px;
  font-weight: 1000;
  text-transform: uppercase;
}

.pos-reportes-chart-head strong { font-size: 22px; font-weight: 1000; color: #020617; }
#posRepCanvas { width: 100%; height: 100%; min-height: 280px; }

.pos-reportes-msg {
  min-height: 28px;
  padding: 6px 10px;
  color: #64748b;
  font-weight: 850;
}
.pos-reportes-msg.ok { color: #15803d; }
.pos-reportes-msg.err { color: #b91c1c; }
.pos-reportes-msg.loading { color: #0f172a; }

@media (max-width: 1200px) {
  body.fe-pos-fullscreen { overflow: auto !important; }
  .pos-admin-terminal-reportes { height: auto; min-height: 100vh; overflow: visible; }
  .pos-reportes-main { height: auto; min-height: calc(100vh - 58px); overflow: visible; }
  .pos-reportes-filtros { grid-template-columns: 1fr 1fr 1fr; }
  .pos-reportes-actions { justify-content: flex-start; }
  .pos-reportes-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .pos-reportes-filtros { grid-template-columns: 1fr; }
  .pos-reportes-cards { grid-template-columns: 1fr 1fr; }
  .pos-reportes-tabs { overflow-x: auto; flex-wrap: nowrap; }
}


/* Ajustes solicitados: sin botón Gráficos, iconos personalizados y Reporte de Caja visible */
.pos-reportes-tabs button img,
.pos-reportes-big-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 18px;
}
.pos-reportes-big-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}
.pos-reportes-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.pos-admin-terminal-reportes .pos-reportes-content {
  min-height: 0;
}
.pos-admin-terminal-reportes .pos-reportes-tab.active {
  min-height: 0;
}
.pos-admin-terminal-reportes .pos-table-wrap {
  min-height: 0;
}


/* Estados de Reporte de caja */
.pos-rep-estado {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 1000;
  font-size: 12px;
  text-transform: none;
  border: 1px solid transparent;
}
.pos-rep-estado.abierta {
  color: #166534;
  background: rgba(34,197,94,.14);
  border-color: rgba(34,197,94,.35);
}
.pos-rep-estado.cerrada {
  color: #991b1b;
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.35);
}
.pos-rep-estado.otro {
  color: #334155;
  background: rgba(148,163,184,.16);
  border-color: rgba(148,163,184,.35);
}

/* Ajuste: Generar reportes y Exportar siempre en una sola línea */
.pos-reportes-filtros {
  grid-template-columns: 135px 135px 130px minmax(300px, 1fr) 178px 118px !important;
  grid-auto-flow: row;
  align-items: end;
  gap: 8px;
}

#posRepGenerar {
  grid-column: 5 !important;
  grid-row: 1 !important;
}

#posRepExportar {
  grid-column: 6 !important;
  grid-row: 1 !important;
}

.pos-reportes-quick {
  grid-column: 4 !important;
  grid-row: 1 !important;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.pos-reportes-big-btn {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.pos-reportes-big-btn img {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
}

@media (max-width: 1320px) {
  .pos-reportes-filtros {
    grid-template-columns: 120px 120px 115px minmax(260px, 1fr) 158px 104px !important;
    gap: 6px;
  }
  .pos-rbtn { padding: 0 7px; font-size: 12px; }
  .pos-reportes-big-btn { font-size: 12px; padding: 0 8px; }
}

@media (max-width: 980px) {
  .pos-reportes-filtros {
    grid-template-columns: 1fr 1fr !important;
  }
  .pos-reportes-quick,
  #posRepGenerar,
  #posRepExportar {
    grid-column: auto !important;
    grid-row: auto !important;
  }
}

/* Anular desde Reportes -> Documentos emitidos (20260923) */
/* Banner + filtros comparten la 1ª fila del grid de .pos-reportes-main (auto auto auto 1fr auto):
   así los tabs siguen en su fila 'auto' y la tabla en la fila 1fr, con o sin banner. */
.pos-reportes-cabecera { display: grid; gap: 8px; min-width: 0; }
.pos-reportes-cabecera > .pos-rep-demo-banner { margin: 0; }
.pos-rep-demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
}
.pos-rep-demo-banner[hidden] { display: none; }
.pos-rep-demo-banner strong {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  letter-spacing: .04em;
}
.pos-rep-doc-estado {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: #e0f2fe;
  color: #075985;
}
.pos-rep-doc-estado.anulada,
.pos-rep-doc-estado.baja_aceptada { background: #f1f5f9; color: #334155; text-decoration: line-through; }
.pos-rep-doc-estado.baja_pendiente { background: #fef3c7; color: #92400e; }
.pos-rep-doc-estado.baja_rechazada { background: #fee2e2; color: #991b1b; }
.pos-rep-doc-estado.revision { background: #ffedd5; color: #9a3412; }
.pos-rep-anular {
  padding: 4px 12px;
  border: 1px solid #dc2626;
  border-radius: 6px;
  background: #fff;
  color: #dc2626;
  font-weight: 800;
  cursor: pointer;
}
.pos-rep-anular:hover:not(:disabled) { background: #dc2626; color: #fff; }
.pos-rep-anular:disabled { border-color: #cbd5e1; color: #94a3b8; cursor: not-allowed; }
.pos-rep-doc-sin-accion { color: #94a3b8; }
.pos-rep-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .55);
}
.pos-rep-modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.pos-rep-modal h3 { margin: 0 0 12px; font-size: 18px; }
.pos-rep-modal-datos { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; }
.pos-rep-modal-datos dt { color: #64748b; font-weight: 700; }
.pos-rep-modal-datos dd { margin: 0; font-weight: 800; }
.pos-rep-modal-aviso { margin: 0 0 12px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; color: #475569; font-size: 13px; }
.pos-rep-modal label { display: block; margin-bottom: 4px; font-weight: 800; }
.pos-rep-modal textarea { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; resize: vertical; }
.pos-rep-modal-error { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #fee2e2; color: #991b1b; font-size: 13px; }
.pos-rep-modal-error[hidden] { display: none; }
.pos-rep-modal-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
/* Botones deshabilitados del modal de anulación (p.ej. boleta sin la casilla de NO otorgada): visiblemente bloqueados. */
.pos-rep-modal-botones .pos-maestro-btn:disabled,
.pos-rep-modal-botones .pos-maestro-btn:disabled:hover { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; box-shadow: none; }
