﻿:root {
    --navy: #001f48;
    --logo-dark: #15447e;
    --logo-blue: #3059f3;
    --pill: #ffffff;
    --ui-scale: 0.75;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

    body.byke-admin-body {
        overflow: hidden;
        background: #ffffff;
        color: var(--navy);
        font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    }

/* The reference was designed at a 75% internal UI scale. */
.app-scale {
    width: calc(100vw / var(--ui-scale));
    height: calc(100vh / var(--ui-scale));
    overflow: hidden;
    zoom: var(--ui-scale);
}

.stage {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sidebar {
    position: relative;
    width: 286px;
    flex: 0 0 286px;
    overflow: hidden;
    background: var(--navy);
    transition: width 0.34s cubic-bezier(0.4, 0, 0.2, 1), flex-basis 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #c7e4ff 100%);
}

/* Top bar */
.topbar {
    height: 82px;
    flex: 0 0 82px;
    padding: 0 30px 0 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    background: #ffffff;
}

.hamburger {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: background 0.18s ease;
}

    .hamburger:hover {
        background: rgba(48, 89, 243, 0.08);
    }

    .hamburger span {
        display: block;
        width: 24px;
        height: 2.5px;
        margin: 0;
        border-radius: 2px;
        background: var(--navy);
        transform-origin: center;
        transition: width 0.28s ease;
    }

    .hamburger.is-collapsed span:nth-child(1),
    .hamburger.is-collapsed span:nth-child(3) {
        width: 22px;
    }

    .hamburger.is-collapsed span:nth-child(2) {
        width: 16px;
    }

.topbar .spacer {
    flex: 1;
}

.tb-date {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #1a2b45;
    font-size: 17px;
    font-weight: 500;
}

    .tb-date svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: #44506a;
        stroke-width: 1.8;
    }

.tb-divider {
    width: 1px;
    height: 34px;
    margin: 0 22px;
    background: rgba(0, 0, 0, 0.15);
}

.tb-bell {
    position: relative;
    margin-right: 26px;
    padding: 0;
    border: 0;
    background: transparent;
}

    .tb-bell svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: var(--navy);
        stroke-width: 1.8;
    }

    .tb-bell .notification-badge {
        position: absolute;
        top: -7px;
        right: -8px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #ffffff;
        border-radius: 50%;
        background: var(--logo-blue);
        color: #ffffff;
        font-size: 11px;
        font-weight: 700;
    }

.tb-user {
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--navy);
    font-family: inherit;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.6px;
}

    .tb-user::after {
        margin-left: 10px;
    }

/* Sidebar logo */
.logo-card {
    position: relative;
    z-index: 3;
    height: 96px;
    margin: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0 0 22px 22px;
    background: #ffffff;
    transition: margin 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo {
    font-family: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

    .logo .byke {
        color: var(--logo-dark);
    }

    .logo .lease {
        color: var(--logo-blue);
    }

.logo-full,
.logo-mini,
.nav-item span {
    transition: opacity 0.22s ease, transform 0.34s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    opacity: 1;
    transform: scale(1);
}

.logo-mini {
    position: absolute;
    width: 56px;
    height: 56px;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.72);
    pointer-events: none;
}

/* Sidebar navigation */
.sidebar .nav {
    position: relative;
    margin-top: 26px;
    padding: 0;
    display: block;
    overflow: visible;
}

.pill {
    position: absolute;
    z-index: 1;
    right: 0;
    left: 16px;
    height: 58px;
    border-radius: 29px 0 0 29px;
    background: var(--pill);
    pointer-events: none;
    transition: top 0.38s cubic-bezier(0.34, 1.4, 0.5, 1);
}

    .pill::before,
    .pill::after {
        position: absolute;
        right: 0;
        width: 30px;
        height: 30px;
        content: "";
        pointer-events: none;
    }

    .pill::before {
        top: -30px;
        border-bottom-right-radius: 30px;
        box-shadow: 15px 15px 0 15px var(--pill);
    }

    .pill::after {
        bottom: -30px;
        border-top-right-radius: 30px;
        box-shadow: 15px -15px 0 15px var(--pill);
    }

.sidebar .nav-item {
    position: relative;
    z-index: 2;
    min-width: 0;
    min-height: 58px;
    margin: 0 0 0 16px;
    padding: 0 18px 0 34px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 29px 0 0 29px;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease, width 0.34s cubic-bezier(0.4, 0, 0.2, 1), padding 0.34s cubic-bezier(0.4, 0, 0.2, 1), gap 0.34s cubic-bezier(0.4, 0, 0.2, 1);
}

    .sidebar .nav-item svg {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
    }

    .sidebar .nav-item span {
        display: block;
        max-width: 170px;
        overflow: hidden;
        white-space: nowrap;
        opacity: 1;
        transform: translateX(0);
    }

    .sidebar .nav-item:hover:not(.active) {
        color: #cfe0f7;
    }

    .sidebar .nav-item.active {
        padding-right: 28px;
        background: transparent;
        color: var(--navy);
    }

/* Mini sidebar */
.sidebar.collapsed {
    width: 96px;
    flex-basis: 96px;
}

    .sidebar.collapsed .logo-card {
        margin-right: 10px;
        margin-left: 10px;
    }

    .sidebar.collapsed .logo-full {
        opacity: 0;
        transform: scale(0.72);
        pointer-events: none;
    }

    .sidebar.collapsed .logo-mini {
        opacity: 1;
        transform: scale(1);
    }

    .sidebar.collapsed .nav-item {
        width: 80px;
        min-width: 80px;
        padding-right: 0;
        padding-left: 0;
        justify-content: center;
        gap: 0;
    }

        .sidebar.collapsed .nav-item span {
            max-width: 0;
            opacity: 0;
            transform: translateX(-7px);
            pointer-events: none;
        }

        .sidebar.collapsed .nav-item svg {
            width: 23px;
            height: 23px;
        }

    .sidebar.collapsed .pill {
        right: 0;
        left: 16px;
    }

/* Apply the stored mini state before normal JavaScript completes. */
html.sidebar-precollapsed .sidebar {
    width: 96px;
    flex-basis: 96px;
}

    html.sidebar-precollapsed .sidebar .logo-card {
        margin-right: 10px;
        margin-left: 10px;
    }

    html.sidebar-precollapsed .sidebar .logo-full {
        opacity: 0;
        transform: scale(0.72);
        pointer-events: none;
    }

    html.sidebar-precollapsed .sidebar .logo-mini {
        opacity: 1;
        transform: scale(1);
    }

    html.sidebar-precollapsed .sidebar .nav-item {
        width: 80px;
        min-width: 80px;
        padding-right: 0;
        padding-left: 0;
        justify-content: center;
        gap: 0;
    }

        html.sidebar-precollapsed .sidebar .nav-item span {
            max-width: 0;
            opacity: 0;
            transform: translateX(-7px);
            pointer-events: none;
        }

        html.sidebar-precollapsed .sidebar .nav-item svg {
            width: 23px;
            height: 23px;
        }

/* Reusable content container for non-dashboard pages. */
.content {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
}

    .content::-webkit-scrollbar,
    .dashboard-content::-webkit-scrollbar {
        width: 10px;
    }

    .content::-webkit-scrollbar-thumb,
    .dashboard-content::-webkit-scrollbar-thumb {
        border-radius: 8px;
        background: rgba(0, 31, 72, 0.18);
    }

@media (max-width: 900px) {
    :root {
        --ui-scale: 1;
    }

    .app-scale {
        width: 100vw;
        height: 100vh;
        zoom: 1;
    }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        width: 286px;
        flex-basis: 286px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 286px;
        flex-basis: 286px;
    }

        .sidebar.collapsed .logo-full {
            opacity: 1;
            transform: scale(1);
        }

        .sidebar.collapsed .logo-mini {
            opacity: 0;
        }

        .sidebar.collapsed .nav-item {
            width: auto;
            min-width: 0;
            padding: 0 18px 0 34px;
            justify-content: flex-start;
            gap: 14px;
        }

            .sidebar.collapsed .nav-item span {
                max-width: 170px;
                opacity: 1;
                transform: none;
            }

    .topbar {
        padding: 0 18px;
    }

    .tb-date,
    .tb-divider {
        display: none;
    }
}

/* Administration submenu */
.sidebar .nav-group {
    position: static;
}

.sidebar .nav-group-toggle {
	width: calc(100% - 16px);
	border: 0;
	text-align: left;
}

.sidebar .nav-group-chevron {
	margin-left: auto;
	font-size: 18px;
	transition: transform 0.2s ease;
}

.sidebar .nav-group.open .nav-group-chevron {
	transform: rotate(180deg);
}

.sidebar .nav-submenu {
	display: none;
	margin: 2px 16px 10px 50px;
	padding: 6px 0 6px 14px;
	border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.sidebar .nav-group.open .nav-submenu {
	display: grid;
	gap: 2px;
}

.sidebar .nav-submenu-item {
	padding: 8px 10px;
	border-radius: 7px;
	color: rgba(255, 255, 255, 0.82);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.35px;
	text-decoration: none;
	text-transform: uppercase;
}

.sidebar .nav-submenu-item:hover,
.sidebar .nav-submenu-item.active {
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
}

.sidebar.collapsed .nav-submenu,
html.sidebar-precollapsed .sidebar .nav-submenu {
	display: none;
}

.sidebar.collapsed .nav-group-chevron,
html.sidebar-precollapsed .sidebar .nav-group-chevron {
	display: none;
}

.sidebar .nav-submenu {
    position: relative;
    display: grid;
    gap: 2px;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: max-height .34s ease, margin-bottom .34s ease, padding .34s ease, opacity .24s ease, transform .34s ease, visibility 0s linear .34s;
}

.sidebar .nav-group.open .nav-submenu {
    max-height: var(--administration-submenu-height, 720px);
    margin-bottom: 10px;
    padding-top: 6px;
    padding-bottom: 6px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: max-height .34s ease, margin-bottom .34s ease, padding .34s ease, opacity .24s ease, transform .34s ease, visibility 0s;
}

.sidebar .byke-submenu-pill {
    position: absolute;
    z-index: 0;
    left: 2px;
    right: 2px;
    top: 0;
    height: 32px;
    border-left: 3px solid rgba(255,255,255,.8);
    border-radius: 7px;
    background: rgba(255,255,255,.14);
    opacity: 0;
    pointer-events: none;
    transition: top .36s cubic-bezier(.25,.8,.25,1), height .22s ease, opacity .2s ease;
}

.sidebar .nav-submenu-item {
    position: relative;
    z-index: 1;
    transition: color .2s ease, background-color .2s ease;
}

    /* The animated pill is the active background; do not paint two backgrounds. */
    .sidebar .nav-submenu-item.active {
        background: transparent;
        color: #ffffff;
    }

.sidebar.collapsed .nav-submenu,
html.sidebar-precollapsed .sidebar .nav-submenu {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar .nav-submenu,
    .sidebar .nav-group.open .nav-submenu,
    .sidebar .byke-submenu-pill {
        transition: none;
    }
}

/* Keep the sidebar bounded to the app height. */
.sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

    /* Keep the logo above the scrolling menu. */
    .sidebar .logo-card {
        flex-shrink: 0;
    }

    /* Scroll the navigation independently. */
    .sidebar .nav {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior-y: contain;
        padding-bottom: 20px;
    }

    /* Let the outer navigation scroll all submenu items. */
    .sidebar .nav-group.open .nav-submenu {
        max-height: none;
    }                                                                                                                                                                           

/* Keep the main page independently scrollable. */
.main {
    min-height: 0;
}

    .main > .content,
    .main > .dashboard-content {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

/* Remove the native scrollbar and its reserved space. */
.sidebar .nav {
    scrollbar-width: none;
    scrollbar-gutter: auto;
}

    .sidebar .nav::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

/* Visual indicator overlays the menu without changing its width. */
.byke-sidebar-scroll-thumb {
    position: absolute;
    right: 3px;
    width: 4px;
    border-radius: 999px;
    background: #7690ff;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s ease;
}

    .byke-sidebar-scroll-thumb.is-visible {
        opacity: 1;
    }