/* Clientes/contactos: sólo el área de trabajo; no modifica el shell ni el tema. */
.customer-editor { max-width:96rem; }
.customer-editor .customer-columns { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(290px,1fr); gap:12px; align-items:stretch; }
.customer-editor .customer-main,.customer-editor .customer-fields { display:grid; gap:10px; min-width:0; }
.customer-editor .customer-fields { padding:0; margin:0; border:0; }
.customer-editor .customer-identity { display:flex; gap:18px; align-items:center; flex-wrap:wrap; margin:0 0 12px; color:var(--color-text-muted); }
.customer-editor .customer-identity strong { color:var(--color-text); }
.customer-editor .customer-state,.customer-editor .customer-type,.customer-editor .customer-count { display:inline-flex; border-radius:99px; padding:4px 10px; font-size:12px; background:var(--color-surface-subtle); color:var(--color-text); font-weight:600; }
.customer-editor .customer-commercial { display:grid; grid-template-columns:minmax(160px,1.3fr) minmax(90px,.7fr) minmax(140px,1fr); gap:12px; align-items:start; }
.customer-editor .customer-associated-heading { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.customer-editor .customer-associated-heading .form-section__title { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.customer-editor .customer-associated-heading .button { display:flex; align-items:center; gap:6px; }
.customer-editor .customer-action-icon { width:20px; height:20px; object-fit:contain; }
.customer-editor .customer-contact-card { display:grid; gap:6px; padding:12px; margin:10px 0; border:var(--border-subtle); border-radius:10px; background:var(--color-surface-subtle); min-width:0; overflow-wrap:anywhere; }
.customer-editor .customer-contact-title { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.customer-editor .customer-contact-link { background:none; border:0; padding:0; text-align:left; color:var(--color-text); font:inherit; font-weight:600; cursor:pointer; overflow-wrap:anywhere; }
.customer-editor .customer-contact-link:hover { text-decoration:underline; }
.customer-editor .customer-contact-email { color:var(--color-text-muted); }
.customer-editor .customer-contact-title .record-actions { margin-left:auto; }
.customer-editor .customer-account { display:flex; gap:10px; align-items:start; min-width:0; }
.customer-editor .customer-account > .client-picker { flex:1; min-width:0; }
.customer-editor .customer-new-account { margin-top:24px; flex-shrink:0; white-space:nowrap; }
.customer-editor .customer-communication { display:grid; grid-template-columns:minmax(140px,1fr) minmax(140px,1fr) minmax(220px,1.2fr); gap:14px; }
.customer-editor .customer-contact-bottom { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.customer-editor .customer-comments { min-height:114px; height:114px; }
.customer-editor .customer-associated .pagination { flex-wrap:wrap; }
.customer-editor :disabled { opacity:.8; }
@media(max-width:1200px) { .customer-editor .customer-columns { grid-template-columns:minmax(0,1.5fr) minmax(260px,1fr); } .customer-editor .customer-commercial { grid-template-columns:repeat(2,minmax(0,1fr)); } .customer-editor .customer-commercial > :first-child { grid-column:1/-1; } }
@media(max-width:1000px) { .customer-editor .customer-columns { grid-template-columns:minmax(0,1fr); } }
@media(max-width:700px) {
 .customer-editor .customer-contact-bottom,.customer-editor .customer-communication { grid-template-columns:minmax(0,1fr); }
 .customer-editor .customer-account { flex-wrap:wrap; } .customer-editor .customer-account > .client-picker { flex-basis:100%; }
 .customer-editor .customer-new-account { margin-top:0; }
 .customer-editor .button { min-height:40px; }
}

/* Piloto Clientes, optativo. Contactos conserva todos los selectores anteriores. */
.sales-client-editor.customer-editor { font-size:.875rem; }
.sales-client-editor .customer-columns { align-items:start; grid-template-columns:minmax(0,1.8fr) minmax(18rem,1fr); }
.sales-client-editor .customer-main,.sales-client-editor .form-section,.sales-client-editor .customer-associated,.sales-client-editor .form-field { min-width:0; }
.sales-client-editor .form-field { grid-template-columns:minmax(0,1fr); }
.sales-client-editor .customer-associated { align-self:start; }
.sales-client-editor .form-section__header { border-bottom:var(--border-subtle); background:var(--desktop-header-surface); }
.sales-client-editor .customer-commercial { grid-template-columns:minmax(0,1fr) minmax(0,.65fr) minmax(0,1.4fr); }
.sales-client-editor .customer-associated-heading { margin-bottom:0; }
.sales-client-editor .customer-contact-card { margin:0; padding:.75rem 0; border:0; border-bottom:var(--border-subtle); border-radius:0; background:transparent; }
.sales-client-editor .customer-contact-title { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; }
.sales-client-editor .customer-contact-title .customer-contact-link { grid-column:1; grid-row:1 / 3; }
.sales-client-editor .customer-contact-title .record-actions { grid-column:2; grid-row:1; justify-self:end; }
.sales-client-editor .customer-contact-title .customer-type { grid-column:2; grid-row:2; justify-self:end; max-width:100%; white-space:normal; }
.sales-client-editor :is(.form-label,.form-control,select,textarea,.address-field__summary) { font-size:.875rem; }
.sales-client-editor .address-field .address-field__summary { font-size:.875rem; }
.sales-client-editor .address-field .button { font-size:.8125rem; min-height:2.125rem; }
.sales-client-editor .customer-audit.customer-audit { font-size:.75rem; }
.sales-client-editor :is(.customer-state,.customer-type,.customer-count,.form-field__help,.customer-audit) { font-size:.75rem; }
.sales-client-editor .form-section__title { font-size:1.0625rem; }
.sales-client-editor :is(.button,.input-affix > span) { font-size:.8125rem; }
.sales-client-editor :is(.form-control,select,textarea) { height:auto; min-height:2.125rem; }
.sales-client-editor .input-affix .form-control { height:auto; min-height:2rem; flex:1 1 0; width:0; min-width:0; }
.sales-client-editor .input-affix > span { padding-inline:.5rem; }
.sales-client-editor .sales-client-number-scroll { max-width:100%; min-width:0; overflow-x:auto; padding:2px; }
.sales-client-editor .sales-client-credit { --desktop-number-width:calc(var(--sales-credit-digits,20) * 1ch + 4rem); width:var(--desktop-number-width); max-width:none; }
.sales-client-editor .desktop-number--percent { --desktop-number-width:6.5rem; width:6.5rem; max-width:100%; }
.sales-client-editor .sales-client-icon { min-width:2.25rem; min-height:2.25rem; padding:.375rem; }
.sales-client-editor .customer-action-icon { width:1.5rem; height:1.5rem; }
.sales-clients-workspace .form-action-bar__status { padding:.5rem .75rem; margin:0; border:var(--border-subtle); border-radius:var(--radius-control); background:var(--color-warning-surface); color:var(--color-text); }
.sales-clients-workspace[data-client-state="loading"] .form-action-bar__status { background:var(--color-info-surface); }
.sales-client-notice { padding:.5rem .75rem; border:var(--border-subtle); border-radius:var(--radius-control); background:var(--color-success-surface); color:var(--color-text); white-space:normal; }
.sales-client-editor .form-control.valid { border-color:var(--color-input-border); }
.sales-client-editor .form-control.invalid,
.sales-client-editor :is(.input-affix,.address-field):has(.invalid) { border-color:var(--color-danger); }
.sales-client-editor .validation-message { white-space:normal; overflow-wrap:anywhere; }
@media (max-width:1200px) {
 .sales-client-editor .customer-commercial { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .sales-client-editor .customer-commercial > :first-child { grid-column:1/-1; }
}
@media (max-width:80rem) {
 .sales-client-editor .customer-columns { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:700px) {
 .sales-client-editor .customer-commercial { grid-template-columns:minmax(0,1fr); }
 .sales-client-editor .customer-contact-title .customer-contact-link { grid-row:1; }
 .sales-client-editor .customer-contact-title .customer-type { grid-column:1/-1; }
}
/* Captura y auxiliares de Clientes/Contactos, incluida capacidad híbrida de puntero fino. */
html[data-touch-capable="true"] :is(.customer-editor,.address-dialog,.customer-term-dialog) :is(button,input,select,textarea,[role="button"]) {
 min-height:48px; min-width:48px;
}
html[data-touch-capable="true"] .customer-editor .input-affix .form-control { min-height:48px; }
html[data-touch-capable="true"] .customer-editor-panel.compact-actions .form-action-bar .button { min-height:48px; min-width:48px; }
html[data-touch-capable="true"] dialog.dialog-card:is(.address-dialog,.customer-term-dialog)[open] :is(.button,.form-control) { min-height:48px; min-width:48px; }
html[data-touch-capable="true"] .sales-clients-list .button { min-height:48px; min-width:48px; }
html[data-touch-capable="true"] .customer-editor .address-field button.address-field__icon-action { width:48px; min-width:48px; min-height:48px; }

/* Referencia integral: el borde de la sección recorta el encabezado a sangre. */
.compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) { --customer-section-padding:14px; }
.compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) .form-section { padding:var(--customer-section-padding); overflow:hidden; }
.compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) .form-section__header {
 border-radius:0; margin:calc(-1 * var(--customer-section-padding)) calc(-1 * var(--customer-section-padding)) 10px;
 padding:8px 12px;
}
@media(max-width:700px) {
 .compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) { --customer-section-padding:10px; }
}

/* Adopción móvil de Clientes/Contactos: mismo formulario y contrato de acciones.
   Escritorio conserva IconsOnly; Volver y ⋮ siguen siendo controles compactos. */
:is(.sales-clients-workspace,.sales-contacts-workspace) .form-action-bar.form-action-bar--contract.form-action-bar--icons-only:is([data-touch="true"],[data-layout="compact"]) .form-action-bar__entry:not([data-action-role="back"]) .desktop-action:has(img) {
 width:auto; height:auto; min-width:48px; min-height:48px; max-width:100%; padding:8px 12px; gap:8px; align-self:stretch; justify-content:center;
}
:is(.sales-clients-workspace,.sales-contacts-workspace) .form-action-bar.form-action-bar--contract.form-action-bar--icons-only:is([data-touch="true"],[data-layout="compact"]) .form-action-bar__entry:not([data-action-role="back"]) .desktop-action:has(img) .desktop-action__label {
 position:static; width:auto; height:auto; margin:0; clip-path:none; overflow:visible; white-space:normal; overflow-wrap:anywhere;
}
:is(.sales-clients-workspace,.sales-contacts-workspace) .form-action-bar--contract[data-layout="compact"] .form-action-bar__secondary .desktop-action { justify-content:flex-start; }
@media(max-width:64rem) {
 :is(.sales-clients-workspace,.sales-contacts-workspace) .form-action-bar.form-action-bar--contract.form-action-bar--icons-only .form-action-bar__entry:not([data-action-role="back"]) .desktop-action:has(img) {
  width:auto; height:auto; min-width:48px; min-height:48px; max-width:100%; padding:8px 12px; gap:8px; align-self:stretch; justify-content:center;
 }
 :is(.sales-clients-workspace,.sales-contacts-workspace) .form-action-bar.form-action-bar--contract.form-action-bar--icons-only .form-action-bar__entry:not([data-action-role="back"]) .desktop-action:has(img) .desktop-action__label {
  position:static; width:auto; height:auto; margin:0; clip-path:none; overflow:visible; white-space:normal; overflow-wrap:anywhere;
 }
 .compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) .form-section {
  background:var(--color-surface-raised); border:1px solid var(--color-content-border);
 }
 .compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) .form-section__header {
  background:var(--surface-glass-high); border-bottom:1px solid var(--color-content-border);
 }
 .compact-editor.customer-editor.sales-client-editor .desktop-finance {
  background:var(--finance-money-body); border-color:var(--finance-money-border); color:var(--finance-money-text);
 }
 .sales-client-editor.compact-editor .desktop-finance>.form-section__header {
  background:var(--finance-money-header); border-color:var(--finance-money-border);
 }
 .sales-client-editor .desktop-finance :is(.form-section__title,.form-label,.form-field__help) { color:var(--finance-money-text); }
 .compact-editor.customer-editor:is(.sales-client-editor,.sales-contact-editor) :is(button,input,select,textarea,[role="button"]) { min-height:48px; min-width:48px; }
 .sales-client-editor .input-affix .form-control { min-height:48px; }
 .sales-client-editor .customer-contact-card { padding:.75rem; border:1px solid var(--color-content-border); border-radius:var(--radius-control); background:var(--color-surface-subtle); margin-top:10px; }
 .sales-client-editor .customer-contact-card:nth-of-type(even) { background:var(--color-surface-raised); }
}
