/* Central: panel del dueño y cobranza. Colores de Fraire's Solutions. */
:root { --fs-marino: #071634; --fs-marino-2: #0b2350; --fs-azul: #1673f0; --fs-cian: #5cc8ff; --fs-fondo: #f2f5fa; --fs-linea: #dde5f0;
  --bs-primary: #1673f0; --bs-primary-rgb: 22, 115, 240; }
body { background: var(--fs-fondo); min-height: 100vh; }
.btn-primary { --bs-btn-bg: #1673f0; --bs-btn-border-color: #1673f0; --bs-btn-hover-bg: #0f5fd0; --bs-btn-hover-border-color: #0f5fd0; }
.marca { font-weight: 700; color: var(--fs-marino); display: flex; gap: 8px; align-items: center; }
.marca i { color: var(--fs-azul); }

/* ── La barra azul de arriba: la misma de la caja (título, datos de la sección y la cuenta) ── */
.barra { background: linear-gradient(90deg, var(--fs-marino) 0%, var(--fs-marino-2) 100%); color: #fff; padding: 8px 14px; display: flex; gap: 10px;
  align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 1020; box-shadow: 0 2px 10px rgba(7, 22, 52, .25); }
.barra-titulo { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; margin-right: 4px; }
.barra-titulo b { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 360px; }
.barra-titulo b i { color: var(--fs-cian); }
.barra-titulo small { color: #a9bddb; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.barra-titulo small:empty { display: none; }
.barra-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.barra-chips:empty { display: none; }
.barra-fin { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 4px 12px; font-size: .85rem; line-height: 1.35; white-space: nowrap; color: #fff; }
.chip i { color: var(--fs-cian); }
a.chip, button.chip { color: #fff; text-decoration: none; cursor: pointer; transition: background .15s; }
a.chip:hover, button.chip:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.chip-verde, a.chip-verde:hover, button.chip-verde:hover { background: #198754; border-color: transparent; }
.chip-verde i { color: #fff; }
.chip-aviso, a.chip-aviso, button.chip-aviso { background: #f2a000; border-color: transparent; color: #1f1400; }
a.chip-aviso:hover, button.chip-aviso:hover { background: #ffb21f; color: #1f1400; }
.chip-aviso i { color: #1f1400; }
.chip-rojo, a.chip-rojo:hover, button.chip-rojo:hover { background: #dc3545; border-color: transparent; }
.chip-rojo i { color: #fff; }
/* Un chip con una lista adentro (la sucursal del panel). */
.chip-campo { padding: 0 0 0 12px; cursor: pointer; margin: 0; }
.chip-campo:focus-within { outline: 3px solid rgba(92, 200, 255, .6); outline-offset: 1px; }
.chip-select { width: auto; max-width: 240px; background-color: transparent; color: #fff; border: 0; padding: 4px 30px 4px 0; font-size: .85rem; line-height: 1.35;
  box-shadow: none; cursor: pointer; text-overflow: ellipsis; background-position: right 10px center;
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
.chip-select:focus { box-shadow: none; }
.chip-select option { color: #071634; }
/* Botones cuadrados de la barra (secciones, la cuenta). */
.barra-btn { min-width: 38px; height: 38px; flex: none; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; font-size: .9rem; text-decoration: none; transition: background .15s; }
.barra-btn i { font-size: 1.1rem; }
.barra-btn:hover, .barra-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .15); color: #fff; }
.barra-btn.active { background: rgba(92, 200, 255, .18); border-color: rgba(92, 200, 255, .55); color: #fff; }
.barra-btn.dropdown-toggle::after { margin-left: 0; }
.chip:focus-visible, .barra-btn:focus-visible { outline: 3px solid rgba(92, 200, 255, .6); outline-offset: 1px; }
@media (prefers-reduced-motion: reduce) { a.chip, button.chip, .barra-btn { transition: none; } }
.tarjeta { background: #fff; border: 1px solid var(--fs-linea); border-radius: 12px; padding: 14px 16px; }
.kpi { background: #fff; border: 1px solid var(--fs-linea); border-radius: 12px; padding: 12px 14px; height: 100%; }
.kpi .etq { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #5b6679; font-weight: 600; }
.kpi .val { font-size: 1.45rem; font-weight: 700; color: var(--fs-marino); font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: #5b6679; }
.tabla-wrap { background: #fff; border: 1px solid var(--fs-linea); border-radius: 12px; overflow: auto; }
.tabla-wrap table { margin: 0; }
.tabla-wrap thead th { background: #f7f9fc; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #5b6679; white-space: nowrap; position: sticky; top: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fila-click { cursor: pointer; }
.nav-pills .nav-link { font-weight: 600; white-space: nowrap; }
.pestanas { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.copiable { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; word-break: break-all; background: #f7f9fc; border: 1px solid var(--fs-linea); border-radius: 8px; padding: 8px; }
.codigo-grande { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; letter-spacing: .1em; text-align: center; font-weight: 700; color: var(--fs-marino); }

/* Foto del artículo */
.foto-mini { width: 36px; height: 36px; object-fit: contain; background: #fff; border: 1px solid var(--fs-linea); border-radius: 8px; }

/* ── Entrada (la misma en la caja, el panel de la empresa y cobranza) ───────── */
.entrada { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 120px 16px 28px;
  position: relative; overflow: hidden; background: radial-gradient(ellipse at 70% 30%, #0d2c66 0%, #061634 50%, #010a1b 100%); }
.entrada::before, .entrada::after { content: ''; position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; }
.entrada::before { width: 460px; height: 460px; background: #1673f0; opacity: .35; top: -180px; left: -140px; }
.entrada::after { width: 380px; height: 380px; background: #5cc8ff; opacity: .18; bottom: -170px; right: -110px; }
.entrada > * { position: relative; z-index: 1; }
.entrada-caja { width: 100%; max-width: 410px; background: #fff; border-radius: 24px; padding: 110px 32px 28px; position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
/* El logo en círculo, montado sobre la orilla de arriba del cuadro. */
.entrada-logo { position: absolute; top: -92px; left: 50%; transform: translateX(-50%); width: 184px; height: 184px; padding: 14px;
  border-radius: 50%; object-fit: contain; background: radial-gradient(circle at 50% 38%, #10306d 0%, #071a3f 55%, #030c22 100%);
  border: 4px solid #fff; box-shadow: 0 0 0 8px rgba(22, 115, 240, .16), 0 16px 36px rgba(3, 12, 34, .45); }
.entrada-marca { font-weight: 700; font-size: 1.35rem; color: #071634; display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 4px; }
.entrada-marca i { color: #1673f0; font-size: 1.45rem; }
.entrada-titulo { font-size: .95rem; font-weight: 400; color: #6b778c; text-align: center; margin-bottom: 26px; }
.entrada-campo { position: relative; margin-bottom: 14px; }
.entrada-campo > i { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: #8a96ab; font-size: 1.15rem; pointer-events: none; transition: color .15s; }
.entrada-campo .form-control { height: 54px; padding: 0 48px; border-radius: 14px; background: #f3f6fb; border: 1.5px solid #f3f6fb; font-size: 1rem; }
.entrada-campo .form-control:focus { background: #fff; border-color: #1673f0; box-shadow: 0 0 0 4px rgba(22, 115, 240, .12); }
.entrada-campo:focus-within > i { color: #1673f0; }
.entrada-ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #8a96ab; padding: 8px 12px; border-radius: 10px; }
.entrada-ojo:hover { color: #1673f0; background: #eaf1ff; }
.entrada-boton { height: 54px; border-radius: 14px; font-weight: 600; font-size: 1.05rem; margin-top: 6px; border: 0;
  background: linear-gradient(135deg, #2b8cff 0%, #1673f0 45%, #0b4fc4 100%); box-shadow: 0 12px 26px rgba(22, 115, 240, .35);
  transition: transform .12s, box-shadow .12s, filter .12s; }
.entrada-boton:hover { filter: brightness(1.06); box-shadow: 0 14px 30px rgba(22, 115, 240, .45); }
.entrada-boton:active { transform: translateY(1px); }
.entrada-pie { margin-top: 22px; color: rgba(219, 231, 255, .55); font-size: .8rem; text-align: center; }
@media (max-width: 400px) {
  .entrada { padding-top: 104px; }
  .entrada-caja { padding: 94px 22px 24px; }
  .entrada-logo { width: 158px; height: 158px; top: -79px; padding: 12px; }
}
/* Movimiento suave al aparecer y detalles para usarla con el teclado o el dedo. */
@keyframes entrada-sube { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes entrada-logo { from { opacity: 0; transform: translateX(-50%) scale(.88); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
.entrada-caja { animation: entrada-sube .5s cubic-bezier(.2, .8, .2, 1) both; }
.entrada-logo { animation: entrada-logo .55s .1s cubic-bezier(.2, .8, .2, 1) both; }
.entrada-caja .alert { animation: entrada-sube .25s ease-out both; }
.entrada-ojo { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.entrada-boton:focus-visible, .entrada-ojo:focus-visible { outline: 3px solid rgba(92, 200, 255, .75); outline-offset: 2px; }
.entrada-boton:disabled { opacity: .85; }
@media (prefers-reduced-motion: reduce) {
  .entrada-caja, .entrada-logo, .entrada-caja .alert { animation: none; }
  .entrada-boton, .entrada-campo > i { transition: none; }
}

/* Filtros de las listas (periodo, buscador) y páginas */
.filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filtros .filtros-periodo { width: auto; min-width: 150px; }
.filtros-fechas { display: flex; gap: 6px; align-items: center; color: #6b778c; font-size: .85rem; }
.filtros-fechas input { width: 150px; }
.filtros-buscar { position: relative; flex: 1 1 220px; max-width: 380px; }
.filtros-buscar i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8a96ab; pointer-events: none; }
.filtros-buscar input { padding-left: 32px; }
.filtros .form-select { width: auto; }
.paginador { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: #6b778c; margin-top: 10px; }

/* Panel: la barra de herramientas de Artículos. Cobranza: buscador y botones. */
.pa-herr { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.pa-buscar { max-width: 300px; }
.pa-dep { width: auto; max-width: 280px; }
.cb-buscar { max-width: 320px; }
.cb-botones { white-space: nowrap; }

/* ── Celular (hasta 767 px): barra en dos renglones y todo al ancho ────────── */
@media (max-width: 767.98px) {
  .barra { padding: 8px 10px; gap: 8px; }
  .barra-titulo { flex: 1 1 0; }
  .barra-titulo b, .barra-titulo small { max-width: none; }
  /* Los datos bajan a su renglón y se recorren con el dedo, de orilla a orilla. */
  .barra-chips { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 0 10px; }
  .barra-chips::-webkit-scrollbar { display: none; }
  .chip-select { max-width: 132px; font-size: 1rem; }
  /* 16 px: así el iPhone no se acerca al tocar un campo. */
  .form-control, .form-select { font-size: 1rem; }
  .pestanas { margin-left: -12px; margin-right: -12px; padding: 0 12px 2px; gap: 4px; }
  .pestanas .nav-link { padding: .55rem .85rem; }
  .kpi { padding: 10px 12px; }
  .kpi .val { font-size: 1.2rem; overflow-wrap: anywhere; }
  .tabla-wrap .table { font-size: .88rem; }
  .tabla-wrap .table > :not(caption) > * > * { padding: .55rem .5rem; }
  .tabla-wrap .btn-sm, .paginador .btn-sm { min-height: 38px; min-width: 38px; display: inline-flex; align-items: center; justify-content: center; }
  .filtros .filtros-periodo, .filtros-fechas, .filtros-buscar { flex: 1 1 100%; max-width: none; }
  .filtros-fechas input { flex: 1 1 0; width: auto; min-width: 0; }
  .modal-footer > .btn { flex: 1 1 0; min-height: 44px; }
  .codigo-grande { font-size: 1.2rem; letter-spacing: .05em; overflow-wrap: anywhere; }
  .pa-herr { gap: 10px; }
  .pa-buscar, .cb-buscar { flex: 1 1 100%; max-width: none; }
  .pa-dep { flex: 1 1 150px; max-width: none; min-width: 0; }
  .pa-art .pa-mayoreo { white-space: normal; }
  .cb-acciones > .btn { flex: 1 1 auto; }
  .cb-botones { white-space: normal; }
  .cb-botones .btn { margin: 2px 0; }
}
