/* FE POS — Diseño moderno punto de venta R&H
 * Paleta Celumania: azul #1A3C8F | verde #16A34A | gris #F8FAFC
 * Inputs táctiles 44px mínimo. Mobile-first responsive.
 * NUNCA max-width ni margin:0 auto (Error #10).
 */

.fepos-shell {
  padding: 16px 20px;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: #1f2937;
  background: #F8FAFC;
  min-height: 100%;
}

/* ═════ Header con toggle ═════ */
.fepos-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #E2E8F0;
}
.fepos-header-left { flex: 1 1 280px; }
.fepos-title {
  margin: 0 0 4px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1A3C8F;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fepos-info-btn {
  background: transparent;
  border: 1px solid #1A3C8F;
  border-radius: 50%;
  width: 32px; height: 32px;
  font-size: 1rem;
  cursor: pointer;
  color: #1A3C8F;
}
.fepos-info-btn:hover { background: #1A3C8F; color: #fff; }
.fepos-subtitle { font-size: 0.9rem; color: #64748B; }

.fepos-toggle-wrap {
  display: inline-flex;
  background: #fff;
  border-radius: 14px;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  border: 1px solid #E2E8F0;
}
.fepos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: #64748B;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.18s;
  min-height: 44px;
}
.fepos-toggle-ico { font-size: 1.2rem; }
.fepos-toggle.active {
  background: linear-gradient(135deg, #1A3C8F 0%, #2D55B3 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 60, 143, 0.35);
}
.fepos-toggle:not(.active):hover { background: #F1F5F9; color: #1A3C8F; }

/* ═════ Layout 2 columnas ═════ */
.fepos-main {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
}
@media (max-width: 1024px) {
  .fepos-main { grid-template-columns: 1fr; }
}
.fepos-col-left, .fepos-col-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ═════ Cards ═════ */
.fepos-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.fepos-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: #1A3C8F;
}
.fepos-card-selected { border-color: #16A34A; background: #F0FDF4; }
.fepos-badge {
  background: #EEF2FF;
  color: #4F46E5;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.fepos-badge-warn { background: #FEF3C7; color: #92400E; }
.fepos-badge-ok { background: #DCFCE7; color: #166534; }

.fepos-btn-link {
  background: none; border: none;
  color: #1A3C8F;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
}
.fepos-btn-link:hover { text-decoration: underline; }

/* ═════ Inputs ═════ */
.fepos-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  min-height: 44px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.fepos-input:focus { border-color: #1A3C8F; box-shadow: 0 0 0 3px rgba(26, 60, 143, 0.1); }
.fepos-input-scan {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  letter-spacing: 0.5px;
}

/* ═════ Resultados de búsqueda ═════ */
.fepos-resultados {
  margin-top: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.fepos-resultados:empty { margin-top: 0; }
.fepos-res-row {
  padding: 10px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  background: #fff;
  transition: all 0.12s;
}
.fepos-res-row:hover, .fepos-res-active {
  background: #EEF2FF;
  border-color: #1A3C8F;
}
.fepos-res-meta {
  font-size: 0.82rem;
  color: #64748B;
  margin-top: 2px;
}

/* ═════ Cliente seleccionado ═════ */
.fepos-cliente-info { padding: 4px 0; }
.fepos-cliente-nombre {
  font-size: 1.1rem;
  font-weight: 600;
  color: #166534;
}
.fepos-cliente-meta {
  font-size: 0.85rem;
  color: #4B5563;
  margin-top: 4px;
}

/* ═════ Tabla detalle ═════ */
.fepos-table-wrap { overflow-x: auto; }
.fepos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.fepos-table thead th {
  text-align: left;
  padding: 8px;
  background: #F8FAFC;
  border-bottom: 2px solid #E2E8F0;
  color: #64748B;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fepos-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.fepos-line-name { font-weight: 600; color: #1f2937; }
.fepos-line-meta { font-size: 0.78rem; color: #64748B; margin-top: 2px; }
.fepos-line-price { text-align: right; color: #4B5563; }
.fepos-line-total { text-align: right; color: #1A3C8F; }
.fepos-line-input {
  width: 72px;
  padding: 8px;
  text-align: center;
  border: 1.5px solid #E2E8F0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  min-height: 44px;
  box-sizing: border-box;
}
.fepos-line-input-sm { width: 80px; }
.fepos-line-input:focus { border-color: #1A3C8F; outline: none; }

.fepos-btn-icon {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FCA5A5;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}
.fepos-btn-icon:hover { background: #DC2626; color: #fff; }

/* ═════ Resumen ═════ */
.fepos-resumen { background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%); }
.fepos-resumen-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: #4B5563;
  font-size: 0.95rem;
}
.fepos-resumen-row b { color: #1f2937; }
.fepos-resumen-total {
  border-top: 2px solid #1A3C8F;
  margin-top: 8px;
  padding-top: 10px;
  font-size: 1.2rem;
}
.fepos-resumen-total span, .fepos-resumen-total b {
  color: #1A3C8F;
  font-weight: 700;
}

/* ═════ Pagos ═════ */
.fepos-tipo-venta {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px;
  background: #F8FAFC;
  border-radius: 10px;
}
.fepos-tipo-venta label {
  cursor: pointer;
  font-weight: 500;
  color: #4B5563;
}
.fepos-tipo-venta input { margin-right: 4px; }

.fepos-pagos-medios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.fepos-btn-medio {
  padding: 14px 10px;
  border: 1.5px solid #E2E8F0;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1f2937;
  min-height: 56px;
  transition: all 0.15s;
}
.fepos-btn-medio:hover {
  background: #EEF2FF;
  border-color: #1A3C8F;
  color: #1A3C8F;
}
.fepos-pagos-list {
  border-top: 1px dashed #E2E8F0;
  padding-top: 10px;
  margin-top: 6px;
}
.fepos-pago-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  gap: 8px;
  border-bottom: 1px solid #F1F5F9;
}
.fepos-pago-medio { color: #4B5563; font-size: 0.9rem; }
.fepos-info-credito {
  padding: 10px;
  background: #FEF3C7;
  color: #92400E;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

/* ═════ Botones de acción ═════ */
.fepos-acciones {
  display: flex;
  gap: 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.fepos-btn-save, .fepos-btn-cancel {
  flex: 1;
  padding: 14px 18px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  min-height: 52px;
}
.fepos-btn-save {
  background: linear-gradient(135deg, #16A34A 0%, #15803D 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.35);
}
.fepos-btn-save:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(22, 163, 74, 0.45);
}
.fepos-btn-save:disabled { opacity: 0.5; cursor: not-allowed; }
.fepos-btn-cancel {
  background: #fff;
  color: #64748B;
  border: 1.5px solid #E2E8F0;
}
.fepos-btn-cancel:hover { background: #F8FAFC; border-color: #94A3B8; }

/* ═════ Modal ═════ */
.fepos-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.fepos-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}
.fepos-modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3);
}
.fepos-modal-card h3 {
  margin: 0 0 6px;
  color: #1A3C8F;
  font-size: 1.2rem;
}
.fepos-modal-card h4 {
  margin: 12px 0 4px;
  color: #1f2937;
  font-size: 0.95rem;
}
.fepos-modal-meta {
  font-size: 0.85rem;
  color: #64748B;
  margin-bottom: 14px;
}
.fepos-modal-card label {
  display: block;
  font-size: 0.85rem;
  color: #64748B;
  margin: 14px 0 4px;
  font-weight: 500;
}
.fepos-modal-card input[type="number"],
.fepos-modal-card input[type="text"] {
  width: 100%;
  padding: 14px;
  font-size: 1.3rem;
  text-align: center;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  color: #1A3C8F;
  box-sizing: border-box;
}
.fepos-modal-card input:focus {
  border-color: #1A3C8F;
  outline: none;
  box-shadow: 0 0 0 4px rgba(26, 60, 143, 0.1);
}
.fepos-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* ═════ Modal "Enviando DIAN..." ═════ */
.fepos-modal-loading {
  text-align: center;
  padding: 30px;
}
.fepos-modal-loading h3 {
  color: #1A3C8F;
  margin: 20px 0 10px;
}
.fepos-modal-loading p {
  color: #64748B;
  margin: 0;
}
.fepos-spinner {
  width: 56px; height: 56px;
  border: 5px solid #EEF2FF;
  border-top-color: #1A3C8F;
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: fp-spin 0.9s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }

/* ═════ Recibo final ═════ */
.fepos-recibo-totales {
  background: #F8FAFC;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.fepos-recibo-totales > div {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}
.fepos-recibo-dian {
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.fepos-dian-ok { background: #F0FDF4; border: 1.5px solid #16A34A; }
.fepos-dian-err { background: #FEF2F2; border: 1.5px solid #DC2626; color: #7F1D1D; }
.fepos-dian-pend { background: #FEF3C7; border: 1.5px solid #F59E0B; }
.fepos-cufe { font-size: 0.78rem; word-break: break-all; margin: 6px 0; color: #4B5563; }
.fepos-cufe code { background: #F1F5F9; padding: 2px 6px; border-radius: 4px; }
.fepos-dian-errmsg { font-size: 0.85rem; color: #7F1D1D; margin-top: 6px; }

/* ═════ Alerts inline ═════ */
.fepos-alert {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 500;
}
.fepos-alert-warn { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.fepos-alert-err  { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.fepos-alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }

/* ═════ Mobile ═════ */
@media (max-width: 640px) {
  .fepos-shell { padding: 12px; }
  .fepos-toggle { padding: 8px 12px; font-size: 0.85rem; }
  .fepos-toggle-lbl { display: none; }
  .fepos-modal-card { padding: 18px; }
}

/* ═════ Header right (view switcher + tipo toggle) ═════ */
.fepos-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* Vista Nueva / Historial */
.fepos-view-sw {
  display: inline-flex;
  background: #F1F5F9;
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  border: 1px solid #E2E8F0;
}
.fepos-vsw {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: #64748B;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s;
}
.fepos-vsw.fepos-vsw-on {
  background: #1A3C8F;
  color: #fff;
  box-shadow: 0 2px 6px rgba(26,60,143,0.28);
}
.fepos-vsw:not(.fepos-vsw-on):hover { background: #E2E8F0; color: #1A3C8F; }

/* ═════ Historial ═════ */
/* ══════════════════════════════════════════════════════════════
   HISTORIAL FE-POS — Diseño moderno (v05)
   ══════════════════════════════════════════════════════════════ */

/* Stats bar */
.fh-stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  background: linear-gradient(135deg, #1A3C8F 0%, #2563EB 100%);
  border-radius: 12px 12px 0 0;
  padding: 16px 24px;
  color: #fff;
  flex-wrap: wrap;
}
.fh-stat {
  flex: 1 1 80px;
  text-align: center;
  padding: 0 12px;
}
.fh-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.fh-stat-lbl {
  font-size: 0.72rem;
  opacity: 0.8;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fh-stat-div {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.25);
  flex-shrink: 0;
}

/* Filtros */
.fh-filtros-wrap {
  background: #F8FAFC;
  border-left: 1px solid #E2E8F0;
  border-right: 1px solid #E2E8F0;
  padding: 14px 20px 10px;
}
.fh-filtro-top {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.fh-search-wrap {
  flex: 1 1 220px;
  position: relative;
  display: flex;
  align-items: center;
}
.fh-search-ico {
  position: absolute;
  left: 10px;
  font-size: 0.95rem;
  pointer-events: none;
}
.fh-search-inp {
  width: 100%;
  padding: 9px 34px 9px 32px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.fh-search-inp:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.fh-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 2px 4px;
}
.fh-search-clear:hover { color: #1A3C8F; }
.fh-fecha-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.fh-fecha-lbl {
  font-weight: 600;
  font-size: 0.85rem;
  color: #475569;
  white-space: nowrap;
}
.fh-fecha-inp {
  padding: 8px 10px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  font-size: 0.88rem;
  background: #fff;
  cursor: pointer;
}
.fh-fecha-inp:focus { outline: none; border-color: #2563EB; }

/* Chips de filtro */
.fh-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.fh-chips-group { display: flex; gap: 5px; flex-wrap: wrap; }
.fh-chips-sep {
  width: 1px;
  height: 22px;
  background: #CBD5E1;
  flex-shrink: 0;
  margin: 0 4px;
}
.fh-chip {
  padding: 4px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 20px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.fh-chip:hover { border-color: #2563EB; color: #1A3C8F; background: #EFF6FF; }
.fh-chip-on   { border-color: #1A3C8F; background: #1A3C8F; color: #fff; }
.fh-chip-on:hover { background: #1e40af; }

/* Tabla */
.fh-table-wrap {
  overflow-x: auto;
  border: 1px solid #E2E8F0;
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15,23,42,0.06);
}
.fh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.fh-table thead tr {
  background: #F1F5F9;
}
.fh-table thead th {
  padding: 11px 10px;
  font-weight: 700;
  color: #1A3C8F;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid #E2E8F0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.fh-th-consec { width: 130px; }
.fh-th-hora   { width: 56px; text-align: center; }
.fh-th-r      { text-align: right; width: 100px; }
.fh-th-c      { text-align: center; width: 110px; }
.fh-th-sub    { font-size: 0.72rem; font-weight: 400; color: #64748b; text-transform: none; letter-spacing: 0; }

.fh-row { transition: background 0.12s; cursor: default; }
.fh-row:hover { background: #F0F7FF; }
.fh-row:last-child td { border-bottom: none; }

.fh-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

/* Consecutivo */
.fh-td-consec { width: 130px; }
.fh-consec-int {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1A3C8F;
  font-family: 'Courier New', monospace;
}
.fh-legal {
  display: inline-block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #16A34A;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.3px;
}
.fh-legal-off { color: #94a3b8; background: #F8FAFC; border-color: #E2E8F0; }

/* Hora */
.fh-td-hora { text-align: center; color: #64748b; font-size: 0.85rem; }

/* Cliente */
.fh-td-cliente { min-width: 160px; }
.fh-cliente-nom { font-weight: 600; color: #1e293b; }
.fh-cliente-ced { font-size: 0.75rem; color: #94a3b8; margin-top: 1px; }

/* Total */
.fh-td-total {
  text-align: right;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  white-space: nowrap;
}

/* Badges */
.fh-td-badge { text-align: center; }
.fh-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.fh-badge-ok    { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.fh-badge-pend  { background: #FFFBEB; color: #92400e; border: 1px solid #FDE68A; }
.fh-badge-err   { background: #FFF7ED; color: #9a3412; border: 1px solid #FED7AA; }
.fh-badge-off   { background: #F1F5F9; color: #64748b; border: 1px solid #E2E8F0; }
.fh-badge-cont  { background: #EFF6FF; color: #1d4ed8; border: 1px solid #BFDBFE; }
.fh-badge-cred  { background: #FDF4FF; color: #7e22ce; border: 1px solid #E9D5FF; }
.fh-badge-canc  { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.fh-badge-pend2 { background: #FFF7ED; color: #c2410c; border: 1px solid #FED7AA; }

/* Empty / loading */
.fh-empty {
  text-align: center;
  padding: 40px 16px;
  color: #94a3b8;
  font-size: 0.95rem;
}
.fh-spin { display: inline-block; animation: fh-rotate 1s linear infinite; }
@keyframes fh-rotate { to { transform: rotate(360deg); } }

/* Botón imprimir */
.fh-td-print { text-align: center; width: 50px; }
.fepos-hist-print-btn {
  background: none;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05rem;
  padding: 5px 8px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
}
.fepos-hist-print-btn:hover {
  background: #EFF6FF;
  border-color: #1A3C8F;
  transform: scale(1.1);
}

/* ═════ Selector de lista de precios (card producto) ═════ */
.fepos-lista-sel {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 0 4px;
}
.fepos-lista-btn {
  flex: 1;
  min-width: 70px;
  padding: 6px 10px;
  border: 2px solid #CBD5E1;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.fepos-lista-btn:hover  { border-color: #1A3C8F; color: #1A3C8F; }
.fepos-lista-btn-on     { border-color: #1A3C8F; background: #1A3C8F; color: #fff; }

/* ═════ Chips de lista en modal cantidad ═════ */
.fepos-listas-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fepos-lista-chip {
  flex: 1;
  min-width: 80px;
  padding: 8px 6px;
  border: 2px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
  color: #374151;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  line-height: 1.4;
  transition: all .15s;
}
.fepos-lista-chip:hover   { border-color: #1A3C8F; }
.fepos-lista-chip-on      { border-color: #1A3C8F; background: #EEF2FF; color: #1A3C8F; font-weight: 700; }

/* ═════ Badge de tope de descuento ═════ */
.fepos-tope-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  background: #DCFCE7;
  color: #166534;
  font-weight: 600;
}
.fepos-tope-sin {
  background: #FEE2E2;
  color: #991B1B;
}
}

/* ═══════════════════════════════════════════════════════════════════════════
   PANEL DE CONSECUTIVOS DIAN — muestra estado DRH en tiempo real
   ═══════════════════════════════════════════════════════════════════════════ */
.fepos-cons-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #EEF2FF 0%, #F0FDF4 100%);
  border: 1px solid #C7D2FE;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #3730A3;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.fepos-cons-panel:hover {
  background: linear-gradient(135deg, #E0E7FF 0%, #DCFCE7 100%);
  border-color: #818CF8;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}
.fepos-cons-drh {
  font-size: 1rem;
  font-weight: 800;
  color: #1A3C8F;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  letter-spacing: 0.5px;
}
.fepos-cons-sep { color: #CBD5E1; margin: 0 2px; }
.fepos-cons-pct {
  font-weight: 700;
  color: #16A34A;
}
.fepos-cons-pct-warn { color: #D97706; }
.fepos-cons-pct-danger { color: #DC2626; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL ÉXITO DIAN — Animación logo R&H al aprobar factura electrónica
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay con gradiente azul corporativo */
.fepos-modal-dian-success {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 50% 30%,
    rgba(26, 60, 143, 0.97) 0%,
    rgba(10, 25, 77, 0.99) 100%);
  animation: fp-overlay-in 0.35s ease-out;
}
@keyframes fp-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Partículas flotantes decorativas */
.fepos-dian-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.fepos-dian-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: fp-particle-float 3s ease-in-out infinite;
}
.fepos-dian-particle:nth-child(1) { width: 6px; height: 6px; background: #60A5FA; left: 15%; top: 20%; animation-delay: 0s; }
.fepos-dian-particle:nth-child(2) { width: 4px; height: 4px; background: #34D399; left: 80%; top: 15%; animation-delay: 0.4s; }
.fepos-dian-particle:nth-child(3) { width: 8px; height: 8px; background: #FCD34D; left: 25%; top: 75%; animation-delay: 0.8s; }
.fepos-dian-particle:nth-child(4) { width: 5px; height: 5px; background: #F9A8D4; left: 70%; top: 70%; animation-delay: 1.2s; }
.fepos-dian-particle:nth-child(5) { width: 4px; height: 4px; background: #60A5FA; left: 50%; top: 85%; animation-delay: 1.6s; }
.fepos-dian-particle:nth-child(6) { width: 6px; height: 6px; background: #A78BFA; left: 10%; top: 50%; animation-delay: 2.0s; }
@keyframes fp-particle-float {
  0%   { opacity: 0; transform: translateY(0) scale(0.5); }
  20%  { opacity: 0.8; }
  80%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-40px) scale(1.2); }
}

/* Card central */
.fepos-dian-success-card {
  position: relative;
  background: #fff;
  border-radius: 24px;
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: fp-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fp-card-in {
  from { opacity: 0; transform: scale(0.7) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Wrapper del logo con efecto glow */
.fepos-dian-logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}
.fepos-dian-logo-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(37, 99, 235, 0.25) 0%,
    rgba(26, 60, 143, 0.1) 60%,
    transparent 80%);
  animation: fp-glow-pulse 2s ease-in-out infinite;
}
@keyframes fp-glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%       { transform: scale(1.15); opacity: 1; }
}
.fepos-dian-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 16px;
  position: relative;
  animation: fp-logo-reveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
  filter: drop-shadow(0 8px 24px rgba(26, 60, 143, 0.35));
}
@keyframes fp-logo-reveal {
  from { opacity: 0; transform: scale(0.4) rotate(-10deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Check de aprobado */
.fepos-dian-check {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #16A34A, #15803D);
  border-radius: 50%;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.5);
  animation: fp-check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}
@keyframes fp-check-pop {
  from { opacity: 0; transform: scale(0); }
  to   { opacity: 1; transform: scale(1); }
}

/* Textos del modal */
.fepos-dian-success-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1A3C8F;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.fepos-dian-success-sub {
  font-size: 0.9rem;
  color: #64748B;
  margin: 0 0 20px;
}

/* Datos de la factura aprobada */
.fepos-dian-fact-info {
  background: linear-gradient(135deg, #F8FAFC, #EEF2FF);
  border: 1px solid #C7D2FE;
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  margin-bottom: 16px;
}
.fepos-dian-fact-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #E2E8F0;
  font-size: 0.88rem;
}
.fepos-dian-fact-row:last-child { border-bottom: none; }
.fepos-dian-fact-lbl { color: #64748B; }
.fepos-dian-fact-val {
  font-weight: 700;
  color: #1A3C8F;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.82rem;
}
.fepos-dian-fact-val-green { color: #166534; }
.fepos-dian-cufe-row {
  background: #F1F5F9;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 0.72rem;
  color: #64748B;
  word-break: break-all;
  text-align: left;
}
.fepos-dian-cufe-lbl { font-weight: 600; color: #475569; display: block; margin-bottom: 2px; }

/* Barra de botones */
.fepos-dian-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.fepos-dian-btn-primary {
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1A3C8F, #2D55B3);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 3px 10px rgba(26, 60, 143, 0.35);
}
.fepos-dian-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(26, 60, 143, 0.45);
}
.fepos-dian-btn-secondary {
  padding: 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  background: #fff;
  color: #4B5563;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.fepos-dian-btn-secondary:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
}
.fepos-dian-btn-full {
  grid-column: 1 / -1;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #16A34A, #15803D);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: 0 3px 10px rgba(22, 163, 74, 0.35);
}
.fepos-dian-btn-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(22, 163, 74, 0.45);
}

/* Animación de salida */
.fepos-modal-dian-success.fp-closing {
  animation: fp-overlay-out 0.25s ease-in forwards;
}
.fepos-modal-dian-success.fp-closing .fepos-dian-success-card {
  animation: fp-card-out 0.25s ease-in forwards;
}
@keyframes fp-overlay-out {
  to { opacity: 0; }
}
@keyframes fp-card-out {
  to { opacity: 0; transform: scale(0.9) translateY(20px); }
}

/* Responsive modal */
@media (max-width: 480px) {
  .fepos-dian-success-card { padding: 28px 20px 24px; }
  .fepos-dian-logo { width: 90px; height: 90px; }
  .fepos-dian-actions { grid-template-columns: 1fr; }
  .fepos-dian-btn-full { grid-column: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MEJORAS GENERALES — UI más profesional
   ═══════════════════════════════════════════════════════════════════════════ */

/* Header gradient bar */
.fepos-header {
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 50%, #F0FDF4 100%);
  border-radius: 14px;
  padding: 16px 20px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  margin-bottom: 20px;
  border-bottom: none;
}

/* Cards con sombra elevada al hover */
.fepos-card {
  transition: box-shadow 0.2s, transform 0.15s;
}
.fepos-card:hover {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* Resumen card con gradiente premium */
.fepos-resumen {
  background: linear-gradient(160deg, #F0F4FF 0%, #EEF2FF 40%, #F0FDF4 100%) !important;
  border-color: #C7D2FE !important;
}

/* Animación de entrada para el spinner de DIAN */
.fepos-modal-loading {
  animation: fp-fade-up 0.3s ease-out;
}
@keyframes fp-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Spinner DIAN más vistoso */
.fepos-spinner {
  background: conic-gradient(transparent 0deg, #1A3C8F 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
  border: none;
  border-radius: 50%;
}

/* Botón guardar con shimmer al hover */
.fepos-btn-save::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.4s;
}
.fepos-btn-save {
  position: relative;
  overflow: hidden;
}
.fepos-btn-save:hover:not(:disabled)::after {
  transform: translateX(100%);
}

/* Electrónica badge en el toggle */
.fepos-toggle.active[data-ele="1"]::before {
  content: '🇨🇴 ';
}

/* ═════ Mini-barra inline (qty + nota al seleccionar producto) ═════ */
.fepos-minibar {
  background: #EFF6FF;
  border: 1.5px solid #93C5FD;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 4px 0;
}
.fepos-minibar-prod {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1A3C8F;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fepos-minibar-lista {
  font-size: 0.78rem;
  color: #64748B;
  font-weight: 500;
}
.fepos-minibar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fepos-minibar-lbl {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}
.fepos-minibar-inp {
  flex: 0 0 80px;
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid #93C5FD;
  border-radius: 6px;
  font-size: 1rem;
  text-align: center;
  font-weight: 700;
  background: #fff;
  color: #1e293b;
  outline: none;
}
.fepos-minibar-inp:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.fepos-minibar-qty { font-size: 1.1rem; }
.fepos-minibar-nota {
  flex: 1 1 140px;
  min-width: 100px;
  text-align: left;
  font-weight: 400;
  font-size: 0.88rem;
}
.fepos-minibar-meta {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.fepos-minibar-ok {
  flex: 1;
  height: 38px;
  background: #16A34A;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.fepos-minibar-ok:hover { background: #15803D; }
.fepos-minibar-x {
  height: 38px;
  padding: 0 14px;
  background: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}
.fepos-minibar-x:hover { background: #E2E8F0; }

/* ═════ Avisos pago (crédito / mixto) ═════ */
.fepos-info-credito,
.fepos-info-mixto {
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #92400E;
  margin-bottom: 10px;
  line-height: 1.5;
}
.fepos-info-credito { background: #EFF6FF; border-color: #93C5FD; color: #1e3a8a; }

/* ═════ v5 — Resumen cartera/cupo del cliente ═════ */
.fepos-resumen-wrap { margin: 10px 0 4px; }
.fepos-resumen-panel {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
}
.fepos-resumen-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.fepos-resumen-row:last-child { margin-bottom: 0; }
.fepos-resumen-lbl  { color: #64748b; font-size: 11px; }
.fepos-resumen-val  { font-weight: 700; color: #1e293b; }
.fepos-resumen-vencido {
  background: #fef2f2; color: #b91c1c;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.fepos-resumen-cupo  { color: #475569; font-size: 12px; }
.fepos-resumen-disp  { color: #16a34a; font-weight: 700; font-size: 12px; }
.fepos-resumen-nocupo { color: #94a3b8; font-size: 12px; font-style: italic; }
.fepos-resumen-alerta {
  background: #fef9c3; border: 1px solid #fde68a;
  border-radius: 6px; padding: 6px 10px; font-size: 11px;
  color: #854d0e; margin-top: 6px; line-height: 1.4;
}
.fepos-resumen-cargando { color: #94a3b8; font-size: 11px; font-style: italic; display: block; padding: 8px 0; }

/* ═════ v5 — Selector tipo de factura ═════ */
.fepos-tipo-wrap {
  display: flex; gap: 6px; margin: 8px 0 4px;
}
.fepos-tipo-btn {
  flex: 1; padding: 8px 6px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; background: #f8fafc; color: #475569;
  font-size: 12px; cursor: pointer; transition: all .15s; font-family: inherit;
}
.fepos-tipo-btn.active {
  background: #1A3C8F; color: white; border-color: #1A3C8F; font-weight: 700;
}
.fepos-tipo-btn.disabled { opacity: 0.6; cursor: default; }

/* ═════ v5 — Badge en tabs ═════ */
.fepos-tab-badge {
  display: inline-block;
  background: #dc2626; color: white; border-radius: 20px;
  font-size: 10px; font-weight: 700; padding: 0 5px; min-width: 16px;
  text-align: center; margin-left: 4px; line-height: 16px; vertical-align: middle;
}

/* ═════ v5 — Modal supera cupo ═════ */
.fepos-cupo-card { text-align: center; }
.fepos-cupo-icon { font-size: 36px; margin-bottom: 8px; }
.fepos-cupo-detalle { background: #f8fafc; border-radius: 8px; padding: 12px; margin: 12px 0; font-size: 13px; line-height: 1.7; }

/* ═════ v5 — Modal despacho post-guardado ═════ */
.fepos-despacho-card { text-align: center; }
.fepos-despacho-check { font-size: 36px; margin-bottom: 8px; }
.fepos-despacho-opciones {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0;
}
.fepos-despacho-btn {
  border: 2px solid #e2e8f0; border-radius: 12px; padding: 16px 10px;
  background: #f8fafc; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 4px; transition: all .15s; font-family: inherit;
}
.fepos-despacho-btn:hover:not(:disabled) { border-color: #1A3C8F; background: #eff6ff; }
.fepos-despacho-btn:disabled { opacity: 0.6; cursor: wait; }
.fepos-despacho-ico  { font-size: 28px; }
.fepos-despacho-lbl  { font-weight: 700; font-size: 13px; color: #1e293b; }
.fepos-despacho-sub  { font-size: 11px; color: #64748b; }
.fepos-despacho-recoge:hover:not(:disabled) { border-color: #16a34a; background: #f0fdf4; }
.fepos-despacho-envia:hover:not(:disabled)  { border-color: #f97316; background: #fff7ed; }

/* ═════ v5 — Sección Pendientes de Salida ═════ */
.fepos-pendientes-wrap { padding: 0 0 24px; }
.fepos-pend-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.fepos-pend-title { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0; }
.fepos-pend-filtros { display: flex; gap: 8px; align-items: center; }
.fepos-pend-select {
  padding: 6px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  font-size: 13px; background: white; font-family: inherit; cursor: pointer;
}
.fepos-btn-icon {
  padding: 6px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px;
  background: #f8fafc; cursor: pointer; font-size: 14px;
}
.fepos-pend-lista { display: flex; flex-direction: column; gap: 10px; }
.fepos-pend-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 40px 0; }
.fepos-pend-err   { color: #dc2626; }

.fepos-pend-card {
  border: 1.5px solid #e2e8f0; border-left-width: 4px;
  border-radius: 10px; padding: 14px 16px; background: white;
  display: flex; flex-direction: column; gap: 8px;
}
.fepos-pend-pendiente { border-left-color: #f59e0b; }
.fepos-pend-hoy       { border-left-color: #f97316; }
.fepos-pend-vencida   { border-left-color: #dc2626; background: #fef2f2; }

.fepos-pend-card-top {
  display: flex; justify-content: space-between; align-items: center;
}
.fepos-pend-estado { font-size: 12px; font-weight: 600; }
.fepos-pend-total  { font-size: 15px; font-weight: 700; color: #1e293b; }
.fepos-pend-cli {
  font-size: 13px; display: flex; justify-content: space-between; align-items: center;
}
.fepos-pend-fac { font-size: 11px; color: #94a3b8; }
.fepos-pend-btns { display: flex; gap: 8px; }

.fepos-btn-accion {
  padding: 7px 14px; border: none; border-radius: 7px;
  font-size: 12px; cursor: pointer; font-weight: 600; font-family: inherit;
}
.fepos-btn-salida { background: #16a34a; color: white; }
.fepos-btn-salida:hover { background: #15803d; }

/* Alerta urgente de cobro (> 40 días vencido) */
.fepos-resumen-cobro-urgente {
  background: #fef2f2; border: 1.5px solid #dc2626; border-radius: 6px;
  color: #dc2626; font-size: 12px; font-weight: 700;
  padding: 7px 10px; margin-top: 6px;
  animation: fepos-pulse-red 1.5s ease-in-out infinite;
}
@keyframes fepos-pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(220,38,38,0); }
}

