:root {
    --bg-color: #f0f2f5;
    --sidebar-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    
    /* Primary Colors */
    --brand-color: #d97706; 
    
    /* Card Colors */
    --card-olive: #b39b6b;
    --card-green: #10b981;
    --card-blue: #3b82f6;
    --card-orange: #f59e0b;
    --card-dark: #2a2e3f;
    
    /* Status Colors */
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --sidebar-width: 260px;
    --header-height: 70px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brand-color);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item i { font-size: 1.25rem; }

.nav-item:hover {
    color: var(--brand-color);
    background-color: #fdfbf7;
}

.nav-item.active {
    color: var(--brand-color);
    background-color: #fdfbf7;
    border-right: 4px solid var(--brand-color);
}

.nav-group { margin-top: 20px; }

.group-title {
    display: block;
    padding: 0 24px;
    margin-bottom: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: 0.05em;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.topbar {
    height: var(--header-height);
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 1.1rem; font-weight: 700; color: #111827; }

.user-profile { display: flex; align-items: center; gap: 12px; }
.avatar {
    width: 36px; height: 36px;
    background-color: var(--brand-color);
    color: white;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-weight: 700; font-size: 0.9rem;
}
.username { font-size: 0.9rem; font-weight: 600; color: #374151; }

/* Dashboard Content */
.dashboard-container {
    padding: 24px;
    max-width: 1400px;
    width: 100%;
}

.grid { display: grid; gap: 24px; margin-bottom: 24px; }
.primary-cards { grid-template-columns: repeat(4, 1fr); }

.card {
    padding: 24px;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.card-icon { font-size: 1.5rem; margin-bottom: 12px; display: block; opacity: 0.8; }
.card-value { font-size: 1.75rem; font-weight: 800; margin-bottom: 4px; }
.card-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; opacity: 0.9; text-transform: uppercase; }

.card-olive { background: #b39b6b; }
.card-green { background: #10b981; }
.card-blue { background: #3b82f6; }
.card-orange { background: #f59e0b; }
.card-red { background: #ef4444; }

.chart-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.chart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 950;
    backdrop-filter: blur(2px);
}

/* Responsive Rules */
@media (max-width: 1200px) {
    .primary-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar { padding: 0 16px; }
    .dashboard-container { padding: 16px; }
    .primary-cards { grid-template-columns: 1fr; gap: 16px; }
    .page-title { font-size: 1rem; }
    .username { display: none; }
    
    .sidebar-overlay.active { display: block; }
}

/* Utility for Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
