/* ===== Modulo Facturacion (D2.2) ===== */
.haon-fact-toolbar {
  display: flex; align-items: center; gap: 16px; margin: 24px 0 20px;
  flex-wrap: wrap;
}
.haon-fact-search-wrap { flex: 1; min-width: 280px; }
.haon-fact-search {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04); color: #fff; font-size: 14px;
  outline: none; transition: border-color 0.2s, background 0.2s;
}
.haon-fact-search::placeholder { color: rgba(255,255,255,0.4); }
.haon-fact-search:focus {
  border-color: #fbbf24; background: rgba(255,255,255,0.06);
}
.haon-fact-total-pill {
  padding: 8px 16px; border-radius: 999px;
  background: rgba(251,191,36,0.12); color: #fbbf24;
  font-size: 13px; white-space: nowrap;
}
.haon-fact-total-pill strong { font-weight: 700; }

.haon-fact-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: rgba(255,255,255,0.02); border-radius: 12px;
  overflow: hidden; font-size: 14px;
}
.haon-fact-table thead th {
  text-align: left; padding: 14px 18px; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.55); font-weight: 600;
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.haon-fact-table thead th.haon-fact-th-right { text-align: right; }
.haon-fact-table tbody tr.haon-fact-row {
  cursor: pointer; transition: background 0.15s;
}
.haon-fact-table tbody tr.haon-fact-row:hover {
  background: rgba(251,191,36,0.06);
}
.haon-fact-table tbody td {
  padding: 16px 18px; color: #e5e7eb;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: middle;
}
.haon-fact-table tbody tr:last-child td { border-bottom: none; }

.haon-fact-tipo {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  background: rgba(96,165,250,0.15); color: #93c5fd;
  font-size: 12px; font-weight: 600;
}
.haon-fact-receptor { font-weight: 600; color: #fff; }
.haon-fact-receptor-rfc {
  font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 2px;
}
.haon-fact-importe {
  text-align: right; font-weight: 600; color: #fff;
  font-variant-numeric: tabular-nums;
}
.haon-fact-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.haon-fact-badge-ok {
  background: rgba(29,158,117,0.18); color: #5dcaa5;
}


/* ===== Modulo Facturacion - Detalle inline (D2.3a) ===== */
.haon-fact-det-header { margin: 20px 0 16px; }
.haon-fact-back-btn {
  background: transparent; border: none; color: #fbbf24; cursor: pointer;
  font-size: 14px; padding: 6px 0; margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: opacity 0.2s;
}
.haon-fact-back-btn:hover { opacity: 0.7; }
.haon-fact-det-title {
  font-size: 28px; font-weight: 700; color: #fff; margin: 0;
}
.haon-fact-det-sub {
  font-size: 13px; color: rgba(255,255,255,0.45);
  font-family: 'SF Mono', Menlo, monospace; margin-top: 4px;
}
.haon-fact-det-chips {
  display: flex; gap: 28px; margin: 20px 0 24px; flex-wrap: wrap;
}
.haon-fact-chip { display: flex; flex-direction: column; gap: 6px; }
.haon-fact-chip-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5); font-weight: 600;
}
.haon-fact-badge-warn {
  background: rgba(251,191,36,0.18); color: #fbbf24;
}
.haon-fact-det-actions {
  display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap;
}
.haon-fact-action-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04); color: #fff;
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.haon-fact-action-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2);
}
.haon-fact-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.haon-fact-action-primary { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.3); color: #fbbf24; }
.haon-fact-action-icon { width: 16px; height: 16px; vertical-align: middle; }

.haon-fact-det-card {
  background: rgba(255,255,255,0.03); border-radius: 12px;
  padding: 24px; border: 1px solid rgba(255,255,255,0.06);
}
.haon-fact-det-section {
  font-size: 16px; font-weight: 600; color: #fff;
  margin: 0 0 18px; padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.haon-fact-det-row {
  display: grid; grid-template-columns: 200px 1fr;
  padding: 10px 0; gap: 16px; align-items: start;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.haon-fact-det-row:last-child { border-bottom: none; }
.haon-fact-det-label {
  color: rgba(255,255,255,0.55); font-size: 14px;
}
.haon-fact-det-value {
  color: #e5e7eb; font-size: 14px; word-break: break-word;
}
.haon-fact-det-mono {
  font-family: 'SF Mono', Menlo, monospace; font-size: 13px;
  color: #fbbf24;
}


/* ===== Modulo Facturacion - Dropdown descargar (D2.3b) ===== */
.haon-fact-dropdown { position: relative; display: inline-block; }
.haon-fact-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 180px;
  background: #1a2a3a; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  z-index: 100;
}
.haon-fact-dd-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 6px; border: none;
  background: transparent; color: #fff; cursor: pointer;
  font-size: 14px; text-align: left;
  transition: background 0.12s;
}
.haon-fact-dd-item:hover { background: rgba(251,191,36,0.12); color: #fbbf24; }
.haon-fact-dd-icon { width: 16px; height: 16px; }


/* ===== Cancelar Factura (root only) ===== */
.haon-fact-action-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.45);
  transition: all 0.15s ease;
}
.haon-fact-action-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.7);
  color: #fff;
}

/* ===== HAON MOBILE CONSOLIDADO (<=820px) - 20260610-014602 ===== */
@keyframes haonNudge{0%,100%{transform:translateX(0)}50%{transform:translateX(-10px)}}
@media (max-width:820px){
  /* Tablas: full-bleed + scroll horizontal tactil */
  .haon-scroll-x{overflow-x:auto;-webkit-overflow-scrolling:touch;width:100vw;max-width:100vw;margin-left:calc(50% - 50vw);padding:0 10px;box-sizing:border-box;}
  .haon-scroll-x table{min-width:680px;}
  .haon-scroll-x::-webkit-scrollbar{height:6px;}
  .haon-scroll-x::-webkit-scrollbar-thumb{background:rgba(255,255,255,.25);border-radius:3px;}
  /* Vistas: aprovechar todo el ancho */
  .haon-view{padding-left:12px;padding-right:12px;max-width:100%;box-sizing:border-box;align-items:stretch;}
  .haon-view > *:not(.haon-scroll-x){max-width:100%;width:auto;margin-left:0;margin-right:0;}
  .haon-search-wrap{width:100%;max-width:100%;margin:0;padding:20px 0;box-sizing:border-box;}
  .haon-search-heading{width:100%;text-align:left;margin:0;}
  .haon-search-input-naval{width:100%;max-width:100%;box-sizing:border-box;}
  input[type="text"],input[type="search"],input[type="email"],input[type="password"]{max-width:100%;box-sizing:border-box;}
}

/* ===== Fase A.2: badge cancelada ===== */
.haon-fact-badge-cancel{background:rgba(245,158,11,.15);color:#fbbf24;border:1px solid rgba(245,158,11,.35);padding:3px 10px;border-radius:12px;font-size:12px;white-space:nowrap;}

/* ===== Fase A.2: badge cancelada ===== */
.haon-fact-badge-cancel{background:rgba(245,158,11,.15);color:#fbbf24;border:1px solid rgba(245,158,11,.35);padding:3px 10px;border-radius:12px;font-size:12px;white-space:nowrap;}

/* ===== Fase A.2b: chips filtro facturacion ===== */
.haon-fact-chips{display:flex;gap:8px;margin-bottom:14px;flex-wrap:wrap;}
.haon-fact-chip{background:rgba(255,255,255,.06);color:#cbd5e1;border:1px solid rgba(255,255,255,.15);padding:5px 14px;border-radius:14px;font-size:13px;cursor:pointer;font-family:inherit;}
.haon-fact-chip:hover{background:rgba(255,255,255,.12);}
.haon-fact-chip-on{background:rgba(56,189,248,.18);color:#7dd3fc;border-color:rgba(56,189,248,.45);}

/* ===== Fase B: badge pagada ===== */
.haon-fact-badge-paid{background:rgba(59,130,246,.15);color:#93c5fd;border:1px solid rgba(59,130,246,.4);padding:3px 10px;border-radius:12px;font-size:12px;white-space:nowrap;}

/* ===== Fase B: pagos y modal REP ===== */
.haon-fact-pago-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid rgba(255,255,255,.08);}
.haon-fact-pago-row:last-child{border-bottom:none;}
.haon-pago-overlay{position:fixed;inset:0;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;z-index:1000;}
.haon-pago-modal{background:#0f2744;border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:24px;width:min(420px,92vw);box-shadow:0 20px 60px rgba(0,0,0,.5);}
.haon-pago-label{display:block;margin:12px 0 4px;font-size:13px;color:#cbd5e1;}
.haon-pago-input{width:100%;box-sizing:border-box;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.18);border-radius:8px;padding:8px 10px;color:#fff;font-family:inherit;font-size:14px;}
.haon-pago-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:18px;}
