/**
 * Hosting506 account design system (hx-ds)
 * Shared primitives for client-area forms/lists — navy shell, not card soup.
 */

:root {
  --hx-ink: #0a2038;
  --hx-ink-2: #213a54;
  --hx-muted: #5d6c80;
  --hx-muted-2: #8493a6;
  --hx-line: #eef2f6;
  --hx-border: #e4e9ef;
  --hx-border-input: #cbd5e1;
  --hx-surface: #ffffff;
  --hx-surface-2: #fafbfc;
  --hx-radius: 12px;
  --hx-radius-sm: 8px;
  --hx-shadow: 0 8px 24px rgba(17, 26, 36, 0.06);
  --hx-focus: 0 0 0 3px rgba(33, 58, 84, 0.14);
  --hx-switch-on: #213a54;
  --hx-switch-off: #cbd5e1;
}

html.dark {
  --hx-ink: #e8edf4;
  --hx-ink-2: #c5ced8;
  --hx-muted: #9aa8b8;
  --hx-muted-2: #7a8799;
  --hx-line: #2a3140;
  --hx-border: #2a3140;
  --hx-border-input: #3a4454;
  --hx-surface: #1c212b;
  --hx-surface-2: #161b24;
  --hx-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --hx-focus: 0 0 0 3px rgba(61, 90, 122, 0.35);
  --hx-switch-on: #3d5a7a;
  --hx-switch-off: #3a4454;
}

/* ── Surface: one calm container per page section ── */
.hx-surface {
  background: var(--hx-surface);
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius);
  box-shadow: var(--hx-shadow);
  padding: 28px 32px 32px;
  margin-top: 8px;
}

@media (max-width: 767px) {
  .hx-surface {
    padding: 20px 18px 24px;
  }
}

/* ── Toolbar ── */
.hx-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--hx-line);
}

.hx-toolbar__main {
  flex: 1 1 240px;
  min-width: 0;
}

.hx-toolbar__label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--hx-muted);
  text-transform: none !important;
}

.hx-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ── Section divider (title + content, no nested card) ── */
.hx-section {
  margin: 0 0 28px;
}

.hx-section:last-of-type {
  margin-bottom: 20px;
}

.hx-section__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--hx-line);
}

.hx-section__head i {
  color: var(--hx-muted-2);
  font-size: 15px;
}

.hx-toolbar__actions .btn,
.hx-surface .btn {
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-section__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--hx-ink);
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-section__hint {
  margin: -8px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hx-muted);
}

/* ── Field with icon ── */
.hx-field {
  margin-bottom: 16px;
}

.hx-field__label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--hx-muted);
  text-transform: none !important;
}

.hx-field__control {
  position: relative;
  display: flex;
  align-items: center;
}

.hx-field__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  pointer-events: none;
  color: var(--hx-muted-2);
  font-size: 14px;
  line-height: 1;
  transition: color 0.15s ease;
}

.hx-field__control:focus-within .hx-field__icon {
  color: var(--hx-ink-2);
}

.hx-field__input,
.hx-field .form-control,
.hx-field select.form-control,
.hx-field__control > select {
  height: 44px !important;
  min-height: 44px;
  padding: 10px 14px !important;
  border: 1px solid var(--hx-border-input) !important;
  border-radius: var(--hx-radius-sm) !important;
  box-shadow: none !important;
  font-size: 14px;
  color: var(--hx-ink) !important;
  background-color: var(--hx-surface) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.hx-field--textarea .hx-field__input,
.hx-field--textarea .form-control,
.hx-field textarea.hx-field__input,
.hx-field textarea.form-control {
  height: auto !important;
  min-height: 110px;
  padding: 12px 14px !important;
  resize: vertical;
  line-height: 1.45;
}

/* Solo reservar espacio izquierdo cuando hay icono */
.hx-field__control:has(> .hx-field__icon) > .hx-field__input,
.hx-field__control:has(> .hx-field__icon) > .form-control,
.hx-field__control:has(> .hx-field__icon) > input,
.hx-field__control:has(> .hx-field__icon) > select {
  padding-left: 42px !important;
}

.hx-field select.form-control,
.hx-field__control > select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238493a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 36px !important;
  cursor: pointer;
}

.hx-field__input:focus,
.hx-field .form-control:focus,
.hx-field select.form-control:focus,
.hx-field__control > select:focus {
  border-color: var(--hx-ink-2) !important;
  box-shadow: var(--hx-focus) !important;
  outline: none;
}

.hx-field--bare .hx-field__input,
.hx-field--bare .form-control,
.hx-field--bare select.form-control,
.hx-field--bare .hx-field__control > select {
  padding-left: 14px !important;
}

.hx-field-extra {
  margin-top: 8px;
}

.hx-field-extra .btn {
  text-transform: none !important;
  letter-spacing: normal !important;
  border-radius: var(--hx-radius-sm) !important;
}

/* Custom fields WHMCS (HTML pre-renderizado) */
.hx-customfield__input {
  width: 100%;
}

.hx-customfield__input .form-control,
.hx-customfield__input select,
.hx-customfield__input input[type="text"],
.hx-customfield__input input[type="tel"],
.hx-customfield__input input[type="email"],
.hx-customfield__input input[type="number"] {
  height: 44px !important;
  min-height: 44px;
  padding: 10px 14px !important;
  border: 1px solid var(--hx-border-input) !important;
  border-radius: var(--hx-radius-sm) !important;
  box-shadow: none !important;
  font-size: 14px;
  color: var(--hx-ink) !important;
  background: var(--hx-surface) !important;
  width: 100%;
}

.hx-customfield__input select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238493a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 16px !important;
  padding-right: 36px !important;
}

.hx-customfield__input .intl-tel-input,
.hx-customfield__input .iti {
  width: 100%;
  display: block;
}

.hx-customfield__input .intl-tel-input.separate-dial-code input,
.hx-customfield__input .intl-tel-input.separate-dial-code input.form-control {
  padding-left: 88px !important;
}

.hx-customfield__input .intl-tel-input:not(.separate-dial-code) input,
.hx-customfield__input .intl-tel-input:not(.separate-dial-code) input.form-control {
  padding-left: 52px !important;
}


/* Tel + intl-tel-input (bandera WHMCS): sin icono propio, padding del plugin */
.hx-field--tel .hx-field__icon {
  display: none !important;
}

.hx-field--tel > .hx-field__control > .form-control,
.hx-field--tel > .hx-field__control > .hx-field__input {
  padding-left: 14px !important;
}

.hx-field .intl-tel-input,
.hx-field .iti,
.hx-field--tel .intl-tel-input,
.hx-field--tel .iti {
  width: 100%;
  display: block;
}

.hx-field--tel .intl-tel-input,
.hx-field--tel .iti {
  width: 100% !important;
}

/* No forzar padding fijo: intl-tel (iti-sdc-*) ya reserva bandera + código */
.hx-field--tel .intl-tel-input input,
.hx-field--tel .intl-tel-input input.form-control,
.hx-field--tel .iti input,
.hx-field--tel .iti input.form-control,
.hx-field .intl-tel-input input,
.hx-field .intl-tel-input input.form-control,
.hx-field .iti input,
.hx-field .iti input.form-control {
  padding-left: 52px !important; /* solo bandera */
  height: 44px !important;
  border-radius: var(--hx-radius-sm) !important;
}

/* Código separado (+506): punto medio (ni 6px ni 118px) */
.hx-field--tel .intl-tel-input.separate-dial-code input,
.hx-field--tel .intl-tel-input.separate-dial-code input.form-control,
.hx-field .intl-tel-input.separate-dial-code input,
.hx-field .intl-tel-input.separate-dial-code input.form-control {
  padding-left: 88px !important;
}

.hx-field--tel .intl-tel-input.separate-dial-code.iti-sdc-2 input,
.hx-field .intl-tel-input.separate-dial-code.iti-sdc-2 input {
  padding-left: 72px !important;
}
.hx-field--tel .intl-tel-input.separate-dial-code.iti-sdc-3 input,
.hx-field .intl-tel-input.separate-dial-code.iti-sdc-3 input {
  padding-left: 80px !important;
}
.hx-field--tel .intl-tel-input.separate-dial-code.iti-sdc-4 input,
.hx-field .intl-tel-input.separate-dial-code.iti-sdc-4 input {
  padding-left: 90px !important;
}

.hx-field--tel .intl-tel-input .flag-container,
.hx-field--tel .iti__flag-container,
.hx-field .intl-tel-input .flag-container,
.hx-field .iti__flag-container {
  z-index: 3;
}

/* ── Switch ── */
.hx-switch-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hx-switch-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--hx-line);
  cursor: pointer;
  font-weight: 500;
}

.hx-switch-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hx-switch-row:first-child {
  padding-top: 0;
}

.hx-switch-row__text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--hx-ink);
  line-height: 1.4;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-switch-row__hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  color: var(--hx-muted);
}

.hx-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 1px;
}

.hx-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.hx-switch__slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: var(--hx-switch-off);
  border-radius: 24px;
  transition: background 0.2s ease;
}

.hx-switch__slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(17, 26, 36, 0.22);
  transition: transform 0.2s ease;
}

.hx-switch input:checked + .hx-switch__slider {
  background: var(--hx-switch-on);
}

.hx-switch input:checked + .hx-switch__slider::before {
  transform: translateX(20px);
}

.hx-switch input:focus-visible + .hx-switch__slider {
  box-shadow: var(--hx-focus);
}

.hx-switch input:disabled + .hx-switch__slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Actions ── */
.hx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--hx-line);
}

.hx-actions .btn {
  border-radius: var(--hx-radius-sm) !important;
  font-weight: 600;
  padding: 10px 16px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-actions .btn-primary {
  background: linear-gradient(135deg, #213a54 0%, #0a2038 100%) !important;
  border: none !important;
  box-shadow: 0 3px 10px rgba(10, 32, 56, 0.18);
}

.hx-actions .btn-default {
  background: var(--hx-surface) !important;
  border: 1px solid var(--hx-border-input) !important;
  color: var(--hx-ink-2) !important;
  font-weight: 500;
}

.hx-actions .btn-danger {
  font-weight: 600;
}

.hx-actions .btn-link {
  border: 0 !important;
  background: transparent !important;
  color: var(--hx-muted) !important;
  font-weight: 500;
  box-shadow: none !important;
}

/* ── Table shell (for later lists) ── */
.hx-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius);
  background: var(--hx-surface);
  box-shadow: var(--hx-shadow);
}

.hx-table-wrap .table {
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.hx-table-wrap .table > thead > tr > th {
  background: var(--hx-surface-2);
  border-bottom: 1px solid var(--hx-line) !important;
  font-size: 12px;
  font-weight: 600;
  color: var(--hx-muted);
  text-transform: none;
  padding: 14px 16px !important;
}

.hx-table-wrap .table > tbody > tr > td {
  padding: 14px 16px !important;
  vertical-align: middle !important;
  border-top-color: var(--hx-line) !important;
  color: var(--hx-ink);
}

/* ── Pill ── */
.hx-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.hx-pill--navy {
  background: var(--hx-ink);
  color: #fff;
}

.hx-pill--muted {
  background: var(--hx-line);
  color: var(--hx-muted);
}

.hx-pill--ok {
  background: #e8f6ee;
  color: #1f7a45;
}

html.dark .hx-pill--ok {
  background: #1a3324;
  color: #7dcea0;
}

html.dark .hx-pill--navy {
  background: #3d5a7a;
}

/* ── Mis Datos (clientareadetails) ── */
.hx-details .hx-section__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.hx-details .hx-section__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--hx-ink);
  flex: 1 1 auto;
}

.hx-details .hx-section__head > i:first-child {
  color: var(--hx-muted-2);
  font-size: 15px;
}

.hx-details .btn-change-address {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--hx-border-input);
  color: var(--hx-muted);
  padding: 8px 14px;
  border-radius: var(--hx-radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-details .btn-change-address:hover {
  background: var(--hx-ink);
  border-color: var(--hx-ink);
  color: #fff;
}

.hx-details .btn-change-address.btn-editing {
  background: #e8f6ee;
  border-color: #1f7a45;
  color: #1f7a45 !important;
}

.hx-details .btn-change-address.btn-editing:hover {
  background: #e8f6ee;
  border-color: #1f7a45;
  color: #1f7a45 !important;
}

.hx-field__input--locked,
.hx-details .address-locked,
.hx-details .cr-cascade-locked,
.hx-details .hx-field .form-control.address-locked,
.hx-details .hx-field .form-control.cr-cascade-locked,
.hx-details .hx-field .form-control.hx-field__input--locked,
.hx-details .hx-field input.hx-field__input--locked,
.hx-details .hx-field select.address-locked,
.hx-details .hx-field select.cr-cascade-locked,
.hx-details .hx-field select:disabled,
.hx-details .hx-field input:disabled,
.hx-details .hx-field input[readonly],
.hx-details .hx-field input[readonly].address-locked,
.hx-details .hx-field input[readonly].cr-cascade-locked,
.hx-details .hx-field input[readonly].hx-field__input--locked,
.hx-details .hx-field__control > select.address-locked,
.hx-details .hx-field__control > select.cr-cascade-locked,
.hx-details .hx-field__control > select:disabled,
.hx-details .hx-field--tel input:disabled,
.hx-details .hx-field--tel .iti input:disabled,
.hx-details .hx-field--tel .intl-tel-input input:disabled {
  background-color: #f5f5f5 !important;
  background-image: none !important; /* sin chevron “activo” en selects bloqueados */
  cursor: not-allowed !important;
  border-color: #e0e0e0 !important;
  color: #6b7280 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* Cursor bloqueado también sobre el control / icono */
.hx-details .hx-field__control:has(> .address-locked),
.hx-details .hx-field__control:has(> .cr-cascade-locked),
.hx-details .hx-field__control:has(> .hx-field__input--locked),
.hx-details .hx-field__control:has(> select:disabled),
.hx-details .hx-field__control:has(> input:disabled),
.hx-details .hx-field__control:has(> input[readonly]) {
  cursor: not-allowed !important;
}

.hx-details .hx-field__control:has(> .address-locked) > .hx-field__icon,
.hx-details .hx-field__control:has(> .cr-cascade-locked) > .hx-field__icon,
.hx-details .hx-field__control:has(> .hx-field__input--locked) > .hx-field__icon,
.hx-details .hx-field__control:has(> select:disabled) > .hx-field__icon,
.hx-details .hx-field__control:has(> input:disabled) > .hx-field__icon,
.hx-details .hx-field__control:has(> input[readonly]) > .hx-field__icon {
  color: #c0c6ce;
  cursor: not-allowed !important;
}

html.dark .hx-field__input--locked,
html.dark .hx-details .address-locked,
html.dark .hx-details .cr-cascade-locked,
html.dark .hx-details .hx-field .form-control.address-locked,
html.dark .hx-details .hx-field .form-control.cr-cascade-locked,
html.dark .hx-details .hx-field .form-control.hx-field__input--locked,
html.dark .hx-details .hx-field input.hx-field__input--locked,
html.dark .hx-details .hx-field select.address-locked,
html.dark .hx-details .hx-field select.cr-cascade-locked,
html.dark .hx-details .hx-field select:disabled,
html.dark .hx-details .hx-field input:disabled,
html.dark .hx-details .hx-field input[readonly],
html.dark .hx-details .hx-field__control > select:disabled,
html.dark .hx-details .hx-field--tel input:disabled,
html.dark .hx-details .hx-field--tel .iti input:disabled {
  background-color: #161b24 !important;
  background-image: none !important;
  border-color: #2a3140 !important;
  color: var(--hx-muted) !important;
}



.hx-details .hx-field__control select.form-control,
.hx-details .hx-field__control select.hx-field__input {
  padding-left: 42px !important;
}

.hx-details .cedula-loading {
  position: relative;
}

.hx-details .cedula-loading::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--hx-ink-2);
  border-radius: 50%;
  animation: hx-spin 0.8s linear infinite;
  z-index: 5;
}

@keyframes hx-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.hx-details .table-account-changes {
  margin-top: 12px;
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius-sm);
  overflow: hidden;
}

.hx-details .hx-actions {
  margin-top: 8px;
}

/* Custom fields adicionales: iconos + switches */
.hx-details .hx-field--switch {
  margin-bottom: 8px;
  padding: 4px 0;
}

.hx-details .hx-field--switch .hx-switch-list {
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius-sm);
  background: var(--hx-surface-2);
  padding: 4px 14px;
}

.hx-details .hx-field--switch .hx-switch-row {
  border-bottom: 0;
  padding: 12px 0;
  align-items: center;
}

.hx-details .hx-field__control .hx-field__icon.fab {
  font-family: "Font Awesome 5 Brands", "Font Awesome 6 Brands";
  font-weight: 400;
}

.hx-details .hx-field--whatsapp .hx-field__icon {
  color: #25d366;
}

/* Si intl-tel envuelve WhatsApp, no competir con el icono FA */
.hx-details .hx-field--whatsapp .intl-tel-input,
.hx-details .hx-field--whatsapp .iti {
  width: 100%;
}

.hx-details .hx-field--whatsapp .hx-field__icon ~ .intl-tel-input .hx-field__icon,
.hx-details .hx-field--whatsapp:has(.intl-tel-input) > .hx-field__control > .hx-field__icon,
.hx-details .hx-field--whatsapp:has(.iti) > .hx-field__control > .hx-field__icon {
  display: none;
}

.hx-details .hx-field--whatsapp:has(.intl-tel-input) .hx-field__control > input,
.hx-details .hx-field--whatsapp:has(.iti) .hx-field__control > input {
  padding-left: 14px !important; /* iti ajusta el suyo */
}

.hx-details .hx-field .help-block {
  display: none;
}

.hx-details .hx-section__hint {
  margin: 6px 0 0;
}

/* Permisos de usuario */
.hx-permissions .hx-permissions__user {
  margin: -4px 0 18px;
  font-size: 13px;
  color: var(--hx-muted);
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-permissions .hx-switch-list {
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius-sm);
  background: var(--hx-surface-2);
  padding: 4px 18px;
}

.hx-permissions .hx-switch-row {
  align-items: center;
  padding: 16px 0;
}

.hx-permissions .hx-switch-row:first-child {
  padding-top: 14px;
}

.hx-permissions .hx-switch-row:last-child {
  padding-bottom: 14px;
}

.hx-permissions .hx-switch-row__text,
.hx-permissions .hx-switch-row__hint,
.hx-permissions label {
  text-transform: none !important;
  letter-spacing: normal !important;
}

.hx-permissions-invite {
  margin-top: 12px;
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius-sm);
  background: var(--hx-surface-2);
  padding: 4px 18px;
}

.hx-permissions-invite .hx-switch-row {
  align-items: center;
  padding: 14px 0;
}

.hx-permissions-invite .hx-switch-row__text,
.hx-permissions-invite .hx-switch-row__hint,
.hx-permissions-invite label,
.hx-account-invite label.radio-inline {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: 14px;
}

/* Contactos: copiar empresa del perfil */
.hx-contacts .btn-copy-company {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid var(--hx-border);
  border-radius: 6px;
  background: var(--hx-surface-2);
  color: var(--hx-muted);
  cursor: pointer;
  vertical-align: middle;
  line-height: 1;
}

.hx-contacts .btn-copy-company:hover {
  color: var(--hx-ink-2);
  border-color: var(--hx-ink-2);
}

.hx-contacts .hx-field__label {
  display: flex;
  align-items: center;
}

/* ── Modal (cambio de titular, etc.) ── */
.hx-modal .modal-content {
  border: 1px solid var(--hx-border);
  border-radius: var(--hx-radius);
  box-shadow: var(--hx-shadow);
  overflow: hidden;
  background: var(--hx-surface);
}

.hx-modal .modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--hx-surface-2);
  border-bottom: 1px solid var(--hx-line);
  color: var(--hx-ink);
}

.hx-modal .modal-header .close {
  order: 2;
  margin: 0 0 0 auto;
  float: none;
  padding: 0;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  color: var(--hx-muted);
  opacity: 1;
  text-shadow: none;
}

.hx-modal .modal-header .close:hover,
.hx-modal .modal-header .close:focus {
  color: var(--hx-ink);
  opacity: 1;
}

.hx-modal .modal-title {
  order: 1;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--hx-ink);
  text-transform: none !important;
  letter-spacing: normal;
  line-height: 1.3;
}

.hx-modal .modal-title i {
  margin-right: 6px;
  color: var(--hx-ink-2);
}

.hx-modal .modal-body {
  padding: 18px 20px 20px;
}

.hx-modal .modal-footer.hx-actions,
.hx-modal .hx-actions.modal-footer {
  margin: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--hx-line);
  background: var(--hx-surface-2);
  justify-content: flex-end;
  text-align: left;
}

.hx-modal__form .hx-field {
  margin-bottom: 14px;
}

.hx-modal__form .hx-field:last-child {
  margin-bottom: 0;
}

.hx-modal__form .row .hx-field {
  margin-bottom: 14px;
}

.hx-req {
  color: #b45309;
  font-weight: 600;
}

.hx-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--hx-border);
  border-left-width: 3px;
  border-radius: var(--hx-radius-sm);
  background: var(--hx-surface-2);
  color: var(--hx-muted);
  font-size: 13px;
  line-height: 1.35;
}

.hx-notice i {
  flex-shrink: 0;
  margin-top: 0;
  font-size: 15px;
  color: var(--hx-ink-2);
}

.hx-notice > div {
  display: inline;
  min-width: 0;
}

.hx-notice strong {
  display: inline;
  margin: 0 0.35em 0 0;
  color: var(--hx-ink);
  font-weight: 600;
}

.hx-notice strong::after {
  content: "—";
  margin-left: 0.35em;
  font-weight: 500;
  color: inherit;
  opacity: 0.7;
}

.hx-notice--warn {
  border-left-color: #d97706;
  background: #fffbeb;
  color: #78350f;
}

.hx-notice--warn i {
  color: #d97706;
}

.hx-notice--warn strong {
  color: #92400e;
}

html.dark .hx-notice--warn {
  background: rgba(217, 119, 6, 0.12);
  color: #fbbf24;
  border-color: #3a4454;
  border-left-color: #d97706;
}

html.dark .hx-notice--warn strong {
  color: #fcd34d;
}

#modalAlertContainer {
  margin-top: 16px;
}

#modalAlertContainer:empty {
  display: none;
  margin: 0;
}


/* ── Unified page header (Mi cuenta + listas hx) ──
 * One row: [icon] Title (left, ~26px) · breadcrumb (right).
 * Do not stack a second in-page H1 under this bar on hx pages.
 */
.hexa-page-header.hx-page-header,
.hexa-content .hexa-page-header,
.main-content .hexa-page-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-top: 16px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--hx-border, #e4e9ef) !important;
  min-height: 0 !important;
  height: auto !important;
}

.hexa-page-header .hx-page-header__title,
.hexa-content .hexa-page-header h2,
.main-content .hexa-page-header h2 {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  max-width: 100%;
  font-size: 26px !important;
  font-weight: 600 !important;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--hx-ink, #0a2038);
}

.hexa-page-header .hx-page-header__icon,
.hexa-page-header h2 > .icon {
  width: 1.05em !important;
  height: 1.05em !important;
  font-size: 1em !important;
  flex: 0 0 auto;
  margin-right: 0 !important;
  opacity: 0.92;
}

.hexa-page-header .hx-page-header__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hexa-page-header .hx-page-header__crumb,
.hexa-page-header .md\:ml-auto {
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.hexa-page-header .hx-page-header__crumb ol {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.hexa-page-header .show-info {
  font-size: 14px;
  color: var(--hx-muted-2, #8493a6);
  padding-left: 4px !important;
  padding-right: 0 !important;
}

/* Internal list/form pages: intro lives in-page; keep collapsible desc closed */
body.hx-internal-page .page-information {
  display: none !important;
}

html.dark .hexa-page-header.hx-page-header,
html.dark .hexa-content .hexa-page-header,
html.dark .main-content .hexa-page-header {
  border-bottom-color: var(--hx-border, #2a3140) !important;
}

html.dark .hexa-page-header .hx-page-header__title,
html.dark .hexa-content .hexa-page-header h2,
html.dark .main-content .hexa-page-header h2 {
  color: var(--hx-ink, #e8edf4);
}

@media (max-width: 767px) {
  .hexa-page-header .hx-page-header__title,
  .hexa-content .hexa-page-header h2,
  .main-content .hexa-page-header h2 {
    font-size: 22px;
  }

  .hexa-page-header .hx-page-header__crumb {
    width: 100%;
    margin-left: 0;
  }
}
