/* Global Body & Layout Styles */
body {
    background-color: #e9ecef;
    direction: rtl; 
    text-align: right;
}

/* Custom Container for Wider Layout */
.custom-container {
    max-width: 1400px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* Form & Card Centering */
.form-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

/* Card Styling with Shadow and Hover Effect */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

.card-header h4 {
    margin-bottom: 0;
}

.card-body {
    flex-grow: 1;
}

/* Alert & Badge Colors */
.list-group-item-warning {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

.list-group-item-danger {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

/* Tables */
.table td .btn {
    margin-bottom: 5px;
}

.btn-group.dropup {
    position: relative;
}

/* ================================================== */
/* START: === كود الطباعة المضغوط (3 أعمدة) === */
/* ================================================== */
@media print {
    /* --- إعدادات عامة للطباعة --- */
    body {
        font-size: 9pt; /* **تقليل حجم الخط الأساسي** */
        background-color: #fff !important;
        color: #000 !important;
    }

    /* --- إخفاء العناصر --- */
    .no-print, .navbar, .btn, .modal, .alert, .card-footer {
        display: none !important;
    }

    /* --- التخطيط الرئيسي --- */
    .custom-container, .container {
        max-width: 100% !important; width: 100% !important;
        margin: 0 !important; padding: 0 !important;
        box-shadow: none !important; border: none !important;
    }
    
    /* --- تصميم البطاقات المضغوط --- */
    .card {
        border: 1px solid #bbb !important;
        box-shadow: none !important;
        margin-bottom: 8px !important; /* **تقليل المسافة بين البطاقات** */
        page-break-inside: avoid;
    }

    .card-header {
        background-color: #f0f0f0 !important;
        color: #000 !important;
        padding: 3px 5px !important; /* **تقليل حشو الرأس** */
        border-bottom: 1px solid #ccc !important;
    }

    .card-header h5, .card-header h4, .card-header strong {
        font-size: 10pt !important; /* **تقليل حجم خط الرأس** */
        font-weight: bold;
        margin-bottom: 0 !important;
    }
    
    .card-header small {
        font-size: 8pt;
    }
    
    .card-body {
        padding: 5px !important; /* **تقليل حشو الجسم** */
    }
    
    .list-group {
        margin-bottom: 0 !important;
    }

    .list-group-item {
        padding: 2px 5px !important; /* **تقليل حشو عناصر القائمة** */
        font-size: 9pt;
        border: 0 !important;
        display: block;
    }
    
    .list-group-item .d-flex {
        display: flex !important;
        justify-content: space-between !important;
    }

    .list-group-item:nth-child(odd) {
         background-color: #f9f9f9 !important;
    }
    
    .list-group-item-danger, .list-group-item-warning {
        background-color: inherit !important;
        color: #000 !important;
        font-weight: bold;
    }

    /* --- تخطيط الأعمدة (3 أعمدة) --- */
    .row {
        display: flex;
        flex-wrap: wrap;
        margin-right: -4px;
        margin-left: -4px;
    }

    .col-xl-4, .col-lg-6, .col-md-6 {
        padding-right: 4px;
        padding-left: 4px;
        width: 33.33% !important; /* **تغيير إلى 3 أعمدة** */
        flex: 0 0 33.33%;
        max-width: 33.33%;
    }
    
    /* --- عناوين الأقسام --- */
    h5 {
       font-size: 11pt !important;
       border-bottom: 1px solid #eee;
       padding-bottom: 3px;
       margin-top: 10px !important;
       margin-bottom: 8px !important;
    }

    /* --- رأس الطباعة --- */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 15px !important;
        border-bottom: 2px solid #000;
        padding-bottom: 8px !important;
    }

    .print-header h2 {
        font-size: 13pt !important;
        margin-bottom: 2px !important;
    }

    .print-header p {
        font-size: 9pt !important;
        margin-bottom: 0 !important;
    }
}
/* ================================================== */
/* END: === نهاية كود الطباعة === */
/* ================================================== */

/* === القسم الخاص بتصغير الصناديق الإحصائية === */
.summary-card .card-body {
    padding: 1rem; /* تقليل المساحة الداخلية */
}
.summary-card h1 {
    font-size: 2.5rem; /* تصغير حجم الرقم الكبير */
    margin-bottom: 0.25rem;
}
.summary-card p {
    font-size: 1rem; /* تصغير حجم النص */
    margin-bottom: 0.5rem;
}
.summary-card .btn {
    padding: 0.25rem 0.5rem; /* تصغير حجم الزر */
    font-size: 0.875rem;
}

/* === القسم الجديد: تلوين حقل الملاحظات === */
.notes-display small {
    color: #dc3545 !important; /* اللون الأحمر */
    font-weight: bold; /* خط عريض */
}