.certificate-header {
    width: 100%;
    margin-bottom: 28px;
}

.certificate-header-grid {
    display: grid;
    grid-template-columns: 130px 1fr 130px;
    align-items: start;
    column-gap: 12px;
}

.certificate-logo-left,
.certificate-logo-right {
    text-align: center;
}

.certificate-logo {
    width: 105px;
    height: 105px;
    object-fit: contain;
}

.certificate-header-text {
    text-align: center;
    font-family: "Times New Roman", serif;
    color: #000;
    line-height: 1.08;
}

.cert-republic {
    font-size: 18px;
    font-weight: bold;
}

.cert-region {
    font-size: 18px;
    font-weight: bold;
}

.cert-barangay {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
}

.cert-office {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
}

.certificate-double-line {
    margin-top: 14px;
    border-top: 6px solid #000;
    border-bottom: 2px solid #000;
    height: 10px;
}

.certificate-no {
    margin-top: 8px;
    text-align: right;
    font-size: 14px;
}

.certificate-page {
    width: 8.5in;
    min-height: 11in;
    margin: 0 auto;
    padding: 1in;
    background: white;
    color: black;
    font-family: "Times New Roman", serif;
    border: 1px solid #ddd;
    position: relative;
    overflow: hidden;
}

.certificate-watermark {
    position: absolute;
    top: 35%;
    left: 50%;
    width: 430px;
    height: 430px;
    transform: translate(-50%, -50%);
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
    object-fit: contain;
}

.certificate-header,
.certificate-body,
.certificate-footer,
.certificate-note {
    position: relative;
    z-index: 1;
}

.certificate-title {
    margin-top: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    text-decoration: underline;
}

.certificate-body {
    font-size: 18px;
    line-height: 1.8;
    text-align: justify;
}

.certificate-footer {
    width: 100%;
    margin-top: 80px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: center;
}

.footer-left{
    display:flex;
    justify-content:flex-start;
}

.footer-right{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

.footer-qr-box {
    width: 220px;
    border: 2px solid #198754;
    border-radius: 14px;
    padding: 12px;
}

.qr-title {
    text-align:center;
    color:#198754;
    font-weight:bold;
    margin-bottom:8px;
}

.qr-image {
    width:120px;
    height:120px;
    display:block;
    margin:auto;
}

.qr-details {
    margin-top: 10px;
    border-top: 1px solid #198754;
    padding-top: 8px;
    font-size: 11px;
}

.detail-row {
    display: flex;
    margin-bottom: 4px;
}

.detail-label {
    width: 85px;          /* Adjust to 90px if needed */
    font-weight: bold;
    flex-shrink: 0;
}

.detail-label::after {
    content: ":";
    float: right;
    margin-right: 6px;
}

.detail-value {
    flex: 1;
}

.signature-line {
    width: 320px;
    border-top: 2px solid #000;
    margin-bottom: 10px;
}

.signature-name {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.signature-title {
    font-size: 16px;
    text-align: center;
}

.certificate-note {
    display: block;
    width: 100%;
    clear: both;
    margin-top: 30px;
    border-top: 3px double #198754;
    padding-top: 8px;
    text-align: center;
    font-size: 11px;
    font-style: italic;
}

.eopt-summary-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.eopt-summary-card .card {
    height: 100%;
}

.eopt-summary-card .card-body {
    text-align: center;
    padding: 15px;
}

.eopt-summary-card h4,
.eopt-summary-card h5 {
    margin: 0;
    white-space: nowrap;
}

.eopt-summary-card .badge {
    white-space: normal;
}

@media (max-width: 1200px) {
    .eopt-summary-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .eopt-summary-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .eopt-summary-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .certificate-page,
    .certificate-page * {
        visibility: visible !important;
    }

    .certificate-page {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 8.5in !important;
        height: 11in !important;
        min-height: 11in !important;
        margin: 0 !important;
        padding: 0.55in !important;
        border: none !important;
        box-shadow: none !important;
        overflow: hidden !important;
        page-break-after: avoid !important;
        page-break-inside: avoid !important;
    }

    .no-print {
        display: none !important;
    }
}

@page {
    size: Letter;
    margin: 0;
}