:root {
    /* Core Branding */
    --primary-vibrant: #6347ea;
    --primary-glow: rgba(99, 71, 234, 0.4);

    /* Deep Dark Theme (#000000) */
    --bg-deep: #000000;
    --bg-surface: rgba(25, 25, 25, 0.6);
    --layout-bg: #000000;
    --sidebar-bg: rgba(0, 0, 0, 0.95);
    --header-bg: rgba(0, 0, 0, 0.85);
    --content-bg: #000000;

    /* Typography & Borders */
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.08);
    --sidebar-border: rgba(255, 255, 255, 0.06);
    --header-border: rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.03);

    /* Layout Dimensions */
    --sidebar-width: 72px;
    --header-height: 64px;
    --ui-height: 48px;

    /* Navigation */
    --nav-item-radius: 12px;
    --nav-hover-bg: rgba(99, 71, 234, 0.12);
    --nav-active-bg: rgba(99, 71, 234, 0.22);
    --nav-icon-dim: var(--text-dim);
    --nav-icon-active: var(--primary-vibrant);
}

/* ============================================================
   GLOBAL RESET & BASE
   ============================================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

input:focus {
    outline: unset !important;
    box-shadow: unset !important;
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.layout-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background-color: var(--layout-bg);
}

/* ============================================================
   SIDEBAR (Fixed Icon-only)
   ============================================================ */
.layout-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    z-index: 1050;
    overflow: visible;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-vibrant);
    flex-shrink: 0;
    margin-bottom: 32px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px var(--primary-glow);
    text-decoration: none;
}

.sidebar-brand svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 12px;
    overflow-y: visible;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--nav-item-radius);
    text-decoration: none;
    color: var(--nav-icon-dim);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    flex-shrink: 0;
}

.sidebar-nav-item:hover {
    background: var(--nav-hover-bg);
    color: var(--text-main);
}

.sidebar-nav-item.active {
    background: var(--nav-active-bg);
    color: var(--nav-icon-active);
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.sidebar-nav-item:hover svg {
    transform: scale(1.1);
}

/* Tooltip (Hover Toolbar) */
.sidebar-tooltip {
    position: absolute;
    left: 80px;
    top: 50%;
    transform: translateY(-50%) translateX(-10px);
    background: #1a1a2e;
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1100;
}

.sidebar-tooltip::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #1a1a2e;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item:hover .sidebar-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.sidebar-footer {
    width: 100%;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid var(--sidebar-border);
    padding-top: 12px;
    margin-top: 8px;
}

/* ============================================================
   HEADER
   ============================================================ */
.layout-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    display: flex;
    align-items: center;
    padding: 0 28px;
    z-index: 1040;
    gap: 16px;
}

.header-title-area {
    flex: 1;
}

.header-page-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.header-breadcrumb {
    font-size: 12px;
    color: var(--text-dim);
    margin: 2px 0 0;
}

/* Search overrides */
.header-search-wrap .bw-input.input-glass {
    height: 40px !important;
    width: 220px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.header-search-wrap .bw-input.input-glass:focus {
    width: 260px !important;
    border-color: var(--primary-vibrant) !important;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-glass);
}

.header-bell {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-glass) !important;
    transition: all 0.2s ease !important;
}

.header-bell:hover {
    background: var(--nav-hover-bg) !important;
    border-color: rgba(99, 71, 234, 0.3) !important;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */
.layout-main {
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    flex: 1;
    background-color: var(--content-bg);
}

.layout-content {
    margin-top: var(--header-height);
    padding: 28px;
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - var(--header-height));
}

.layout-content::-webkit-scrollbar {
    width: 5px;
}

.layout-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

/* ============================================================
   COMPONENTS & UTILITIES
   ============================================================ */
.glass {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--border-glass) !important;
}

.input-glass {
    background: var(--input-bg) !important;
    border: 1px solid var(--border-glass) !important;
    color: var(--text-main) !important;
    border-radius: .5rem;
}

/* Custom Primary Color Utilities */
.bg-primary-vibrant {
    background-color: var(--primary-vibrant) !important;
}

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

/* Bladewind Overrides */
.bw-button.primary {
    background-color: var(--primary-vibrant) !important;
    border-color: var(--primary-vibrant) !important;
}

.bw-statistic {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: var(--border-glass) !important;
    border-radius: 16px !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .layout-sidebar {
        display: none !important;
    }

    .layout-main {
        margin-left: 0 !important;
    }

    .layout-header {
        left: 0 !important;
        padding: 0 16px;
    }

    .layout-content {
        padding: 20px 16px 80px;
    }

    .mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 68px;
        background: var(--sidebar-bg);
        border-top: 1px solid var(--sidebar-border);
        backdrop-filter: blur(20px);
        display: flex;
        z-index: 1060;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        text-decoration: none;
        color: var(--nav-icon-dim);
    }

    .mobile-nav-item.active {
        color: var(--nav-icon-active);
    }

    .mobile-nav-label {
        font-size: 10px;
        font-weight: 600;
    }
}