:root {
    /* --- PALETTE: Solar Flare --- */
    --bg: #030305; /* Deep Void */
    --surface: rgba(20, 20, 25, 0.5); /* Glass Surface */
    --surface-hover: rgba(255, 107, 0, 0.08);
    --border: rgba(255, 255, 255, 0.06);
    
    /* Neon Orange Accents */
    --accent: #ff5e00; 
    --accent-light: #ff9900;
    --glow: rgba(255, 94, 0, 0.5);
    
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.55);
    
    /* --- PHYSICS --- */
    /* Apple-style spring animation */
    --spring: cubic-bezier(0.25, 1, 0.3, 1); 
    --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    height: 100dvh;
    overflow: hidden; /* Desktopто скроллду жашырабыз */
    position: relative;
}

/* Ambient Background Light */
body::before {
    content: ''; position: absolute; top: -20%; left: -10%; width: 50%; height: 50%;
    background: radial-gradient(circle, rgba(255, 94, 0, 0.12), transparent 70%);
    filter: blur(80px); z-index: 0; animation: pulse 10s ease-in-out infinite alternate;
}

body::after {
    content: ''; position: absolute; bottom: -20%; right: -10%; width: 60%; height: 60%;
    background: radial-gradient(circle, rgba(255, 153, 0, 0.08), transparent 70%);
    filter: blur(80px); z-index: 0;
}

@keyframes pulse { 0% { opacity: 0.5; } 100% { opacity: 1; } }

.app-container { 
    display: flex; height: 100%; padding: 1.5rem; gap: 1.5rem; 
    position: relative; z-index: 10;
}

/* --- 1. SIDEBAR (GLASS NAVIGATION) --- */
.sidebar {
    width: 270px;
    background: var(--surface);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 35px 20px;
    display: flex; flex-direction: column;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    transition: all 0.6s var(--spring);
}

.logo { 
    display: flex; align-items: center; gap: 14px; 
    font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; 
    margin-bottom: 40px; color: #fff; padding-left: 10px;
}
.logo-icon { 
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    box-shadow: 0 0 20px var(--glow);
}

.nav-menu { display: flex; flex-direction: column; gap: 8px; }

.nav-menu a {
    text-decoration: none; color: var(--text-muted);
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; border-radius: 18px;
    font-weight: 600; font-size: 0.95rem;
    transition: 0.4s var(--spring);
    position: relative; overflow: hidden;
}

/* Hover Effect */
.nav-menu a:hover { color: #fff; background: var(--surface-hover); transform: translateX(5px); }

/* Active State (Glowing Lamp) */
.nav-menu a.active { 
    background: linear-gradient(90deg, rgba(255, 94, 0, 0.15), transparent);
    color: var(--accent-light);
    border-left: 3px solid var(--accent);
}

/* --- 2. MAIN AREA --- */
.main-content { 
    flex-grow: 1; display: flex; flex-direction: column; gap: 1.2rem; 
    min-width: 0; /* Flexbox bug fix */
}

.top-nav {
    height: 80px; flex-shrink: 0;
    background: var(--surface); backdrop-filter: blur(30px);
    border: 1px solid var(--border); border-radius: 26px;
    padding: 0 25px; display: flex; align-items: center; justify-content: space-between;
}

.search-field {
    background: rgba(0,0,0,0.3); border: 1px solid var(--border);
    border-radius: 50px; padding: 12px 24px; width: 350px;
    display: flex; align-items: center; gap: 12px;
    transition: 0.3s ease;
}
.search-field:focus-within { 
    border-color: var(--accent); 
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.15); 
    width: 380px;
}
.search-field input { 
    background: transparent; border: none; outline: none; 
    color: #fff; width: 100%; font-family: inherit; 
}

/* --- 3. BENTO GRID SYSTEM --- */
.bento-grid {
    display: grid; 
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, minmax(180px, 1fr));
    gap: 1.2rem; height: 100%;
    overflow-y: auto; padding-right: 5px; /* Скролл ичинде */
}

/* Custom Scrollbar */
.bento-grid::-webkit-scrollbar { width: 6px; }
.bento-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.bento-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 32px; padding: 35px;
    transition: 0.5s var(--spring);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
}

/* Glass Shine Effect on Hover */
.bento-item::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: 0.5s;
}
.bento-item:hover::before { left: 100%; }

.bento-item:hover { 
    transform: translateY(-6px) scale(1.01); 
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.6);
}

.hero-card { grid-column: span 4; align-items: flex-start; }
.hero-card h1 { 
    font-size: clamp(2.5rem, 6vw, 5rem); 
    font-weight: 800; line-height: 0.95; letter-spacing: -2px;
    background: linear-gradient(to right, #fff, rgba(255,255,255,0.6));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.stat-card { grid-column: span 2; }
.stat-value { font-size: 3.5rem; font-weight: 800; color: var(--accent-light); text-shadow: 0 0 30px rgba(255, 153, 0, 0.3); }

/* --- 4. ULTRA ADAPTIVE (RESPONSIVE) --- */

/* Laptop (1200px) */
@media (max-width: 1200px) {
    .sidebar { width: 88px; padding: 30px 15px; align-items: center; }
    .sidebar span, .logo span { display: none; }
    .nav-menu { gap: 15px; width: 100%; }
    .nav-menu a { justify-content: center; padding: 18px; border-radius: 22px; }
    .nav-menu a.active { border-left: none; background: var(--accent); color: #000; }
}

/* Tablet (900px) */
@media (max-width: 900px) {
    .bento-grid { grid-template-columns: 1fr 1fr; display: flex; flex-direction: column; }
    .hero-card { min-height: 250px; }
    .stat-card { min-height: 160px; }
    .search-field { width: 220px; }
}

/* Mobile (768px) - THE ISLAND UI */
@media (max-width: 768px) {
    body { overflow: auto; } /* Телефондо жалпы скроллду күйгүзөбүз */
    .app-container { 
        flex-direction: column; padding: 15px; 
        height: auto; min-height: 100dvh;
        gap: 15px;
    }

    /* Top Nav Styling */
    .top-nav { 
        height: 70px; padding: 0 15px; 
        position: sticky; top: 10px; z-index: 50; /* Жабышып турат */
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
    .search-field { width: 100%; }
    .upgrade-btn { display: none; }

    /* Main Content */
    .main-content { margin-bottom: 100px; /* Менюга орун */ }

    /* THE FLOATING ISLAND MENU (Меню калкып турат) */
    .sidebar {
        position: fixed; 
        bottom: 25px; left: 20px; right: 20px; /* Экрандын ортосунда */
        width: auto; height: 75px;
        flex-direction: row; justify-content: space-between; align-items: center;
        padding: 0 25px;
        border-radius: 100px; /* Pill Shape */
        background: rgba(15, 15, 20, 0.85); /* Darker Glass */
        backdrop-filter: blur(20px) saturate(180%);
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 20px 50px rgba(0,0,0,0.6);
        z-index: 100;
        margin: 0;
    }

    .logo { display: none; }
    .nav-menu { 
        flex-direction: row; width: 100%; justify-content: space-between; gap: 0; 
    }
    
    .nav-menu a { 
        padding: 12px; border-radius: 50%; /* Круглые кнопки */
        color: rgba(255,255,255,0.5);
    }
    
    .nav-menu a i { font-size: 1.4rem; }
    .nav-menu a span { display: none; } /* Текстти жашырабыз, иконкалар гана калат */

    .nav-menu a.active {
        background: var(--accent); 
        color: #fff;
        transform: translateY(-15px) scale(1.2); /* Активдүү кнопка секирип чыгат */
        box-shadow: 0 10px 20px var(--glow);
        border: 4px solid var(--bg); /* Контраст */
    }
}