/**
 * Official Bank & Cash Statement Print Stylesheet
 * High-end, official bank ledger and corporate financial statement styling.
 */

@charset "UTF-8";

/* ── Screen Preview Layout ─────────────────────────────────────────────── */
body.statement-screen {
    background-color: #f1f5f9;
    color: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Floating Toolbar (Screen only) */
.statement-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #0f172a;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.statement-toolbar-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.statement-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.statement-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}

.statement-btn-primary {
    background: #2563eb;
    color: #ffffff;
}
.statement-btn-primary:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.statement-btn-secondary {
    background: #334155;
    color: #f8fafc;
}
.statement-btn-secondary:hover {
    background: #475569;
    color: #ffffff;
}

/* A4 Page Container on Screen */
.statement-container {
    max-width: 210mm;
    margin: 1.5rem auto;
    background: #ffffff;
    padding: 12mm 12mm;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    box-sizing: border-box;
}

/* ── Statement Content Structure ────────────────────────────────────────── */

/* Header */
.statement-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 0.85rem;
    margin-bottom: 1rem;
}

.company-branding {
    max-width: 55%;
}

.company-logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.company-details {
    font-size: 0.76rem;
    color: #475569;
    line-height: 1.35;
}

.statement-title-block {
    text-align: right;
    max-width: 45%;
}

.statement-main-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.statement-meta-item {
    font-size: 0.75rem;
    color: #475569;
    line-height: 1.4;
}

.statement-meta-item strong {
    color: #1e293b;
}

/* Info Grid (Account & Period details) */
.statement-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.info-column {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.info-row {
    display: flex;
    font-size: 0.8rem;
    line-height: 1.3;
}

.info-row .lbl {
    width: 120px;
    min-width: 120px;
    font-weight: 600;
    color: #64748b;
    font-size: 0.76rem;
}

.info-row .val {
    color: #0f172a;
    font-weight: 600;
}

.info-row .val.highlight {
    font-weight: 700;
    color: #1e40af;
}

.iban-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Summary Cards / Table */
.statement-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
}

.statement-summary-table th {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    text-align: center;
}

.statement-summary-table td {
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e1;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.statement-summary-table td.text-incoming {
    color: #16a34a;
}
.statement-summary-table td.text-outgoing {
    color: #dc2626;
}
.statement-summary-table td.text-balance {
    color: #1e3a8a;
    background: #eff6ff;
}

/* Transaction Ledger Table */
.statement-tx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
}

.statement-tx-table thead th {
    background: #0f172a;
    color: #ffffff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    padding: 0.55rem 0.6rem;
    border: 1px solid #0f172a;
    text-align: left;
}

.statement-tx-table thead th.text-end {
    text-align: right;
}

.statement-tx-table tbody td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #f1f5f9;
    border-left: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1e293b;
}

.statement-tx-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.statement-tx-table tbody tr:hover td {
    background: #f1f5f9;
}

.statement-tx-table tbody tr.row-opening td {
    background: #f0fdf4;
    font-weight: 600;
}

.statement-tx-table td.col-date {
    white-space: nowrap;
    text-align: center;
    line-height: 1.15;
    padding: 0.35rem 0.25rem;
}

.statement-tx-table .tx-date {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.statement-tx-table .tx-time {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.67rem;
    color: #64748b;
    margin-top: 1px;
}

.statement-tx-table .tx-fno {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.61rem;
    font-weight: 600;
    color: #475569;
    margin-top: 2px;
    letter-spacing: -0.3px;
    line-height: 1.15;
    white-space: nowrap;
}

.statement-tx-table tr.row-opening .tx-fno {
    color: #16a34a;
    font-weight: 700;
}

.statement-tx-table td.col-num {
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.70rem;
    font-weight: 600;
    letter-spacing: -0.2px;
    padding: 0.35rem 0.4rem;
}

.statement-tx-table td.col-desc {
    word-break: break-word;
    line-height: 1.35;
    padding: 0.45rem 0.85rem;
}

.statement-tx-table .tx-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.77rem;
    line-height: 1.3;
}

.statement-tx-table .tx-counterparty {
    font-size: 0.73rem;
    color: #334155;
    margin-top: 2px;
    line-height: 1.25;
}

.statement-tx-table .tx-counterparty .lbl-badge {
    color: #64748b;
    font-weight: 600;
}

.statement-tx-table .tx-note {
    font-size: 0.70rem;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.25;
}

.statement-tx-table .tx-ref {
    font-size: 0.66rem;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    margin-top: 2px;
}

.statement-tx-table td.col-money {
    text-align: right;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.35rem 0.4rem;
}

.statement-tx-table td.col-debit {
    color: #dc2626;
}

.statement-tx-table td.col-credit {
    color: #16a34a;
}

.statement-tx-table td.col-balance {
    color: #0f172a;
    font-weight: 700;
    background-color: rgba(241, 245, 249, 0.4);
}

.statement-tag {
    display: inline-block;
    padding: 2px 5px;
    font-size: 0.64rem;
    font-weight: 600;
    border-radius: 3px;
    line-height: 1.2;
    text-align: center;
    background: #e2e8f0;
    color: #475569;
}

.statement-tag-income {
    background: #dcfce7;
    color: #15803d;
}

.statement-tag-expense {
    background: #fee2e2;
    color: #b91c1c;
}

/* Statement Footer & Signatures */
.statement-legal-note {
    font-size: 0.7rem;
    color: #64748b;
    border-top: 1px solid #cbd5e1;
    padding-top: 0.6rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.statement-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    page-break-inside: avoid;
}

.sig-box {
    width: 42%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sig-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
}

.sig-meta {
    font-size: 0.72rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

.sig-line {
    border-top: 1px solid #94a3b8;
    text-align: center;
    font-size: 0.7rem;
    color: #94a3b8;
    padding-top: 0.25rem;
}

/* ── PRINT MEDIA RULES (Clean A4 Paper Output) ─────────────────────────── */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 12mm 12mm 12mm;
    }

    body, body.statement-screen {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt;
        padding: 0 !important;
        margin: 0 !important;
    }

    .no-print,
    .statement-toolbar,
    .sidebar,
    .topbar,
    .navbar,
    #sidebar,
    .metric-card,
    .card:has(form),
    .btn,
    .btn-group,
    nav,
    .alert-light:has(button) {
        display: none !important;
    }

    .statement-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .statement-header {
        border-bottom: 2pt solid #000000 !important;
    }

    .statement-summary-table,
    .statement-summary-table th,
    .statement-summary-table td,
    .statement-info-grid,
    .sig-box {
        border-color: #333333 !important;
    }

    .statement-tx-table {
        page-break-inside: auto;
    }

    .statement-tx-table thead {
        display: table-header-group;
    }

    .statement-tx-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .statement-tx-table thead th {
        background: #000000 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .statement-signatures {
        page-break-inside: avoid;
    }
}
