/* ============================================================
           PAGE
        ============================================================ */

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: #f5f7fa;
}

#page-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}


/* ============================================================
           HEADER
        ============================================================ */

#page-header {
    position: relative;
    z-index: 100;
    flex: 0 0 64px;
    width: 100%;
    height: 64px;
    min-height: 64px;
    background: linear-gradient(110deg, #ffffff 0%, #fbfcfd 55%, #f4f7f9 100%);
    border-bottom: 1px solid #e7ebef;
    box-shadow: 0 2px 12px rgba(31, 41, 55, 0.05);
}

.portal-brand {
    height: 100%;
    padding-right: 20px;
}

.portal-logo {
    display: block;
    width: auto;
    max-width: 145px;
    height: 30px;
    object-fit: contain;
}

.portal-divider {
    width: 1px;
    height: 26px;
    margin-right: 18px;
    background: #e5e9ed;
}

#kt_header_nav {
    min-width: 0;
    overflow: hidden;
}

.portal-navigation {
    gap: 3px;
}

    .portal-navigation .menu-item {
        display: flex;
        align-items: center;
    }

.portal-nav-link {
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 13px !important;
    color: #64748b !important;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

    .portal-nav-link .menu-title {
        color: inherit !important;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
    }

    .portal-nav-link:hover {
        color: #1c262f !important;
        background: #eef3f5;
        transform: translateY(-1px);
    }

.portal-navigation .menu-item.active .portal-nav-link,
.portal-navigation .menu-link.active {
    color: #15803d !important;
    background: #ecfdf3;
}

.portal-beta {
    display: inline-flex;
    align-items: center;
    height: 16px;
    padding: 0 5px;
    color: #168a4a;
    background: #dcfce7;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .3px;
}


/* ============================================================
           HEADER ACTIONS
        ============================================================ */

.portal-actions {
    margin-left: 15px;
}

.portal-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    color: #64748b;
    background: #fff;
    border: 1px solid #e4e8ec;
    border-radius: 9px;
    outline: 0;
    cursor: pointer;
    transition: all .15s ease;
}

    .portal-action-button:hover {
        color: #168a4a;
        background: #f0fdf4;
        border-color: #bbebcd;
    }


/* ============================================================
           SEARCH
        ============================================================ */

.portal-search {
    position: relative;
    width: 220px;
}

.portal-search-icon {
    position: absolute;
    left: 11px;
    z-index: 5;
    display: flex;
    color: #94a3b8;
    pointer-events: none;
}

.portal-search .k-autocomplete,
.portal-search .k-input {
    width: 100% !important;
}

.portal-search .k-input-inner {
    height: 36px !important;
    padding-left: 34px !important;
    font-size: 12px !important;
}


/* ============================================================
           CLIENT
        ============================================================ */

.portal-client {
    width: 200px;
}

    .portal-client .k-combobox,
    .portal-client .k-picker {
        width: 100% !important;
    }


/* ============================================================
           BODY
        ============================================================ */

#page-body {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}


/* ============================================================
           SPLITTER
        ============================================================ */

#main-splitter {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #f5f7fa;
}

    #main-splitter > .k-pane {
        min-width: 0;
        min-height: 0;
    }

    #main-splitter > .k-splitbar {
        width: 5px !important;
        min-width: 5px !important;
        border: 0;
        background: #edf0f3;
    }

        #main-splitter > .k-splitbar:hover {
            background: #dce2e7;
        }


/* ============================================================
           SIDEBAR
        ============================================================ */

#left-sidebar {
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border-right: 1px solid #e7ebef;
}

    #left-sidebar .sidebar-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 15px;
        box-sizing: border-box;
    }

    #left-sidebar .sidebar-header {
        flex: 0 0 auto;
        width: 100%;
        padding-bottom: 12px;
        border-bottom: 1px solid #edf0f2;
    }

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
}

.sidebar-title,
.sidebar-list-heading {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .65px; 
}

#left-sidebar .sidebar-header .k-combobox,
#left-sidebar .sidebar-header .k-picker {
    width: 100% !important;
}

 


/* ============================================================
           WIDGET LIST
        ============================================================ */

#widget-list-container {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding-right: 3px;
    overflow-x: hidden;
    overflow-y: auto;
}

#widget-list {
    width: 100%;
    min-width: 0;
}

    #widget-list .widget-item {
        width: 100%;
        min-width: 0;
        padding: 5px;
        background: #fff;
        border-color: #e8ebef !important;
        transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
    }

        #widget-list .widget-item:hover {
            background: #f8fafb;
            border-color: #d9e1e7 !important;
            box-shadow: 0 2px 7px rgba(15, 23, 42, .04);
        }

#widget-list-container::-webkit-scrollbar {
    width: 5px;
}

#widget-list-container::-webkit-scrollbar-track {
    background: transparent;
}

#widget-list-container::-webkit-scrollbar-thumb {
    background: #d7dde2;
    border-radius: 10px;
}

    #widget-list-container::-webkit-scrollbar-thumb:hover {
        background: #aeb8c1;
    }

    #widget-list .widget-item {
    width: 100%;
    min-width: 0;
    padding: 8px;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

#widget-list .widget-item:hover {
    background: #f5f8fa;
    border-color: #d8dce5 !important;
}

#widget-list .widget-item.widget-selected {
    background: #f1f6ff;
    border-color: #009ef7 !important; 
}

#widget-list .widget-item.widget-selected .text-gray-800 {
    color: #009ef7 !important;
}


/* ============================================================
           MAIN CONTENT
        ============================================================ */

#main-content {
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background: #f5f7fa;
}

.main-content-inner { 
    padding: 18px;
    box-sizing: border-box;
}

#page_content {
    width: 100%;
    min-width: 0;
}


/* ============================================================
           FOOTER
        ============================================================ */

#page-footer {
    position: relative;
    z-index: 20;
    flex: 0 0 36px;
    width: 100%;
    height: 36px;
    min-height: 36px;
    color: #7c8794;
    background: #fff;
    border-top: 1px solid #e7ebef;
    font-size: 11px;
}

.footer-brand {
    font-weight: 600;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
}


/* ============================================================
           RESPONSIVE
        ============================================================ */

@media (max-width: 1399.98px) {
    .portal-search {
        width: 175px;
    }

    .portal-client {
        width: 145px;
    }

    .portal-nav-link {
        padding: 0 9px !important;
    }

        .portal-nav-link .menu-title {
            font-size: 12px;
        }
}

@media (max-width: 991.98px) {
    #page-header {
        flex-basis: 58px;
        height: 58px;
        min-height: 58px;
    }

    .portal-logo {
        height: 26px;
    }

    .portal-actions {
        margin-left: auto;
    }
}

/* HEADER NAV MUST HAVE AVAILABLE WIDTH */
#kt_header_nav {
    display: flex !important;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: visible;
}

    /* METRONIC HEADER MENU WRAPPER */
    #kt_header_nav .header-menu {
        display: flex !important;
        align-items: stretch;
        flex: 1 1 auto;
        width: auto !important;
        height: 100%;
    }

/* ACTUAL MENU */
#kt_header_menu {
    display: flex !important;
    align-items: center;
    flex-direction: row;
    width: auto;
    height: 100%;
    margin: 0 !important;
}

    /* MENU ITEMS */
    #kt_header_menu > .menu-item {
        display: flex !important;
        align-items: center;
    }

    /* LINKS */
    #kt_header_menu .portal-nav-link {
        display: flex !important;
        align-items: center;
        min-height: 38px;
        padding: 0 13px !important;
        color: #64748b !important;
        border-radius: 8px;
        cursor: pointer;
    }

        #kt_header_menu .portal-nav-link .menu-title {
            display: block !important;
            color: #64748b !important;
            font-size: 13px;
            font-weight: 600;
            white-space: nowrap;
        }

        #kt_header_menu .portal-nav-link:hover {
            color: #168a4a !important;
            background: #f0fdf4;
        }

            #kt_header_menu .portal-nav-link:hover .menu-title {
                color: #168a4a !important;
            }


/* MOBILE */
@media (max-width: 991.98px) {
    #kt_header_menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto;
    }

        #kt_header_menu > .menu-item {
            width: 100%;
        }

        #kt_header_menu .portal-nav-link {
            width: 100%;
            min-height: 44px;
        }
}
