/* ==================================================
   PAGE LAYOUT
================================================== */
.page-wrap {
    min-height: 100vh;
    margin-left: 190px;
    padding: 28px 32px;
    color: #f9fafb;
}

.page-inner {
    max-width: 1800px;
    margin: 0 auto;
}
/* ==================================================
   SIDEBAR
================================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 190px;
    height: 100vh;
    background: linear-gradient(
        180deg,
        #0f0f12 0%,
        #14141a 45%,
        #0b0b0e 100%
    );
    border-right: 1px solid #27272f;
    z-index: 2000;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.16);
}

.topbar-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ==================================================
   LOGO
================================================== */
.topbar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 68px;
    padding: 14px 12px 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-logo {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}

.topbar-logo-mark {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}

.topbar-logo-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
    color: #f9fafb;
}

/* ==================================================
   MENU AREA
================================================== */
.topbar-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 10px 8px;
}

.topbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topbar-section {
    list-style: none;
}

.topbar-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 30px;
    margin: 8px 0 2px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-align: left;
}

.topbar-section:first-child .topbar-section-toggle {
    margin-top: 0;
}

.topbar-section-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e5e7eb;
}

.topbar-section-toggle i {
    font-size: 10px;
    transition: transform 0.15s ease;
}

.topbar-section.is-collapsed .topbar-section-toggle i {
    transform: rotate(-90deg);
}

.topbar-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topbar-section.is-collapsed .topbar-submenu {
    display: none;
}

/* ==================================================
   MENU ITEM
================================================== */
.topbar-item a {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #e5e7eb;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
}

.topbar-item.is-subitem a {
    min-height: 38px;
    padding: 9px 10px;
}

/* 아이콘 고정 규격 */
.topbar-item a i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 15px;
    color: #9ca3af;
    text-align: center;
    flex-shrink: 0;
}

.topbar-item.is-subitem a i {
    width: 22px;
    height: 22px;
    font-size: 14px;
}

/* 텍스트 */
.topbar-item a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
}

.topbar-item.is-subitem a span {
    font-size: 14px;
}

/* hover */
.topbar-item a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.topbar-item a:hover i {
    color: #e5e7eb;
}

/* ACTIVE */
.topbar-item.is-active a {
    background-color: #ec4899;
    box-shadow: 0 8px 18px rgba(236, 72, 153, 0.26);
}

.topbar-item.is-active a span {
    color:white;
    font-weight: 700;
}

.topbar-item.is-active a i {
    color: white;
}

/* ==================================================
   LOGOUT (BOTTOM)
================================================== */
.topbar-right {
    border-top: 1px solid #27272f;
    padding: 10px;
}

.topbar-right .topbar-item a {
    font-size: 13px;
    background-color: rgba(255, 255, 255, 0.04);
}

/* ==================================================
   RESPONSIVE
================================================== */
@media (max-width: 1024px) {
    .page-wrap {
        margin-left: 190px;
        padding: 24px;
    }

    .topbar {
        width: 190px;
    }
}

@media (max-width: 768px) {
    .page-wrap {
        margin-left: 190px;
        padding: 20px;
    }

    .topbar {
        width: 190px;
    }
}

@media (max-width: 640px) {
    .page-wrap {
        margin-left: 0;
        padding: 16px;
    }
}
/* =========================
   RESPONSIVE
========================= */
.topbar {
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .topbar {
        width: 190px;
    }

    .page-wrap {
        margin-left: 190px;
    }
}
.topbar-toggle{
    display:none;
}
@media (max-width: 640px) {
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 220px;
        transform: translateX(-100%);
        z-index: 1000;
    }

    .topbar.is-open {
        transform: translateX(0);
    }

    .page-wrap {
        margin-left: 0;
        padding-top:60px;
        background: url(/static/style/2/main-bg.jpg) top center / 100% 80vh no-repeat, #f5f6f8;
    }

    .topbar-toggle {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1100;
        background: #fff;
        border: none;
        font-size: 20px;
        padding: 8px 10px;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        display:block;
    }
}

.topbar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* topbar 열렸을 때 */
.topbar.is-open + .topbar-overlay {
    opacity: 1;
    pointer-events: auto;
}
