:root {
    --bg-base: #f9f9f9;
    --bg-white: #ffffff;
    --border-light: #f1f1f4;
    --text-dark: #181c32;
    --text-gray: #5e6278;
    --text-muted: #a1a5b7;
    --primary: #009ef7;
    --radius-lg: 12px;
}

* {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-base);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
    color: var(--text-dark);
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--bg-base);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.brand {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 25px;
    cursor: pointer;
}

.logo-box {
    width: 28px;
    height: 28px;
    background: #181c32;
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.logo-box svg {
    width: 18px;
    height: 18px;
}

.brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
}

.ChevronLogo {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-gray);
}

/* Search Box */
.search-container {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0 20px 25px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 12px;
}

.search-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shortcut {
    font-size: 10px;
    border: 1px solid var(--border-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Sidebar Scroll Area */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 15px;
}
.sidebar-scroll::-webkit-scrollbar { display: none; }

.main-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link i:first-child {
    width: 24px;
    text-align: left;
    font-size: 13px;
    color: var(--text-muted);
    margin-right: 2px;
}

.nav-arrow {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    transition: transform 0.2s;
}

.nav-link:hover {
    color: var(--text-dark);
    background: rgba(0,0,0,0.02);
}
.nav-link:hover i:first-child {
    color: var(--text-dark);
}

.nav-link.active {
    background: var(--bg-white);
    color: var(--text-dark);
    box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.02);
}
.nav-link.active i:first-child {
    color: var(--text-dark);
}

/* Dropdown Menu Styles */
.nav-item {
    display: flex;
    flex-direction: column;
}

.sub-menu {
    display: none;
    flex-direction: column;
    padding-left: 28px; /* Indent sub-menu items */
    margin-top: 2px;
}

.nav-item.expanded .sub-menu {
    display: flex;
}

.nav-item.expanded .nav-arrow {
    transform: rotate(180deg);
}

.sub-nav-link {
    padding: 8px 12px;
    color: var(--text-gray);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sub-nav-link:hover {
    color: var(--text-dark);
    background: rgba(0,0,0,0.02);
}

/* Sections */
.menu-section {
    margin-top: 25px;
    margin-bottom: 5px;
}

.menu-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    padding: 0 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-icon {
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
}
.action-icon:hover {
    color: var(--text-dark);
}

/* Sidebar Footer */
.sidebar-footer {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-top: auto;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-actions {
    margin-left: auto;
    display: flex;
    gap: 2px;
}

.footer-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: 0.2s;
}

.footer-btn:hover {
    background: var(--border-light);
    color: var(--text-dark);
}

/* Main Content Wrapper */
.content-wrapper {
    flex: 1;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-dark);
    margin: 0;
}

.btn-group {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    color: var(--text-gray);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0px 2px 4px rgba(0,0,0,0.01);
    transition: all 0.2s;
}

.btn-secondary i {
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: #fdfdfd;
    color: var(--text-dark);
    border-color: #d8d8e5;
}

.overview-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    flex: 1;
    border: 1px solid var(--border-light);
    box-shadow: 0px 5px 15px 0px rgba(0,0,0,0.02);
}
/* === Global Responsive Boilerplate === */
@media (max-width: 900px) {
    .sidebar { position: absolute; left: -100%; transition: left 0.3s ease; z-index: 1000; box-shadow: 10px 0 30px rgba(0,0,0,0.1); }
    .sidebar.active { left: 0; }
    .main-wrapper { margin-left: 0 !important; width: 100% !important; padding-left: 0 !important; }
    .topbar, .toolbar, .header { flex-direction: column; align-items: flex-start; height: auto !important; padding: 1rem !important; gap: 1rem; }
    .search-box, .search-bar, .search-input { width: 100% !important; max-width: 100% !important; }
    .toolbar-actions, .header-actions { flex-wrap: wrap; width: 100%; justify-content: flex-start; }
    .content, .main-content { padding: 1rem !important; }
    .dashboard-grid, .stats-grid, .features-grid, .mega-menu-content { grid-template-columns: 1fr !important; }
    .overview-grid, .pricing-grid { grid-template-columns: 1fr !important; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-img-box { margin: 0 auto; }
}

/* Mobile Header (Hidden by default) */
.mobile-header {
    display: none;
    height: 60px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.hamburger {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    body {
        flex-direction: column;
    }

    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -280px; /* Hide off-screen */
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
        height: 100vh;
        background: var(--bg-base);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar.active + .sidebar-overlay {
        display: block;
    }

    .content-wrapper {
        padding: 20px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .btn-group {
        width: 100%;
    }

    .btn-secondary {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .brand-name {
        display: none; /* Save space on tiny screens */
    }
    
    .page-title {
        font-size: 20px;
    }
}