:root {
    --nw-sb-w: 288px;
    --nw-sb-rail: 68px;
    --nw-topbar-h: 60px;
    --nw-sb-bg: #f5f1ec;
    --nw-surface: #ffffff;
    --nw-line: #e6ded5;
    --nw-hover: #ece4da;
    --nw-ink: #221b17;
    --nw-ink-2: #3b322c;
    --nw-ink-3: #5e534b;
    --nw-ink-4: #6b6058;
    --nw-accent: #2f5482;
    --nw-accent-deep: #233f63;
    --nw-accent-soft: #e9eff7;
    --nw-gold: #a07a3c;
    --nw-tint: #efe7de;
    --nw-tint-hover: #e6dbcf;
    --nw-radius: 8px;
    --nw-shadow-active: 0 1px 2px rgba(60, 30, 20, 0.08), 0 0 0 1px rgba(60, 30, 20, 0.05);
    --nw-font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
    --nw-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.nw-sb {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    width: var(--nw-sb-w);
    display: flex;
    flex-direction: column;
    background: var(--nw-sb-bg);
    border-left: 1px solid var(--nw-line);
    font-family: var(--nw-font);
    color: var(--nw-ink-2);
    transition: width 200ms var(--nw-ease), transform 220ms var(--nw-ease);
}

.nw-sb a,
.nw-sb a:hover {
    text-decoration: none;
}

.nw-sb-top {
    height: var(--nw-topbar-h);
    flex: none;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-bottom: 1px solid var(--nw-line);
}

.nw-sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 4px 6px;
    border-radius: var(--nw-radius);
    color: var(--nw-ink);
}

.nw-sb-brand:hover {
    background: var(--nw-hover);
    color: var(--nw-ink);
}

.nw-sb-logo {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.nw-sb-brand-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.nw-sb-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 10px 20px;
    scrollbar-width: thin;
    scrollbar-color: #d4d4d4 transparent;
}

.nw-sb-nav::-webkit-scrollbar {
    width: 6px;
}

.nw-sb-nav::-webkit-scrollbar-thumb {
    background: #d4d4d4;
    border-radius: 6px;
}

.nw-sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 12px;
    margin: 2px 0;
    border-radius: var(--nw-radius);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--nw-ink-2);
    cursor: pointer;
    user-select: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.nw-sb-link:hover {
    background: var(--nw-hover);
    color: var(--nw-ink);
}

.nw-sb-link.is-active {
    background: var(--nw-surface);
    color: var(--nw-ink);
    box-shadow: var(--nw-shadow-active);
}

.nw-sb-icon {
    width: 22px;
    flex: none;
    font-size: 19px;
    line-height: 1;
    text-align: center;
    color: var(--nw-ink-3);
}

.nw-sb-link:hover .nw-sb-icon {
    color: var(--nw-ink);
}

.nw-sb-link.is-active .nw-sb-icon,
.nw-sb-group[data-active] > .nw-sb-head .nw-sb-icon {
    color: var(--nw-accent);
}

.nw-sb-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.nw-sb-head {
    list-style: none;
}

.nw-sb-head::-webkit-details-marker,
.nw-sb-head::marker {
    display: none;
    content: "";
}

.nw-sb-group[data-active] > .nw-sb-head {
    color: var(--nw-ink);
    font-weight: 600;
}

.nw-sb-caret {
    flex: none;
    font-size: 13px;
    color: var(--nw-ink-4);
    transform: rotate(90deg);
    transition: transform 160ms var(--nw-ease);
}

.nw-sb-group[open] > .nw-sb-head .nw-sb-caret {
    transform: rotate(0deg);
}

.nw-sb-items {
    padding: 2px 0 6px;
}

.nw-sb-item {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 12px;
    padding-inline-start: 46px;
    margin: 2px 0;
    border-radius: var(--nw-radius);
    font-size: 15.5px;
    line-height: 1.35;
    color: var(--nw-ink-3);
    transition: background-color 120ms ease, color 120ms ease;
}

.nw-sb-item:hover {
    background: var(--nw-hover);
    color: var(--nw-ink);
}

.nw-sb-item.is-active {
    background: var(--nw-surface);
    color: var(--nw-accent);
    font-weight: 600;
    box-shadow: var(--nw-shadow-active);
}

.nw-sb-section {
    padding: 14px 12px 4px;
    padding-inline-start: 46px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--nw-ink-4);
}

.nw-sb-items > .nw-sb-section:first-child {
    padding-top: 4px;
}

.nw-sb-divider {
    height: 1px;
    margin: 10px 6px;
    background: var(--nw-line);
}

.nw-sb-user {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--nw-line);
    font-size: 15px;
    color: var(--nw-ink-2);
}

.nw-sb-user .nw-sb-username {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.nw-sb-avatar {
    width: 34px;
    height: 34px;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--nw-accent-soft);
    color: var(--nw-accent);
    font-size: 15px;
    font-weight: 600;
}

.nw-sb a:focus-visible,
.nw-sb summary:focus-visible,
.nw-topbar button:focus-visible {
    outline: 2px solid var(--nw-accent);
    outline-offset: 1px;
}

::selection {
    background: var(--nw-accent-soft);
    color: var(--nw-accent-deep);
}

.nw-sb-overlay {
    display: none;
}

.wrapper > .content-wrapper,
.wrapper > .main-footer,
.wrapper > .main-header {
    margin-left: 0 !important;
    margin-right: var(--nw-sb-w) !important;
    transition: margin-right 200ms var(--nw-ease);
}

.nw-topbar {
    height: var(--nw-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--nw-surface);
    border-bottom: 1px solid var(--nw-line);
    font-family: var(--nw-font);
}

.nw-topbar form {
    margin: 0;
}

.nw-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--nw-radius);
    background: transparent;
    color: var(--nw-ink-3);
    font-size: 20px;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease;
}

.nw-icon-btn:hover {
    background: #f1f1f1;
    color: var(--nw-ink);
}

.nw-tint-btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--nw-radius);
    background: var(--nw-tint);
    color: var(--nw-ink-2);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.nw-tint-btn:hover {
    background: var(--nw-tint-hover);
    color: var(--nw-ink);
}

.nw-page-head {
    padding: 18px 24px 6px;
}

.nw-page-title {
    margin: 0;
    font-family: var(--nw-font);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--nw-ink);
}

@media (min-width: 992px) {
    body.nw-rail .nw-sb {
        width: var(--nw-sb-rail);
    }

    body.nw-rail .wrapper > .content-wrapper,
    body.nw-rail .wrapper > .main-footer,
    body.nw-rail .wrapper > .main-header {
        margin-right: var(--nw-sb-rail) !important;
    }

    body.nw-rail .nw-sb-label,
    body.nw-rail .nw-sb-caret,
    body.nw-rail .nw-sb-items,
    body.nw-rail .nw-sb-divider {
        display: none;
    }

    body.nw-rail .nw-sb-top,
    body.nw-rail .nw-sb-user {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    body.nw-rail .nw-sb-link {
        justify-content: center;
        padding: 0;
    }

    body.nw-rail .nw-sb-group[data-active] > .nw-sb-head {
        background: var(--nw-surface);
        box-shadow: var(--nw-shadow-active);
    }
}

@media (max-width: 991.98px) {
    .nw-sb {
        transform: translateX(100%);
        box-shadow: none;
    }

    body.nw-sb-open .nw-sb {
        transform: none;
        box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
    }

    body.nw-sb-open .nw-sb-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1039;
        background: rgba(23, 23, 23, 0.32);
    }

    .wrapper > .content-wrapper,
    .wrapper > .main-footer,
    .wrapper > .main-header {
        margin-right: 0 !important;
    }

    .nw-page-head {
        padding: 14px 16px 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nw-sb,
    .nw-sb-caret,
    .wrapper > .content-wrapper,
    .wrapper > .main-footer,
    .wrapper > .main-header {
        transition: none;
    }
}
