/* ===== الأنماط المخصصة - محظرة التيسير ===== */

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* شريط التمرير */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(27, 94, 32, 0.3); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(27, 94, 32, 0.5); }

/* النمط الإسلامي */
.islamic-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(27, 94, 32, 0.04) 1px, transparent 0);
    background-size: 24px 24px;
}
.islamic-pattern-dark {
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.06) 1px, transparent 0);
    background-size: 24px 24px;
}

.gradient-islamic {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
}
.gradient-islamic-light {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

/* ظلال ناعمة */
.soft-shadow {
    box-shadow: 0 2px 8px -2px rgba(27, 94, 32, 0.08), 0 4px 16px -4px rgba(27, 94, 32, 0.06);
}
.soft-shadow-lg {
    box-shadow: 0 4px 16px -4px rgba(27, 94, 32, 0.12), 0 8px 32px -8px rgba(27, 94, 32, 0.08);
}

/* حركات */
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-scale-in { animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-slide-in-right { animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* إخفاء شريط التمرير */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* بطاقات */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px -2px rgba(27, 94, 32, 0.08), 0 4px 16px -4px rgba(27, 94, 32, 0.06);
    border: 1px solid rgba(27, 94, 32, 0.05);
}

/* أزرار */
.btn-primary {
    background: #1B5E20;
    color: white;
    border-radius: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary:hover { background: #2E7D32; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 0.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-secondary:hover { background: #e5e7eb; }

/* حقول الإدخال */
.form-input {
    width: 100%;
    background: rgba(248, 250, 248, 0.7);
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}
.form-input:focus {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: white;
}

/* شارات */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 500;
    border: 1px solid;
}
.badge-active { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.badge-exempted { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-partial { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.badge-pending { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-graduated { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.badge-exited { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }

/* الأفاتار */
.avatar {
    border-radius: 9999px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    ring: 2px solid white;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; font-size: 1rem; }
.avatar-xl { width: 5rem; height: 5rem; font-size: 1.5rem; }
.avatar-2xl { width: 7rem; height: 7rem; font-size: 2rem; }

/* المودال */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}
@media (min-width: 640px) {
    .modal-overlay { align-items: center; padding: 1rem; }
}
.modal-content {
    background: white;
    width: 100%;
    max-width: 28rem;
    border-radius: 1.5rem 1.5rem 0 0;
    padding: 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
}
@media (min-width: 640px) {
    .modal-content { border-radius: 1.5rem; }
}

/* شريط التقدم */
.progress-bar {
    height: 0.375rem;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
}

/* حالة التحميل */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* الأسعار المالية */
.text-income { color: #047857; }
.text-expense { color: #b91c1c; }
.text-neutral-finance { color: #6b7280; }
