:root {
    --sidebar-width: 272px;
    --sidebar-background: #18212f;
    --sidebar-secondary: #222f40;
    --primary: #536dfe;
    --primary-dark: #3d54d9;
    --background: #f4f6fa;
    --text: #202632;
    --muted: #758093;
    --border: #e6eaf0;
}

html {
    position: relative;
    min-height: 100%;
    font-size: 14px;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    color: #fff;
    background: linear-gradient( 180deg, var(--sidebar-background), #111925);
    box-shadow: 8px 0 24px rgba(21, 31, 46, .12);
}

.sidebar-brand {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.brand-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
}

    .brand-link:hover {
        color: #fff;
    }

.brand-symbol {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient( 135deg, #6f86ff, #a76dff);
    box-shadow: 0 6px 15px rgba(83, 109, 254, .3);
    font-size: 1.35rem;
    font-weight: 800;
}

.brand-name,
.brand-store {
    display: block;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 750;
    line-height: 1.1;
}

.brand-store {
    margin-top: 4px;
    color: rgba(255, 255, 255, .55);
    font-size: .69rem;
    letter-spacing: .14em;
}

.sidebar-close {
    display: none;
    padding: 5px 8px;
    color: rgba(255, 255, 255, .7);
    border: 0;
    background: transparent;
    font-size: 1.7rem;
}

.sidebar-navigation {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 13px 12px 20px;
    scrollbar-width: thin;
}

.menu-section {
    margin-bottom: 17px;
}

.menu-title {
    padding: 7px 12px;
    color: rgba(255, 255, 255, .38);
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.menu-link {
    position: relative;
    display: flex;
    min-height: 43px;
    align-items: center;
    gap: 11px;
    margin: 3px 0;
    padding: 9px 12px;
    color: rgba(255, 255, 255, .72);
    border-radius: 10px;
    text-decoration: none;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

    .menu-link:hover {
        color: #fff;
        background: rgba(255, 255, 255, .08);
        transform: translateX(3px);
    }

    .menu-link.active {
        color: #fff;
        background: rgba(83, 109, 254, .26);
        box-shadow: inset 3px 0 0 #7b8dff;
    }

    .menu-link.menu-featured {
        color: #fff;
        background: linear-gradient( 135deg, var(--primary), #7b61e8);
    }

        .menu-link.menu-featured:hover {
            background: linear-gradient( 135deg, var(--primary-dark), #654bd5);
        }

.menu-icon {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: rgba(255, 255, 255, .09);
    font-size: 1rem;
    font-weight: 700;
}

.notification-badge {
    min-width: 22px;
    margin-left: auto;
    padding: 3px 6px;
    color: #fff;
    border-radius: 99px;
    background: #e84964;
    font-size: .68rem;
    font-weight: 700;
    text-align: center;
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    background: rgba(0, 0, 0, .09);
}

.sidebar-user {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
}

.user-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-weight: 700;
}

.user-information {
    min-width: 0;
}

.user-name {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: .8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-profile {
    color: rgba(255, 255, 255, .55);
    font-size: .73rem;
    text-decoration: none;
}

    .user-profile:hover {
        color: #fff;
    }

.logout-button {
    width: 100%;
    padding: 8px;
    color: rgba(255, 255, 255, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 9px;
    background: transparent;
    font-size: .78rem;
}

    .logout-button:hover {
        color: #fff;
        background: rgba(255, 255, 255, .07);
    }

.app-main {
    display: flex;
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    z-index: 1020;
    top: 0;
    display: flex;
    min-height: 70px;
    align-items: center;
    gap: 15px;
    padding: 10px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 2px 10px rgba(24, 33, 47, .04);
    backdrop-filter: blur(12px);
}

.menu-toggle {
    display: none;
    width: 41px;
    height: 41px;
    padding: 0;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    font-size: 1.25rem;
}

.topbar-title {
    min-width: 0;
}

.topbar-page,
.topbar-subtitle {
    display: block;
}

.topbar-page {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-subtitle {
    color: var(--muted);
    font-size: .75rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
}

.topbar-sale-button {
    padding: 9px 15px;
    color: #fff;
    border-radius: 10px;
    background: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

    .topbar-sale-button:hover {
        color: #fff;
        background: var(--primary-dark);
    }

.topbar-alert-button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #e84964;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    font-weight: 800;
}

.app-content {
    width: 100%;
    flex: 1;
    padding: 0 20px 28px;
    animation: content-in .25s ease-out;
}

.app-footer {
    padding: 18px 25px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: .78rem;
    text-align: center;
}

.sidebar-overlay {
    display: none;
}

.public-header {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
}

.public-brand {
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
}

.btn,
.form-control,
.form-select {
    border-radius: 9px;
}

    .form-control:focus,
    .form-select:focus,
    .form-check-input:focus {
        border-color: rgba(83, 109, 254, .55);
        box-shadow: 0 0 0 .22rem rgba(83, 109, 254, .13);
    }

.card {
    border-radius: 12px;
}

@keyframes content-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform .23s ease;
    }

    .sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 1030;
        inset: 0;
        display: block;
        visibility: hidden;
        background: rgba(10, 17, 28, .5);
        opacity: 0;
        transition: opacity .23s ease, visibility .23s ease;
    }

    .sidebar-open .sidebar-overlay {
        visibility: visible;
        opacity: 1;
    }

    .sidebar-open {
        overflow: hidden;
    }

    .app-main {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .app-content {
        padding-right: 13px;
        padding-left: 13px;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        min-height: 62px;
        padding: 9px 12px;
    }

    .topbar-subtitle {
        display: none;
    }

    .topbar-sale-button {
        padding: 9px 11px;
        font-size: .78rem;
    }

    .topbar-alert-button {
        display: none;
    }

    .app-content {
        padding-bottom: 18px;
    }
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 12px;
    color: #526071;
    border: 1px solid #dfe4ea;
    border-radius: 999px;
    background: #fff;
    font-size: .78rem;
    font-weight: 650;
    box-shadow: 0 3px 12px rgba(22, 34, 51, .06);
    transition: color .25s ease, border-color .25s ease, background-color .25s ease;
}

.connection-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: #9ca3af;
}

.connection-status.is-checking .connection-dot {
    animation: connection-pulse 1.2s infinite;
}

.connection-status.is-online {
    color: #087443;
    border-color: #b9e6ce;
    background: #effbf4;
}

    .connection-status.is-online .connection-dot {
        background: #16a065;
        box-shadow: 0 0 0 4px rgba(22, 160, 101, .13);
    }

.connection-status.is-slow {
    color: #8a5a00;
    border-color: #f1d38d;
    background: #fff9e9;
}

    .connection-status.is-slow .connection-dot {
        background: #e4a11b;
        box-shadow: 0 0 0 4px rgba(228, 161, 27, .15);
    }

.connection-status.is-offline {
    color: #b42318;
    border-color: #f0b8b4;
    background: #fff2f1;
}

    .connection-status.is-offline .connection-dot {
        background: #d92d20;
        box-shadow: 0 0 0 4px rgba(217, 45, 32, .13);
    }

@keyframes connection-pulse {
    50% {
        opacity: .35;
        transform: scale(.8);
    }
}

@media (max-width: 575px) {
    .connection-status {
        padding: 7px 9px;
    }

        .connection-status .connection-text {
            font-size: .72rem;
        }
}
