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

:root {
    --primary: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #111827;
    --light: #f8fafc;
    --text: #374151;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-dark: #1f2937;
    --bg-darker: #111827;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--light);
    color: var(--text);
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: #e5e7eb;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s;
}

body.dark-mode .sidebar {
    background: var(--bg-darker);
    border-right-color: #374151;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--primary);
}

.sidebar-nav {
    flex: 1;
}

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

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

body.dark-mode .sidebar-nav a {
    color: #d1d5db;
}

.sidebar-nav a:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-divider {
    border-bottom: 1px solid var(--border);
    margin: 12px 0;
}

body.dark-mode .sidebar-divider {
    border-bottom-color: #374151;
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

body.dark-mode .sidebar-footer {
    border-top-color: #374151;
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
}

.sidebar-footer a:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    background: var(--light);
    transition: background-color 0.3s;
}

body.dark-mode .main-content {
    background: var(--bg-dark);
}

/* Top Header */
.top-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s;
}

body.dark-mode .top-header {
    background: var(--bg-darker);
    border-bottom-color: #374151;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
}

body.dark-mode .sidebar-toggle {
    color: #d1d5db;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 300px;
    flex: 1;
    color: var(--text-muted);
}

body.dark-mode .search-box {
    background: #374151;
    border-color: #4b5563;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    color: var(--text);
    font-size: 14px;
}

body.dark-mode .search-box input {
    color: #d1d5db;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
    transition: color 0.3s;
}

body.dark-mode .theme-toggle {
    color: #d1d5db;
}

.theme-toggle:hover {
    color: var(--primary);
}

.notification-bell {
    position: relative;
}

.notification-bell button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
    position: relative;
}

body.dark-mode .notification-bell button {
    color: #d1d5db;
}

.notification-bell .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
}

.user-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
}

body.dark-mode .dropdown-toggle {
    color: #d1d5db;
}

.dropdown-toggle img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.dropdown-menu {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.dark-mode .dropdown-menu {
    background: var(--bg-darker);
    border-color: #374151;
}

.dropdown-item {
    color: var(--text);
    padding: 10px 16px;
    border-radius: 0;
    transition: all 0.2s;
}

body.dark-mode .dropdown-item {
    color: #d1d5db;
}

.dropdown-item:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.dropdown-divider {
    background: var(--border);
}

body.dark-mode .dropdown-divider {
    background: #374151;
}

/* Dashboard Container */
.dashboard-container {
    padding: 32px;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}

body.dark-mode .dashboard-header h1 {
    color: #f3f4f6;
}

.dashboard-header p {
    color: var(--text-muted);
}

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.dark-mode .card {
    background: var(--bg-darker);
    border-color: #374151;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: 1px solid var(--border);
    padding: 16px;
    background: var(--light);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.dark-mode .card-header {
    background: #374151;
    border-bottom-color: #4b5563;
}

.card-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Stat Cards */
.stat-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: white;
    transition: all 0.3s;
}

body.dark-mode .stat-card {
    background: var(--bg-darker);
    border-color: #374151;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--dark);
}

body.dark-mode .stat-value {
    color: #f3f4f6;
}

/* Chart Cards */
.chart-card {
    border: 1px solid var(--border);
    border-radius: 12px;
}

body.dark-mode .chart-card {
    border-color: #374151;
}

/* Tables */
.table {
    margin: 0;
}

.table thead th {
    background: var(--light);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text);
    padding: 12px;
    font-size: 13px;
}

body.dark-mode .table thead th {
    background: #374151;
    border-bottom-color: #4b5563;
    color: #d1d5db;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

body.dark-mode .table tbody td {
    border-bottom-color: #374151;
    color: #d1d5db;
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

body.dark-mode .table tbody tr:hover {
    background: rgba(37, 99, 235, 0.1);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    align-items: flex-start;
    transition: all 0.2s;
}

.activity-item:hover {
    background: var(--light);
}

body.dark-mode .activity-item:hover {
    background: #374151;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    margin: 0 0 4px;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

body.dark-mode .activity-title {
    color: #d1d5db;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    font-size: 14px;
}

body.dark-mode .form-label {
    color: #d1d5db;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    color: white;
}

.btn-outline-primary {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: rgba(37, 99, 235, 0.1);
}

.btn-outline-secondary {
    border: 1px solid var(--border);
    color: var(--text);
    background: white;
}

body.dark-mode .btn-outline-secondary {
    background: var(--bg-darker);
    color: #d1d5db;
    border-color: #374151;
}

.btn-outline-secondary:hover {
    background: var(--light);
}

.btn-outline-danger {
    border: 1px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.badge {
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
}

.badge.bg-success {
    background: var(--success) !important;
    color: white;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: white;
}

.badge.bg-danger {
    background: var(--danger) !important;
    color: white;
}

/* Account Cards */
.account-card {
    transition: all 0.3s;
}

.account-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.account-details {
    margin: 16px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

body.dark-mode .detail-row {
    border-bottom-color: #374151;
}

.detail-row .label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-row .value {
    color: var(--text);
    font-weight: 600;
}

body.dark-mode .detail-row .value {
    color: #d1d5db;
}

/* Pagination */
.pagination {
    margin: 20px 0 0;
}

.page-link {
    border: 1px solid var(--border);
    color: var(--primary);
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0 4px;
    transition: all 0.2s;
}

body.dark-mode .page-link {
    background: #374151;
    border-color: #4b5563;
    color: var(--primary);
}

.page-link:hover {
    background: rgba(37, 99, 235, 0.1);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border);
}

body.dark-mode .nav-tabs {
    border-bottom-color: #374151;
}

.nav-link {
    color: var(--text);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    margin-bottom: -2px;
    transition: all 0.2s;
}

body.dark-mode .nav-link {
    color: #d1d5db;
}

.nav-link:hover {
    color: var(--primary);
    border-bottom-color: rgba(37, 99, 235, 0.3);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* Progress */
.progress {
    background: var(--light);
    border-radius: 8px;
    height: 20px;
}

body.dark-mode .progress {
    background: #374151;
}

.progress-bar {
    border-radius: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        position: fixed;
        left: 0;
        z-index: 1001;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .search-box {
        max-width: 200px;
    }
    
    .dashboard-container {
        padding: 16px;
    }
    
    .stat-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px;
    }
}
