/*
 * Building Manager - NosmoTech Brand Stylesheet
 * Bootstrap 5 compatible
 *
 * Palette: Vivid Teal + Coral (Option D)
 * Fonts: Blinker (headings), Poppins (body/UI)
 */

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
    /* --- Brand colours (Vivid Teal + Coral) --- */
    --nt-primary:        #1FBAC9;   /* vivid teal – buttons, links, accents */
    --nt-primary-hover:  #179DAB;
    --nt-primary-active: #128A96;
    --nt-secondary:      #0A1E4D;   /* deep navy – headings, sidebar, dark accents */
    --nt-accent:         #F2735A;   /* warm coral – secondary CTAs, highlights */
    --nt-accent-hover:   #E0604A;
    --nt-highlight:      #DAFBFF;   /* pale cyan – subtle backgrounds */
    --nt-highlight-50:   rgba(31,186,201,0.22); /* teal @ 22% */
    --nt-white:          #FFFFFF;
    --nt-black:          #000000;
    --nt-white-muted:    rgba(255,255,255,0.6);

    /* --- Text colours --- */
    --nt-text:           #5A6370;   /* body text (slightly darker for contrast) */
    --nt-text-dark:      #0A1E4D;   /* headings – matches secondary */
    --nt-text-light:     #FFFFFF;
    --nt-text-muted:     #8E99A4;

    /* --- Grays --- */
    --nt-gray-50:        #f7f7f8;
    --nt-gray-100:       #ebebef;
    --nt-gray-150:       #e5e5e9;
    --nt-gray-200:       #d1d1db;
    --nt-gray-600:       #55556d;
    --nt-gray-700:       #3f3f50;
    --nt-gray-800:       #1d1d22;
    --nt-gray-900:       #121217;

    /* --- Background --- */
    --nt-body-bg:        #F0F6FC;   /* soft blue-gray page bg */

    /* --- Teal ramp (for data viz, charts, gradients) --- */
    --nt-teal-50:        #DAFBFF;
    --nt-teal-100:       #B0EEF5;
    --nt-teal-200:       #6FDAE6;
    --nt-teal-400:       #1FBAC9;   /* = primary */
    --nt-teal-500:       #179DAB;   /* = hover */
    --nt-teal-600:       #128A96;   /* = active */
    --nt-teal-700:       #0C6870;

    /* --- Air quality semantic colours --- */
    --aq-excellent:      #2D9F83;   /* sea green */
    --aq-good:           #1FBAC9;   /* teal = primary */
    --aq-moderate:       #E5A833;   /* amber */
    --aq-poor:           #E07A3A;   /* orange */
    --aq-hazardous:      #D64545;   /* red */

    /* --- Bootstrap semantic colour overrides --- */
    --bs-primary:        #1FBAC9;
    --bs-primary-rgb:    31, 186, 201;
    --bs-secondary:      #0A1E4D;
    --bs-secondary-rgb:  10, 30, 77;
    --bs-success:        #2D9F83;
    --bs-success-rgb:    45, 159, 131;
    --bs-danger:         #D64545;
    --bs-danger-rgb:     214, 69, 69;
    --bs-warning:        #E5A833;
    --bs-warning-rgb:    229, 168, 51;
    --bs-info:           #2196BD;
    --bs-info-rgb:       33, 150, 189;
    --bs-light:          #F0F6FC;
    --bs-light-rgb:      240, 246, 252;
    --bs-dark:           #0A1E4D;
    --bs-dark-rgb:       10, 30, 77;

    /* --- Typography --- */
    --nt-font-heading:   "Blinker", sans-serif;
    --nt-font-body:      "Poppins", sans-serif;

    /* --- Spacing / Layout --- */
    --nt-container-max:  1140px;
    --nt-radius:         8px;
    --nt-radius-sm:      4px;
    --nt-radius-lg:      12px;
    --nt-radius-pill:    30px;

    /* --- Shadows --- */
    --nt-shadow-xs:      0 1px 2px 0 rgba(10,30,77,.06);
    --nt-shadow-sm:      0 1px 3px 0 rgba(10,30,77,.08), 0 1px 2px 0 rgba(10,30,77,.05);
    --nt-shadow-md:      0 4px 6px -1px rgba(10,30,77,.08), 0 2px 4px -1px rgba(10,30,77,.05);
}


/* ============================================================
   Base / Reset overrides
   ============================================================ */
body {
    font-family: var(--nt-font-body);
    font-size: 15px;
    font-weight: 400;
    color: var(--nt-text);
    background-color: var(--nt-body-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--nt-font-heading);
    color: var(--nt-text-dark);
    letter-spacing: -0.3px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
}

h2 {
    font-family: var(--nt-font-body);
    font-size: 24px;
    font-weight: 600;
}

h3, h4, h5 {
    font-family: var(--nt-font-body);
    font-size: 15px;
    font-weight: 600;
}

h6 {
    font-family: var(--nt-font-body);
    font-size: 12px;
    font-weight: 600;
}

a {
    color: var(--nt-primary);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: var(--nt-primary-hover);
    text-decoration: underline;
}

p {
    margin-bottom: 1rem;
}

.text-muted {
    color: var(--nt-text) !important;
}

small, .small {
    font-size: 14px;
}

@media (max-width: 767px) {
    h1         { font-size: 20px; }
    h2         { font-size: 16px; }
    h3, h4, h5 { font-size: 13px; }
    body       { font-size: 13px; }
}


/* ============================================================
   Bootstrap overrides – Buttons
   ============================================================ */
.btn-primary {
    background-color: var(--nt-primary);
    border-color: var(--nt-primary);
    color: var(--nt-white);
    font-family: var(--nt-font-body);
    font-weight: 700;
    font-size: 15px;
    padding: 5px 30px;
    border-radius: var(--nt-radius-pill);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--nt-primary-hover);
    border-color: var(--nt-primary-hover);
    color: var(--nt-white);
}

.btn-primary:active {
    background-color: var(--nt-primary-active);
    border-color: var(--nt-primary-active);
}

.btn-secondary {
    background-color: var(--nt-secondary);
    border-color: var(--nt-secondary);
    color: var(--nt-white);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
}

.btn-secondary:hover {
    background-color: #0D2660;
    border-color: #0D2660;
    color: var(--nt-white);
}

.btn-success {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    color: var(--nt-white);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
}

.btn-success:hover {
    background-color: #258A71;
    border-color: #258A71;
    color: var(--nt-white);
}

.btn-danger {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    color: var(--nt-white);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
}

.btn-danger:hover {
    background-color: #C03535;
    border-color: #C03535;
    color: var(--nt-white);
}

.btn-warning {
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
    color: var(--nt-white);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
}

.btn-warning:hover {
    background-color: #D09528;
    border-color: #D09528;
    color: var(--nt-white);
}

.btn-info {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
    color: var(--nt-white);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
}

.btn-info:hover {
    background-color: #1A7FA3;
    border-color: #1A7FA3;
    color: var(--nt-white);
}

.btn-outline-primary {
    border-color: var(--nt-primary);
    color: var(--nt-primary);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
}

.btn-outline-primary:hover {
    background-color: var(--nt-primary);
    color: var(--nt-white);
}

.btn-outline-accent {
    border: 2px solid var(--nt-accent);
    color: var(--nt-accent);
    font-weight: 600;
    border-radius: var(--nt-radius-pill);
    background: transparent;
}

.btn-outline-accent:hover {
    background-color: var(--nt-accent);
    color: var(--nt-white);
}

.btn-accent {
    background-color: var(--nt-accent);
    border-color: var(--nt-accent);
    color: var(--nt-white);
    font-weight: 700;
    border-radius: var(--nt-radius-pill);
}

.btn-accent:hover {
    background-color: var(--nt-accent-hover);
    border-color: var(--nt-accent-hover);
    color: var(--nt-white);
}

.btn-sm {
    font-size: 14px;
    padding: 3px 16px;
}


/* ============================================================
   Bootstrap overrides – Cards
   ============================================================ */
.card {
    border: none;
    border-radius: var(--nt-radius);
    box-shadow: var(--nt-shadow-sm);
    background-color: var(--nt-white);
}

.card-title {
    color: var(--nt-text-dark);
    font-family: var(--nt-font-heading);
    font-weight: 600;
}

.card-footer {
    background-color: var(--nt-gray-50);
}


/* ============================================================
   Bootstrap overrides – Badges
   ============================================================ */
.badge {
    font-family: var(--nt-font-body);
    font-weight: 600;
    font-size: 12px;
    border-radius: var(--nt-radius-pill);
    padding: 4px 10px;
}

.badge.bg-success {
    background-color: var(--bs-success) !important;
    color: var(--nt-white);
}

.badge.bg-primary {
    background-color: var(--nt-primary) !important;
}

.badge.bg-danger {
    background-color: var(--bs-danger) !important;
}

.badge.bg-warning {
    background-color: var(--bs-warning) !important;
    color: var(--nt-white);
}

.badge.bg-info {
    background-color: var(--bs-info) !important;
    color: var(--nt-white);
}

/* Project lifecycle status badges — keyed by Project.status code
   _ = Setup, 1 = Ready, 3 = Monitoring, 6 = Complete, a = Archived */
.badge.project-status-_ {
    background-color: var(--bs-warning) !important;
    color: var(--nt-white);
}

.badge.project-status-1 {
    background-color: var(--bs-info) !important;
    color: var(--nt-white);
}

.badge.project-status-3 {
    background-color: var(--bs-success) !important;
    color: var(--nt-white);
}

.badge.project-status-6 {
    background-color: var(--nt-primary) !important;
    color: var(--nt-white);
}

.badge.project-status-a {
    background-color: var(--bs-secondary) !important;
    color: var(--nt-white);
}

/* RAG indicators — used for install-readiness badges in the project Pool tab */
.badge.rag-green {
    background-color: var(--bs-success) !important;
    color: var(--nt-white);
}

.badge.rag-amber {
    background-color: var(--bs-warning) !important;
    color: var(--nt-white);
}

.badge.rag-red {
    background-color: var(--bs-danger) !important;
    color: var(--nt-white);
}


/* ============================================================
   Bootstrap overrides – Tables
   ============================================================ */
.table {
    font-size: 14px;
}

.table thead th {
    font-family: var(--nt-font-body);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nt-gray-600);
    border-bottom-width: 2px;
}


/* ============================================================
   Bootstrap overrides – Nav tabs
   ============================================================ */
.nav-tabs .nav-link {
    font-family: var(--nt-font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--nt-text);
}

.nav-tabs .nav-link.active {
    color: var(--nt-primary);
    border-bottom-color: var(--nt-primary);
}

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


/* ============================================================
   Bootstrap overrides – Forms
   ============================================================ */
.form-control,
.form-select {
    border-radius: var(--nt-radius-sm);
    border-color: var(--nt-gray-200);
    font-size: 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--nt-primary);
    box-shadow: 0 0 0 0.2rem var(--nt-highlight-50);
}

.form-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--nt-secondary);
}


/* ============================================================
   Bootstrap overrides – Alerts
   ============================================================ */
.alert-primary {
    background-color: var(--nt-highlight);
    border-color: var(--nt-primary);
    color: var(--nt-secondary);
}

.alert-success {
    background-color: #e6f5f0;
    border-color: var(--bs-success);
    color: #1a6b54;
}

.alert-danger {
    background-color: #fce8e8;
    border-color: var(--bs-danger);
    color: #8a2020;
}

.alert-warning {
    background-color: #fdf4e0;
    border-color: var(--bs-warning);
    color: #7a5a10;
}

.alert-info {
    background-color: #e2f3f9;
    border-color: var(--bs-info);
    color: #14566e;
}


/* ============================================================
   Bootstrap overrides – Pagination
   ============================================================ */
.page-link {
    color: var(--nt-primary);
}

.page-item.active .page-link {
    background-color: var(--nt-primary);
    border-color: var(--nt-primary);
}


/* ============================================================
   Layout – Mobile top bar
   ============================================================ */
.bm-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background-color: var(--nt-white);
    border-bottom: 1px solid var(--nt-gray-200);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1050;
    box-shadow: var(--nt-shadow-sm);
    gap: 0.75rem;
}

.bm-mobile-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--nt-secondary);
    padding: 0.25rem;
    line-height: 1;
    cursor: pointer;
}

.bm-mobile-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.bm-mobile-logo {
    height: 36px;
    width: auto;
    border-radius: 0;
}

.bm-mobile-org {
    font-family: var(--nt-font-heading);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--nt-secondary);
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar overlay (mobile) */
.bm-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.bm-sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* Push main content below mobile header */
@media (max-width: 991.98px) {
    .bm-main {
        padding-top: calc(56px + 36px);
    }
}


/* ============================================================
   Layout – Sidebar
   ============================================================ */
.bm-sidebar {
    width: 250px;
    background-color: var(--nt-secondary);
    color: var(--nt-white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.bm-sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.bm-sidebar-brand {
    display: inline-block;
    text-decoration: none;
}

.bm-sidebar-brand:hover {
    text-decoration: none;
}

.bm-sidebar-logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--nt-white);
    border-radius: var(--nt-radius);
    padding: 6px 12px;
    margin-bottom: 0.5rem;
}

.bm-sidebar-logo {
    height: 44px;
    width: auto;
    border-radius: 0;
}

.bm-sidebar-org-name {
    font-family: var(--nt-font-heading);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--nt-white-muted);
    margin-bottom: 0;
    letter-spacing: -0.2px;
}

.bm-sidebar-nav {
    padding: 0;
    margin: 0;
    list-style: none;
}

.bm-nav-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-family: var(--nt-font-body);
    font-weight: 500;
    font-size: 14px;
    transition: background-color 0.2s, color 0.2s;
}

.bm-nav-item:hover {
    background-color: rgba(255,255,255,0.08);
    color: var(--nt-white);
    text-decoration: none;
}

.bm-nav-item.active {
    background-color: var(--nt-primary);
    color: var(--nt-white);
}

.bm-nav-item i {
    width: 1.25em;
    text-align: center;
}

.bm-user-info {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
    font-size: 0.875rem;
}

.bm-user-info a {
    color: var(--nt-white-muted);
    font-size: 0.75rem;
    font-weight: 400;
}

.bm-user-info a:hover {
    color: var(--nt-white);
}


/* ============================================================
   Layout – Main content
   ============================================================ */
.bm-main {
    margin-left: 250px;
    flex: 1;
    padding: 1.5rem;
    min-height: 100vh;
    position: relative;
}


/* ============================================================
   Header bar (top of main content area)
   ============================================================ */
.bm-header {
    background: linear-gradient(135deg, var(--nt-secondary) 0%, var(--nt-accent) 100%);
    color: var(--nt-white);
    padding: 1.5rem 2rem;
    border-radius: var(--nt-radius);
    margin-bottom: 1.5rem;
}

.bm-header h2 {
    color: var(--nt-white);
    font-family: var(--nt-font-heading);
    margin-bottom: 0.25rem;
}

.bm-header p {
    color: var(--nt-white-muted);
    margin-bottom: 0;
}


/* ============================================================
   Page header (breadcrumb + title + optional actions)
   ============================================================ */
.bm-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--nt-gray-150);
}

.bm-page-header h2 {
    margin-bottom: 0;
    font-size: 22px;
}

.bm-page-header .breadcrumb {
    margin-bottom: 0.25rem;
    font-size: 13px;
}

.bm-page-header .breadcrumb-item a {
    font-weight: 400;
}

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

.bm-page-header .bm-page-subtitle {
    color: var(--nt-text);
    font-size: 13px;
    margin: 0.15rem 0 0;
}

.bm-page-header .bm-page-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.bm-page-header .bm-page-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.25rem;
}

@media (max-width: 767px) {
    .bm-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .bm-page-header h2 {
        font-size: 18px;
    }
}


/* ============================================================
   Help link (docserve)
   ============================================================ */
.bm-help-link {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    font-size: 1.35rem;
    color: var(--nt-text-muted);
    z-index: 10;
    transition: color 0.15s;
}
.bm-help-link:hover {
    color: var(--nt-primary);
}


/* ============================================================
   Footer
   ============================================================ */
.bm-footer {
    background-color: var(--nt-secondary);
    color: rgba(255,255,255,0.6);
    padding: 2rem 0;
    margin-top: 3rem;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
}

.bm-footer a {
    color: var(--nt-primary);
    font-weight: 400;
    font-size: 14px;
}

.bm-footer a:hover {
    color: var(--nt-white);
}

.bm-footer .footer-heading {
    font-family: var(--nt-font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--nt-white);
    margin-bottom: 0.75rem;
}

.bm-footer .footer-text {
    font-size: 13px;
    line-height: 1.6;
}

.bm-footer-logo {
    height: 44px;
    width: auto;
    background: var(--nt-white);
    border-radius: var(--nt-radius-sm);
    padding: 4px 8px;
}

.bm-footer .footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
    margin-top: 1.5rem;
    font-size: 12px;
    text-align: center;
}

.bm-footer .footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    color: var(--nt-white);
    margin: 0 4px;
    transition: background-color 0.2s;
}

.bm-footer .footer-social a:hover {
    background-color: var(--nt-primary);
    text-decoration: none;
}


/* ============================================================
   Device cards (overview dashboard)
   ============================================================ */
.bm-device-card {
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.bm-device-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--nt-shadow-md);
}

.bm-device-id {
    font-family: var(--nt-font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--nt-text-dark);
    line-height: 1.2;
}

.bm-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Monitor pills on location cards: one pill per gadget,
   colour-coded by worst active alert severity.
   The pill is a container with a monitoring link on the left (activity icon +
   factory id label) that stretches to fill the pill, and an info-icon link on
   the right (→ device detail). */
.bm-monitor-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .7rem;
    font-family: var(--nt-font-mono, monospace);
    line-height: 1.4;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Monitoring link — fills the left side of the pill (activity icon + id label)
   and stretches to push the info-detail action to the right edge. */
a.bm-monitor-pill__link,
a.bm-monitor-pill__link:hover,
a.bm-monitor-pill__link:focus,
a.bm-monitor-pill__link:visited {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.85;
}

a.bm-monitor-pill__link:hover {
    opacity: 1;
}

.bm-monitor-pill__label {
    font-family: var(--nt-font-mono, monospace);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Icon links inherit the pill's text colour and beat default link rules. */
a.bm-monitor-pill__action,
a.bm-monitor-pill__action:hover,
a.bm-monitor-pill__action:focus,
a.bm-monitor-pill__action:visited {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: inherit;
    text-decoration: none;
    opacity: 0.75;
}

a.bm-monitor-pill__action:hover {
    opacity: 1;
}

.bm-monitor-pill--ok {
    background-color: var(--bs-success-bg-subtle);
    border-color: var(--bs-success-border-subtle);
    color: var(--bs-success-text-emphasis);
}

.bm-monitor-pill--info {
    background-color: var(--bs-info-bg-subtle);
    border-color: var(--bs-info-border-subtle);
    color: var(--bs-info-text-emphasis);
}

.bm-monitor-pill--warning {
    background-color: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
    color: var(--bs-warning-text-emphasis);
}

.bm-monitor-pill--critical {
    background-color: var(--bs-danger-bg-subtle);
    border-color: var(--bs-danger-border-subtle);
    color: var(--bs-danger-text-emphasis);
}


/* ============================================================
   Utility classes
   ============================================================ */
.bg-nt-highlight {
    background-color: var(--nt-highlight) !important;
}

.text-nt-primary {
    color: var(--nt-primary) !important;
}

.text-nt-secondary {
    color: var(--nt-secondary) !important;
}

.border-nt-primary {
    border-color: var(--nt-primary) !important;
}


/* ============================================================
   Responsive – collapse sidebar on mobile
   ============================================================ */
@media (max-width: 991.98px) {
    .bm-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1060;
    }

    .bm-sidebar.show {
        transform: translateX(0);
    }

    .bm-main {
        margin-left: 0;
    }

    /* Prevent body scroll when sidebar open */
    body.bm-sidebar-open {
        overflow: hidden;
    }
}


/* ============================================================
   Images – match nosmotech border-radius
   ============================================================ */
img {
    border-radius: var(--nt-radius);
}


/* ============================================================
   IAQ indicator gauges (overview cards) — three side-by-side
   gauges (Comfort / Air Quality / Ventilation) per card.
   ============================================================ */
.bm-aqi-gauge {
    width: 100%;
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    gap: 4px;
}

.bm-gauge-cell {
    flex: 1 1 0;
    min-width: 90px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.bm-gauge-cell__svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.bm-gauge-cell__label {
    margin-top: 2px;
    font-size: 0.72rem;
    color: #6c757d;
    text-align: center;
    letter-spacing: 0.02em;
}

.bm-aqi-gauge--loading .bm-gauge-cell__svg {
    opacity: 0.55;
}

/* Link wrapper — sits above the card's stretched-link so the gauges
   navigate to live monitoring instead of the device-detail page. */
.bm-aqi-gauge-link {
    display: block;
    position: relative;
    z-index: 2;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.bm-aqi-gauge-link:hover .bm-gauge-cell__svg {
    filter: brightness(1.04);
}

/* Overview "Overview" checkbox — collapses the gauge so cards become the
   shorter, pre-gauge summary card. */
html.bm-viz-hidden .bm-aqi-gauge,
html.bm-viz-hidden .bm-aqi-gauge-link { display: none; }

/* In compact mode the cards are short, so pack them in a denser responsive
   grid: 1 across on small screens up to 4 across at lg+. (The rows keep
   row-cols-1 as the gauge-mode default; these rules only apply when compact.) */
@media (min-width: 576px)  { html.bm-viz-hidden .bm-overview-cards > * { width: 50%; } }     /* sm: 2 */
@media (min-width: 768px)  { html.bm-viz-hidden .bm-overview-cards > * { width: 33.3333%; } } /* md: 3 */
@media (min-width: 992px)  { html.bm-viz-hidden .bm-overview-cards > * { width: 25%; } }      /* lg+: 4 max */
