/* ===== SIDEBAR ===== */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --sidebar-bg: #1a1a2e;
    --sidebar-hover: #16213e;
    --sidebar-active: #0f3460;
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --sidebar-accent: #FF6600;
    --topbar-height: 60px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    transition: left 0.3s ease;
}

.topbar .menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.topbar .menu-toggle:hover {
    background: #f0f0f0;
}

.topbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.topbar-brand span {
    color: var(--sidebar-accent);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.9rem;
}

.topbar-user .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sidebar-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1100;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--sidebar-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-header .logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-header .logo-sub {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    font-weight: 400;
}

/* Nav */
.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-nav .nav-section {
    padding: 8px 20px 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.25);
}

.sidebar-nav .nav-item {
    padding: 0 12px;
    margin: 2px 0;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
}

.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--sidebar-accent);
    border-radius: 0 4px 4px 0;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-footer .version {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.2);
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content .content-wrapper {
    padding: 24px;
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .topbar {
        left: 0;
    }

    .topbar .menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content .content-wrapper {
        padding: 16px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 70px;
    }

    .sidebar-header .logo-text,
    .sidebar-header .logo-sub,
    .sidebar-nav .nav-section,
    .sidebar-nav .nav-link span,
    .sidebar-footer .version {
        display: none;
    }

    .sidebar-nav .nav-link {
        justify-content: center;
        padding: 12px;
    }

    .sidebar-nav .nav-link i {
        font-size: 1.1rem;
    }

    .sidebar-nav .nav-link .badge {
        display: none;
    }

    .topbar-brand span:last-child {
        display: none;
    }
}
