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

body {
    font-family: 'Cairo', sans-serif;
    background: #f5f7fa;
    direction: rtl;
    color: #1f2937;
}

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

/* Main Wrapper */
.main-wrapper {
    margin-right: 280px;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-right: 80px;
}

/* Header */
.app-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    padding: 8px 16px;
    border-radius: 50px;
    width: 300px;
}

.search-bar input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 14px;
}

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

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications i {
    font-size: 20px;
    color: #666;
}

.notifications .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 50%;
}

.user-dropdown {
    cursor: pointer;
}

.user-dropdown .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-dropdown img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

/* Main Content */
.main-content {
    padding: 24px;
    min-height: calc(100vh - 60px);
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.md\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.lg\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap-6 {
    gap: 24px;
}

.mb-6 {
    margin-bottom: 24px;
}

/* Cards */
.bg-white {
    background: white;
}

.rounded-2xl {
    border-radius: 16px;
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.p-6 {
    padding: 24px;
}

.p-5 {
    padding: 20px;
}

/* Text */
.text-gray-500 {
    color: #6b7280;
}

.text-gray-800 {
    color: #1f2937;
}

.text-green-500 {
    color: #10b981;
}

.text-red-600 {
    color: #dc2626;
}

.text-blue-600 {
    color: #2563eb;
}

.text-purple-600 {
    color: #7c3aed;
}

.text-orange-500 {
    color: #f97316;
}

.text-sm {
    font-size: 0.875rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

/* Backgrounds */
.bg-blue-100 {
    background: #dbeafe;
}

.bg-green-100 {
    background: #d1fae5;
}

.bg-purple-100 {
    background: #ede9fe;
}

.bg-red-100 {
    background: #fee2e2;
}

.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-blue-500 {
    --tw-gradient-from: #3b82f6;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.to-purple-600 {
    --tw-gradient-to: #9333ea;
}

.text-white {
    color: white;
}

/* Buttons */
.bg-white\/20 {
    background: rgba(255,255,255,0.2);
}

.hover\:bg-white\/30:hover {
    background: rgba(255,255,255,0.3);
}

.transition {
    transition: all 0.3s ease;
}

/* Tables */
.w-full {
    width: 100%;
}

.overflow-x-auto {
    overflow-x: auto;
}

.border-b {
    border-bottom: 1px solid #e5e7eb;
}

.py-3 {
    padding-top: 12px;
    padding-bottom: 12px;
}

.px-4 {
    padding-left: 16px;
    padding-right: 16px;
}

.text-right {
    text-align: right;
}

/* Badges */
.px-3 {
    padding-left: 12px;
    padding-right: 12px;
}

.py-1 {
    padding-top: 4px;
    padding-bottom: 4px;
}

.rounded-full {
    border-radius: 9999px;
}

.text-xs {
    font-size: 0.75rem;
}

.bg-green-100 {
    background: #d1fae5;
}

.text-green-800 {
    color: #065f46;
}

.bg-blue-100 {
    background: #dbeafe;
}

.text-blue-800 {
    color: #1e40af;
}

.bg-yellow-100 {
    background: #fef3c7;
}

.text-yellow-800 {
    color: #92400e;
}

/* Flex */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-start {
    justify-content: flex-start;
}

.gap-3 {
    gap: 12px;
}

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

@media (max-width: 768px) {
    .main-wrapper {
        margin-right: 0 !important;
    }
    
    .sidebar {
        transform: translateX(100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        width: 200px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-container {
    animation: fadeIn 0.5s ease;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-right: 4px solid #10b981;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-right: 4px solid #ef4444;
}
