/* Base Styles */
:root {
    --blue-50: #f0f5ff;
    --blue-100: #e0eaff;
    --blue-200: #c7d9ff;
    --blue-300: #a4c1ff;
    --blue-400: #7da3ff;
    --blue-500: #5785ff;
    --blue-600: #3b6aff;
    --blue-700: #2955e6;
    --blue-800: #1e42b8;
    --blue-900: #183285;
    
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    
    --green-500: #22c55e;
    --red-500: #ef4444;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    --radius: 0.5rem;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--slate-50);
    color: var(--slate-800);
    line-height: 1.5;
}

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

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--blue-800);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--blue-700);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-sidebar {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
}

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

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

.sidebar-nav ul li {
    margin-bottom: 0.25rem;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
    transition: background-color 0.2s;
}

.sidebar-nav ul li a:hover,
.sidebar-nav ul li.active a {
    background-color: var(--blue-700);
    color: white;
}

.sidebar-nav ul li a i {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
}

.dropdown-toggle {
    position: relative;
}

.dropdown-icon {
    margin-left: auto;
    transition: transform 0.2s;
}

.dropdown-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 2.5rem;
}

.dropdown-menu.open {
    max-height: 200px;
}

.dropdown-menu li a {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.badge {
    background-color: var(--blue-600);
    color: white;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

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

.sidebar-footer a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.sidebar-footer a:hover {
    background-color: var(--blue-700);
    color: white;
}

.sidebar-footer a i {
    margin-right: 0.75rem;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: white;
    border-bottom: 1px solid var(--slate-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--slate-600);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 300px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-500);
    font-size: 0.875rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    background-color: var(--slate-50);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

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

.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--slate-600);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.5rem;
}

.notification-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--blue-600);
    border-radius: 50%;
}

.user-profile {
    display: flex;
    align-items: center;
}

.avatar {
    width: 2rem;
    height: 2rem;
    background-color: var(--blue-100);
    color: var(--blue-800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Dashboard Content */
.dashboard-content {
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background-color: white;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.stat-info {
    flex: 1;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--slate-500);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--slate-800);
    margin: 0.25rem 0 0.5rem;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.stat-change.positive {
    color: var(--green-500);
}

.stat-change.negative {
    color: var(--red-500);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.bg-blue-500 {
    background-color: var(--blue-500);
}

.bg-blue-600 {
    background-color: var(--blue-600);
}

.bg-blue-700 {
    background-color: var(--blue-700);
}

.bg-blue-800 {
    background-color: var(--blue-800);
}

/* Card */
.card {
    background-color: white;
    border-radius: var(--radius);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--slate-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--slate-800);
}

.card-description {
    font-size: 0.875rem;
    color: var(--slate-500);
    margin-top: 0.25rem;
}

.card-content {
    padding: 1.25rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--slate-200);
    margin-bottom: 1.25rem;
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-600);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: var(--blue-600);
}

.tab-btn.active {
    color: var(--blue-600);
    border-bottom-color: var(--blue-600);
}

.tab-content {
    display: none;
}

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

/* Table */
.table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-500);
    background-color: var(--slate-50);
    border-bottom: 1px solid var(--slate-200);
}

.users-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--slate-200);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--blue-100);
    color: var(--blue-800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    color: var(--slate-800);
}

.user-email {
    font-size: 0.75rem;
    color: var(--slate-500);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-active {
    background-color: rgba(34, 197, 94, 0.1);
    color: var(--green-500);
}

.status-inactive {
    background-color: var(--slate-100);
    color: var(--slate-600);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--slate-500);
}

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .close-sidebar {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .toggle-sidebar {
        display: block;
    }
    
    .hide-mobile {
        display: none;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-container {
        width: 100%;
        max-width: none;
    }
}