:root {
    --primary-color: #000000;
    --bg-color: #f4f4f9;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

/* ------------------- Control Panel (UI) ------------------- */
.control-panel {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    /* قمنا بزيادة العرض ليحتوي الـ 3 أعمدة بشكل مريح */
    width: 450px; 
    max-width: 100%;
    height: fit-content;

}

.control-panel h2, .control-panel h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input, .form-group select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    /* أضفنا هذه الخصائص لضمان عدم خروج الحقول عن الإطار */
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
}

.btn-print { background-color: #4CAF50; }
.btn-pdf { background-color: #2196F3; }

/* ------------------- Receipt Page (A4 Paper) ------------------- */
.receipt-wrapper {
    overflow: auto;
}

.receipt-page {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    margin: 0;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    color: var(--primary-color);
    position: relative;
}

.receipt-header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    border-bottom: 2px solid #000;

    padding-bottom: 18px;

    margin-bottom: 25px;

}



.header-side {

    width: 28%;

    font-size: 11pt;

    line-height: 1.5;

    font-weight: 600;

}



.header-ar {

    text-align: right;

}



.header-en {

    text-align: left;

    direction: ltr;

}



.header-center {

    width: 40%;

    text-align: center;

}



.company-logo {

    width: 120px;

    display: block;

    margin: 0 auto 12px;

}



.receipt-title {

    font-size: 20pt;

    font-weight: 700;

}

.receipt-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-weight: bold;
    font-size: 12pt;
}

.dotted-line {
    border-bottom: 1px dashed #000;
    display: inline-block;
    min-width: 100px;
    text-align: center;
    color: #333;
    font-weight: normal;
}

.amounts-table, .services-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.amounts-table th, .amounts-table td, 
.services-table th, .services-table td {
    border: 1px solid #000;
    padding: 8px;
    font-size: 12pt;
    font-weight: 600;
}

.amounts-table th { text-align: center; background-color: #f2f2f2; }
.amounts-table td { text-align: center; }

.services-table th { background-color: #f2f2f2; }
.ar-text { text-align: right; }
.en-text { text-align: left; direction: ltr; }
.check-col { text-align: center; font-size: 14pt; color: #000; }

.receipt-text {
    margin-bottom: 20px;
    font-size: 12pt;
    font-weight: bold;
    line-height: 1.8;
}

.text-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 5px;
}

.flex-grow {
    flex-grow: 1;
    margin: 0 10px;
    text-align: right;
    padding-right: 10px;
}

.w-100px { min-width: 100px; margin: 0 10px; }

.options-section {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 11pt;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.box {
    width: 15px;
    height: 15px;
    border: 1px solid #000;
    display: inline-block;
    text-align: center;
    line-height: 15px;
    font-size: 12px;
}

.signatures {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    font-size: 12pt;
    font-weight: bold;
}
.sig-box{

position:relative;
width:45%;
min-height:120px;
white-space: nowrap;
font-size: 11pt;

}



.official-stamp{

position:absolute;

width:120px;

bottom:-15px;

right:50px;

opacity:0.90;


}



.english-sign{

text-align:left;

direction:ltr;

}

.sig-box p { margin-bottom: 10px; }

.receipt-footer {
    position: absolute;
    bottom: 20mm;
    left: 20mm;
    right: 20mm;
    display: flex;
    justify-content: space-between;
    border-top: 2px solid #000;
    padding-top: 10px;
    font-size: 10pt;
}

.footer-en { text-align: left; direction: ltr; }
.footer-center { text-align: center; align-self: center; font-weight: bold; }

/* ------------------- Print Settings ------------------- */
@media print {
    body {
        background-color: white;
        padding: 0;
        margin: 0;
        display: block;
    }
    .no-print { display: none !important; }
    .receipt-wrapper { overflow: visible; }
    .receipt-page {
        margin: 0;
        padding: 20mm;
        box-shadow: none;
        width: 100%;
        height: 100%;
    }
}