/* Admin & front-end form */
.rg-form{max-width:600px;margin:22px auto;padding:18px;background:#fff;border:1px solid #e6e6e6;border-radius:6px;font-family:Arial,Helvetica,sans-serif}
.rg-form label{display:block;font-weight:600;margin-bottom:6px}
.rg-form input[type="text"], .rg-form input[type="email"], .rg-form input[type="number"], .rg-form select, .rg-form textarea {width:100%;padding:8px;border:1px solid #ccc;border-radius:4px;margin-bottom:12px;box-sizing:border-box}
.rg-form button.rg-submit{background:#0073aa;color:#fff;padding:10px 16px;border:none;border-radius:4px;cursor:pointer; transition: all 0.3s ease;}
.rg-form button.rg-submit:hover{background:#005177;transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0,0,0,0.2);}
.rg-form .rg-paystack-btn {background-color: #3567d2; color: #fff; border: none; padding: 10px 16px; border-radius: 4px; cursor: pointer; margin-top: 10px;}
.rg-form .rg-paystack-btn:hover {background-color: #2b54ad;}

/* Input with currency symbol prefix */
.rg-input-with-currency {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.rg-input-with-currency span {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-right: none;
    padding: 8px 10px;
    border-radius: 4px 0 0 4px;
    font-weight: bold;
    color: #555;
    height: 34px;
    display: flex;
    align-items: center;
}
.rg-input-with-currency input {
    flex-grow: 1;
    border-left: none;
    border-radius: 0 4px 4px 0;
    margin-bottom: 0;
}


/* --- Receipt Layout --- */
.rg-receipt-container{
    max-width: 800px;
    margin: 30px auto;
    padding: 0;
    border: 1px solid #ddd;
    background: #fff;
    font-family: 'Arial', sans-serif;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
}

/* Watermark */
.rg-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 80px;
    color: rgba(0, 0, 0, 0.08);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
    font-weight: bold;
    text-transform: uppercase;
}
.rg-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 10px 30px;
    text-align: center;
}

.rg-section {
    padding: 15px 30px;
    position: relative;
    z-index: 1;
}

/* Header Bar */
.rg-header-top-bar {
    background-color: var(--rg-primary-color, #C00000);
    height: 15px;
    width: 100%;
    margin-bottom: 20px;
}

/* Main Header Section */
.rg-main-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 10px;
    position: relative;
    padding: 15px 30px;
}
.rg-company-branding {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-grow: 1;
}
.rg-company-logo-img {
    margin-bottom: 5px;
}
.rg-company-name-text {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}
.rg-company-contact-text {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* QR Code Box Positioning */
.rg-qr-code-box {
    width: auto;
    height: auto;
    z-index: 2;
    border: 1px solid #eee;
    padding: 5px;
    margin-left: 20px;
}
.rg-qr-code-box img {
    display: block;
    max-width: 100%;
    height: auto;
}
.rg-qr-error {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    color: #777;
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
}

/* Address Blocks (Bill To / Branch Info) */
.rg-address-blocks {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-bottom: 20px;
    padding-left: 30px;
    padding-right: 30px;
}
.rg-block {
    flex: 1;
    padding-right: 20px;
    line-height: 1.6;
    font-size: 14px;
}
.rg-block h3 {
    font-size: 16px;
    font-weight: bold;
    color: var(--rg-primary-color, #C00000);
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--rg-primary-color, #C00000);
    padding-bottom: 5px;
    display: inline-block;
}
.rg-branch-info {
    border-left: 1px solid #eee;
    padding-left: 20px;
}
.rg-branch-info-placeholder {
    flex: 1;
    padding-right: 20px;
    line-height: 1.6;
    font-size: 14px;
    border-left: 1px solid #eee;
    padding-left: 20px;
}

/* Receipt Details Block for Number, Date, Payment Mode */
.rg-receipt-details-block {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 10px 30px 20px 30px;
    border-top: 1px solid #eee;
    margin-bottom: 10px;
    font-size: 14px;
}
.rg-receipt-details-block .rg-detail-row {
    display: flex;
    justify-content: space-between;
    width: 30%;
    min-width: 200px;
    margin-bottom: 8px;
    line-height: 1.4;
}
.rg-receipt-details-block .rg-detail-row span:first-child {
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
    padding-right: 10px;
}
.rg-receipt-details-block .rg-receipt-number-value {
    color: var(--rg-primary-color, #C00000);
    font-size: 16px;
}


/* Items Table */
.rg-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}
.rg-items-table thead .rg-items-header-bar th {
    background-color: var(--rg-primary-color, #C00000);
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
}
.rg-items-table tbody td {
    border: 1px solid #eee;
    padding: 10px 15px;
    vertical-align: top;
    height: 30px;
}
.rg-items-table .rg-description-col { width: 50%; }
.rg-items-table .rg-qty-col { width: 15%; text-align: center; }
.rg-items-table .rg-unit-price-col { width: 15%; text-align: right; }
.rg-items-table .rg-total-col { width: 20%; text-align: right; }


/* Summary and Disclaimer Section */
.rg-summary-and-disclaimer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-top: 0;
    padding-left: 30px;
    padding-right: 30px;
}
.rg-remarks {
    flex: 1;
    padding-right: 20px;
    max-width: 60%;
}
.rg-disclaimer-text {
    font-size: 13px;
    color: #666;
    font-style: italic;
    margin-top: 0;
}
.rg-bank-details {
    margin-top: 20px;
}
.rg-bank-details h4 {
    color: var(--rg-primary-color, #C00000);
    margin-top: 0;
    margin-bottom: 5px;
}
.rg-bank-details p {
    margin: 0 0 5px 0;
    font-size: 13px;
}
.rg-bank-details .rg-bank-detail-item {
    margin-bottom: 10px;
    border: 1px solid #eee;
    padding: 8px;
    border-radius: 4px;
}
.rg-bank-details .rg-bank-detail-item p:last-child {
    margin-bottom: 0;
}
.rg-summary-totals {
    width: 40%;
    text-align: right;
    font-size: 14px;
    line-height: 1.8;
}
.rg-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}
.rg-summary-row span:first-child {
    font-weight: normal;
    color: #555;
}
.rg-summary-row span:last-child {
    font-weight: normal;
}
.rg-summary-row.rg-discount-row span {
    color: var(--rg-primary-color, #C00000);
}
.rg-total-paid {
    border-top: 2px solid var(--rg-primary-color, #C00000);
    padding-top: 8px;
    margin-top: 8px;
    font-size: 18px;
    font-weight: bold;
    color: var(--rg-primary-color, #C00000);
}
.rg-total-paid span:last-child {
    font-size: 20px;
}


/* Footer Bar */
.rg-footer-bar {
    background-color: var(--rg-primary-color, #C00000);
    color: #fff;
    padding: 10px 30px;
    text-align: center;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

/* Pay Now Button on receipt page */
.rg-paystack-btn-on-receipt {
    background-color: #3567d2;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    display: block;
    width: 100%;
    max-width: 250px;
    margin: 20px auto;
    text-align: center;
    text-decoration: none;
}
.rg-paystack-btn-on-receipt:hover {
    background-color: #2b54ad;
}

/* Print Button */
.rg-print-button-container {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #eee;
}
.rg-print-button-container .button {
    background-color: #0073aa;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}
.rg-print-button-container .button:hover {
    background-color: #005177;
}

/* --- New: Admin Table Responsiveness --- */
.rg-responsive-table-wrap {
    overflow-x: auto;
}
.widefat {
    width: 100%;
    min-width: 1200px;
}

/* --- New: Mobile Responsiveness for Receipt --- */
@media screen and (max-width: 768px) {
    .rg-receipt-container {
        margin: 15px;
        box-shadow: none;
        border: none;
    }
    .rg-section {
        padding: 10px 15px;
    }
    .rg-main-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .rg-company-branding {
        align-items: center;
    }
    .rg-qr-code-box {
        margin-top: 15px;
        margin-left: 0;
        width: 100px;
        height: 100px;
    }
    .rg-qr-code-box img {
        width: 100%;
        height: 100%;
    }
    .rg-address-blocks {
        flex-direction: column;
        padding-top: 10px;
        border-top: none;
    }
    .rg-block {
        width: 100%;
        padding-right: 0;
        margin-bottom: 20px;
    }
    .rg-branch-info,
    .rg-branch-info-placeholder {
        border-left: none;
        padding-left: 0;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }
    .rg-receipt-details-block {
        flex-direction: column;
        padding-left: 15px;
        padding-right: 15px;
    }
    .rg-receipt-details-block .rg-detail-row {
        width: 100%;
        min-width: auto;
    }
    .rg-items-table {
        font-size: 12px;
    }
    .rg-items-table thead th,
    .rg-items-table tbody td {
        padding: 8px 10px;
    }
    .rg-summary-and-disclaimer {
        flex-direction: column;
        align-items: center;
    }
    .rg-remarks {
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        margin-bottom: 20px;
    }
    .rg-summary-totals {
        width: 100%;
    }
    .rg-share-section-bottom {
        flex-direction: column;
        align-items: center;
    }
    .rg-share-section-bottom .button {
        width: 100%;
        margin-top: 10px;
    }
    .rg-paystack-btn-on-receipt {
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }
    .rg-bank-details {
        margin-top: 10px;
    }
    .rg-bank-details .rg-bank-detail-item {
        padding: 6px;
    }
    .rg-summary-row.rg-discount-row span:first-child {
        font-size: 12px;
    }
    .rg-total-paid span:last-child {
        font-size: 18px;
    }
    .rg-watermark {
        font-size: 40px;
    }
}
/* Print rules - show only receipt */
@media print{
    body *{visibility:hidden}
    .rg-receipt-container, .rg-receipt-container *{visibility:visible}
    .rg-receipt-container{
        position: absolute;
        left:0;
        top:0;
        width:100%;
        box-shadow:none;
        border:none;
        padding: 0;
    }
    .rg-print-button-container,
    .rg-share-section-bottom,
    .rg-paystack-btn-on-receipt {
        display: none;
    }
    .rg-watermark {
        font-size: 60px;
    }
}
