:root {
    --bg-main: #f8f9fa;
    --bg-side: #ffffff;
    --bg-card: #ffffff;
    --accent: #fb8c00;
    --text-main: #344767;
    --text-dim: #67748e;
    --border: #e9ecef;
    --shadow: 0 20px 27px 0 rgba(0, 0, 0, 0.05);
    --radius: 12px;
    /* Sidebar width variable for easy adjustment */
    --sidebar-width: 240px; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: var(--bg-main); 
    color: var(--text-main); 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
}

/* --- Sidebar Base Styles --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-side);
    display: flex;
    flex-direction: column;
    padding: 20px 0; /* Vertical padding only */
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.brand { 
    display: flex; 
    align-items: center; 
    padding: 0 20px;
    margin-bottom: 30px;
}

.sidebar-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

/* --- Navigation --- */
.nav-list {
    padding: 0 12px; /* Adds space so active state doesn't touch sidebar edge */
}

.nav-item {
    width: 100%; 
    border: none; 
    background: transparent; 
    padding: 10px 12px; 
    color: var(--text-dim);
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-radius: 8px; 
    cursor: pointer;
    font-weight: 500; 
    transition: 0.2s; 
    margin-bottom: 4px; 
    font-size: 0.85rem;
}

.nav-item i { 
    width: 28px; 
    height: 28px; 
    background: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: var(--text-main); 
    font-size: 14px;
}

.nav-item.active { 
    background: #fff; 
    color: var(--text-main); 
    box-shadow: var(--shadow); 
    font-weight: 700; 
}

.nav-item.active i { 
    background: var(--accent); 
    color: #fff; 
}

/* --- Promo / Help Section Fix --- */
.sidebar-promo { 
    margin-top: auto; 
    padding: 20px 16px; /* This prevents the boxes from touching the borders */
}

.help-card {
    background: linear-gradient(135deg, #3a416f 0%, #141727 100%);
    border-radius: 15px; 
    padding: 20px 16px; 
    color: white; 
    text-align: center; 
    margin-bottom: 12px;
}

.help-icon { 
    width: 35px; 
    height: 35px; 
    background: white; 
    color: #344767; 
    border-radius: 8px; 
    display: grid; 
    place-items: center; 
    margin: 0 auto 10px; 
}

.docs-btn { 
    width: 100%; 
    background: white; 
    color: #344767; 
    border: none; 
    padding: 10px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 0.7rem; 
    margin-top: 12px; 
    cursor: pointer; 
}

.upgrade-btn { 
    width: 100%; 
    background: linear-gradient(310deg, #ff9800, #fb8c00); 
    color: white; 
    border: none; 
    padding: 12px; 
    border-radius: 10px; 
    font-weight: 700; 
    font-size: 0.75rem; 
    cursor: pointer; 
}

/* --- Main Content --- */
.main-wrapper { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    overflow-y: auto; 
    position: relative; 
}

.topbar { 
    height: 80px; 
    padding: 0 32px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    flex-shrink: 0; 
}

.breadcrumb span { font-size: 0.75rem; color: var(--text-dim); }
.breadcrumb strong { display: block; font-size: 1rem; color: var(--text-main); }

.header-right { display: flex; align-items: center; gap: 20px; }
.search-group { 
    background: #fff; 
    border: 1px solid var(--border); 
    padding: 8px 12px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    width: 200px; 
}
.search-group input { border: none; outline: none; font-size: 0.85rem; width: 100%; }
.outline-btn { 
    background: transparent; 
    border: 1px solid var(--accent); 
    color: var(--accent); 
    padding: 8px 16px; 
    border-radius: 8px; 
    font-weight: 700; 
    font-size: 0.75rem; 
    cursor: pointer; 
}
.user-link { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-size: 0.85rem; 
    font-weight: 600; 
    cursor: pointer; 
}

/* Bento Grid */
.bento-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 24px; 
    padding: 20px 32px; 
}
.bento-card { 
    background: var(--bg-card); 
    border-radius: 1rem; 
    padding: 20px; 
    box-shadow: var(--shadow); 
    overflow: hidden; 
}

.stat-card.orange { background: linear-gradient(310deg, #ff9800, #fb8c00); color: #fff; }
.stat-card.dark { background: #344767; color: #fff; }
.c-label { font-size: 0.8rem; font-weight: 600; opacity: 0.8; }
.c-val { font-size: 1.5rem; font-weight: 800; display: block; margin: 4px 0; }

.span-3 { grid-column: span 3; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.data-table th { 
    text-align: left; 
    font-size: 0.65rem; 
    text-transform: uppercase; 
    color: var(--text-dim); 
    padding-bottom: 15px; 
    border-bottom: 1px solid var(--border); 
}
.data-table td { padding: 15px 0; font-size: 0.85rem; border-bottom: 1px solid var(--border); }

.avatar-group { display: flex; }
.avatar-group img { 
    width: 24px; 
    height: 24px; 
    border-radius: 50%; 
    border: 2px solid #fff; 
    margin-left: -8px; 
}
.avatar-group img:first-child { margin-left: 0; }

.progress-bar { 
    height: 4px; 
    background: #e9ecef; 
    border-radius: 2px; 
    width: 100px; 
    margin-top: 6px; 
}
.progress-fill { height: 100%; background: #17ad37; border-radius: 2px; }

/* --- MOBILE OPTIMIZATION --- */
.overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); 
    display: none; z-index: 1500; 
}
.overlay.active { display: block; }

.mobile-menu-btn { 
    display: none; border: none; background: var(--accent); color: #fff; 
    width: 50px; height: 50px; border-radius: 50%; 
    box-shadow: 0 10px 20px rgba(251, 140, 0, 0.3); 
}

@media (max-width: 1024px) {
    .sidebar { position: fixed; transform: translateX(-100%); z-index: 2000; width: 260px; }
    .sidebar.open { transform: translateX(0); }
    
    .mobile-menu-btn { 
        display: flex; 
        position: fixed; 
        bottom: 20px; 
        right: 20px; 
        z-index: 2100; 
        align-items: center; 
        justify-content: center; 
    }
    
    .topbar { height: auto; padding: 20px; flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
    .search-group { width: 100%; order: 3; }
    
    .bento-grid { grid-template-columns: 1fr; padding: 15px; gap: 15px; }
    .span-3 { grid-column: span 1; }
    
    .bento-card { overflow-x: auto; }
    .data-table { min-width: 500px; }
}