:root {
    --primary-green: #166647;
    --light-green: #f0f7f4;
    --background-gray: #f8f9fa;
    --border-gray: #e9ecef;
    --text-dark: #212529;
    --text-light: #6c757d;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

body {
    display: flex;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-gray);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden; 
}

* {
    box-sizing: border-box;
}

button, input, select, textarea, a {
    font-family: 'Poppins', sans-serif;
}

.sidebar {
    width: 260px;
    background-color: var(--primary-green);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 24px;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    margin-bottom: 30px;
    padding-left: 10px;
}
.sidebar-header h3 {
    margin: 0;
    font-weight: 700;
}
.sidebar-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--white);
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.sidebar-nav a.active {
    background-color: var(--white);
    color: var(--primary-green);
    font-weight: 600;
}
.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    width: 100%;
    height: 100vh; 
    overflow-y: auto; 
    overflow-x: hidden;
    padding-bottom: 120px; 
}

.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.main-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    flex-wrap: wrap; 
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    margin-right: 15px;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.menu-overlay.active {
    display: block;
    opacity: 1;
}

.logout-btn {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 0;
    display: inline-flex;
    align-items: center;
}
.logout-btn:hover {
    background-color: var(--border-gray);
}
.logout-btn i {
    margin-right: 8px;
    font-size: 16px;
}
.logout-btn::after {
    content: 'uColab';
    font-size: 16px;
    font-weight: 600;
}

.header-left h1 {
    font-size: 1.75rem;
    color: #1C7F56;
    margin: 0 0 0.25rem 0;
}

.last-updated {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-refresh {
    background: linear-gradient(135deg, #1C7F56 0%, #15603F 100%);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 127, 86, 0.3);
}

.btn-refresh i {
    font-size: 1rem;
}

.tab-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.tab-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.tab-header {
    background: linear-gradient(135deg, #1C7F56 0%, #15603F 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.tab-header:hover {
    background: linear-gradient(135deg, #15603F 0%, #1C7F56 100%);
}

.tab-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tab-title i {
    font-size: 1.5rem;
}

.tab-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 40px;
    text-align: center;
}

.tab-content {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    display: none;
}

.tab-content.active {
    display: block;
}

.data-table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 10;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.data-table th:not(:first-child),
.data-table td:not(:first-child) {
    text-align: right;
}

.data-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f9fafb;
}

.data-table td {
    padding: 0.875rem 1rem;
    color: #4b5563;
}

.data-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.data-table td:first-child {
    font-weight: 600;
    color: #1f2937;
    background-color: #f3f4f6;
}

.data-table td.percentage-high {
    color: #16a34a;
    font-weight: 600;
}

.data-table td.percentage-medium {
    color: #ca8a04;
    font-weight: 600;
}

.data-table td.percentage-low {
    color: #dc2626;
    font-weight: 600;
}

.data-table td.currency {
    font-weight: 600;
    color: #1C7F56;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

.loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error-state {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-state i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    body {
        position: relative;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        width: 260px;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        padding: 20px;
        width: 100%;
        padding-bottom: 120px; 
    }
    .menu-toggle {
        display: block;
        order: 1; 
    }
    .main-header {
        gap: 10px;
        padding: 15px;
    }
    
    .header-left {
        width: 100%;
        order: 3; 
        text-align: center;
        margin-top: 10px;
    }
    .header-left h1 {
        font-size: 1.4rem;
    }
    
    .header-right {
        order: 2; 
        width: auto;
        justify-content: flex-end;
    }

    .tab-content {
        padding: 1rem;
        max-height: 400px;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .btn-refresh {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .logout-btn {
        padding: 0.5rem 0.8rem;
    }
    .logout-btn::after {
        font-size: 14px;
    }
}