body.bm-app,
body.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at var(--bm-cursor-x) var(--bm-cursor-y), var(--bm-glow), transparent 34rem),
        linear-gradient(135deg, #e9fbff 0%, #f7fbf8 48%, #fff5f8 100%);
    color: var(--bm-ink, #142033);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bm-dark body,
.bm-dark {
    background:
        radial-gradient(circle at var(--bm-cursor-x) var(--bm-cursor-y), var(--bm-glow), transparent 34rem),
        linear-gradient(135deg, #07131d 0%, #0b2332 52%, #1c1220 100%);
}

body.bm-app::before,
body.login-body::before {
    content: "";
    position: fixed;
    inset: auto clamp(1rem, 6vw, 5rem) -7rem auto;
    width: min(42vw, 34rem);
    aspect-ratio: 1;
    background: url("/assets/images/Seahorse.png") center / contain no-repeat;
    opacity: .08;
    pointer-events: none;
    transform: rotate(-8deg);
    z-index: 0;
}

.bm-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 292px 1fr;
    min-height: 100vh;
}

.bm-sidebar {
    grid-row: 1 / span 2;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.1rem;
    color: #dff9ff;
    background:
        linear-gradient(180deg, rgba(7, 26, 42, .96), rgba(6, 15, 26, .98)),
        url("/assets/images/Seahorse.png") center 88% / 14rem auto no-repeat;
    border-right: 1px solid rgba(18, 214, 232, .2);
    box-shadow: 1rem 0 3rem rgba(8, 25, 38, .16);
}

.bm-sidebar::after {
    content: "";
    position: absolute;
    left: 1.4rem;
    right: 1.4rem;
    bottom: 1.4rem;
    height: 5rem;
    border: 1px dashed rgba(255, 209, 102, .3);
    border-radius: 8px;
    opacity: .55;
    pointer-events: none;
}

.bm-sidebar-light {
    color: #183149;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(238, 250, 252, .92)),
        url("/assets/images/Seahorse.png") center 88% / 14rem auto no-repeat;
}

.brand {
    display: flex;
    align-items: center;
    gap: .78rem;
    color: inherit;
    text-decoration: none;
    font-size: 1.24rem;
    font-weight: 900;
    margin-bottom: 1.25rem;
}

.brand small {
    display: block;
    color: var(--bm-sun);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .92);
    border: 1px solid rgba(18, 214, 232, .35);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .65), 0 .8rem 1.5rem rgba(0, 0, 0, .18);
    overflow: hidden;
}

.brand-mark img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    transform: translateY(2px);
}

.bm-sidebar .nav-link {
    color: inherit;
    border-radius: 8px;
    padding: .68rem .78rem;
    margin-bottom: .18rem;
    border: 1px solid transparent;
    transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.bm-sidebar .nav-link:hover,
.bm-sidebar .nav-link:focus,
.bm-sidebar .nav-link.active {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(18, 214, 232, .28);
    transform: translateX(3px);
}

.bm-sidebar-light .nav-link:hover,
.bm-sidebar-light .nav-link:focus,
.bm-sidebar-light .nav-link.active {
    background: rgba(0, 135, 184, .1);
}

.nav-link.sub {
    padding-left: 2.35rem;
    font-size: .95rem;
}

.nav-section {
    margin: 1rem .75rem .35rem;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--bm-muted, #8fa0b2);
}

.bm-topbar {
    grid-column: 2;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 74px;
    padding: 0 1.5rem;
    background: rgba(255, 255, 255, .68);
    border-bottom: 1px solid var(--bm-border);
    backdrop-filter: blur(18px) saturate(1.15);
    box-shadow: 0 .5rem 2rem rgba(10, 44, 65, .08);
}

.bm-dark .bm-topbar {
    background: rgba(12, 28, 43, .72);
}

.bm-topbar strong {
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 900;
}

.bm-content {
    grid-column: 2;
    min-width: 0;
    padding: clamp(1rem, 2.5vw, 2rem);
}

.bm-content > .row:first-child,
.bm-content > .bm-card:first-child,
.bm-content > .alert:first-child {
    animation: bm-rise .38s ease both;
}

.bm-card,
.metric-card,
.card,
.modal-content {
    background: var(--bm-panel, rgba(255, 255, 255, .78));
    border: 1px solid var(--bm-border);
    border-radius: 8px;
    box-shadow: var(--bm-shadow);
    backdrop-filter: blur(18px) saturate(1.12);
}

.metric-card {
    position: relative;
    display: block;
    min-height: 8rem;
    padding: 1.25rem;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(18, 214, 232, .14), transparent 45%),
        linear-gradient(315deg, rgba(255, 90, 138, .12), transparent 44%);
    opacity: .75;
    pointer-events: none;
}

.metric-card span,
.metric-card strong {
    position: relative;
    z-index: 1;
}

.metric-card:hover,
.metric-card:focus {
    transform: translateY(-4px) rotateX(1deg);
    border-color: rgba(255, 90, 138, .42);
    box-shadow: 0 1.3rem 3rem rgba(0, 135, 184, .18);
}

.metric-card strong {
    display: block;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
    font-weight: 950;
    color: var(--bm-primary);
}

.metric-card span {
    display: inline-block;
    margin-bottom: .9rem;
    color: var(--bm-muted);
    font-weight: 800;
}

.bm-card h2,
.bm-card .h5 {
    font-weight: 900;
}

.bm-card h2::after,
.bm-card .h5::after {
    content: "";
    display: block;
    width: 4.2rem;
    height: .35rem;
    margin-top: .42rem;
    border: 2px solid var(--bm-accent);
    border-left: 0;
    border-right: 0;
    transform: rotate(-1.5deg);
    opacity: .78;
}

.table-card {
    overflow: hidden;
}

.table-card .table {
    margin: 0;
    color: var(--bm-ink);
}

.table > :not(caption) > * > * {
    border-color: rgba(0, 135, 184, .12);
}

.form-label {
    color: var(--bm-muted);
    font-size: .86rem;
    font-weight: 800;
}

.form-control,
.form-select {
    color: var(--bm-ink);
    background-color: rgba(255, 255, 255, .86);
    border-color: rgba(56, 72, 96, .18);
    border-radius: 8px;
}

.bm-dark .form-control,
.bm-dark .form-select {
    color: var(--bm-ink);
    background-color: rgba(7, 19, 29, .72);
    border-color: rgba(18, 214, 232, .22);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}

.mobile-nav a {
    display: block;
    padding: 1rem 1.25rem;
    color: #172331;
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.login-body {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    background: var(--bm-panel);
    border: 1px solid var(--bm-border);
    border-radius: 8px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    box-shadow: var(--bm-shadow);
    backdrop-filter: blur(18px) saturate(1.14);
}

.install-card {
    width: min(100%, 760px);
}

.bm-font-large {
    font-size: 1.08rem;
}

.bm-compact .bm-content {
    padding: 1rem;
}

.bm-compact .card-body,
.bm-compact .metric-card {
    padding: .85rem;
}

.status-pill {
    display: inline-flex;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(18, 214, 232, .14);
    color: var(--bm-primary);
    border: 1px solid rgba(18, 214, 232, .2);
    font-size: .85rem;
    font-weight: 800;
}

.bm-dark .bm-card,
.bm-dark .metric-card,
.bm-dark .card,
.bm-dark .modal-content {
    color: var(--bm-ink);
}

@keyframes bm-rise {
    from {
        opacity: 0;
        transform: translateY(.7rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 991.98px) {
    .bm-shell {
        display: block;
    }

    .bm-sidebar {
        display: none;
    }

    .bm-topbar {
        min-height: 64px;
        padding: 0 1rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 44px;
    }

    .table-responsive {
        border-radius: 8px;
    }

    body.bm-app::before,
    body.login-body::before {
        width: 72vw;
        right: -6rem;
        bottom: -4rem;
    }
}
