/* ═══════════════════════════════════════════════════════════
   NAVBAR — Premium Clean UI
   ═══════════════════════════════════════════════════════════ */

/* ── Base navbar ── */
.nb-root {
    height: auto;
    min-height: 64px;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    transition: box-shadow 0.28s ease;
    z-index: 1030;
    flex-wrap: nowrap !important;
}

.nb-root.nb-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, .08), 0 6px 24px rgba(0, 0, 0, .05);
    border-bottom-color: transparent;
}

.nb-inner {
    height: 100%;
    padding: 0 20px;
    flex-wrap: nowrap;
    overflow: visible;
}

.logo-img {
    max-height: 44px;
    width: auto;
    object-fit: contain;
}

/* ── Root nav list ── */
.root-nav {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.root-nav>li>a.nav-link {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text-heading);
    padding: 7px 13px;
    border-radius: 10px;
    transition: color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}

.root-nav>li>a.nav-link:hover,
.root-nav>li>a.nav-link:focus {
    color: var(--theme-primary);
    background: rgba(0, 0, 0, .07);
}

.root-nav>li>a.nav-link-highlight {
    color: var(--theme-secondary);
    font-weight: 800;
}

.root-nav>li>a.nav-link-highlight:hover {
    color: var(--theme-primary);
}

/* ── Chevron in nav links ── */
.custom-drop-toggler-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.22s ease;
    vertical-align: middle;
    margin-left: 2px;
    display: inline-block;
}


.nav-link.show .custom-drop-toggler-icon {
    transform: rotate(180deg);
    color: var(--theme-primary);
}

/* ── Mega dropdown positioning ── */
.mega-dropdown {
    position: static !important;
    list-style: none;
}

.mega-menu {
    width: 100%;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% - 20px) !important;
    padding-top: 20px !important;
    margin-top: 0 !important;
    border: none !important;
    display: none;
    position: absolute;
    width: 100%;
    background-color: var(--bg-card);
}

/* Invisible bridge above the dropdown to cover any gap between nav-link and menu */
.mega-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

@keyframes nb-drop {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu[data-bs-popper] {
    top: 100% !important;
    margin-top: 0 !important;
}

/* ── Mega menu section titles ── */
.mega-title {
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--theme-primary);
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(var(--theme-primary-rgb), .06);
    border-radius: 8px;
    border-left: 3px solid var(--theme-primary);
}

/* ── Mega list links ── */
.mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-list li {
    margin-bottom: 0;
}

.mega-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-heading);
    font-size: var(--fs-13);
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.18s ease;
    line-height: 1.4;
}

.mega-list a::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-medium);
    flex-shrink: 0;
    transition: background 0.18s ease;
}

.mega-list a:hover {
    color: var(--theme-primary);
}

.mega-list a:hover::before {
    background: var(--theme-primary);
}

/* ── Links dropdown ── */
.nb-section-title {
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--theme-primary);
    margin-bottom: 12px;
    padding: 6px 10px;
    background: rgba(var(--theme-primary-rgb), .06);
    border-radius: 8px;
    border-left: 3px solid var(--theme-primary);
}

.nb-link-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-heading);
    font-size: var(--fs-13);
    font-weight: 500;
    padding: 6px 0;
    transition: color 0.18s ease;
    line-height: 1.4;
}

.nb-link-list a::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--border-medium);
    flex-shrink: 0;
    transition: background 0.18s ease;
}

.nb-link-list a:hover {
    color: var(--theme-primary);
}

.nb-link-list a:hover::before {
    background: var(--theme-primary);
}

/* ── Service chips (Services mega dropdown) ── */
.nb-service-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-heading);
    font-size: var(--fs-13);
    font-weight: 500;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-light);
    transition: all 0.18s ease;
}

.nb-service-chip:hover {
    background: rgba(0, 0, 0, .07);
    border-color: rgba(0, 0, 0, .22);
    color: var(--theme-primary);
    transform: translateX(3px);
}

.nb-service-chip i[data-lucide] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-light);
}

.nb-service-chip:hover i[data-lucide] {
    color: var(--theme-primary);
}

/* ── Links dropdown inner panel ── */
.nb-links-panel {
    background: var(--bg-card);
    border-radius: 0 0 18px 18px;
    border: 1px solid var(--border-light) !important;
    border-top: 2.5px solid var(--theme-primary) !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .1), 0 2px 8px rgba(0, 0, 0, .04);
    animation: nb-drop 0.18s ease;
}

/* ── Mobile Links responsive ── */
@media (max-width: 991px) {
    .nb-links-panel .row {
        gap: 0;
    }

    .nb-links-panel .col-md-3 {
        border-bottom: 1px solid var(--bg-light);
        padding-bottom: 12px;
        margin-bottom: 8px;
    }

    .nb-links-panel .col-md-3:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
}

/* ── Quick Generate pill ── */
.qg-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 6px 14px !important;
    border: none !important;
    border-radius: 8px !important;
    color: var(--theme-primary) !important;
    font-size: var(--fs-lg) !important;
    font-weight: 800 !important;
    background: transparent !important;
    transition: color 0.18s ease !important;
}

.qg-pill:hover,
.qg-pill:focus {
    color: var(--theme-secondary) !important;
}

/* ── Quick Generate left panel ── */
.nb-qg-left {
    background: #f8f9fb;
    border-right: 1px solid rgba(0, 0, 0, .07);
    min-height: 420px;
    border-bottom-left-radius: 18px;
}

.service-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.service-menu li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-heading);
    margin-bottom: 3px;
    transition: background 0.15s ease, color 0.15s ease;
}

.service-menu li i[data-lucide] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--text-light);
}

.service-menu li:hover {
    background: rgba(0, 0, 0, .08);
    color: var(--theme-primary);
}

.service-menu li:hover i[data-lucide] {
    color: var(--theme-primary);
}

.service-menu li.active {
    background: var(--theme-primary);
    color: #fff;
    font-weight: 700;
}

.service-menu li.active i[data-lucide] {
    color: rgba(255, 255, 255, .8);
}

/* ── Quick Generate right panel ── */
.qg-right-panel {
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .2) transparent;
}

.qg-right-panel::-webkit-scrollbar {
    width: 5px;
}

.qg-right-panel::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, .2);
    border-radius: 999px;
}

/* ── Service boxes ── */
.service-box {
    display: none;
}

.service-box.active {
    display: block;
    animation: nb-drop 0.16s ease;
}

/* ── Premium service card ── */
.premium-service-card {
    border: 1px solid rgba(0, 0, 0, .08) !important;
    border-radius: 14px;
    background: var(--bg-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
    overflow: hidden;
}

.premium-service-card:hover {
    transform: translateY(-5px);
    box-shadow: none;
    border-color: rgba(0, 0, 0, .25) !important;
}

/* ── Icon wrappers ── */
.icon-wrapper-free {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #065f46;
    flex-shrink: 0;
}

.icon-wrapper-paid {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #92400e;
    flex-shrink: 0;
}

.icon-wrapper-premimum {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--theme-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.icon-wrapper-free i[data-lucide],
.icon-wrapper-paid i[data-lucide],
.icon-wrapper-premimum i[data-lucide] {
    width: 20px;
    height: 20px;
}

/* ── Badges ── */
.premium-badge {
    background: rgba(0, 0, 0, .12);
    color: var(--theme-primary);
    font-size: var(--fs-xs);
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: .3px;
    white-space: nowrap;
}

/* ── Service link ── */
.service-link {
    font-size: var(--fs-base);
    font-weight: 700;
    text-decoration: none;
    color: var(--theme-primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.18s ease, gap 0.18s ease;
}

.service-link:hover {
    color: var(--theme-primary);
    gap: 8px;
}

/* ── Simple service card (non-premium panels) ── */
.service-card {
    display: block;
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border-light);
    transition: all 0.22s ease;
    height: 100%;
    cursor: pointer;
}

.service-card h6 {
    margin-bottom: 4px;
    font-weight: 600;
    color: #111827;
}

.service-card small {
    color: #6b7280;
    font-size: var(--fs-13);
}

.service-card:hover {
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .22);
    transform: translateY(-3px);
    box-shadow: none;
}

/* ── Right-side auth buttons ── */
.btn-nav-login {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--theme-secondary);
    padding: 7px 15px;
    border-radius: 10px;
    text-decoration: none;
    background: transparent;
    border: 1.5px solid var(--theme-secondary);
    transition: background 0.18s ease, color 0.18s ease;
}

.btn-nav-login:hover {
    color: #fff;
    background: var(--theme-secondary);
}

.btn-nav-register {
    font-size: var(--fs-base);
    font-weight: 700;
    color: #fff;
    padding: 8px 18px;
    border-radius: 10px;
    background: var(--theme-primary);
    text-decoration: none;
    box-shadow: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.btn-nav-register:hover {
    transform: translateY(-2px);
    box-shadow: none;
    color: #fff;
}

/* ── Hamburger button ── */
.menu-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-heading);
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
    flex-shrink: 0;
}

.menu-btn:hover {
    border-color: var(--theme-primary);
    background: rgba(0, 0, 0, .06);
    color: var(--theme-primary);
}

.menu-btn i[data-lucide] {
    width: 20px;
    height: 20px;
}

/* ── OCR Search button ── */
.nb-ocr-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-heading);
    transition: all 0.18s ease;
}

.nb-ocr-btn:hover {
    border-color: var(--theme-primary);
    background: rgba(0, 0, 0, .06);
    color: var(--theme-primary);
}

.nb-ocr-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Quick Add button ── */
.nb-quickadd-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-heading);
    transition: all 0.18s ease;
}

.nb-quickadd-btn:hover {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), .06);
    color: var(--theme-primary);
    color: var(--theme-primary);
}

.nb-quickadd-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Quick Add dropdown panel ── */
.nb-quickadd-panel {
    width: 240px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .10);
    padding: 0;
    overflow: hidden;
    animation: nbQaIn .18s ease;
}

@keyframes nbQaIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nb-qa-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: var(--fs-base);
    color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), .04);
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), .1);
}

.nb-qa-section-label {
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #a1a1aa;
    padding: 8px 14px 3px;
}

.nb-qa-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    text-decoration: none;
    color: var(--text-heading);
    font-size: var(--fs-base);
    font-weight: 500;
    transition: background .12s;
}

.nb-qa-item:hover {
    background: rgba(var(--theme-primary-rgb), .08);
    color: var(--theme-primary);
}

.nb-qa-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-heading);
}

.nb-qa-item:hover .nb-qa-icon {
    color: var(--theme-primary);
}

.nb-qa-text {
    flex: 1;
}

.nb-qa-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 2px 10px;
}

/* ── Navbar WhatsApp button ── */
.nb-wa-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-heading);
    font-size: var(--fs-2xl);
    transition: all 0.18s ease;
}

.nb-wa-btn:hover {
    border-color: #25D366;
    background: rgba(37, 211, 102, .06);
    color: #25D366;
}

/* ── WhatsApp dropdown panel ── */
.nb-wa-panel {
    width: 300px;
    border: 1px solid #dee2e6;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
    padding: 0;
    overflow: hidden;
    animation: nbWaIn .18s ease;
}

@keyframes nbWaIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nb-wa-header {
    padding: 12px 16px;
    font-weight: 700;
    font-size: var(--fs-base);
    color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), .04);
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), .1);
}

.nb-wa-body {
    padding: 14px 16px;
    background: #fafafa;
}

.nb-wa-field {
    margin-bottom: 10px;
}

.nb-wa-label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #6b7280;
    margin-bottom: 4px;
}

.nb-wa-phone-row {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1.5px solid var(--border-medium);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color .15s;
}

.nb-wa-phone-row:focus-within {
    border-color: #25D366;
}

.nb-wa-prefix {
    padding: 7px 8px;
    font-size: var(--fs-sm);
    font-weight: 700;
    color: var(--text-heading);
    background: var(--bg-card-hover);
    border-right: 1px solid var(--border-light);
    user-select: none;
}

.nb-wa-phone {
    flex: 1;
    border: none;
    outline: none;
    padding: 7px 8px;
    font-size: var(--fs-13);
    background: transparent;
}

.nb-wa-msg {
    width: 100%;
    border: 1.5px solid var(--border-medium);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: var(--fs-sm);
    resize: none;
    outline: none;
    font-family: inherit;
    transition: border-color .15s;
}

.nb-wa-msg:focus {
    border-color: #25D366;
}

.nb-wa-tpls {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.nb-wa-tpl {
    font-size: var(--fs-2xs);
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    color: var(--text-heading);
    cursor: pointer;
    transition: all .12s;
}

.nb-wa-tpl:hover,
.nb-wa-tpl.active {
    background: #dcfce7;
    border-color: #25D366;
    color: #065f46;
}

.nb-wa-footer {
    padding: 10px 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
}

.nb-wa-send {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: #25D366;
    color: #fff;
    font-size: var(--fs-13);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s;
}

.nb-wa-send:hover {
    background: #128C7E;
}

/* ── WhatsApp company autocomplete ── */
.nb-wa-company-list {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 10;
    background: var(--bg-card); border: 1.5px solid var(--border-light); border-radius: 8px;
    max-height: 160px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,.1); margin-top: 2px;
}
.nb-wa-company-item {
    padding: 8px 12px; cursor: pointer; font-size: var(--fs-13);
    border-bottom: 1px solid var(--bg-light); transition: background .15s;
}
.nb-wa-company-item:hover { background: var(--bg-light); }
.nb-wa-company-item:last-child { border-bottom: none; }
.nb-wa-company-name { font-weight: 600; color: #1f2937; }
.nb-wa-company-type { font-size: var(--fs-xs); color: var(--text-light); }

/* ── User avatar button ── */
.btn-clean {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.user-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, .25);
    object-fit: cover;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn-clean:hover .user-avatar-img {
    border-color: var(--theme-primary);
    box-shadow: none;
}

/* ── User dropdown menu ── */
.nb-user-dropdown {
    min-width: 220px;
    border-radius: 14px !important;
    border: 1px solid rgba(0, 0, 0, .08) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
    padding: 4px !important;
    overflow: hidden;
    animation: nb-drop 0.16s ease;
}

.nb-user-info {
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.nb-user-name {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--text-ink);
    line-height: 1.3;
}

.nb-user-email {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nb-pkg-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
}

.nb-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1;
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

/* ── Profile Group (referral + avatar side by side) ── */
.nb-profile-group {
    gap: 6px !important;
}

/* ── Referral Quick Panel ── */
.nb-ref-dropdown {
    position: relative;
}

.nb-ref-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1.5px solid rgba(0, 0, 0, .12);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-heading);
    transition: all .18s ease;
    box-shadow: none;
}

.nb-ref-btn:hover {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), .06);
    color: var(--theme-primary);
}

.nb-ref-btn svg {
    width: 18px;
    height: 18px;
}

.nb-ref-pts-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--theme-primary);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: none;
    border: 2px solid #fff;
}

.nb-ref-panel {
    width: 280px;
    border-radius: 12px !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .10);
    padding: 0 !important;
    overflow: hidden;
    animation: nb-drop 0.16s ease;
    background: var(--bg-card);
}

.nb-ref-header {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary), var(--theme-primary-light));
}

.nb-ref-header-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    backdrop-filter: none;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 14px;
}

.nb-ref-header-icon svg {
    width: 26px;
    height: 26px;
    color: var(--theme-secondary);
}

.nb-ref-header-pts {
    font-size: var(--fs-2xl);
    font-weight: 900;
    line-height: 1.1;
}

.nb-ref-header-pts small {
    opacity: .7;
}

.nb-ref-header-label {
    font-size: var(--fs-2xs);
    opacity: .6;
    letter-spacing: .4px;
}

.nb-ref-section-label {
    font-size: var(--fs-2xs);
    letter-spacing: .5px;
}

.nb-ref-code-row {
    background: rgba(128,128,128,.1);
    border: 1.5px dashed rgba(128,128,128,.3);
}

.nb-ref-code-value {
    font-size: var(--fs-base);
    letter-spacing: 1.5px;
    color: var(--theme-secondary);
}

.nb-ref-link-input {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    background: var(--bg-card-hover);
    min-width: 0;
}

.nb-ref-copy-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s;
}

.nb-ref-copy-btn svg {
    width: 12px;
    height: 12px;
}

.nb-ref-copy-btn:hover {
    border-color: var(--theme-secondary) !important;
    color: var(--theme-secondary);
    background: rgba(58, 143, 25, .06);
}

.nb-ref-copy-btn.nb-ref-copied {
    border-color: var(--theme-secondary) !important;
    background: rgba(58, 143, 25, .08);
}

.nb-ref-qr-label {
    font-size: var(--fs-xs);
    letter-spacing: .4px;
}

#nbRefQrCode canvas {
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}

.nb-ref-earn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
    gap: 4px;
}

.nb-ref-earn-item {
    background: var(--bg-card-hover);
}

.nb-ref-earn-val {
    font-size: var(--fs-13);
    color: var(--theme-secondary);
    line-height: 1.2;
}

.nb-ref-earn-lbl {
    font-size: var(--fs-2xs);
    letter-spacing: .3px;
    margin-top: 1px;
}

.nb-ref-footer {
    background: var(--bg-card-hover);
}

.nb-ref-footer a {
    font-size: var(--fs-sm);
    color: var(--theme-secondary);
}

.nb-ref-footer a:hover {
    text-decoration: underline;
}

.nb-dd-item {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 9px 12px !important;
    border-radius: 10px !important;
    font-size: var(--fs-base) !important;
    font-weight: 500 !important;
    color: var(--text-ink) !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.nb-dd-item:hover {
    background: rgba(128, 128, 128, .1) !important;
    color: var(--theme-primary) !important;
}

.nb-dd-item i[data-lucide] {
    width: 15px;
    height: 15px;
    color: var(--text-light);
    flex-shrink: 0;
}

.nb-dd-item:hover i[data-lucide] {
    color: var(--theme-primary);
}

.nb-dd-danger,
.nb-dd-danger:hover {
    color: #dc2626 !important;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
}

.nb-dd-danger:hover {
    background: rgba(220, 38, 38, .07) !important;
}

.nb-dd-danger i[data-lucide],
.nb-dd-danger:hover i[data-lucide] {
    color: #dc2626 !important;
}

/* ── Mobile offcanvas ── */
.nb-offcanvas {
    max-width: 300px;
}

.mobile-section {
    margin-bottom: 6px;
}

.mobile-section h6 {
    font-size: var(--fs-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text-light);
    margin: 16px 0 6px;
    padding: 0 4px;
}

.mobile-section a.nav-link {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-heading);
    padding: 8px 10px;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-section a.nav-link:hover {
    color: var(--theme-primary);
    background: rgba(0, 0, 0, .07);
}

/* ══════════════════════════════════════════
   NOTIFICATION BELL
   ══════════════════════════════════════════ */
.nb-notif-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-heading);
    cursor: pointer;
    position: relative;
    transition: all .2s ease;
    box-shadow: none;
}

.nb-notif-btn:hover {
    border-color: var(--theme-primary);
    background: rgba(0, 0, 0, .06);
    color: var(--theme-primary);
}

.nb-notif-btn svg {
    width: 18px;
    height: 18px;
}

.nb-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--theme-primary);
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid #fff;
}

@keyframes notifBellShake {
    0% {
        transform: rotate(0);
    }

    15% {
        transform: rotate(14deg);
    }

    30% {
        transform: rotate(-14deg);
    }

    45% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(-8deg);
    }

    75% {
        transform: rotate(4deg);
    }

    85% {
        transform: rotate(-2deg);
    }

    100% {
        transform: rotate(0);
    }
}

.nb-notif-panel {
    min-width: 340px;
    max-width: 380px;
    border-radius: 12px !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .10);
    overflow: hidden;
    background: var(--bg-card);
}

.nb-notif-tab {
    background: none;
    border: none;
    padding: 4px 12px;
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s ease;
}

.nb-notif-tab:hover {
    color: var(--theme-primary);
}

.nb-notif-tab.active {
    color: var(--theme-primary);
    border-bottom-color: var(--theme-primary);
}

.nb-notif-hide-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    flex-shrink: 0;
    align-self: flex-start;
    transition: all .15s ease;
}

.nb-notif-hide-btn svg {
    width: 14px;
    height: 14px;
}

.nb-notif-hide-btn:hover {
    background: rgba(var(--theme-primary-rgb), .08);
    color: var(--theme-primary);
}

.nb-notif-mark-all {
    color: var(--theme-primary);
    font-size: var(--fs-13);
    cursor: pointer;
}

.nb-notif-mark-all svg {
    width: 14px;
    height: 14px;
}

.nb-notif-mark-all:hover {
    color: var(--theme-primary-dark);
}

.nb-notif-list {
    max-height: 380px;
    overflow-y: auto;
}

.nb-notif-item {
    cursor: pointer;
    transition: background .15s ease;
}

.nb-notif-item:hover {
    background: rgba(var(--theme-primary-rgb), .06);
}

.nb-notif-item.unread {
    background: var(--bg-card-hover);
}

.nb-notif-item.unread:hover {
    background: rgba(var(--theme-primary-rgb), .08);
}

.nb-notif-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 8px;
    box-sizing: border-box;
}

.nb-notif-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.nb-notif-icon.info {
    background: rgba(var(--theme-primary-rgb), .08);
    color: var(--theme-primary);
}

.nb-notif-icon.info svg { stroke: var(--theme-primary); }

.nb-notif-icon.warning {
    background: rgba(217,119,6,.1);
    color: #d97706;
}

.nb-notif-icon.warning svg { stroke: #d97706; }

.nb-notif-icon.success {
    background: rgba(58, 143, 25, .08);
    color: var(--theme-secondary);
}

.nb-notif-icon.success svg { stroke: var(--theme-secondary); }

.nb-notif-icon.alert {
    background: rgba(220,38,38,.1);
    color: #dc2626;
}

.nb-notif-icon.alert svg { stroke: #dc2626; }

.nb-notif-content h6 {
    font-size: var(--fs-13);
    color: var(--text-ink);
}

.nb-notif-content p {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    line-height: 1.4;
}

.nb-notif-time {
    font-size: var(--fs-xs);
    color: var(--text-light);
    margin-top: 2px;
}

.nb-notif-footer a {
    font-size: var(--fs-sm);
    color: var(--theme-primary);
}

.nb-notif-footer a:hover {
    color: var(--theme-primary-dark);
}

.nb-notif-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
    color: var(--text-light);
}

.nb-notif-empty svg {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
}

.nb-notif-empty p {
    margin: 0;
    font-size: var(--fs-13);
    font-weight: 500;
}

@media (max-width: 991px) {
    .nb-notif-panel {
        min-width: 300px;
        max-width: 340px;
    }
}

/* ── Reminder Button & Panel ── */
.nb-reminder-dropdown {
    position: relative;
}

.nb-reminder-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, .12);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-heading);
    cursor: pointer;
    position: relative;
    transition: all .2s;
}

.nb-reminder-btn:hover {
    border-color: var(--theme-primary);
    background: rgba(var(--theme-primary-rgb), .06);
    color: var(--theme-primary);
}

.nb-reminder-btn svg {
    width: 18px;
    height: 18px;
}

.nb-reminder-active {
    border-color: rgba(0, 0, 0, .12);
    background: transparent;
    color: var(--text-heading);
}

.nb-reminder-active:hover {
    border-color: var(--theme-primary);
    background: rgba(0, 0, 0, .06);
    color: var(--theme-primary);
}

.nb-reminder-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc2626;
    color: #fff;
    font-size: var(--fs-2xs);
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
}

.nb-reminder-panel {
    min-width: 360px;
    max-width: 400px;
    border-radius: 14px !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .12);
    padding: 0 !important;
    overflow: hidden;
    background: var(--bg-card);
}

.nb-reminder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(var(--theme-primary-rgb), .1);
    background: rgba(var(--theme-primary-rgb), .04);
    color: var(--theme-primary);
}

.nb-reminder-toolbar {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card-hover);
}

.nb-rt-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nb-rs-icon {
    font-size: var(--fs-sm);
    color: var(--text-light);
    flex-shrink: 0;
}

.nb-rs-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: var(--fs-13);
    color: var(--text-ink);
    padding: 0;
    min-width: 80px;
}

.nb-rs-input::placeholder {
    color: var(--text-light);
    font-weight: 500;
}

/* Filter toggle button */
.nb-rt-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-light);
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}

.nb-rt-toggle i {
    font-size: var(--fs-xs);
}

.nb-rt-toggle:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
    background: rgba(0, 0, 0, .04);
}

.nb-rt-toggle.nb-rt-toggle-on {
    background: var(--theme-primary);
    color: #fff;
    border-color: var(--theme-primary);
}

/* Filter panel (hidden by default, shown on toggle click) */
.nb-rt-filter-panel {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nb-rf-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nb-rf-label {
    font-size: var(--fs-2xs);
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: .4px;
    min-width: 52px;
    flex-shrink: 0;
}

.nb-rf-label i {
    font-size: var(--fs-2xs);
}

.nb-rf-pills {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.nb-rf-btn {
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}

.nb-rf-btn:hover {
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.nb-rf-btn.nb-rf-active {
    background: var(--theme-primary);
    color: #fff;
    border-color: var(--theme-primary);
}

.nb-rt-select {
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-ink);
    cursor: pointer;
    outline: none;
    flex: 1;
    min-width: 0;
}

.nb-rt-select:focus {
    border-color: var(--theme-primary);
}

.nb-rf-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-2xs);
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    padding: 0 4px;
    margin-left: 3px;
    background: rgba(0, 0, 0, .08);
    color: #6b7280;
}

.nb-rf-active .nb-rf-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

.nb-reminder-list {
    max-height: 340px;
    overflow-y: auto;
}

.nb-reminder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--bg-card-hover);
    transition: background .15s;
    cursor: pointer;
}

.nb-reminder-item:hover {
    background: rgba(var(--theme-primary-rgb), .06);
}

.nb-ri-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-13);
    flex-shrink: 0;
}

.nb-ri-icon-danger {
    background: rgba(220, 38, 38, .1);
    color: #dc2626;
}

.nb-ri-icon-warn {
    background: rgba(245, 158, 11, .1);
    color: #d97706;
}

.nb-ri-icon-pending {
    background: rgba(107, 114, 128, .1);
    color: #6b7280;
}

.nb-ri-body {
    flex: 1;
    min-width: 0;
}

.nb-ri-title {
    font-size: var(--fs-13);
    font-weight: 700;
    color: var(--text-ink);
    line-height: 1.3;
}

.nb-ri-company {
    font-size: var(--fs-xs);
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nb-ri-badge {
    font-size: var(--fs-2xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nb-badge-danger {
    background: #dc2626;
    color: #fff;
}

.nb-badge-warn {
    background: #f59e0b;
    color: #fff;
}

.nb-badge-pending {
    background: #6b7280;
    color: #fff;
}

.nb-reminder-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--bg-light);
    background: var(--bg-card-hover);
    text-align: center;
}


@media (max-width: 991px) {
    .nb-reminder-panel {
        min-width: 300px;
        max-width: 340px;
    }

    /* Referral panel responsive for tablets */
    .nb-ref-panel {
        width: 300px;
    }

    .nb-ref-btn {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }

    .nb-ref-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ── Quick Generate mobile button ── */
.nb-qg-mobile-btn {
    gap: 5px;
    background: var(--theme-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: var(--fs-13);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity .15s;
}

.nb-qg-mobile-btn:hover {
    opacity: .9;
}

/* ── Initials avatar circle ── */
.nb-initials-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--theme-primary-rgb), .1);
    border: 2px solid rgba(var(--theme-primary-rgb), .25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-base);
    font-weight: 800;
    color: var(--theme-primary);
    letter-spacing: -.3px;
    flex-shrink: 0;
    transition: all .18s;
}

.btn-clean:hover .nb-initials-btn {
    background: rgba(var(--theme-primary-rgb), .16);
    border-color: rgba(var(--theme-primary-rgb), .4);
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
    .nb-root {
        min-height: 58px;
    }

    .nb-inner {
        padding: 0 10px;
        flex-wrap: nowrap !important;
    }

    .navbar-brand {
        margin-right: auto;
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
    }

    .logo-img {
        max-height: 44px;
        width: auto;
    }

    .menu-btn {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .menu-btn i[data-lucide] {
        width: 18px;
        height: 18px;
    }

    /* Right actions */
    .nb-right-actions {
        gap: 4px !important;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    /* Generate button — icon only */
    .nb-qg-mobile-btn {
        padding: 6px 10px;
        font-size: var(--fs-sm);
        border-radius: 8px;
        white-space: nowrap;
    }

    .nb-profile-group {
        gap: 4px !important;
    }

    .nb-ref-btn {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .nb-ref-btn svg {
        width: 15px;
        height: 15px;
    }

    .nb-ref-pts-badge {
        top: -4px;
        right: -5px;
        min-width: 16px;
        height: 16px;
        font-size: var(--fs-2xs);
        padding: 0 4px;
        border-width: 1.5px;
    }

    /* Referral panel — fit within 370px screen */
    .nb-ref-panel {
        width: calc(100vw - 16px);
        max-width: 320px;
        right: -8px !important;
        border-radius: 14px !important;
    }

    .nb-ref-header {
        padding: 14px 14px 12px;
        gap: 10px;
    }

    .nb-ref-header-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .nb-ref-header-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    .nb-ref-header-pts {
        font-size: var(--fs-2xl);
    }

    .nb-ref-header-pts small {
        font-size: var(--fs-xs);
    }

    .nb-ref-header-label {
        font-size: var(--fs-2xs);
    }

    .nb-ref-body {
        padding: 12px 12px;
    }

    .nb-ref-section-label {
        font-size: var(--fs-2xs);
        margin-bottom: 5px;
    }

    .nb-ref-code-row {
        padding: 7px 10px;
        border-radius: 8px;
        gap: 6px;
    }

    .nb-ref-code-value {
        font-size: var(--fs-base);
        letter-spacing: 1px;
    }

    .nb-ref-copy-btn {
        width: 28px;
        height: 28px;
        border-radius: 7px;
    }

    .nb-ref-copy-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    .nb-ref-link-row {
        gap: 6px;
    }

    .nb-ref-link-input {
        padding: 6px 8px;
        font-size: var(--fs-xs);
        border-radius: 7px;
    }

    .nb-ref-share-row {
        gap: 6px;
        margin: 10px 0;
        padding-top: 10px;
    }

    .nb-ref-share-btn {
        height: 32px;
        border-radius: 8px;
    }

    .nb-ref-earn-grid {
        gap: 5px;
        padding-top: 10px;
    }

    .nb-ref-earn-item {
        padding: 6px 3px;
        border-radius: 7px;
    }

    .nb-ref-earn-val {
        font-size: var(--fs-sm);
    }

    .nb-ref-earn-lbl {
        font-size: var(--fs-2xs);
    }

    .nb-ref-footer {
        padding: 8px 12px;
    }

    .nb-ref-footer a {
        font-size: var(--fs-sm);
    }

    /* Notification & reminder panels */
    .nb-notif-panel {
        min-width: 280px;
        max-width: calc(100vw - 16px);
        right: -10px !important;
        left: auto !important;
    }

    .nb-reminder-panel {
        min-width: 280px;
        max-width: calc(100vw - 16px);
    }

    /* Avatar button */
    .user-avatar-img {
        width: 32px !important;
        height: 32px !important;
    }

    /* Initials button */
    .nb-initials-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: var(--fs-sm);
    }

    /* User dropdown on mobile */
    .nb-user-dropdown {
        min-width: 200px;
        max-width: calc(100vw - 16px);
        border-radius: 12px !important;
    }

    .nb-user-info {
        padding: 10px 10px !important;
    }

    .nb-user-name {
        font-size: var(--fs-13) !important;
    }

    .nb-user-email {
        font-size: var(--fs-xs) !important;
    }

    .nb-dd-item {
        padding: 8px 10px !important;
        font-size: var(--fs-13) !important;
        gap: 7px !important;
    }

    .nb-dd-item i[data-lucide] {
        width: 15px !important;
        height: 15px !important;
    }

    /* Other navbar buttons */
    .nb-ocr-btn,
    .nb-quickadd-btn,
    .nb-reminder-btn,
    .nb-theme-toggle,
    .nb-wa-btn,
    .nb-notif-btn,
    .nb-ref-btn {
        width: 34px;
        height: 34px;
    }

    .nb-ocr-btn svg,
    .nb-quickadd-btn svg,
    .nb-reminder-btn svg,
    .nb-theme-toggle svg,
    .nb-notif-btn svg,
    .nb-ref-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ── Extra small mobile (≤ 370px) ── */
@media (max-width: 370px) {
    .nb-root {
        min-height: 52px;
    }

    .nb-inner {
        padding: 0 6px;
        flex-wrap: nowrap !important;
    }

    .logo-img {
        max-height: 40px;
        width: auto;
    }

    .menu-btn {
        width: 34px;
        height: 34px;
    }

    /* Right actions */
    .nb-right-actions {
        gap: 3px !important;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }

    /* Generate button — compact icon */
    .nb-qg-mobile-btn {
        padding: 5px 8px;
        border-radius: 7px;
        white-space: nowrap;
    }

    .nb-qg-mobile-btn i {
        width: 14px !important;
        height: 14px !important;
    }

    .nb-profile-group {
        gap: 3px !important;
    }

    .nb-ref-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .nb-ref-btn svg {
        width: 14px;
        height: 14px;
    }

    .nb-ref-pts-badge {
        top: -3px;
        right: -4px;
        min-width: 15px;
        height: 15px;
        font-size: var(--fs-2xs);
        padding: 0 3px;
    }

    .nb-ref-panel {
        width: calc(100vw - 12px);
        max-width: 300px;
        right: -12px !important;
        border-radius: 12px !important;
    }

    .nb-ref-header {
        padding: 12px 12px 10px;
        gap: 8px;
    }

    .nb-ref-header-icon {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .nb-ref-header-icon svg {
        width: 16px !important;
        height: 16px !important;
    }

    .nb-ref-header-pts {
        font-size: var(--fs-xl);
    }

    .nb-ref-header-label {
        font-size: var(--fs-2xs);
    }

    .nb-ref-body {
        padding: 10px 10px;
    }

    .nb-ref-code-row {
        padding: 6px 8px;
        gap: 5px;
    }

    .nb-ref-code-value {
        font-size: var(--fs-13);
        letter-spacing: .8px;
    }

    .nb-ref-copy-btn {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }

    .nb-ref-link-input {
        padding: 5px 7px;
        font-size: var(--fs-2xs);
    }

    .nb-ref-share-btn {
        height: 30px;
        border-radius: 7px;
    }

    .nb-ref-earn-grid {
        gap: 4px;
    }

    .nb-ref-earn-item {
        padding: 5px 2px;
    }

    .nb-ref-earn-val {
        font-size: var(--fs-xs);
    }

    .nb-ref-earn-lbl {
        font-size: var(--fs-2xs);
        letter-spacing: .2px;
    }

    .nb-ref-footer {
        padding: 7px 10px;
    }

    .nb-ref-footer a {
        font-size: var(--fs-xs);
    }

    /* Other buttons */
    .nb-ocr-btn,
    .nb-quickadd-btn,
    .nb-reminder-btn,
    .nb-theme-toggle,
    .nb-wa-btn,
    .nb-notif-btn,
    .nb-ref-btn {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .nb-ocr-btn svg,
    .nb-quickadd-btn svg,
    .nb-reminder-btn svg,
    .nb-theme-toggle svg,
    .nb-notif-btn svg,
    .nb-ref-btn svg {
        width: 14px;
        height: 14px;
    }

    .nb-initials-btn {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        font-size: var(--fs-2xs);
    }

    /* User dropdown */
    .nb-user-dropdown {
        min-width: 180px;
        max-width: calc(100vw - 12px);
        border-radius: 10px !important;
        padding: 3px !important;
    }

    .nb-user-info {
        padding: 8px 8px !important;
    }

    .nb-user-name {
        font-size: var(--fs-13) !important;
    }

    .nb-user-email {
        font-size: var(--fs-xs) !important;
    }

    .nb-pkg-badge,
    .nb-points-badge {
        font-size: var(--fs-2xs) !important;
        padding: 2px 8px !important;
    }

    .nb-dd-item {
        padding: 7px 8px !important;
        font-size: var(--fs-sm) !important;
        border-radius: 8px !important;
        gap: 6px !important;
    }

    .nb-dd-item i[data-lucide] {
        width: 14px !important;
        height: 14px !important;
    }

    .nb-notif-panel,
    .nb-reminder-panel {
        min-width: 260px;
        max-width: calc(100vw - 12px);
        right: -10px !important;
        left: auto !important;
    }

    /* Offcanvas for tiny screens */
    .nb-offcanvas {
        max-width: 280px;
    }
}

/* ── Dark Mode — Navbar ── */
[data-theme="dark"] .nb-root {
    background: rgba(18, 19, 24, .98) !important;
    border-bottom: 1px solid var(--border-light);
}
[data-theme="dark"] .nb-root .nav-link { color: #c8ccd4; }
[data-theme="dark"] .nb-root .nav-link:hover,
[data-theme="dark"] .nb-root .nav-link.active { color: #fff; }
[data-theme="dark"] .nb-right-actions .nb-icon-btn { color: #c8ccd4; }
[data-theme="dark"] .nb-right-actions .nb-icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
[data-theme="dark"] .menu-btn { color: #c8ccd4; }
[data-theme="dark"] .navbar-brand .logo-img text { fill: #e5e7eb !important; }
[data-theme="dark"] .qg-pill { background: rgba(255,255,255,.08) !important; color: #c8ccd4 !important; border-color: rgba(255,255,255,.15) !important; }
[data-theme="dark"] .qg-pill:hover { background: rgba(255,255,255,.14) !important; color: #fff !important; }
[data-theme="dark"] .mega-menu { background: var(--bg-dropdown); border-color: var(--border-light); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .mega-menu a { color: var(--text-ink); }
[data-theme="dark"] .mega-menu a:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .nb-offcanvas { background: var(--bg-card); color: var(--text-ink); border-color: var(--border-light); }
[data-theme="dark"] .nb-profile-dropdown { background: var(--bg-dropdown); border-color: var(--border-light); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .nb-profile-dropdown a,
[data-theme="dark"] .nb-profile-dropdown button { color: var(--text-ink); }
[data-theme="dark"] .nb-profile-dropdown a:hover,
[data-theme="dark"] .nb-profile-dropdown button:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .nb-qa-item { color: var(--text-ink); }
[data-theme="dark"] .nb-qa-item:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .nb-qa-section-label { color: var(--text-muted); }
[data-theme="dark"] .nb-qa-text { color: var(--text-ink); }
[data-theme="dark"] .nb-qa-icon { color: var(--text-muted); }

/* Notification/Reminder dropdowns */
[data-theme="dark"] .nb-notif-dropdown,
[data-theme="dark"] .nb-reminder-dropdown { background: var(--bg-dropdown) !important; border-color: var(--border-light); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .nb-notif-item,
[data-theme="dark"] .nb-reminder-item { color: var(--text-ink); border-color: var(--border-light); }
[data-theme="dark"] .nb-notif-item:hover,
[data-theme="dark"] .nb-reminder-item:hover { background: rgba(255,255,255,.04); }

/* WhatsApp quick send */
[data-theme="dark"] .nb-wa-panel { border-color: var(--border-light); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
[data-theme="dark"] .nb-wa-header { background: rgba(var(--theme-primary-rgb),.08); border-bottom-color: var(--border-light); }
[data-theme="dark"] .nb-wa-body { background: var(--bg-card); }
[data-theme="dark"] .nb-wa-label { color: var(--text-muted); }
[data-theme="dark"] .nb-wa-phone-row { background: var(--bg-input); border-color: var(--border-light); }
[data-theme="dark"] .nb-wa-prefix { background: var(--bg-card-hover); border-right-color: var(--border-light); color: var(--text-ink); }
[data-theme="dark"] .nb-wa-phone { color: var(--text-ink); }
[data-theme="dark"] .nb-wa-phone::placeholder { color: var(--text-light); }
[data-theme="dark"] .nb-wa-msg { background: var(--bg-input); color: var(--text-ink); border-color: var(--border-light); }
[data-theme="dark"] .nb-wa-msg::placeholder { color: var(--text-light); }
[data-theme="dark"] .nb-wa-tpl { background: var(--bg-card-hover); border-color: var(--border-light); color: var(--text-ink); }
[data-theme="dark"] .nb-wa-tpl:hover,
[data-theme="dark"] .nb-wa-tpl.active { background: rgba(37,211,102,.12); border-color: #25D366; color: #6ee7b7; }
[data-theme="dark"] .nb-wa-footer { background: var(--bg-card-hover); border-top-color: var(--border-light); }
[data-theme="dark"] .nb-wa-dropdown input,
[data-theme="dark"] .nb-wa-dropdown select,
[data-theme="dark"] .nb-wa-dropdown textarea { background: var(--bg-input); color: var(--text-ink); border-color: var(--border-light); }
[data-theme="dark"] .nb-wa-company-list { background: var(--bg-dropdown); border-color: var(--border-light); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
[data-theme="dark"] .nb-wa-company-item { border-bottom-color: var(--border-light); }
[data-theme="dark"] .nb-wa-company-item:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .nb-wa-company-name { color: var(--text-ink); }
[data-theme="dark"] .nb-wa-company-type { color: var(--text-muted); }

/* Navbar action buttons — dark mode */
[data-theme="dark"] .nb-ocr-btn,
[data-theme="dark"] .nb-quickadd-btn,
[data-theme="dark"] .nb-wa-btn,
[data-theme="dark"] .nb-notif-btn,
[data-theme="dark"] .nb-reminder-btn,
[data-theme="dark"] .nb-theme-toggle,
[data-theme="dark"] .nb-ref-btn {
    border-color: #2e3140;
    background: #232630;
    color: #c8ccd4;
    box-shadow: none;
}
[data-theme="dark"] .nb-ocr-btn:hover,
[data-theme="dark"] .nb-quickadd-btn:hover,
[data-theme="dark"] .nb-notif-btn:hover,
[data-theme="dark"] .nb-reminder-btn:hover,
[data-theme="dark"] .nb-theme-toggle:hover,
[data-theme="dark"] .nb-ref-btn:hover {
    background: #2a2d38;
    border-color: #3a3d4a;
    color: #fff;
}
[data-theme="dark"] .nb-wa-btn:hover {
    border-color: #25D366;
    background: rgba(37,211,102,.12);
    color: #25D366;
}
[data-theme="dark"] .nb-reminder-active {
    border-color: #2e3140;
    background: #232630;
    color: #c8ccd4;
}
/* Theme toggle button */
.nb-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-heading);
    cursor: pointer;
    transition: all .18s ease;
}

/* ═══════════════════════════════════════════════════════════
   LOCALE TOGGLE — single button
   ═══════════════════════════════════════════════════════════ */
.nb-lang-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--ink, #111);
    font-size: var(--fs-13);
    font-weight: 800;
    font-family: inherit;
    letter-spacing: .3px;
    cursor: pointer;
    transition: color .2s ease;
    line-height: 1;
}

.nb-lang-btn:hover {
    color: var(--theme-primary, #2c53a9);
}

#nbLangForm { display: inline-flex; margin: 0; }

@media (max-width: 991.98px) {
    #nbLangForm {
        order: 2;
        margin-left: auto;
        margin-right: 8px;
    }

    .nb-lang-btn {
        width: 34px;
        height: 34px;
        font-size: var(--fs-sm);
    }
}

/* ── Dark mode ── */
[data-theme="dark"] .nb-lang-btn {
    border-color: #2e3140;
    background: #232630;
    color: #c8ccd4;
}

[data-theme="dark"] .nb-lang-btn:hover {
    background: #2a2d38;
    border-color: #3a3d4a;
    color: #fff;
}

/* ── Laptop compact (992px – 1399.98px): shrink right actions so all icons fit ── */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .nb-inner { padding: 0 12px; }

    .root-nav { gap: 0; }
    .root-nav > li > a.nav-link { padding: 6px 9px; font-size: var(--fs-sm); }

    .nb-right-actions { gap: 2px !important; }
    .nb-right-actions > .d-lg-flex { gap: 4px !important; }

    .nb-ocr-btn,
    .nb-quickadd-btn,
    .nb-reminder-btn,
    .nb-theme-toggle,
    .nb-wa-btn,
    .nb-notif-btn,
    .nb-ref-btn,
    .nb-lang-btn {
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }

    .nb-ocr-btn svg,
    .nb-quickadd-btn svg,
    .nb-reminder-btn svg,
    .nb-theme-toggle svg,
    .nb-wa-btn svg,
    .nb-notif-btn svg,
    .nb-ref-btn svg { width: 16px; height: 16px; }

    .nb-lang-btn { padding: 4px 8px; font-size: var(--fs-sm); }
}
.nb-theme-toggle:hover { background: transparent; color: var(--theme-primary); }