:root {
    /* Premium Color Palette */
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #0d9488;
    --bg-color: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
    z-index: 20;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 28px 24px;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), transparent);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    letter-spacing: -0.025em;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-links li {
    padding: 10px 20px;
    margin: 4px 16px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-links li:hover:not(.nav-section-title), .nav-links li.active {
    background-color: var(--sidebar-hover);
    transform: translateX(4px);
}

.nav-links li.active {
    background: linear-gradient(90deg, var(--sidebar-hover), transparent);
    border-left: 3px solid var(--primary-light);
}

.nav-links li.active a {
    color: #ffffff;
}

.nav-links li a {
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
}

.nav-links li a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: var(--primary-light);
    opacity: 0.8;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-color);
}

.topbar {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    padding: 10px 18px;
    border-radius: 24px;
    gap: 12px;
    width: 340px;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.search-bar:focus-within {
    border-color: var(--primary-light);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    color: var(--text-main);
    font-size: 0.95rem;
}

.search-bar i {
    color: var(--text-muted);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 30px;
    transition: background var(--transition-fast);
    cursor: pointer;
}

.user-profile:hover {
    background: rgba(0,0,0,0.03);
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: var(--shadow-sm);
}

.content-wrapper {
    padding: 36px;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Cards & Dashboard */
.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.025em;
}

.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    outline: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #34d399);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.35);
}

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

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    margin-bottom: 36px;
}

.card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-premium);
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0.1;
    transform: translate(30%, -30%);
    border-radius: 50%;
}

.stat-info h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 12px;
}

.stat-info h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.5);
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
    overflow: hidden;
}

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

th {
    background: #f8fafc;
    text-align: left;
    padding: 18px 24px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.95rem;
}

tbody tr {
    transition: background-color var(--transition-fast);
}

tbody tr:hover {
    background-color: #f1f5f9;
}

.badge {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.badge-pending { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-progress { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-completed { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background-color: #f8fafc;
    color: var(--text-main);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.form-control:hover:not(:focus) {
    border-color: #cbd5e1;
}

.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9; 
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}

/* Responsiveness */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        overflow-y: visible;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    }
    
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .nav-links li {
        margin: 2px 5px;
        flex: 1 1 auto;
        text-align: center;
    }
    
    .nav-links li a {
        justify-content: center;
    }
    
    .nav-section-title {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    
    .main-content {
        overflow-y: visible;
    }
    
    .topbar {
        position: static;
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card::after {
        display: none;
    }
    
    .form-group[style] {
        flex-direction: column;
    }
}
