/* ==========================================================================
 * FILE: css/alphacp-v22.css
 * HostPlux Storefront + AlphaCP Control Panel v24.0 Master Design System
 *
 * Verified at 390x844 (Mobile), 980x850 (Chrome Desktop Site) & 1366x900:
 *   1. Public Storefront Mobile 3-Line Menu (.site-nav.open) 100% Working
 *   2. Zero Top-Left Dead Hole, Zero Left Overlap, Zero Right Overflow
 *   3. Zero Sidebar Label Truncation on BOTH Desktop AND Mobile
 *   4. 100% Pixel-True 3-Design Harmony (Nova Dark | Aurora Light | Classic)
 * ========================================================================== */

:root {
  --hpx-pri: #673de6;
  --hpx-pri-hover: #5025d1;
  --hpx-pri-deep: #2f1c6a;
  --hpx-pri-soft: #f0ecff;
  --hpx-pri-border: rgba(103, 61, 230, 0.24);
  --hpx-ok: #00b090;
  --hpx-ok-soft: rgba(0, 176, 144, 0.12);
}

/* ==========================================================================
 * 1. STOREFRONT HEADER & MOBILE 3-LINE MENU FIX (index.html)
 * ========================================================================== */
body.site-body {
  overflow-x: clip;
  max-width: 100vw;
  --s-card: #ffffff;
}
.site-header-inner {
  max-width: 1280px !important;
  width: 100% !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}
@media (min-width: 901px) {
  .site-nav {
    display: flex !important;
    gap: 2px !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
  }
  .site-nav-item {
    padding: 7px 9px !important;
    font-size: 13.5px !important;
    white-space: nowrap !important;
  }
  .nav-burger {
    display: none !important;
  }
}
@media (max-width: 900px) {
  .nav-burger {
    display: inline-flex !important;
    background: var(--s-surface, #ffffff) !important;
    color: var(--s-text, #1e1b4b) !important;
    border: 1.5px solid var(--s-border, #e2e8f0) !important;
  }
  .site-nav:not(.open) {
    display: none !important;
  }
  .site-nav.open {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 950 !important;
    background: var(--s-surface, #ffffff) !important;
    border-top: 1px solid var(--s-border, #e5e7eb) !important;
    border-bottom: 1px solid var(--s-border, #e5e7eb) !important;
    padding: 10px 14px 16px !important;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28) !important;
    max-height: calc(100dvh - 80px) !important;
    overflow-y: auto !important;
  }
  .site-nav.open .site-nav-item {
    width: 100% !important;
    justify-content: space-between !important;
    padding: 12px 12px !important;
    font-size: 14.5px !important;
    border-radius: 10px !important;
  }
  .site-nav.open .site-nav-drop {
    position: static !important;
    background: var(--s-primary-light, #f8f7ff) !important;
    border-radius: 10px !important;
    margin: 2px 0 6px !important;
    padding: 4px 6px !important;
    box-shadow: none !important;
    border: 1px solid var(--s-border, #ede9fe) !important;
  }
}
.site-header-actions {
  gap: 7px !important;
  flex-shrink: 0 !important;
}
.site-header-actions .site-btn {
  padding: 8px 13px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* ==========================================================================
 * 2. SEAMLESS SIDEBAR + MAIN SHELL GEOMETRY (DESKTOP, 980px & MOBILE 390px)
 *    - Eliminates top-left empty gap completely (sidebar top: 0 -> height: 100dvh)
 *    - Eliminates 980px "Desktop site" overlap completely
 *    - Eliminates mobile truncation & right-side button overflow completely
 * ========================================================================== */

/* --- DESKTOP & CHROME ANDROID "DESKTOP SITE" (>= 769px, incl. 980px & 1366px) --- */
@media (min-width: 769px) {
  :root, body {
    --sb-w: 248px !important;
    --sidebar-w: 248px !important;
  }
  .app-shell {
    display: flex !important;
    min-height: 100vh !important;
  }
  .sidebar,
  #sidebar.sidebar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    bottom: auto !important;
    width: 248px !important;
    min-width: 248px !important;
    flex: 0 0 248px !important;
    height: 100vh !important;
    transform: none !important;
    box-shadow: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  body.sb-closed .sidebar,
  body.sb-closed #sidebar.sidebar {
    display: none !important;
  }
  .main-col,
  body.sb-open .main-col {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .page-inner,
  body.sb-open .page-inner {
    padding: 20px 24px 56px !important;
  }
  #sidebar .nav-label,
  .sidebar .nav-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 13.5px !important;
  }
}

/* --- MOBILE PHONE PORTRAIT (<= 768px): Full-Height Push Sidebar + Zero Overflow --- */
@media (max-width: 768px) {
  :root, body {
    --sb-w: 170px !important;
  }
  .sidebar,
  #sidebar.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: var(--sb-w) !important;
    min-width: var(--sb-w) !important;
    height: 100dvh !important;
    z-index: 62 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  body.sb-open .main-col {
    margin-left: var(--sb-w) !important;
    width: calc(100% - var(--sb-w)) !important;
    max-width: calc(100% - var(--sb-w)) !important;
  }
  body:not(.sb-open) .main-col {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  /* Full readable multi-word labels on mobile — ZERO "..." truncation! */
  .sidebar .nav-item,
  #sidebar .nav-item {
    padding: 8px 8px !important;
    margin: 1px 5px !important;
    gap: 7px !important;
    align-items: center !important;
  }
  .sidebar .nav-label,
  #sidebar .nav-label {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    font-size: 12.2px !important;
    line-height: 1.24 !important;
  }
  .sidebar .nav-badge,
  #sidebar .nav-badge {
    font-size: 8.5px !important;
    padding: 1.5px 4.5px !important;
  }
  /* Prevent ANY card, button, chat bar, or header from overflowing right on mobile */
  .v22-chat-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 8px 10px !important;
    gap: 8px !important;
  }
  .v22-chat-bar input {
    width: 100% !important;
    min-width: 0 !important;
  }
  .v22-chat-bar .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .page-inner * {
    max-width: 100%;
    box-sizing: border-box;
  }
  .v22-site-row > div,
  .card-head {
    flex-wrap: wrap !important;
  }
  .v23-gauge-row,
  .v22-grid-2,
  .v22-grid-3,
  .v22-grid-4,
  .design-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Shared Nav Item & Hover-Only Star Pin */
#sidebar .nav-item {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
}
#sidebar .nav-item svg {
  width: 17px !important;
  height: 17px !important;
  flex-shrink: 0 !important;
}
#sidebar .nav-label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
#sidebar .nav-badge {
  font-weight: 700 !important;
  border-radius: 999px !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

#sidebar button.fav-btn,
#sidebar .icon-btn.fav-btn {
  all: unset !important;
  position: absolute !important;
  right: 7px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 18px !important;
  height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.14s ease, color 0.14s ease !important;
}
#sidebar .nav-item:hover button.fav-btn,
#sidebar button.fav-btn.is-pinned {
  opacity: 1 !important;
  pointer-events: auto !important;
}
@media (min-width: 769px) {
  #sidebar .nav-item {
    padding: 8.5px 12px !important;
    margin: 1.5px 8px !important;
    gap: 9px !important;
  }
  #sidebar .nav-badge {
    font-size: 9.5px !important;
    padding: 2px 5.5px !important;
  }
  #sidebar .nav-item:hover {
    padding-right: 28px !important;
  }
}
#sidebar button.fav-btn.is-pinned {
  color: #f59e0b !important;
}

/* ==========================================================================
 * 3. EXACT PER-THEME HARMONY (100% MATCHING admin.html DESIGN CARDS 1, 2, 3)
 * ========================================================================== */

/* --- THEME 1: NOVA DARK (Purple Gradient Sidebar + White Topbar) --- */
[data-theme="1"] #sidebar.sidebar,
[data-theme="1"] .sidebar {
  background: linear-gradient(180deg, #5b21b6 0%, #3b1491 45%, #2e1065 100%) !important;
  color: #ede9ff !important;
  border-right: 0 !important;
}
[data-theme="1"] #sidebar .brand-in-sidebar,
[data-theme="1"] .sidebar .brand-block {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
}
[data-theme="1"] #sidebar .brand-name,
[data-theme="1"] .sidebar .brand-name { color: #ffffff !important; }
[data-theme="1"] #sidebar .v22-group-hdr { color: rgba(237, 233, 255, 0.65); }
[data-theme="1"] #sidebar .v22-group-hdr:hover { background: rgba(255, 255, 255, 0.10); color: #ffffff; }
[data-theme="1"] #sidebar .v22-ctx-box {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.20);
  color: #ffffff;
}
[data-theme="1"] #sidebar .v22-back-btn { color: #e4ddff; }
[data-theme="1"] #sidebar .nav-badge { background: #fbbf24; color: #2e1065; }

/* --- THEME 2: AURORA LIGHT (White Sidebar + Deep Purple Topbar #3C1E8F) --- */
[data-theme="2"] #sidebar.sidebar,
[data-theme="2"] .sidebar {
  background: #ffffff !important;
  color: #374151 !important;
  border-right: 1px solid #e7e8ee !important;
}
[data-theme="2"] #sidebar .brand-in-sidebar,
[data-theme="2"] .sidebar .brand-block {
  display: flex !important;
  border-bottom: 1px solid #f1f5f9;
}
[data-theme="2"] #sidebar .brand-in-sidebar .brand-name,
[data-theme="2"] .sidebar .brand-name {
  display: block !important;
  color: #1f2937 !important;
}
[data-theme="2"] #sidebar .nav-item { color: #374151; border-radius: 10px; }
[data-theme="2"] #sidebar .nav-item:hover { background: #f5f3ff; color: #5b21b6; }
[data-theme="2"] #sidebar .nav-item.active { background: #ede9fe; color: #5b21b6; font-weight: 700; }
[data-theme="2"] #sidebar .nav-badge { background: #ede9fe; color: #5b21b6; }
[data-theme="2"] .topbar .btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.10);
}
[data-theme="2"] .topbar .btn-outline:hover { background: rgba(255, 255, 255, 0.20); }
[data-theme="2"] .topbar .brand-sub-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

/* --- THEME 3: CLASSIC MODERN SAAS (White Sidebar + White Topbar + Pill UI) --- */
[data-theme="3"] #sidebar.sidebar,
[data-theme="3"] .sidebar {
  background: #ffffff !important;
  color: #363842 !important;
  border-right: 1px solid #e8e9ee !important;
}
[data-theme="3"] #sidebar .nav-item { border-radius: 999px !important; color: #363842; }
[data-theme="3"] #sidebar .nav-item:hover { background: #f5f3ff; color: #5527d0; }
[data-theme="3"] #sidebar .nav-item.active { background: #efeafd; color: #5527d0; font-weight: 700; }
[data-theme="3"] #sidebar .nav-badge { background: #efeafd; color: #673de6; }

/* --- OPTIONAL INDEPENDENT DARK MODE OVERLAY (Account Menu -> Dark Mode ON) --- */
html[data-dark="1"] {
  --bg: #0b1120 !important;
  --card-bg: #131c31 !important;
  --surface: #131c31 !important;
  --text: #f1f5f9 !important;
  --muted: #94a3b8 !important;
  --border: rgba(148, 163, 184, 0.18) !important;
  --topbar-bg: #0f172a !important;
}
html[data-dark="1"] body,
html[data-dark="1"] .main-col { background: #0b1120 !important; color: #f1f5f9 !important; }
html[data-dark="1"] #sidebar.sidebar,
html[data-dark="1"] .sidebar { background: #0f172a !important; color: #e2e8f0 !important; border-right: 1px solid rgba(148, 163, 184, 0.16) !important; }
html[data-dark="1"] #sidebar .nav-item { color: #cbd5e1 !important; }
html[data-dark="1"] #sidebar .nav-item.active { background: rgba(124, 58, 237, 0.28) !important; color: #ffffff !important; }
html[data-dark="1"] #sidebar .brand-name { color: #ffffff !important; }
html[data-dark="1"] .card,
html[data-dark="1"] .v23-gauge-card,
html[data-dark="1"] .v22-site-row,
html[data-dark="1"] .v22-tile,
html[data-dark="1"] .v22-choice-card,
html[data-dark="1"] #user-dropdown {
  background: #131c31 !important;
  color: #f1f5f9 !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}
html[data-dark="1"] .topbar { background: #0f172a !important; color: #f8fafc !important; border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important; }
html[data-dark="1"] input, html[data-dark="1"] select, html[data-dark="1"] textarea {
  background: #0b1120 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

/* ==========================================================================
 * 4. BRAND MARK, TOPBAR SEARCH & SHARED UI COMPONENTS
 * ========================================================================== */
.hpx-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #673de6 0%, #8c6ff7 100%);
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(103, 61, 230, 0.25);
}
.hpx-logo-mark svg { width: 17px !important; height: 17px !important; color: #fff !important; stroke: #fff !important; }

.brand-sub-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--hpx-pri-soft);
  color: var(--hpx-pri);
  border: 1px solid var(--hpx-pri-border);
  white-space: nowrap;
}

.topbar {
  gap: 8px !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
.topbar-search {
  display: flex !important;
  flex: 1 1 220px !important;
  max-width: 420px !important;
  min-width: 140px !important;
}
@media (max-width: 680px) {
  .topbar-search input, .topbar-search kbd { display: none !important; }
  .topbar-search {
    flex: 0 0 34px !important;
    min-width: 34px !important;
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 10px !important;
  }
  .admin-topbar .topbar-search {
    display: none !important;
  }
  /* When mobile push-sidebar is open (220px topbar), keep [☰] ... [✨] [🔔] [AK] crisp with 0 right clip */
  body.sb-open .topbar .topbar-search,
  body.sb-open .topbar .lang-switch {
    display: none !important;
  }
  body.sb-open .topbar {
    padding-left: 8px !important;
    padding-right: 8px !important;
    gap: 5px !important;
  }
}

.v22-ctx-box {
  margin: 8px 8px 10px;
  padding: 10px;
  border-radius: 12px;
  background: #f8f9fc;
  border: 1px solid #e5e7eb;
}
.v22-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  color: #6d7081;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 0 6px;
  cursor: pointer;
}
.v22-back-btn:hover { color: var(--hpx-pri); }
.v22-ctx-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  word-break: break-all;
}
.v22-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hpx-ok);
  box-shadow: 0 0 0 3px var(--hpx-ok-soft);
  flex-shrink: 0;
}
.v22-ctx-select, .v22-sb-filter {
  width: 100%;
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1d1e20;
  outline: none;
}
.v22-sb-filter { margin-top: 6px; }

.v22-group-hdr {
  width: calc(100% - 16px);
  margin: 10px 8px 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 7px;
  background: none;
  border: 0;
  color: #727586;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  cursor: pointer;
}
.v22-group-caret { display: inline-flex; transition: transform 0.18s ease; font-size: 12px; }
.v22-group-hdr.closed .v22-group-caret { transform: rotate(-90deg); }
.v22-group-body.closed { display: none; }

.nav-sub.open { display: block; }
.nav-sub {
  padding-left: 11px;
  margin: 2px 8px 6px 20px;
  border-left: 1.5px solid rgba(148, 163, 184, 0.28);
}
.nav-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12.8px;
  color: inherit;
  opacity: 0.85;
  text-decoration: none;
  cursor: pointer;
}
.nav-sub-item:hover, .nav-sub-item.active {
  opacity: 1;
  background: rgba(103, 61, 230, 0.10);
  font-weight: 600;
}

#user-dropdown {
  min-width: 250px !important;
  max-width: calc(100vw - 20px) !important;
  padding: 8px !important;
  border-radius: 14px !important;
  color: #1f2937 !important;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.16) !important;
}
.v22-dd-head {
  padding: 8px 10px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.v22-dd-head b { display: block; font-size: 13.5px; }
.v22-dd-head span { font-size: 11.5px; opacity: 0.72; word-break: break-all; }
.v22-dd-sep { height: 1px; margin: 5px 6px; background: rgba(148, 163, 184, 0.2); }

/* Theme-Specific Signature Blocks on Home Page */
.v23-nova-hero {
  background: linear-gradient(135deg, #5b21b6 0%, #3b1491 55%, #1e1b4b 100%);
  color: #ffffff;
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 12px 32px rgba(76, 29, 149, 0.22);
}
.v23-slider-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  overflow: hidden;
  margin-top: 6px;
}
.v23-slider-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #a78bfa, #34d399);
}
.v23-gauge-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.v23-gauge-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.v22-home-chat {
  background: linear-gradient(135deg, rgba(103, 61, 230, 0.07) 0%, rgba(0, 176, 144, 0.05) 100%);
  border: 1px solid var(--hpx-pri-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 18px;
}
body.kodee-open .v22-home-chat { display: none; }
.v22-chat-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--hpx-pri-border);
  border-radius: 12px;
  padding: 6px 6px 6px 14px;
  align-items: center;
}
.v22-chat-bar input {
  border: 0 !important;
  background: transparent !important;
  flex: 1 1 auto;
  min-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  font-size: 14px;
}
.v22-pills { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.v22-pill {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.3));
  color: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.v22-pill:hover { border-color: var(--hpx-pri); color: var(--hpx-pri); transform: translateY(-1px); }

.v22-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.v22-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.v22-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1080px) and (min-width: 769px) {
  .v22-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.v22-site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.24));
  border-radius: 14px;
  background: var(--card-bg, #fff);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.v22-tile {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.24));
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.v22-tile:hover {
  transform: translateY(-2px);
  border-color: var(--hpx-pri);
}

/* ==========================================================================
 * 9. v25.0 UNIVERSAL SIDEBAR TOGGLE, TOPBAR HARMONY & 158-PAGE SAAS POLISH
 * ========================================================================== */

/* Universal single-state sidebar toggle across ALL widths (320px -> 4096px) */
@media (max-width: 768px) {
  body.sb-open .sidebar,
  body.sb-open #sidebar.sidebar,
  body.sb-open #admin-sidebar.sidebar {
    transform: none !important;
    display: flex !important;
  }
  .main-col {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}
body.sb-closed .sidebar,
body.sb-closed #sidebar.sidebar {
  display: none !important;
  transform: translateX(-110%) !important;
}
body.sb-closed .main-col {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

/* Single clean brand mark — show in topbar ONLY when sidebar is closed */
body:not(.sb-closed) .brand-in-topbar {
  display: none !important;
}
body.sb-closed .brand-in-topbar {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

/* Prevent search bar / ⌘K from ever colliding with Refer & earn */
.topbar-search {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
.topbar-search input {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}
.topbar-search kbd {
  flex: 0 0 auto !important;
}

/* Crisp readable status pill inside Aurora Light deep-purple topbar */
[data-theme="2"] .topbar .live-pill,
[data-theme="2"] .topbar .badge {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Website row ellipsis (⋮) dropdown popover */
.v22-kebab-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.v22-kebab-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 235px;
  background: var(--card-bg, #ffffff);
  color: var(--text, #111827);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
  z-index: 95;
  flex-direction: column;
  gap: 2px;
}
.v22-kebab-menu.open {
  display: flex !important;
}
.v22-kebab-menu a,
.v22-kebab-menu button {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 11px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: none !important;
}
.v22-kebab-menu a:hover,
.v22-kebab-menu button:hover {
  background: rgba(103, 61, 230, 0.09) !important;
  color: var(--hpx-pri, #673de6) !important;
}

/* Spacious inner-page container, headers & stacked card rhythm across ALL 158 routes */
.page-inner {
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
}
.page-header,
.page-head {
  margin-bottom: 18px;
}
.page-header h1,
.page-head h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.page-header p.muted {
  margin: 0;
  font-size: 13.5px;
}
.card + .card,
.section + .section {
  margin-top: 16px;
}

/* Universal Modern SaaS Form Inputs, Selects, Textareas & Buttons (0 raw OS controls!) */
#page-root input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
#page-root select,
#page-root textarea,
#modal-root input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
#modal-root select,
#modal-root textarea,
.admin-main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
.admin-main select,
.admin-main textarea {
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #d8deea);
  background: var(--card-bg, #ffffff);
  color: var(--text, #111827);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#page-root input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
#page-root select:focus,
#page-root textarea:focus,
#modal-root input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
#modal-root select:focus,
#modal-root textarea:focus {
  border-color: var(--hpx-pri, #673de6);
  box-shadow: 0 0 0 3px rgba(103, 61, 230, 0.12);
}

/* Re-preserve borderless chat input inside .v22-chat-bar */
#page-root .v22-chat-bar input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 6px 0 !important;
}

/* Clean breathing gap when raw inline inputs/selects sit next to buttons */
#page-root .card-body > input + button,
#page-root .card-body > select + button,
#page-root .card-body > input + input,
#page-root .card-body > input + select {
  margin-left: 8px;
}

/* Modern button styling for .btn-pri, .btn-sec & any unclassed <button> inside pages */
#page-root button.btn-pri,
#page-root .btn-pri,
#page-root .ai-actions button:first-child {
  background: var(--hpx-pri, #673de6) !important;
  color: #ffffff !important;
  border: 1px solid var(--hpx-pri, #673de6) !important;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
#page-root .btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost):not(.btn-pri),
#modal-root .btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost):not(.btn-pri),
.admin-main .btn:not(.btn-primary):not(.btn-danger):not(.btn-ghost):not(.btn-pri),
#page-root .btn-sec,
#modal-root .btn-sec,
.admin-main .btn-sec,
#page-root button:not([class]),
#modal-root button:not([class]),
.admin-main button:not([class]) {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #d8deea);
  background: var(--card-bg, #ffffff);
  color: var(--text, #1f2937);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
#page-root .btn-sec:hover,
#modal-root .btn-sec:hover,
.admin-main .btn-sec:hover,
#page-root button:not([class]):hover,
#modal-root button:not([class]):hover,
.admin-main button:not([class]):hover {
  border-color: var(--hpx-pri, #673de6);
  color: var(--hpx-pri, #673de6);
}

/* Prevent Storefront Header Overlap at Desktop-Site (980px) & Tablet Viewports */
@media (max-width: 1140px) and (min-width: 861px) {
  .site-header-inner {
    gap: 10px !important;
    padding: 11px 14px !important;
  }
  .site-logo {
    font-size: 18px !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
  }
  .site-nav {
    gap: 2px !important;
    min-width: 0 !important;
    flex-wrap: nowrap !important;
  }
  .site-nav-item {
    padding: 7px 7px !important;
    font-size: 12.5px !important;
    gap: 3px !important;
    white-space: nowrap !important;
  }
  .site-header-actions {
    gap: 6px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  .site-lang {
    padding: 6px 7px !important;
    font-size: 12px !important;
  }
}

/* Clean pill spacing for WHM Key-Value metrics (#/control Currency & tax, etc.) */
.kv {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin: 0 8px 8px 0;
  border-radius: 9px;
  background: rgba(103, 61, 230, 0.06);
  border: 1px solid rgba(103, 61, 230, 0.14);
  font-size: 13px;
}
.kv span {
  color: var(--muted, #6b7280);
}
.kv b {
  font-weight: 700;
}

/* Full Dark Mode support for universal inputs, popovers & unclassed buttons */
html[data-dark="1"] .v22-kebab-menu,
html[data-dark="1"] #page-root input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-dark="1"] #page-root select,
html[data-dark="1"] #page-root textarea,
html[data-dark="1"] #modal-root input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-dark="1"] #modal-root select,
html[data-dark="1"] #modal-root textarea,
html[data-dark="1"] #page-root button:not([class]),
html[data-dark="1"] #modal-root button:not([class]) {
  background: #141824 !important;
  color: #f8fafc !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

