/* ==========================================================================
   TIGMEIN - Global Glassmorphism Design System
   ========================================================================== */

:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);
    
    /* Brand Colors */
    --accent-primary: #10b981; /* Emerald Green */
    --accent-secondary: #f59e0b; /* Gold */
    --danger: #ef4444;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- 3D Ambient Orbs --- */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
}
.orb-1 { width: 50vw; height: 50vw; background: var(--accent-primary); top: -10%; left: -10%; }
.orb-2 { width: 40vw; height: 40vw; background: var(--accent-secondary); bottom: -10%; right: -10%; }

/* --- Shared Glass Classes --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* --- Layout Architecture --- */
#dashboard-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* --- Sidebar Navigation --- */
.sidebar {
    width: 260px;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}

.brand {
    padding: 30px 20px 20px;
    text-align: center;
    position: relative;
}
.brand h2 { color: var(--accent-primary); font-size: 1.5rem; letter-spacing: 1px; }
.brand p { font-size: 0.8rem; color: var(--text-muted); }

.close-sidebar-btn {
    display: none;
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none; color: var(--text-muted);
    font-size: 1.2rem; cursor: pointer;
}

.nav-menu {
    list-style: none;
    padding: 10px 15px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar */
}

.nav-item { margin-bottom: 5px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}
.nav-link i { font-size: 1.2rem; }
.nav-link:hover { background: var(--glass-hover); color: var(--text-main); }
.nav-link.active {
    background: var(--glass-hover);
    color: var(--text-main);
    border-left: 4px solid var(--accent-primary);
}

/* --- User Profile Bottom Widget --- */
.user-profile-sm {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.1);
}
.avatar-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--glass-hover);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-primary);
}
.user-info { flex-grow: 1; overflow: hidden; }
.user-info .name { font-size: 0.9rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.user-info .role { font-size: 0.75rem; color: var(--accent-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

.logout-btn {
    background: none; border: none; color: var(--danger);
    font-size: 1.2rem; cursor: pointer; transition: transform 0.2s;
}
.logout-btn:hover { transform: scale(1.1); }

/* --- Main Content Area --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.top-bar {
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
}

.menu-toggle {
    display: none;
    background: none; border: none; color: var(--text-main);
    font-size: 1.5rem; cursor: pointer;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.content-wrapper {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

/* --- Mobile Overlay --- */
.overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0, 0, 0, 0.6); /* Darkened slightly */
    backdrop-filter: blur(8px); /* Increased blur to hide content better */
    -webkit-backdrop-filter: blur(8px);
    z-index: 990; /* Forces it above main content */
    display: none; 
    opacity: 0; 
    transition: opacity 0.3s;
}
.overlay.active { 
    display: block; 
    opacity: 1; 
}

/* --- Responsiveness --- */
@media (max-width: 992px) {
    .sidebar { 
        position: fixed; 
        top: 0;
        left: 0;
        transform: translateX(-100%); 
        z-index: 1000; /* Forces sidebar to the absolute front */
        /* Make mobile sidebar more solid to prevent text bleed-through */
        background: rgba(15, 23, 42, 0.95); 
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    }
    .sidebar.active { 
        transform: translateX(0); 
    }
    .close-sidebar-btn { 
        display: block; 
    }
    .menu-toggle { 
        display: block; 
    }
    .top-bar { 
        padding: 0 20px; 
    }
    .content-wrapper { 
        padding: 20px; 
    }
}