html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-input {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.text-danger {
    color: red;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85); /* تعديل بسيط ليعمل الـ opacity بشكل صحيح */
    z-index: -1;
}

body {
    font-family: 'Cairo', sans-serif;
    background-image: url('/images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.card {
    border-radius: 12px;
}

.my-error-text {
    color: red;
    font-size: 12px;
}

.logo {
    max-width: 150px;
    width: 100%;
    height: auto;
}

/* تخلصنا من fixed واستخدمنا flex لضمان وجوده في الأسفل دائماً */
.custom-footer-green {
    background-color: #0b5e5e !important;
    color: #ffffff !important;
    width: 100%;
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* ضروري جداً ليعمل margin-top: auto */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   👇 كود تنسيق الطباعة الجديد (آمن ولا يخرب تصفح الموقع)
   ========================================== */
@media print {
    /* إلغاء صورة الخلفية والطبقة الشفافة لتوفر حبر الطابعة وتظهر الورقة بيضاء نظيفة */
    body {
        background-image: none !important;
        background-color: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* إعادة تشكيل الـ body::before القديم ليصبح عنواناً نصياً في أعلى الورقة المطبوعة */
    body::before {
        content: "مجمع حلقات علي بن أبي طالب - تقرير السجل المالي" !important;
        position: static !important; /* إلغاء التثبيت على الشاشة */
        display: block !important;
        font-size: 22px !important;
        font-weight: bold !important;
        text-align: center !important;
        color: #000000 !important;
        margin-bottom: 30px !important;
        height: auto !important;
        width: auto !important;
        z-index: auto !important;
    }

    /* إخفاء القائمة الجانبية، الأزرار، المودال، والتذييل الأخضر (كل ما لا نحتاجه في الورق) */
    .btn, .modal, .navbar, .sidebar, .custom-footer-green, form, [class*="sidebar"], [id*="sidebar"] {
        display: none !important;
    }

    /* جعل الكارد والجدول يفرشان بعرض الورقة الكامل وبدون ظلال رمادية */
    .card, .card-body, .table-responsive {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* تحسين حدود الجدول لكي تظهر واضحة وحادة في الطباعة الحقيقية */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 1px solid #000000 !important; /* حدود سوداء واضحة للطباعة */
        padding: 10px !important;
        text-align: right !important;
        color: #000000 !important;
    }

    /* إخفاء عمود المرفقات/الإجراءات أثناء الطباعة لأنه بدون فائدة على الورق */
    th:last-child, td:last-child {
        display: none !important;
    }
}