:root {
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --bg-sidebar: #2b3035;
    --text-primary: #333333;
    --text-secondary: #878a99;
    --text-sidebar: #838fb9;
    --text-sidebar-hover: #ffffff;
    --accent: #ff6b35; /* Orange accent */
    --accent-light: #fff2ed;
    --border-color: #e9ebec;
    
    --success: #10b981;
    --danger: #ef4444;
    
    --font-family: 'Inter', sans-serif;
    --border-radius: 12px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.04);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
    font-size: 22px;
    font-weight: 700;
}

.logo-icon {
    color: var(--accent);
}

.collapse-btn {
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-btn:hover {
    color: white;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.menu-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    letter-spacing: 0.5px;
    padding: 0 24px;
    margin-bottom: 12px;
}

.nav-list {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
    transition: all 0.2s ease;
    gap: 12px;
    position: relative;
}

.nav-item a i {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.nav-item.has-dropdown .dropdown-icon {
    margin-left: auto;
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

.nav-item a:hover {
    color: var(--text-sidebar-hover);
    background-color: rgba(255,255,255,0.03);
}

.nav-item.active a {
    color: var(--accent);
}

.nav-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background-color: var(--accent);
    border-radius: 0 4px 4px 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 12px;
}

.preview-link {
    color: var(--text-sidebar);
    background: rgba(255,255,255,0.05);
    padding: 6px 10px;
    border-radius: 6px;
    display: block;
    text-align: center;
    text-decoration: none;
    word-break: break-all;
}

.preview-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: 70px;
    background-color: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.welcome-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border-radius: 20px;
    padding: 6px 16px;
    width: 240px;
    transition: width 0.3s;
}

.search-box:focus-within {
    width: 280px;
    box-shadow: 0 0 0 2px rgba(255,107,53,0.2);
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    padding-left: 8px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
}

.search-icon {
    color: var(--text-secondary);
    width: 18px;
    height: 18px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.icon-btn i {
    width: 20px;
    height: 20px;
}

.icon-btn:hover {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

.notification-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.profile-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e2e8f0;
}

/* Page Content */
.page-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Alert Box */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
}

.alert-warning {
    background-color: #fbebd9;
    color: #c95116;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: -260px;
        transition: left 0.3s;
        z-index: 1000;
    }
    .sidebar.open {
        left: 0;
    }
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    background-color: var(--accent-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon {
    width: 24px;
    height: 24px;
}

.text-orange {
    color: var(--accent);
}

.stat-info {
    text-align: right;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
}

.trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.trend i {
    width: 14px;
    height: 14px;
}

.trend.up {
    color: var(--success);
}

.trend.down {
    color: var(--danger);
}

.trend-text {
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.view-more {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.view-more:hover {
    color: var(--accent);
}

/* Chart Section */
.chart-section {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
}

.chart-filters {
    display: flex;
    background-color: var(--bg-main);
    border-radius: 8px;
    padding: 4px;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-body {
    height: 300px;
    position: relative;
    width: 100%;
}
