:root {
    --topbar-height: 64px;
    --sidebar-width: 248px;
    --sidebar-collapse-width: 82px;
    --footer-height: 42px;

    --primary: #198754;
    --primary-dark: #146c43;
    --primary-light: #eaf7ef;
    --topbar: #075f4f;
    --topbar-2: #0b705d;

    --body: #f5f8f7;
    --white: #ffffff;
    --border: #dfe8e4;
    --text: #17352d;
    --muted: #6b7d77;

    --radius: 12px;
    --shadow: 0 3px 16px rgba(19, 57, 46, .08);
    --transition: .25s ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--body);
    color: var(--text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

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

.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: var(--topbar-height);
    padding: 0 12px;
    background: linear-gradient(90deg, var(--topbar), var(--topbar-2));
    display: flex;
    align-items: center;
    z-index: 1100;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .14);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 188px;
    min-width: 188px;
}

.topbar-center {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    margin-left: 2px;
    margin-right: 5px;
    overflow: visible;
}

.topbar-right {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

/* =========================================================
   LOGO
========================================================= */

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    min-width: 0;
}

.logo img {
    width: 46px;
    height: 46px;
    padding: 3px;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
}

.logo-text {
    line-height: 1.08;
}

.logo-title {
    font-size: 19px;
    font-weight: 800;
}

.logo-text small {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    opacity: .9;
}

/* =========================================================
   MOBILE TOPBAR BUTTON
========================================================= */

.topbar-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 9px;
}

.topbar-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .2);
}

/* =========================================================
   MEGA MENU
========================================================= */

.mega-menu {
    display: flex !important;
    align-items: center;
    gap: 1px;
    width: 100%;
    height: 100%;
    white-space: nowrap;
}

.mega-menu > .nav-item {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 0 0 auto;
}

.mega-menu .nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 9px !important;
    color: rgba(255, 255, 255, .97) !important;
    border-radius: 9px !important;
    font-size: 14px !important;
    font-weight: 650 !important;
    white-space: nowrap;
    transition: all .2s ease;
}

.mega-menu .nav-link i {
    font-size: 16px !important;
}

.mega-menu .nav-link:hover,
.mega-menu .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, .14) !important;
}

.mega-menu .dropdown-menu {
    min-width: 235px;
    margin-top: 5px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .15);
}

.mega-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    color: #30443e;
    border-radius: 8px;
    font-size: 14px;
}

.mega-menu .dropdown-item i {
    width: 20px;
    color: var(--primary);
    text-align: center;
}

.mega-menu .dropdown-item span {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.mega-menu .dropdown-item strong {
    font-size: 13px;
    font-weight: 650;
}

.mega-menu .dropdown-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.mega-menu .dropdown-item:hover {
    color: var(--primary-dark);
    background: var(--primary-light);
}

/* =========================================================
   USER MENU
========================================================= */

.user-menu {
    display: flex;
    align-items: center;
    max-width: 145px;
    padding: 4px 5px;
    color: #fff;
    border-radius: 10px;
}

.user-menu:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    color: var(--primary-dark);
    background: #dff7e9;
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    font-size: 19px;
}

.user-info {
    min-width: 0;
    margin-left: 7px;
    line-height: 1.15;
}

.user-name {
    display: block;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.user-info small {
    font-size: 10px;
    opacity: .85;
}

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

.main-wrapper {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
    padding-top: var(--topbar-height);
}

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

.sidebar {
    position: fixed;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    overflow: hidden;
    background: #fff;
    border-right: 1px solid var(--border);
    transition: width var(--transition), transform var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 15px;
    background: #eff8f2;
    border-bottom: 1px solid var(--border);
}

.sidebar-title {
    color: var(--primary-dark);
    font-size: 16px;
    font-weight: 700;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    color: var(--primary-dark);
    border-radius: 8px;
}

.sidebar-toggle:hover {
    color: #fff;
    background: var(--primary);
}

.sidebar-body {
    flex: 1;
    min-height: 0;
    padding: 12px;
    overflow: hidden;
}

.quick-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-menu .nav-link,
.mobile-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 14px;
    color: #4d5958;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 500;
    transition: all .2s ease;
}

.quick-menu .nav-link:hover,
.mobile-nav .nav-link:hover {
    color: var(--primary-dark);
    background: var(--primary-light);
}

.quick-menu .nav-link i,
.mobile-nav .nav-link i {
    width: 20px;
    min-width: 20px;
    font-size: 18px;
    text-align: center;
}

.quick-menu hr,
.mobile-nav hr {
    margin: 8px 4px;
    border-color: var(--border);
}

.mobile-menu {
    display: none;
}

.mobile-nav .nav-link {
    padding: 12px 14px;
}

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

.content {
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--topbar-height) - var(--footer-height));
    margin-top: 0;
    margin-left: var(--sidebar-width);
    padding: 24px 28px 30px;
    overflow-x: auto;
    background: var(--body);
    transition: all var(--transition);
}

.page-title {
    margin: 0;
    font-size: 27px;
    font-weight: 750;
}

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

body.sidebar-collapse .sidebar {
    width: var(--sidebar-collapse-width);
}

body.sidebar-collapse .content {
    width: calc(100% - var(--sidebar-collapse-width));
    margin-left: var(--sidebar-collapse-width);
}

body.sidebar-collapse .sidebar-title,
body.sidebar-collapse .quick-menu .nav-link span {
    display: none;
}

body.sidebar-collapse .sidebar-header {
    justify-content: center;
}

body.sidebar-collapse .quick-menu .nav-link {
    justify-content: center;
    padding: 11px 8px;
}

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

.sidebar-overlay {
    position: fixed;
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    display: none;
    background: rgba(0, 0, 0, .38);
}

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

/* =========================================================
   LOADER
========================================================= */

.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .8);
}

.loader.d-none {
    display: none !important;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1399.98px) and (min-width: 1200px) {
    .topbar-left {
        flex-basis: 180px;
        min-width: 180px;
    }

    .topbar-center {
        margin-left: 1px;
    }

    .mega-menu .nav-link {
        padding-right: 7px !important;
        padding-left: 7px !important;
        font-size: 13px !important;
    }

    .mega-menu .nav-link i {
        font-size: 15px !important;
    }

    .user-info {
        display: none !important;
    }

    .user-menu {
        max-width: 48px;
    }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
    .topbar-left {
        flex-basis: 175px;
        min-width: 175px;
    }

    .mega-menu .nav-link {
        padding-right: 5px !important;
        padding-left: 5px !important;
        font-size: 12px !important;
    }

    .mega-menu .nav-link i {
        font-size: 14px !important;
    }

    .user-info {
        display: none !important;
    }

    .user-menu {
        max-width: 45px;
    }
}

@media (max-width: 991.98px) {

    .footer {
        width: 100%;
        margin-left: 0 !important;
        min-height: var(--footer-height);
        flex-direction: column;
        gap: 3px;
        padding: 7px 12px;
    }
    .topbar-left {
        flex: 1;
        min-width: 0;
    }

    .topbar-center {
        display: none;
    }

    .topbar-right {
        margin-left: auto;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 8px 0 28px rgba(0, 0, 0, .14);
    }

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

    .desktop-quick-menu {
        display: none !important;
    }

    .mobile-menu {
        display: block !important;
    }

    .content {
        width: 100%;
        min-height: calc(100vh - var(--topbar-height) - var(--footer-height));
        margin-left: 0;
        padding: 20px 15px;
    }

    .logo img {
        width: 42px;
        height: 42px;
    }

    .logo-title {
        font-size: 18px;
    }

    .user-info {
        display: none !important;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 14px;
    }

    .content {
        padding: 16px 12px;
    }

    .page-title {
        font-size: 23px;
    }

    .logo-text small {
        display: none;
    }
}

/* =========================================================
   PRINT
========================================================= */

@media print {
    .topbar,
    .sidebar,
    .footer,
    .sidebar-overlay,
    .sidebar-toggle {
        display: none !important;
    }

    .content {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}



/* Dashboard uses the complete content area */
.dashboard-page {
    padding: 0;
}

/* =========================================================
   RK CRAFT - LAYOUT FIXED
   Based directly on current layout.css
   Only shell issues corrected; dashboard/menu architecture kept.
========================================================= */

@media (min-width: 992px) {
    .sidebar-body {
        overflow: hidden !important;
        overflow-y: hidden !important;
        overflow-x: hidden !important;
    }

    .footer {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 991.98px) {
    .footer {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .desktop-quick-menu {
        display: none !important;
    }

    .mobile-menu {
        display: block !important;
    }

    .sidebar.show {
        transform: translateX(0);
    }
}
/* =========================================================
   RK CRAFT V3 - NAVIGATION FIX
   ========================================================= */


/* =========================================================
   RK CRAFT V3 - NAVIGATION FIX
   ---------------------------------------------------------
   1. Desktop Mega Menu:
      - keep every menu item
      - allow horizontal navigation inside the center area
      - keep logo and user area fixed
      - hide the scrollbar visually
   2. Mobile:
      - full menu remains inside the sidebar
      - sidebar body gets vertical scrolling
      - desktop sidebar scrollbar remains disabled
   ========================================================= */

/* ---------------------------------------------------------
   DESKTOP TOPBAR / MEGA MENU
   --------------------------------------------------------- */

@media (min-width: 992px) {

    .topbar-center {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .topbar-center::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .mega-menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex: 0 0 auto !important;
        width: max-content !important;
        min-width: max-content !important;
        justify-content: flex-start !important;
        white-space: nowrap !important;
    }

    .mega-menu > .nav-item {
        flex: 0 0 auto !important;
    }

    .mega-menu > .nav-item > .nav-link {
        white-space: nowrap !important;
    }

    /* Do not allow the profile/right controls to be pushed away. */
    .topbar-right {
        flex: 0 0 auto !important;
        min-width: max-content !important;
    }
}


/* ---------------------------------------------------------
   MOBILE SIDEBAR
   --------------------------------------------------------- */

@media (max-width: 991.98px) {

    /*
     * The sidebar itself remains fixed.
     * Only its body scrolls.
     */
    .sidebar {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - var(--topbar-height)) !important;
        max-height: calc(100vh - var(--topbar-height)) !important;
        overflow: hidden !important;
    }

    .sidebar-header {
        flex: 0 0 auto !important;
    }

    .sidebar-body {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;

        overflow-x: hidden !important;
        overflow-y: auto !important;

        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;

        scrollbar-width: thin !important;
    }

    .sidebar-body::-webkit-scrollbar {
        width: 5px !important;
    }

    .sidebar-body::-webkit-scrollbar-thumb {
        border-radius: 10px !important;
    }

    .mobile-menu {
        display: block !important;
        min-height: max-content !important;
        height: auto !important;
    }

    .mobile-nav {
        display: flex !important;
        flex-direction: column !important;
        min-height: max-content !important;
        padding-bottom: 24px !important;
    }

    .mobile-nav-item,
    .mobile-submenu,
    .mobile-submenu > ul {
        flex: 0 0 auto !important;
    }

    /*
     * Prevent a long submenu from being clipped by an inner
     * fixed-height element.
     */
    .mobile-submenu {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
}


/* ---------------------------------------------------------
   DESKTOP SIDEBAR - NO SCROLLBAR
   --------------------------------------------------------- */

@media (min-width: 992px) {

    .sidebar-body {
        overflow-x: hidden !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }

    .sidebar-body::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
    }
}
/* =========================================================
   RK CRAFT V4 - DESKTOP MEGA MENU FIT
   ========================================================= */


/* =========================================================
   RK CRAFT V4 - DESKTOP MEGA MENU FIT
   ---------------------------------------------------------
   Mobile V3 is kept unchanged.
   Desktop only:
   - full mega menu stays visible
   - compact spacing so all top menus fit
   - no horizontal scrolling
   - profile area remains visible
   - no menu item is removed
   ========================================================= */

@media (min-width: 992px) {

    .topbar {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .topbar-left {
        flex: 0 0 174px !important;
        min-width: 174px !important;
        gap: 6px !important;
    }

    .topbar-center {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 2px !important;

        /* V4: fit the menu instead of making the user scroll it. */
        overflow: hidden !important;
        scrollbar-width: none !important;
    }

    .topbar-center::-webkit-scrollbar {
        display: none !important;
    }

    .mega-menu {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 0 !important;
        overflow: visible !important;
    }

    .mega-menu > .nav-item {
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }

    .mega-menu > .nav-item > .nav-link,
    .topbar .mega-menu .nav-link {
        padding: 0.62rem 0.48rem !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        gap: 2px !important;
        white-space: nowrap !important;
    }

    .topbar .mega-menu .nav-link i {
        font-size: 13px !important;
        margin-right: 3px !important;
    }

    .topbar .mega-menu .dropdown-toggle::after {
        margin-left: 3px !important;
        font-size: 8px !important;
    }

    .topbar-right {
        flex: 0 0 auto !important;
        min-width: max-content !important;
        margin-left: 2px !important;
    }

    /*
     * Keep the profile control compact so it does not consume
     * unnecessary width from the actual navigation.
     */
    .topbar-right .topbar-icon {
        width: 38px !important;
        height: 38px !important;
    }

    .topbar-right .dropdown-toggle {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    /*
     * Slightly reduce logo footprint while retaining the 
     */
    .topbar-left .logo img {
        width: 42px !important;
        height: 42px !important;
    }

    .topbar-left .logo-title {
        font-size: 17px !important;
    }

    .topbar-left .logo-text small {
        font-size: 9px !important;
    }
}


/* ---------------------------------------------------------
   VERY WIDE / MEDIUM DESKTOP
   Keep the same full menu but compact it further when the
   browser width is around normal 1366px desktop resolution.
   --------------------------------------------------------- */

@media (min-width: 992px) and (max-width: 1399.98px) {

    .topbar-left {
        flex-basis: 168px !important;
        min-width: 168px !important;
    }

    .mega-menu > .nav-item > .nav-link,
    .topbar .mega-menu .nav-link {
        padding-left: 0.38rem !important;
        padding-right: 0.38rem !important;
        font-size: 11.5px !important;
    }

    .topbar .mega-menu .nav-link i {
        font-size: 12px !important;
        margin-right: 2px !important;
    }
}
/* =========================================================
   RK CRAFT V5 - DESKTOP MENU TYPOGRAPHY
   ========================================================= */


/* =========================================================
   RK CRAFT V5 - DESKTOP MENU TYPOGRAPHY
   ---------------------------------------------------------
   Desktop fit from V4 is retained.
   Only menu/submenu readability is increased.
   Mobile rules are untouched.
   ========================================================= */

@media (min-width: 992px) {

    /* Main topbar menu */
    .topbar .mega-menu > .nav-item > .nav-link {
        font-size: 12.5px !important;
        font-weight: 700 !important;
        padding-left: 0.45rem !important;
        padding-right: 0.45rem !important;
    }

    .topbar .mega-menu > .nav-item > .nav-link i {
        font-size: 13px !important;
        margin-right: 3px !important;
    }

    /* Mega-menu dropdown/submenu text */
    .topbar .mega-menu .dropdown-menu {
        font-size: 12.5px !important;
    }

    .topbar .mega-menu .dropdown-menu .dropdown-item {
        font-size: 12.5px !important;
        line-height: 1.35 !important;
        padding: 0.48rem 0.72rem !important;
        white-space: nowrap !important;
    }

    .topbar .mega-menu .dropdown-menu .dropdown-item i {
        font-size: 13px !important;
        margin-right: 7px !important;
    }

    .topbar .mega-menu .dropdown-menu .dropdown-item span {
        font-size: 12.5px !important;
    }

    /* If the original mega-menu uses grouped submenu links */
    .topbar .mega-menu .mega-panel,
    .topbar .mega-menu .mega-panel a,
    .topbar .mega-menu .mega-panel .dropdown-item {
        font-size: 12.5px !important;
    }

    .topbar .mega-menu .mega-panel a {
        line-height: 1.35 !important;
    }
}

/* Normal desktop width: keep the larger readable font while
   using slightly tighter horizontal spacing to retain the fit. */
@media (min-width: 992px) and (max-width: 1399.98px) {

    .topbar .mega-menu > .nav-item > .nav-link {
        font-size: 12px !important;
        padding-left: 0.35rem !important;
        padding-right: 0.35rem !important;
    }

    .topbar .mega-menu .dropdown-menu,
    .topbar .mega-menu .dropdown-menu .dropdown-item,
    .topbar .mega-menu .dropdown-menu .dropdown-item span,
    .topbar .mega-menu .mega-panel,
    .topbar .mega-menu .mega-panel a,
    .topbar .mega-menu .mega-panel .dropdown-item {
        font-size: 12px !important;
    }
}
/* =========================================================
   RK CRAFT V6 - DESKTOP MEGA SUBMENU VISIBILITY
   ========================================================= */


/* =========================================================
   RK CRAFT V6 - DESKTOP MEGA SUBMENU VISIBILITY
   ---------------------------------------------------------
   IMPORTANT:
   V4/V5 correctly compacted the desktop top menu, but the
   .topbar-center overflow:hidden was clipping the actual
   dropdown/mega submenu.

   This override does NOT change the mobile menu.
   It only allows desktop submenu panels to escape the
   topbar-center clipping area.
   ========================================================= */

@media (min-width: 992px) {

    /* Never clip the dropdown panel at the topbar level. */
    .topbar {
        overflow: visible !important;
    }

    .topbar-center {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    .mega-menu {
        overflow: visible !important;
    }

    .mega-menu > .nav-item {
        position: relative;
    }

    /*
     * Bootstrap dropdown / our mega panels must appear above
     * the dashboard/content layer.
     */
    .mega-menu .dropdown-menu,
    .mega-menu .mega-panel {
        z-index: 1200 !important;
    }

    /*
     * Keep the readable V5 submenu typography.
     */
    .mega-menu .dropdown-menu .dropdown-item,
    .mega-menu .mega-panel a,
    .mega-menu .mega-panel .dropdown-item {
        font-size: 12.5px !important;
    }

    .mega-menu .dropdown-menu .dropdown-item i {
        font-size: 13px !important;
    }
}

/*
 * Do not allow the desktop fix to leak into mobile.
 * Mobile V3 scrolling remains exactly as previously fixed.
 */
@media (max-width: 991.98px) {

    .topbar,
    .topbar-center,
    .mega-menu {
        overflow: visible;
    }
}
/* =========================================================
   RK CRAFT V7 - MOBILE MENU VISUAL POLISH
   ========================================================= */


/* =========================================================
   RK CRAFT V7 - MOBILE MENU VISUAL POLISH
   ---------------------------------------------------------
   Mobile only.
   Desktop Mega Menu / Quick Menu are untouched.
   Functional behavior remains controlled by menu.php +
   Bootstrap Collapse.
   ========================================================= */

@media (max-width: 991.98px) {

    /* -----------------------------------------------------
       MOBILE MENU BASE
       ----------------------------------------------------- */

    .mobile-menu {
        padding: 4px 0 18px !important;
    }

    .mobile-nav {
        gap: 3px !important;
    }

    .mobile-nav-item {
        margin: 0 !important;
    }

    /*
     * Parent + direct navigation links:
     * slightly stronger typography and more comfortable
     * touch targets.
     */
    .mobile-nav > .mobile-nav-item > .mobile-nav-link {
        min-height: 48px !important;
        padding: 11px 14px !important;
        gap: 11px !important;
        border-radius: 10px !important;
        font-size: 14px !important;
        font-weight: 550 !important;
        letter-spacing: .05px !important;
        color: #435350 !important;
        transition:
            background-color .16s ease,
            color .16s ease,
            box-shadow .16s ease !important;
    }

    /* Main menu icon */
    .mobile-nav > .mobile-nav-item > .mobile-nav-link > i:first-child {
        width: 21px !important;
        min-width: 21px !important;
        font-size: 17px !important;
        color: #53625f !important;
        text-align: center !important;
    }

    /*
     * Parent menu item:
     * make it visually stronger than child items.
     */
    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle {
        font-weight: 600 !important;
        background: #fbfdfc !important;
        border: 1px solid transparent !important;
    }

    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle:hover,
    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle:focus {
        color: #176b57 !important;
        background: #f1f8f5 !important;
        border-color: #dcece5 !important;
        box-shadow: none !important;
        outline: none !important;
    }

    /* Parent active/open state */
    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle.active,
    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle[aria-expanded="true"] {
        color: #0f6b56 !important;
        background: #edf7f3 !important;
        border-color: #d8ebe3 !important;
    }

    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle.active > i:first-child,
    .mobile-nav > .mobile-nav-item > .mobile-nav-toggle[aria-expanded="true"] > i:first-child {
        color: #0f8064 !important;
    }

    /* Chevron belongs to the right side */
    .mobile-nav .mobile-nav-arrow {
        width: auto !important;
        min-width: 0 !important;
        margin-left: auto !important;
        font-size: 13px !important;
        color: #6d7c78 !important;
        transition: transform .18s ease, color .18s ease !important;
    }

    .mobile-nav .mobile-nav-toggle[aria-expanded="true"] .mobile-nav-arrow {
        color: #0f8064 !important;
        transform: rotate(180deg) !important;
    }


    /* -----------------------------------------------------
       SUBMENU
       ----------------------------------------------------- */

    .mobile-nav .mobile-submenu {
        margin: 2px 0 5px 14px !important;
        padding: 3px 0 3px 10px !important;
        border-left: 2px solid #d9ebe4 !important;
        background: #fbfdfc !important;
        border-radius: 0 9px 9px 0 !important;
    }

    .mobile-nav .mobile-submenu > ul {
        gap: 1px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /*
     * Child links are deliberately smaller/lighter than
     * their parent so the hierarchy is immediately visible.
     */
    .mobile-nav .mobile-submenu .nav-link {
        position: relative !important;
        min-height: 39px !important;
        margin: 1px 4px 1px 0 !important;
        padding: 8px 10px 8px 16px !important;
        gap: 9px !important;
        border-radius: 8px !important;
        color: #65736f !important;
        font-size: 12px !important;
        font-weight: 450 !important;
        line-height: 1.25 !important;
    }

    /* Child icons */
    .mobile-nav .mobile-submenu .nav-link i {
        width: 16px !important;
        min-width: 16px !important;
        font-size: 13px !important;
        color: #7a8a85 !important;
        text-align: center !important;
    }

    /* Small hierarchy marker */
    .mobile-nav .mobile-submenu .nav-link::before {
        content: "" !important;
        position: absolute !important;
        left: 5px !important;
        top: 50% !important;
        width: 4px !important;
        height: 4px !important;
        margin-top: -2px !important;
        border-radius: 50% !important;
        background: #a8c9bd !important;
    }

    .mobile-nav .mobile-submenu .nav-link:hover,
    .mobile-nav .mobile-submenu .nav-link:focus {
        color: #176b57 !important;
        background: #f1f8f5 !important;
        outline: none !important;
    }

    .mobile-nav .mobile-submenu .nav-link:hover i,
    .mobile-nav .mobile-submenu .nav-link:focus i {
        color: #176b57 !important;
    }

    /* Active child */
    .mobile-nav .mobile-submenu .nav-link.active {
        color: #0d6f58 !important;
        background: #eaf6f1 !important;
        font-weight: 600 !important;
        box-shadow: inset 3px 0 0 #168365 !important;
    }

    .mobile-nav .mobile-submenu .nav-link.active::before {
        background: #168365 !important;
    }

    .mobile-nav .mobile-submenu .nav-link.active i {
        color: #168365 !important;
    }


    /* -----------------------------------------------------
       DIRECT TOP-LEVEL ACTIVE LINK
       ----------------------------------------------------- */

    .mobile-nav > .mobile-nav-item > .mobile-nav-link.active:not(.mobile-nav-toggle) {
        color: #0d6f58 !important;
        background: #eaf6f1 !important;
        font-weight: 650 !important;
        box-shadow: inset 3px 0 0 #168365 !important;
    }

    .mobile-nav > .mobile-nav-item > .mobile-nav-link.active:not(.mobile-nav-toggle) > i:first-child {
        color: #168365 !important;
    }


    /* -----------------------------------------------------
       LOGOUT
       ----------------------------------------------------- */

    .mobile-nav .mobile-nav-logout {
        margin-top: 8px !important;
        padding-top: 8px !important;
        border-top: 1px solid #e5ece9 !important;
    }

    .mobile-nav .mobile-nav-logout .nav-link {
        min-height: 46px !important;
        color: #b94a4a !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
    }

    .mobile-nav .mobile-nav-logout .nav-link i {
        color: #c45454 !important;
    }

    .mobile-nav .mobile-nav-logout .nav-link:hover {
        color: #a83f3f !important;
        background: #fff4f4 !important;
    }


    /* -----------------------------------------------------
       MOBILE SIDEBAR HEADER
       ----------------------------------------------------- */

    .sidebar-header {
        min-height: 56px !important;
        padding: 0 14px !important;
    }

    .sidebar-title {
        font-size: 15px !important;
        font-weight: 700 !important;
        letter-spacing: .1px !important;
    }

}


/* ---------------------------------------------------------
   SMALL PHONES
   --------------------------------------------------------- */

@media (max-width: 575.98px) {

    .mobile-nav > .mobile-nav-item > .mobile-nav-link {
        min-height: 47px !important;
        padding: 10px 12px !important;
        font-size: 13.5px !important;
    }

    .mobile-nav .mobile-submenu {
        margin-left: 12px !important;
        padding-left: 9px !important;
    }

    .mobile-nav .mobile-submenu .nav-link {
        min-height: 37px !important;
        padding: 7px 8px 7px 15px !important;
        font-size: 11.5px !important;
    }

    .mobile-nav .mobile-submenu .nav-link i {
        font-size: 12.5px !important;
    }
}
