/* ========================================
   MESSAGEHUB OSM
   LAYOUT
======================================== */


/* ========================================
   APP
======================================== */

.app {

    min-height: 100vh;

    display: flex;

    background: var(--bg-main);
}


/* ========================================
   SIDEBAR
======================================== */

.sidebar {

    width: 280px;

    min-width: 280px;

    min-height: 100vh;

    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    z-index: 1000;

    display: flex;

    flex-direction: column;

    background: var(--bg-sidebar);

    border-right: 1px solid var(--border);

    overflow-y: auto;

    transition:
        transform 0.25s ease;
}


/* ========================================
   BRAND
======================================== */

.brand {

    height: 136px;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 18px 20px;

    border-bottom: 1px solid var(--border);
}


.brand img {

    display: block;

    width: 190px;

    max-width: 100%;

    height: auto;

    object-fit: contain;
}


/* ========================================
   SIDEBAR MENU
======================================== */

.sidebar-menu {

    display: flex;

    flex-direction: column;

    gap: 3px;

    padding: 20px 16px 30px;
}


.menu-section {

    padding: 14px 16px 10px;

    color: var(--text-muted);

    font-size: 12px;

    font-weight: 500;

    letter-spacing: 0.5px;
}


/* ========================================
   MENU ITEM
======================================== */

.menu-item {

    min-height: 48px;

    width: 100%;

    display: flex;

    align-items: center;

    gap: 14px;

    padding: 0 14px;

    border: 1px solid transparent;

    border-radius: 10px;

    background: transparent;

    color: var(--text-primary);

    text-decoration: none;

    font-size: 15px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


.menu-item:hover {

    background: rgba(30, 94, 255, 0.08);

    border-color: rgba(30, 94, 255, 0.18);
}


.menu-item.active {

    background: rgba(30, 94, 255, 0.16);

    border-color: var(--blue);

    color: var(--text-primary);

    box-shadow:
        0 0 18px rgba(30, 94, 255, 0.08);
}


/* ========================================
   MENU ICON
======================================== */

.menu-icon {

    width: 20px;

    min-width: 20px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    color: var(--text-secondary);

    font-size: 16px;
}


.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {

    color: var(--text-primary);
}


/* ========================================
   MENU GROUP
======================================== */

.menu-group {

    width: 100%;
}


/* ========================================
   MENU PARENT
======================================== */

.menu-parent {

    font: inherit;

    text-align: left;

    cursor: pointer;
}


.menu-parent .menu-arrow {

    margin-left: auto;

    color: var(--text-secondary);

    font-size: 18px;

    line-height: 1;

    transition:
        transform 0.2s ease,
        color 0.2s ease;
}


.menu-parent.open .menu-arrow {

    transform: rotate(90deg);

    color: var(--blue-light);
}


/* ========================================
   SUBMENU
======================================== */

.submenu {

    display: none;

    width: 100%;

    padding: 4px 0 8px 42px;
}


.submenu.open {

    display: block;

    animation:
        submenuOpen 0.2s ease;
}


.submenu-item {

    min-height: 40px;

    width: 100%;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 12px;

    border-radius: 8px;

    color: var(--text-secondary);

    text-decoration: none;

    font-size: 14px;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.submenu-item:hover {

    background: rgba(30, 94, 255, 0.10);

    color: var(--text-primary);
}


.submenu-item .whatsapp {

    color: var(--whatsapp);
}


.submenu-item .telegram {

    color: var(--telegram);
}


.submenu-item .email {

    color: var(--email);
}


/* ========================================
   DIVIDER
======================================== */

.menu-divider {

    width: 100%;

    height: 1px;

    margin: 14px 0;

    background: var(--border);
}


/* ========================================
   MAIN
======================================== */

.main {

    width: calc(100% - 280px);

    min-height: 100vh;

    margin-left: 280px;

    display: flex;

    flex-direction: column;
}


/* ========================================
   TOPBAR
======================================== */

.topbar {

    height: 82px;

    min-height: 82px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    padding: 0 38px;

    background: var(--bg-main);

    border-bottom: 1px solid var(--border);
}


.topbar-left {

    display: flex;

    align-items: center;

    gap: 12px;
}


.topbar h1 {

    margin: 0;

    font-size: 28px;

    font-weight: 500;

    color: var(--text-primary);
}


.topbar-right {

    display: flex;

    align-items: center;

    gap: 18px;
}


/* ========================================
   NOTIFICATION
======================================== */

.notification {

    position: relative;

    width: 40px;

    height: 40px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 0;

    background: transparent;

    color: var(--text-primary);

    cursor: pointer;

    font-size: 20px;
}


.notification span {

    position: absolute;

    top: 8px;

    right: 8px;

    width: 7px;

    height: 7px;

    border-radius: 50%;

    background: var(--blue);
}


/* ========================================
   PROFILE
======================================== */

.profile {

    min-height: 44px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 5px 14px 5px 7px;

    border: 1px solid var(--border);

    border-radius: 24px;

    color: var(--text-primary);

    cursor: pointer;
}


.profile-avatar {

    width: 32px;

    height: 32px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 50%;

    background: rgba(30, 94, 255, 0.18);

    font-size: 16px;
}


.profile-arrow {

    color: var(--text-secondary);

    font-size: 13px;
}


/* ========================================
   CONTENT
======================================== */

.content {

    width: 100%;

    flex: 1;

    padding: 38px 42px 50px;
}


/* ========================================
   MOBILE MENU
======================================== */

.mobile-menu {

    display: none;

    width: 40px;

    height: 40px;

    align-items: center;

    justify-content: center;

    border: 0;

    background: transparent;

    color: var(--text-primary);

    font-size: 22px;

    cursor: pointer;
}


/* ========================================
   ANIMATION
======================================== */

@keyframes submenuOpen {

    from {

        opacity: 0;

        transform: translateY(-5px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 900px) {

    .sidebar {

        transform: translateX(-100%);
    }


    .sidebar.open {

        transform: translateX(0);
    }


    .main {

        width: 100%;

        margin-left: 0;
    }


    .mobile-menu {

        display: flex;
    }


    .topbar {

        padding: 0 20px;
    }


    .topbar h1 {

        font-size: 22px;
    }


    .content {

        padding: 28px 20px 40px;
    }

}


@media (max-width: 600px) {

    .topbar {

        height: 70px;

        min-height: 70px;
    }


    .topbar h1 {

        font-size: 20px;
    }


    .notification {

        display: none;
    }


    .profile {

        padding-right: 10px;
    }


    .profile > span:not(.profile-arrow) {

        display: none;
    }


    .content {

        padding: 22px 16px 35px;
    }

}