/* ═══════════════════════════════════════════════════════════════════════════
   LAYER 3 CO-LOCATED STYLES: AppShell (`components/layout/AppShell.css`)
   Webxtek Chatbot Sidebar (`#0d111a`) + AtletIQ Floating `BottomNavIsland`
   ═══════════════════════════════════════════════════════════════════════════ */

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  min-height: 100dvh;
}

.sidebar.x-left-rail {
  background: rgba(13, 17, 26, 0.86);
  backdrop-filter: var(--liquid-blur);
  -webkit-backdrop-filter: var(--liquid-blur);
  border-right: 1px solid var(--border-subtle);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 30;
}

.x-rail-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.x-rail-logo-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.x-rail-logo-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
}

.x-rail-logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1d9bf0 0%, #06b6d4 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(29, 155, 240, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.x-rail-logo-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.x-rail-logo-text {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.x-rail-logo-sub {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.x-rail-section-label {
  padding: 4px 12px 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.x-rail-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 11px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  color: #ffffff;
  font-weight: 700;
  background: rgba(29, 155, 240, 0.14);
  border-color: rgba(29, 155, 240, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.nav-item.active svg {
  color: var(--accent);
}

.nav-item-admin {
  color: #a7f3d0;
}

.nav-item-admin.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
}

.nav-item-admin.active svg {
  color: var(--emerald);
}

.x-rail-badge {
  position: absolute;
  top: -5px;
  right: -7px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.x-rail-cta-btn {
  margin-top: 12px;
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d9bf0 0%, #06b6d4 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(29, 155, 240, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.x-rail-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(29, 155, 240, 0.44);
}

.sidebar-footer {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.x-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.x-user-pill:hover {
  background: rgba(255, 255, 255, 0.06);
}

.x-user-pill-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-pack {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.x-user-logout-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.x-user-logout-icon:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ─── MAIN AREA & STICKY FROSTED TOPBAR ──────────────────────────────────── */
.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 48px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(8, 10, 15, 0.78);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-primary);
}

.topbar-title-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── FLOATING MOBILE BOTTOM NAV ISLAND (Webxtek & AtletIQ Standard) ─────── */
.bottom-nav-island {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar.x-left-rail {
    display: none;
  }
  .main-area {
    padding-bottom: 92px;
  }
  .bottom-nav-island {
    display: block;
    position: fixed;
    bottom: calc(12px + var(--safe-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-bottom-nav);
    width: calc(100% - 24px);
    max-width: 460px;
    pointer-events: none;
  }
  .bottom-nav-island-inner {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 8px;
    border-radius: 18px;
    background: var(--bg-surface-solid);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-strong);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.16);
  }
  .bottom-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 10px;
    min-width: 52px;
    min-height: 46px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
  }
  .bottom-nav-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 700;
  }
}
