/* Livay v429 · «Editar cliente» con el mismo modelo que el registro de clientes (registro-clientes-modelo.html):
   cabecera oscura, tiendas con logo y punto, tarjeta blanca «Datos personales del cliente», campos grises y botón rojo.
   Todo acotado a #view-form.editing (el registro nuevo sigue siendo el modelo del iframe). */
#view-form.editing .legacy-form-hidden{display:flex!important;flex-direction:column;gap:10px;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#182A31}

/* cabecera oscura */
#view-form.editing .page-heading.form-heading{background:#182A31!important;color:#EFEFED!important;border-radius:20px!important;padding:14px 16px!important;margin:0!important;display:flex!important;align-items:center!important;gap:10px!important;min-height:0!important;box-shadow:none!important}
#view-form.editing .page-heading.form-heading::before,#view-form.editing .page-heading.form-heading::after,#view-form.editing .page-heading.form-heading .art{display:none!important}
#view-form.editing .page-heading.form-heading > div{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
#view-form.editing #back-to-clients-legacy{align-self:flex-start;background:#EFEFED!important;color:#182A31!important;border:0!important;border-radius:999px!important;padding:7px 12px!important;font:700 12.5px/1 Inter,sans-serif!important;margin:0 0 8px!important;cursor:pointer}
#view-form.editing .form-heading .eyebrow{color:#EFEFED!important;opacity:.7;font:500 12px/1.2 Inter,sans-serif!important;letter-spacing:0!important;text-transform:none!important;margin:0!important}
#view-form.editing .form-heading .eyebrow::before{display:none!important}
#view-form.editing #form-heading{color:#EFEFED!important;font:800 17px/1.2 Inter,sans-serif!important;margin:0!important;padding:0!important;border:0!important}
#view-form.editing #form-heading::before{display:none!important}
#view-form.editing .form-heading .subtle{color:rgba(239,239,237,.7)!important;font:500 12px/1.35 Inter,sans-serif!important;margin:2px 0 0!important}
#view-form.editing .form-heading .view-refresh{background:rgba(239,239,237,.1)!important;color:#EFEFED!important;border:0!important;box-shadow:none!important;border-radius:12px!important;height:38px!important;padding:0 12px!important;flex:none}

/* tarjeta blanca */
#view-form.editing #client-form{margin:0!important}
#view-form.editing .form-section.wizard-panel{background:#fff!important;border-radius:20px!important;padding:16px 18px!important;display:flex!important;flex-direction:column!important;gap:12px!important;box-shadow:none!important;border:0!important;margin:0!important}
#view-form.editing .form-section .section-title{margin:0!important;padding:0!important;border:0!important}
#view-form.editing .form-section .section-title .step,#view-form.editing .form-section .section-title p{display:none!important}
#view-form.editing .form-section .section-title h3{font:800 16px/1.2 Inter,sans-serif!important;margin:0!important;color:#182A31!important}

/* etiquetas y campos */
#view-form.editing .form-section .field{display:flex!important;flex-direction:column!important;gap:6px!important;margin:0!important;font:700 12px/1.2 Inter,sans-serif!important;color:#55606A!important}
#view-form.editing .form-section .field > span{font:700 12px/1.2 Inter,sans-serif!important;color:#55606A!important;letter-spacing:0!important;text-transform:none!important}
#view-form.editing .form-section input:not([type=radio]):not([type=checkbox]){background:#F5F5F4!important;border:1px solid transparent!important;border-radius:14px!important;padding:12px 14px!important;font:400 15px/1.3 Inter,sans-serif!important;color:#182A31!important;width:100%!important;box-shadow:none!important;height:auto!important;min-height:0!important}
#view-form.editing .form-section input:not([type=radio]):not([type=checkbox]):focus{outline:none!important;border-color:#182A31!important;background:#fff!important}
#view-form.editing .form-section .field-grid{display:grid!important;grid-template-columns:1fr!important;gap:12px!important;margin:0!important}

/* tiendas con logo y punto (como el registro) */
#view-form.editing .store-segment{display:flex!important;gap:10px!important;background:transparent!important;border:0!important;padding:0!important;box-shadow:none!important}
#view-form.editing .store-segment-option{flex:1!important;height:52px!important;border-radius:14px!important;border:2px solid transparent!important;background:#F5F5F4!important;display:flex!important;align-items:center!important;justify-content:center!important;position:relative!important;padding:0!important;box-shadow:none!important;cursor:pointer;color:#182A31!important}
#view-form.editing .store-segment-option img{height:26px;width:auto;object-fit:contain;display:block}
#view-form.editing .store-segment-option .dot{position:absolute;right:10px;top:50%;margin-top:-7px;width:14px;height:14px;border-radius:50%;border:2px solid #B9BEC4;background:#fff}
#view-form.editing .store-segment-option.active,#view-form.editing .store-segment-option[aria-pressed="true"]{border-color:#182A31!important;background:#fff!important}
#view-form.editing .store-segment-option.active .dot,#view-form.editing .store-segment-option[aria-pressed="true"] .dot{background:#182A31;border-color:#182A31}
#view-form.editing .store-segment-option::before,#view-form.editing .store-segment-option::after{display:none!important}

/* tipo de documento: tres botones iguales, el elegido oscuro */
#view-form.editing .document-choices{display:flex!important;gap:6px!important;flex-wrap:nowrap!important}
#view-form.editing .doc-choice{flex:1 1 0!important;min-width:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}
#view-form.editing .doc-choice input{position:absolute!important;opacity:0!important;pointer-events:none!important;width:1px!important;height:1px!important}
#view-form.editing .doc-choice span{display:block!important;text-align:center!important;padding:11px 6px!important;border-radius:12px!important;background:#F5F5F4!important;color:#182A31!important;font:700 13.5px/1.2 Inter,sans-serif!important;border:0!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
#view-form.editing .doc-choice input:checked + span{background:#182A31!important;color:#fff!important}
#view-form.editing .doc-choice input:focus-visible + span{outline:2px solid #E0335A;outline-offset:2px}

/* botón rojo como «Guardar cliente» */
#view-form.editing .wizard-actions{margin:4px 0 0!important;padding:0!important;border:0!important;background:transparent!important;position:static!important;box-shadow:none!important}
#view-form.editing .wizard-actions .next-step{width:100%!important;background:#E0335A!important;color:#fff!important;border:0!important;border-radius:16px!important;padding:15px!important;font:800 16px/1 Inter,sans-serif!important;box-shadow:none!important;height:auto!important}

/* v429 · solo los datos del registro: sin tipo de atención ni departamento (se conservan como están) */
#view-form.editing .form-section .field.fulfillment-field,#view-form.editing .form-section #department-wrap,#view-form.editing .form-section .field-grid:empty{display:none!important}
/* tarjeta de tiendas aparte, como en el registro (Drisné primero) */
#view-form.editing #client-form{display:flex!important;flex-direction:column!important;gap:10px!important}
#view-form.editing .ec-stores{background:#fff!important;border-radius:20px!important;padding:12px!important;margin:0!important}
#view-form.editing .ec-stores.field > span{display:none!important}
#view-form.editing .ec-stores .store-segment-option[data-company-choice="DRISNE"]{order:-1}
/* fila Celular | Documento */
#view-form.editing .ec-row{display:grid;grid-template-columns:1fr 1.1fr;gap:12px;align-items:start}
@media (max-width:420px){#view-form.editing .ec-row{grid-template-columns:1fr}}
#view-form.editing .ec-row > .field{min-width:0}
/* la barra de secciones (Clientes · Notas · Envíos · Claves · Stock) queda fija abajo también al editar */
body:has(#view-form.active.editing) .bottom-nav.top-nav:not([hidden]){display:flex!important}
#view-form.editing{padding-bottom:calc(110px + env(safe-area-inset-bottom))!important}html body #view-form.editing .document-choices .doc-choice.choice span{display:block!important;width:auto!important;height:auto!important;min-height:0!important;text-align:center!important;padding:11px 6px!important;border-radius:12px!important;background:#F5F5F4!important;color:#182A31!important;font:700 13.5px/1.2 Inter,sans-serif!important;border:0!important;box-shadow:none!important}
html body #view-form.editing .document-choices .doc-choice.choice input:checked + span{background:#182A31!important;color:#fff!important}
html body #view-form.editing .document-choices .doc-choice.choice span::before,html body #view-form.editing .document-choices .doc-choice.choice span::after{display:none!important}
html body #view-form.editing .document-choices .doc-choice.choice span{flex:1 1 auto!important;width:100%!important;background:#EFEFED!important}
html body #view-form.editing .document-choices .doc-choice.choice input:checked + span{background:#182A31!important}

/* v434 · al editar solo se ven los datos del cliente: «Guardar cambios» guarda directo, así que Envío y Pago (que aparecían debajo) se ocultan */
#view-form.editing .form-section.wizard-panel:not([data-step="0"]){display:none!important}
