/* ==========================================================================
   BodegaFlex POS — Cierres de caja (cierres-caja.css, 27-oct-2026)
   Aislado bajo #bf-cierres-caja-root y #bfc-modal. Pensado para 390 px sin scroll horizontal.
   ========================================================================== */

/* El corte quincenal viejo (solo en el teléfono) sigue en el DOM pero no se muestra: la pestaña Cierres es la nueva */
#panel-cierres > *:not(#bf-cierres-caja-root) { display: none !important; }

#bf-cierres-caja-root, #bf-cierres-caja-root *, #bfc-modal, #bfc-modal * { box-sizing: border-box; }
#bf-cierres-caja-root { width: 100%; max-width: 820px; margin: 0 auto; color: #0f172a; font-size: 14px; }

.bfc-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06); }
.bfc-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bfc-cab h2 { margin: 0; font-size: 1.25rem; color: #1a3a6b; }
.bfc-cab p { margin: 4px 0 0; color: #64748b; font-size: 0.85rem; max-width: 520px; }

.bfc-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; border-bottom: 2px solid #e2e8f0; }
.bfc-tab { flex: 0 0 auto; border: 1px solid #cbd5e1; background: #f8fafc; color: #334155; border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 0.86rem; cursor: pointer; }
.bfc-tab.activa { background: #1a3a6b; border-color: #1a3a6b; color: #fff; }

.bfc-btn { border: none; border-radius: 8px; padding: 10px 16px; font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.bfc-btn:disabled { opacity: 0.6; cursor: wait; }
.bfc-btn-principal { background: #1a3a6b; color: #fff; width: 100%; margin-top: 6px; }
.bfc-btn-sec { background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; }

.bfc-cargando, .bfc-aviso { padding: 22px 14px; text-align: center; color: #475569; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; margin: 8px 0; }
.bfc-periodo { margin: 4px 0 10px; color: #334155; }
.bfc-periodo-dia { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bfc-periodo-dia input { border: 1px solid #cbd5e1; border-radius: 8px; padding: 6px 8px; font-size: 0.9rem; margin-left: 6px; }
.bfc-chip { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #e0f2fe; color: #075985; }
.bfc-chip-semanal { background: #ede9fe; color: #5b21b6; }
.bfc-chip-quincenal { background: #fef3c7; color: #92400e; }
.bfc-chip-mensual { background: #dcfce7; color: #166534; }

.bfc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bfc-kpi { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; min-width: 0; }
.bfc-kpi span { display: block; font-size: 0.78rem; color: #64748b; font-weight: 600; }
.bfc-kpi strong { display: block; font-size: 1.25rem; color: #0f172a; margin: 2px 0; }
.bfc-kpi small { display: block; color: #64748b; font-size: 0.76rem; overflow-wrap: anywhere; }
.bfc-kpi-verde { background: #f0fdf4; border-color: #bbf7d0; }
.bfc-kpi-verde strong { color: #166534; }

.bfc-bloque { border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.bfc-bloque h4, .bfc-form h4 { margin: 0 0 8px; font-size: 0.95rem; color: #1a3a6b; }
.bfc-caja { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.bfc-moneda { background: #f8fafc; border-radius: 8px; padding: 8px 10px; min-width: 0; }
.bfc-moneda-t { font-size: 0.8rem; font-weight: 700; color: #475569; margin-bottom: 4px; }
.bfc-fila { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed #e2e8f0; font-size: 0.88rem; }
.bfc-fila:last-child { border-bottom: none; }
.bfc-fila span { color: #475569; min-width: 0; overflow-wrap: anywhere; }
.bfc-fila strong { text-align: right; white-space: nowrap; }
.bfc-fila.bfc-total strong { color: #1a3a6b; font-size: 0.98rem; }
.bfc-fila.bfc-sub span { padding-left: 10px; font-size: 0.82rem; }
.bfc-nota { margin: 6px 0; font-size: 0.8rem; color: #64748b; }

.bfc-form { border: 2px solid #1a3a6b; border-radius: 10px; padding: 14px; margin-top: 6px; background: #f8fbff; }
.bfc-form label { display: block; font-size: 0.84rem; font-weight: 600; color: #334155; margin: 10px 0 0; }
.bfc-form input { display: block; width: 100%; margin-top: 4px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 10px; font-size: 1rem; }
.bfc-error { margin-top: 10px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; font-size: 0.85rem; }
.bfc-hecho { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px; margin: 6px 0 10px; }
.bfc-hecho-t { font-weight: 700; color: #166534; margin-bottom: 6px; }
.bfc-rehacer { margin-top: 4px; }

.bfc-lista { display: flex; flex-direction: column; gap: 8px; }
.bfc-item { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.bfc-item-cab { width: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff; border: none; padding: 10px 12px; cursor: pointer; text-align: left; font-size: 0.88rem; }
.bfc-item-per { flex: 1 1 140px; color: #334155; min-width: 0; }
.bfc-item-tot { font-weight: 800; color: #1a3a6b; }
.bfc-item-dif { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.bfc-item-dif.ok { background: #dcfce7; color: #166534; }
.bfc-item-dif.mal { background: #fee2e2; color: #991b1b; }
.bfc-det { padding: 4px 12px 12px; background: #f8fafc; }

/* Cajero: ventana "Cerrar el día" */
.bfc-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 9000; display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.bfc-modal-caja { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 14px 16px 20px; }
@media (min-width: 640px) { .bfc-modal { align-items: center; padding: 16px; } .bfc-modal-caja { border-radius: 16px; } }
.bfc-modal-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bfc-modal-cab h3 { margin: 0; color: #1a3a6b; font-size: 1.1rem; }
.bfc-x { border: none; background: #f1f5f9; border-radius: 8px; width: 36px; height: 36px; font-size: 1rem; cursor: pointer; }
.bfc-btn-cerrar-dia { padding: 8px 16px; font-size: 0.88rem; display: flex; align-items: center; gap: 6px; }

@media (max-width: 480px) {
  .bfc-card { padding: 14px 12px; }
  .bfc-kpi strong { font-size: 1.1rem; }
}
