/* ===== App Topbar ===== */

@media print { 
    header {
        display: none !important;
    }
}
header {
    height: 72px;
    width: 100%;
    background-color: var(--orange2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 8px rgba(0,0,0,0.35);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;
    padding: 0 16px;
}

.logoDiv img {
    display: block;
}

.message-bell {
    text-decoration: none;
    color: var(--blue1);
    font-size: 24px;
    line-height: 1;
}

.backbtn button {
    font-weight: bold;
    border-radius: 24px;
    white-space: nowrap;
}

/* ===== Sidebar ===== */
.app-sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    width: 280px;
    height: calc(100vh - 72px);
    background: linear-gradient(180deg, #2f356e 0%, #232851 100%);
    box-shadow: 2px 0 12px rgba(0,0,0,0.2);
    z-index: 1100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.28s ease, width 0.2s ease;
}

.sidebar-brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: .4px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.app-sidebar #menu {
    margin: 0;
    padding: 10px 8px 16px;
}

.app-sidebar #menu > li {
    list-style: none;
    margin: 4px 0;
    border-radius: 10px;
    overflow: hidden;
}

.app-sidebar #menu > li > a {
    display: block;
    text-decoration: none;
    color: #f5f7ff;
    font-weight: 600;
    padding: 10px 12px;
    transition: background-color .2s ease;
}

.app-sidebar #menu > li > a:hover {
    background-color: rgba(255,255,255,0.12);
}

.app-sidebar .havelist {
    color: #c9d1ff;
    font-weight: 700;
    padding: 10px 12px 4px;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}

.app-sidebar .havelist::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 10px;
    font-size: 13px;
    color: #dbe1ff;
    transition: transform .2s ease;
}

.app-sidebar .havelist.is-open::after {
    transform: rotate(180deg);
}

.app-sidebar .havelist > ul {
    margin: 0;
    padding: 0 0 0 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .24s ease, margin-top .2s ease;
}

.app-sidebar .havelist.is-open > ul {
    max-height: 900px;
    margin-top: 8px;
}

.app-sidebar .havelist > ul > li {
    list-style: none;
    margin-bottom: 4px;
}

.app-sidebar .havelist > ul > li > a {
    display: block;
    text-decoration: none;
    color: #f3f5ff;
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 500;
}

.app-sidebar .havelist > ul > li > a:hover {
    background-color: rgba(255,255,255,0.12);
}

.app-sidebar #menu a.active-link,
.app-sidebar .havelist > ul > li.active-item > a,
.app-sidebar #menu > li.active-item > a {
    background-color: var(--orange1);
    color: #fff;
}

.app-sidebar .havelist.active-group {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* ===== Layout offsets ===== */
body.has-app-layout {
    --sidebar-width: 280px;
    padding-top: 72px;
    padding-left: var(--sidebar-width);
}

body.has-app-layout main {
    margin-top: 1.25rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: min(1400px, calc(100% - 24px));
    padding-inline: clamp(6px, 1.2vw, 18px);
    transition: width 0.28s ease, padding 0.28s ease;
}

/* ===== Desktop collapse ===== */
body.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed {
    padding-left: 0;
}

body.sidebar-collapsed main {
    width: min(1400px, calc(100% - 24px));
}

/* ===== Burger ===== */
.parentOf3Divs {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    padding: 4px;
    cursor: pointer;
}

.parentOf3Divs .my3divs {
    width: 24px;
    height: 3px;
    background: var(--blue1);
    border-radius: 3px;
}

/* ===== Mobile drawer ===== */
.sidebar-overlay {
    position: fixed;
    inset: 72px 0 0 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: .2s ease;
    z-index: 1090;
}

@media only screen and (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    body.has-app-layout {
        padding-left: 0;
    }

    body.has-app-layout main {
        width: min(100%, calc(100% - 12px));
        padding-inline: clamp(6px, 2vw, 12px);
    }

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

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .loginOutDiv .backbtn button {
        padding: 8px 12px !important;
        font-size: 13px;
    }
}

@media only screen and (max-width: 575px) {
    header {
        padding: 0 10px;
    }

    .app-sidebar {
        width: 86vw;
        max-width: 320px;
    }

    .message-bell {
        font-size: 21px;
    }

    .loginOutDiv .backbtn button {
        padding: 6px 10px !important;
        font-size: 12px;
    }
}

@media print {
    .app-sidebar,
    .sidebar-overlay {
        display: none !important;
        visibility: hidden !important;
    }

    body.has-app-layout {
        padding-left: 0 !important;
    }

    body.has-app-layout main {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline: 0 !important;
    }
}

