/* تخصيصات عامة للنظام */
* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Tajawal', sans-serif;
}

/* تحسين التمرير */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* بطاقات الإحصائيات */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* جداول متجاوبة */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* رسائل التنبيه */
.flash-message {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* تحميل */
.loading-spinner {
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* طباعة */
@media print {
    #sidebar, header, footer, .no-print {
        display: none !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* تحسينات الجوال */
@media (max-width: 1023px) {
    main {
        padding-bottom: 5.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    input[type="search"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
    }

    .table-responsive table {
        min-width: 640px;
    }

    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .mobile-full {
        width: 100% !important;
    }

    .touch-target {
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (max-width: 640px) {
    .stat-card {
        padding: 0.875rem;
    }
}
