/* ═══════════════════════════════════════════════════════════════
   ATHEX UNIVERSAL WIDGET — athex.css
   Hosted at https://athex.andareno.com/widget/athex.css

   Covers both variants:
     Athex          — personal/family (*.andareno.com)
     Athex Enterprise — client/business (*.cximmersive.com)

   All classes prefixed with `athex-` to avoid host-app conflicts.
   No emojis anywhere.
   Developed for Anda Reno by Becchio Group LLC. (c) 2026. All rights reserved.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Fonts (loaded by JS to avoid duplicate requests) ── */
/* Poppins (headings, 600-900) + Inter (body, 400/500/700) + JetBrains Mono (codes) */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
  --athex-void:              #050b14;
  --athex-bg:                #050b14;
  --athex-surface:           rgba(10, 18, 32, 0.55);
  --athex-surface-hover:     rgba(16, 26, 46, 0.70);
  --athex-surface-solid:     rgba(8, 15, 28, 0.96);
  --athex-border:            rgba(255,255,255,0.08);
  --athex-border-hover:      rgba(255,255,255,0.16);
  --athex-cyan:              #00e5ff;
  --athex-cyan-dim:          rgba(0,229,255,0.12);
  --athex-cyan-glow:         rgba(0,229,255,0.30);
  --athex-cyan-border:       rgba(0,229,255,0.25);
  --athex-purple:            #b44dff;
  --athex-red:               #ff4444;
  --athex-red-dim:           rgba(255,68,68,0.08);
  --athex-green:             #00ff9f;
  --athex-green-dim:         rgba(0,255,159,0.10);
  --athex-blur:              40px;
  --athex-blur-sm:           16px;
  --athex-radius-card:       20px;
  --athex-radius-btn:        12px;
  --athex-radius-pill:       100px;
  --athex-ease:              cubic-bezier(0.22, 0.68, 0, 1);
  --athex-ease-spring:       cubic-bezier(0.2, 0.8, 0.2, 1);
  --athex-font-display:      'Poppins', -apple-system, sans-serif;
  --athex-font-body:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --athex-font-mono:         'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --athex-shadow-card:       0 24px 80px rgba(0,0,0,0.55), 0 0 50px rgba(0,229,255,0.06), inset 0 1px 0 rgba(255,255,255,0.10);
  --athex-shadow-menu:       0 12px 40px rgba(0,0,0,0.60), 0 0 30px rgba(0,229,255,0.05), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ─── Reset (scoped to athex- elements only) ─────────────────── */
.athex-tile,
.athex-tile *,
.athex-overlay,
.athex-overlay *,
.athex-panel,
.athex-panel * {
  box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ══════════════════════════════════════════════════════════════ */

/* Overlay fade */
@keyframes athex-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Card entrance — spring curve */
@keyframes athex-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Menu dropdowns */
@keyframes athex-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes athex-menu-in-up {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Settings / admin pane swap */
@keyframes athex-pane-in {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Sub-flow: push in from right */
@keyframes athex-push-in {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Sub-flow: pop back out to right */
@keyframes athex-pop-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* Sub-flow: previous view slides left (parallax) */
@keyframes athex-push-back {
  from { transform: translateX(0);     opacity: 1;   }
  to   { transform: translateX(-30%);  opacity: 0.5; }
}

/* Toast */
@keyframes athex-toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes athex-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}

/* Loader spinner */
@keyframes athex-spin {
  to { transform: rotate(360deg); }
}

/* Breathing cyan glow on the login card — 3s cycle */
@keyframes athex-breathe {
  0%,  100% { box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 50px rgba(0,229,255,0.06), inset 0 1px 0 rgba(255,255,255,0.10); }
  50%        { box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 80px rgba(0,229,255,0.14), inset 0 1px 0 rgba(255,255,255,0.10); }
}

/* Border shimmer — subtle brightness sweep across the card border */
@keyframes athex-border-shimmer {
  0%   { border-color: rgba(255,255,255,0.11); }
  40%  { border-color: rgba(0,229,255,0.22); }
  60%  { border-color: rgba(255,255,255,0.18); }
  100% { border-color: rgba(255,255,255,0.11); }
}

/* Autofill detection hook — intentionally empty, triggers JS via animationstart */
@keyframes athex-autofill-detect {
  from {}
  to   {}
}

/* Error shake — horizontal 4-bounce */
@keyframes athex-shake {
  0%,  100% { transform: translateX(0); }
  15%        { transform: translateX(-6px); }
  30%        { transform: translateX(5px); }
  45%        { transform: translateX(-4px); }
  60%        { transform: translateX(3px); }
  75%        { transform: translateX(-2px); }
  90%        { transform: translateX(1px); }
}


/* ══════════════════════════════════════════════════════════════
   INLINE GLASS TILE — the logged-in user pill in host app navbar
   ══════════════════════════════════════════════════════════════ */

.athex-tile {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Login CTA (logged-out state) */
.athex-tile__login-btn {
  font-family: var(--athex-font-body);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--athex-cyan);
  text-decoration: none;
  padding: 6px 16px;
  min-height: 44px;
  border-radius: var(--athex-radius-pill);
  border: 1px solid var(--athex-cyan-border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--athex-ease);
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
}
.athex-tile__login-btn:hover {
  background: rgba(0,229,255,0.14);
  border-color: rgba(0,229,255,0.50);
  box-shadow: 0 0 12px rgba(0,229,255,0.15);
}

/* User pill (logged-in state) */
.athex-tile__user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  min-height: 44px;
  border-radius: var(--athex-radius-pill);
  background: rgba(0,229,255,0.05);
  border: 1px solid rgba(0,229,255,0.18);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s var(--athex-ease);
  font-family: var(--athex-font-body);
  color: var(--athex-cyan);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.athex-tile__user-btn:hover {
  background: rgba(0,229,255,0.10);
  border-color: rgba(0,229,255,0.38);
}
.athex-tile__user-btn[aria-expanded="true"] {
  background: rgba(0,229,255,0.13);
  border-color: rgba(0,229,255,0.42);
}
.athex-tile__user-btn[aria-expanded="true"] .athex-tile__chevron {
  transform: rotate(180deg);
}

.athex-tile__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,229,255,0.22), rgba(180,77,255,0.22));
  border: 1px solid rgba(0,229,255,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--athex-font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--athex-cyan);
  letter-spacing: 0.02em;
  overflow: hidden;
  flex-shrink: 0;
}
.athex-tile__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.athex-tile__name {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--athex-cyan);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.athex-tile__chevron {
  width: 12px;
  height: 12px;
  color: rgba(255,255,255,0.28);
  transition: transform 0.22s var(--athex-ease);
  flex-shrink: 0;
}

/* Enterprise badge on tile */
.athex-tile__badge {
  font-size: 0.60rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0,229,255,0.5);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0,229,255,0.18);
  background: rgba(0,229,255,0.04);
}


/* ══════════════════════════════════════════════════════════════
   USER MENU DROPDOWN
   Always within viewport — JS flips direction as needed.
   ══════════════════════════════════════════════════════════════ */

.athex-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10000;
  width: 268px;
  padding: 6px;
  background: rgba(8, 15, 28, 0.94);
  -webkit-backdrop-filter: blur(var(--athex-blur)) saturate(1.7);
  backdrop-filter: blur(var(--athex-blur)) saturate(1.7);
  border: 1px solid rgba(0,229,255,0.16);
  border-radius: 16px;
  box-shadow: var(--athex-shadow-menu);
  animation: athex-menu-in 0.20s var(--athex-ease) both;
}
.athex-menu[hidden] { display: none; }

/* Flip upward when near bottom of viewport */
.athex-menu--above {
  top: auto;
  bottom: calc(100% + 8px);
  animation: athex-menu-in-up 0.20s var(--athex-ease) both;
}

.athex-menu__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px;
}

.athex-menu__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(0,229,255,0.22), rgba(180,77,255,0.22));
  border: 1px solid rgba(0,229,255,0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--athex-font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--athex-cyan);
  overflow: hidden;
}
.athex-menu__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.athex-menu__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.athex-menu__name {
  font-family: var(--athex-font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.athex-menu__email {
  font-family: var(--athex-font-body);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.32);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.athex-menu__variant {
  font-size: 0.60rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--athex-cyan);
  opacity: 0.6;
}

.athex-menu__divider {
  height: 1px;
  margin: 2px 10px;
  background: linear-gradient(90deg, transparent, rgba(0,229,255,0.12), transparent);
}

.athex-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: var(--athex-font-body);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  min-height: 44px;
  transition: background 0.18s, color 0.18s;
}
.athex-menu__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.48;
  transition: opacity 0.18s, color 0.18s;
}
.athex-menu__item:hover {
  background: rgba(0,229,255,0.07);
  color: var(--athex-cyan);
}
.athex-menu__item:hover svg {
  opacity: 1;
  color: var(--athex-cyan);
}
.athex-menu__item--admin {
  color: var(--athex-cyan);
}
.athex-menu__item--admin svg {
  opacity: 0.8;
  color: var(--athex-cyan);
}
.athex-menu__item--danger:hover {
  background: var(--athex-red-dim);
  color: var(--athex-red);
}
.athex-menu__item--danger:hover svg {
  color: var(--athex-red);
}


/* ══════════════════════════════════════════════════════════════
   GLASS CIRCLE ICON BUTTONS (Apple Liquid Glass pattern)
   X (close), Arrow (back), Plus (add)
   All 44px min for touch targets.
   ══════════════════════════════════════════════════════════════ */

.athex-circle-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  padding: 0;
  background: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 2px 12px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.16);
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.20s, border-color 0.20s, box-shadow 0.20s, color 0.20s;
  flex-shrink: 0;
}
.athex-circle-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.24);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.20);
}
.athex-circle-btn:active {
  transform: scale(0.93);
}
.athex-circle-btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

/* Hidden by default — JS shows back button on sub-flows */
.athex-circle-btn--back {
  display: none;
}
.athex-circle-btn--back.athex-visible {
  display: flex;
}

/* Cyan accent variant (for add/confirm actions) */
.athex-circle-btn--cyan {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.22);
  color: var(--athex-cyan);
}
.athex-circle-btn--cyan:hover {
  background: rgba(0,229,255,0.16);
  border-color: rgba(0,229,255,0.40);
  color: var(--athex-cyan);
  box-shadow: 0 4px 20px rgba(0,229,255,0.18), inset 0 1px 0 rgba(0,229,255,0.12);
}


/* ══════════════════════════════════════════════════════════════
   OVERLAY BACKDROP
   Glass blur behind all modals/panels.
   Page behind is blurred 20px + saturation boost.
   ══════════════════════════════════════════════════════════════ */

.athex-overlay {
  position: fixed;
  inset: 0;
  z-index: 9900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5,11,20,0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  animation: athex-overlay-in 0.22s ease both;
  padding: 20px;
  overflow: hidden; /* card never causes scroll — it is fixed-size */
}
.athex-overlay[hidden] { display: none; }


/* ══════════════════════════════════════════════════════════════
   AUTH CARD — glass tile, fixed size, centered in overlay
   Max 440px wide, overflow hidden (never grows).
   Breathing cyan glow + border shimmer animations.
   ══════════════════════════════════════════════════════════════ */

.athex-login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.055);
  -webkit-backdrop-filter: blur(var(--athex-blur)) saturate(1.9) brightness(1.08);
  backdrop-filter: blur(var(--athex-blur)) saturate(1.9) brightness(1.08);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: var(--athex-radius-card);
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 50px rgba(0,229,255,0.06), inset 0 1px 0 rgba(255,255,255,0.10);
  animation:
    athex-card-in       0.28s var(--athex-ease-spring) both,
    athex-breathe       3s    ease-in-out              infinite 0.5s,
    athex-border-shimmer 5s   ease-in-out              infinite 1s;
  overflow: hidden; /* fixed-size — content inside never pushes card open */
}

/* ─── Card top controls row ──────────────────────────── */
.athex-login-card__controls {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none; /* children re-enable */
}
.athex-login-card__controls .athex-circle-btn {
  pointer-events: auto;
}

/* ─── Card header — logo + brand row ────────────────── */
.athex-login-card__header {
  text-align: center;
  padding: 48px 32px 0;
  flex-shrink: 0;
}

.athex-login-card__logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.athex-login-card__logo {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
}

/* Consumer variant: show brand name next to logo */
.athex-login-card__brand-name {
  font-family: var(--athex-font-display);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1f5f9;
  margin: 0;
  line-height: 1;
}

/* Enterprise variant: logo IS the wordmark — hide brand-name */
.athex-login-card--enterprise .athex-login-card__brand-name {
  display: none;
}
/* Enterprise: give the logo more room to breathe as wordmark */
.athex-login-card--enterprise .athex-login-card__logo {
  width: auto;
  height: 32px;
}

/* "ACCOUNT PORTAL" subtitle */
.athex-login-card__subtitle {
  font-family: var(--athex-font-display);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(0,229,255,0.55);
  margin: 0;
}

/* ─── Pill tab selector — LOGIN | JOIN ───────────────── */
.athex-auth-tabs {
  display: flex;
  gap: 6px;
  padding: 20px 32px 0;
  flex-shrink: 0;
}

.athex-auth-tabs__pill {
  flex: 1;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: var(--athex-radius-pill);
  font-family: var(--athex-font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.20s ease, color 0.20s ease, border-color 0.20s ease, box-shadow 0.20s ease;
  white-space: nowrap;
  text-align: center;
}

/* Inactive pill */
.athex-auth-tabs__pill {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.50);
}
.athex-auth-tabs__pill:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.75);
}

/* Active pill */
.athex-auth-tabs__pill--active {
  background: rgba(0,229,255,0.15);
  border-color: rgba(0,229,255,0.38);
  color: var(--athex-cyan);
  box-shadow: 0 0 14px rgba(0,229,255,0.12);
}

/* ─── Auth form body — scrollable content area ───────── */
.athex-login-card__body {
  padding: 20px 32px 0;
  flex: 1;
  overflow: hidden; /* JS swaps panes; card never grows */
  position: relative;
}

/* Pane: each flow screen inside the card */
.athex-auth-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}
.athex-auth-pane--active {
  display: flex;
}

/* Push-in entrance from right */
.athex-auth-pane--push-in {
  animation: athex-push-in 0.26s var(--athex-ease-spring) both;
}

/* Pop-out to right (going back) */
.athex-auth-pane--pop-out {
  animation: athex-pop-out 0.22s var(--athex-ease) both;
}

/* Previous pane slides left underneath new one */
.athex-auth-pane--push-back {
  animation: athex-push-back 0.26s var(--athex-ease) both;
  pointer-events: none;
}

/* Error shake on the card or a form group */
.athex-shake {
  animation: athex-shake 0.4s ease both;
}

/* ─── Card footer ─────────────────────────────────────── */
.athex-login-card__footer {
  padding: 20px 32px 24px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Secured-by row */
.athex-login-card__secured-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.athex-login-card__secured-row svg {
  width: 12px;
  height: 12px;
  color: rgba(255,255,255,0.22);
  flex-shrink: 0;
}
.athex-login-card__secured {
  font-family: var(--athex-font-display);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  margin: 0;
}

/* Legal line */
.athex-login-card__legal {
  font-family: var(--athex-font-body);
  font-size: 0.625rem;
  color: rgba(255,255,255,0.22);
  margin: 0;
  line-height: 1.5;
}
.athex-login-card__legal a {
  color: rgba(255,255,255,0.30);
  text-decoration: none;
  transition: color 0.18s;
}
.athex-login-card__legal a:hover {
  color: var(--athex-cyan);
}


/* ══════════════════════════════════════════════════════════════
   SETTINGS PANEL — Apple iOS fixed-frame, tabs swap content
   ══════════════════════════════════════════════════════════════ */

.athex-settings-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.055);
  -webkit-backdrop-filter: blur(var(--athex-blur)) saturate(1.9) brightness(1.08);
  backdrop-filter: blur(var(--athex-blur)) saturate(1.9) brightness(1.08);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: var(--athex-radius-card);
  box-shadow: var(--athex-shadow-card);
  animation: athex-card-in 0.28s var(--athex-ease) both;
  max-height: min(88vh, 680px);
  overflow: hidden;
}

/* Settings header bar — fixed, never scrolls */
.athex-settings-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  flex-shrink: 0;
  position: relative;
}

.athex-settings-card__title {
  font-family: var(--athex-font-display);
  font-size: 0.90rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1f5f9;
  flex: 1;
  text-align: center;
  margin: 0;
}

/* Tab bar — fixed below header, never scrolls */
.athex-settings-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  margin-top: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.athex-settings-tabs::-webkit-scrollbar { display: none; }

.athex-settings-tabs__tab {
  flex-shrink: 0;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--athex-font-display);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  transition: color 0.22s var(--athex-ease), border-color 0.22s var(--athex-ease);
  white-space: nowrap;
}
.athex-settings-tabs__tab:hover {
  color: rgba(255,255,255,0.60);
}
.athex-settings-tabs__tab--active {
  color: var(--athex-cyan);
  border-bottom-color: var(--athex-cyan);
}

/* Scrollable content area — fixed height, content scrolls inside */
.athex-settings-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 24px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.15) transparent;
}
.athex-settings-body::-webkit-scrollbar {
  width: 4px;
}
.athex-settings-body::-webkit-scrollbar-track {
  background: transparent;
}
.athex-settings-body::-webkit-scrollbar-thumb {
  background: rgba(0,229,255,0.15);
  border-radius: 4px;
}

/* Tab pane switching */
.athex-settings-pane {
  display: none;
}
.athex-settings-pane--active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: athex-pane-in 0.18s var(--athex-ease) both;
}


/* ══════════════════════════════════════════════════════════════
   ADMIN PANEL — full-height slide-in from right
   ══════════════════════════════════════════════════════════════ */

.athex-admin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10100;
  background: rgba(5,11,20,0.65);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s var(--athex-ease-spring);
}
.athex-admin-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.athex-admin-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10200;
  width: min(580px, 100vw);
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.055);
  -webkit-backdrop-filter: blur(var(--athex-blur)) saturate(1.9) brightness(1.06);
  backdrop-filter: blur(var(--athex-blur)) saturate(1.9) brightness(1.06);
  border-left: 1px solid rgba(255,255,255,0.10);
  box-shadow: -24px 0 80px rgba(0,0,0,0.55), 0 0 40px rgba(0,229,255,0.05);
  transform: translateX(100%);
  transition: transform 0.38s var(--athex-ease-spring);
  overflow: hidden;
}
.athex-admin-panel--open {
  transform: translateX(0);
}

.athex-admin-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.athex-admin-panel__title {
  font-family: var(--athex-font-display);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--athex-cyan);
  flex: 1;
  margin: 0;
}

.athex-admin-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.athex-admin-tabs::-webkit-scrollbar { display: none; }

.athex-admin-tabs__tab {
  flex-shrink: 0;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--athex-font-display);
  font-size: 0.70rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  transition: color 0.20s, border-color 0.20s;
  white-space: nowrap;
}
.athex-admin-tabs__tab:hover { color: rgba(255,255,255,0.60); }
.athex-admin-tabs__tab--active {
  color: var(--athex-cyan);
  border-bottom-color: var(--athex-cyan);
}

.athex-admin-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,229,255,0.12) transparent;
}
.athex-admin-body::-webkit-scrollbar { width: 4px; }
.athex-admin-body::-webkit-scrollbar-track { background: transparent; }
.athex-admin-body::-webkit-scrollbar-thumb {
  background: rgba(0,229,255,0.12);
  border-radius: 4px;
}

.athex-admin-pane { display: none; }
.athex-admin-pane--active {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: athex-pane-in 0.18s var(--athex-ease) both;
}


/* ══════════════════════════════════════════════════════════════
   SHARED FORM ELEMENTS
   ══════════════════════════════════════════════════════════════ */

.athex-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.athex-form-row {
  display: flex;
  gap: 14px;
}
.athex-form-row .athex-form-group {
  flex: 1;
  min-width: 0;
}

.athex-label {
  font-family: var(--athex-font-display);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
}
.athex-label__hint {
  font-family: var(--athex-font-body);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(255,255,255,0.20);
  margin-left: 4px;
}

.athex-input {
  padding: 10px 14px;
  border-radius: var(--athex-radius-btn);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f1f5f9;
  font-family: var(--athex-font-body);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.22s, box-shadow 0.22s;
  width: 100%;
  min-height: 44px;
}
.athex-input::placeholder { color: rgba(255,255,255,0.16); }
.athex-input:focus {
  border-color: rgba(0,229,255,0.42);
  box-shadow: 0 0 10px rgba(0,229,255,0.10);
}
.athex-input:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.athex-input--error {
  border-color: rgba(255,68,68,0.50);
}
.athex-input--valid {
  border-color: rgba(0,255,159,0.38);
}

/* Autofill detection — animationstart fires when browser fills this */
input:-webkit-autofill {
  animation-name: athex-autofill-detect;
  animation-duration: 0.001ms;
  -webkit-box-shadow: 0 0 0 1000px rgba(0,0,0,0.35) inset;
  -webkit-text-fill-color: #f1f5f9;
  caret-color: #f1f5f9;
}

.athex-select {
  padding: 10px 14px;
  border-radius: var(--athex-radius-btn);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f1f5f9;
  font-family: var(--athex-font-body);
  font-size: 0.82rem;
  outline: none;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.22s;
}
.athex-select:focus {
  border-color: rgba(0,229,255,0.42);
}

.athex-textarea {
  padding: 10px 14px;
  border-radius: var(--athex-radius-btn);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  color: #f1f5f9;
  font-family: var(--athex-font-body);
  font-size: 0.82rem;
  outline: none;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.22s;
}
.athex-textarea:focus {
  border-color: rgba(0,229,255,0.42);
}

/* Primary action button */
.athex-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  min-height: 48px;
  background: linear-gradient(135deg, rgba(0,229,255,0.16), rgba(0,229,255,0.07));
  border: 2px solid rgba(0,229,255,0.32);
  color: var(--athex-cyan);
  cursor: pointer;
  width: 100%;
  font-family: var(--athex-font-body);
  font-size: 0.80rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: all 0.20s var(--athex-ease);
}
.athex-btn:hover {
  background: linear-gradient(135deg, rgba(0,229,255,0.26), rgba(0,229,255,0.12));
  border-color: rgba(0,229,255,0.58);
  box-shadow: 0 4px 24px rgba(0,229,255,0.18);
  transform: translateY(-1px);
}
.athex-btn:active { transform: translateY(0); }
.athex-btn:disabled {
  opacity: 0.40;
  cursor: not-allowed;
  transform: none;
}
.athex-btn--danger {
  background: var(--athex-red-dim);
  border-color: rgba(255,68,68,0.35);
  color: var(--athex-red);
}
.athex-btn--danger:hover {
  background: rgba(255,68,68,0.14);
  border-color: rgba(255,68,68,0.55);
  box-shadow: 0 4px 24px rgba(255,68,68,0.15);
}
.athex-btn--ghost {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.55);
}
.athex-btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  color: #f1f5f9;
  box-shadow: none;
}
.athex-btn--sm {
  padding: 8px 16px;
  min-height: 38px;
  font-size: 0.72rem;
  border-radius: 10px;
  width: auto;
}

/* Section heading inside panels */
.athex-section-heading {
  font-family: var(--athex-font-display);
  font-size: 0.70rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Glass card row (profile info row, user list row, etc.) */
.athex-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.18s, border-color 0.18s;
}
.athex-row:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.10);
}
.athex-row--interactive { cursor: pointer; }
.athex-row__label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
  flex: 1;
}
.athex-row__value {
  font-size: 0.78rem;
  color: #f1f5f9;
  text-align: right;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toggle switch */
.athex-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.athex-toggle__track {
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  position: relative;
  flex-shrink: 0;
  transition: background 0.22s, border-color 0.22s;
}
.athex-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.athex-toggle input[type="checkbox"]:checked + .athex-toggle__track {
  background: rgba(0,229,255,0.22);
  border-color: rgba(0,229,255,0.38);
}
.athex-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.50);
  transition: transform 0.22s var(--athex-ease), background 0.22s;
}
.athex-toggle input[type="checkbox"]:checked ~ .athex-toggle__track .athex-toggle__thumb,
.athex-toggle input[type="checkbox"]:checked + .athex-toggle__track .athex-toggle__thumb {
  transform: translateX(18px);
  background: var(--athex-cyan);
}
.athex-toggle__label {
  font-size: 0.80rem;
  color: rgba(255,255,255,0.65);
}

/* Inline error / success messages */
.athex-msg {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border-radius: 8px;
  padding: 8px 12px;
}
.athex-msg[hidden] { display: none; }
.athex-msg--error {
  background: var(--athex-red-dim);
  border: 1px solid rgba(255,68,68,0.18);
  color: var(--athex-red);
}
.athex-msg--success {
  background: var(--athex-green-dim);
  border: 1px solid rgba(0,255,159,0.18);
  color: var(--athex-green);
}
.athex-msg--info {
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.14);
  color: rgba(0,229,255,0.80);
}

/* Password strength bars */
.athex-pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.athex-pw-strength__bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
}
.athex-pw-strength__bar--weak   { background: var(--athex-red); }
.athex-pw-strength__bar--fair   { background: #ffaa00; }
.athex-pw-strength__bar--good   { background: #88dd00; }
.athex-pw-strength__bar--strong { background: var(--athex-green); }
.athex-pw-strength__label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.38);
  margin-top: 4px;
}

/* Avatar picker */
.athex-avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
}
.athex-avatar-picker__circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,229,255,0.20), rgba(180,77,255,0.20));
  border: 1px solid rgba(0,229,255,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--athex-cyan);
  overflow: hidden;
  flex-shrink: 0;
}
.athex-avatar-picker__circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.athex-avatar-picker__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.athex-avatar-picker__hint {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.25);
}

/* User list rows (admin panel) */
.athex-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s;
}
.athex-user-row:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(0,229,255,0.14);
}
.athex-user-row__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,229,255,0.18), rgba(180,77,255,0.18));
  border: 1px solid rgba(0,229,255,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--athex-cyan);
  overflow: hidden;
  flex-shrink: 0;
}
.athex-user-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.athex-user-row__info {
  flex: 1;
  min-width: 0;
}
.athex-user-row__name {
  font-size: 0.80rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.athex-user-row__email {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.30);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.athex-user-row__badge {
  font-size: 0.60rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.athex-user-row__badge--admin {
  background: rgba(0,229,255,0.10);
  border: 1px solid rgba(0,229,255,0.20);
  color: var(--athex-cyan);
}
.athex-user-row__badge--disabled {
  background: rgba(255,68,68,0.08);
  border: 1px solid rgba(255,68,68,0.18);
  color: var(--athex-red);
}

/* Loader spinner */
.athex-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(0,229,255,0.15);
  border-top-color: var(--athex-cyan);
  border-radius: 50%;
  animation: athex-spin 0.70s linear infinite;
  flex-shrink: 0;
}

/* Loading state centered in a panel */
.athex-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: rgba(255,255,255,0.35);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

/* Toast notification */
.athex-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.athex-toast {
  padding: 12px 18px;
  border-radius: 12px;
  font-family: var(--athex-font-body);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: #f1f5f9;
  background: rgba(8,15,28,0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,0.40);
  pointer-events: auto;
  animation: athex-toast-in 0.22s var(--athex-ease) both;
  max-width: 320px;
}
.athex-toast--success { border-color: rgba(0,255,159,0.22); }
.athex-toast--error   { border-color: rgba(255,68,68,0.22); }
.athex-toast--info    { border-color: rgba(0,229,255,0.18); }
.athex-toast--exit {
  animation: athex-toast-out 0.28s var(--athex-ease) both;
}

/* TOTP / 2FA code input */
.athex-totp-input {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0;
}
.athex-totp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--athex-font-mono);
  color: var(--athex-cyan);
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.20s, box-shadow 0.20s;
}
.athex-totp-digit:focus {
  border-color: rgba(0,229,255,0.45);
  box-shadow: 0 0 10px rgba(0,229,255,0.12);
}

/* QR code container for 2FA setup */
.athex-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.athex-qr-container img {
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
}
.athex-qr-secret {
  font-family: var(--athex-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.10em;
  color: rgba(0,229,255,0.70);
  word-break: break-all;
  text-align: center;
}


/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile-first, scale up
   ══════════════════════════════════════════════════════════════ */

/* Mobile: full-width card, bottom-sheet style, 16px side padding */
@media (max-width: 479px) {
  .athex-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .athex-login-card {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding-left: 0;
    padding-right: 0;
  }
  .athex-login-card__header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .athex-auth-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }
  .athex-login-card__body {
    padding-left: 16px;
    padding-right: 16px;
  }
  .athex-login-card__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .athex-settings-card {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }
  .athex-admin-panel {
    width: 100vw;
  }
  .athex-form-row {
    flex-direction: column;
    gap: 12px;
  }
  .athex-tile__name {
    max-width: 80px;
  }
  .athex-toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
  }
  .athex-toast {
    max-width: 100%;
  }
}

/* Tablet and up */
@media (min-width: 768px) {
  .athex-settings-card {
    max-height: min(84vh, 680px);
  }
  .athex-login-card {
    max-width: 440px;
  }
}

/* ──────────────────────────────────────────────────────────
   LINK BUTTON — ghost text-only button (Forgot password?, etc.)
   ────────────────────────────────────────────────────────── */
.athex-link-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  font-family: var(--athex-font-body);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.15);
  transition: color 0.18s, text-decoration-color 0.18s;
  line-height: 1;
}
.athex-link-btn:hover {
  color: var(--athex-cyan);
  text-decoration-color: rgba(0,229,255,0.40);
}

/* Large screens */
@media (min-width: 1280px) {
  .athex-admin-panel {
    width: 580px;
  }
  .athex-menu {
    width: 280px;
  }
}
