.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.sidebar {
    width: 190px;
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 1000;
}

.sidebar.mini {
    width: 60px;
}

.sidebar-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 15px;
}

.sidebar-logo {
    white-space: nowrap !important;
    font-size: 14px;
    line-height: 1.2;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--accent, #00f5ff);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.mini .sidebar-header {
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    color: var(--text-dim, #94a3b8);
    text-decoration: none;
    border-radius: 6px;
    margin: 0 10px 5px 10px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-icon {
    min-width: 24px;
    display: flex;
    justify-content: center;
    margin-right: 10px;
    font-size: 16px;
}

.sidebar.mini .nav-text,
.sidebar.mini .sidebar-logo {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.sidebar.mini .nav-link {
    justify-content: center;
}

.sidebar.mini .nav-icon {
    margin-right: 0;
}

.nav-text {
    transition: opacity 0.3s;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    /* Adjust for each page's specific layout */
}

/* Global sleek scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent, #00f5ff);
}

/* Responsive Sidebar Drawer for Mobile & Tablet */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 10000;
        width: 240px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    }

    /* Collapsed state on mobile: hide off-screen using left instead of transform */
    .sidebar.mini {
        width: 240px;
        left: -240px;
    }

    /* Make logo and text always visible inside the open drawer on mobile */
    .sidebar.mini .nav-text,
    .sidebar.mini .sidebar-logo {
        display: none;
    }

    .sidebar .nav-text,
    .sidebar .sidebar-logo {
        opacity: 1 !important;
        display: block !important;
        pointer-events: auto !important;
    }

    .sidebar .nav-link {
        justify-content: flex-start !important;
    }

    .sidebar .nav-icon {
        margin-right: 10px !important;
    }

    /* Float toggle button at top-left when sidebar is collapsed */
    .sidebar.mini .sidebar-toggle {
        position: fixed;
        left: 15px;
        top: 12px;
        z-index: 10001;
        background: rgba(15, 23, 42, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 6px;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(8px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }

    .sidebar-toggle {
        font-size: 16px;
    }

    /* Shift headers to the right to make room for floating toggle button */
    header,
    .hist-page-header {
        padding-left: 70px !important;
    }
}

/* Global Brand Header Typography */
.brand h1,
.hist-page-brand h1 {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    color: var(--accent) !important;
    letter-spacing: 0.5px !important;
}

.brand p,
.hist-page-brand p {
    font-family: 'Inter', sans-serif !important;
    color: var(--text-dim, #94a3b8) !important;
    font-size: 13px !important;
}