/* Fee receipt rendering styles. Keep this file independent from common.css. */

#receipt-modal .receipt-shell {
    width: min(960px, 94vw);
    max-height: 92vh;
    overflow: auto;
    padding: 1.5rem;
    text-align: left;
}

.receipt-success {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.receipt-success h2 {
    justify-content: flex-start;
    margin-bottom: 0.35rem;
}

.fee-receipt-output-root {
    position: fixed;
    left: 0;
    top: 0;
    width: 210mm;
    min-height: 297mm;
    padding: 0;
    background: #ffffff;
    z-index: -1;
    pointer-events: none;
}

.receipt-sheet {
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
    padding: 1.6rem;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(59,130,246,0.15), transparent 26%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #0f172a;
    border: 1px solid rgba(59,130,246,0.15);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
    font-family: Inter, Arial, sans-serif;
}

.receipt-sheet.pdf-compact {
    width: 200mm !important;
    max-width: 200mm !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 4mm !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}

.receipt-sheet.style-classic {
    background: linear-gradient(180deg, #fffdf7 0%, #fff9eb 100%);
    border-color: rgba(146, 64, 14, 0.18);
}

.receipt-sheet.style-royal {
    background:
        radial-gradient(circle at top left, rgba(129,140,248,0.2), transparent 28%),
        linear-gradient(180deg, #f6f5ff 0%, #eef2ff 100%);
    border-color: rgba(79, 70, 229, 0.2);
}

.receipt-sheet.style-emerald {
    background:
        radial-gradient(circle at top right, rgba(16,185,129,0.18), transparent 30%),
        linear-gradient(180deg, #f3fff9 0%, #ecfdf5 100%);
    border-color: rgba(5, 150, 105, 0.2);
}

.receipt-sheet.style-sunset {
    background:
        radial-gradient(circle at top left, rgba(251,146,60,0.18), transparent 26%),
        linear-gradient(180deg, #fff8f2 0%, #fff1f2 100%);
    border-color: rgba(234, 88, 12, 0.18);
}

.receipt-watermark {
    position: absolute;
    right: -14px;
    top: 24px;
    transform: rotate(20deg);
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: rgba(22,163,74,0.08);
    pointer-events: none;
}

.receipt-sheet.pdf-compact .receipt-watermark {
    top: 10px;
    right: -6px;
    font-size: 2.8rem;
}

.receipt-top {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(59,130,246,0.28);
}

.receipt-sheet.pdf-compact .receipt-top {
    gap: 3mm;
    padding-bottom: 2.5mm;
}

.receipt-logo-box {
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(59,130,246,0.16);
    overflow: hidden;
}

.receipt-sheet.pdf-compact .receipt-logo-box {
    width: 16mm;
    height: 16mm;
    padding: 1.2mm;
    border-radius: 3mm;
}

.receipt-org-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.receipt-kicker {
    margin: 0 0 0.35rem;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.receipt-sheet.pdf-compact .receipt-kicker {
    font-size: 2.1mm;
    margin-bottom: 1mm;
}

.receipt-sheet.style-classic .receipt-kicker,
.receipt-sheet.style-classic .receipt-card h4,
.receipt-sheet.style-classic .receipt-note-box h4,
.receipt-sheet.style-classic .receipt-table th { color: #92400e; }

.receipt-sheet.style-royal .receipt-kicker,
.receipt-sheet.style-royal .receipt-card h4,
.receipt-sheet.style-royal .receipt-note-box h4,
.receipt-sheet.style-royal .receipt-table th { color: #4338ca; }

.receipt-sheet.style-emerald .receipt-kicker,
.receipt-sheet.style-emerald .receipt-card h4,
.receipt-sheet.style-emerald .receipt-note-box h4,
.receipt-sheet.style-emerald .receipt-table th { color: #047857; }

.receipt-sheet.style-sunset .receipt-kicker,
.receipt-sheet.style-sunset .receipt-card h4,
.receipt-sheet.style-sunset .receipt-note-box h4,
.receipt-sheet.style-sunset .receipt-table th { color: #c2410c; }

.receipt-org {
    flex: 1 1 auto;
    min-width: 0;
}

.receipt-org h1 {
    margin: 0;
    color: #0f172a;
    font-size: 1.7rem;
    line-height: 1.1;
}

.receipt-sheet.pdf-compact .receipt-org h1 {
    font-size: 4.5mm;
    line-height: 1.05;
}

.receipt-tagline,
.receipt-address {
    margin: 0.28rem 0 0;
    color: #475569;
    font-size: 0.86rem;
    line-height: 1.35;
}

.receipt-sheet.pdf-compact .receipt-tagline,
.receipt-sheet.pdf-compact .receipt-address {
    font-size: 2.7mm;
    line-height: 1.18;
    margin-top: 0.8mm;
}

.receipt-badge-box {
    display: grid;
    gap: 0.6rem;
    min-width: 170px;
    justify-items: end;
}

.receipt-sheet.pdf-compact .receipt-badge-box {
    min-width: 34mm;
    gap: 1.5mm;
}

.receipt-badge {
    display: inline-flex;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.receipt-sheet.pdf-compact .receipt-badge {
    padding: 1.2mm 2.5mm;
    font-size: 2.1mm;
}

.receipt-sheet.style-classic .receipt-badge {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.receipt-sheet.style-emerald .receipt-badge {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #047857;
}

.receipt-sheet.style-sunset .receipt-badge {
    background: linear-gradient(135deg, #ffedd5, #fecdd3);
    color: #c2410c;
}

.receipt-meta-chip {
    min-width: 170px;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: #ffffff;
    color: #0f172a !important;
    border: 1px solid #94a3b8;
    box-shadow: none;
}

.receipt-sheet.style-royal .receipt-meta-chip {
    background: #ffffff;
    color: #0f172a;
    border-color: #94a3b8;
}

.receipt-sheet.pdf-compact .receipt-meta-chip {
    min-width: 34mm;
    padding: 2mm 2.5mm;
    border-radius: 3mm;
}

.receipt-meta-chip span {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
}

.receipt-meta-chip strong {
    display: block;
    margin-top: 0.2rem;
    font-size: 1.12rem;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
}

.receipt-sheet.pdf-compact .receipt-meta-chip strong {
    font-size: 3.4mm;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
}

#modal-receipt-no,
#fee-receipt-print-root #modal-receipt-no,
.receipt-sheet .receipt-meta-chip #modal-receipt-no {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
}

.receipt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
    margin-top: 1rem;
}

.receipt-sheet.pdf-compact .receipt-grid {
    gap: 3mm;
    margin-top: 3mm;
}

.receipt-card,
.receipt-note-box,
.receipt-summary-box {
    padding: 0.95rem 1rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(148,163,184,0.22);
}

.receipt-sheet.pdf-compact .receipt-card,
.receipt-sheet.pdf-compact .receipt-note-box,
.receipt-sheet.pdf-compact .receipt-summary-box {
    padding: 2.4mm 3mm;
    border-radius: 3mm;
}

.receipt-card h4,
.receipt-note-box h4 {
    margin: 0 0 0.65rem;
    color: #2563eb;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.receipt-sheet.pdf-compact .receipt-card h4,
.receipt-sheet.pdf-compact .receipt-note-box h4 {
    margin-bottom: 1.8mm;
    font-size: 2.2mm;
}

.receipt-info-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem 0.9rem;
}

.receipt-sheet.pdf-compact .receipt-info-list {
    gap: 1.8mm 3mm;
}

.receipt-info-list span,
.receipt-summary-box span,
.receipt-signatures span,
.receipt-table th {
    display: block;
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.receipt-sheet.pdf-compact .receipt-info-list span,
.receipt-sheet.pdf-compact .receipt-summary-box span,
.receipt-sheet.pdf-compact .receipt-signatures span,
.receipt-sheet.pdf-compact .receipt-table th {
    font-size: 1.9mm;
    letter-spacing: 0.04em;
}

.receipt-info-list strong,
.receipt-summary-box strong,
.receipt-signatures strong,
.receipt-table td {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 800;
}

.receipt-sheet.pdf-compact .receipt-info-list strong,
.receipt-sheet.pdf-compact .receipt-summary-box strong,
.receipt-sheet.pdf-compact .receipt-signatures strong,
.receipt-sheet.pdf-compact .receipt-table td {
    font-size: 2.55mm;
    line-height: 1.15;
}

.receipt-table-wrap {
    margin-top: 1rem;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.24);
}

.receipt-sheet.pdf-compact .receipt-table-wrap {
    margin-top: 3mm;
    border-radius: 3mm;
}

.receipt-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    background: #ffffff;
}

.receipt-table th,
.receipt-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.receipt-sheet.pdf-compact .receipt-table th,
.receipt-sheet.pdf-compact .receipt-table td {
    padding: 1.8mm 2.2mm;
}

.receipt-table th {
    background: #eff6ff;
    color: #2563eb;
}

.receipt-footer-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 0.9rem;
    margin-top: 1rem;
}

.receipt-sheet.pdf-compact .receipt-footer-grid {
    gap: 3mm;
    margin-top: 3mm;
}

.receipt-note-box p {
    margin: 0;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.5;
}

.receipt-sheet.pdf-compact .receipt-note-box p {
    font-size: 2.45mm;
    line-height: 1.25;
}

.receipt-summary-box {
    display: grid;
    gap: 0.55rem;
}

.receipt-sheet.pdf-compact .receipt-summary-box {
    gap: 1.5mm;
}

.receipt-summary-box div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.receipt-summary-box .grand {
    margin-top: 0.15rem;
    padding-top: 0.55rem;
    border-top: 1px dashed #cbd5e1;
}

.receipt-sheet.pdf-compact .receipt-summary-box .grand {
    padding-top: 1.5mm;
}

.receipt-summary-box .grand strong {
    color: #1d4ed8;
    font-size: 1.05rem;
}

.receipt-sheet.pdf-compact .receipt-summary-box .grand strong {
    font-size: 3.2mm;
}

.receipt-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed #cbd5e1;
}

.receipt-sheet.pdf-compact .receipt-signatures {
    margin-top: 3mm;
    padding-top: 2.5mm;
    gap: 3mm;
}

.receipt-sheet.receipt-half-page-copy {
    width: 196mm !important;
    max-width: 196mm !important;
    padding: 2mm 3mm !important;
}

.receipt-sheet.receipt-half-page-copy .receipt-watermark {
    display: none;
}

.receipt-sheet.receipt-half-page-copy .receipt-top {
    gap: 2mm;
    padding-bottom: 1.5mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-logo-box {
    width: 12mm;
    height: 12mm;
    border-radius: 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-kicker {
    font-size: 1.7mm;
    margin-bottom: 0.5mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-org h1 {
    font-size: 3.5mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-tagline,
.receipt-sheet.receipt-half-page-copy .receipt-address {
    font-size: 2.1mm;
    line-height: 1.08;
    margin-top: 0.4mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-badge-box,
.receipt-sheet.receipt-half-page-copy .receipt-meta-chip {
    min-width: 28mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-badge {
    padding: 0.8mm 2mm;
    font-size: 1.8mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-meta-chip {
    padding: 1.4mm 2mm;
    border-radius: 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-meta-chip span {
    font-size: 1.6mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-meta-chip strong {
    font-size: 2.8mm;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a;
}

.receipt-sheet.receipt-half-page-copy .receipt-grid {
    gap: 2mm;
    margin-top: 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-card,
.receipt-sheet.receipt-half-page-copy .receipt-note-box,
.receipt-sheet.receipt-half-page-copy .receipt-summary-box {
    padding: 1.7mm 2mm;
    border-radius: 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-card h4,
.receipt-sheet.receipt-half-page-copy .receipt-note-box h4 {
    margin-bottom: 1.1mm;
    font-size: 1.8mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-info-list {
    gap: 1mm 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-info-list span,
.receipt-sheet.receipt-half-page-copy .receipt-summary-box span,
.receipt-sheet.receipt-half-page-copy .receipt-signatures span,
.receipt-sheet.receipt-half-page-copy .receipt-table th {
    font-size: 1.55mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-info-list strong,
.receipt-sheet.receipt-half-page-copy .receipt-summary-box strong,
.receipt-sheet.receipt-half-page-copy .receipt-signatures strong,
.receipt-sheet.receipt-half-page-copy .receipt-table td {
    font-size: 2.1mm;
    line-height: 1.05;
}

.receipt-sheet.receipt-half-page-copy .receipt-table-wrap {
    margin-top: 2mm;
    border-radius: 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-table th,
.receipt-sheet.receipt-half-page-copy .receipt-table td {
    padding: 1.2mm 1.6mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-footer-grid {
    gap: 2mm;
    margin-top: 2mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-note-box p {
    font-size: 2mm;
    line-height: 1.15;
}

.receipt-sheet.receipt-half-page-copy .receipt-summary-box {
    gap: 0.9mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-summary-box .grand {
    padding-top: 0.9mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-summary-box .grand strong {
    font-size: 2.6mm;
}

.receipt-sheet.receipt-half-page-copy .receipt-signatures {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    visibility: visible !important;
    margin-top: 2mm;
    padding-top: 1.8mm;
    gap: 2mm;
    border-top: 1px dashed #94a3b8;
}

.receipt-sheet.receipt-half-page-copy .receipt-signatures div {
    min-height: 9mm;
    align-content: end;
}

.receipt-signatures div {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 4mm;
    }

    html,
    body {
        width: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body * {
        visibility: hidden !important;
    }

    #receipt-modal,
    #receipt-modal *,
    #fee-receipt-print-root,
    #fee-receipt-print-root * {
        visibility: visible !important;
    }

    .receipt-success,
    .modal-actions {
        display: none !important;
    }

    #receipt-modal {
        position: static !important;
        display: block !important;
        background: #ffffff !important;
    }

    #receipt-modal .receipt-shell {
        width: 200mm !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        background: #ffffff !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .receipt-sheet {
        width: 200mm !important;
        max-width: 200mm !important;
        margin: 0 auto !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .receipt-watermark {
        display: none !important;
    }
}
