/* =========================================================
   WIRTZ HUB · MI PERFIL
   CSS completo corregido
   Premium · moderno · minimalista · legible
   Modal permisos amplio · centrado · sin corte
   X / Entendido clickeables
   ========================================================= */

/* =========================================================
   RESET LOCAL
   ========================================================= */

.profile-page,
.profile-page *,
.profile-modal,
.profile-modal *,
.profile-action,
.profile-edit-form,
.profile-edit-form * {
  box-sizing: border-box;
  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif !important;
}

/* =========================================================
   VARIABLES
   ========================================================= */

.profile-page,
.profile-modal {
  --profile-bg: rgba(255, 255, 255, 0.98);
  --profile-bg-solid: #ffffff;
  --profile-bg-soft: #f8fafc;
  --profile-bg-soft-2: #f3f4f6;
  --profile-hover: rgba(15, 23, 42, 0.045);

  --profile-border: rgba(15, 23, 42, 0.105);
  --profile-border-strong: rgba(15, 23, 42, 0.17);

  --profile-text: #111827;
  --profile-muted: #6b7280;
  --profile-muted-2: #9ca3af;

  --profile-success: #16a34a;
  --profile-warning: #ca8a04;
  --profile-danger: #dc2626;
  --profile-blue: #2563eb;
  --profile-purple: #7c3aed;
  --profile-teal: #0f766e;

  --profile-radius-lg: 15px;
  --profile-radius-md: 12px;
  --profile-radius-sm: 10px;

  --profile-shadow:
    0 1px 0 rgba(255, 255, 255, 0.78) inset,
    0 10px 26px rgba(15, 23, 42, 0.045);

  --profile-transition: 0.18s ease;
}

html[data-theme="dark"] .profile-page,
html[data-theme="dark"] .profile-modal {
  --profile-bg: rgba(13, 13, 13, 0.96);
  --profile-bg-solid: #101010;
  --profile-bg-soft: #151515;
  --profile-bg-soft-2: #1d1d1d;
  --profile-hover: rgba(255, 255, 255, 0.055);

  --profile-border: rgba(255, 255, 255, 0.105);
  --profile-border-strong: rgba(255, 255, 255, 0.17);

  --profile-text: rgba(255, 255, 255, 0.92);
  --profile-muted: rgba(255, 255, 255, 0.56);
  --profile-muted-2: rgba(255, 255, 255, 0.36);

  --profile-success: #4ade80;
  --profile-warning: #facc15;
  --profile-danger: #f87171;
  --profile-blue: #60a5fa;
  --profile-purple: #a78bfa;
  --profile-teal: #2dd4bf;

  --profile-shadow:
    0 1px 0 rgba(255, 255, 255, 0.045) inset,
    0 14px 34px rgba(0, 0, 0, 0.36);
}

/* =========================================================
   CONTENEDOR · SIN ESPACIO MUERTO
   ========================================================= */

#profileContent,
.app-content:has(.profile-page) {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;

  min-height: auto !important;
  height: auto !important;

  overflow: visible !important;
  align-content: start !important;
}

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

  width: 100%;
  min-width: 0;

  min-height: auto !important;
  height: auto !important;

  color: var(--profile-text);
  overflow: visible !important;

  animation: profilePageIn 0.2s ease both;
}

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

.profile-hero,
.profile-kpis,
.profile-layout,
.profile-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius-lg);
  background: var(--profile-bg);
  box-shadow: var(--profile-shadow);

  overflow: hidden;

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

.profile-hero:hover,
.profile-card:hover {
  border-color: var(--profile-border-strong);
}

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

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

  min-height: 68px;
  padding: 10px 12px;
}

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

  min-width: 0;
}

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

  border: 1px solid color-mix(in srgb, var(--profile-purple) 32%, var(--profile-border));
  border-radius: 14px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--profile-purple) 11%, transparent),
      color-mix(in srgb, var(--profile-blue) 5%, transparent)
    );

  color: var(--profile-purple);

  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;

  overflow: hidden;

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

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

.profile-avatar--photo {
  padding: 0;
  background: var(--profile-bg-soft);
}

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

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

  min-width: 0;
}

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

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

.profile-hero__copy h2 {
  margin: 0;

  color: var(--profile-text);

  font-size: clamp(16px, 1.5vw, 20px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;

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

.profile-hero__copy p {
  margin: 0;

  color: var(--profile-muted);

  font-size: 8.6px;
  font-weight: 760;
  line-height: 1.25;

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

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

  margin-top: 3px;
}

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

  min-height: 20px;
  max-width: 230px;
  padding: 0 8px;

  border: 1px solid var(--profile-border);
  border-radius: 999px;
  background: var(--profile-bg-soft);

  color: var(--profile-text);

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

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

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

  min-width: 0;
}

/* =========================================================
   BOTONES
   ========================================================= */

.profile-action {
  position: relative;
  z-index: 2;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 31px;
  padding: 0 11px;

  border: 1px solid var(--profile-border-strong);
  border-radius: 10px;
  background: transparent;

  color: var(--profile-text);

  font-size: 8.8px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  pointer-events: auto;
  outline: none;

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

.profile-action:hover {
  border-color: color-mix(in srgb, var(--profile-text) 24%, transparent);
  background: var(--profile-hover);
  transform: translateY(-1px);
}

.profile-action:active {
  transform: translateY(0) scale(0.985);
}

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

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

.profile-action .icon,
.profile-action svg {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  stroke-width: 2.15;
  pointer-events: none;
}

.profile-action span {
  pointer-events: none;
}

.profile-action--primary,
#profileOpenPermissions {
  border-color: #111827 !important;
  background: #111827 !important;
  color: #ffffff !important;
}

.profile-action--primary:hover,
#profileOpenPermissions:hover {
  border-color: #030712 !important;
  background: #030712 !important;
  color: #ffffff !important;
}

.profile-action--primary span,
.profile-action--primary .icon,
.profile-action--primary svg,
#profileOpenPermissions span,
#profileOpenPermissions .icon,
#profileOpenPermissions svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

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

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

/* =========================================================
   KPIS
   ========================================================= */

.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: 9px 10px;

  border-right: 1px solid var(--profile-border);

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

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

.profile-kpi:hover {
  background: var(--profile-hover);
}

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

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

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

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

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

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

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

  font-size: 7.4px;
  font-weight: 820;
  line-height: 1.1;

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

.profile-kpi:nth-child(1) strong {
  color: var(--profile-success);
}

.profile-kpi:nth-child(2) strong {
  color: var(--profile-purple);
}

.profile-kpi:nth-child(3) strong {
  color: var(--profile-blue);
}

.profile-kpi:nth-child(4) strong {
  color: var(--profile-warning);
}

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

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

  background: var(--profile-bg);
}

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

  min-width: 0;
}

.profile-column:first-child {
  border-right: 1px solid var(--profile-border);
}

.profile-layout .profile-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

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

  padding: 10px;

  border-bottom: 1px solid var(--profile-border);
}

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

.profile-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;

  min-width: 0;
  min-height: 32px;
}

.profile-card__head > div {
  min-width: 0;
}

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

  color: var(--profile-text);

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

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

  color: var(--profile-purple);
}

.profile-card__head .profile-action {
  flex: 0 0 auto;
}

.profile-card--loading {
  min-height: 90px;
}

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

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

  border: 1px solid var(--profile-border);
  border-radius: 12px;

  overflow: hidden;
}

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

  min-height: 44px;
  padding: 9px;

  border-right: 1px solid var(--profile-border);
  border-bottom: 1px solid var(--profile-border);
  background: transparent;

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

.profile-field:hover {
  background: var(--profile-hover);
}

.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-security__item small,
.profile-list__row span {
  display: block;

  color: var(--profile-muted);

  font-size: 7px;
  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(--profile-text);

  font-size: 9px;
  font-weight: 900;
  line-height: 1.25;

  overflow-wrap: anywhere;
}

.profile-bio {
  display: none !important;
}

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

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

  border: 1px solid var(--profile-border);
  border-radius: 12px;

  overflow: hidden;
}

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

  min-height: 44px;
  padding: 9px;

  border-bottom: 1px solid var(--profile-border);
  background: transparent;

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

.profile-list__row:hover,
.profile-security__item:hover {
  background: var(--profile-hover);
}

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

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

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

  min-width: 0;
}

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

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

  border: 1px solid var(--profile-border);
  border-radius: 999px;
  background: var(--profile-bg-soft);

  color: var(--profile-text);

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

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

  width: 5px;
  height: 5px;

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

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

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

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

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

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

  border: 1px solid var(--profile-border);
  border-radius: 12px;

  overflow: hidden;
}

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

  min-width: 0;
  min-height: 48px;
  padding: 9px;

  border-right: 1px solid var(--profile-border);
  border-bottom: 1px solid var(--profile-border);
  background: transparent;

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

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

.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--wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.profile-edit-field--full {
  display: none !important;
}

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

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

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

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

  color: var(--profile-text);

  font: inherit;
  font-size: 9px;
  font-weight: 850;
  line-height: 1.28;
}

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

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

.profile-edit-field select {
  cursor: pointer;
}

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

.profile-edit-message {
  min-height: 22px;
  padding: 7px 9px;

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

  color: var(--profile-muted);

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

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

.profile-edit-message.is-error {
  border-color: color-mix(in srgb, var(--profile-danger) 32%, transparent);
  background: color-mix(in srgb, var(--profile-danger) 8%, transparent);
  color: var(--profile-danger);
}

.profile-edit-message.is-ok {
  border-color: color-mix(in srgb, var(--profile-success) 32%, transparent);
  background: color-mix(in srgb, var(--profile-success) 8%, transparent);
  color: var(--profile-success);
}

/* =========================================================
   FOTO
   ========================================================= */

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

  padding: 9px;

  border: 1px solid var(--profile-border);
  border-radius: 13px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--profile-purple) 6%, transparent),
      color-mix(in srgb, var(--profile-blue) 3%, transparent)
    );
}

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

  border: 1px solid color-mix(in srgb, var(--profile-purple) 30%, var(--profile-border));
  border-radius: 17px;
  background: var(--profile-bg);

  color: var(--profile-purple);

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

  overflow: hidden;
}

.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 strong {
  color: var(--profile-text);

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

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

  color: var(--profile-muted);

  font-size: 8.2px;
  font-weight: 760;
  line-height: 1.28;
}

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

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

/* =========================================================
   SWITCH
   ========================================================= */

.profile-edit-field--switch {
  align-content: center;
}

.profile-edit-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  width: 100%;
  min-width: 0;
}

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

  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.profile-edit-toggle input {
  display: none;
}

.profile-edit-toggle b {
  position: relative;

  width: 34px;
  height: 19px;
  min-width: 34px;

  border: 1px solid var(--profile-border-strong);
  border-radius: 999px;
  background: var(--profile-bg-soft);

  cursor: pointer;

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

.profile-edit-toggle b::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;

  width: 13px;
  height: 13px;

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

  transition:
    transform var(--profile-transition),
    background var(--profile-transition);
}

.profile-edit-toggle input:checked + b {
  border-color: color-mix(in srgb, var(--profile-success) 42%, transparent);
  background: color-mix(in srgb, var(--profile-success) 10%, transparent);
}

.profile-edit-toggle input:checked + b::before {
  transform: translateX(15px);
  background: var(--profile-success);
}

.profile-edit-toggle b:hover {
  border-color: color-mix(in srgb, var(--profile-text) 26%, transparent);
}

/* =========================================================
   MODAL PERMISOS · FINAL
   ========================================================= */

html.profile-modal-open,
body.profile-modal-open {
  overflow: hidden !important;
}

.profile-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;

  display: none !important;
  place-items: center !important;

  width: 100vw !important;
  height: 100vh !important;
  padding: 30px !important;

  background: rgba(15, 23, 42, 0.46) !important;
  backdrop-filter: blur(14px) saturate(0.95) !important;
  -webkit-backdrop-filter: blur(14px) saturate(0.95) !important;

  overflow: hidden !important;
  pointer-events: auto !important;
}

.profile-modal.is-open {
  display: grid !important;
  animation: profileModalBackdropIn 0.16s ease both;
}

.profile-modal__card {
  position: relative !important;
  z-index: 100000 !important;

  display: grid !important;
  grid-template-rows: 58px minmax(0, 1fr) 56px !important;

  width: min(1320px, calc(100vw - 90px)) !important;
  height: min(790px, calc(100vh - 110px)) !important;
  max-height: calc(100vh - 110px) !important;
  min-height: 520px !important;

  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  color: #111827 !important;

  box-shadow:
    0 38px 130px rgba(15, 23, 42, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.88) inset !important;

  overflow: hidden !important;
  pointer-events: auto !important;

  animation: profileModalIn 0.2s ease both;
}

html[data-theme="dark"] .profile-modal__card {
  border-color: rgba(255, 255, 255, 0.13) !important;
  background: #101010 !important;
  color: rgba(255, 255, 255, 0.92) !important;

  box-shadow:
    0 38px 130px rgba(0, 0, 0, 0.78),
    0 1px 0 rgba(255, 255, 255, 0.055) inset !important;
}

/* Header modal */
.profile-modal__head {
  position: relative !important;
  z-index: 100001 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;

  min-height: 58px !important;
  height: 58px !important;
  padding: 10px 16px !important;

  border-bottom: 1px solid rgba(15, 23, 42, 0.09) !important;
  background: #f8fafc !important;

  overflow: hidden !important;
}

html[data-theme="dark"] .profile-modal__head {
  border-bottom-color: rgba(255, 255, 255, 0.09) !important;
  background: #151515 !important;
}

.profile-modal__head > div {
  min-width: 0 !important;
}

.profile-modal__head span {
  display: block !important;

  color: #6b7280 !important;

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

.profile-modal__head h3 {
  margin: 4px 0 0 !important;

  color: #111827 !important;

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

.profile-modal__head p {
  margin: 4px 0 0 !important;

  color: #6b7280 !important;

  font-size: 9px !important;
  font-weight: 760 !important;
  line-height: 1.2 !important;
}

html[data-theme="dark"] .profile-modal__head span,
html[data-theme="dark"] .profile-modal__head p {
  color: rgba(255, 255, 255, 0.56) !important;
}

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

.profile-modal__close {
  position: relative !important;
  z-index: 100002 !important;

  display: grid !important;
  place-items: center !important;

  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;

  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  border-radius: 12px !important;
  background: #ffffff !important;

  color: #111827 !important;

  cursor: pointer !important;
  pointer-events: auto !important;

  transition:
    background var(--profile-transition),
    border-color var(--profile-transition),
    transform var(--profile-transition) !important;
}

.profile-modal__close:hover {
  border-color: rgba(15, 23, 42, 0.24) !important;
  background: rgba(15, 23, 42, 0.055) !important;
  transform: translateY(-1px) !important;
}

.profile-modal__close:active {
  transform: scale(0.985) !important;
}

.profile-modal__close .icon,
.profile-modal__close svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  stroke-width: 2.15 !important;
  pointer-events: none !important;
}

html[data-theme="dark"] .profile-modal__close {
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: #1d1d1d !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

/* Body modal */
.profile-modal__body {
  position: relative !important;
  z-index: 100000 !important;

  display: block !important;

  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;

  padding: 12px !important;

  background: #ffffff !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  scrollbar-width: thin !important;
  scrollbar-color: rgba(120, 128, 145, 0.58) transparent !important;
}

html[data-theme="dark"] .profile-modal__body {
  background: #101010 !important;
}

.profile-modal__body::-webkit-scrollbar {
  width: 9px !important;
}

.profile-modal__body::-webkit-scrollbar-track {
  background: transparent !important;
}

.profile-modal__body::-webkit-scrollbar-thumb {
  border: 2px solid transparent !important;
  border-radius: 999px !important;
  background: rgba(120, 128, 145, 0.58) !important;
  background-clip: content-box !important;
}

.profile-modal__body::-webkit-scrollbar-thumb:hover {
  background: rgba(120, 128, 145, 0.72) !important;
  background-clip: content-box !important;
}

html[data-theme="dark"] .profile-modal__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28) !important;
  background-clip: content-box !important;
}

/* Lista permisos */
.profile-permission-list {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;

  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  border-radius: 16px !important;
  background: #ffffff !important;

  overflow: hidden !important;
}

html[data-theme="dark"] .profile-permission-list {
  border-color: rgba(255, 255, 255, 0.1) !important;
  background: #101010 !important;
}

.profile-permission-row {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) 150px !important;
  gap: 12px !important;
  align-items: center !important;

  min-height: 54px !important;
  padding: 8px 12px !important;

  border-bottom: 1px solid rgba(15, 23, 42, 0.085) !important;
  background: transparent !important;

  transition:
    background var(--profile-transition),
    border-color var(--profile-transition),
    transform var(--profile-transition) !important;
}

.profile-permission-row:last-child {
  border-bottom: 0 !important;
}

.profile-permission-row:hover {
  background: rgba(15, 23, 42, 0.035) !important;
}

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

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

.profile-permission-row__icon {
  display: grid !important;
  place-items: center !important;

  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;

  border: 1px solid color-mix(in srgb, var(--profile-purple) 30%, transparent) !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, var(--profile-purple) 7%, transparent) !important;

  color: var(--profile-purple) !important;
}

.profile-permission-row__icon .icon,
.profile-permission-row__icon svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  stroke-width: 2.15 !important;
}

.profile-permission-row__content {
  display: grid !important;
  gap: 3px !important;
  min-width: 0 !important;
}

.profile-permission-row__content strong {
  color: #111827 !important;

  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.1 !important;

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

.profile-permission-row__content small {
  color: #6b7280 !important;

  font-size: 8px !important;
  font-weight: 760 !important;
  line-height: 1.15 !important;

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

html[data-theme="dark"] .profile-permission-row__content strong {
  color: rgba(255, 255, 255, 0.92) !important;
}

html[data-theme="dark"] .profile-permission-row__content small {
  color: rgba(255, 255, 255, 0.56) !important;
}

.profile-permission-row__access {
  display: flex !important;
  justify-content: flex-end !important;
  min-width: 0 !important;
}

.profile-permission-row__access span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  min-height: 24px !important;
  max-width: 100% !important;
  padding: 0 10px !important;

  border: 1px solid color-mix(in srgb, var(--profile-teal) 28%, transparent) !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--profile-teal) 6%, transparent) !important;

  color: var(--profile-teal) !important;

  font-size: 8px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  white-space: nowrap !important;

  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Empty */
.profile-permission-empty {
  display: grid;
  place-items: center;
  gap: 8px;

  min-height: 220px;
  padding: 22px;

  text-align: center;
}

.profile-permission-empty .icon {
  width: 32px;
  height: 32px;
  color: var(--profile-muted);
}

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

  font-size: 14px;
  font-weight: 950;
}

.profile-permission-empty p {
  max-width: 340px;
  margin: 0;

  color: var(--profile-muted);

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

/* Footer modal */
.profile-modal__footer {
  position: relative !important;
  z-index: 100001 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;

  min-height: 56px !important;
  height: 56px !important;
  padding: 10px 16px !important;

  border-top: 1px solid rgba(15, 23, 42, 0.09) !important;
  background: #f8fafc !important;

  overflow: hidden !important;
  pointer-events: auto !important;
}

html[data-theme="dark"] .profile-modal__footer {
  border-top-color: rgba(255, 255, 255, 0.09) !important;
  background: #151515 !important;
}

.profile-modal__footer .profile-action {
  position: relative !important;
  z-index: 100002 !important;

  min-height: 34px !important;
  padding: 0 14px !important;
  border-radius: 12px !important;

  font-size: 9px !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.profile-modal__footer .profile-action .icon,
.profile-modal__footer .profile-action svg {
  width: 13px !important;
  height: 13px !important;
}

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

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

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

@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 var(--profile-border);
  }
}

@media (max-width: 760px) {
  .profile-modal {
    padding: 10px !important;
  }

  .profile-modal__card {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    min-height: 0 !important;

    grid-template-rows: auto minmax(0, 1fr) auto !important;
    border-radius: 18px !important;
  }

  .profile-modal__head {
    height: auto !important;
    min-height: 56px !important;
  }

  .profile-modal__footer {
    height: auto !important;
    min-height: 56px !important;
  }

  .profile-permission-row {
    grid-template-columns: 38px minmax(0, 1fr) !important;
    min-height: auto !important;
    padding: 10px !important;
  }

  .profile-permission-row__access {
    grid-column: 1 / -1 !important;
    justify-content: flex-start !important;
    padding-left: 50px !important;
  }

  .profile-permission-row__content strong,
  .profile-permission-row__content small {
    white-space: normal !important;
  }
}

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

  .profile-hero,
  .profile-kpis,
  .profile-layout {
    border-radius: 13px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    padding: 9px;
  }

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

  .profile-avatar {
    width: 39px;
    height: 39px;
    min-width: 39px;
    border-radius: 12px;
    font-size: 12px;
  }

  .profile-hero__copy h2 {
    font-size: 17px;
    line-height: 1.04;
    white-space: normal;
  }

  .profile-hero__copy p {
    font-size: 8.2px;
    white-space: normal;
  }

  .profile-badges span {
    max-width: 100%;
    min-height: 19px;
    font-size: 6.8px;
  }

  .profile-hero__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
  }

  .profile-hero__actions .profile-action,
  .profile-action {
    width: 100%;
    min-height: 32px;
    font-size: 8.6px;
  }

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

  .profile-field,
  .profile-kpi,
  .profile-edit-field {
    border-right: 0;
    border-bottom: 1px solid var(--profile-border);
  }

  .profile-field:last-child,
  .profile-kpi:last-child,
  .profile-edit-field:last-child {
    border-bottom: 0;
  }

  .profile-kpi:nth-child(n + 3) {
    border-top: 0;
  }

  .profile-card {
    padding: 8px;
  }

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

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

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

    min-height: 42px;
  }

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

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

  .profile-photo-editor {
    grid-template-columns: 1fr;
  }

  .profile-photo-editor__preview {
    width: 62px;
    height: 62px;
  }

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

/* =========================================================
   HEIGHT SAFETY
   ========================================================= */

@media (max-height: 820px) {
  .profile-modal {
    padding: 22px !important;
  }

  .profile-modal__card {
    height: calc(100vh - 70px) !important;
    max-height: calc(100vh - 70px) !important;
    min-height: 0 !important;

    grid-template-rows: 52px minmax(0, 1fr) 50px !important;
  }

  .profile-modal__head {
    min-height: 52px !important;
    height: 52px !important;
  }

  .profile-modal__footer {
    min-height: 50px !important;
    height: 50px !important;
  }

  .profile-permission-row {
    min-height: 48px !important;
    padding: 7px 10px !important;
  }

  .profile-permission-row__content strong {
    font-size: 10px !important;
  }

  .profile-permission-row__content small {
    font-size: 7.4px !important;
  }

  .profile-permission-row__access span {
    min-height: 22px !important;
    font-size: 7.6px !important;
  }
}

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

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

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

@keyframes profileModalBackdropIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes profileModalIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

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

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .profile-page,
  .profile-page *,
  .profile-page *::before,
  .profile-page *::after,
  .profile-modal,
  .profile-modal *,
  .profile-modal *::before,
  .profile-modal *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}/* =========================================================
   MI PERFIL · FIX FOOTER EN MODAL
   El modal no mueve el footer y lo cubre correctamente
   ========================================================= */

/* El footer no debe participar visualmente cuando el modal está abierto */
html.profile-modal-open .app-main > footer,
body.profile-modal-open .app-main > footer,
html.profile-modal-open .footer,
body.profile-modal-open .footer,
html.profile-modal-open [class*="footer"],
body.profile-modal-open [class*="footer"] {
  position: relative !important;
  z-index: 1 !important;
}

/* El modal debe cubrir también la zona del footer */
.profile-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;

  display: none !important;
  place-items: center !important;

  width: 100vw !important;
  height: 100vh !important;

  padding: 28px !important;

  background: rgba(15, 23, 42, 0.54) !important;
  backdrop-filter: blur(14px) saturate(0.95) !important;
  -webkit-backdrop-filter: blur(14px) saturate(0.95) !important;

  overflow: hidden !important;
  pointer-events: auto !important;
}

.profile-modal.is-open {
  display: grid !important;
}

/* La card ya no llega hasta el footer */
.profile-modal__card {
  width: min(1240px, calc(100vw - 96px)) !important;
  height: min(720px, calc(100vh - 112px)) !important;
  max-height: calc(100vh - 112px) !important;
  min-height: 0 !important;

  grid-template-rows: 56px minmax(0, 1fr) 54px !important;

  border-radius: 22px !important;
  overflow: hidden !important;
}

/* Body scrollea por dentro */
.profile-modal__body {
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Footer del modal siempre adentro de la card */
.profile-modal__footer {
  position: relative !important;
  z-index: 100001 !important;

  height: 54px !important;
  min-height: 54px !important;

  background: #f8fafc !important;
  border-top: 1px solid rgba(15, 23, 42, 0.09) !important;
}

html[data-theme="dark"] .profile-modal__footer {
  background: #151515 !important;
  border-top-color: rgba(255, 255, 255, 0.09) !important;
}

/* La lista no debe empujar el footer del sistema */
.profile-permission-list {
  min-height: auto !important;
  height: auto !important;
}

/* Pantallas bajas */
@media (max-height: 820px) {
  .profile-modal {
    padding: 22px !important;
  }

  .profile-modal__card {
    height: calc(100vh - 92px) !important;
    max-height: calc(100vh - 92px) !important;
    grid-template-rows: 52px minmax(0, 1fr) 50px !important;
  }

  .profile-modal__footer {
    height: 50px !important;
    min-height: 50px !important;
  }
}

/* Mobile */
@media (max-width: 760px) {
  .profile-modal {
    padding: 10px !important;
  }

  .profile-modal__card {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }
}/* =========================================================
   MI PERFIL · TEXTO E IMAGEN MÁS GRANDES
   Agregar al final de perfil.css
   ========================================================= */

/* Avatar principal */

.profile-avatar {
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;

  border-radius: 16px !important;

  font-size: 17px !important;
}

.profile-avatar--photo img {
  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
}


/* Cabecera */

.profile-hero {
  min-height: 84px !important;
  padding: 12px 14px !important;
}

.profile-hero__main {
  gap: 14px !important;
}

.profile-eyebrow,
.profile-card__head span,
.profile-photo-editor__body > span {
  font-size: 9px !important;
}

.profile-hero__copy h2 {
  font-size: 25px !important;
}

.profile-hero__copy p {
  font-size: 11.5px !important;
}

.profile-badges span {
  min-height: 24px !important;
  padding: 0 10px !important;

  font-size: 9px !important;
}


/* Botones */

.profile-action {
  min-height: 36px !important;
  padding: 0 13px !important;

  font-size: 11px !important;
}

.profile-action .icon,
.profile-action svg {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
}


/* KPIs */

.profile-kpi {
  min-height: 60px !important;
  padding: 11px 12px !important;
}

.profile-kpi span {
  font-size: 9px !important;
}

.profile-kpi strong {
  font-size: 18px !important;
}

.profile-kpi small {
  font-size: 9.5px !important;
}


/* Títulos de secciones */

.profile-card__head h3 {
  font-size: 15px !important;
}


/* Datos personales, preferencias y seguridad */

.profile-field,
.profile-list__row,
.profile-security__item {
  min-height: 52px !important;
  padding: 11px !important;
}

.profile-field small,
.profile-security__item small,
.profile-list__row span {
  font-size: 9px !important;
}

.profile-field strong,
.profile-security__item strong,
.profile-list__row strong {
  font-size: 12px !important;
}

.profile-status {
  min-height: 23px !important;
  padding: 0 9px !important;

  font-size: 9px !important;
}


/* Formulario de edición */

.profile-edit-field {
  min-height: 56px !important;
  padding: 11px !important;
}

.profile-edit-field span {
  font-size: 9px !important;
}

.profile-edit-field input,
.profile-edit-field textarea,
.profile-edit-field select {
  font-size: 12px !important;
}

.profile-edit-toggle strong {
  font-size: 11px !important;
}

.profile-edit-message {
  font-size: 10px !important;
}


/* Imagen dentro del editor */

.profile-photo-editor {
  grid-template-columns: 92px minmax(0, 1fr) !important;
  gap: 14px !important;

  padding: 12px !important;
}

.profile-photo-editor__preview {
  width: 92px !important;
  height: 92px !important;

  border-radius: 20px !important;

  font-size: 24px !important;
}

.profile-photo-editor__preview img {
  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
}

.profile-photo-editor__body strong {
  font-size: 13px !important;
}

.profile-photo-editor__body p {
  font-size: 10px !important;
}


/* Modal de permisos */

.profile-modal__head span {
  font-size: 10px !important;
}

.profile-modal__head h3 {
  font-size: 21px !important;
}

.profile-modal__head p {
  font-size: 11px !important;
}

.profile-permission-row {
  min-height: 62px !important;
}

.profile-permission-row__icon {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
}

.profile-permission-row__icon .icon,
.profile-permission-row__icon svg {
  width: 17px !important;
  height: 17px !important;
  min-width: 17px !important;
  min-height: 17px !important;
}

.profile-permission-row__content strong {
  font-size: 13px !important;
}

.profile-permission-row__content small {
  font-size: 10px !important;
}

.profile-permission-row__access span {
  min-height: 27px !important;
  padding: 0 11px !important;

  font-size: 10px !important;
}

.profile-modal__footer .profile-action {
  font-size: 11px !important;
}/* =========================================================
   MI PERFIL · IMAGEN TODAVÍA MÁS GRANDE
   Reemplazá solo los tamaños anteriores por estos valores
   o agregá este bloque al final de perfil.css
   ========================================================= */

.profile-avatar {
  width: 72px !important;
  height: 72px !important;
  min-width: 72px !important;

  border-radius: 20px !important;

  font-size: 21px !important;
}

.profile-hero {
  min-height: 98px !important;
}

.profile-hero__main {
  gap: 16px !important;
}

.profile-photo-editor {
  grid-template-columns:
    125px
    minmax(0, 1fr) !important;

  gap: 16px !important;
}

.profile-photo-editor__preview {
  width: 125px !important;
  height: 125px !important;

  border-radius: 24px !important;

  font-size: 30px !important;
}

.profile-photo-editor__preview img,
.profile-avatar--photo img {
  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
  object-position: center !important;
}/* =========================================================
   MI PERFIL
   MISMO TAMAÑO + TODO EL ANCHO + SCROLL DE PÁGINA
   Agregar al FINAL de perfil.css
   ========================================================= */

/* =========================================================
   CONTENEDOR GENERAL
   ========================================================= */

#profileContent,
.app-content:has(.profile-page) {
  display: block !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  padding: 10px !important;

  overflow: visible !important;
}

.profile-page {
  display: grid !important;

  grid-template-rows:
    auto
    auto
    auto !important;

  align-content: start !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  gap: 12px !important;

  overflow: visible !important;
}

/* =========================================================
   CABECERA
   ========================================================= */

.profile-hero {
  display: grid !important;

  grid-template-columns:
    minmax(320px, 1fr)
    auto !important;

  align-items: center !important;

  width: 100% !important;

  min-height: 112px !important;

  padding:
    16px
    18px !important;

  gap: 18px !important;

  border-radius: 13px !important;
}

.profile-hero__main {
  gap: 16px !important;
}

.profile-avatar {
  width: 76px !important;
  height: 76px !important;

  min-width: 76px !important;
  min-height: 76px !important;

  border-radius: 20px !important;

  font-size: 22px !important;
}

.profile-avatar--photo img {
  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
  object-position: center !important;
}

.profile-eyebrow {
  font-size: 9px !important;
  font-weight: 950 !important;
}

.profile-hero__copy h2 {
  font-size:
    clamp(
      25px,
      2.2vw,
      31px
    ) !important;

  font-weight: 950 !important;
  line-height: 1 !important;
}

.profile-hero__copy p {
  font-size: 12px !important;
  font-weight: 700 !important;
}

.profile-badges {
  gap: 6px !important;

  margin-top: 5px !important;
}

.profile-badges span {
  min-height: 25px !important;

  padding:
    0
    10px !important;

  font-size: 9px !important;
  font-weight: 900 !important;
}

/* =========================================================
   BOTONES
   ========================================================= */

.profile-action {
  min-height: 36px !important;
  height: 36px !important;

  padding:
    0
    12px !important;

  gap: 7px !important;

  border-radius: 9px !important;

  font-size: 11px !important;
  font-weight: 900 !important;
}

.profile-action .icon,
.profile-action svg {
  width: 15px !important;
  height: 15px !important;

  min-width: 15px !important;
  min-height: 15px !important;
}

.profile-hero__actions {
  gap: 7px !important;
}

/* =========================================================
   KPIS
   ========================================================= */

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

  width: 100% !important;

  border-radius: 13px !important;
}

.profile-kpi {
  min-height: 72px !important;

  padding:
    11px
    12px !important;

  gap: 4px !important;
}

.profile-kpi span {
  font-size: 9px !important;
  font-weight: 900 !important;
}

.profile-kpi strong {
  font-size: 19px !important;
  font-weight: 950 !important;
}

.profile-kpi small {
  font-size: 9.5px !important;
  font-weight: 700 !important;
}

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

.profile-layout {
  display: grid !important;

  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(360px, 0.8fr) !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;

  border-radius: 13px !important;

  overflow: visible !important;
}

.profile-column {
  min-width: 0 !important;
  height: auto !important;
}

.profile-card {
  gap: 12px !important;

  padding:
    14px !important;
}

.profile-card__head {
  min-height: 42px !important;
}

.profile-card__head span {
  font-size: 9px !important;
}

.profile-card__head h3 {
  margin-top: 4px !important;

  font-size: 16px !important;
  font-weight: 950 !important;
}

.profile-card__head > .icon,
.profile-card__head > svg {
  width: 18px !important;
  height: 18px !important;

  min-width: 18px !important;
  min-height: 18px !important;
}

/* =========================================================
   DATOS PERSONALES
   ========================================================= */

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

  border-radius: 11px !important;
}

.profile-field {
  min-height: 62px !important;

  padding:
    11px
    12px !important;

  gap: 6px !important;
}

.profile-field small,
.profile-security__item small,
.profile-list__row span {
  font-size: 9px !important;
  font-weight: 950 !important;
}

.profile-field strong,
.profile-security__item strong,
.profile-list__row strong {
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.35 !important;
}

/* =========================================================
   PREFERENCIAS Y SEGURIDAD
   ========================================================= */

.profile-list,
.profile-security {
  border-radius: 11px !important;
}

.profile-list__row,
.profile-security__item {
  min-height: 58px !important;

  padding:
    11px
    12px !important;

  gap: 12px !important;
}

.profile-status {
  min-height: 25px !important;

  padding:
    0
    10px !important;

  font-size: 9px !important;
  font-weight: 950 !important;
}

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

.profile-edit-form {
  gap: 12px !important;
}

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

  border-radius: 11px !important;
}

.profile-edit-field {
  min-height: 64px !important;

  padding:
    11px
    12px !important;

  gap: 7px !important;
}

.profile-edit-field span {
  font-size: 9px !important;
  font-weight: 950 !important;
}

.profile-edit-field input,
.profile-edit-field textarea,
.profile-edit-field select {
  font-size: 12px !important;
  font-weight: 800 !important;
}

.profile-edit-field textarea {
  min-height: 90px !important;
}

.profile-edit-toggle strong {
  font-size: 11px !important;
}

.profile-edit-message {
  min-height: 30px !important;

  padding:
    8px
    10px !important;

  font-size: 10px !important;
}

.profile-edit-actions {
  gap: 7px !important;
}

/* =========================================================
   EDITOR DE FOTO
   ========================================================= */

.profile-photo-editor {
  grid-template-columns:
    130px
    minmax(0, 1fr) !important;

  gap: 16px !important;

  padding: 14px !important;

  border-radius: 13px !important;
}

.profile-photo-editor__preview {
  width: 130px !important;
  height: 130px !important;

  min-width: 130px !important;
  min-height: 130px !important;

  border-radius: 24px !important;

  font-size: 31px !important;
}

.profile-photo-editor__preview img {
  width: 100% !important;
  height: 100% !important;

  object-fit: cover !important;
  object-position: center !important;
}

.profile-photo-editor__body > span {
  font-size: 9px !important;
}

.profile-photo-editor__body strong {
  font-size: 13px !important;
}

.profile-photo-editor__body p {
  font-size: 10px !important;
  line-height: 1.45 !important;
}

/* =========================================================
   SCROLL DE PÁGINA Y FOOTER
   ========================================================= */

body:has(.profile-page) .app-main {
  min-height: 100vh !important;
  height: auto !important;

  overflow: visible !important;
}

body:has(.profile-page) .app-shell {
  min-height: 100vh !important;
  height: auto !important;

  overflow: visible !important;
}

body:has(.profile-page) .app-footer,
body:has(.profile-page) #footerMount,
body:has(.profile-page) footer.app-footer {
  position: static !important;

  inset: auto !important;

  width: 100% !important;

  margin-top: 12px !important;

  transform: none !important;
}

/* =========================================================
   MODAL DE PERMISOS
   ========================================================= */

.profile-modal {
  position: fixed !important;
  inset: 0 !important;

  z-index: 100000 !important;

  display: none !important;
  place-items: center !important;

  width: 100vw !important;
  height: 100dvh !important;

  padding: 18px !important;

  background:
    rgba(
      0,
      0,
      0,
      0.76
    ) !important;

  backdrop-filter: blur(7px) !important;
  -webkit-backdrop-filter: blur(7px) !important;

  overflow: hidden !important;

  isolation: isolate !important;
}

.profile-modal.is-open {
  display: grid !important;
}

.profile-modal[aria-hidden="true"] {
  display: none !important;

  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.profile-modal[aria-hidden="false"] {
  display: grid !important;

  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.profile-modal__card {
  display: grid !important;

  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto !important;

  width:
    min(
      1240px,
      calc(100vw - 36px)
    ) !important;

  height:
    min(
      820px,
      calc(100dvh - 36px)
    ) !important;

  max-height:
    calc(
      100dvh -
      36px
    ) !important;

  min-width: 0 !important;
  min-height: 0 !important;

  border-radius: 16px !important;

  overflow: hidden !important;
}

.profile-modal__head {
  height: auto !important;
  min-height: 76px !important;

  padding:
    13px
    15px !important;
}

.profile-modal__head span {
  font-size: 9px !important;
}

.profile-modal__head h3 {
  font-size: 20px !important;
  font-weight: 950 !important;
}

.profile-modal__head p {
  font-size: 10.5px !important;
}

.profile-modal__close {
  width: 36px !important;
  height: 36px !important;

  min-width: 36px !important;
  min-height: 36px !important;

  border-radius: 9px !important;
}

.profile-modal__body {
  min-height: 0 !important;

  padding: 14px !important;

  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.profile-permission-list {
  border-radius: 11px !important;
}

.profile-permission-row {
  grid-template-columns:
    46px
    minmax(0, 1fr)
    180px !important;

  min-height: 68px !important;

  padding:
    10px
    12px !important;

  gap: 12px !important;
}

.profile-permission-row__icon {
  width: 42px !important;
  height: 42px !important;

  min-width: 42px !important;
  min-height: 42px !important;

  border-radius: 10px !important;
}

.profile-permission-row__icon .icon,
.profile-permission-row__icon svg {
  width: 18px !important;
  height: 18px !important;
}

.profile-permission-row__content strong {
  font-size: 13px !important;
}

.profile-permission-row__content small {
  margin-top: 4px !important;

  font-size: 10px !important;
}

.profile-permission-row__access span {
  min-height: 28px !important;

  padding:
    0
    11px !important;

  font-size: 10px !important;
}

.profile-modal__footer {
  height: auto !important;
  min-height: 64px !important;

  padding:
    12px
    15px !important;
}

.profile-modal__footer .profile-action {
  min-height: 36px !important;
  height: 36px !important;

  font-size: 11px !important;
}

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

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

  .profile-column:first-child {
    border-right: 0 !important;

    border-bottom:
      1px solid
      var(--profile-border) !important;
  }
}

@media (max-width: 900px) {
  .profile-hero {
    grid-template-columns:
      1fr !important;
  }

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

@media (max-width: 760px) {
  .profile-hero {
    min-height: 0 !important;

    padding: 12px !important;
  }

  .profile-avatar {
    width: 64px !important;
    height: 64px !important;

    min-width: 64px !important;
    min-height: 64px !important;
  }

  .profile-hero__copy h2 {
    font-size: 23px !important;

    white-space: normal !important;
  }

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

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

  .profile-kpi,
  .profile-field,
  .profile-edit-field {
    border-right: 0 !important;
  }

  .profile-photo-editor {
    grid-template-columns:
      1fr !important;
  }

  .profile-photo-editor__preview {
    width: 110px !important;
    height: 110px !important;

    min-width: 110px !important;
    min-height: 110px !important;
  }

  .profile-modal {
    padding: 8px !important;
  }

  .profile-modal__card {
    width:
      calc(
        100vw -
        16px
      ) !important;

    height:
      calc(
        100dvh -
        16px
      ) !important;

    max-height:
      calc(
        100dvh -
        16px
      ) !important;

    border-radius: 13px !important;
  }

  .profile-permission-row {
    grid-template-columns:
      42px
      minmax(0, 1fr) !important;
  }

  .profile-permission-row__access {
    grid-column:
      1 /
      -1 !important;

    justify-content:
      flex-start !important;

    padding-left: 54px !important;
  }
}

@media (max-width: 520px) {
  .profile-kpis {
    grid-template-columns:
      1fr !important;
  }

  .profile-hero__actions {
    display: grid !important;

    grid-template-columns:
      1fr !important;

    width: 100% !important;
  }

  .profile-hero__actions .profile-action,
  .profile-edit-actions .profile-action,
  .profile-photo-editor__actions .profile-action {
    width: 100% !important;
  }

  .profile-edit-actions,
  .profile-photo-editor__actions {
    display: grid !important;

    grid-template-columns:
      1fr !important;
  }
}/* =========================================================
   MI PERFIL · BORDES DE CARDS MÁS VISIBLES
   Agregar al FINAL de perfil.css
   ========================================================= */

/* =========================================================
   CARDS PRINCIPALES
   ========================================================= */

.profile-hero,
.profile-kpis,
.profile-layout,
.profile-card {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;
}

/* Sombra suave para separar del fondo */

.profile-hero,
.profile-kpis,
.profile-layout {
  box-shadow:
    0 1px 0
    rgba(
      255,
      255,
      255,
      0.85
    ) inset,
    0 5px 16px
    rgba(
      15,
      23,
      42,
      0.055
    ) !important;
}

/* =========================================================
   BORDES INTERNOS
   ========================================================= */

.profile-column:first-child {
  border-right-color:
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

.profile-card {
  border-bottom-color:
    rgba(
      15,
      23,
      42,
      0.16
    ) !important;
}

/* Datos personales */

.profile-fields,
.profile-list,
.profile-security,
.profile-edit-grid,
.profile-photo-editor {
  border-color:
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

/* Celdas y filas internas */

.profile-field,
.profile-list__row,
.profile-security__item,
.profile-edit-field {
  border-right-color:
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;

  border-bottom-color:
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;
}

/* Badges y estados */

.profile-badges span,
.profile-status {
  border-color:
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

/* =========================================================
   HOVER
   ========================================================= */

.profile-hero:hover,
.profile-layout:hover,
.profile-card:hover {
  border-color:
    rgba(
      15,
      23,
      42,
      0.28
    ) !important;
}

.profile-field:hover,
.profile-list__row:hover,
.profile-security__item:hover,
.profile-edit-field:hover,
.profile-edit-field:focus-within,
.profile-photo-editor:hover {
  border-color:
    rgba(
      15,
      23,
      42,
      0.24
    ) !important;
}

/* =========================================================
   MODAL DE PERMISOS
   ========================================================= */

.profile-modal__card {
  border-color:
    rgba(
      15,
      23,
      42,
      0.2
    ) !important;
}

.profile-permission-list {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;
}

.profile-permission-row {
  border-bottom-color:
    rgba(
      15,
      23,
      42,
      0.15
    ) !important;
}

.profile-permission-row:hover {
  background:
    rgba(
      15,
      23,
      42,
      0.045
    ) !important;
}

/* =========================================================
   MODO OSCURO
   ========================================================= */

html[data-theme="dark"] .profile-hero,
html[data-theme="dark"] .profile-kpis,
html[data-theme="dark"] .profile-layout,
html[data-theme="dark"] .profile-card {
  border-color:
    rgba(
      255,
      255,
      255,
      0.19
    ) !important;
}

html[data-theme="dark"] .profile-hero,
html[data-theme="dark"] .profile-kpis,
html[data-theme="dark"] .profile-layout {
  box-shadow:
    0 1px 0
    rgba(
      255,
      255,
      255,
      0.055
    ) inset,
    0 8px 20px
    rgba(
      0,
      0,
      0,
      0.32
    ) !important;
}

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

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

html[data-theme="dark"] .profile-fields,
html[data-theme="dark"] .profile-list,
html[data-theme="dark"] .profile-security,
html[data-theme="dark"] .profile-edit-grid,
html[data-theme="dark"] .profile-photo-editor {
  border-color:
    rgba(
      255,
      255,
      255,
      0.17
    ) !important;
}

html[data-theme="dark"] .profile-field,
html[data-theme="dark"] .profile-list__row,
html[data-theme="dark"] .profile-security__item,
html[data-theme="dark"] .profile-edit-field {
  border-right-color:
    rgba(
      255,
      255,
      255,
      0.13
    ) !important;

  border-bottom-color:
    rgba(
      255,
      255,
      255,
      0.13
    ) !important;
}

html[data-theme="dark"] .profile-badges span,
html[data-theme="dark"] .profile-status {
  border-color:
    rgba(
      255,
      255,
      255,
      0.17
    ) !important;
}

html[data-theme="dark"] .profile-hero:hover,
html[data-theme="dark"] .profile-layout:hover,
html[data-theme="dark"] .profile-card:hover,
html[data-theme="dark"] .profile-field:hover,
html[data-theme="dark"] .profile-list__row:hover,
html[data-theme="dark"] .profile-security__item:hover,
html[data-theme="dark"] .profile-edit-field:hover,
html[data-theme="dark"] .profile-edit-field:focus-within,
html[data-theme="dark"] .profile-photo-editor:hover {
  border-color:
    rgba(
      255,
      255,
      255,
      0.27
    ) !important;
}

html[data-theme="dark"] .profile-modal__card,
html[data-theme="dark"] .profile-permission-list {
  border-color:
    rgba(
      255,
      255,
      255,
      0.19
    ) !important;
}

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