body { background: #f4f6f9; }
.login-bg { background: linear-gradient(135deg, #1e3a8a, #0ea5e9); }
.login-card { width: 100%; max-width: 380px; margin: 16px; border: 0; }

.navbar-brand { font-weight: 600; }
.stat-card { border: 0; }
.stat-card .label { font-size: .8rem; color: #6c757d; text-transform: uppercase; letter-spacing: .03em; }
.stat-card .value { font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td { vertical-align: middle; }
.table .desc { max-width: 420px; word-break: break-word; }
.table-sm td, .table-sm th { font-size: .875rem; }
.card { border: 0; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.drop-zone { border: 2px dashed #cbd5e1; border-radius: .5rem; padding: 1rem; background: #fff; }
.toast-container { z-index: 1100; }
.toast-body { white-space: pre-line; word-break: break-word; }
.toast { width: 420px; max-width: calc(100vw - 32px); }

/* ---------- Print view ---------- */
.print-only { display: none; }
@media print {
    @page { size: A4 landscape; margin: 10mm; }
    body { background: #fff; font-size: 10pt; }
    .navbar, form > div:not([id$="Sum"]), .toast-container, nav[id$="Pager"], .card-body:has(> #bankUpload), .card-body:has(> #opUpload),
    .card:has(#bankUpload), .card:has(#opUpload), button { display: none !important; }
    .print-only { display: block !important; }
    main { padding: 0 !important; }
    .card { box-shadow: none; border: 0; }
    .card-header { background: none !important; padding-left: 0; }
    .table-responsive { overflow: visible !important; }
    .table { font-size: 8.5pt; }
    .table th, .table td { padding: 2px 4px !important; }
    .table thead { display: table-header-group; }
    .table tr { break-inside: avoid; }
    .table .desc { max-width: none; }
    .badge { border: 1px solid #999; color: #000 !important; background: none !important; }
    .stat-card .value { font-size: 12pt; }
    .row > [class*="col-"] { flex: 1 0 0; width: auto; }
    .recon-detail td { background: #fff !important; }
    a { text-decoration: none; color: inherit; }
}

/* ---------- Small screens: every table row becomes a card ---------- */
@media screen and (max-width: 767.98px) {
    main { padding-left: 8px !important; padding-right: 8px !important; }
    .table-responsive { overflow: visible; }
    .table-cards > thead { display: none; }
    .table-cards, .table-cards > tbody { display: block; width: 100%; }
    .table-cards > tbody > tr {
        display: block; background: #fff; border: 1px solid #e2e8f0; border-radius: .5rem;
        margin: .5rem; padding: .5rem .75rem; box-shadow: 0 1px 2px rgba(0,0,0,.04);
    }
    .table-cards > tbody > tr > td {
        display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
        border: 0 !important; padding: .2rem 0 !important; text-align: right !important;
        white-space: normal !important; word-break: break-word; background: none !important;
    }
    .table-cards > tbody > tr > td::before {
        content: attr(data-label); font-weight: 600; color: #64748b; text-align: left; flex-shrink: 0; max-width: 45%;
    }
    .table-cards > tbody > tr > td:not([data-label]) { display: block; text-align: center !important; }
    .table-cards > tbody > tr > td:not([data-label])::before { content: none; }
    .table-cards > tbody > tr > td:empty { display: none; }
    .table-cards > tbody > tr > td:first-child { font-size: 1rem; }
    .table-cards .desc { max-width: none; }
    .table-cards > tbody > tr.recon-detail { padding: 0; border: 0; box-shadow: none; background: transparent; }
    .table-cards > tbody > tr.recon-detail > td { display: block; padding: 0 !important; }
    .table-cards .table-cards > tbody > tr { margin: .5rem 0; }
    .stat-card .value { font-size: 1.1rem; }
}
