/* ضبط عام للمتصفح */
body { font-family: Arial, sans-serif; background: #f0f0f0; margin: 0; padding: 20px; }
.admin-panel { background: #fff; max-width: 900px; margin: auto; padding: 20px; direction: rtl; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.input-row { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.field { flex: 1; min-width: 200px; }
input, select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }

.button-group { display: flex; gap: 10px; margin-top: 10px; }
.issue-btn { flex: 3; padding: 15px; background: #1a237e; color: #fff; border: none; font-weight: bold; cursor: pointer; border-radius: 4px; }
.clear-btn { flex: 1; padding: 15px; background: #d32f2f; color: white; border: none; cursor: pointer; border-radius: 4px; }

/* إعدادات صفحة A4 */
#official-doc { 
    display: none; 
    width: 210mm; 
    height: 297mm; 
    background: #fff; 
    margin: auto; 
    padding: 10mm 15mm 45mm 15mm; 
    position: relative; 
    box-sizing: border-box; 
    border: 1px solid #eee;
}

.doc-header { 
    display: flex; 
    flex-direction: row-reverse; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 5px; 
}

.main-title-red { 
    background: #d32f2f !important; 
    color: #fff; 
    text-align: center; 
    padding: 6px; 
    margin: 10px 0; 
    font-weight: bold; 
    font-size: 14px;
    -webkit-print-color-adjust: exact; 
}

table { width: 100%; border-collapse: collapse; margin-bottom: 8px; font-size: 11px; }
th, td { border: 1px solid #000; padding: 5px 8px; text-align: left; }
.bg-gray { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; font-weight: bold; }
.bg-red-head { background: #d32f2f !important; color: #fff; -webkit-print-color-adjust: exact; }
.benefits-header { background: #1a237e; color: #fff; padding: 5px; font-weight: bold; font-size: 12px; -webkit-print-color-adjust: exact; }

.vertical-terms { font-size: 10.5px; line-height: 1.4; color: #333; margin-top: 5px; }

/* --- التذييل المطور (تعديل الـ QR فقط) --- */
.footer-container {
    position: absolute;
    bottom: 0mm !important; 
    left: 0;
    right: 0;
    width: 100%;
}

.doc-footer { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-end; 
    margin-bottom: 5px;
    padding: 0 15mm;
}

/* التنسيق الجديد للـ QR Code */
.footer-left-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.qr-label { 
    color: #0087ff !important; /* اللون الأزرق المشرق */
    font-size: 12px; 
    font-weight: bold; 
    margin-bottom: 2px;
    -webkit-print-color-adjust: exact;
}

#qrcode img { 
    width: 100px !important; 
    height: 100px !important; 
    border: none !important; /* إزالة الإطار الأسود ليطابق الصورة */
}

.qr-subtext { 
    font-size: 9.5px; 
    font-style: italic; /* نص مائل */
    color: #333; 
    margin-top: 2px;
    max-width: 250px;
    line-height: 1.2;
}

.mini-images-row { display: flex; gap: 12px; margin-top: 5px; align-items: center; }
.mini-images-row img { 
    max-height: 22px; /* حجم متناسق للشعارات */
    width: auto; 
    object-fit: contain; 
}

.footer-right-col { width: 40%; text-align: center; }
.stamp-container { height: 75px; display: flex; align-items: center; justify-content: center; }
#outStampImg { max-width: 130px; max-height: 75px; object-fit: contain; }
.signature-line { border-top: 2px solid #000; font-size: 10px; font-weight: bold; padding-top: 3px; }

.contact-footer { 
    background: #f8f9fa !important; 
    border-top: 3px solid #006400 !important; 
    padding: 10px 0; 
    text-align: center; 
    font-size: 10px; 
    width: 100%;
    -webkit-print-color-adjust: exact;
}

@media print { 
    @page { size: A4; margin: 0; }
    body { padding: 0; margin: 0; }
    .no-print { display: none !important; } 
    #official-doc { 
        display: block !important; 
        border: none; 
        width: 210mm;
        height: 297mm;
    } 
}