:root {
    --sidebar-width: 268px;
    --header-height: 72px;
    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #111c33;
    --sidebar-text: #cbd5e1;
    --sidebar-text-strong: #f8fafc;
    --accent: #155aec;
    --page-bg: #f3f6fb;
}

html,
body {
    height: 100%;
}

body {
    display: block;
    background: var(--page-bg);
    overflow-x: hidden;
}

/* Undo the old global active-link paint that leaked into page tabs */
.nav-link.active {
    color: inherit;
    background-color: transparent;
}

.columnWrapper {
    display: block;
    min-height: 100vh;
    width: 100%;
}

.left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0b1224 100%);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand {
    min-height: var(--header-height);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.sidebar-brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    min-width: 0;
}

.sidebar-brand-link:hover {
    color: #fff;
    text-decoration: none;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #155aec 0%, #3b82f6 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 8px 16px rgba(21, 90, 236, 0.35);
    flex-shrink: 0;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sidebar-text-strong);
}

.brand-sub {
    font-size: 11px;
    color: #94a3b8;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sidebar-icon-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: #eef3ff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.sidebar-icon-btn:hover {
    background: #155aec;
    color: #fff;
}

.sidebar-icon-btn .material-icons {
    font-size: 22px;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-close:hover {
    background: #155aec;
    color: #fff;
}

.left-sidebar .sideNavBar {
    flex: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 12px 12px 24px;
    overflow: hidden;
    width: 100%;
}

.sidebar-section {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 6px 10px 10px;
}

.left-sidebar .navbar-nav {
    max-height: none;
    overflow-y: auto;
    padding-bottom: 16px;
}

.left-sidebar .navbar-nav::-webkit-scrollbar {
    width: 6px;
}

.left-sidebar .navbar-nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 10px;
}

.left-sidebar .nav-item {
    margin-bottom: 4px;
}

.left-sidebar .navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    justify-content: flex-start;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.left-sidebar .navbar-nav .nav-link .material-icons {
    font-size: 20px;
    width: 22px;
    color: #93c5fd;
    flex-shrink: 0;
}

.left-sidebar .navbar-nav .nav-link .nav-text {
    flex: 1;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.left-sidebar .navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.left-sidebar .navbar-nav .nav-link.active {
    background: linear-gradient(90deg, #155aec 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 8px 18px rgba(21, 90, 236, 0.28);
}

.left-sidebar .navbar-nav .nav-link.active .material-icons,
.left-sidebar .navbar-nav .nav-link:hover .material-icons {
    color: #fff;
}

.nav-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.left-sidebar .navbar-nav .nav-link.active .nav-badge {
    background: #fff;
    color: #155aec;
}

div#mainPart,
.main-content {
    width: 100%;
    float: none;
    padding-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--page-bg);
}

.main-content-header {
    height: var(--header-height);
    padding: 0 22px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid #e8edf5;
    z-index: 1020;
}

.mch-left-items,
.mch-right-items {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mch-title-wrap {
    min-width: 0;
}

.mch-heading {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 52vw;
}

.mch-breadcrumb {
    font-size: 12px;
    color: #6b7280;
}

.header-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-decoration: none;
}

.header-icon-btn:hover {
    color: #155aec;
    background: #eef3ff;
    text-decoration: none;
}

.header-icon-btn .material-icons {
    font-size: 22px;
}

.header-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.user-menu .user-btn {
    width: auto;
    height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.user-menu .user-btn img {
    width: 36px;
    height: 36px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #e5e7eb;
}

.user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}

.user-meta strong {
    font-size: 13px;
    color: #0f172a;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta small {
    font-size: 11px;
    color: #6b7280;
    text-transform: capitalize;
}

.user-caret {
    font-size: 18px;
    color: #94a3b8;
}

.user-dropmenu.show,
.dropdown-menu.user-dropmenu {
    transform: none !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 8px;
    min-width: 240px;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.user-drop-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 12px;
    border-bottom: 1px solid #eef2f7;
    margin-bottom: 6px;
}

.user-drop-head img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.user-drop-head strong,
.user-drop-head small {
    display: block;
    line-height: 1.2;
}

.user-drop-head strong {
    font-size: 13px;
    color: #0f172a;
}

.user-drop-head small {
    font-size: 11px;
    color: #6b7280;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropmenu a.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 500;
}

.user-dropmenu a.dropdown-item .material-icons {
    font-size: 18px;
    color: #64748b;
}

.user-dropmenu a.dropdown-item:hover {
    background: #eef3ff;
    color: #155aec;
}

.user-dropmenu a.dropdown-item.text-red {
    color: #dc2626;
}

.user-dropmenu a.dropdown-item.text-red .material-icons {
    color: #dc2626;
}

.main-content-body {
    padding: 24px 28px 40px;
}

.sidebar-overlay {
    display: none;
}

/* Login / auth screens */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-app .auth-brand .brand-name {
    color: #0f172a;
    font-size: 22px;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .fullPageWrapper_left {
        display: none;
    }

    .fullPageWrapper_right {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 24px 16px;
        min-height: 100vh;
    }

    .card.login-wrapper form {
        padding: 28px 20px 36px;
    }

    .card.login-wrapper.common_box {
        max-width: 100%;
    }
}

@media (max-width: 991.98px) {
    .left-sidebar {
        transform: translateX(-105%);
        transition: transform .25s ease;
    }

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

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1035;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

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

    div#mainPart,
    .main-content {
        padding-left: 0;
    }

    .main-content-header {
        padding: 0 14px;
        height: 64px;
    }

    .mch-heading {
        font-size: 16px;
        max-width: 46vw;
    }

    .main-content-body {
        padding: 16px 14px 28px;
    }

    .common-table-wrapper,
    .table-responsive,
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper .row {
        flex-direction: column;
        align-items: stretch !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .dataTables_wrapper .row:last-child {
        flex-direction: column;
        gap: 10px;
        margin: 10px 0 !important;
    }

    .dataTables_filter,
    .dataTables_length,
    .dataTables_info,
    .dataTables_paginate {
        text-align: left !important;
        width: 100%;
        float: none !important;
    }

    .cat-toolbar,
    .db-toolbar,
    .prf-toolbar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .cat-search,
    .db-filter-wrap,
    .cat-toolbar-actions,
    .search-form {
        width: 100%;
        min-width: 0;
    }

    .cat-create-btn,
    .btn.cat-create-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .user-menu .user-btn {
        padding: 3px;
        height: 42px;
    }

    .header-icon-btn {
        width: 38px;
        height: 38px;
    }

    .mch-heading {
        max-width: 42vw;
    }

    .modal-dialog {
        margin: 12px;
    }

    .btn-groups-horizontal {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (min-width: 1400px) {
    .main-content-body {
        padding-left: 36px;
        padding-right: 36px;
    }
}
