﻿html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

body {
    color: #000;
    font-weight: 400;
    font-size: 0.85rem;
    overflow: hidden;
    background: #ffffff;
    font-family: 'Roboto', Arial, sans-serif;
}

/* ==== TOPBAR ==== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    color: #fff;
    z-index: 1050;
    display: flex;
    padding: 0 20px;
    background: #000;
    align-items: center;
    justify-content: space-between;
}

.topbar .left-info {
    gap: 10px;
    display: flex;
    align-items: center;
}

#toggleSidebar {
    font-size: 20px;
    cursor: pointer;
}

.topbar .left-info strong {
    font-size: 14px;
}

.topbar .left-info small {
    color: #ccc;
    font-size: 12px;
}

.topbar .right-text {
    text-align: right;
    font-size: 13px;
    line-height: 1.2;
}

.topbar .right-text strong {
    font-size: 14px;
}

/* ==== SIDEBAR ==== */
.sidebar {
    position: fixed;
    top: 80px;
    left: 12px;
    bottom: 20px;
    width: 260px;
    z-index: 999;
    overflow: hidden;
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1), 0 0 6px rgba(0, 0, 0, 0.08);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 10px;
    max-height: calc(100vh - 140px);
}

.sidebar:hover {
    overflow-y: auto;
}

.sidebar.closed {
    width: 0;
    opacity: 0;
    overflow: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

/* ==== MOBILE ==== */
@media (max-width: 768px) {
    .sidebar {
        left: -270px;
    }

    .sidebar.open {
        left: 10px;
    }
}

/* Profile */
.sidebar-content .profile {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid #d1d1d1;
}

.sidebar-content .profile img {
    height: 80px;
    width: auto;
    margin-bottom: 10px;
}

.sidebar-content .profile h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    overflow:hidden;
}

.sidebar-content .profile p {
    margin: 2px 0 0;
    font-size: 0.7rem;
    color: #666;
    overflow:hidden;
}

/* Menu */
.sidebar-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-content > ul > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: #333;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-content ul li a:hover {
    background: #e7f1fc;
    border-radius: 10px;
    color: #0b5ed7;
}

.menu-text {
    display: flex;
    align-items: center;
}

.menu-text i {
    width: 22px;
    text-align: center;
    margin-right: 10px;
    font-size:0.9rem;
    transition: all 0.4s ease;
}

.sidebar-content ul li a:hover .menu-text i,
.submenu a:hover i {
    transform: scale(1.15);
    color: #0b5ed7;
}

.arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sidebar-content ul li.open > a .arrow {
    transform: rotate(90deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    background: #f9fcff;
    transition: all 0.3s ease;
    padding: 0;
    margin-left: 20px;
}

.sidebar-content ul li.open .submenu {
    max-height: 300px;
    padding: 5px 0;
}

.submenu a {
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    gap: 10px;
    padding: 8px 20px;
    font-size: 0.75rem;
    color: #444;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    text-align: left;
}

.submenu a:hover {
    background: #e6f0fa;
    color: #0b5ed7;
    transform: translateX(4px);
}

/* Bottom icons */
.sidebar .bottom-icons {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(6px);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid #ccc;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.sidebar .bottom-icons i {
    font-size: 1.2rem;
    color: #000;
    cursor: pointer;
    transition: all 0.4s ease;
}

.sidebar .bottom-icons i:hover {
    transform: scale(1.15);
}

/* Content */
.content {
    flex: 1;
    margin-left: 280px;
    margin-top:70px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transition: margin-left 0.3s;
}

.sidebar.closed ~ .content {
    margin-left: 40px;
}

@media (max-width: 768px) {
    .content {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        width: 100%;
        height: auto;
        overflow-y: auto;
        overflow-x: auto;
    }
}