/* Acceso local obligatorio para el panel de operación. */

body.auth-locked {
  overflow: hidden;
}

body.auth-locked > :not(#authGate) {
  visibility: hidden;
  pointer-events: none;
}

/* Mientras auth.js valida la sesión no mostrar fugazmente el formulario de
   inicio. Si la sesión es válida se quita junto con auth-locked; si no, se
   quita al bloquear y se muestra el acceso normalmente. */
body.auth-pending #authGate {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

body.auth-pending::after {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 6000;
  content: 'Verificando sesión…';
  transform: translate(-50%, -50%);
  color: #c2a17e;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 3rem);
  background:
    radial-gradient(circle at 16% 12%, rgba(222, 91, 71, .2), transparent 29rem),
    radial-gradient(circle at 85% 86%, rgba(243, 182, 93, .1), transparent 26rem),
    #0d1012;
  color: #f7f3ec;
  opacity: 1;
  transition: opacity .35s ease, visibility .35s ease;
}

.auth-gate[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.auth-gate::before {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  opacity: .27;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.auth-orbit {
  position: absolute;
  border: 1px solid rgba(243, 182, 93, .14);
  border-radius: 50%;
  pointer-events: none;
}

.auth-orbit-one { width: min(52vw, 44rem); aspect-ratio: 1; top: -28%; left: -15%; transform: rotate(-22deg); }
.auth-orbit-two { width: min(42vw, 34rem); aspect-ratio: 1; right: -16%; bottom: -28%; border-color: rgba(223, 91, 71, .16); }

.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(23rem, .92fr);
  width: min(100%, 69rem);
  min-height: min(43rem, calc(100vh - 3rem));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 1.65rem;
  background: rgba(24, 28, 31, .9);
  box-shadow: 0 28px 100px rgba(0,0,0,.48), 0 0 0 1px rgba(243,182,93,.04);
  backdrop-filter: blur(18px);
}

.auth-story {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(2rem, 5vw, 4rem);
  background: linear-gradient(145deg, rgba(51, 27, 24, .85), rgba(26, 30, 33, .54) 57%, rgba(19, 22, 24, .45));
}

.auth-brand-lockup,
.auth-mobile-brand { display: flex; align-items: center; gap: .75rem; }
.auth-brand-lockup strong, .auth-mobile-brand strong { display: block; color: #fffaf3; font-size: .98rem; letter-spacing: -.02em; }
.auth-brand-lockup small, .auth-mobile-brand small { display: block; margin-top: .15rem; color: #c2a17e; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.auth-brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  border: 1px solid rgba(243, 182, 93, .64);
  border-radius: .9rem;
  background: linear-gradient(145deg, #e36b51, #9e392f);
  box-shadow: 0 8px 20px rgba(223, 91, 71, .22);
  color: #fff7ed;
  font-weight: 950;
  letter-spacing: -.08em;
}
.auth-brand-mark::after { position: absolute; inset: .22rem; border: 1px solid rgba(255,255,255,.22); border-radius: .7rem; content: ''; }
.auth-brand-mark i { position: absolute; top: .32rem; right: .4rem; width: .3rem; height: .3rem; border-radius: 50%; background: #f3b65d; box-shadow: 0 0 10px #f3b65d; }
.auth-brand-mark span { position: relative; z-index: 1; font-size: .84rem; }

.auth-story-copy { max-width: 31rem; margin: auto 0; padding: 3.2rem 0 2.3rem; }
.auth-kicker, .auth-eyebrow { display: inline-flex; align-items: center; gap: .45rem; color: #f3b65d; font-size: .64rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.auth-kicker::before { width: 1.35rem; height: 1px; background: #f3b65d; content: ''; }
.auth-story h1 { margin: 1rem 0 1.05rem; color: #fffaf3; font-size: clamp(2.35rem, 4.7vw, 4.2rem); font-weight: 900; letter-spacing: -.075em; line-height: .98; }
.auth-story h1 em { color: #f3b65d; font-style: normal; }
.auth-story-copy > p { max-width: 29rem; color: #b5bec5; font-size: .92rem; line-height: 1.65; }

.auth-story-features { display: grid; gap: .75rem; }
.auth-story-features > div { display: flex; align-items: flex-start; gap: .85rem; }
.auth-story-features > div > span { color: #b15a4b; font-size: .63rem; font-weight: 900; letter-spacing: .12em; }
.auth-story-features p { display: grid; gap: .13rem; }
.auth-story-features strong { color: #ebe5dc; font-size: .75rem; }
.auth-story-features small { color: #89939b; font-size: .68rem; }
.auth-story-footer { display: flex; align-items: center; gap: .5rem; margin-top: 2rem; color: #747f88; font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.auth-live-dot { width: .42rem; height: .42rem; border-radius: 50%; background: #43c995; box-shadow: 0 0 0 .22rem rgba(67,201,149,.1), 0 0 10px rgba(67,201,149,.8); }

.auth-panel { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: clamp(2rem, 5vw, 4.3rem) clamp(1.6rem, 5vw, 4.2rem); background: rgba(14, 17, 19, .72); }
.auth-mobile-brand { display: none; margin-bottom: 2.4rem; }
.auth-form-heading { margin-bottom: 2rem; }
.auth-form-heading h2 { margin: .6rem 0 .55rem; color: #fffaf3; font-size: clamp(1.65rem, 3vw, 2.25rem); letter-spacing: -.055em; line-height: 1.08; }
.auth-form-heading p { max-width: 22rem; color: #89939b; font-size: .8rem; line-height: 1.55; }

.auth-form { display: grid; gap: 1rem; }
.auth-field { display: grid; gap: .42rem; }
.auth-field[hidden] { display: none; }
.auth-field label { color: #dfe3e6; font-size: .72rem; font-weight: 800; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon { position: absolute; left: .9rem; z-index: 1; color: #d07b64; font-size: .75rem; pointer-events: none; }
.auth-input-wrap input { width: 100%; min-height: 3.05rem; padding: .8rem .9rem .8rem 2.45rem; border: 1px solid #323a41; border-radius: .8rem; outline: none; background: #181d21; color: #f8f6f1; font: inherit; font-size: .82rem; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.auth-input-wrap input::placeholder { color: #68737c; }
.auth-input-wrap input:focus { border-color: rgba(243,182,93,.7); background: #1c2227; box-shadow: 0 0 0 3px rgba(243,182,93,.1); }
.auth-input-wrap input:-webkit-autofill { -webkit-text-fill-color: #f8f6f1; box-shadow: 0 0 0 1000px #181d21 inset; }
.auth-password-toggle { position: absolute; right: .55rem; padding: .35rem .42rem; border: 0; border-radius: .45rem; background: transparent; color: #aeb8be; font: inherit; font-size: .62rem; font-weight: 800; cursor: pointer; }
.auth-password-toggle:hover { color: #f3b65d; background: rgba(243,182,93,.08); }

.auth-form-meta { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-height: 1.45rem; }
.auth-session-note { color: #79858d; font-size: .64rem; }
.auth-check-mark { display: inline-grid; place-items: center; width: .9rem; height: .9rem; margin-right: .3rem; border-radius: 50%; background: rgba(67,201,149,.14); color: #65d9a9; font-size: .58rem; font-weight: 900; }
.auth-text-button { padding: 0; border: 0; background: transparent; color: #d48b72; font: inherit; font-size: .64rem; font-weight: 800; cursor: pointer; }
.auth-text-button:hover { color: #f3b65d; text-decoration: underline; }
.auth-submit { display: flex; align-items: center; justify-content: space-between; min-height: 3.1rem; margin-top: .35rem; padding: .65rem 1rem  .65rem 1.15rem; border: 1px solid rgba(243,182,93,.38); border-radius: .8rem; background: linear-gradient(135deg, #df5b47, #b94136); color: #fff9f1; box-shadow: 0 10px 22px rgba(223,91,71,.2); font: inherit; font-size: .78rem; font-weight: 900; cursor: pointer; transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; }
.auth-submit b { display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border: 1px solid rgba(255,255,255,.24); border-radius: .5rem; font-size: 1rem; }
.auth-submit:hover { filter: brightness(1.08); box-shadow: 0 13px 28px rgba(223,91,71,.3); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { cursor: wait; filter: grayscale(.2); opacity: .72; transform: none; }
.auth-message { min-height: 1.2rem; margin: 0; color: #ee8e7c; font-size: .68rem; line-height: 1.45; }
.auth-message.is-success { color: #65d9a9; }
.auth-panel-footer { display: flex; align-items: center; gap: .45rem; margin-top: auto; padding-top: 2.8rem; color: #68737b; font-size: .62rem; line-height: 1.4; }
.auth-lock-icon { color: #d48b72; font-size: 1rem; transform: rotate(180deg); }

.auth-user-control { display: inline-flex; align-items: center; gap: .42rem; min-height: 2.1rem; padding: .25rem .35rem .25rem .55rem; border: 1px solid #343c43; border-radius: 999px; background: rgba(255,255,255,.035); }
.auth-user-avatar { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: rgba(67,201,149,.16); color: #65d9a9; font-size: .9rem; line-height: 1; }
.auth-user-name { max-width: 7rem; overflow: hidden; color: #cfd7db; font-size: .64rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.auth-user-role { padding: .18rem .32rem; border-radius: 999px; background: rgba(243,182,93,.1); color: #f3b65d; font-size: .53rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.auth-logout-button { padding: .32rem .55rem; border: 1px solid rgba(223,91,71,.35); border-radius: 999px; background: rgba(223,91,71,.1); color: #ff9b81; font: inherit; font-size: .61rem; font-weight: 900; cursor: pointer; }
.auth-logout-button:hover { border-color: rgba(243,182,93,.65); color: #f3b65d; }

/* Administración de usuarios dentro de Ajustes. */
.admin-users-card { border-color: rgba(243, 182, 93, .34) !important; background: linear-gradient(145deg, rgba(243,182,93,.07), rgba(24,27,31,.98) 38%) !important; }
.admin-only-tag { border-color: rgba(243,182,93,.4) !important; background: rgba(243,182,93,.1) !important; color: #f3b65d !important; }
.admin-users-intro { margin: -.25rem 0 1rem; color: var(--text-muted); font-size: .74rem; line-height: 1.5; }
.admin-current-access { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.1rem; padding: .7rem .75rem; border: 1px solid rgba(243,182,93,.24); border-radius: .8rem; background: rgba(243,182,93,.06); }
.admin-crown-badge { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: .65rem; background: rgba(243,182,93,.16); color: #f3b65d; font-size: 1.1rem; }
.admin-current-access strong { display: block; color: var(--text-main); font-size: .8rem; }
.admin-current-access small { display: block; margin-top: .12rem; color: #c2915c; font-size: .63rem; }
.admin-users-section-heading, .admin-create-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: .6rem; margin-bottom: .5rem; }
.admin-users-section-heading .form-label, .admin-create-heading .form-label { margin-bottom: 0; }
.admin-users-count { color: var(--text-muted); font-size: .64rem; font-weight: 800; }
.admin-users-list { display: grid; gap: .45rem; }
.admin-user-row { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .58rem .62rem; border: 1px solid var(--border-color); border-radius: .72rem; background: rgba(255,255,255,.025); transition: border-color .18s ease, opacity .18s ease; }
.admin-user-row:hover { border-color: rgba(243,182,93,.38); }
.admin-user-row.is-disabled { opacity: .58; }
.admin-user-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: .58rem; background: rgba(223,91,71,.15); color: #ff9b81; font-size: .72rem; font-weight: 900; }
.admin-user-avatar.is-admin { background: rgba(243,182,93,.16); color: #f3b65d; }
.admin-user-copy { display: grid; min-width: 0; flex: 1; gap: .08rem; }
.admin-user-copy strong { overflow: hidden; color: var(--text-main); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-copy small { overflow: hidden; color: var(--text-muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-copy em { overflow: hidden; color: #b89a73; font-size: .58rem; font-style: normal; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
.admin-mini-button { padding: .28rem .38rem; border: 1px solid #3a444d; border-radius: .4rem; background: #20252b; color: #cbd5dc; font: inherit; font-size: .57rem; font-weight: 800; cursor: pointer; }
.admin-mini-button:hover { border-color: rgba(243,182,93,.65); color: #f3b65d; }
.admin-mini-button.is-danger { border-color: rgba(223,91,71,.32); color: #e98a77; }
.admin-mini-button.is-danger:hover { border-color: rgba(223,91,71,.7); color: #ff9b81; }
.admin-owner-badge { padding: .26rem .4rem; border: 1px solid rgba(243,182,93,.32); border-radius: 999px; color: #f3b65d; font-size: .57rem; font-weight: 900; }
.admin-create-heading { align-items: flex-start; }
.admin-create-heading small { display: block; margin-top: .15rem; color: var(--text-muted); font-size: .63rem; line-height: 1.35; }
.admin-create-user-form { display: grid; gap: .65rem; }
.admin-create-user-form .form-group { margin: 0; }
.admin-create-user-form .form-label { font-size: .67rem; }
.admin-create-user-form .form-input { min-height: 2.45rem; font-size: .73rem; }
.admin-create-user-button { width: 100%; justify-content: center; min-height: 2.6rem; font-size: .7rem; }
.admin-create-user-form .form-row-2 { margin: 0; }
.admin-permissions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; margin-top: .35rem; }
.admin-permissions-grid label { display: flex; align-items: center; gap: .38rem; min-height: 2rem; padding: .4rem .48rem; border: 1px solid var(--border-color); border-radius: .5rem; color: var(--text-muted); font-size: .62rem; cursor: pointer; }
.admin-permissions-grid label:has(input:checked) { border-color: rgba(243,182,93,.42); background: rgba(243,182,93,.08); color: var(--text-main); }
.admin-permissions-grid label.admin-permission-locked { cursor: not-allowed; opacity: .58; }
.admin-permissions-grid input { accent-color: #d96d52; }
.admin-form-actions { display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
.admin-cancel-user-button { min-height: 2.6rem; font-size: .7rem; }
.admin-users-message { min-height: 1rem; margin: 0; color: #ee8e7c; font-size: .65rem; line-height: 1.4; }
.admin-users-message.is-success { color: #65d9a9; }

.profile-role-switcher { margin: 0 .2rem; }
.profile-role-switcher-label { display: block; margin-bottom: .35rem; color: var(--text-muted); font-size: .61rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.profile-role-switcher-select { width: 100%; min-height: 2.25rem; padding: .45rem .55rem; border: 1px solid rgba(243,182,93,.34); border-radius: .55rem; background: rgba(243,182,93,.07); color: var(--text-main); font: inherit; font-size: .68rem; font-weight: 800; }
.profile-role-switcher-select:focus { outline: 0; border-color: rgba(243,182,93,.75); box-shadow: 0 0 0 3px rgba(243,182,93,.1); }
.profile-role-switcher-note { display: block; margin-top: .35rem; color: var(--text-muted); font-size: .6rem; line-height: 1.35; }

@media (max-width: 760px) {
  .auth-gate { padding: .75rem; }
  .auth-shell { display: block; width: min(100%, 31rem); min-height: auto; border-radius: 1.25rem; }
  .auth-story { display: none; }
  .auth-panel { min-height: min(42rem, calc(100vh - 1.5rem)); padding: 2.1rem clamp(1.25rem, 7vw, 2.6rem) 1.4rem; }
  .auth-mobile-brand { display: flex; }
  .auth-form-heading { margin-bottom: 1.65rem; }
  .auth-panel-footer { padding-top: 2.2rem; }
  .auth-user-name { display: none; }
  .auth-user-role { display: none; }
  .admin-user-row { align-items: flex-start; flex-wrap: wrap; }
  .admin-user-actions { width: 100%; padding-left: 2.4rem; justify-content: flex-start; }
  .admin-permissions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .auth-panel { padding-inline: 1.05rem; }
  .auth-mobile-brand { margin-bottom: 1.7rem; }
  .auth-form-meta { align-items: flex-start; flex-direction: column; gap: .35rem; }
}

/* Perfil del usuario: el logo de la cabecera también funciona como avatar. */
.brand-profile-trigger {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: 0 0 auto;
}
.brand-profile-trigger .brand-logo-svg { display: block; width: 42px; height: 42px; transition: transform .18s ease, opacity .18s ease; animation: brand-ember-glow 3.2s ease-in-out infinite; }
.brand-profile-trigger .brand-logo-svg > circle:nth-of-type(n+3) { transform-box: fill-box; transform-origin: center; animation: brand-ember-flicker 1.8s ease-in-out infinite alternate; }
.brand-profile-trigger .brand-logo-svg > circle:nth-of-type(4) { animation-delay: .55s; }
.brand-profile-trigger .brand-logo-svg > circle:nth-of-type(5) { animation-delay: 1.05s; }
.brand-profile-trigger:hover .brand-logo-svg { transform: rotate(-4deg) scale(1.06); }
.brand-profile-trigger .brand-logo-svg[hidden] { display: none; }
@keyframes brand-ember-glow {
  0%, 100% { filter: drop-shadow(0 2px 3px rgba(245, 158, 11, .16)); }
  50% { filter: drop-shadow(0 2px 6px rgba(245, 158, 11, .38)); }
}
@keyframes brand-ember-flicker {
  from { opacity: .55; transform: scale(.82); }
  to { opacity: 1; transform: scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-profile-trigger .brand-logo-svg,
  .brand-profile-trigger .brand-logo-svg > circle:nth-of-type(n+3) { animation: none; }
}
.brand-profile-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #f3b65d;
  border-radius: 50%;
  box-sizing: border-box;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  transition: transform .18s ease, border-color .18s ease;
}
.brand-profile-image[hidden] { display: none !important; }
.brand-profile-trigger:hover .brand-profile-image { transform: scale(1.06); border-color: #df5b47; }

.auth-user-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.auth-user-profile-trigger:hover .auth-user-name { color: #f3b65d; }
.auth-user-avatar { position: relative; overflow: hidden; }
.auth-user-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-user-avatar img[hidden],
.auth-user-avatar span[hidden] { display: none !important; }

.profile-modal-card { max-width: 600px; }
.profile-modal-header { align-items: flex-start; gap: 1rem; }
.profile-modal-subtitle { margin: .22rem 0 0; color: #89959e; font-size: .68rem; line-height: 1.45; }
.profile-modal-body { gap: 1rem; }
.profile-identity-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .8rem;
  border: 1px solid rgba(243,182,93,.28);
  border-radius: .9rem;
  background: linear-gradient(135deg, rgba(243,182,93,.11), rgba(223,91,71,.06));
}
.profile-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 4.2rem;
  height: 4.2rem;
  flex: 0 0 auto;
  border: 2px solid #f3b65d;
  border-radius: 50%;
  background: linear-gradient(135deg, #df5b47, #8d302b);
  color: #fff9f1;
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
}
.profile-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-preview img[hidden], .profile-preview span[hidden] { display: none !important; }
.profile-preview span { font-size: 1.1rem; font-weight: 900; letter-spacing: .05em; }
.profile-identity-copy { display: grid; min-width: 0; gap: .18rem; }
.profile-kicker { color: #f3b65d; font-size: .58rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.profile-identity-copy strong { overflow: hidden; color: #f8f6f1; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity-copy small { color: #aeb8be; font-size: .67rem; }
.profile-photo-controls { display: grid; gap: .35rem; }
.profile-photo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.profile-upload-button, .profile-remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: .48rem .72rem;
  border-radius: .58rem;
  font: inherit;
  font-size: .67rem;
  font-weight: 900;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.profile-upload-button { border: 1px solid rgba(243,182,93,.55); background: rgba(243,182,93,.12); color: #f3b65d; }
.profile-remove-button { border: 1px solid rgba(223,91,71,.38); background: rgba(223,91,71,.08); color: #ff9b81; }
.profile-upload-button:hover, .profile-remove-button:hover:not(:disabled) { transform: translateY(-1px); }
.profile-upload-button:hover { border-color: #f3b65d; background: rgba(243,182,93,.18); }
.profile-remove-button:hover:not(:disabled) { border-color: #df5b47; background: rgba(223,91,71,.15); }
.profile-remove-button:disabled { cursor: not-allowed; opacity: .45; }
.profile-photo-controls > small { color: #79858d; font-size: .61rem; line-height: 1.4; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.profile-field-wide { grid-column: 1 / -1; }
.profile-form-grid .form-group { margin: 0; }
.profile-form-grid .form-input[readonly] { cursor: not-allowed; opacity: .72; }
.profile-message { min-height: 1.1rem; margin: 0; color: #ee8e7c; font-size: .66rem; line-height: 1.4; }
.profile-message.is-success { color: #65d9a9; }
.profile-modal-footer { justify-content: flex-end; }

body:not(.dark-mode) .auth-user-control { border-color: #cbd6df; background: rgba(255,255,255,.9); }
body:not(.dark-mode) .auth-user-name { color: #344451; }
body:not(.dark-mode) .auth-user-role { background: #fff4df; color: #8a5a00; }
body:not(.dark-mode) .auth-user-avatar { background: #e9f8f1; color: #168052; }
body:not(.dark-mode) .auth-logout-button { background: #fff0ee; border-color: #efaaa0; color: #b42318; }
body:not(.dark-mode) .profile-modal-card { background: #fff; border-color: #d8e0e7; color: #273746; }
body:not(.dark-mode) .profile-modal-header,
body:not(.dark-mode) .profile-modal-footer { background: #f8fafb; border-color: #dfe6eb; }
body:not(.dark-mode) .profile-modal-subtitle { color: #64717d; }
body:not(.dark-mode) .profile-identity-card { border-color: #e5c98f; background: linear-gradient(135deg, #fff8e8, #fff4f1); }
body:not(.dark-mode) .profile-identity-copy strong { color: #17202a; }
body:not(.dark-mode) .profile-identity-copy small,
body:not(.dark-mode) .profile-photo-controls > small { color: #64717d; }
body:not(.dark-mode) .profile-form-grid .form-input { background: #fff; border-color: #cbd6df; color: #17202a; }
body:not(.dark-mode) .profile-form-grid .form-input[readonly] { background: #f1f4f6; color: #536371; }
body:not(.dark-mode) .profile-upload-button { background: #fff4df; border-color: #d59a38; color: #8a5a00; }
body:not(.dark-mode) .profile-remove-button { background: #fff0ee; border-color: #efaaa0; color: #b42318; }

@media (max-width: 620px) {
  .profile-modal-card { max-height: 92vh; }
  .profile-modal-header { padding-inline: 1rem; }
  .profile-modal-body { padding-inline: 1rem; }
  .profile-modal-footer { padding-inline: 1rem; }
}

@media (max-width: 440px) {
  .profile-form-grid { grid-template-columns: 1fr; }
  .profile-field-wide { grid-column: auto; }
  .profile-photo-actions { align-items: stretch; flex-direction: column; }
  .profile-upload-button, .profile-remove-button { width: 100%; }
}

/* Confirmación propia para acciones que descartan productos. */
.account-delete-confirm-overlay { z-index: 3200; }
.account-delete-confirm-card { max-width: 480px; overflow: hidden; }
.account-delete-confirm-topline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: .75rem;
  padding: 1.15rem 1.25rem 1rem;
  border-bottom: 1px solid #343c43;
  background: linear-gradient(135deg, rgba(223,91,71,.12), rgba(243,182,93,.06));
}
.account-delete-confirm-icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(223,91,71,.48);
  border-radius: .7rem;
  background: rgba(223,91,71,.16);
  color: #ff9b81;
  font-size: 1.05rem;
  font-weight: 950;
}
.account-delete-confirm-eyebrow { display: block; margin-bottom: .18rem; color: #f3b65d; font-size: .58rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.account-delete-confirm-topline h2 { margin: 0; color: #f8f6f1; font-size: 1.1rem; line-height: 1.15; }
.account-delete-confirm-topline .btn-close-modal { margin: -.25rem -.35rem 0 0; }
.account-delete-confirm-body { display: grid; gap: .85rem; padding: 1.1rem 1.25rem; }
.account-delete-confirm-message { margin: 0; color: #cfd7db; font-size: .78rem; line-height: 1.55; }
.account-delete-confirm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  padding: .7rem;
  border: 1px solid #343c43;
  border-radius: .75rem;
  background: #20252b;
}
.account-delete-confirm-summary > div { display: grid; min-width: 0; gap: .16rem; }
.account-delete-confirm-summary span { color: #8e9aa3; font-size: .59rem; font-weight: 800; text-transform: uppercase; }
.account-delete-confirm-summary strong { overflow: hidden; color: #f3b65d; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.account-delete-confirm-warning { margin: 0; padding: .65rem .7rem; border-left: 3px solid #df5b47; border-radius: .45rem; background: rgba(223,91,71,.09); color: #ffb0a0; font-size: .67rem; line-height: 1.45; }
.account-delete-confirm-footer { display: flex; justify-content: flex-end; gap: .6rem; padding: .85rem 1.25rem 1.1rem; border-top: 1px solid #343c43; background: #16191d; }
.account-delete-confirm-footer button { min-height: 2.55rem; }
.account-delete-confirm-action { padding: .55rem .8rem; border: 1px solid rgba(223,91,71,.72); border-radius: .62rem; background: linear-gradient(135deg, #df5b47, #b94136); color: #fff9f1; font: inherit; font-size: .68rem; font-weight: 900; cursor: pointer; }
.account-delete-confirm-action:hover { filter: brightness(1.08); transform: translateY(-1px); }
.account-delete-confirm-action:disabled { opacity: .62; cursor: progress; transform: none; }
.account-delete-confirm-progress { margin: 0; color: #f3b65d; font-size: .72rem; font-weight: 700; }

body:not(.dark-mode) .account-delete-confirm-topline { border-color: #eadde0; background: linear-gradient(135deg, #fff2ef, #fff8e8); }
body:not(.dark-mode) .account-delete-confirm-topline h2 { color: #17202a; }
body:not(.dark-mode) .account-delete-confirm-message { color: #536371; }
body:not(.dark-mode) .account-delete-confirm-summary { border-color: #d8e0e7; background: #f1f4f6; }
body:not(.dark-mode) .account-delete-confirm-summary span { color: #64717d; }
body:not(.dark-mode) .account-delete-confirm-summary strong { color: #8a5a00; }
body:not(.dark-mode) .account-delete-confirm-warning { background: #fff0ee; color: #b42318; }
body:not(.dark-mode) .account-delete-confirm-footer { border-color: #dfe6eb; background: #f8fafb; }

@media (max-width: 460px) {
  .account-delete-confirm-topline, .account-delete-confirm-body, .account-delete-confirm-footer { padding-inline: 1rem; }
  .account-delete-confirm-summary { grid-template-columns: 1fr; }
  .account-delete-confirm-footer { flex-direction: column-reverse; }
  .account-delete-confirm-footer button { width: 100%; }
}

.session-idle-warning {
  position: fixed; inset: auto 16px 18px auto; z-index: 10001; display: flex; align-items: center; gap: 16px;
  max-width: min(560px, calc(100vw - 32px)); padding: 14px 16px; border: 1px solid #d59b49; border-radius: 14px;
  background: #211b12; color: #fff4d6; box-shadow: 0 12px 40px #0008; font: 600 14px/1.4 system-ui, sans-serif;
}
.session-idle-warning button { flex: 0 0 auto; min-height: 42px; padding: 9px 14px; border: 0; border-radius: 10px; background: #e69a45; color: #21170c; font: 700 14px system-ui, sans-serif; cursor: pointer; }
@media (max-width: 560px) { .session-idle-warning { inset: auto 12px 12px; flex-direction: column; align-items: stretch; text-align: center; } }
