/* Sidebar presentation. Widths and responsive behavior remain owned by the theme. */
html body .main-menu.menu-dark {
    --sb-bg: #0b1b33;
    --sb-text: #c6d2e3;
    --sb-muted: #91a4bf;
    --sb-hover: rgba(170, 193, 225, .07);
    --sb-line: rgba(170, 193, 225, .12);
    --sb-accent: #2463bc;
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-line);
    box-shadow: none;
    font-family: 'Prompt', 'Segoe UI', Tahoma, sans-serif;
}

html body .main-menu.menu-dark .main-menu-content {
    padding: 0 0 24px;
    scrollbar-width: thin;
    scrollbar-color: #344862 transparent;
}

html body .main-menu.menu-dark .navigation {
    padding-top: 6px;
    background: transparent;
    font-family: inherit;
}

/* Workspace heading and search share the same alignment as the navigation. */
.nt-sidebar-tools {
    margin: 0 16px 8px;
    padding: 20px 0 16px;
    border-bottom: 1px solid var(--sb-line);
}

.nt-sidebar-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 17px;
}

.nt-sidebar-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    height: 34px;
    border: 1px solid rgba(120, 172, 246, .2);
    border-radius: 10px;
    background: rgba(87, 147, 235, .1);
    color: #9ac2ff;
    font-size: 17px;
}

.nt-sidebar-heading-text {
    min-width: 0;
}

.nt-sidebar-eyebrow,
.nt-sidebar-title {
    display: block;
}

.nt-sidebar-eyebrow {
    margin-bottom: 3px;
    color: var(--sb-muted);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: .16em;
}

.nt-sidebar-title {
    color: #f1f5fb;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.nt-sidebar-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(170, 193, 225, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: var(--sb-muted);
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.nt-sidebar-search:focus-within {
    border-color: #78aaf0;
    background: rgba(120, 170, 240, .06);
    box-shadow: 0 0 0 3px rgba(120, 170, 240, .12);
}

.nt-sidebar-search > i {
    flex: 0 0 auto;
    font-size: 15px;
}

html body .main-menu .nt-sidebar-search input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    color: #edf3fc;
    font: inherit;
    font-size: 12px;
    appearance: none;
}

.nt-sidebar-search input::placeholder {
    color: var(--sb-muted);
    opacity: 1;
}

.nt-sidebar-search input::-webkit-search-cancel-button {
    appearance: none;
}

.nt-sidebar-search button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    height: 28px;
    margin-right: -5px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #c6d2e3;
    cursor: pointer;
}

.nt-sidebar-search button:hover {
    background: var(--sb-hover);
    color: #fff;
}

.nt-sidebar-search button[hidden],
.nt-sidebar-empty[hidden] {
    display: none;
}

/* Section labels stay intact so saved layouts and permission identifiers work. */
html body .main-menu.menu-dark .navigation .navigation-header.nt-foldable {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    margin: 4px 10px;
    padding: 7px 8px;
    border-radius: 8px;
    color: #dce5f2;
    font-size: 12px;
    line-height: 1.65;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    user-select: none;
    transition: color .15s, background .15s;
}

html body .main-menu.menu-dark .navigation .navigation-header.nt-foldable:hover {
    background: var(--sb-hover);
    color: #fff;
}

html body .main-menu.menu-dark .navigation .navigation-header .nt-sec-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin: 0;
    border: 1px solid rgba(170, 193, 225, .07);
    border-radius: 7px;
    background: rgba(170, 193, 225, .045);
    color: #a4b8d4;
    font-size: 15px;
}

html body .main-menu.menu-dark .navigation .navigation-header.nt-foldable > span {
    position: relative;
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 15px;
    font-weight: 500;
    white-space: normal;
}

html body .main-menu.menu-dark .navigation .navigation-header.nt-foldable > span::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 2px;
    width: 5px;
    height: 5px;
    margin-top: -4px;
    border-right: 1.5px solid #91a4bf;
    border-bottom: 1.5px solid #91a4bf;
    transform: rotate(45deg);
    transition: transform .15s;
}

html body .main-menu.menu-dark .navigation .navigation-header.nt-folded > span::after {
    margin-top: -3px;
    transform: rotate(-45deg);
}

html body .main-menu.menu-dark .navigation .navigation-header.nt-section-active {
    color: #b9d5ff;
}

html body .main-menu.menu-dark .navigation .navigation-header.nt-section-active .nt-sec-ic {
    border-color: rgba(120, 172, 246, .2);
    background: rgba(87, 147, 235, .12);
    color: #9ac2ff;
}

html body .main-menu.menu-dark .navigation > li.nt-fold-hide {
    display: none !important;
}

/* Rows use a stable icon column and give long Thai labels room to wrap. */
html body .main-menu.menu-dark .navigation > li,
html body .main-menu.menu-dark .navigation > li.open,
html body .main-menu.menu-dark .navigation li.active {
    border-left: 0;
    background: transparent;
}

html body .main-menu.menu-dark .navigation > li > a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 39px;
    margin: 3px 10px 3px 32px;
    padding: 9px 10px !important;
    border-radius: 7px;
    color: var(--sb-text);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.65;
    transition: background .15s, color .15s;
}

html body .main-menu.menu-dark .navigation > li > a > i {
    top: 0;
    flex: 0 0 18px;
    width: 18px;
    margin: 0 9px 0 0;
    color: var(--sb-muted);
    font-size: 17px;
    text-align: center;
}

html body .main-menu.menu-dark .navigation > li > a > i::before {
    font-size: inherit;
}

html body .main-menu.menu-dark .navigation .menu-title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
}

html body .main-menu.menu-dark .navigation > li:hover > a,
html body .main-menu.menu-dark .navigation > li.hover > a,
html body .main-menu.menu-dark .navigation > li.open > a {
    background: var(--sb-hover);
    color: #fff;
}

html body .main-menu.menu-dark .navigation > li.active:not(.has-sub) > a {
    background: var(--sb-accent);
    color: #fff;
    font-weight: 500;
    box-shadow: inset 3px 0 0 #a4ccff, 0 3px 10px rgba(0, 0, 0, .08);
}

html body .main-menu.menu-dark .navigation > li:hover > a > i,
html body .main-menu.menu-dark .navigation > li.open > a > i,
html body .main-menu.menu-dark .navigation > li.active > a > i {
    color: #d5e7ff;
}

html body .main-menu.menu-dark .navigation .erp-code {
    flex: 0 0 auto;
    margin-left: 6px;
    padding: 1px 4px;
    border: 1px solid rgba(170, 193, 225, .14);
    border-radius: 4px;
    background: transparent;
    color: #a8bad2;
    font-size: 8px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: .03em;
}

html body .main-menu.menu-dark .navigation li.active > a .erp-code {
    border-color: rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

html body .main-menu.menu-dark .navigation li.has-sub > a {
    padding-right: 25px !important;
}

html body .main-menu.menu-dark .navigation li.has-sub > a::after {
    top: 50% !important;
    right: 12px !important;
    margin-top: -9px;
    color: var(--sb-muted);
}

/* Nested groups retain the theme's accordion behavior. */
html body .main-menu.menu-dark .navigation > li .menu-content {
    position: relative;
    margin: 5px 0 8px;
    background: transparent;
}

html body .main-menu.menu-dark .navigation > li .menu-content::before {
    content: '';
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 50px;
    width: 1px;
    background: var(--sb-line);
}

html body .main-menu.menu-dark .navigation > li .menu-content li > a,
html body .main-menu.menu-dark .navigation > li.open .menu-content li > a,
html body .main-menu.menu-dark .navigation > li.open .menu-content li.active > a {
    display: block;
    margin: 2px 10px 2px 72px;
    padding: 8px 10px !important;
    border-radius: 6px;
    background: transparent;
    color: var(--sb-text);
    font-size: 12.5px;
    line-height: 1.65;
    white-space: normal;
}

html body .main-menu.menu-dark .navigation > li .menu-content li > a:hover {
    background: var(--sb-hover);
    color: #fff;
}

html body .main-menu.menu-dark .navigation > li .menu-content li.active > a {
    background: rgba(77, 142, 235, .18);
    color: #c8dfff;
    box-shadow: inset 2px 0 0 #85b7ff;
}

html body .main-menu.menu-dark .navigation a:focus-visible,
html body .main-menu.menu-dark .navigation .navigation-header:focus-visible,
.nt-sidebar-search button:focus-visible {
    outline: 2px solid #9ac2ff;
    outline-offset: -2px;
}

/* Search reveals matching rows without changing the user's saved folds. */
html body .main-menu.menu-dark.nt-menu-searching .navigation > li.nt-fold-hide:not(.nt-search-hide) {
    display: block !important;
}

html body .main-menu.menu-dark.nt-menu-searching .navigation .menu-content {
    display: block !important;
}

html body .main-menu.menu-dark.nt-menu-searching .navigation li.nt-search-hide {
    display: none !important;
}

html body .main-menu.menu-dark.nt-menu-searching .navigation .navigation-header > span::after {
    margin-top: -4px;
    transform: rotate(45deg);
}

html body .main-menu.menu-dark.nt-menu-searching .navigation .navigation-header {
    cursor: default;
}

.nt-sidebar-empty {
    padding: 30px 15px;
    color: var(--sb-text);
    text-align: center;
}

.nt-sidebar-empty > i,
.nt-sidebar-empty > span,
.nt-sidebar-empty > small {
    display: block;
}

.nt-sidebar-empty > i {
    margin-bottom: 12px;
    color: var(--sb-muted);
    font-size: 23px;
}

.nt-sidebar-empty > span {
    font-size: 12px;
}

.nt-sidebar-empty > small {
    margin-top: 6px;
    color: var(--sb-muted);
    font-size: 10px;
}

/* The 60px rail expands on hover through the existing menu controller. */
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .nt-sidebar-tools {
    margin: 0 8px 8px;
    padding: 16px 0 12px;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .nt-sidebar-heading {
    justify-content: center;
    margin: 0;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .nt-sidebar-heading-text,
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .nt-sidebar-search,
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .nt-sidebar-empty,
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation .erp-code,
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation > li > a > .menu-title,
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation .navigation-header > span,
body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation .navigation-header .nt-sec-ic {
    display: none;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation > li.nt-fold-hide:not(.nt-search-hide) {
    display: block !important;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation > li .menu-content {
    display: none !important;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation > li > a {
    justify-content: center;
    min-height: 40px;
    margin: 3px 8px;
    padding: 10px 0 !important;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation > li > a > i {
    margin: 0;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation .navigation-header.nt-foldable {
    justify-content: center;
    min-height: 12px;
    margin: 8px 18px;
    padding: 0;
}

body.menu-collapsed .main-menu.menu-dark:not(.expanded) .navigation .navigation-header .feather.icon-minus {
    color: #4b607d;
    font-size: 12px;
}

html body .main-menu.menu-dark .main-menu-content::-webkit-scrollbar {
    width: 5px;
}

html body .main-menu.menu-dark .main-menu-content::-webkit-scrollbar-thumb,
html body .main-menu.menu-dark .ps__thumb-y {
    border-radius: 4px;
    background: #344862;
}

@media (prefers-reduced-motion: reduce) {
    html body .main-menu.menu-dark .navigation *,
    .nt-sidebar-search {
        animation: none !important;
        transition: none !important;
    }
}
