/* =========================================================
   WIRTZ HUB · MI PERFIL
   Perfil · permisos · edición · cuenta
   Premium · minimalista · responsive · dark safe
   ========================================================= */

/* =========================================================
   PAGE
   ========================================================= */

.profile-page {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 7px;

  animation: profilePageIn 0.24s ease both;
}

/* =========================================================
   BLOQUES BASE
   ========================================================= */

.profile-hero,
.profile-kpis,
.profile-layout {
  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--panel-solid) 97%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.035),
    0 12px 28px rgba(0, 0, 0, 0.035);

  overflow: hidden;

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

html[data-theme="dark"] .profile-hero,
html[data-theme="dark"] .profile-kpis,
html[data-theme="dark"] .profile-layout {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(10, 10, 10, 0.9);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 32px rgba(0, 0, 0, 0.28);
}

/* =========================================================
   HERO
   ========================================================= */

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;

  min-height: 82px;
  padding: 9px;
}

.profile-hero__main {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
}

.profile-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  min-width: 48px;
  place-items: center;

  border: 1px solid rgba(124, 58, 237, 0.32);
  border-radius: 15px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, #7c3aed 16%, transparent),
      color-mix(in srgb, #2563eb 8%, transparent)
    );

  color: #7c3aed;

  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;

  transition:
    transform var(--transition),
    filter var(--transition),
    border-color var(--transition),
    background var(--transition),
    color var(--transition);
}

.profile-hero:hover .profile-avatar {
  transform: translateY(-1px);
  filter: saturate(1.12) contrast(1.03);
}

html[data-theme="dark"] .profile-avatar {
  border-color: color-mix(in srgb, #a78bfa 32%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, #a78bfa 14%, transparent),
      color-mix(in srgb, #60a5fa 8%, transparent)
    );

  color: #a78bfa;
}

.profile-hero__copy {
  display: grid;
  gap: 3px;

  min-width: 0;
}

.profile-eyebrow,
.profile-card__head span {
  color: var(--muted);

  font-size: 7.4px;
  font-weight: 950;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

html[data-theme="dark"] .profile-eyebrow,
html[data-theme="dark"] .profile-card__head span {
  color: rgba(255, 255, 255, 0.48);
}

.profile-hero__copy h2 {
  margin: 0;

  color: var(--text-strong);

  font-size: clamp(18px, 2vw, 24px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.065em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .profile-hero__copy h2 {
  color: rgba(255, 255, 255, 0.94);
}

.profile-hero__copy p {
  margin: 0;

  color: var(--muted);

  font-size: 9px;
  font-weight: 760;
  line-height: 1.32;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .profile-hero__copy p {
  color: rgba(255, 255, 255, 0.48);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;

  margin-top: 4px;
}

.profile-badges span {
  display: inline-flex;
  align-items: center;

  min-height: 19px;
  max-width: 220px;
  padding: 3px 7px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.025);

  color: var(--text-strong);

  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .profile-badges span {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.86);
}

.profile-hero__actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
}

/* =========================================================
   ACCIONES
   ========================================================= */

.profile-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;

  min-height: 28px;
  padding: 5px 8px;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 8px;
  background: transparent;

  color: var(--text-strong);

  font-size: 8.5px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;

  cursor: pointer;
  outline: none;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    opacity var(--transition);
}

.profile-action:hover {
  border-color: rgba(0, 0, 0, 0.24);
  background: rgba(0, 0, 0, 0.055);
}

.profile-action:active {
  transform: scale(0.98);
}

.profile-action:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-strong) 16%, transparent);
}

.profile-action .icon {
  width: 11px;
  height: 11px;
  stroke-width: 2.15;
}

html[data-theme="dark"] .profile-action {
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .profile-action:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
}

/* Acción primaria */
.profile-action--primary {
  border-color: rgba(17, 24, 39, 0.92);
  background: rgba(17, 24, 39, 0.96);
  color: #ffffff;
}

.profile-action--primary:hover {
  border-color: rgba(17, 24, 39, 1);
  background: rgba(17, 24, 39, 0.9);
}

html[data-theme="dark"] .profile-action--primary {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.9);
  color: #090909;
}

html[data-theme="dark"] .profile-action--primary:hover {
  border-color: rgba(255, 255, 255, 0.98);
  background: rgba(255, 255, 255, 0.82);
}

.profile-action:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* =========================================================
   KPI
   ========================================================= */

.profile-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-kpi {
  display: grid;
  align-content: center;
  gap: 3px;

  min-height: 48px;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);

  transition:
    background var(--transition),
    border-color var(--transition);
}

.profile-kpi:last-child {
  border-right: 0;
}

.profile-kpi:hover {
  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .profile-kpi {
  border-right-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .profile-kpi:hover {
  background: rgba(255, 255, 255, 0.065);
}

.profile-kpi span {
  color: var(--muted);

  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.085em;
  line-height: 1;
  text-transform: uppercase;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-kpi strong {
  color: var(--text-strong);

  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.06em;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-kpi small {
  color: var(--muted-2);

  font-size: 7px;
  font-weight: 820;
  line-height: 1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .profile-kpi span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .profile-kpi small {
  color: rgba(255, 255, 255, 0.38);
}

/* Acentos KPI */
.profile-kpi:nth-child(1) strong {
  color: #16a34a;
}

.profile-kpi:nth-child(2) strong {
  color: #7c3aed;
}

.profile-kpi:nth-child(3) strong {
  color: #2563eb;
}

.profile-kpi:nth-child(4) strong {
  color: #ea580c;
}

html[data-theme="dark"] .profile-kpi:nth-child(1) strong {
  color: #4ade80;
}

html[data-theme="dark"] .profile-kpi:nth-child(2) strong {
  color: #a78bfa;
}

html[data-theme="dark"] .profile-kpi:nth-child(3) strong {
  color: #60a5fa;
}

html[data-theme="dark"] .profile-kpi:nth-child(4) strong {
  color: #fb923c;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 0;
}

.profile-column {
  display: grid;
  align-content: start;
  gap: 0;

  min-width: 0;
}

.profile-column:first-child {
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .profile-column:first-child {
  border-right-color: rgba(255, 255, 255, 0.09);
}

.profile-card {
  display: grid;
  gap: 8px;

  padding: 9px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-card:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .profile-card {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.profile-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profile-card__head h3 {
  margin: 2px 0 0;

  color: var(--text-strong);

  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.profile-card__head .icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.15;

  color: #7c3aed;
}

html[data-theme="dark"] .profile-card__head h3 {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .profile-card__head .icon {
  color: #a78bfa;
}

/* =========================================================
   CAMPOS
   ========================================================= */

.profile-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;

  overflow: hidden;
}

html[data-theme="dark"] .profile-fields {
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-field {
  display: grid;
  gap: 2px;

  min-height: 45px;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.profile-field:hover {
  background: rgba(0, 0, 0, 0.035);
}

html[data-theme="dark"] .profile-field {
  border-right-color: rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .profile-field:hover {
  background: rgba(255, 255, 255, 0.055);
}

.profile-field:nth-child(2n) {
  border-right: 0;
}

.profile-field:nth-last-child(1),
.profile-field:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

.profile-field small,
.profile-bio small,
.profile-security__item small,
.profile-list__row span {
  display: block;

  color: var(--muted);

  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.profile-field strong,
.profile-security__item strong,
.profile-list__row strong {
  display: block;
  margin-top: 1px;

  color: var(--text-strong);

  font-size: 9.2px;
  font-weight: 900;
  line-height: 1.28;

  overflow-wrap: anywhere;
}

html[data-theme="dark"] .profile-field small,
html[data-theme="dark"] .profile-bio small,
html[data-theme="dark"] .profile-security__item small,
html[data-theme="dark"] .profile-list__row span {
  color: rgba(255, 255, 255, 0.48);
}

html[data-theme="dark"] .profile-field strong,
html[data-theme="dark"] .profile-security__item strong,
html[data-theme="dark"] .profile-list__row strong {
  color: rgba(255, 255, 255, 0.9);
}

.profile-bio {
  display: grid;
  gap: 4px;

  padding: 8px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.025);
}

html[data-theme="dark"] .profile-bio {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
}

.profile-bio p {
  margin: 0;

  color: var(--text);

  font-size: 9px;
  font-weight: 700;
  line-height: 1.42;
}

html[data-theme="dark"] .profile-bio p {
  color: rgba(255, 255, 255, 0.72);
}

/* =========================================================
   LISTAS
   ========================================================= */

.profile-list,
.profile-security {
  display: grid;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;

  overflow: hidden;
}

html[data-theme="dark"] .profile-list,
html[data-theme="dark"] .profile-security {
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-list__row,
.profile-security__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  min-height: 40px;
  padding: 8px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.profile-list__row:hover,
.profile-security__item:hover {
  background: rgba(0, 0, 0, 0.035);
}

.profile-list__row:last-child,
.profile-security__item:last-child {
  border-bottom: 0;
}

html[data-theme="dark"] .profile-list__row,
html[data-theme="dark"] .profile-security__item {
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .profile-list__row:hover,
html[data-theme="dark"] .profile-security__item:hover {
  background: rgba(255, 255, 255, 0.055);
}

.profile-list__row strong {
  margin-top: 0;
  text-align: right;
}

.profile-security__item {
  align-items: center;
}

.profile-security__copy {
  display: grid;
  gap: 2px;

  min-width: 0;
}

.profile-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  min-height: 20px;
  padding: 2px 7px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.025);

  color: var(--text-strong);

  font-size: 7.5px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

html[data-theme="dark"] .profile-status {
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.88);
}

.profile-status::before {
  content: "";

  width: 5px;
  height: 5px;

  border-radius: 999px;
  background: var(--muted);
}

.profile-status.status-ok::before {
  background: var(--success);
}

.profile-status.status-warn::before {
  background: var(--warning);
}

/* =========================================================
   PERMISOS
   ========================================================= */

.profile-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;

  overflow: hidden;
}

html[data-theme="dark"] .profile-permissions {
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-permission {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: center;

  min-height: 50px;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.profile-permission:hover {
  background: rgba(0, 0, 0, 0.035);
}

html[data-theme="dark"] .profile-permission {
  border-right-color: rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .profile-permission:hover {
  background: rgba(255, 255, 255, 0.055);
}

.profile-permission:nth-child(2n) {
  border-right: 0;
}

.profile-permission:nth-last-child(1),
.profile-permission:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

.profile-permission__icon {
  display: grid;
  width: 24px;
  height: 24px;
  min-width: 24px;
  place-items: center;

  border: 1px solid color-mix(in srgb, #7c3aed 28%, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  background: color-mix(in srgb, #7c3aed 6%, transparent);

  color: #7c3aed;

  transition:
    color var(--transition),
    transform var(--transition),
    filter var(--transition);
}

.profile-permission:hover .profile-permission__icon {
  transform: translateY(-1px);
  filter: saturate(1.12) contrast(1.03);
}

html[data-theme="dark"] .profile-permission__icon {
  border-color: color-mix(in srgb, #a78bfa 30%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, #a78bfa 8%, transparent);
  color: #a78bfa;
}

.profile-permission__icon .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.15;
}

.profile-permission__body {
  min-width: 0;
}

.profile-permission__body strong {
  display: block;

  color: var(--text-strong);

  font-size: 9px;
  font-weight: 950;
  line-height: 1.1;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-permission__body span {
  display: block;
  margin-top: 2px;

  color: var(--muted);

  font-size: 7.8px;
  font-weight: 730;
  line-height: 1.25;

  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

html[data-theme="dark"] .profile-permission__body strong {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .profile-permission__body span {
  color: rgba(255, 255, 255, 0.48);
}

/* =========================================================
   FORMULARIO DE EDICIÓN
   ========================================================= */

.profile-edit-form {
  display: grid;
  gap: 8px;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;

  overflow: hidden;
}

html[data-theme="dark"] .profile-edit-grid {
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-edit-field {
  display: grid;
  gap: 5px;

  min-width: 0;
  padding: 8px;

  border-right: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;

  transition:
    background var(--transition),
    border-color var(--transition);
}

.profile-edit-field:hover,
.profile-edit-field:focus-within {
  background: rgba(0, 0, 0, 0.035);
}

html[data-theme="dark"] .profile-edit-field {
  border-right-color: rgba(255, 255, 255, 0.09);
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

html[data-theme="dark"] .profile-edit-field:hover,
html[data-theme="dark"] .profile-edit-field:focus-within {
  background: rgba(255, 255, 255, 0.055);
}

.profile-edit-field:nth-child(2n) {
  border-right: 0;
}

.profile-edit-field:nth-last-child(1),
.profile-edit-field:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

.profile-edit-field--full {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
}

html[data-theme="dark"] .profile-edit-field--full {
  border-color: rgba(255, 255, 255, 0.1);
}

.profile-edit-field span {
  color: var(--muted);

  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

html[data-theme="dark"] .profile-edit-field span {
  color: rgba(255, 255, 255, 0.48);
}

.profile-edit-field input,
.profile-edit-field textarea {
  width: 100%;

  border: 0;
  outline: 0;
  background: transparent;

  color: var(--text-strong);

  font: inherit;
  font-size: 9.3px;
  font-weight: 850;
  line-height: 1.35;
}

.profile-edit-field input::placeholder,
.profile-edit-field textarea::placeholder {
  color: var(--muted-2);
}

html[data-theme="dark"] .profile-edit-field input,
html[data-theme="dark"] .profile-edit-field textarea {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .profile-edit-field input::placeholder,
html[data-theme="dark"] .profile-edit-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.profile-edit-field textarea {
  min-height: 58px;
  resize: vertical;
}

.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-edit-message {
  min-height: 20px;
  padding: 6px 8px;

  border: 1px solid transparent;
  border-radius: 9px;

  color: var(--muted);

  font-size: 8px;
  font-weight: 850;
  line-height: 1.25;
}

.profile-edit-message:empty {
  display: none;
}

.profile-edit-message.is-error {
  border-color: rgba(230, 0, 0, 0.28);
  background: rgba(230, 0, 0, 0.06);
  color: #e60000;
}

.profile-edit-message.is-ok {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.06);
  color: var(--success);
}

html[data-theme="dark"] .profile-edit-message.is-error {
  border-color: rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
}

html[data-theme="dark"] .profile-edit-message.is-ok {
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-column:first-child {
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  html[data-theme="dark"] .profile-column:first-child {
    border-bottom-color: rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 820px) {
  .profile-hero {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .profile-hero__actions {
    justify-content: flex-start;
  }

  .profile-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-kpi:nth-child(2n) {
    border-right: 0;
  }

  .profile-kpi:nth-child(n + 3) {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  html[data-theme="dark"] .profile-kpi:nth-child(n + 3) {
    border-top-color: rgba(255, 255, 255, 0.09);
  }
}

@media (max-width: 620px) {
  .profile-page {
    gap: 6px;
  }

  .profile-hero {
    padding: 8px;
  }

  .profile-hero__main {
    align-items: flex-start;
  }

  .profile-avatar {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 13px;

    font-size: 13px;
  }

  .profile-hero__copy h2 {
    white-space: normal;
  }

  .profile-hero__copy p {
    white-space: normal;
  }

  .profile-hero__actions,
  .profile-action {
    width: 100%;
  }

  .profile-fields,
  .profile-permissions,
  .profile-kpis,
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }

  .profile-field,
  .profile-permission,
  .profile-kpi,
  .profile-edit-field {
    border-right: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .profile-field:first-child,
  .profile-permission:first-child,
  .profile-kpi:first-child,
  .profile-edit-field:first-child {
    border-top: 0;
  }

  html[data-theme="dark"] .profile-field,
  html[data-theme="dark"] .profile-permission,
  html[data-theme="dark"] .profile-kpi,
  html[data-theme="dark"] .profile-edit-field {
    border-top-color: rgba(255, 255, 255, 0.09);
  }

  .profile-list__row,
  .profile-security__item {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-list__row strong {
    text-align: left;
  }

  .profile-edit-actions,
  .profile-edit-actions .profile-action {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .profile-hero,
  .profile-kpis,
  .profile-layout {
    border-radius: 12px;
  }

  .profile-badges span {
    max-width: 100%;
  }

  .profile-card {
    padding: 8px;
  }

  .profile-card__head {
    gap: 8px;
  }

  .profile-card__head h3 {
    font-size: 11.5px;
  }

  .profile-permission {
    grid-template-columns: 23px minmax(0, 1fr);
  }

  .profile-permission__icon {
    width: 23px;
    height: 23px;
    min-width: 23px;
  }
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes profilePageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Respeta usuarios con reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  .profile-page,
  .profile-page *,
  .profile-page *::before,
  .profile-page *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}




/* =========================================================
   FOTO DE PERFIL
   ========================================================= */

.profile-avatar {
  overflow: hidden;
}

.profile-avatar--photo {
  padding: 0;
  background: rgba(0, 0, 0, 0.035);
}

.profile-avatar--photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;

  padding: 9px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 13px;
  background:
    linear-gradient(
      135deg,
      rgba(124, 58, 237, 0.055),
      rgba(37, 99, 235, 0.030)
    );
}

html[data-theme="dark"] .profile-photo-editor {
  border-color: rgba(255, 255, 255, 0.10);
  background:
    linear-gradient(
      135deg,
      rgba(167, 139, 250, 0.09),
      rgba(96, 165, 250, 0.045)
    );
}

.profile-photo-editor__preview {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;

  border: 1px solid rgba(124, 58, 237, 0.28);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);

  color: #7c3aed;

  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.05em;

  overflow: hidden;
}

html[data-theme="dark"] .profile-photo-editor__preview {
  border-color: rgba(167, 139, 250, 0.28);
  background: rgba(255, 255, 255, 0.055);
  color: #a78bfa;
}

.profile-photo-editor__preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-photo-editor__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-photo-editor__body > span {
  color: var(--muted);

  font-size: 7.2px;
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.profile-photo-editor__body strong {
  color: var(--text-strong);

  font-size: 10.2px;
  font-weight: 950;
  line-height: 1.1;
}

.profile-photo-editor__body p {
  max-width: 520px;
  margin: 0;

  color: var(--muted);

  font-size: 8px;
  font-weight: 760;
  line-height: 1.35;
}

.profile-photo-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.profile-action--upload {
  cursor: pointer;
}

@media (max-width: 620px) {
  .profile-photo-editor {
    grid-template-columns: 1fr;
  }

  .profile-photo-editor__preview {
    width: 68px;
    height: 68px;
    border-radius: 16px;
  }

  .profile-photo-editor__actions,
  .profile-photo-editor__actions .profile-action {
    width: 100%;
  }
}