/* ============================================
   The Pro PC - Enhanced Style Sheet v2.0
   Modern, Clean, Professional Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Secondary Colors */
    --secondary: #7c3aed;
    --secondary-dark: #6d28d9;
    
    /* Success, Warning, Danger */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Global Styles
   ============================================ */

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

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--gray-900);
    direction: rtl;
    line-height: 1.6;
}

/* ============================================
   Layout
   ============================================ */

.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: white;
    box-shadow: var(--shadow-lg);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    padding: var(--space-lg);
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--gray-100);
    margin-bottom: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space);
    text-decoration: none;
}

.logo-img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: var(--space-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space);
    padding: var(--space) var(--space-md);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--gray-50);
    color: var(--primary);
    transform: translateX(-4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.nav-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-right: 280px;
    padding: var(--space-lg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space);
    border-bottom: 2px solid var(--gray-100);
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: var(--space);
}

.card-body {
    padding: var(--space) 0;
}

/* ============================================
   Stats Cards
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-right: 4px solid transparent;
}

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

.stat-card.primary {
    border-right-color: var(--primary);
}

.stat-card.success {
    border-right-color: var(--success);
}

.stat-card.warning {
    border-right-color: var(--warning);
}

.stat-card.danger {
    border-right-color: var(--danger);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.stat-icon.success {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.stat-icon.danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
}

/* ============================================
   Forms
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--space-md);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: var(--space) var(--space-md);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition);
    background: white;
}

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

.form-control:disabled {
    background: var(--gray-50);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space) var(--space-lg);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f87171);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #fbbf24);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-group {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ============================================
   Tables
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: linear-gradient(135deg, var(--gray-50), var(--gray-100));
}

th {
    padding: var(--space-md);
    text-align: right;
    font-weight: 700;
    color: var(--gray-700);
    font-size: 14px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    background: white;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--gray-50);
}

/* ============================================
   Badges & Status
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background: var(--info-light);
    color: var(--info);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Status specific badges */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 13px;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space);
    border-right: 4px solid;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border-color: var(--info);
}

/* ============================================
   Modal
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 2px solid var(--gray-100);
    display: flex;
    gap: var(--space);
    justify-content: flex-end;
}

/* ============================================
   Utility Classes
   ============================================ */

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

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space); }
.gap-3 { gap: var(--space-md); }

.hidden { display: none; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        transform: translateX(100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .col-3, .col-4, .col-6, .col-8 {
        grid-column: span 12;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .sidebar,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
    }
    
    body {
        background: white;
    }
}
