* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {

    --bg: #070b14;

    --panel: rgba(15, 23, 42, 0.82);
    --panel-solid: #0f172a;

    --panel-hover: #172033;

    --border: rgba(148, 163, 184, 0.12);

    --text: #e5edf7;
    --muted: #8fa3bf;

    --primary: #3b82f6;
    --primary-hover: #2563eb;

    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;

    --radius: 16px;
}

body {

    font-family: Inter, sans-serif;

    background:
        radial-gradient(circle at top left,
            rgba(59, 130, 246, .12),
            transparent 30%),

        radial-gradient(circle at bottom right,
            rgba(139, 92, 246, .08),
            transparent 30%),

        var(--bg);

    color: var(--text);

    overflow: hidden;
}

#app {

    display: flex;
    height: 100vh;

}

/* =========================
           SIDEBAR
        ========================= */

.sidebar {

    width: 260px;
    background: var(--panel);
    border-right: 1px solid var(--border);

    display: flex;
    flex-direction: column;

    transition: .2s;

}

.sidebar.collapsed {

    width: 72px;

}

.sidebar-top {

    height: 72px;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;

    padding: 0 18px;

}

.brand {

    display: flex;
    align-items: center;
    gap: 12px;

}

.brand-logo {

    width: 42px;
    height: 42px;

    border-radius: 12px;

    background: linear-gradient(135deg,
            #2563eb,
            #1d4ed8);

    flex-shrink: 0;

}

.brand-info {

    overflow: hidden;

}

.brand-title {

    font-weight: 700;
    font-size: 15px;

}

.brand-subtitle {

    font-size: 11px;
    color: var(--muted);

}

.sidebar.collapsed .brand-info {

    display: none;

}

.sidebar-section {

    padding: 14px 10px;

}

.section-title {

    font-size: 11px;
    color: #64748b;

    margin-bottom: 10px;
    padding: 0 10px;

}

.sidebar.collapsed .section-title {

    display: none;

}

.nav-item {

    height: 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 12px;

    border-radius: 10px;

    cursor: pointer;

    color: #cbd5e1;

    transition: .15s;

    margin-bottom: 4px;

}

.nav-item:hover {

    background: #172033;

}

.nav-item.active {

    background: #1d4ed8;
    color: white;

}

.nav-left {

    display: flex;
    align-items: center;
    gap: 12px;

}

.nav-icon {

    width: 18px;
    text-align: center;

}

.badge {

    background: #1e293b;

    min-width: 22px;
    height: 22px;

    border-radius: 999px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;

}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .badge {

    display: none;

}

/* =========================
           WORKSPACE
        ========================= */

.workspace {

    flex: 1;

    display: flex;
    flex-direction: column;

    overflow: hidden;

}

/* =========================
           HEADER
        ========================= */

.header {

    height: 68px;

    background: var(--panel);

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 18px;

    gap: 20px;

}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    gap: 14px;

    min-width: 0;
}

.icon-btn {

    width: 38px;
    height: 38px;

    border: none;
    border-radius: 10px;

    background: #182235;
    color: white;

    cursor: pointer;

}

.breadcrumb {

    font-size: 13px;
    color: var(--muted);

}

.search {

    width: 360px;
    height: 42px;

    background: rgba(15, 23, 42, .7);

    border: 1px solid var(--border);

    border-radius: 12px;

    color: white;

    padding: 0 16px;

    transition: .15s;
}

.search:focus {

    border-color: rgba(59, 130, 246, .6);

    box-shadow:
        0 0 0 4px rgba(59, 130, 246, .12);
}

.toolbar-btn {

    height: 38px;

    padding: 0 16px;

    border: none;
    border-radius: 10px;

    background: #182235;

    color: white;

    cursor: pointer;

    font-size: 13px;

}

.toolbar-btn.primary {

    background: var(--primary);

}

.toolbar-btn.danger {

    background: var(--danger);

}

.profile {
    display: flex;
    align-items: center;
    gap: 10px;

    padding-left: 10px;

    border-left: 1px solid var(--border);

    min-width: 0;
}

.avatar {

    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #1e293b;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 700;

}

.profile>div {
    min-width: 0;
}

.profile-name,
.profile-role {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile .toolbar-btn {
    flex-shrink: 0;
}

/* =========================
           BULK BAR
        ========================= */

.bulkbar {

    height: 52px;

    background: #111827;

    border-bottom: 1px solid var(--border);

    display: none;
    align-items: center;

    gap: 10px;

    padding: 0 14px;

}

.bulkbar.active {

    display: flex;

}

/* =========================
           MAIN
        ========================= */

.main {

    flex: 1;

    display: flex;

    overflow: hidden;

}

/* =========================
           PAGE
        ========================= */

.page {

    flex: 1;

    overflow: auto;

    padding: 16px;

}

.stats {

    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));

    gap: 14px;

    margin-bottom: 16px;

}

.stat-card {

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 14px;

    padding: 16px;

}

.stat-title {

    font-size: 12px;
    color: var(--muted);

    margin-bottom: 10px;

}

.stat-value {

    font-size: 28px;
    font-weight: 700;

}

/* =========================
           GRID
        ========================= */

.grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(280px, 1fr));

    gap: 18px;
}

.client-card {

    background: var(--panel);

    backdrop-filter: blur(18px);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;

    position: relative;

    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .25);
}

.client-card:hover {

    border-color: rgba(59, 130, 246, .5);

    transform: translateY(-3px);

    background: rgba(20, 30, 50, .95);
}

.client-card.selected {

    outline: 2px solid #2563eb;

}

.client-toolbar {

    position: absolute;

    top: 10px;
    right: 10px;

    display: flex;
    gap: 6px;

    z-index: 5;

}

.mini-btn {

    width: 28px;
    height: 28px;

    border: none;

    border-radius: 8px;

    background: rgba(15, 23, 42, .9);

    color: white;

    cursor: pointer;

}

.preview {

    height: 150px;

    background: #0b1220;

    position: relative;

    overflow: hidden;
}

.preview img {

    width: 100%;
    height: 100%;

    object-fit: cover;

}

.preview::after {

    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(to top,
            rgba(0, 0, 0, .55),
            transparent 45%);
}

.live-badge {

    position: absolute;

    top: 10px;
    left: 10px;

    background: rgba(0, 0, 0, .5);

    backdrop-filter: blur(10px);

    height: 24px;

    border-radius: 999px;

    padding: 0 10px;

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 11px;

}

.live-dot {

    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: #22c55e;

    animation: pulse 1.5s infinite;

}

@keyframes pulse {

    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
    }

    100% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

}

.client-body {

    padding: 14px;

}

.hostname {

    font-weight: 600;
    margin-bottom: 4px;

}

.room {

    font-size: 12px;
    color: var(--muted);

    margin-bottom: 12px;

}

.metrics {

    display: flex;
    gap: 10px;

    margin-bottom: 12px;

}

.metric {

    flex: 1;

    background: #111827;

    border-radius: 10px;

    padding: 10px;

}

.metric-label {

    font-size: 11px;
    color: var(--muted);

    margin-bottom: 6px;

}

.metric-value {

    font-size: 16px;
    font-weight: 700;

}

.sparkline {

    width: 100%;
    height: 34px;

}

/* =========================
           ACTIVITY
        ========================= */

.activity {

    width: 340px;

    background: rgba(15, 23, 42, .75);

    backdrop-filter: blur(18px);

    border-left: 1px solid var(--border);
}

.activity-header {

    height: 68px;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;

    padding: 0 16px;

    font-weight: 600;

}

.activity-list {

    flex: 1;

    overflow: auto;

    padding: 10px;

}

.activity-item {

    display: flex;
    gap: 10px;

    background: #111827;

    border: 1px solid #1f2937;

    border-radius: 12px;

    padding: 12px;

    margin-bottom: 10px;

    font-size: 12px;

}

.activity-dot {

    width: 10px;
    height: 10px;

    border-radius: 50%;

    background: #22c55e;

    margin-top: 3px;

    flex-shrink: 0;

}

/* =========================
           FOOTER
        ========================= */

.footer {

    height: 36px;

    border-top: 1px solid var(--border);

    background: #0f172a;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 14px;

    font-size: 11px;

    color: var(--muted);

}

/* =========================
           CONTEXT
        ========================= */

.context {

    position: fixed;

    width: 200px;

    background: #111827;

    border: 1px solid var(--border);

    border-radius: 12px;

    overflow: hidden;

    display: none;

    z-index: 9999;

    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);

}

.context-item {

    height: 42px;

    display: flex;
    align-items: center;

    padding: 0 14px;

    cursor: pointer;

    font-size: 13px;

}

.context-item:hover {

    background: #172033;

}

/* =========================================================
ENTERPRISE TOOLBAR
========================================================= */

.enterprise-toolbar {

    background: rgba(15, 23, 42, .7);

    backdrop-filter: blur(18px);

    border-bottom: 1px solid var(--border);

    padding: 14px;

    display: flex;

    gap: 14px;

    overflow-x: auto;
}

.tool-btn,
.toolbar-btn {

    height: 40px;

    border-radius: 12px;

    border: 1px solid transparent;

    background: #172033;

    color: white;

    transition: .15s ease;
}

.tool-btn:hover,
.toolbar-btn:hover {

    background: #22314d;

    border-color: rgba(255, 255, 255, .08);
}

.toolbar-btn.ghost {

    background: transparent;

    border: 1px solid var(--border);
}


.stat-card {

    background: var(--panel);

    backdrop-filter: blur(16px);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 18px;

    min-height: 110px;
}

.toolbar-group {

    background: #111827;

    border: 1px solid #1f2937;

    border-radius: 12px;

    padding: 10px;

    min-width: max-content;
}

.toolbar-group-title {

    font-size: 11px;

    color: #94a3b8;

    margin-bottom: 8px;

    font-weight: 600;
}

.toolbar-row {

    display: flex;

    gap: 8px;

    flex-wrap: wrap;
}

.tool-btn {

    height: 40px;

    padding: 0 14px;

    border: none;

    border-radius: 10px;

    background: #182235;

    color: white;

    cursor: pointer;

    font-size: 13px;

    transition: .15s;
}

.tool-btn:hover {

    background: #22314d;
}

.tool-btn.primary {

    background: #2563eb;
}

.tool-btn.success {

    background: #16a34a;
}

.tool-btn.danger {

    background: #dc2626;
}

.quick-actions {

    display: flex;
    gap: 10px;

    margin-bottom: 16px;

    flex-wrap: wrap;
}

.quick-btn {

    height: 42px;

    padding: 0 16px;

    border: none;

    border-radius: 10px;

    background: #182235;

    color: white;

    cursor: pointer;

    transition: .15s;
}

.quick-btn:hover {

    background: #22314d;
}

.quick-btn.danger {

    background: #dc2626;
}

.grid {

    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(220px, 1fr));

    gap: 12px;
}

.grid.compact .client-card {

    transform: scale(.92);
}

.grid.compact .preview {

    height: 90px;
}

.overlay-stats {

    position: absolute;

    bottom: 8px;
    left: 8px;

    display: flex;
    gap: 6px;

    flex-wrap: wrap;
}

.overlay-stats span {

    background: rgba(0, 0, 0, .5);

    backdrop-filter: blur(10px);

    padding: 4px 8px;

    border-radius: 999px;

    font-size: 10px;
}

.health-bar {

    height: 6px;

    background: #111827;

    border-radius: 999px;

    overflow: hidden;

    margin-top: 10px;
}

.health {

    height: 100%;
}

.health.cpu {

    background: #2563eb;
}

.room-group {

    margin-bottom: 26px;
}

.room-header {

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 12px;

    font-weight: 600;

    font-size: 15px;
}

.client-card.dragging {

    opacity: .5;

    border: 2px dashed #2563eb;
}

.selection-box {

    position: fixed;

    border: 1px solid #3b82f6;

    background: rgba(59, 130, 246, .15);

    pointer-events: none;

    z-index: 99999;
}

.wall-mode .sidebar,
.wall-mode .activity {

    display: none;
}

.wall-mode .grid {

    grid-template-columns:
        repeat(auto-fill, minmax(180px, 1fr));
}

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

@media(max-width:1200px) {

    .activity {

        display: none;

    }

}

@media(max-width:900px) {

    .sidebar {

        position: fixed;

        left: -260px;

        top: 0;

        z-index: 999;

    }

    .sidebar.mobile-open {

        left: 0;

    }

    .search {

        width: 180px;

    }

}

@media(max-width:1200px) {

    .header-right .toolbar-btn.ghost {
        display: none;
    }

    .profile-name,
    .profile-role {
        max-width: 120px;
    }
}

.tenant-modal {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .7);
        backdrop-filter: blur(6px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 99999;
    }

    .tenant-modal.hidden {
        display: none;
    }

    .tenant-modal-box {
        width: 420px;
        background: #0f172a;
        border: 1px solid #1e293b;
        border-radius: 18px;
        padding: 24px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    }

    .tenant-modal-title {
        font-size: 22px;
        font-weight: 700;
        color: #fff;
    }

    .tenant-modal-desc {
        margin-top: 8px;
        color: #94a3b8;
        font-size: 14px;
    }

    .tenant-modal-group {
        margin-top: 18px;
    }

    .tenant-modal-group label {
        display: block;
        margin-bottom: 8px;
        color: #cbd5e1;
        font-size: 14px;
    }

    .tenant-select {
        width: 100%;
        height: 48px;
        border-radius: 12px;
        border: 1px solid #334155;
        background: #111827;
        color: white;
        padding: 0 14px;
        font-size: 15px;
    }

    .tenant-save-btn {
        width: 100%;
        height: 48px;
        margin-top: 22px;
        border: none;
        border-radius: 12px;
        background: #2563eb;
        color: white;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }

    .profile {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 8px 12px;

    border-radius: 14px;

    cursor: pointer;

    transition: .2s;
}

.profile-trigger:hover {
    background: rgba(255,255,255,.06);
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.profile-name {
    font-size: 14px;
    font-weight: 600;
}

.profile-role {
    font-size: 12px;
    color: #94a3b8;
}

.profile-arrow {
    font-size: 12px;
    opacity: .7;
    transition: .2s;
}

.profile.active .profile-arrow {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;

    top: calc(100% + 10px);
    right: 0;

    width: 220px;

    background: #111827;

    border: 1px solid rgba(255,255,255,.08);

    border-radius: 16px;

    padding: 8px;

    display: none;

    box-shadow:
        0 10px 40px rgba(0,0,0,.35);

    z-index: 999;
}

.profile.active .profile-menu {
    display: block;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 12px 14px;

    border-radius: 12px;

    cursor: pointer;

    font-size: 14px;

    transition: .2s;
}

.profile-menu-item:hover {
    background: rgba(255,255,255,.06);
}

.profile-menu-item.danger {
    color: #ef4444;
}

.profile-menu-item.danger:hover {
    background: rgba(239,68,68,.12);
}

/* =========================================
   MODERN GLASS LOADER
========================================= */

.boot-loader{
    position:fixed;
    inset:0;

    display:flex;
    align-items:center;
    justify-content:center;

    z-index:99999;

    background:
        radial-gradient(
            circle at top,
            rgba(59,130,246,.18),
            transparent 40%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(168,85,247,.14),
            transparent 35%
        ),
        rgba(2,6,23,.55);

    backdrop-filter:
        blur(18px)
        saturate(180%);

    -webkit-backdrop-filter:
        blur(18px)
        saturate(180%);

    transition:
        opacity .45s ease,
        visibility .45s ease;
}

.boot-loader.hidden{
    opacity:0;
    visibility:hidden;
    pointer-events:none;
}

.boot-loader-box{
    position:relative;

    display:flex;
    flex-direction:column;
    align-items:center;
    gap:18px;

    padding:42px 52px;

    border-radius:30px;

    background:
        linear-gradient(
            180deg,
            rgba(255,255,255,.08),
            rgba(255,255,255,.03)
        );

    border:1px solid rgba(255,255,255,.08);

    box-shadow:
        0 10px 40px rgba(0,0,0,.25),
        inset 0 1px 0 rgba(255,255,255,.05);

    overflow:hidden;
}

/* glow */

.boot-loader-box::before{
    content:"";

    position:absolute;
    inset:-120px;

    background:
        radial-gradient(
            circle,
            rgba(59,130,246,.18),
            transparent 60%
        );

    animation:
        pulseGlow 4s ease infinite;

    pointer-events:none;
}

/* spinner */

.boot-spinner{
    position:relative;

    width:68px;
    height:68px;

    border-radius:50%;

    border:
        3px solid rgba(255,255,255,.06);

    border-top:
        3px solid rgba(96,165,250,.95);

    border-right:
        3px solid rgba(168,85,247,.7);

    animation:
        bootSpin 1s linear infinite;

    box-shadow:
        0 0 25px rgba(59,130,246,.25);
}

.boot-spinner::after{
    content:"";

    position:absolute;
    inset:10px;

    border-radius:50%;

    background:
        rgba(255,255,255,.04);

    backdrop-filter:blur(4px);
}

/* text */

.boot-title{
    position:relative;

    font-size:24px;
    font-weight:700;
    letter-spacing:.4px;

    color:
        rgba(255,255,255,.96);
}

.boot-subtitle{
    position:relative;

    font-size:14px;
    font-weight:500;

    color:
        rgba(226,232,240,.72);

    letter-spacing:.2px;
}

/* loading dots */

.boot-subtitle::after{
    content:"";

    animation:dots 1.6s infinite;
}

/* animations */

@keyframes bootSpin{
    to{
        transform:rotate(360deg);
    }
}

@keyframes pulseGlow{

    0%{
        transform:scale(1);
        opacity:.55;
    }

    50%{
        transform:scale(1.15);
        opacity:.9;
    }

    100%{
        transform:scale(1);
        opacity:.55;
    }
}

@keyframes dots{

    0%{
        content:"";
    }

    33%{
        content:".";
    }

    66%{
        content:"..";
    }

    100%{
        content:"...";
    }
}