@page {
    size: A4;
    margin: 0;
}

* {
    box-sizing: border-box;
}

body { 
    background-color: #f4f6f9; 
    font-family: 'Iskoola Pota', 'Noto Sans Sinhala', sans-serif; 
    margin: 0;
    padding: 0;
}

.form-container { 
    max-width: 600px; 
    margin: 20px auto; 
    background: white; 
    padding: 25px; 
    border-radius: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

.form-control, .form-label {
    font-family: 'Iskoola Pota', 'Noto Sans Sinhala', sans-serif;
}

/* PDF Template */
#pdfTemplate {
    width: 210mm; 
    padding: 10mm 15mm; 
    margin: 0 auto; 
    background: white;
    font-family: 'Iskoola Pota', 'Noto Sans Sinhala', sans-serif; 
    color: black;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* CRITICAL: Footer එක page break වීම වැළැක්වීම */
.footer-table {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

/* Mobile Preview */
@media screen and (max-width: 768px) {
    #pdfTemplate {
        width: 100%;
        padding: 10mm;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

@media print {
    body { background-color: white; }
    .form-container, #previewSection > div:first-child, #previewSection > p { 
        display: none !important; 
    }
    #pdfTemplate { 
        display: block !important; 
        width: 210mm; 
        box-shadow: none; 
        border: none; 
        margin: 0; 
    }
    .footer-table {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}