:root {
    --primary: #0E9D59;
    --primary-dark: #087A45;
    --secondary: #12355B;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --font: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --header-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-800); }

.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex; flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 18px; color: var(--secondary);
    text-decoration: none;
}
.sidebar-logo img { height: 32px; }
.sidebar-logo span::after { content: "Smart"; color: var(--primary); }

.sidebar-nav {
    flex: 1; padding: 16px 12px; overflow-y: auto;
}
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px;
    color: var(--gray-600);
    text-decoration: none; font-size: 14px; font-weight: 500;
    transition: all 0.2s ease;
}
.sidebar-nav a:hover { background: var(--gray-50); color: var(--primary); }
.sidebar-nav a.active { background: rgba(15,157,88,0.08); color: var(--primary); }
.sidebar-nav a i { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--gray-200); }
.btn-logout {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 10px 14px;
    border: none; border-radius: 12px;
    background: transparent; color: var(--gray-600);
    font-size: 14px; font-weight: 500; font-family: var(--font);
    cursor: pointer; transition: all 0.2s ease;
}
.btn-logout:hover { background: #fef2f2; color: #dc2626; }
.btn-logout i { width: 20px; text-align: center; }

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex; flex-direction: column;
}

.main-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.menu-toggle {
    display: none; background: none; border: none;
    font-size: 24px; color: var(--gray-600);
    cursor: pointer; padding: 8px;
}
.header-right { display: flex; align-items: center; gap: 16px; }
.group-name { font-weight: 600; color: var(--gray-700); }
.language-switcher { display: flex; gap: 4px; }
.language-switcher button {
    background: none; border: 1px solid var(--gray-200);
    padding: 4px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    color: var(--gray-500); transition: all 0.2s ease;
}
.language-switcher button:hover,
.language-switcher button.active { border-color: var(--primary); color: var(--primary); }

.content-area {
    flex: 1; padding: 24px; overflow-y: auto;
}

.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 32px;
}
.stat-card {
    background: var(--white); padding: 20px 24px;
    border-radius: 16px; border: 1px solid var(--gray-200);
}
.stat-card h3 { font-size: 14px; color: var(--gray-500); font-weight: 500; }
.stat-card p { font-size: 28px; font-weight: 700; color: var(--gray-900); margin-top: 4px; }

.section { margin-bottom: 32px; }
.section h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-header h2 { margin-bottom: 0; }

.activities-list { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--white);
    border-radius: 12px; border: 1px solid var(--gray-100);
}
.activity-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(15,157,88,0.1); color: var(--primary); }
.activity-text { flex: 1; font-size: 14px; font-weight: 500; color: var(--gray-700); }
.activity-amount { font-weight: 600; color: var(--gray-800); }
.activity-time { font-size: 12px; color: var(--gray-400); }

.table-wrapper { overflow-x: auto; background: var(--white); border-radius: 16px; border: 1px solid var(--gray-200); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-weight: 600; color: var(--gray-500); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

.status-badge {
    display: inline-block; padding: 2px 12px; border-radius: 50px;
    font-size: 12px; font-weight: 600;
}
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #fef2f2; color: #991b1b; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-completed { background: #dbeafe; color: #1e40af; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.status-reversed { background: #f3e8ff; color: #6b21a8; }
.status-default { background: var(--gray-100); color: var(--gray-500); }

.btn-sm { padding: 6px 10px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.2s ease; }
.btn-sm:hover { opacity: 0.8; }
.btn-info { background: #dbeafe; color: #1e40af; }
.btn-warning { background: #fef3c7; color: #92400e; }
.btn-danger { background: #fee2e2; color: #991b1b; }

.loading-state, .error-state, .info-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; color: var(--gray-500);
}
.loading-state i, .error-state i, .info-state i { font-size: 48px; margin-bottom: 16px; color: var(--gray-300); }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .content-area { padding: 16px; }
    .main-header { padding: 0 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .activity-item { flex-wrap: wrap; }
    .activity-time { width: 100%; margin-left: 48px; }
}