/*
 * Design B: Collapsible Icon Rail Sidebar
 * Building Manager shell layout — icon rail with expand/collapse toggle
 *
 * Depends on builtair.css for brand tokens, typography,
 * Bootstrap overrides, cards, buttons, footer, etc.
 *
 * This file defines the shell chrome:
 *   - Icon rail sidebar (64px collapsed, 220px expanded)
 *   - Toggle button for expand/collapse
 *   - Flyout panel (admin sub-menu, collapsed state only)
 *   - Utility bar (top of main content)
 *   - Bottom tab bar (mobile)
 *   - Full-screen overlay nav (mobile)
 *   - Main content wrapper offsets
 */


/* ============================================================
   Layout variables
   ============================================================ */
:root {
    --rail-w:           64px;
    --rail-w-expanded:  220px;
    --rail-bg:          var(--nt-secondary);
    --rail-transition:  width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --utilbar-h:        44px;
    --mobile-tab-h:     56px;
}


/* ============================================================
   Body reset
   ============================================================ */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}


/* ============================================================
   ICON RAIL SIDEBAR (desktop, >= 992px)
   ============================================================ */
.rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    background: var(--rail-bg);
    z-index: 1050;
    flex-direction: column;
    align-items: center;
    padding: 0;
    overflow: visible;
    transition: var(--rail-transition);
}

.rail.d-none { display: none !important; }
.rail.d-lg-flex {
    display: none !important;
}
@media (min-width: 992px) {
    .rail.d-lg-flex {
        display: flex !important;
    }
}


/* --- Logo area --- */
.rail__logo {
    width: 100%;
    padding: 12px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rail__logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
}

.rail__logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nt-white);
    border-radius: var(--nt-radius-sm);
    width: 40px;
    height: 40px;
    padding: 4px;
    flex-shrink: 0;
}

.rail__logo-box img {
    height: 32px;
    width: auto;
    border-radius: 0;
}

.rail__logo-text {
    font-family: var(--nt-font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--nt-white);
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.2s ease 0.05s, max-width 0.25s ease;
}

.rail__org-name {
    display: none;
    width: 100%;
    padding: 0 16px 8px;
    font-family: var(--nt-font-body);
    font-size: 11px;
    font-weight: 500;
    color: var(--nt-white-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}


/* --- Primary nav items --- */
.rail__items {
    flex: 1;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Scrollbar styling for rail items */
.rail__items::-webkit-scrollbar {
    width: 3px;
}
.rail__items::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Individual nav button */
.rail__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px;
    min-height: 48px;
    padding: 6px 4px 4px;
    border-radius: var(--nt-radius);
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    position: relative;
    flex-shrink: 0;
}

.rail__btn i {
    font-size: 20px;
    line-height: 1;
}

.rail__btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--nt-white);
    text-decoration: none;
}

.rail__btn.active {
    background: var(--nt-primary);
    color: var(--nt-white);
}

/* Label below icon (collapsed state) */
.rail__label {
    font-family: var(--nt-font-body);
    font-size: 9px;
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
    text-align: center;
    line-height: 1.2;
}

/* Separator between primary and admin items */
.rail__separator {
    width: 36px;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 4px 0;
    flex-shrink: 0;
}

/* Notification badge on rail button */
.rail__badge {
    position: absolute;
    top: 2px;
    right: 4px;
    background: #dc3545;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 7px;
    text-align: center;
    padding: 0 3px;
}

/* Device jump-to widget in utility bar */
.utilbar__device-jump {
    display: flex;
    align-items: center;
}

.utilbar__device-select,
.utilbar__device-input {
    font-size: 11px;
    height: 28px;
    width: 150px;
    border-radius: var(--nt-radius-sm, 4px);
    border: 1px solid var(--nt-gray-200, #dee2e6);
    padding: 2px 8px;
}

.utilbar__device-select:focus,
.utilbar__device-input:focus {
    border-color: var(--nt-primary, #0d6efd);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

.device-jump-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    background: var(--nt-white, #fff);
    border: 1px solid var(--nt-gray-200, #dee2e6);
    border-top: none;
    border-radius: 0 0 var(--nt-radius-sm, 4px) var(--nt-radius-sm, 4px);
    max-height: 240px;
    overflow-y: auto;
    box-shadow: var(--nt-shadow-sm, 0 2px 8px rgba(0,0,0,0.1));
}

.device-jump-item {
    display: block;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--nt-text, #212529);
    text-decoration: none;
    cursor: pointer;
}

.device-jump-item:hover,
.device-jump-item:focus {
    background: var(--nt-highlight, #f0f4ff);
    color: var(--nt-primary, #0d6efd);
    text-decoration: none;
}

.device-jump-item.text-muted {
    color: var(--nt-gray-400, #adb5bd) !important;
    cursor: default;
}

/* --- Footer items (notifications, help) --- */
.rail__footer {
    width: 100%;
    padding: 4px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* --- Toggle button --- */
.rail__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--nt-white);
    border: 1px solid var(--nt-gray-200);
    color: var(--nt-gray-600);
    font-size: 12px;
    cursor: pointer;
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1051;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    box-shadow: var(--nt-shadow-xs);
    padding: 0;
    line-height: 1;
}

.rail__toggle:hover {
    border-color: var(--nt-primary);
    background: var(--nt-highlight);
    box-shadow: 0 0 0 3px rgba(69, 166, 178, 0.15);
}

.rail__toggle i {
    transition: transform 0.25s ease;
}


/* --- User section (bottom of rail, dropup trigger) --- */
.rail__user-section {
    display: flex;
    width: 100%;
    padding: 8px 4px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.rail__user-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    padding: 6px;
    background: none;
    border: none;
    border-radius: var(--nt-radius-sm);
    color: var(--nt-white);
    cursor: pointer;
    transition: background 0.15s;
}

.rail__user-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rail__user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--nt-white);
    font-size: 13px;
    flex-shrink: 0;
}

.rail__user-name {
    display: none;
    font-family: var(--nt-font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--nt-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rail__user-chevron {
    display: none;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-left: auto;
}

/* Dropdown menu styling */
.rail__user-dropdown {
    min-width: 200px;
    border-radius: var(--nt-radius-sm);
    font-family: var(--nt-font-body);
    font-size: 13px;
}

.rail__user-lang-item {
    padding: 8px 16px;
}

.rail__user-lang-item:hover,
.rail__user-lang-item:focus,
.rail__user-lang-item:active {
    background: transparent;
}

.rail__user-lang-item select {
    font-size: 12px;
    padding: 2px 6px;
    height: 28px;
}


/* ============================================================
   EXPANDED STATE (.rail--expanded)
   ============================================================ */
.rail--expanded {
    width: var(--rail-w-expanded);
}

/* Logo area: show text */
.rail--expanded .rail__logo {
    justify-content: flex-start;
    padding-left: 16px;
}

.rail--expanded .rail__logo-text {
    opacity: 1;
    max-width: 140px;
}

.rail--expanded .rail__org-name {
    display: block;
    text-align: left;
    padding-left: 16px;
}

/* Nav items: horizontal layout */
.rail--expanded .rail__items {
    align-items: stretch;
    padding: 4px 8px;
}

.rail--expanded .rail__btn {
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    gap: 12px;
    border-radius: var(--nt-radius);
}

.rail--expanded .rail__btn i {
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.rail--expanded .rail__label {
    font-size: 13px;
    font-weight: 500;
    margin-top: 0;
    max-width: none;
    text-align: left;
}

.rail--expanded .rail__btn.active {
    border-left: 3px solid var(--nt-white);
    padding-left: 9px;
}

/* Separator */
.rail--expanded .rail__separator {
    width: calc(100% - 16px);
    margin: 4px 8px;
}

/* Admin flyout button stays visible in the expanded state too — it opens
   the same flyout sub-menu the collapsed rail uses (see flyout repositioning
   below). The inline admin list is no longer rendered. */

/* Footer: horizontal layout */
.rail--expanded .rail__footer {
    align-items: stretch;
    padding: 4px 8px 8px;
}

.rail--expanded .rail__footer .rail__btn {
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    min-height: 36px;
    padding: 6px 12px;
    gap: 12px;
}

.rail--expanded .rail__footer .rail__label {
    font-size: 12px;
    margin-top: 0;
    max-width: none;
    text-align: left;
}

.rail--expanded .rail__footer .rail__badge {
    position: static;
    margin-left: auto;
}

/* Toggle button: flip chevron */
.rail--expanded .rail__toggle i {
    transform: rotate(180deg);
}

/* User section: show name & chevron when expanded */
.rail--expanded .rail__user-trigger {
    justify-content: flex-start;
    gap: 8px;
}
.rail--expanded .rail__user-name {
    display: inline;
}
.rail--expanded .rail__user-chevron {
    display: inline;
}


/* ============================================================
   FLYOUT PANEL (admin sub-menu, collapsed state only)
   ============================================================ */
.flyout {
    position: fixed;
    top: 0;
    left: var(--rail-w);
    bottom: 0;
    width: 220px;
    background: var(--nt-white);
    box-shadow: var(--nt-shadow-md);
    z-index: 1045;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    overflow-y: auto;
    padding: 20px 16px;
}

.flyout--open {
    transform: translateX(0);
    opacity: 1;
}

.flyout__section {
    margin-bottom: 16px;
}

.flyout__heading {
    font-family: var(--nt-font-heading);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--nt-text-muted);
    margin-bottom: 10px;
    padding: 0 8px;
}

.flyout__link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    font-family: var(--nt-font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--nt-secondary);
    text-decoration: none;
    border-radius: var(--nt-radius);
    transition: background 0.15s;
}

.flyout__link:hover {
    background: var(--nt-highlight);
    text-decoration: none;
}

.flyout__link.active {
    background: var(--nt-highlight);
    color: var(--nt-primary);
}

/* Backdrop for flyout */
.flyout__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    pointer-events: none;
    background: transparent;
}

.flyout__backdrop--visible {
    pointer-events: auto;
}

/* In the expanded rail state the flyout still works — it just sits beside the
   wider rail instead of the collapsed one. */
.rail--expanded ~ .flyout {
    left: var(--rail-w-expanded);
}


/* ============================================================
   UTILITY BAR (top of main content, desktop)
   ============================================================ */
.utilbar {
    position: fixed;
    top: 0;
    left: var(--rail-w);
    right: 0;
    height: var(--utilbar-h);
    background: var(--nt-white);
    border-bottom: 1px solid var(--nt-gray-150);
    z-index: 1040;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.utilbar.d-none { display: none !important; }
.utilbar.d-lg-flex {
    display: none !important;
}
@media (min-width: 992px) {
    .utilbar.d-lg-flex {
        display: flex !important;
    }
}

/* Adjust utilbar left when rail is expanded */
.shell-main--expanded ~ .utilbar,
.rail--expanded ~ .utilbar {
    left: var(--rail-w-expanded);
}

/* Utilbar sections */
.utilbar__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 0 0 auto;
}

.utilbar__left .breadcrumb {
    font-size: 13px;
    font-family: var(--nt-font-body);
    margin-bottom: 0;
}

.utilbar__left .breadcrumb-item a {
    color: var(--nt-text);
    font-weight: 400;
}

.utilbar__left .breadcrumb-item.active {
    color: var(--nt-text-muted);
}

.utilbar__center {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
}

.utilbar__org-link {
    text-decoration: none;
    color: inherit;
}

.utilbar__org-link:hover .utilbar__org {
    color: var(--nt-primary);
}

.utilbar__org {
    margin: 0;
    font-family: var(--nt-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--nt-secondary);
    white-space: nowrap;
}

.utilbar__project-select {
    width: auto;
    min-width: 140px;
    font-size: 12px;
    height: 30px;
}

.utilbar__right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.utilbar__lang-form select {
    width: 56px;
    font-size: 11px;
    padding: 1px 4px;
    height: 26px;
    border-radius: var(--nt-radius-sm);
}

.utilbar__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--nt-text);
    font-size: 16px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.utilbar__icon-btn:hover {
    background: var(--nt-highlight);
    color: var(--nt-primary);
    text-decoration: none;
}

.utilbar__notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 7px;
    text-align: center;
    padding: 0 3px;
}

.utilbar__user-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--nt-gray-200);
    border-radius: var(--nt-radius-pill);
    padding: 2px 10px 2px 2px;
    font-family: var(--nt-font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--nt-secondary);
    cursor: pointer;
    transition: border-color 0.15s;
    height: 30px;
}

.utilbar__user-btn:hover {
    border-color: var(--nt-primary);
}

.utilbar__user-btn::after {
    margin-left: 2px;
    font-size: 10px;
}

.utilbar__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--nt-highlight);
    color: var(--nt-primary);
    font-size: 12px;
}

.utilbar__username {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}


/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
.shell-main {
    margin-left: var(--rail-w);
    margin-right: 0;
    padding-top: calc(var(--utilbar-h) + 20px);
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 40px;
    min-height: 100vh;
    position: relative;
    flex: 1;
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.shell-main--expanded {
    margin-left: var(--rail-w-expanded);
}

/* Footer negative margins */
.shell-main .bm-footer {
    margin-left: -24px;
    margin-right: -24px;
    margin-bottom: -40px;
}


/* ============================================================
   MOBILE TOP BAR (< 992px) — hamburger + centred organisation
   ============================================================ */
.mobile-topbar {
    display: none;
}

@media (max-width: 991.98px) {
    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--utilbar-h);
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 8px;
        background: var(--nt-white);
        border-bottom: 1px solid var(--nt-gray-150);
        z-index: 1040;
    }
}

.mobile-topbar__brand {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mobile-topbar__brand img {
    height: 28px;
    width: auto;
    display: block;
}

.mobile-topbar__org {
    flex: 1;
    min-width: 0;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topbar__menu {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--nt-secondary);
    cursor: pointer;
}

/* Top-bar items dropdown panel */
.mobile-topbar__panel {
    position: absolute;
    top: 100%;
    right: 8px;
    margin-top: 4px;
    min-width: 230px;
    max-width: calc(100vw - 16px);
    display: flex;
    flex-direction: column;
    padding: 6px;
    background: var(--nt-white);
    border: 1px solid var(--nt-gray-150);
    border-radius: var(--nt-radius-md, 8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 1041;
}

.mobile-topbar__panel[hidden] {
    display: none;
}

.mobile-topbar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--nt-radius-sm, 6px);
    color: var(--nt-text);
    text-decoration: none;
    font-size: 14px;
}

.mobile-topbar__item i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.mobile-topbar__item:hover {
    background: var(--nt-gray-100);
    color: var(--nt-primary);
}

.mobile-topbar__item--danger {
    color: var(--nt-danger, #dc3545);
}

.mobile-topbar__divider {
    height: 1px;
    background: var(--nt-gray-150);
    margin: 6px 4px;
}

.mobile-topbar__select {
    width: 100%;
    margin: 4px 0;
}

.mobile-topbar__lang {
    margin: 0;
}

/* ============================================================
   MOBILE BOTTOM TAB BAR (< 992px)
   ============================================================ */
.mobile-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-tab-h);
    background: var(--nt-white);
    border-top: 1px solid var(--nt-gray-200);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 1050;
    padding: 0;
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.06);
}

.mobile-tabs__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--nt-text-muted);
    font-size: 20px;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.15s;
    position: relative;
}

.mobile-tabs__btn span {
    font-family: var(--nt-font-body);
    font-size: 10px;
    font-weight: 500;
    margin-top: 2px;
}

.mobile-tabs__btn:hover,
.mobile-tabs__btn.active {
    color: var(--nt-primary);
    text-decoration: none;
}

.mobile-tabs__btn.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nt-primary);
}

.mobile-tabs__badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: #dc3545;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 7px;
    text-align: center;
    padding: 0 3px;
}


/* ============================================================
   MOBILE FULL-SCREEN OVERLAY NAV
   ============================================================ */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--nt-white);
    z-index: 1060;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-overlay--open {
    transform: translateY(0);
}

.mobile-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nt-gray-150);
}

.mobile-overlay__brand {
    display: flex;
    align-items: center;
    font-family: var(--nt-font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--nt-secondary);
}

.mobile-overlay__close {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--nt-text);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.mobile-overlay__nav {
    padding: 12px 16px;
}

.mobile-overlay__nav hr {
    border-color: var(--nt-gray-150);
    margin: 8px 0;
}

.mobile-overlay__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    color: var(--nt-secondary);
    font-family: var(--nt-font-body);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--nt-radius);
    transition: background 0.15s;
}

.mobile-overlay__link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    color: var(--nt-accent);
}

.mobile-overlay__link:hover {
    background: var(--nt-highlight);
    text-decoration: none;
}

.mobile-overlay__link--danger {
    color: #dc3545;
}

.mobile-overlay__link--danger i {
    color: #dc3545;
}


/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */

/* Mobile (< 992px): no rail, use bottom tabs */
@media (max-width: 991.98px) {
    .shell-main {
        margin-left: 0;
        padding-top: calc(var(--utilbar-h) + 16px);
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: calc(var(--mobile-tab-h) + 20px);
    }

    .shell-main--expanded {
        margin-left: 0;
    }

    .shell-main .bm-footer {
        margin-left: -12px;
        margin-right: -12px;
        margin-bottom: calc(-1 * (var(--mobile-tab-h) + 20px));
    }
}

/* Tablet / small desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .shell-main {
        padding-left: 20px;
        padding-right: 20px;
    }

    .shell-main .bm-footer {
        margin-left: -20px;
        margin-right: -20px;
    }
}

/* Larger desktops (>= 1200px) */
@media (min-width: 1200px) {
    .shell-main {
        padding-left: 32px;
        padding-right: 32px;
    }

    .shell-main .bm-footer {
        margin-left: -32px;
        margin-right: -32px;
    }
}


/* ============================================================
   HELP LINK (floating, top-right of main content)
   ============================================================ */
.bm-help-link {
    position: absolute;
    top: calc(var(--utilbar-h) + 8px);
    right: 16px;
    font-size: 18px;
    color: var(--nt-text-muted);
    opacity: 0.6;
    transition: opacity 0.15s, color 0.15s;
    z-index: 10;
}

.bm-help-link:hover {
    opacity: 1;
    color: var(--nt-primary);
}
