/* ==========================================================
   FORMULARIOS (form.basico, div.smallinput, .bloqueform)
   Se carga después de style.css y sobreescribe el diseño
   de todos los formularios generados por _clases/formularios.php.
   Solo cambia la apariencia: anchos, floats y layout se respetan.
   ========================================================== */
:root {
  --frm-titulo:       #090b41;
  --frm-subtitulo:    #13235b;
  --frm-texto:        #1f2a44;
  --frm-gris:         #6b7686;
  --frm-borde:        #e3e9ef;
  --frm-borde-input:  #cfd8e3;
  --frm-fondo-off:    #f3f6f9;
  --frm-acento:       #0961fc;
  --frm-acento-hover: #074fd0;
  --frm-acento-fondo: #eef5fe;
  --frm-anillo:       rgba(9, 97, 252, .15);
  --frm-tabla-head:   #eef4fb;
  --frm-aviso-fondo:  #fff7e6;
  --frm-aviso-borde:  #f5d48a;
  --frm-radio:        6px;
}

/* ===== FONDO GENERAL DEL SISTEMA =====
   Mismo gris azulado del index (.dsh en dashboard.css) en todas las pantallas. */
body { background-color: #f4f7fa; }

/* Listados (clase table de _clases/llamadas.php): tarjeta blanca como en el index;
   su gris #f3f3f3 original se perdería sobre el fondo nuevo. */
body div.table,
body div.regular {
  background: #fff;
  border: 1px solid var(--frm-borde);
  border-radius: 10px;
}
body div.table h4,
body div.regular h4 {
  color: var(--frm-titulo);
  font-weight: bold;
}

/* ===== CONTENEDOR DEL FORMULARIO ===== */
body form.basico,
body div.smallinput,
body div.form.basico,
body form.basico.plomo {
  background-color: #fff;
  border: 1px solid var(--frm-borde);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
  padding: 40px 24px 24px 24px;
  color: var(--frm-texto);
}
/* Contiene los bloques flotantes aunque una pantalla ponga overflow: visible
   (ej. _venta.php lo fuerza con !important para los buscadores y eso dejaba
   el contenido de los modales colgando fuera del formulario). No recorta nada.
   Especificidad cero (:where) para que cualquier clase que oculte el form (.hide, etc.) gane.
:where(form.basico, div.smallinput) { display: flow-root; }

body form.basico.rango,
body div.rango.smallinput {
  background-color: transparent;
  border: none;
  box-shadow: none;
  padding: 10px;
}

/* Título del formulario */
body form.basico h3,
body div.smallinput h3,
body form.basico.plomo h3.fnombre {
  margin: -20px 0 20px 0;
  color: var(--frm-titulo);
  font-size: 26px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: -.2px;
}
body form.basico h3 .resaltar { color: var(--frm-acento); }

/* Subtítulos de sección */
body form.basico h4,
body div.smallinput h4 {
  color: var(--frm-subtitulo);
  font-size: 17px;
  font-weight: bold;
  text-transform: uppercase;
}

/* ===== BLOQUES (TARJETAS) ===== */
/* style.css colorea cada nivel de anidación con selectores como
   "form.basico .bloqueform .bloqueform" (teal / gris alternados);
   aquí se repite cada nivel con "body" + ".basico" para ganarles. */
body form .bloqueform,
body form.basico .bloqueform,
body form.basico .bloqueform .bloqueform,
body div.smallinput .bloqueform,
body div.smallinput .bloqueform .bloqueform,
body form.basico.plomo .bloqueform .bloqueform {
  background-color: #fff;
  border: 1px solid var(--frm-borde);
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
/* Del tercer nivel en adelante: tarjeta clara para distinguir el nivel */
body form.basico .bloqueform .bloqueform .bloqueform,
body form.basico .bloqueform .bloqueform .bloqueform .bloqueform,
body form.basico .bloqueform .bloqueform .bloqueform .bloqueform .bloqueform,
body div.smallinput .bloqueform .bloqueform .bloqueform,
body div.smallinput .bloqueform .bloqueform .bloqueform .bloqueform,
body div.smallinput .bloqueform .bloqueform .bloqueform .bloqueform .bloqueform,
body form.basico.plomo .bloqueform .bloqueform .bloqueform {
  background-color: #fafbfd;
  border: 1px solid var(--frm-borde);
  border-radius: 8px;
}
/* Sin doble tarjeta:
   - el bloque que solo lleva la pestaña del folio es un contenedor general;
   - un bloque que abre directamente con otro bloque solo lo envuelve. */
body form.basico .bloqueform:has(> .foliopestana),
body form .bloqueform > .bloqueform:first-child {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}

body form.basico .bloqueform h4,
body form.basico .bloqueform h5,
body form.basico .bloqueform .bloqueform h4,
body form.basico .bloqueform .bloqueform h5,
body div.smallinput .bloqueform h4,
body div.smallinput .bloqueform .bloqueform h4 {
  margin-top: -4px;
  margin-bottom: 12px;
  color: var(--frm-subtitulo);
  font-size: 16px;
  font-weight: bold;
  text-transform: uppercase;
}
body form.basico .bloqueform h5,
body form.basico .bloqueform .bloqueform h5 {
  font-size: 12px;
  font-weight: normal;
  text-transform: none;
  color: var(--frm-gris);
}

/* Pestaña con el título/folio en la esquina superior derecha */
body form.basico .bloqueform .foliopestana,
body form .bloqueform .foliopestana,
body div.smallinput .bloqueform .foliopestana {
  margin-top: -44px;
  right: 0;
  padding: 10px 14px;
  background-color: #fff;
  border: 1px solid var(--frm-borde);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--frm-titulo);
  font-size: 20px;
}

.bloqueform p, .bloque p { color: var(--frm-gris); }
body form p.nota-form {
  font-size: 12.5px;
  line-height: 1.6;
  color: #4b5563;
}
body form p.nota-form a { color: var(--frm-acento); }

/* Botón junto al título del formulario (ej. COTIZACIÓN) */
body form.basico h3 small .boton,
body form.basico h3 .boton {
  float: none;
  display: inline-block;
  vertical-align: middle;
  margin: -4px 0 0 14px !important;
  padding: 9px 12px 8px !important;
  font-size: 12px;
  text-transform: uppercase;
}
body form.basico h3 small { font-size: 1em; }

/* ===== ETIQUETAS ===== */
body form.basico label,
body div.smallinput label,
body div.form.basico label {
  color: var(--frm-texto);
  font-size: 13px;
  font-weight: bold;
}

/* Etiquetas largas: en lugar de altura fija (35px con line-height 2.6em, que
   desborda la 2a línea) usan altura mínima y line-height compacto.
   Una línea queda centrada con el campo; dos líneas hacen crecer el renglón. */
body form.basico:not(.smallinput):not(.full) label:not(.radio):not(.checkbox):not(.right-side) {
  height: auto;
  min-height: 35px;
  line-height: 17px;
  padding-top: 8px;
  padding-bottom: 6px;
}
body form label.requerido:after { margin-left: 2px; }

/* Etiquetas de la encuesta de venta (lclase 'large'): una sola línea.
   Con flex + flex-end, si el texto no cabe se extiende a la izquierda
   en lugar de encimarse sobre el campo. */
body form.basico:not(.smallinput):not(.full) label.large:not(.radio):not(.checkbox):not(.right-side) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  height: 35px;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-right: 10px;
}

/* ===== CAMPOS ===== */
body form input,
body form textarea,
body form select,
body form .custom-combobox-input,
body div.smallinput input,
body div.smallinput textarea,
body div.smallinput select,
body div.form input,
body div.form textarea,
body div.form select {
  background-color: #fff;
  border: 1px solid var(--frm-borde-input);
  border-radius: var(--frm-radio);
  color: var(--frm-texto);
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
body form span.custom-combobox,
body div.smallinput span.custom-combobox {
  border: none;
  background: transparent;
}
body form textarea,
body div.smallinput textarea {
  padding: 8px 10px;
  line-height: 1.4;
}
body form input::placeholder,
body form textarea::placeholder { color: #98a2b3; }

body form input:hover,
body form textarea:hover,
body form select:hover { border-color: #b3bfcd; }

input:focus, textarea:focus, select:focus,
body form input:focus,
body form textarea:focus,
body form select:focus {
  outline: none !important;
  border-color: var(--frm-acento);
  box-shadow: 0 0 0 3px var(--frm-anillo);
}

body form input:disabled,
body form textarea:disabled,
body form select:disabled,
body form input[readonly],
body form textarea[readonly] {
  background-color: var(--frm-fondo-off);
  color: var(--frm-gris);
  cursor: not-allowed;
}
/* Fechas con pickadate: el plugin les pone readonly para que solo se elijan con el
   calendario, pero son editables; no deben verse bloqueadas */
body form input.picker__input[readonly]:not(:disabled) {
  background-color: #fff;
  color: var(--frm-texto);
  cursor: pointer;
}

/* Select con flecha (chevron) */
body form select,
body div.smallinput select,
body div.form select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 32px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231f2a44' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 12px 8px;
  border-radius: var(--frm-radio);
}
body form select:disabled { background-color: var(--frm-fondo-off); }

/* Campos dentro de tablas: compactos */
/* Conservan el tamaño de letra compacto de style.css */
body table td select,
body table td input,
body table td textarea { font-size: 11px; }
body table td select,
body table td textarea {
  border: 1px solid var(--frm-borde) !important;
  border-radius: 4px;
  background-color: #fff;
}
/* Inputs en celdas: se ven como texto y muestran el borde al usarlos */
body table td input {
  border: 1px solid transparent !important;
  border-radius: 4px;
  background-color: transparent;
  text-align: center;
}
body table td input:hover { border-color: var(--frm-borde-input) !important; }
body table td input:focus {
  border-color: var(--frm-acento) !important;
  background-color: #fff;
}
body table td select:disabled,
body table td input:disabled,
body table td textarea:disabled { background-color: transparent; }
body table td input:disabled:hover { border-color: transparent !important; }

/* ===== TOTALES (labels a la derecha del campo) ===== */
body form.basico label.right-side {
  font-weight: normal;
  color: #4b5563;
  font-size: 14px;
}
/* Cuadros de totales: inputs deshabilitados "right-side aright" (Subtotal,
   Descuento, IVA, Total, Pago total) en ventas, cotizaciones, remisiones,
   órdenes de venta, notas de crédito, etc. Se ven igual tengan o no "big". */
body form input.big:disabled,
body form input.big[disabled],
body form input.right-side.aright:disabled {
  background-color: var(--frm-fondo-off);
  border-color: transparent;
  color: var(--frm-texto);
}
body form input.right-side.aright:disabled { font-size: 25px; }
body form input.total:disabled {
  background-color: var(--frm-acento-fondo);
  font-weight: bold;
}

/* Labels de color: insignias suaves en lugar de color sólido */
body form.basico label.red,
body form.basico label.green,
body form.basico label.orange {
  border-radius: var(--frm-radio);
  padding-left: 10px;
  font-weight: bold;
}
body form.basico label.red    { background-color: #fde4e4 !important; color: #c81e1e; }
body form.basico label.green  { background-color: #e1f6e8 !important; color: #1e6c20; }
body form.basico label.orange { background-color: #fdeacc !important; color: #b4530a; }
/* Total (ventas[total], cotizaciones[total], remisiones[total]...): insignia azul marino */
body form.basico label.right-side[for$="[total]"] {
  background-color: #1f2f57 !important;
  color: #fff;
  border-radius: var(--frm-radio);
  padding-left: 10px;
  font-weight: bold;
}

/* ===== BOTONES DE ÍCONO ===== */
/* Agregar (+): cuadro blanco con borde y cruz azul */
body .botones-1.agregar,
body .botones-1.agregar.hover:hover,
body .botones-2.agregar,
body .botones-2.agregar.hover:hover {
  box-sizing: border-box;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--frm-acento);
  border-radius: var(--frm-radio);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%230961fc' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center center;
  background-size: 14px 14px;
  cursor: pointer;
  transition: background-color .15s;
}
body .botones-2.agregar,
body .botones-2.agregar.hover:hover {
  width: 24px;
  height: 24px;
  background-size: 10px 10px;
}
body .botones-1.agregar.hover:hover,
body .botones-2.agregar.hover:hover { background-color: var(--frm-acento-fondo); }

/* Borrar renglón (bote de basura rojo) */
body table td .botones-2.borrar,
body table td .botones-2.borrar.hover:hover {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23e0242a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6'/%3E%3C/svg%3E") no-repeat center center;
  background-size: 18px 18px;
  cursor: pointer;
}
body table td .botones-2.borrar.hover:hover { opacity: .75; }

/* Código de barras (azul) */
body .btnnew-1.codigo-barras,
body .btnnew-1.codigo-barras.hover:hover {
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230961fc' stroke-width='1.6'%3E%3Crect x='2.5' y='4.5' width='19' height='15' rx='2'/%3E%3Cpath d='M6 8v8M9 8v8M11.5 8v8M14 8v8M16.5 8v8M18 8v8' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat center center;
  background-size: 18px 18px;
}
body .btnnew-1.codigo-barras.hover:hover { opacity: .75; }

/* Encabezados de tablas dentro de formularios */
body form.basico table th,
body div.smallinput table th {
  background-color: var(--frm-tabla-head);
  color: var(--frm-subtitulo);
  font-weight: bold;
}

/* ===== RADIOS Y CHECKBOXES ===== */
body form label.radio,
body form label.checkbox,
body div.smallinput label.radio,
body div.smallinput label.checkbox {
  background-color: #f5f8fe !important;
  border: 1px solid #cdd9ec;
  border-radius: 8px;
  color: #1e3a8a !important;
  justify-content: flex-start !important;
  text-align: left !important;
  font-weight: normal;
  /* separación entre opciones sin romper los anchos en % */
  width: calc(100% - 6px) !important;
  margin: 0 3px !important;
  padding: 6px 8px 6px 36px;
  /* crece con el texto en lugar de desbordarse; texto centrado verticalmente */
  height: auto;
  min-height: 35px;
  display: flex;
  align-items: center;
  line-height: 1.3;
  white-space: normal;
  transition: border-color .15s, background-color .15s;
}
body form div.radiobox,
body div.smallinput div.radiobox { height: auto; min-height: 35px; }
body form.basico.smallinput div.radiobox,
body div.smallinput div.radiobox,
body form.basico.smallinput label.radio,
body form.basico.smallinput label.checkbox,
body div.smallinput label.radio,
body div.smallinput label.checkbox { min-height: 25px; padding-top: 3px; padding-bottom: 3px; }
/* Círculo / cuadro centrado verticalmente */
body form label.radio span,
body form label.checkbox span,
body div.smallinput label.radio span,
body div.smallinput label.checkbox span {
  left: 11px !important;
  top: 50% !important;
  width: 18px !important;
  height: 18px !important;
  margin: -9px 0 0 0 !important;
  box-sizing: border-box;
}
body form.basico.smallinput label.radio span,
body form.basico.smallinput label.checkbox span,
body div.smallinput label.radio span,
body div.smallinput label.checkbox span {
  width: 14px !important;
  height: 14px !important;
  margin-top: -7px !important;
}
body form label.radio:hover,
body form label.checkbox:hover { border-color: var(--frm-acento); }

body form div.radiobox.activo > label.radio,
body form div.radiobox.activo > label.checkbox,
body div.smallinput div.radiobox.activo > label.radio,
body div.smallinput div.radiobox.activo > label.checkbox {
  background-color: var(--frm-acento-fondo) !important;
  border-color: var(--frm-acento);
  color: var(--frm-subtitulo);
}

/* Círculo del radio */
body form label.radio span,
body div.smallinput label.radio span {
  background: #fff;
  border: 1.5px solid #8a94a6;
  box-shadow: none;
}
body form div.radiobox.activo > label.radio span,
body div.smallinput div.radiobox.activo > label.radio span {
  background: #fff;
  border-color: var(--frm-acento);
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 9px var(--frm-acento);
}
body form label.radio span,
body div.smallinput label.radio span { border-color: #3b4a6b; }

/* Cuadro del checkbox */
body form label.checkbox span,
body div.smallinput label.checkbox span {
  background: #fff;
  border: 1.5px solid #8a94a6;
  box-shadow: none;
}
body form div.radiobox.activo > label.checkbox span,
body div.smallinput div.radiobox.activo > label.checkbox span {
  background: var(--frm-acento) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='10' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center center;
  background-size: 10px 8px;
  border-color: var(--frm-acento);
}

/* ===== BOTONES ===== */
body a.boton,
body form input[type=submit],
body form .boton.botonaccion,
body form.basico input[type=submit],
body div.smallinput input[type=submit] {
  --btn-bg: var(--frm-acento);
  background-color: var(--btn-bg);
  border: none;
  border-radius: var(--frm-radio);
  color: #fff;
  font-weight: bold;
  letter-spacing: .2px;
  transition: background-color .15s, filter .15s;
}
body a.boton:hover,
body form input[type=submit]:hover,
body form .boton.botonaccion:hover,
body form.basico .boton:hover,
body form.basico input[type=submit]:hover,
body div.smallinput .boton:hover,
body div.smallinput input[type=submit]:hover {
  background-color: var(--btn-bg) !important;
  filter: brightness(.88);
}
/* style.css fuerza los submit en verde azulado con !important */
body form input[type=submit],
body form.basico input[type=submit],
body form .boton.botonaccion,
body form.basico .boton.botonaccion,
body div.smallinput input[type=submit] {
  background-color: var(--btn-bg) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .18);
}
body form input[type=submit]:hover,
body form.basico input[type=submit]:hover,
body form .boton.botonaccion:hover,
body form.basico .boton.botonaccion:hover,
body div.smallinput input[type=submit]:hover {
  color: #fff !important;
  border: none !important;
}
body form.basico input[type=submit]:disabled,
body form.basico input[type=submit].loading,
body form.basico .boton:disabled,
body form.basico .boton.loading {
  background-color: #98a2b3 !important;
  filter: none;
  cursor: wait;
}

/* Variantes de color */
body .boton.green,  body form input.green[type=submit]  { --btn-bg: #1e8e3e; }
body .boton.red,    body form input.red[type=submit]    { --btn-bg: #e0242a; }
body .boton.blue,   body form input.blue[type=submit]   { --btn-bg: #0961fc; }
body .boton.gray,   body form input.gray[type=submit]   { --btn-bg: #8a94a6; }
body .boton.purple, body form input.purple[type=submit] { --btn-bg: #7b3fc4; }
body .boton.orange, body form input.orange[type=submit] { --btn-bg: #f66603; }
body .boton.clean { --btn-bg: #e3e9ef; color: var(--frm-texto); }
body .boton.borrar { --btn-bg: #e0242a; }
body .boton.green, body .boton.red, body .boton.blue, body .boton.gray,
body .boton.purple, body .boton.orange, body .boton.clean, body .boton.borrar,
body form input.green[type=submit], body form input.red[type=submit],
body form input.blue[type=submit], body form input.gray[type=submit],
body form input.purple[type=submit], body form input.orange[type=submit] {
  background-color: var(--btn-bg);
}

/* ===== BOTONES DE REMISIONES (ventas/_remisiones.php, clase boton-rem) =====
   Mismo estilo que los selectores Remisión / Evento / Apartado: fondo muy claro, borde suave
   y texto oscuro del color; al pasar el cursor se marca el borde con el color fuerte.
   Solo aplica a los botones con boton-rem; el resto del sistema conserva boton-pequeno sólido (style.css) */
body table td .boton-pequeno.boton-rem {
  --bp-texto: #1e3a8a;
  --bp-fondo: #f5f8fe;
  --bp-borde: #cdd9ec;
  --bp-hover: #0961fc;
  --bp-hover-fondo: #eef5fe;
  display: inline-block;
  box-sizing: border-box;
  margin: 5px;
  padding: 4px 10px;
  background-color: var(--bp-fondo);
  border: 1px solid var(--bp-borde);
  border-radius: 6px;
  color: var(--bp-texto);
  font-family: Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
body table td .boton-pequeno.boton-rem:hover {
  background-color: var(--bp-hover-fondo);
  border-color: var(--bp-hover);
  color: var(--bp-texto);
}
/* Verde (success): piezas vendidas / Rojo (cancel): piezas devueltas */
body table td .boton-pequeno.boton-rem.success {
  --bp-texto: #14532d; --bp-fondo: #f3faf5; --bp-borde: #c7e4cf;
  --bp-hover: #1e8e3e; --bp-hover-fondo: #e8f5ec;
}
body table td .boton-pequeno.boton-rem.cancel {
  --bp-texto: #9f1d20; --bp-fondo: #fef5f5; --bp-borde: #f2cfd0;
  --bp-hover: #e0242a; --bp-hover-fondo: #fdecec;
}
/* Amarillo (alert): piezas pendientes */
body table td .boton-pequeno.boton-rem.alert {
  --bp-texto: #7a4b00; --bp-fondo: #fffaeb; --bp-borde: #f3dc9b;
  --bp-hover: #e0a800; --bp-hover-fondo: #fff3d1;
}
/* Deshabilitado */
body table td .boton-pequeno.boton-rem.disabled {
  background-color: #f3f4f6;
  border-color: #e5e7eb;
  color: #8a94a6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Botón dentro de un subtítulo de formulario (ej. "Historial"); solo en forms,
   los títulos de tablas (div.table h4) conservan el botón sólido */
body form h4 .boton {
  --btn-bg: var(--frm-acento-fondo);
  color: var(--frm-acento);
  border: 1px solid #c9dcfb;
  font-weight: bold;
}

/* ===== MENSAJES ===== */
body form p.info,
body div.smallinput p.info {
  background-color: var(--frm-aviso-fondo);
  background-position: 12px center;
  border-radius: var(--frm-radio);
  margin: 12px 0;
  padding: 12px 14px 12px 40px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.6;
}

/* Alerta principal (ej. producto sin existencia) */
body .alerta_ventas {
  background-color: #fdecec;
  color: #d0141b;
  border: 1px solid #f7c9c9;
  border-left: 5px solid #d0141b;
  border-radius: 8px;
  padding: 18px 20px;
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: bold;
  line-height: 1.5;
}

/* Tablas de listado (clase table) dentro de un formulario */
body form div.table {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0 0 12px 0;
  width: 100%;
}
body form div.table h4 {
  color: var(--frm-subtitulo);
  font-size: 20px;
  font-weight: bold;
  line-height: 1.35;
  margin: 0 0 14px 0;
}
body form div.table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--frm-borde);
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
}
body form div.table table th {
  background-color: var(--frm-tabla-head);
  color: #4b5563;
  font-size: 13px;
  font-weight: normal;
  padding: 10px 12px;
}
body form div.table table td {
  padding: 9px 12px;
  font-size: 13px;
  border-top: 1px solid var(--frm-borde);
  border-left: 1px solid var(--frm-borde);
}
body form div.table table td:first-child { border-left: none; }
body form p.infocliente,
body div.smallinput p.infocliente {
  border: none;
  background-color: var(--frm-acento-fondo);
  background-position: 10px 11px;
  border-radius: var(--frm-radio);
  padding: 10px 12px 10px 34px;
  color: var(--frm-texto);
}

/* ===== VENTANAS EMERGENTES ===== */
body section.pop { border-top: none; }
body section.pop h2.seccion {
  background-color: var(--frm-titulo);
  border-radius: 8px 8px 0 0;
}
/* Modal: fondo gris azulado y las secciones como tarjetas blancas */
body .mfp-content form.basico,
body .mfp-content div.smallinput {
  background-color: #f4f6fa;
  border: none;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(9, 11, 65, .25);
  padding: 44px 24px 24px 24px;
}
/* _venta.php fuerza "form.basico { overflow: visible !important }" (para sus buscadores)
   y luego lo regresa a hidden modal por modal; los que no están en su lista
   (ej. detalles_prod del buscador del header) quedaban con el contenido fuera del fondo.
   En un modal el form siempre contiene su contenido, como en el resto del sistema. */
body .mfp-content form.basico,
body .mfp-content div.smallinput {
  display: flow-root;
  overflow: hidden !important;
}
body .mfp-content form.basico h3.fnombre:empty { display: none; }
body .mfp-content form.basico .bloqueform h4 {
  font-size: 20px;
  line-height: 1.35;
  margin: 0 0 14px 0;
}
body .mfp-content form.basico p.losbotones { margin-top: 4px; }

/* Tipo de venta perdida (modal): opciones de varias líneas centradas, como la referencia */
body form div.radiobox.vp-tipo > label.radio {
  justify-content: center !important;
  text-align: center !important;
}

/* Campo obligatorio: asterisco rojo en lugar de la barra dorada pegada al campo */
body form label.requerido:before { display: none; }
body form label.requerido:after {
  content: ' *';
  color: #e0242a;
  font-weight: bold;
}

/* ===== INDICADOR DE CARGA (#alertas p.waiting) =====
   Lo activan waitingStart()/waitingEnd() y el "Cargando..." inicial de header.php.
   Tarjeta centrada en la pantalla con spinner azul y un velo suave sobre la página
   (el velo es una sombra extendida: oscurece pero no bloquea clics). */
body #alertas .waiting.activo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: fixed;
  left: 50%;
  top: 50%;
  width: auto;
  min-width: 220px;
  max-width: 380px;
  margin: 0;
  transform: translate(-50%, -50%);
  padding: 28px 36px 24px;
  background: #fff;
  border: none;
  border-radius: 16px;
  box-shadow:
    0 0 0 100vmax rgba(9, 11, 65, .18),
    0 24px 60px rgba(9, 11, 65, .28),
    0 4px 12px rgba(9, 11, 65, .08);
  color: var(--frm-titulo);
  font-size: 15px;
  font-weight: bold;
  line-height: 1.4;
  letter-spacing: .2px;
  text-align: center;
  animation: frm-cargando-entrada .22s ease-out;
}
/* Spinner: arco con degradado sobre un anillo azul claro */
body #alertas .waiting.activo:before {
  content: '';
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, rgba(9, 97, 252, 0) 0deg, rgba(9, 97, 252, .15) 60deg, var(--frm-acento) 330deg, var(--frm-acento) 360deg),
    var(--frm-acento-fondo);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
  animation: frm-cargando-giro .8s linear infinite;
}
@keyframes frm-cargando-giro { to { transform: rotate(360deg); } }
@keyframes frm-cargando-entrada {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.94);
    box-shadow: 0 0 0 100vmax rgba(9, 11, 65, 0), 0 24px 60px rgba(9, 11, 65, 0), 0 4px 12px rgba(9, 11, 65, 0);
  }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  body #alertas .waiting.activo { animation: none; }
  body #alertas .waiting.activo:before { animation-duration: 1.6s; }
}

/* ===== BLOQUES PLEGABLES (.bloqueform.moreless + .abrircerrar) =====
   El h4 heredaba line-height 2.5em (~40px) y quedaba más abajo que el botón
   (fijo a top: 12px). Título en línea compacta y botón centrado con él. */
body form.basico .bloqueform.moreless,
body form.basico .bloqueform .bloqueform.moreless {
  padding-top: 13px;
}
body form.basico .bloqueform.moreless > h4,
body form.basico .bloqueform .bloqueform.moreless > h4 {
  margin: 0 32px 12px 0;
  line-height: 22px;
}
body form.basico .bloqueform.moreless > .abrircerrar {
  top: 14px;
  right: 16px;
}
body form.basico .bloqueform.moreless.closed { max-height: 50px; }
