.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;  /* scrollbar track - ар талын саарал */
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #5A5278; /* барих хэсгийн өнгө */
  border-radius: 8px;
  border: 2px solid #f1f1f1; /* дотор padding effect */
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: #3b3f5c; /* hover үед өнгө */
}


* {
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}
.d-flex.full-height {
  height: 100vh;
  overflow: hidden;
}

/* Логоны хэмжээ */
.logo {
    width: 80px;
}

/* Toolbar (desktop) */
.toolbar {
    width: 60px;
    background-color: #f8f9fa;
    height: 100vh;
    padding-top: 20px;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.toolbar .icon-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 45px;
    width: 100%;
    font-size: 1.2rem;
    margin-bottom: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.toolbar .icon-btn a {
    color: #474747;
}

.toolbar .icon-btn a:hover {
    color: #5A5278;
}

.toolbar .icon-btn:hover {
    color: #5A5278;
}

.toolbar .icon-btn a i,
.toolbar .icon-btn i {
    color: inherit;
    pointer-events: none;
}

/* Sidebar */
.sidebar {
    width: 270px;
    height: 100vh;
    background: #fff;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    transition: width 0.3s ease;
    z-index: 1050;
    white-space: normal;
    word-wrap: break-word;
}



/* Collapsed sidebar */
.sidebar.collapsed {
    width: 0;
    padding: 0;
}

/* Sidebar доторх текст/тэмдэглэгээ */
.sidebar.collapsed h4,
.sidebar.collapsed .section-title,
.sidebar.collapsed .nav-link {
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    user-select: none;
}

/* Sidebar өргөн байхад текст харагдах */
.sidebar:not(.collapsed) h4,
.sidebar:not(.collapsed) .section-title,
.sidebar:not(.collapsed) .nav-link {
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
}

.sidebar h4 {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 30px;
    white-space: nowrap;
}

.sidebar .nav-link {
    color: #333;
    font-weight: 400;
    white-space: nowrap;
    display: inline-block; /* scale-д шаардлагатай */
    transition: transform 0.9s ease, color 0.9s ease;
}

.sidebar .nav-link:hover {
    transform: scale(1.05) translateX(5px);
    color: #5A5278;
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar .nav-link.active {
    color: #3b3f5c;
    font-weight: 700;
}


.icon-active {
    display: none;
}

.nav-link.active .icon-default {
    display: none;
}

.nav-link.active .icon-active {
    display: inline-block;
    color: #3b3f5c;
}

.sidebar .section-title {
    font-size: 0.75rem;
    color: #999;
    margin-top: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-weight: 600;
    white-space: nowrap;
}

.layout-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* Main content */
.main-content {
    flex-grow: 5;
    overflow-y: auto;
    background-color: #f1f1f1;
    padding: 20px;
    transition: all 0.3s ease;
    width: 80%;
}

/* Sidebar хаагдсан үед main content margin багасна */
.main-content.expanded {
    margin-left: 0px;
}

/* Full height container */
.d-flex.full-height {
    height: 100vh;
    overflow: hidden;
}

.ss .nav-item a {
    color: #5f5f5f;
}

.nav.ss .nav-item {
    margin-bottom: 3px; /* default нь 8px-12px орчим байдаг */
}

.nav.ss .nav-link {
    padding-top: 2px;
    padding-bottom: 2px;
    font-size: 0.92rem; /* хүсвэл бага зэрэг жижигрүүлж болно */
}

.header {
    background-color: #f2f2f2;
    padding: 10px 20px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #3b3f5c;
}

.icon-btn:hover {
    opacity: 0.7;
}

.dropdown-toggle::after {
    margin-left: 4px;
}

.form-select,
.form-control {
    font-size: 0.875rem;
}

.head-search {
    color: #5A5278;
    border-color: #5A5278;
}

.head-search:hover {
    background-color: #5A5278;
    border-color: #3b3f5c;
}

.card-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.card-link i {
    font-size: 40px;
    display: block;
    transition: all 0.3s ease;
}

.card-link h6 {
    transition: all 0.3s ease;
}

.card-link:hover i {
    transform: scale(1.3) translateY(2px);
    color: #3b3f5c;
}

.card-link:hover h6 {
    transform: scale(1.3) translateY(5px);
    color: #3b3f5c;
    font-size: 14px;
}

.card-link p {
    position: absolute;
    background-color: #3b3f5c;
    width: 50px;
    top: 20px;
    left: -5px;
    color: white;
    font-size: 20px;
    margin-top: -5px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.card-link:hover p {
    transform: scale(1.3) translateY(5px);
    color: #ffffff;
}

.card {
    border: none;
}

.nav-tabs .nav-item a {
    color: #3b3f5c;
}

.nav-tabs .nav-item:active {
    border-top: 1px solid #3b3f5c;
    transition: all 0.3s ease;

}

.dt-buttons .btn {
  background-color: #3b3f5c !important;
  color: white !important;
  border: none;
  margin-left: 5px;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
}

.dt-buttons .btn:hover {
  background-color: #2f324a !important;
  color: #ffffff !important;
}

.dt-button-info {
  background-color: #3b3f5c !important;
  color: white !important;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  top: 120px !important;
  right: 50px !important;
  left: auto !important;
  position: fixed !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 9999;
}
.dt-paging .dt-paging-button li {
    background: #2f324a;
}
/* ================================================
   MOBILE — sidebar close button (sidebar дотор)
   ================================================ */
.sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 4px 14px 4px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e7e8f2;
}

.sidebar-close-btn {
    background: rgba(90,82,120,.10);
    border: none;
    border-radius: 10px;
    color: #5A5278;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background .18s;
}

.sidebar-close-btn:hover {
    background: rgba(90,82,120,.22);
}

/* ================================================
   MOBILE HEADER
   ================================================ */
.mobile-header {
    display: none;
}

/* ================================================
   Responsive toolbar — mobile
   ================================================ */
@media (max-width: 768px) {

    .d-flex.full-height {
        overflow: auto;
        height: auto;
    }

    html, body {
        height: 100%;
        overflow-y: auto;
    }

    .layout-container {
        flex-direction: column;
        height: auto;
    }

    .toolbar {
        display: none !important;
    }

    /* ── Mobile top header ── */
    .mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        background: #fff;
        padding: 0 16px;
        height: 56px;
        border-bottom: 1px solid #e7e8f2;
        position: sticky;
        top: 0;
        z-index: 1060;
        box-shadow: 0 2px 8px rgba(0,0,0,.06);
    }

    .mobile-header-left {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-menu-btn {
        background: none;
        border: none;
        padding: 6px 8px;
        border-radius: 10px;
        font-size: 24px;
        color: #5A5278;
        cursor: pointer;
        display: flex;
        align-items: center;
        transition: background .18s;
    }

    .mobile-menu-btn:hover {
        background: rgba(90,82,120,.10);
    }

    .mobile-logo {
        height: 30px;
    }

    .mobile-title {
        font-weight: 700;
        font-size: 15px;
        color: #2f324a;
        letter-spacing: .3px;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
    }

    .mobile-user-badge {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        color: #5A5278;
        font-weight: 600;
        background: rgba(90,82,120,.08);
        border: 1px solid rgba(90,82,120,.16);
        border-radius: 20px;
        padding: 5px 12px 5px 8px;
        max-width: 150px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mobile-user-badge i {
        font-size: 16px;
        flex-shrink: 0;
    }

    /* ── Overlay ── */
    .overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,.40);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 1049;
    }

    .overlay.show {
        display: block;
    }

    /* ── Sidebar (slide-in panel) ── */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100%;
        background: #fff;
        box-shadow: 4px 0 24px rgba(0,0,0,.14);
        z-index: 1050;
        transition: left 0.28s cubic-bezier(.4,0,.2,1);
        width: 280px;
        padding: 0 14px 100px 14px;
        overflow-y: auto;
        border-radius: 0 20px 20px 0;
    }

    .sidebar.show {
        left: 0;
    }

    /* ── Main content ── */
    .main-content {
        margin-left: 0 !important;
        padding: 16px;
        width: 100%;
    }

    /* ── Mobile bottom nav ── */
    .mobile-ic {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        min-height: 64px;
        background: #fff;
        border-top: 1px solid #e7e8f2;
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        z-index: 9999;
        box-shadow: 0 -4px 16px rgba(0,0,0,.07);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 10px 8px 8px;
        color: #9ca3af;
        font-size: 20px;
        text-decoration: none;
        border-radius: 0;
        transition: color .18s, background .18s;
        flex: 1;
        min-width: 0;
        background: none;
        border: none;
        cursor: pointer;
    }

    .mobile-nav-item span {
        font-size: 10px;
        font-weight: 600;
        color: inherit;
        white-space: nowrap;
    }

    .mobile-nav-item i {
        font-size: 20px;
        line-height: 1;
    }

    .mobile-nav-item:hover,
    .mobile-nav-item:focus {
        color: #5A5278;
        background: rgba(90,82,120,.06);
        text-decoration: none;
    }

    .mobile-nav-item.active {
        color: #5A5278;
    }

    .mobile-nav-item.active i {
        transform: scale(1.15);
    }

    .mobile-nav-item-form {
        flex: 1;
        display: flex;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-item-form .mobile-nav-item {
        width: 100%;
    }

    .mobile-nav-logout {
        color: #ef4444;
    }

    .mobile-nav-logout:hover {
        color: #dc2626;
        background: rgba(239,68,68,.06);
    }
}
