/* =========================================================
   QUEEN DATA HUB
   PROFESSIONAL RESPONSIVE APPLICATION STYLES
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

:root {
    --orange: #f97316;
    --orange-dark: #ea580c;
    --orange-deep: #c2410c;
    --orange-light: #fff7ed;
    --orange-soft: #ffedd5;

    /* User-customizable theme variables */
    --primary-orange: #f97316;
    --primary-orange-dark: #ea580c;
    --primary-light: #fb923c;
    --sidebar-bg: #0f172a;
    --page-background: #f8fafc;
    --button-color: #ea580c;

    /* Compatibility variables */
    --navy: #0f172a;
    --navy-2: #111827;
    --navy-3: #1e293b;
    --navy-4: #334155;

    --page-bg: #f8fafc;
    --white: #ffffff;

    --text-dark: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --light-text: #94a3b8;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;

    --sidebar-width: 280px;
    --mobile-nav-height: 70px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 25px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.10);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* AUTH */
    --auth-ink: #0f172a;
    --auth-muted: #475569;
    --auth-line: rgba(15, 23, 42, 0.10);
    --auth-surface: rgba(255, 255, 255, 0.96);
    --auth-accent: #f97316;
    --auth-accent-deep: #c2410c;

    --auth-font-display: "Syne", "Segoe UI", Arial, sans-serif;
    --auth-font-body: "Figtree", "Segoe UI", Arial, sans-serif;
}

/* =========================================================
   GLOBAL
========================================================= */

html {
    width: 100%;
    min-width: 320px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-width: 320px;
    min-height: 100vh;
  background: var(--page-background, #f8fafc);
    color: var(--text);
    font-family: var(--auth-font-body);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
    font-family: var(--auth-font-body);
}

button,
input,
select,
textarea {
    font-size: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
button,
input,
select,
textarea {
    overflow-wrap: anywhere;
}

/* =========================================================
   APPLICATION SHELL
========================================================= */

.app,
#app,
.app-shell,
.application-shell,
.main-app {
    position: relative;
    width: 100%;
    max-width: none !important;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--page-bg);
    overflow-x: hidden;
    overflow-y: visible;
}

body.auth-layout .app,
body.auth-layout #app,
body.auth-layout .app-shell,
body.auth-layout .application-shell,
body.auth-layout .main-app {
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* =========================================================
   TOPBAR
========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.topbar-user {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.topbar-user .display-user-name {
    margin-top: 2px;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 800;
}

#notificationBell {
    position: relative;
    width: 42px;
    height: 42px;
    margin-left: auto;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--orange);
    font-size: 17px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

#notificationBell:hover {
    background: var(--orange-light);
    border-color: #fed7aa;
    transform: translateY(-1px);
}

#notificationBadge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--white);
    border-radius: 50px;
    background: var(--danger);
    color: var(--white);
    font-size: 9px;
    font-weight: 800;
}

/* =========================================================
   HAMBURGER
========================================================= */

.menu-toggle,
.mobile-menu-btn,
.sidebar-menu-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #fed7aa;
    border-radius: var(--radius-sm);
    background: var(--orange-light);
    color: var(--orange);
    font-size: 19px;
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.menu-toggle:hover,
.mobile-menu-btn:hover,
.sidebar-menu-toggle:hover {
    background: var(--orange);
    color: var(--white);
    transform: translateY(-1px);
}

.user-info {
    min-width: 0;
    flex: 1;
}

.profile-box h3 {
    margin: 0 0 4px;
    color: var(--white) !important;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-box p {
    margin: 0;
    color: var(--light-text) !important;
    font-size: 11px;
}

/* =========================================================
   PROFESSIONAL RESPONSIVE SIDEBAR
   Queen Data Hub
========================================================= */

#sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    width: var(--sidebar-width, 280px);
    height: 100vh;
    height: 100dvh;
    min-height: 0;

    z-index: 5000;

    display: flex;
    flex-direction: column;
    align-items: stretch;

    box-sizing: border-box;
    padding: 22px 15px 16px;

    background: linear-gradient(
        180deg,
        var(--sidebar-bg, #0f172a) 0%,
        var(--sidebar-bg, #0f172a) 100%
    );

    color: var(--white, #ffffff);
    border-right: 1px solid rgba(249, 115, 22, 0.85);

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    transform: translateX(-105%);
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease;

    box-shadow: 8px 0 30px rgba(15, 23, 42, 0.18);
}

#sidebar,
#sidebar * {
    box-sizing: border-box;
}

#sidebar.active {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.28);
}
/* =========================================================
   BRAND / LOGO
========================================================= */

.sidebar-brand {
    width: 100%;
    min-height: 64px;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 11px;

    padding: 2px 7px 18px;
    margin: 0 0 14px;

    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 13px;
    background: var(--orange, #f97316);
    color: #ffffff;

    box-shadow: 0 5px 15px rgba(249, 115, 22, 0.22);
}

.sidebar-brand strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: 0.2px;
}

.sidebar-brand span {
    display: block;
    margin-top: 4px;

    color: #94a3b8;
    font-size: 10px;
    line-height: 1.4;
}

.sidebar-close {
    display: none;

    width: 36px;
    height: 36px;
    flex: 0 0 36px;

    align-items: center;
    justify-content: center;

    margin-left: auto;
    padding: 0;

    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;

    background: transparent;
    color: #cbd5e1;

    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* =========================================================
   PROFILE AREA
========================================================= */

.profile-box {
    width: 100%;
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    min-width: 0;
    padding: 12px 10px 18px;
    margin: 0 0 14px;

    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.sidebar-avatar-wrap {
    position: relative;

    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    flex: 0 0 48px;

    overflow: hidden;
    border-radius: 50%;

    background: #fff0e6;
    border: 2px solid var(--orange, #f97316);
}

.sidebar-profile-img {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;

    display: block;
    object-fit: cover;
    border-radius: 50%;
}

#sidebarInitials {
    position: absolute;
    inset: 0;
    z-index: 1;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: var(--orange, #f97316);
    color: #ffffff;

    font-size: 16px;
    font-weight: 800;
}

#sidebarAvatar {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2;

    display: none;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;

    border-radius: 50%;
    object-fit: cover;
}

/* =========================================================
   NAVIGATION SCROLL AREA

   Supports common existing sidebar navigation selectors.
========================================================= */

#sidebar nav,
#sidebar .sidebar-nav,
#sidebar .sidebar-menu,
#sidebar .sidebar-links {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;

    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

#sidebar nav::-webkit-scrollbar,
#sidebar .sidebar-nav::-webkit-scrollbar,
#sidebar .sidebar-menu::-webkit-scrollbar,
#sidebar .sidebar-links::-webkit-scrollbar {
    width: 4px;
}

#sidebar nav::-webkit-scrollbar-thumb,
#sidebar .sidebar-nav::-webkit-scrollbar-thumb,
#sidebar .sidebar-menu::-webkit-scrollbar-thumb,
#sidebar .sidebar-links::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
}

/* Navigation links */

#sidebar nav a,
#sidebar .sidebar-nav a,
#sidebar .sidebar-menu a,
#sidebar .sidebar-links a {
    min-height: 44px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 13px;
    margin: 3px 0;

    border: 1px solid transparent;
    border-radius: 10px;

    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

#sidebar nav a:hover,
#sidebar .sidebar-nav a:hover,
#sidebar .sidebar-menu a:hover,
#sidebar .sidebar-links a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

#sidebar nav a.active,
#sidebar .sidebar-nav a.active,
#sidebar .sidebar-menu a.active,
#sidebar .sidebar-links a.active,
#sidebar nav a[aria-current="page"] {
    background: var(--primary-orange, #f97316);
    border-color: var(--button-color, #ea580c);
    color: #ffffff;
}
#sidebar nav a i,
#sidebar .sidebar-nav a i,
#sidebar .sidebar-menu a i,
#sidebar .sidebar-links a i,
#sidebar nav a svg,
#sidebar .sidebar-nav a svg,
#sidebar .sidebar-menu a svg,
#sidebar .sidebar-links a svg {
    flex: 0 0 18px;
    width: 18px;
    text-align: center;
    color: var(--primary-light, #fb923c);
}

/* =========================================================
   SIDEBAR FOOTER / LOGOUT
========================================================= */

#sidebar .sidebar-footer,
#sidebar .sidebar-bottom {
    flex: 0 0 auto;
    width: 100%;

    margin-top: auto;
    padding-top: 14px;

    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

#sidebar .sidebar-footer a,
#sidebar .sidebar-bottom a {
    width: 100%;
}

#sidebar .logout-btn,
#sidebar a.logout-btn,
#sidebar .sidebar-footer .logout,
#sidebar .sidebar-bottom .logout {
    min-height: 44px;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    padding: 11px 14px;
    border: 0;
    border-radius: 10px;

    background: #ef2929;
    color: #ffffff;

    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#sidebar .logout-btn:hover,
#sidebar a.logout-btn:hover,
#sidebar .sidebar-footer .logout:hover,
#sidebar .sidebar-bottom .logout:hover {
    background: #dc2626;
}

/* =========================================================
   QUEEN DATA HUB
   RESPONSIVE SIDEBAR + PROFILE PAGE
   PERSONAL USER THEME
========================================================= */

/* =========================================================
   MOBILE OVERLAY
========================================================= */

#sidebarOverlay {
    position: fixed;
    inset: 0;
    z-index: 4999;

    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#sidebarOverlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* =========================================================
   SIDEBAR PROFILE
========================================================= */

#sidebar .profile-box {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    width: 100%;
    min-width: 0;
    min-height: 0;

    margin: 0 0 18px;
    padding: 12px 8px;

    text-align: center;
    overflow: visible;
}

#sidebar .sidebar-avatar-wrap {
    position: relative;
    display: block;

    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    max-width: 54px;
    max-height: 54px;

    flex: 0 0 54px;
    overflow: hidden;
    border-radius: 50%;
}

#sidebar .sidebar-profile-img,
#sidebar #sidebarAvatar,
#sidebar #sidebarInitials {
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    max-width: 54px;
    max-height: 54px;

    border-radius: 50%;
    object-fit: cover;
    box-sizing: border-box;
}

#sidebar .sidebar-profile-img,
#sidebar #sidebarAvatar {
    display: block;
}

#sidebar #sidebarInitials {
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-orange, #f97316);
    color: #fff;
}

#sidebar #sidebarAvatar {
    position: absolute;
    inset: 0;
    z-index: 2;
}
/* =========================================================
   SIDEBAR CLOSE BUTTON
========================================================= */

#sidebar .close-sidebar {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    z-index: 10;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--primary-light, #fb923c);
    border-radius: 10px;
    background: transparent;
    color: var(--primary-light, #fb923c);
    font-size: 20px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

#sidebar .close-sidebar i {
    color: inherit;
}

#sidebar .close-sidebar:hover {
    background: var(--button-color, #ea580c);
    border-color: var(--button-color, #ea580c);
    color: #fff;
}

/* =========================================================
   PROFILE PAGE
========================================================= */

#profilePage {
    width: 100%;
    max-width: none !important;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--page-background, #f8fafc);
}

#profilePage .page-content {
    width: 100%;
    max-width: none !important;
    overflow: visible;
}

/* PROFILE IMAGE */

#profilePage .profile-image-wrapper {
    position: relative;
    width: 110px !important;
    height: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    min-height: 110px !important;
    max-height: 110px !important;
    flex: 0 0 110px;
    margin: 0 auto;
    overflow: hidden !important;
    border-radius: 50% !important;
    background: var(--primary-orange, #f97316);
    display: grid;
    place-items: center;
    isolation: isolate;
}

/* PROFILE INITIALS */

#profilePage #userInitials {
    position: absolute !important;
    inset: 0 !important;
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-orange, #f97316);
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    z-index: 1;
}

/* PROFILE AVATAR */

#profilePage #userAvatar {
    position: absolute !important;
    inset: 0 !important;
    width: 110px !important;
    height: 110px !important;
    min-width: 110px !important;
    min-height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: none;
    object-fit: cover !important;
    object-position: center center !important;
    border: 0 !important;
    border-radius: 50% !important;
    z-index: 2;
}

#profilePage #userAvatar[style*="display: block"],
#profilePage #userAvatar[style*="display:block"] {
    display: block !important;
}

/* PROFILE UPLOAD AREA */

#profilePage .profile-upload-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    text-align: center;
}

/* PROFILE UPLOAD BUTTON */

#profilePage .profile-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--button-color, #ea580c);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    transition: background .2s ease;
}

#profilePage .profile-upload-button:hover {
    background: var(--primary-orange, #f97316);
}

/* PROFILE FORM */

#profilePage .profile-form-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

#profilePage .profile-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#profilePage .profile-field label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

#profilePage .profile-field input,
#profilePage .profile-field select {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    outline: none;
    background: var(--white, #fff);
    color: var(--text-dark);
    transition: border-color .2s ease, box-shadow .2s ease;
}

#profilePage .profile-field input:focus,
#profilePage .profile-field select:focus {
    border-color: var(--primary-orange, #f97316);
    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--primary-orange, #f97316) 15%,
        transparent
    );
}
/* =========================================================
   TABLET AND MOBILE
========================================================= */

@media (max-width: 768px) {

    #sidebar {
        top: 0;
        bottom: 0;
        left: 0;

        width: min(84vw, 310px);
        max-width: 310px;

        height: 100vh;
        min-height: 0;

        padding:
            max(14px, env(safe-area-inset-top))
            14px
            max(14px, env(safe-area-inset-bottom));

        border-right: 1px solid var(--primary-orange, #f97316);

        transform: translateX(-105%);
    }

    #sidebar.active {
        transform: translateX(0);
    }

    .sidebar-brand {
        min-height: 76px;
        padding: 4px 5px 16px;
        margin-bottom: 8px;
    }

    .sidebar-brand-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;

        background: var(--primary-orange, #f97316);
    }

    .sidebar-close {
        display: flex;
    }

    .profile-box {
        padding: 12px 8px 16px;
        margin-bottom: 10px;
    }

    #sidebar nav a,
    #sidebar .sidebar-nav a,
    #sidebar .sidebar-menu a,
    #sidebar .sidebar-links a {
        min-height: 46px;
        padding: 12px;
        margin: 3px 0;
        font-size: 13px;
    }

    #sidebar .sidebar-footer,
    #sidebar .sidebar-bottom {
        padding-top: 12px;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }

}

/* =========================================================
   SHORT MOBILE SCREENS
========================================================= */

@media (max-width: 768px) and (max-height: 600px) {

    #sidebar {
        padding-top: max(8px, env(safe-area-inset-top));
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .sidebar-brand {
        min-height: 54px;
        padding-bottom: 10px;
        margin-bottom: 6px;
    }

    .sidebar-brand-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .profile-box {
        padding-top: 8px;
        padding-bottom: 10px;
        margin-bottom: 6px;
    }

    .sidebar-avatar-wrap {
        width: 40px;
        height: 40px;
        min-width: 40px;
        max-width: 40px;
        flex-basis: 40px;
    }

}

/* =========================================================
   DESKTOP SIDEBAR
========================================================= */

@media (min-width: 769px) {

    #sidebar {
        width: var(--sidebar-width, 280px);
        transform: translateX(0);
    }

    #sidebarOverlay {
        display: none;
    }

}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    #sidebar,
    #sidebarOverlay,
    #sidebar a,
    #sidebar button {
        transition: none !important;
    }

}
/* =========================================================
   SIDEBAR NAVIGATION CONTAINER
========================================================= */

#sidebar .sidebar-nav {
    width: 100%;
    flex: 1 0 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 6px;

    padding: 8px 0;
}

/* =========================================================
   SIDEBAR NAVIGATION BUTTONS
========================================================= */

#sidebar .menu-btn {
    position: relative;
    flex: 0 0 auto;

    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 13px;

    box-sizing: border-box;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm, 10px);

    background: transparent;
    color: #cbd5e1;

    text-align: left;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

/* Navigation icons */

#sidebar .menu-btn i {
    width: 22px;
    flex: 0 0 22px;

    color: var(--primary-light, #fb923c);
    font-size: 16px;
    text-align: center;

    transition: color 0.2s ease;
}

/* Hover and active states */

#sidebar .menu-btn:hover,
#sidebar .menu-btn.active {
    background: var(--primary-orange, #f97316);
    border-left-color: var(--button-color, #ea580c);
    color: #ffffff;
}

#sidebar .menu-btn:hover i,
#sidebar .menu-btn.active i {
    color: #ffffff;
}

#sidebar .menu-btn:hover {
    transform: translateX(2px);
}

/* Keyboard accessibility */

#sidebar .menu-btn:focus-visible,
#sidebar .logout-btn:focus-visible {
    outline: 2px solid var(--primary-light, #fb923c);
    outline-offset: 3px;
}

/* =========================================================
   SIDEBAR RESPONSIVE BEHAVIOUR
   Main sidebar dimensions and overlay are defined earlier.
========================================================= */

@media screen and (min-width: 901px) {
    body.authenticated-layout #sidebar {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
    }
}

@media screen and (max-width: 900px) {
    #sidebar {
        transform: translateX(-105%);
        visibility: visible;
    }

    #sidebar.active {
        transform: translateX(0);
    }
}
/* =========================================================
   LOGOUT BUTTON
========================================================= */

#sidebar .logout-container {
    width: 100%;
    flex: 0 0 auto;

    margin-top: 16px;
    padding-top: 16px;

    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

#sidebar .logout-btn {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    box-sizing: border-box;
    padding: 12px;

    border: 0;
    border-radius: var(--radius-sm, 10px);

    background: #dc2626;
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

#sidebar .logout-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}
/* =========================================================
   MOBILE SIDEBAR ADJUSTMENTS
========================================================= */

@media (max-width: 768px) {
    #sidebar {
        width: min(300px, 88vw);
        height: 100vh;
        height: 100dvh;

        padding: 64px 15px 16px;
        padding-top: max(64px, calc(env(safe-area-inset-top) + 48px));
        padding-bottom: max(16px, env(safe-area-inset-bottom));

        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    #sidebar .close-sidebar {
        position: absolute;
        top: max(10px, env(safe-area-inset-top));
        right: 12px;
    }

    #sidebar .profile-box {
        flex-shrink: 0;
        margin-bottom: 12px;
    }

    #sidebar .sidebar-nav {
        flex: 1 0 auto;
        justify-content: space-evenly;
        gap: 5px;
    }

    #sidebar .menu-btn {
        flex-shrink: 0;
        min-height: 44px;
    }

    #sidebar .logout-container {
        flex-shrink: 0;
        margin-top: auto;
        padding-top: 12px;
    }
}

@media (max-height: 600px) {
    #sidebar .sidebar-nav {
        justify-content: flex-start;
        gap: 5px;
    }

    #sidebar .menu-btn {
        min-height: 40px;
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

/* =========================================================
   HOME PAGE — PERSONAL USER THEME
========================================================= */

#homePage {
    background: linear-gradient(
        180deg,
        var(--orange-light, #fff7ed) 0,
        var(--page-background, #f8fafc) 350px
    );
}

.home-content {
    width: 100%;
    max-width: none !important;
    min-width: 0;

    padding: 30px;

    display: flex;
    flex-direction: column;
}

/* =========================================================
   WALLET CARD — PERSONAL USER THEME
========================================================= */

.wallet-card {
    width: 100%;
    min-height: 185px;

    margin: 0 0 24px;
    padding: 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;

    box-sizing: border-box;
    border-radius: var(--radius-xl);

    background:
        radial-gradient(
            circle at 88% 10%,
            rgba(255, 255, 255, 0.18),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            var(--primary-orange, #f97316),
            var(--primary-light, #fb923c)
        );

    color: #ffffff;

    box-shadow:
        0 14px 32px
        color-mix(
            in srgb,
            var(--primary-orange, #f97316) 20%,
            transparent
        );
}

.wallet-card p {
    margin-bottom: 8px;

    color: rgba(255, 255, 255, 0.85);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.wallet-card h1 {
    color: #ffffff;

    font-size: clamp(28px, 3vw, 40px);
    font-weight: 800;
}

/* Wallet button */

.wallet-card button {
    background: var(--button-color, #ea580c);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.wallet-card button:hover {
    filter: brightness(0.92);
    transform: translateY(-2px);
}

/* =========================================================
   HOME PAGE RESPONSIVE LAYOUT
========================================================= */

@media (max-width: 768px) {
    .home-content {
        padding: 18px 14px;
    }

    .wallet-card {
        min-height: 160px;
        padding: 22px 18px;
        gap: 15px;
    }

    .wallet-card h1 {
        font-size: clamp(25px, 7vw, 34px);
    }
}

@media (max-width: 480px) {
    .wallet-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .wallet-card button {
        width: 100%;
    }
}
/* =========================================================
   PURCHASE CARD
========================================================= */

.purchase-card {
    width: 100%;
    max-width: none !important;
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.purchase-card h2 {
    margin-bottom: 22px;
    color: var(--text-dark);
    font-size: 21px;
    font-weight: 800;
}

.purchase-card label {
    display: block;
    margin: 17px 0 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.purchase-card select,
.purchase-card input {
    width: 100%;
    min-height: 49px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: var(--white);
    color: var(--text-dark);
    outline: none;
}

.purchase-card select:focus,
.purchase-card input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-orange) 12%, transparent);
}

.buy-btn {
    width: 100%;
    min-height: 49px;
    margin-top: 22px;
    padding: 13px 18px;
    border: 0;
    border-radius: 11px;
    background: var(--button-color);
    color: var(--white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.buy-btn:hover {
    filter: brightness(.92);
}

/* =========================================================
   BOTTOM NAVIGATION
========================================================= */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    width: 100%;
    height: var(--mobile-nav-height);
    display: none;
    align-items: center;
    justify-content: space-around;
    padding:
        7px
        max(7px, env(safe-area-inset-right))
        calc(7px + env(safe-area-inset-bottom))
        max(7px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -5px 20px rgba(15, 23, 42, .07);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.bottom-nav button {
    min-width: 55px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.bottom-nav button:hover,
.bottom-nav button.active {
    color: var(--primary-orange);
}

.bottom-nav i {
    font-size: 18px;
}

/* =========================================================
   WALLET / AFFILIATE PAGE
========================================================= */

#walletPage {
    width: 100%;
    max-width: none !important;
    height: auto !important;
    min-height: 100vh;
    overflow-x: hidden !important;
    overflow-y: visible !important;

    background: linear-gradient(
        180deg,
        var(--orange-light, #fff7ed) 0,
        var(--page-background, #f8fafc) 340px
    );
}

#walletPage .wallet-container {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    height: auto !important;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: visible !important;
}

/* =========================================================
   AFFILIATE BALANCE CARD
========================================================= */

.balance-card {
    width: 100%;
    padding: 30px;
    border-radius: var(--radius-xl);

    background:
        radial-gradient(
            circle at 85% 8%,
            rgba(255, 255, 255, .18),
            transparent 28%
        ),
        radial-gradient(
            circle at 10% 100%,
            rgba(255, 255, 255, .08),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            var(--primary-orange, #f97316),
            var(--button-color, #ea580c)
        );

    color: var(--white);

    box-shadow:
        0 18px 38px color-mix(in srgb, var(--primary-orange) 20%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, .14);

    overflow: hidden;
}

.balance-content {
    width: 100%;
}

.balance-content > p {
    margin-bottom: 6px;
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.balance-content h1 {
    margin: 5px 0 0;
    color: var(--white);
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.02em;
}

/* =========================================================
   AFFILIATE STATISTICS
========================================================= */

.stats-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 25px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .20);
}

.stat {
    min-width: 0;
    min-height: 92px;
    padding: 17px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px;
    background: rgba(255, 255, 255, .08);
    text-align: center;
}

.stat span {
    display: block;
    color: var(--white);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
}

.stat p {
    margin-top: 6px;
    color: rgba(255, 255, 255, .76);
    font-size: 11px;
    font-weight: 700;
}

/* =========================================================
   AFFILIATE WITHDRAWAL CARD
========================================================= */

.affiliate-withdrawal-card {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    margin-top: 6px !important;
    padding: 26px !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    background: var(--white) !important;
    box-shadow: var(--shadow-md) !important;
    color: var(--text) !important;
    text-align: left !important;
    overflow: hidden;
}

.affiliate-withdrawal-card > div:first-child {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 13px;
}

.affiliate-withdrawal-card > div:first-child > div:first-child {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    flex: 0 0 46px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid color-mix(in srgb, var(--primary-orange) 25%, white) !important;
    border-radius: 12px !important;
    background: var(--orange-light) !important;
    color: var(--primary-orange) !important;
    font-size: 18px !important;
}

.affiliate-withdrawal-card h3 {
    margin: 0 !important;
    color: var(--text-dark) !important;
    font-size: 19px !important;
    line-height: 1.25;
    font-weight: 800 !important;
}

.affiliate-withdrawal-card > div:first-child p {
    margin: 4px 0 0 !important;
    color: var(--muted) !important;
    font-size: 13px !important;
    line-height: 1.5;
}

/* Minimum withdrawal box */

.affiliate-withdrawal-card > div:nth-child(2) {
    width: 100%;
    margin-top: 20px !important;
    padding: 13px 15px !important;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid color-mix(in srgb, var(--primary-orange) 25%, white) !important;
    border-radius: 10px !important;
    background: var(--orange-light) !important;
    color: var(--text-dark) !important;
    font-size: 13px !important;
    line-height: 1.45;
}

.affiliate-withdrawal-card > div:nth-child(2) i {
    flex: 0 0 auto;
    color: var(--primary-orange);
}

/* =========================================================
   WITHDRAWAL FORM
========================================================= */

#affiliateWithdrawalForm {
    width: 100%;
    margin-top: 20px !important;
}

#affiliateWithdrawalForm > div {
    width: 100%;
}

#affiliateWithdrawalForm label {
    display: block !important;
    margin-bottom: 7px !important;
    color: var(--text) !important;
    font-size: 11px !important;
    line-height: 1.3;
    font-weight: 800 !important;
    letter-spacing: .055em;
    text-transform: uppercase;
}

#affiliateWithdrawalForm input,
#affiliateWithdrawalForm select {
    width: 100% !important;
    min-width: 0;
    height: 49px !important;
    min-height: 49px !important;
    padding: 0 13px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    background: var(--white) !important;
    color: var(--text-dark) !important;
    outline: none !important;
    font-size: 14px !important;
    font-family: var(--auth-font-body) !important;
    transition: border-color .2s ease, box-shadow .2s ease;
}

#affiliateWithdrawalForm input:hover,
#affiliateWithdrawalForm select:hover {
    border-color: var(--primary-light) !important;
}

#affiliateWithdrawalForm input:focus,
#affiliateWithdrawalForm select:focus {
    border-color: var(--primary-orange) !important;
    background: var(--white) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-orange) 12%, transparent) !important;
}

#affiliateWithdrawalForm input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

#affiliateWithdrawalForm select {
    cursor: pointer;
}

/* Available balance */

#affiliateWithdrawalForm > div[style*="justify-content"] {
    width: 100%;
    min-height: 49px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px !important;
    margin-bottom: 15px !important;
    border: 1px solid var(--border-light);
    border-radius: 10px !important;
    background: var(--page-background) !important;
}

#affiliateWithdrawalForm > div[style*="justify-content"] span {
    color: var(--muted) !important;
    font-size: 12px;
}

#affiliateWithdrawalForm > div[style*="justify-content"] strong {
    color: var(--text-dark) !important;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

/* =========================================================
   WITHDRAWAL MESSAGE
========================================================= */

#affiliateWithdrawalMessage {
    width: 100%;
    display: none;
    padding: 12px 13px !important;
    margin-bottom: 15px !important;
    border: 1px solid transparent;
    border-radius: 10px !important;
    font-size: 13px !important;
    line-height: 1.5;
    font-weight: 700 !important;
}

#affiliateWithdrawalMessage.success,
#affiliateWithdrawalMessage.success-message {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

#affiliateWithdrawalMessage.error,
#affiliateWithdrawalMessage.error-message {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

/* =========================================================
   WITHDRAWAL SUBMIT BUTTON
========================================================= */

#affiliateWithdrawalSubmit {
    width: 100% !important;
    min-height: 50px !important;
    height: 50px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: linear-gradient(
        135deg,
        var(--primary-orange),
        var(--button-color)
    ) !important;
    color: var(--white) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer;
    box-shadow: 0 7px 17px color-mix(in srgb, var(--primary-orange) 18%, transparent);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

#affiliateWithdrawalSubmit:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
}

#affiliateWithdrawalSubmit:active {
    transform: translateY(0);
}

#affiliateWithdrawalSubmit:disabled {
    background: #94a3b8 !important;
    box-shadow: none !important;
    opacity: .75;
    transform: none !important;
    cursor: not-allowed;
}

/* =========================================================
   AFFILIATE LINK CARD
========================================================= */

.affiliate-link-card {
    position: relative;
    width: 100%;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    text-align: left;
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.affiliate-link-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--primary-orange),
        var(--button-color)
    );
}

.affiliate-link-card h3 {
    margin: 0 0 7px;
    color: var(--text-dark);
    font-size: 19px;
    line-height: 1.3;
    font-weight: 800;
}

.affiliate-link-card p {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================================
   AFFILIATE LINK INPUT + COPY
========================================================= */

.affiliate-link-row {
    width: 100%;
    display: flex;
    align-items: stretch;
    gap: 9px;
}

.affiliate-link-row input,
#affiliateLink {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: var(--page-background);
    color: var(--text-dark);
    outline: none;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--auth-font-body);
}

.affiliate-link-row input:focus,
#affiliateLink:focus {
    border-color: var(--primary-orange);
    background: var(--white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-orange) 12%, transparent);
}

.affiliate-link-row button {
    min-width: 92px;
    height: 48px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--button-color);
    color: var(--white);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 6px 15px color-mix(in srgb, var(--primary-orange) 15%, transparent);
    transition: filter .2s ease, transform .2s ease;
}

.affiliate-link-row button:hover {
    filter: brightness(.92);
    transform: translateY(-1px);
}

/* =========================================================
   AFFILIATE SHARE BUTTONS
========================================================= */

.affiliate-share-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.affiliate-share-row button {
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid color-mix(in srgb, var(--primary-orange) 25%, white);
    border-radius: 10px;
    background: var(--orange-light);
    color: var(--primary-orange-dark);
    font-size: 12px;
    font-weight: 800;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.affiliate-share-row button:hover {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: var(--white);
    transform: translateY(-1px);
}

.affiliate-share-row button i {
    font-size: 15px;
}

/* WhatsApp keeps its recognizable green hover */

.affiliate-share-row button:last-child:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* =========================================================
   AFFILIATE DASHBOARD LINK
========================================================= */

a.affiliate-link-card[href*="affiliate-dashboard"] {
    min-height: 88px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 26px !important;
    color: var(--text-dark);
}

a.affiliate-link-card[href*="affiliate-dashboard"]::before {
    height: 3px;
}

a.affiliate-link-card[href*="affiliate-dashboard"] > div {
    min-width: 0;
    flex: 1;
}

a.affiliate-link-card[href*="affiliate-dashboard"] strong {
    display: block;
    color: var(--text-dark);
    font-size: 16px;
    font-weight: 800;
}

a.affiliate-link-card[href*="affiliate-dashboard"] p {
    margin: 5px 0 0 !important;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

a.affiliate-link-card[href*="affiliate-dashboard"] > i {
    flex: 0 0 auto;
    color: var(--primary-orange) !important;
    font-size: 15px;
    transition: transform .2s ease;
}

a.affiliate-link-card[href*="affiliate-dashboard"]:hover {
    border-color: var(--primary-light);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .09);
    transform: translateY(-1px);
}

a.affiliate-link-card[href*="affiliate-dashboard"]:hover > i {
    transform: translateX(3px);
}

/* =========================================================
   COMMISSION ACTIVITY
========================================================= */

.wallet-activity-card {
    width: 100%;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.wallet-activity-card h3 {
    margin: 0 0 4px;
    color: var(--text-dark);
    font-size: 19px;
    line-height: 1.3;
    font-weight: 800;
}

.wallet-activity-card > div {
    width: 100%;
    min-height: 180px;
    margin-top: 18px;
    padding: 30px 20px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: 13px;
    background: var(--page-background);
    color: var(--muted) !important;
    text-align: center;
    line-height: 1.6;
}

.wallet-activity-card > div i {
    display: block;
    margin-bottom: 10px !important;
    color: var(--primary-orange);
    font-size: 30px !important;
}

.wallet-activity-card > div div:first-of-type {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.wallet-activity-card > div div:last-of-type {
    margin-top: 7px !important;
    color: var(--muted);
    font-size: 12px !important;
}
/* =========================================================
   LEGACY / GENERAL HISTORY
========================================================= */

.history-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 5px;
    padding-bottom: 20px;
}

.section-subtitle {
    width: 100%;
    margin-bottom: 14px;
    color: var(--text-dark);
    font-weight: 800;
}

#transactionHistory {
    width: 100%;
    max-height: 450px;
    overflow-y: auto;
}

.centered-history {
    margin-top: 30px;
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}


/* =========================================================
   ORDERS / INBOX — RESPONSIVE LAYOUT
========================================================= */

#ordersPage,
#inboxPage {
    display: none;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 100vh;
    height: auto;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    box-sizing: border-box;
}

#ordersPage .topbar,
#inboxPage .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#ordersPage .topbar > div,
#inboxPage .topbar > div {
    flex: 1 1 auto;
    min-width: 0;
}

#ordersPage .page-content,
#inboxPage .page-content {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
}

#ordersList,
#inboxList,
.orders-scroll-box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.orders-scroll-box {
    gap: 12px;
    margin-top: 10px;
    overflow-x: auto;
    overflow-y: visible;
}

.transaction-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px;
    box-sizing: border-box;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
}

.transaction-details {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.transaction-details h4 {
    margin-bottom: 4px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.status-pill {
    flex-shrink: 0;
    padding: 6px 10px;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

/* Status colours are intentionally semantic. */

.status-pill.success {
    background: #dcfce7;
    color: #166534;
}

.status-pill.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.failed {
    background: #fee2e2;
    color: #991b1b;
}

#inboxList > div {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
}

#inboxList h4,
#inboxList p {
    overflow-wrap: anywhere;
    word-break: normal;
}

.notification-unread {
    border-left: 5px solid var(--primary-orange, #f97316) !important;
    background: var(--orange-light, #fff7ed) !important;
}


/* =========================================================
   RESELLER
========================================================= */

.reseller-container {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    margin: 0;
    padding: 30px;
}

.reseller-header-card,
.reseller-steps-card {
    width: 100%;
    max-width: none !important;
    padding: 26px;
    margin-bottom: 22px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.reseller-header-card h2,
.reseller-steps-card h3 {
    color: var(--text-dark);
    font-size: 21px;
    font-weight: 800;
}

.reseller-header-card p,
.reseller-steps-card p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.badge-reseller {
    display: inline-flex;
    padding: 7px 12px;
    margin-bottom: 12px;
    border-radius: 50px;
    background: var(--orange-light);
    color: var(--orange-dark);
    font-size: 10px;
    font-weight: 800;
}

.reseller-stat-box {
    padding: 16px;
    margin-bottom: 12px;
    background: var(--page-background, #f8fafc);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}

.stat-label {
    color: var(--light-text);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .07em;
}

.reseller-stat-box h3 {
    margin-top: 4px;
    color: var(--text-dark);
    font-size: 20px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.step-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--orange-light);
    color: var(--primary-orange, #f97316);
    font-size: 16px;
}

.step-item h4 {
    margin-bottom: 4px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 800;
}

.step-item p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   RESELLER PRICING
========================================================= */

#resellerPricingWorkspace {
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    display: block;
}

#resellerPricingWorkspace [data-package-id] {
    min-width: 0;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

#resellerPricingWorkspace [data-package-id]:hover {
    transform: translateY(-2px);
    border-color: var(--primary-orange, #f97316) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

.reseller-markup {
    outline: none;
}

.reseller-markup:focus {
    border-color: var(--primary-orange, #f97316) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .10);
}

.reseller-packages,
.reseller-package-grid,
.package-grid,
.network-grid,
.packages-grid {
    width: 100%;
    max-width: none !important;
}

.reseller-package-grid,
.package-grid,
.network-grid,
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.network-section,
.reseller-network-section,
.network-group,
.package-network-section {
    width: 100%;
    max-width: none !important;
    min-width: 0;
}

.network-section > *,
.reseller-network-section > *,
.network-group > *,
.package-network-section > * {
    max-width: 100%;
}


/* =========================================================
   FORMS
========================================================= */

input,
select,
textarea {
    max-width: 100%;
}

.plus {
    color: var(--success);
    font-weight: 800;
}

.minus {
    color: var(--danger);
    font-weight: 800;
}

.withdraw-btn {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px 25px;
    border-radius: 10px;
    background: var(--success);
    color: var(--white);
    font-weight: 800;
}

.withdraw-btn:hover {
    background: #15803d;
}

.link-section {
    margin-top: 10px;
    color: var(--muted);
    font-size: .9rem;
}

.primary-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 13px 20px;
    border-radius: 11px;
    background: var(--button-color, var(--orange));
    color: var(--white);
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 7px 17px rgba(249, 115, 22, .18);
    transition:
        background .2s ease,
        transform .2s ease;
}

.primary-btn:hover {
    background: var(--primary-orange-dark, var(--orange-dark));
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #94a3b8 !important;
    box-shadow: none;
    transform: none;
}


/* =========================================================
   AUTHENTICATION
========================================================= */

#loginPage,
#signupPage,
#forgotPasswordPage {
    width: 100%;
    min-height: 100vh;
    background: transparent;
}

.auth-page {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    width: 100vw !important;
    max-width: none !important;
    min-width: 320px;
    min-height: 100vh !important;
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: var(--auth-font-body);
    color: var(--auth-ink);
}

.auth-shell {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 20px;
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(
            circle at 10% 15%,
            rgba(249, 115, 22, .18),
            transparent 35%
        ),
        radial-gradient(
            circle at 90% 85%,
            rgba(251, 146, 60, .18),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #fffaf5 0%,
            #fff1e6 45%,
            #f8e4d1 100%
        );
}

.auth-atmosphere::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            rgba(15, 23, 42, .03) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(15, 23, 42, .03) 1px,
            transparent 1px
        );
    background-size: 40px 40px;
    mask-image: radial-gradient(
        ellipse 70% 70% at 50% 50%,
        black,
        transparent
    );
}

.auth-atmosphere::after {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    top: -180px;
    right: -120px;
    border: 1px solid rgba(249, 115, 22, .12);
    border-radius: 50%;
    box-shadow:
        0 0 0 50px rgba(249, 115, 22, .02),
        0 0 0 100px rgba(249, 115, 22, .01);
}

.auth-layout {
    position: relative;
    z-index: 2;
    width: min(500px, calc(100% - 20px));
    min-height: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 30px 0;
}

.auth-brand {
    width: 100%;
    min-width: 0;
    padding: 5px 0;
    text-align: center;
    animation: authRise .7s ease-out both;
}

.auth-brand-mark {
    display: inline-block;
    margin-bottom: 15px;
    padding: 7px 14px;
    border-radius: 9px;
    background: var(--primary-orange, var(--orange));
    color: var(--white);
    font-family: var(--auth-font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    box-shadow: 0 8px 20px rgba(249, 115, 22, .18);
}

.auth-headline {
    max-width: 100%;
    margin-bottom: 15px;
    color: var(--auth-ink);
    font-family: var(--auth-font-display);
    font-size: clamp(3rem, 7vw, 5rem);
    line-height: .98;
    font-weight: 800;
    letter-spacing: -.04em;
}

.auth-headline::after {
    content: "";
    display: block;
    width: 58px;
    height: 5px;
    margin: 18px auto 0;
    border-radius: 20px;
    background: var(--primary-orange, var(--orange));
}

.auth-support {
    max-width: 470px;
    margin: 0 auto;
    color: var(--auth-muted);
    font-size: 1rem;
    line-height: 1.65;
}

.auth-panel {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 32px;
    border: 1px solid var(--auth-line);
    border-radius: 24px;
    background: var(--auth-surface);
    box-shadow:
        0 24px 70px rgba(15, 23, 42, .08),
        0 4px 16px rgba(15, 23, 42, .03);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: authPanelIn .75s ease-out .08s both;
}

.auth-panel-head {
    margin-bottom: 25px;
}

.auth-panel-head h2 {
    margin-bottom: 7px;
    color: var(--auth-ink);
    font-family: var(--auth-font-display);
    font-size: 1.65rem;
    line-height: 1.2;
    font-weight: 800;
}

.auth-panel-head p {
    color: var(--auth-muted);
    font-size: .9rem;
    line-height: 1.55;
}

.auth-field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}

.auth-field span {
    color: #475569;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

/* Auth inputs are styled once through the panel selector. */

.auth-panel input,
.auth-panel select,
.auth-panel textarea {
    width: 100%;
    min-height: 51px;
    padding: 13px 14px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    background: #fff;
    color: var(--auth-ink);
    outline: none;
    font-size: .94rem;
}

.auth-panel input:hover,
.auth-panel select:hover {
    border-color: rgba(249, 115, 22, .35);
}

.auth-panel input:focus,
.auth-panel select:focus,
.auth-panel textarea:focus {
    border-color: var(--auth-accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, .12);
}

.auth-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: -2px;
    margin-bottom: 18px;
}

.auth-text-link {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--auth-accent-deep);
    font-size: .86rem;
    font-weight: 800;
    cursor: pointer;
}

.auth-text-link:hover {
    color: var(--primary-orange, var(--orange));
}

.auth-submit {
    position: relative;
    width: 100%;
    min-height: 52px;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        var(--primary-orange, var(--orange)),
        var(--primary-orange-dark, var(--orange-dark))
    );
    color: var(--white);
    font-family: var(--auth-font-display);
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(249, 115, 22, .20);
}

.auth-submit:hover {
    transform: translateY(-2px);
}

.auth-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-switch {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--auth-muted);
    font-size: .88rem;
    line-height: 1.5;
    text-align: center;
}

.auth-switch .auth-text-link {
    margin-left: 3px;
}

.auth-panel .admin-login-button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 11px;
    background: var(--navy);
    color: var(--white) !important;
    text-decoration: none !important;
    font-weight: 800;
}

.auth-panel .admin-login-button:hover {
    background: var(--navy-3);
    transform: translateY(-1px);
}

body.auth-layout #sidebar,
body.auth-layout #sidebarOverlay,
body.auth-layout .bottom-nav,
body.auth-layout .topbar {
    display: none !important;
}


/* =========================================================
   AUTHENTICATION ANIMATIONS
========================================================= */

@keyframes authRise {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authPanelIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* =========================================================
   DESKTOP
========================================================= */

@media screen and (min-width: 901px) {

    html,
    body {
        width: 100%;
        min-width: 0;
        max-width: none !important;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.authenticated-layout .app,
    body.authenticated-layout #app,
    body.authenticated-layout .app-shell,
    body.authenticated-layout .application-shell,
    body.authenticated-layout .main-app {
        position: relative !important;
        width: calc(100vw - var(--sidebar-width)) !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 100vh !important;
        margin: 0 0 0 var(--sidebar-width) !important;
        padding: 0 !important;
        display: block !important;
        border-radius: 0 !important;
        background: var(--page-background) !important;
        box-shadow: none !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    body.authenticated-layout #sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: var(--sidebar-width) !important;
        height: 100vh !important;
        min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 5000 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body.authenticated-layout .page {
        position: relative !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 100vh !important;
        margin: 0 !important;
        padding-bottom: 40px !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    body.authenticated-layout .topbar,
    body.authenticated-layout .page-header {
        width: 100% !important;
        max-width: none !important;
        min-height: 70px;
        padding-left: 30px !important;
        padding-right: 30px !important;
    }

    body.authenticated-layout .page-content,
    body.authenticated-layout .home-content,
    body.authenticated-layout #walletPage .wallet-container,
    body.authenticated-layout .reseller-container {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 30px !important;
    }

    body.authenticated-layout .wallet-card,
    body.authenticated-layout .purchase-card,
    body.authenticated-layout .balance-card,
    body.authenticated-layout .reseller-header-card,
    body.authenticated-layout .reseller-steps-card,
    body.authenticated-layout .affiliate-link-card,
    body.authenticated-layout .wallet-activity-card,
    body.authenticated-layout .affiliate-withdrawal-card {
        width: 100% !important;
        max-width: none !important;
    }

    body.authenticated-layout #resellerPricingWorkspace {
        width: 100% !important;
        max-width: none !important;
        display: block !important;
    }

    body.authenticated-layout .reseller-package-grid,
    body.authenticated-layout .package-grid,
    body.authenticated-layout .network-grid,
    body.authenticated-layout .packages-grid {
        width: 100% !important;
        max-width: none !important;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)) !important;
        gap: 20px !important;
    }

    body.authenticated-layout #sidebarOverlay,
    body.authenticated-layout #sidebarOverlay.active,
    body.authenticated-layout #sidebar .sidebar-close,
    body.authenticated-layout .bottom-nav {
        display: none !important;
    }

    /* Authentication layout */

    body.auth-layout .auth-layout {
        width: min(500px, calc(100% - 40px)) !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 24px !important;
        padding: 30px 0 !important;
    }

    body.auth-layout .auth-brand {
        width: 100% !important;
        text-align: center !important;
    }

    body.auth-layout .auth-panel {
        width: 100% !important;
        max-width: 460px !important;
        margin: 0 auto !important;
    }

    /* Affiliate desktop form layout */

    #affiliateWithdrawalForm {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
        row-gap: 0;
    }

    #affiliateWithdrawalForm > div {
        min-width: 0;
    }

    #affiliateWithdrawalForm > div:nth-last-child(3),
    #affiliateWithdrawalForm > div:nth-last-child(2),
    #affiliateWithdrawalForm > div:last-child,
    #affiliateWithdrawalForm > div[style*="justify-content"],
    #affiliateWithdrawalMessage,
    #affiliateWithdrawalSubmit {
        grid-column: 1 / -1;
    }

    /* Affiliate card spacing */

    .affiliate-link-card,
    .wallet-activity-card {
        padding-left: 30px;
        padding-right: 30px;
    }
}


/* =========================================================
   MOBILE ORDERS / INBOX
========================================================= */

@media (max-width: 768px) {

    #ordersPage,
    #inboxPage {
        padding-bottom: 85px;
    }

    #ordersPage .topbar,
    #inboxPage .topbar {
        gap: 10px;
        padding-left: 14px;
        padding-right: 14px;
    }

    #ordersPage .page-content,
    #inboxPage .page-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .transaction-card {
        gap: 10px;
        padding: 12px;
    }

    #inboxList > div {
        padding: 14px !important;
    }
}
/* =========================================================
   TABLET
========================================================= */

@media screen and (min-width: 768px) and (max-width: 900px) {

    html,
    body {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .app,
    #app,
    .app-shell,
    .application-shell,
    .main-app {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 100vh;
    }

    .menu-toggle,
    .mobile-menu-btn {
        display: inline-flex !important;
    }

    #sidebar {
        width: min(320px, 82vw);
        transform: translateX(-105%);
        visibility: visible;
        z-index: 5000;
    }

    #sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close,
    .bottom-nav {
        display: flex;
    }

    .page {
        width: 100%;
        max-width: none !important;
        min-height: 100vh;
        padding-bottom: calc(var(--mobile-nav-height) + 25px);
    }

    .page-header {
        padding-left: 20px;
        padding-right: 20px;
    }

    .home-content,
    .page-content,
    .reseller-container,
    #walletPage .wallet-container {
        width: 100% !important;
        max-width: none !important;
        padding: 22px;
    }

    /* Affiliate tablet */

    #walletPage .wallet-container {
        gap: 18px;
    }

    .balance-card {
        padding: 25px;
    }

    .stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 11px;
    }

    .stat {
        min-height: 88px;
        padding: 14px 9px;
    }

    .stat span {
        font-size: 18px;
    }

    .stat p {
        font-size: 10px;
    }

    .affiliate-withdrawal-card,
    .affiliate-link-card,
    .wallet-activity-card {
        padding: 22px !important;
        border-radius: 16px !important;
    }

    #affiliateWithdrawalForm {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 14px;
    }

    #affiliateWithdrawalForm > div {
        min-width: 0;
    }

    #affiliateWithdrawalForm > div[style*="justify-content"],
    #affiliateWithdrawalMessage,
    #affiliateWithdrawalSubmit {
        grid-column: 1 / -1;
    }

    .affiliate-link-row {
        flex-direction: row;
    }

    .affiliate-link-row input {
        min-width: 0;
    }

    .affiliate-share-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Authentication tablet */

    body.auth-layout .auth-shell {
        align-items: center;
        padding: 24px;
    }

    body.auth-layout .auth-layout {
        width: min(500px, calc(100% - 20px));
        min-height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 22px;
        padding: 25px 0;
    }

    body.auth-layout .auth-brand {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    body.auth-layout .auth-headline {
        font-size: clamp(2.8rem, 6vw, 4rem);
    }

    body.auth-layout .auth-support {
        max-width: 430px;
        margin: 0 auto;
        font-size: .92rem;
    }

    body.auth-layout .auth-panel {
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
        padding: 28px;
    }

    /* Reseller packages */

    .reseller-package-grid,
    .package-grid,
    .network-grid,
    .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}


/* =========================================================
   MOBILE
   ANDROID + IOS
========================================================= */

@media screen and (max-width: 767px) {

    html,
    body {
        width: 100%;
        min-width: 320px;
        overflow-x: hidden;
    }

    .app,
    #app,
    .app-shell,
    .application-shell,
    .main-app {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 100vh;
    }

    .menu-toggle,
    .mobile-menu-btn {
        display: inline-flex !important;
    }

    #sidebar {
        width: min(86vw, 310px);
        height: 100vh;
        transform: translateX(-105%);
        padding: 20px 14px calc(20px + env(safe-area-inset-bottom));
    }

    #sidebar.active {
        transform: translateX(0);
    }

    .sidebar-close,
    .bottom-nav {
        display: flex;
    }

    .page {
        width: 100%;
        max-width: none !important;
        min-height: 100vh;
        padding-bottom: calc(
            var(--mobile-nav-height) + 25px + env(safe-area-inset-bottom)
        );
    }

    .topbar,
    .page-header {
        min-height: 62px;
        padding: 10px 14px;
        gap: 10px;
    }

    .topbar-label {
        font-size: 9px;
    }

    .topbar-user .display-user-name {
        font-size: 14px;
    }

    #notificationBell {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .back-btn {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .page-title {
        font-size: 17px;
    }

    .home-content {
        width: 100%;
        padding: 15px;
    }


    /* =====================================================
       MOBILE WALLET CARD — PERSONAL USER THEME
    ===================================================== */

    .wallet-card {
        width: 100%;
        min-height: 160px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        margin: 0 0 15px;
        padding: 22px;
        border-radius: 17px;
        background: var(--primary-orange, #f97316);
        color: #ffffff;
    }

    .wallet-card h1 {
        font-size: 29px;
        color: inherit;
    }

    .wallet-card button {
        width: 100%;
    }

    .purchase-card {
        width: 100%;
        margin: 0;
        padding: 19px;
        border-radius: 16px;
    }

    .purchase-card h2 {
        font-size: 19px;
    }

    .page-content {
        width: 100%;
        padding: 18px 14px;
    }


    /* =====================================================
       MOBILE AFFILIATE PAGE
    ===================================================== */

    #walletPage {
        padding-bottom: calc(
            var(--mobile-nav-height) + 30px + env(safe-area-inset-bottom)
        );
    }

    #walletPage .wallet-container {
        width: 100%;
        padding: 15px;
        gap: 15px;
    }

    .balance-card {
        width: 100%;
        padding: 21px;
        border-radius: 17px;
    }

    .balance-content h1 {
        font-size: 29px;
    }

    .balance-content > p {
        font-size: 10px;
    }

    .stats-row {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 20px;
        padding-top: 18px;
    }

    .stat {
        width: 100%;
        min-height: 74px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 13px 15px;
        text-align: left;
        border-radius: 11px;
    }

    .stat span {
        font-size: 18px;
    }

    .stat p {
        margin-top: 0;
        font-size: 10px;
        text-align: right;
    }


    /* =====================================================
       MOBILE AFFILIATE WITHDRAWAL
    ===================================================== */

    .affiliate-withdrawal-card {
        width: 100% !important;
        margin-top: 5px !important;
        padding: 19px !important;
        border-radius: 16px !important;
    }

    .affiliate-withdrawal-card > div:first-child {
        align-items: flex-start;
        gap: 11px;
    }

    .affiliate-withdrawal-card > div:first-child > div:first-child {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        flex-basis: 42px;
        border-radius: 11px !important;
        font-size: 17px !important;
    }

    .affiliate-withdrawal-card h3 {
        font-size: 17px !important;
    }

    .affiliate-withdrawal-card > div:first-child p {
        font-size: 12px !important;
        line-height: 1.5;
    }

    .affiliate-withdrawal-card > div:nth-child(2) {
        margin-top: 17px !important;
        padding: 12px 13px !important;
        align-items: flex-start;
        font-size: 12px !important;
    }

    #affiliateWithdrawalForm {
        width: 100%;
        margin-top: 17px !important;
        display: flex;
        flex-direction: column;
    }

    #affiliateWithdrawalForm > div {
        width: 100%;
        margin-bottom: 14px !important;
    }

    #affiliateWithdrawalForm label {
        margin-bottom: 7px !important;
        font-size: 10px !important;
    }

    #affiliateWithdrawalForm input,
    #affiliateWithdrawalForm select {
        width: 100% !important;
        height: 48px !important;
        min-height: 48px !important;
        font-size: 13px !important;
    }

    #affiliateWithdrawalForm > div[style*="justify-content"] {
        width: 100%;
        min-height: 48px;
        margin-bottom: 14px !important;
        padding: 12px 13px !important;
    }

    #affiliateWithdrawalForm > div[style*="justify-content"] span {
        font-size: 11px;
    }

    #affiliateWithdrawalForm > div[style*="justify-content"] strong {
        font-size: 12px;
    }

    #affiliateWithdrawalMessage {
        margin-bottom: 14px !important;
    }

    #affiliateWithdrawalSubmit {
        width: 100% !important;
        min-height: 49px !important;
        height: 49px !important;
        font-size: 13px !important;
    }


    /* =====================================================
       MOBILE AFFILIATE LINK
    ===================================================== */

    .affiliate-link-card {
        width: 100%;
        padding: 20px;
        border-radius: 16px;
    }

    .affiliate-link-card h3 {
        font-size: 18px;
    }

    .affiliate-link-card p {
        font-size: 12px;
        line-height: 1.55;
    }

    .affiliate-link-row {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 9px;
    }

    .affiliate-link-row input,
    #affiliateLink {
        width: 100%;
        min-width: 0;
        height: 47px;
        min-height: 47px;
        font-size: 12px;
    }

    .affiliate-link-row button {
        width: 100%;
        min-width: 0;
        height: 47px;
        min-height: 47px;
    }

    .affiliate-share-row {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 10px;
    }

    .affiliate-share-row button {
        width: 100%;
        min-height: 45px;
    }


    /* =====================================================
       MOBILE AFFILIATE DASHBOARD
    ===================================================== */

    a.affiliate-link-card[href*="affiliate-dashboard"] {
        min-height: 82px;
        padding: 19px 20px !important;
        gap: 12px;
    }

    a.affiliate-link-card[href*="affiliate-dashboard"] strong {
        font-size: 15px;
    }

    a.affiliate-link-card[href*="affiliate-dashboard"] p {
        font-size: 11px;
    }

    a.affiliate-link-card[href*="affiliate-dashboard"] > i {
        font-size: 13px;
    }


    /* =====================================================
       MOBILE COMMISSION ACTIVITY
    ===================================================== */

    .wallet-activity-card {
        width: 100%;
        padding: 20px;
        border-radius: 16px;
    }

    .wallet-activity-card h3 {
        font-size: 18px;
    }

    .wallet-activity-card > div {
        min-height: 170px;
        margin-top: 15px;
        padding: 26px 14px !important;
        font-size: 12px;
    }

    .wallet-activity-card > div i {
        font-size: 27px !important;
    }


    /* =====================================================
       OTHER MOBILE PAGES
    ===================================================== */

    .reseller-container {
        width: 100%;
        padding: 15px;
    }

    .reseller-header-card,
    .reseller-steps-card {
        padding: 18px;
        border-radius: 15px;
    }

    .reseller-package-grid,
    .package-grid,
    .network-grid,
    .packages-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .transaction-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-pill {
        align-self: flex-start;
    }


    /* =====================================================
       MOBILE PROFILE IMAGE
    ===================================================== */

    #profilePage .profile-image-wrapper,
    .profile-image-wrapper {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        min-height: 100px !important;
        max-height: 100px !important;
        flex-basis: 100px;
    }

    #profilePage #userInitials,
    #userInitials {
        width: 100px !important;
        height: 100px !important;
        max-width: 100px !important;
        max-height: 100px !important;
        font-size: 27px;
    }

    #profilePage #userAvatar,
    #userAvatar {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px !important;
        min-height: 100px !important;
        max-width: 100px !important;
        max-height: 100px !important;
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }


    /* =====================================================
       MOBILE AUTHENTICATION
    ===================================================== */

    body.auth-layout .auth-shell {
        min-height: 100vh;
        align-items: flex-start;
        justify-content: center;
        padding:
            20px
            14px
            calc(20px + env(safe-area-inset-bottom));
        overflow-y: auto;
    }

    body.auth-layout .auth-layout {
        width: 100%;
        max-width: 470px;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        gap: 20px;
        padding: 15px 0;
    }

    body.auth-layout .auth-brand {
        width: 100%;
        text-align: center;
        padding: 5px 0;
    }

    body.auth-layout .auth-brand-mark {
        margin-bottom: 12px;
        padding: 6px 10px;
        font-size: 10px;
    }

    body.auth-layout .auth-headline {
        margin-bottom: 10px;
        font-size: clamp(2rem, 10vw, 2.7rem);
    }

    body.auth-layout .auth-headline::after {
        width: 45px;
        height: 4px;
        margin: 15px auto 0;
    }

    body.auth-layout .auth-support {
        max-width: 360px;
        margin: 0 auto;
        font-size: .86rem;
        line-height: 1.55;
    }

    body.auth-layout .auth-panel {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 24px 20px 25px;
        border-radius: 19px;
    }

    .auth-panel-head {
        margin-bottom: 21px;
    }

    .auth-panel-head h2 {
        font-size: 1.45rem;
    }

    .auth-field {
        margin-bottom: 14px;
    }

    .auth-panel input,
    .auth-panel select {
        min-height: 49px;
    }

    .auth-submit {
        min-height: 50px;
    }
}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media screen and (max-width: 380px) {

    .menu-toggle,
    .mobile-menu-btn {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .topbar,
    .page-header {
        padding-left: 11px;
        padding-right: 11px;
    }

    .wallet-card {
        padding: 19px;
    }

    .wallet-card h1 {
        font-size: 26px;
    }

    .purchase-card {
        padding: 16px;
    }

    .reseller-container {
        padding: 12px;
    }

    .reseller-header-card,
    .reseller-steps-card {
        padding: 15px;
    }


    /* Affiliate very small phone */

    #walletPage .wallet-container {
        padding: 12px;
        gap: 12px;
    }

    .balance-card {
        padding: 18px;
        border-radius: 15px;
    }

    .balance-content h1 {
        font-size: 26px;
    }

    .stats-row {
        gap: 8px;
        margin-top: 17px;
        padding-top: 16px;
    }

    .stat {
        min-height: 68px;
        padding: 11px 12px;
    }

    .stat span {
        font-size: 16px;
    }

    .stat p {
        font-size: 9px;
    }

    .affiliate-withdrawal-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    .affiliate-withdrawal-card h3 {
        font-size: 16px !important;
    }

    .affiliate-withdrawal-card > div:first-child p {
        font-size: 11px !important;
    }

    .affiliate-withdrawal-card > div:nth-child(2) {
        font-size: 11px !important;
        padding: 11px 12px !important;
    }

    #affiliateWithdrawalForm input,
    #affiliateWithdrawalForm select {
        height: 47px !important;
        min-height: 47px !important;
        font-size: 12px !important;
    }

    #affiliateWithdrawalSubmit {
        height: 48px !important;
        min-height: 48px !important;
        font-size: 12px !important;
    }

    .affiliate-link-card,
    .wallet-activity-card {
        padding: 16px;
        border-radius: 14px;
    }

    .affiliate-link-card h3,
    .wallet-activity-card h3 {
        font-size: 16px;
    }

    .affiliate-link-card p {
        font-size: 11px;
    }

    .affiliate-link-row input,
    #affiliateLink,
    .affiliate-link-row button {
        height: 46px;
        min-height: 46px;
    }

    .affiliate-share-row button {
        min-height: 43px;
        font-size: 11px;
    }

    a.affiliate-link-card[href*="affiliate-dashboard"] {
        padding: 17px 16px !important;
    }

    a.affiliate-link-card[href*="affiliate-dashboard"] strong {
        font-size: 14px;
    }

    a.affiliate-link-card[href*="affiliate-dashboard"] p {
        font-size: 10px;
    }

    .wallet-activity-card > div {
        min-height: 155px;
        padding: 22px 10px !important;
        font-size: 11px;
    }


    /* Profile image */

    #profilePage .profile-image-wrapper,
    .profile-image-wrapper {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px !important;
        max-width: 90px !important;
        min-height: 90px !important;
        max-height: 90px !important;
        flex-basis: 90px;
    }

    #profilePage #userInitials,
    #userInitials {
        width: 90px !important;
        height: 90px !important;
        max-width: 90px !important;
        max-height: 90px !important;
        font-size: 24px;
    }

    #profilePage #userAvatar,
    #userAvatar {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px !important;
        min-height: 90px !important;
        max-width: 90px !important;
        max-height: 90px !important;
    }


    /* Authentication */

    body.auth-layout .auth-shell {
        padding-left: 11px;
        padding-right: 11px;
    }

    body.auth-layout .auth-layout {
        gap: 16px;
        padding-top: 10px;
    }

    body.auth-layout .auth-brand-mark {
        margin-bottom: 8px;
    }

    body.auth-layout .auth-headline {
        font-size: 2rem;
    }

    body.auth-layout .auth-support {
        font-size: .82rem;
    }

    body.auth-layout .auth-panel {
        padding: 21px 16px 22px;
        border-radius: 17px;
    }

    .auth-panel-head h2 {
        font-size: 1.35rem;
    }

    .auth-panel input,
    .auth-panel select {
        min-height: 47px;
        padding: 11px 12px;
    }

    .auth-submit {
        min-height: 48px;
    }

    .bottom-nav button {
        min-width: 48px;
        font-size: 9px;
    }

    .bottom-nav i {
        font-size: 16px;
    }
}
/* =========================================================
   LARGE DESKTOP
========================================================= */

@media screen and (min-width: 1400px) {

    body.auth-layout .auth-layout {
        width: min(500px, calc(100% - 80px)) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 26px !important;
    }

    body.auth-layout .auth-panel {
        max-width: 460px;
    }

    #walletPage .wallet-container {
        padding: 36px;
        gap: 22px;
    }

    .affiliate-withdrawal-card,
    .affiliate-link-card,
    .wallet-activity-card {
        border-radius: 20px;
    }
}

@media screen and (min-width: 1600px) {

    :root {
        --sidebar-width: 290px;
    }

    body.authenticated-layout .app,
    body.authenticated-layout #app,
    body.authenticated-layout .app-shell,
    body.authenticated-layout .application-shell,
    body.authenticated-layout .main-app {
        width: calc(100vw - var(--sidebar-width)) !important;
        max-width: none !important;
        margin-left: var(--sidebar-width) !important;
    }

    body.authenticated-layout #sidebar {
        width: var(--sidebar-width) !important;
    }

    body.authenticated-layout .home-content,
    body.authenticated-layout .page-content,
    body.authenticated-layout #walletPage .wallet-container,
    body.authenticated-layout .reseller-container {
        padding-left: 40px !important;
        padding-right: 40px !important;
    }

    body.authenticated-layout .reseller-package-grid,
    body.authenticated-layout .package-grid,
    body.authenticated-layout .network-grid,
    body.authenticated-layout .packages-grid {
        grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    }

    body.auth-layout .auth-layout {
        width: min(500px, calc(100% - 100px)) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 28px !important;
    }

    body.auth-layout .auth-panel {
        max-width: 460px;
    }

    .stats-row {
        gap: 16px;
    }

    .stat {
        min-height: 100px;
        padding: 20px;
    }

    .stat span {
        font-size: 22px;
    }
}

/* =========================================================
   IOS / SAFARI
========================================================= */

@supports (-webkit-touch-callout: none) {

    html {
        min-height: -webkit-fill-available;
    }

    body,
    .page {
        min-height: -webkit-fill-available;
    }

    #sidebar {
        height: -webkit-fill-available;
    }

    .auth-page,
    .auth-shell {
        min-height: -webkit-fill-available;
    }

    .bottom-nav {
        padding-bottom: calc(
            7px + env(safe-area-inset-bottom)
        );
    }

    #walletPage {
        padding-bottom: calc(
            var(--mobile-nav-height) +
            30px +
            env(safe-area-inset-bottom)
        );
    }

    #affiliateWithdrawalForm input,
    #affiliateWithdrawalForm select,
    #affiliateLink {
        font-size: 16px !important;
    }

    .auth-panel input,
    .auth-panel select,
    .auth-panel textarea {
        font-size: 16px;
    }
}

/* =========================================================
   ACCESSIBILITY
========================================================= */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-light, #fb923c);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   QUEEN DATA HUB — MTN AFA PAGE STYLING
========================================================= */

#afaPage {
    width: 100%;
    min-width: 0;
    color: var(--text-dark, #1e293b);
}

#afaPage .page-content {
    padding: 22px;
}

/* AFA PAGE TOPBAR */

#afaPage .topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

#afaPage .topbar > div {
    flex: 1;
    min-width: 0;
}

/* SERVICE BANNER */

#afaPage .page-content > div:first-child {
    box-shadow: 0 8px 22px rgba(234, 88, 12, 0.14);
}

#afaPage .page-content > div:first-child h2 {
    font-size: 30px;
    font-weight: 800;
}

/* REGISTRATION FORM CARD */

#afaPage .page-content > div:nth-child(2),
#afaPage .page-content > div:nth-child(3) {
    background: var(--card-background, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 15px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

#afaPage h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-dark, #0f172a);
}

/* FORM LABELS */

#afaPage form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark, #334155);
    font-size: 13px;
    font-weight: 700;
}

/* FORM INPUTS */

#afaPage form input {
    display: block;
    width: 100%;
    min-height: 47px;
    padding: 11px 13px;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 9px;
    background: var(--input-background, #fff);
    color: var(--text-dark, #0f172a);
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

#afaPage form input:focus {
    border-color: var(--primary-orange, #f97316);
    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--primary-orange, #f97316) 12%,
        transparent
    );
}

#afaPage form input::placeholder {
    color: var(--text-muted, #94a3b8);
}

/* SUBMIT BUTTON */

#afaPage #afaSubmitButton {
    min-height: 49px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(
        135deg,
        var(--primary-orange, #f97316),
        var(--button-color, #ea580c)
    );
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}

#afaPage #afaSubmitButton:hover {
    filter: brightness(.96);
    transform: translateY(-1px);
}

#afaPage #afaSubmitButton:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* RESPONSE MESSAGE */

#afaPage #afaRegistrationMessage {
    line-height: 1.5;
}

#afaPage #afaRegistrationMessage.success {
    display: block !important;
    background: #dcfce7;
    color: #166534;
}

#afaPage #afaRegistrationMessage.error {
    display: block !important;
    background: #fee2e2;
    color: #991b1b;
}

#afaPage #afaRegistrationMessage.info {
    display: block !important;
    background: #dbeafe;
    color: #1e40af;
}

/* HISTORY */

#afaPage #afaHistoryList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#afaPage .afa-history-item {
    padding: 15px;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 11px;
    background: var(--card-background, #fff);
}

#afaPage .afa-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

#afaPage .afa-history-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

#afaPage .afa-history-details span {
    display: block;
    color: var(--text-muted, #64748b);
    font-size: 12px;
}

#afaPage .afa-history-details strong {
    display: block;
    margin-top: 4px;
    color: var(--text-dark, #334155);
    font-size: 13px;
    overflow-wrap: anywhere;
}

/* STATUS BADGES */

#afaPage .afa-status {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

#afaPage .afa-status.pending {
    background: #fef3c7;
    color: #92400e;
}

#afaPage .afa-status.processing {
    background: #dbeafe;
    color: #1d4ed8;
}

#afaPage .afa-status.registered {
    background: #dcfce7;
    color: #166534;
}

#afaPage .afa-status.failed,
#afaPage .afa-status.rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* REFRESH BUTTON */

#afaPage #refreshAfaHistory {
    font-size: 12px;
    transition: .2s ease;
}

#afaPage #refreshAfaHistory:hover {
    background: var(--orange-light, #ffedd5) !important;
}

/* MOBILE RESPONSIVENESS */

@media (max-width: 768px) {

    #afaPage .page-content {
        padding: 15px;
    }

    #afaPage .page-content > div:nth-child(2),
    #afaPage .page-content > div:nth-child(3) {
        padding: 17px;
    }

    #afaPage .page-content > div:first-child h2 {
        font-size: 26px;
    }
}

@media (max-width: 480px) {

    #afaPage .afa-history-details {
        grid-template-columns: 1fr;
    }

    #afaPage #refreshAfaHistory {
        width: 100%;
    }
}

/* =========================================================
   FINAL ORDERS / INBOX LAYOUT OVERRIDE
========================================================= */

body.authenticated-layout #ordersPage,
body.authenticated-layout #inboxPage {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body.authenticated-layout #ordersPage .topbar,
body.authenticated-layout #inboxPage .topbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body.authenticated-layout #ordersPage .topbar > div,
body.authenticated-layout #inboxPage .topbar > div {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

body.authenticated-layout #ordersPage .menu-toggle,
body.authenticated-layout #inboxPage .menu-toggle {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
}

body.authenticated-layout #ordersPage .page-content,
body.authenticated-layout #inboxPage .page-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

body.authenticated-layout #ordersList,
body.authenticated-layout #inboxList,
body.authenticated-layout #ordersPage .orders-scroll-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

body.authenticated-layout #inboxList > div {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere;
}

@media screen and (max-width: 900px) {

    body.authenticated-layout #ordersPage,
    body.authenticated-layout #inboxPage {
        padding-bottom: calc(
            var(--mobile-nav-height) +
            25px +
            env(safe-area-inset-bottom)
        ) !important;
    }

    body.authenticated-layout #ordersPage .topbar,
    body.authenticated-layout #inboxPage .topbar {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    body.authenticated-layout #ordersPage .page-content,
    body.authenticated-layout #inboxPage .page-content {
        padding: 18px 14px !important;
    }
}
/* =========================================================
   SIDEBAR SCROLL AND LOGOUT VISIBILITY
========================================================= */

#sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#sidebar .sidebar-navigation,
#sidebar .sidebar-nav {
    flex: 0 0 auto;
    min-height: auto;

    overflow: visible;
}

#sidebar .sidebar-footer,
#sidebar .logout-container {
    position: static;
    flex: 0 0 auto;

    margin-top: 16px;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));

    background: var(--sidebar-bg, #0f172a);
}

#sidebar .logout-btn {
    width: 100%;
    min-height: 48px;
    flex-shrink: 0;
    margin: 0;
}

/* SHORT MOBILE SCREENS */

@media (max-height: 620px) {
    #sidebar .profile-box {
        margin-bottom: 10px;
    }

    #sidebar .logout-container {
        padding-top: 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

/* MOBILE SIDEBAR PROFILE — CIRCULAR AVATAR */

@media (max-width: 767px) {
    #sidebar .profile-box .sidebar-profile-img,
    #sidebar .profile-box #sidebarAvatar,
    #sidebar .profile-box #sidebarInitials {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        max-width: 54px !important;
        max-height: 54px !important;

        aspect-ratio: 1 / 1;
        border-radius: 50% !important;
        object-fit: cover;
        flex-shrink: 0;
        box-sizing: border-box;
    }
}

/* DESKTOP SIDEBAR AVATAR — FORCE PERFECT CIRCLE */

@media (min-width: 769px) {
    #sidebar .sidebar-avatar-wrap {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        max-width: 54px !important;
        max-height: 54px !important;
        flex: 0 0 54px !important;
        aspect-ratio: 1 / 1;
        overflow: hidden !important;
        border-radius: 50% !important;
    }

    #sidebar .sidebar-profile-img,
    #sidebar #sidebarAvatar,
    #sidebar #sidebarInitials {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        max-width: 54px !important;
        max-height: 54px !important;
        aspect-ratio: 1 / 1;
        border-radius: 50% !important;
        object-fit: cover;
        box-sizing: border-box;
    }
}