/* ==================================================
   PAGE LAYOUT
================================================== */
.page-wrap {
    min-height: 100vh;
    margin-left: 220px;
    padding: 28px 32px;
    background: #f5f6f8;
    color: #111827;
}

.page-inner {
    max-width: 1800px;
    margin: 0 auto;
}

/* ==================================================
   SIDEBAR (TOPBAR)
================================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    z-index: 2000;
    transition: transform 0.3s ease;
}

.topbar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==================================================
   LOGO
================================================== */
.topbar-logo {
    display: flex;
    align-items: center;
    padding: 20px 24px;
}

.topbar-logo-mark {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.topbar-logo-text {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

/* ==================================================
   MENU AREA
================================================== */
.topbar-left {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.topbar-menu {
    list-style: none;
    margin: 0;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ==================================================
   MENU ITEM
================================================== */
.topbar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.topbar-item a i {
    width: 18px;
    font-size: 15px;
    color: #9ca3af;
    text-align: center;
}

/* hover */
.topbar-item a:hover {
    background-color: #f3f4f6;
}

.topbar-item a:hover i {
    color: #6d28d9;
}

/* ACTIVE */
.topbar-item.is-active a {
    background-color: #6d28d9;
}

.topbar-item.is-active a span {
    color: #ffffff;
    font-weight: 700;
}

.topbar-item.is-active a i {
    color: #ffffff;
}

/* ==================================================
   LOGOUT (BOTTOM)
================================================== */
.topbar-right {
    border-top: 1px solid #e5e7eb;
    padding: 8px 12px;
}

/* ==================================================
   RESPONSIVE
================================================== */
@media (max-width: 1024px) {
    .topbar {
        width: 200px;
    }
    .page-wrap {
        margin-left: 200px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .topbar {
        width: 180px;
    }
    .page-wrap {
        margin-left: 180px;
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .topbar {
        transform: translateX(-100%);
        width: 200px;
        z-index:9999;
    }

    .topbar.is-open {
        transform: translateX(0);
    }

    .page-wrap {
        margin-left: 0;
        padding: 16px;
        padding-top: 60px;
    }
}

/* ==================================================
   MOBILE TOGGLE
================================================== */
.topbar-toggle {
    display: none;
}

@media (max-width: 640px) {
    .topbar-toggle {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 2100;
        background: #ffffff;
        border: none;
        font-size: 20px;
        padding: 8px 10px;
        border-radius: 5px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        display: block;
    }
}

/* ==================================================
   OVERLAY
================================================== */
.topbar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.topbar.is-open + .topbar-overlay {
    opacity: 1;
    pointer-events: auto;
}
