.auth-header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 920px;
  margin: 0 auto 12px;
  padding: 10px 12px;
  box-sizing: border-box;
}

.auth-header-nav.hidden {
  display: none;
}

.auth-nav-item {
  position: relative;
}

.auth-nav-item.has-children.is-open .auth-nav-flyout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.auth-header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary, #2979ff);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(41, 121, 255, 0.28);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  padding: 8px 16px;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.auth-header-nav-link:hover,
.auth-nav-item.is-open > .auth-header-nav-link {
  background: #fff;
  border-color: rgba(41, 121, 255, 0.5);
  box-shadow: 0 4px 12px rgba(41, 121, 255, 0.15);
}

.auth-nav-caret {
  font-size: 10px;
  opacity: 0.75;
}

.auth-nav-flyout {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 160px;
  max-width: min(280px, 90vw);
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #e0e6ed);
  border-radius: var(--radius, 10px);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
  padding: 6px 0;
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.auth-nav-flyout-link {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-dark, #263238);
  cursor: pointer;
  font-family: inherit;
}

.auth-nav-flyout-link:hover {
  background: var(--bg-light, #f5f7fa);
  color: var(--primary, #2979ff);
}

.auth-copyright {
  width: 100%;
  max-width: 920px;
  margin: 16px auto 0;
  padding: 0 16px 24px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted, #607d8b);
  box-sizing: border-box;
}

.auth-copyright a {
  color: inherit;
  text-decoration: underline;
}

.auth-copyright.hidden {
  display: none;
}

.admin-sidebar-footer .admin-app-signature,
.admin-app-signature,
.admin-login-signature {
  font-size: 8px;
  line-height: 1.3;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.22);
  text-align: center;
  letter-spacing: 0.02em;
}

.admin-sidebar-footer .admin-app-signature {
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar-footer .admin-app-signature a,
.admin-app-signature a,
.admin-login-signature a {
  color: rgba(255, 255, 255, 0.26);
  text-decoration: none;
}

.admin-sidebar-footer .admin-app-signature a:hover,
.admin-app-signature a:hover,
.admin-login-signature a:hover {
  color: rgba(255, 255, 255, 0.38);
  text-decoration: underline;
}

.admin-login-signature {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.context-menu-section-label {
  padding: 6px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #78909c);
  pointer-events: none;
}

.site-menu-ctx-parent {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: default;
}

.site-menu-ctx-parent:hover {
  background: var(--bg-light, #f5f7fa);
}

.site-menu-ctx-caret {
  opacity: 0.55;
  font-size: 12px;
}

.site-menu-ctx-flyout {
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 150px;
  max-width: 240px;
  margin-left: 2px;
  background: var(--bg-white, #fff);
  border: 1px solid var(--border, #e0e6ed);
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow-md, 0 6px 20px rgba(15, 23, 42, 0.14));
  padding: 4px 0;
  z-index: 2100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s, visibility 0.12s;
}

.site-menu-ctx-parent.is-open .site-menu-ctx-flyout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.site-menu-ctx-leaf.site-menu-ctx-child {
  padding-left: 22px;
  font-size: 12px;
}

.site-page-modal-body {
  max-height: min(70vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
}

#modalOverlay > .modal.modal--wide {
  max-width: min(96vw, 720px);
}

.site-menu-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
}

body.site-menu-popup-open {
  overflow: hidden;
}

.site-menu-popup-shell {
  width: min(var(--site-menu-popup-w, 720px), calc(100vw - 24px));
  height: min(var(--site-menu-popup-h, 520px), calc(100vh - 24px));
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-white, #fff);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.site-menu-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, #e0e6ed);
  flex-shrink: 0;
}

.site-menu-popup-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark, #263238);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-menu-popup-close {
  border: none;
  background: var(--bg-light, #f0f4f8);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted, #607d8b);
}

.site-menu-popup-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
}

.site-menu-popup-iframe {
  width: 100%;
  height: 100%;
  min-height: min(400px, calc(100vh - 120px));
  border: none;
}

@media (max-width: 600px) {
  .auth-header-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
  }

  .auth-nav-flyout {
    left: 0;
    transform: translateY(-4px);
  }

  .auth-nav-item.has-children.is-open .auth-nav-flyout {
    transform: translateY(0);
  }

  .site-menu-ctx-flyout {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: 4px;
  }
}
