.accounting-period-workspace{display:grid;gap:16px;min-width:0}.period-filters{display:grid;gap:12px}.period-filters>div{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.period-filters label{display:grid;gap:5px;font-size:12px;color:var(--text-muted,#64748b)}.period-filters select,.period-filters input{min-height:40px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:0 12px}.period-filters p{margin:0;color:#64748b;font-size:12px}.period-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.period-summary-grid article{background:#fff;border:1px solid #dbe5e8;border-radius:14px;padding:14px;display:grid;gap:6px}.period-summary-grid span{font-size:12px;color:#64748b}.period-summary-grid strong{font-size:20px;color:#0f4f55}.period-party-list,.period-orders,.period-documents{display:grid;gap:10px}.period-party-card,.period-order,.period-document{background:#fff;border:1px solid #dbe5e8;border-radius:14px;min-width:0}.period-party-card.payable{border-left:4px solid #0f858d}.period-party-card.receivable{border-left:4px solid #2563eb}.period-party-head,.period-order-head{display:flex;align-items:center;gap:8px;padding:8px}.period-row-toggle{appearance:none;border:0;background:transparent;flex:1;min-width:0;display:grid;grid-template-columns:28px minmax(130px,1.3fr) repeat(4,minmax(105px,1fr)) auto auto;gap:12px;align-items:center;text-align:left;padding:8px;color:#172b35}.period-row-toggle>span{min-width:0;display:grid;gap:3px}.period-row-toggle small{font-size:11px;color:#64748b}.period-row-toggle strong{font-size:13px;overflow-wrap:anywhere}.period-party-head>.period-row-toggle strong:first-of-type{font-size:15px}.chevron{font-size:24px;color:#0f858d;text-align:center}.period-status{display:inline-flex!important;width:max-content;border-radius:999px;padding:5px 9px;background:#eef2f6;font-size:11px}.period-status.reconciled{background:#dcfce7;color:#166534}.period-status.difference,.period-status.difference_acceptable{background:#fef3c7;color:#92400e}mark{background:#fff7d6;color:#875d00;border-radius:999px;padding:4px 8px;font-size:10px;white-space:nowrap}.period-inline-actions{display:flex;gap:6px;flex-wrap:wrap}.period-inline-actions button,.period-filters button{border:1px solid #0f858d;background:#fff;color:#0f7077;border-radius:9px;min-height:36px;padding:0 10px;font-size:12px;white-space:nowrap}.period-orders{padding:0 12px 12px 44px}.period-order{background:#f8fbfc}.period-order .period-row-toggle{grid-template-columns:28px minmax(180px,2fr) repeat(3,minmax(90px,1fr))}.full-order-no{white-space:normal;overflow-wrap:anywhere}.period-documents{padding:0 12px 12px 44px}.period-document{padding:6px;background:#fff}.period-document .period-row-toggle{grid-template-columns:28px minmax(135px,1.4fr) repeat(4,minmax(90px,1fr)) auto}.period-document.is-adjusted{border-color:#eab308}.period-comparison{display:flex;gap:18px;flex-wrap:wrap;padding:0 18px 12px 52px;color:#475569;font-size:12px}.period-items{overflow:auto;margin:6px 8px 8px 38px;border:1px solid #e2e8f0;border-radius:10px;max-height:320px}.period-items table{width:100%;border-collapse:collapse;font-size:12px}.period-items th,.period-items td{padding:9px;border-bottom:1px solid #e2e8f0;text-align:left}.period-items td:nth-child(n+3){text-align:right}.period-items td strong,.period-items td small{display:block}.period-empty,.period-loading{display:grid;place-items:center;min-height:160px;gap:6px}.period-modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.5);z-index:1200;display:grid;place-items:center;padding:18px}.period-modal{width:min(560px,100%);max-height:min(760px,90vh);overflow:auto;background:#fff;border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.25)}.period-modal header{display:flex;justify-content:space-between;align-items:start;padding:18px;border-bottom:1px solid #e2e8f0}.period-modal h2{margin:3px 0 0}.period-modal form{display:grid;gap:14px;padding:18px}.period-modal label{display:grid;gap:6px;font-size:13px}.period-modal input,.period-modal select,.period-modal textarea{border:1px solid #cbd5e1;border-radius:9px;padding:10px;font:inherit}.period-modal label.check{display:flex;align-items:center}.period-modal footer{display:flex;justify-content:flex-end;gap:8px}.period-modal button{border:1px solid #cbd5e1;background:#fff;border-radius:9px;min-height:38px;padding:0 12px}.period-modal button.primary{background:#0f858d;color:#fff;border-color:#0f858d}.modal-system-amount{display:flex;justify-content:space-between;background:#f1f5f9;padding:12px;border-radius:10px}.period-audit-list{padding:18px;display:grid;gap:10px}.period-audit-list article{border-left:3px solid #0f858d;padding:6px 10px}.period-audit-list span,.period-audit-list small{display:block;color:#64748b;font-size:12px}.period-audit-list p{margin:4px 0}
@media(max-width:900px){.period-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.period-party-head,.period-order-head{align-items:stretch;flex-direction:column}.period-row-toggle,.period-order .period-row-toggle,.period-document .period-row-toggle{grid-template-columns:28px repeat(2,minmax(0,1fr))}.period-row-toggle .chevron{grid-row:1/4}.period-orders,.period-documents{padding-left:10px}.period-inline-actions{justify-content:flex-end}.period-items{margin-left:8px}}
@media(max-width:480px){.accounting-period-workspace{gap:10px}.period-summary-grid{grid-template-columns:1fr 1fr}.period-summary-grid article{padding:10px}.period-summary-grid strong{font-size:16px}.period-row-toggle,.period-order .period-row-toggle,.period-document .period-row-toggle{grid-template-columns:24px 1fr}.period-row-toggle .chevron{grid-row:1/8}.period-party-head,.period-order-head{padding:6px}.period-orders,.period-documents{padding:0 6px 6px}.period-comparison{padding:4px 10px 10px}.period-inline-actions button{min-height:44px}.period-items{max-width:calc(100vw - 70px)}.period-modal-backdrop{padding:8px}.period-modal{max-height:94vh}}
.period-quick-shifts{display:flex;gap:8px}
.accounting-period-workspace>.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.period-export-button{min-height:40px;padding:0 14px;border:1px solid #0f858d;border-radius:10px;background:#0f858d;color:#fff}.period-party-card>.period-party-head>.period-row-toggle{grid-template-columns:28px minmax(130px,1.3fr) repeat(3,minmax(105px,1fr)) auto auto}.period-document .period-row-toggle{grid-template-columns:28px minmax(135px,1.4fr) repeat(5,minmax(90px,1fr)) auto}.period-inline-actions button.primary{background:#0f858d;color:#fff}.modal-system-amount span{display:grid;gap:3px}.modal-system-amount small{font-size:11px;color:#64748b;font-weight:400}.difference-live{display:flex;justify-content:space-between;align-items:center;border:1px solid #dbe5e8;background:#f8fafc;border-radius:10px;padding:10px 12px}.difference-live strong{font-size:18px}.export-period-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.period-audit-list article{display:grid;gap:6px}.audit-amounts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:4px 0}.audit-amounts div{background:#f8fafc;border-radius:8px;padding:7px}.audit-amounts dt{font-size:11px;color:#64748b}.audit-amounts dd{margin:2px 0 0;font-weight:700}.period-modal input[readonly]{background:#f1f5f9;color:#475569}
@media(max-width:900px){.period-party-card>.period-party-head>.period-row-toggle,.period-document .period-row-toggle{grid-template-columns:28px repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.accounting-period-workspace>.topbar{align-items:stretch;flex-direction:column}.period-export-button{width:100%}.period-party-card>.period-party-head>.period-row-toggle,.period-document .period-row-toggle{grid-template-columns:24px 1fr}.export-period-grid,.audit-amounts{grid-template-columns:1fr}}
.difference-live{display:grid;grid-template-columns:1fr auto;gap:3px 10px}.difference-live small{grid-column:1/-1;color:#64748b}.period-modal [hidden]{display:none!important}.export-period-grid.month,.export-period-grid.quarter{grid-template-columns:repeat(2,minmax(0,1fr))}.export-period-grid.year{grid-template-columns:1fr}.export-preview{display:grid;gap:4px;padding:11px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc;color:#475569}.export-preview.ready{border-color:#5db7a6;background:#effbf7;color:#145f55}.export-preview.empty{border-color:#e5b95f;background:#fff9e8;color:#7c5710}.period-modal button:disabled{cursor:not-allowed;opacity:.5}
@media(max-width:480px){.export-period-grid.month,.export-period-grid.quarter,.export-period-grid.year{grid-template-columns:1fr}.period-modal footer{flex-wrap:wrap}.period-modal footer button{flex:1 1 auto}}

.period-comparison-modal,.period-reopen-modal{display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;width:min(720px,100%)}
.period-comparison-modal>header,.period-reopen-modal>header{position:relative;z-index:1;background:#fff}
.period-comparison-modal>.period-modal-body,.period-reopen-modal .period-modal-body{overflow:auto;min-height:0;padding:18px 24px;scrollbar-gutter:stable}
.period-comparison-modal>footer,.period-reopen-modal form>footer{margin:0;padding:14px 18px;border-top:1px solid #e2e8f0;background:#fff}
.period-reopen-modal form{display:grid;grid-template-rows:minmax(0,1fr) auto;min-height:0;padding:0;overflow:hidden}
.period-readonly-result{display:grid;gap:18px}.period-readonly-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.period-readonly-grid>div{min-width:0;padding:11px 12px;border:1px solid #dbe5e8;border-radius:10px;background:#f8fafc}
.period-readonly-grid dt{font-size:11px;color:#64748b}.period-readonly-grid dd{margin:4px 0 0;font-weight:700;overflow-wrap:anywhere}
.period-modal-audit{display:grid;gap:10px}.period-modal-audit h3{margin:0}.period-modal-audit article{display:grid;gap:5px;padding:10px 12px;border-left:3px solid #0f858d;background:#f8fafc;border-radius:8px}
.period-modal-audit span,.period-modal-audit small{display:block;color:#64748b;font-size:12px}
.period-reopen-alert{padding:12px 14px;border:1px solid #e5b95f;border-radius:10px;background:#fff9e8;color:#7c5710;line-height:1.6}
.period-modal .reopen-warning{border-color:#b45309;color:#92400e;background:#fff7ed}.period-modal .reopen-warning:hover,.period-modal .reopen-warning:focus-visible{border-color:#92400e;background:#ffedd5;color:#78350f}
.period-previous-link{justify-self:start;color:#0f7077}.period-modal button:focus-visible,.period-modal input:focus-visible,.period-modal select:focus-visible,.period-modal textarea:focus-visible{outline:3px solid rgba(15,133,141,.25);outline-offset:2px}
@media(max-width:480px){.period-comparison-modal,.period-reopen-modal{width:100%;max-height:calc(100dvh - 16px)}.period-comparison-modal>.period-modal-body,.period-reopen-modal .period-modal-body{padding:14px 16px}.period-readonly-grid{grid-template-columns:1fr}.period-comparison-modal>footer,.period-reopen-modal form>footer{display:grid;grid-template-columns:1fr}.period-comparison-modal>footer button,.period-reopen-modal form>footer button{width:100%;min-height:44px}}

.period-payment-modal{width:min(620px,100%)}
.period-payment-modal form{gap:12px}
.period-payment-hint{margin:0;padding:10px 12px;border:1px solid #cfe5e6;border-radius:10px;background:#f3fbfb;color:#17636a;font-size:13px}
.period-payment-summary{padding:12px;border:1px solid var(--erp-border);border-radius:var(--erp-radius-md);background:var(--erp-surface-subtle)}
.period-payment-summary h3,.period-payment-voucher h3{margin:0 0 8px;font-size:14px;color:var(--erp-text);font-weight:var(--erp-font-weight-semibold)}
.period-payment-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 18px;margin:0}
.period-payment-summary-grid>div,.period-payment-summary-grid>label{min-width:0;display:grid;gap:6px;align-content:start}
.period-payment-summary-grid>label>span,.period-payment-summary-grid>div>dt{color:var(--erp-text-muted);font-size:12px;white-space:nowrap}
.period-payment-summary-grid>label>input,.period-payment-summary-grid>label>select{width:100%;min-width:0}
.period-payment-summary-grid dt{color:var(--erp-text-muted);font-size:12px;white-space:nowrap}
.period-payment-summary-grid dd{margin:0;color:var(--erp-text);font-size:14px;font-weight:var(--erp-font-weight-semibold);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.period-payment-voucher{display:grid;gap:12px}
.period-payment-voucher h3{padding-bottom:8px;border-bottom:1px solid var(--erp-border);margin-bottom:0}
.period-payment-voucher>label{display:grid;gap:6px}
.period-payment-voucher>label>small,.period-payment-bank-meta{margin:0;color:var(--erp-text-muted);font-size:12px}
.period-payment-check-void{display:grid;gap:8px;padding:12px;border:1px solid #fecaca;border-radius:var(--erp-radius-md);background:#fff7f7}
.period-payment-check-void>p{margin:0;color:var(--erp-text-secondary);font-size:13px}
.period-payment-check-void>label{display:grid;gap:6px}
.period-payment-check-void>button{justify-self:start}
.period-payment-empty{margin:0;padding:10px 12px;border:1px dashed var(--erp-border);border-radius:var(--erp-radius-md);color:var(--erp-text-secondary);font-size:13px}
.period-payment-modal footer{border-top:1px solid #e2e8f0;padding-top:14px}
.period-receipt-modal{width:min(1080px,calc(100vw - 24px))}
.payment-receipt-sheet{box-sizing:border-box;width:100%;max-width:100%;aspect-ratio:210 / 55;margin:12px auto;background:#fff;border:1px solid #26353a;border-radius:0;padding:2.5mm 4mm 2mm;color:#15252b;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:1.5mm;overflow:hidden;box-shadow:none}
.payment-receipt-paper-header{display:grid;gap:1mm;text-align:center;border-bottom:1px solid #26353a;padding:0 0 2mm;line-height:1.2;min-width:0}
.period-modal .payment-receipt-paper-header{display:grid;justify-content:initial;align-items:initial;padding:0 0 2mm;border-bottom:1px solid #26353a}
.payment-receipt-title-line{display:flex;align-items:baseline;justify-content:center;gap:8px;min-width:0;white-space:nowrap;line-height:1.1}
.payment-receipt-title-line strong{font-size:clamp(16px,2vw,21px);font-weight:800;overflow:hidden;text-overflow:ellipsis}
.payment-receipt-title-line span{font-size:12px;color:#4f6268;flex:0 0 auto}
.payment-receipt-title-line h1{margin:0;font-size:clamp(18px,2.2vw,23px);line-height:1.1;flex:0 0 auto}
.payment-receipt-layout{display:grid;grid-template-columns:minmax(0,40%) minmax(0,55%);gap:5%;min-height:0;overflow:hidden}
.payment-receipt-details{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:1mm}
.payment-receipt-details h2{margin:0;font-size:13px;line-height:1.2}
.payment-receipt-layout dl{margin:0;border:1px solid #809196;min-height:0;overflow:hidden;display:grid;grid-template-rows:none;grid-auto-rows:minmax(0,1fr)}
.payment-receipt-layout dl>div{display:grid;grid-template-columns:40% minmax(0,1fr);min-height:0;border-bottom:1px solid #c2ced0}
.payment-receipt-layout dl>div:last-child{border-bottom:1px solid #c2ced0}
.payment-receipt-layout dt,.payment-receipt-layout dd{margin:0;padding:1.5mm 2mm;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.25}
.payment-receipt-layout dt{background:#f4f7f7;font-weight:700}
.payment-signature-box{border:1px solid #809196;padding:3mm 4mm;min-height:0;display:grid;grid-template-rows:auto auto 1fr;align-content:stretch;gap:0;overflow:hidden}
.payment-signature-box h2{margin:0;font-size:15px;line-height:1.2}
.payment-receipt-recipient{display:grid;gap:6px;padding-top:2mm;font-size:12px;line-height:1.3;min-width:0}
.payment-receipt-recipient span{color:#4f6268;font-size:11px}
.payment-receipt-recipient strong{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.payment-receipt-signature-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:24px;padding-top:2mm;font-size:11px;line-height:1.25;min-width:0}
.payment-receipt-signature-item{display:flex;align-items:center;min-width:0;white-space:nowrap}
.payment-receipt-signature-label{display:inline-flex;align-items:center;line-height:1}
.payment-receipt-signature-line{display:inline-block;height:0;min-width:0;margin-left:4px;border-bottom:1px solid #26353a;vertical-align:middle;transform:translateY(4px);flex:0 1 auto}
.payment-receipt-signature-row .payment-receipt-signer{flex:0 1 52%}
.payment-receipt-signature-row .payment-receipt-date{flex:0 1 38%}
.payment-receipt-signer .payment-receipt-signature-line{width:160px}
.payment-receipt-date .payment-receipt-signature-line{width:110px}
.payment-receipt-paper-footer{display:flex;justify-content:space-between;gap:12px;border-top:1px solid #26353a;padding-top:2mm;color:#4f6268;font-size:10px;line-height:1.2}
.period-modal .payment-receipt-paper-footer{justify-content:space-between;gap:12px;padding-top:2mm}
.payment-receipt-paper-footer span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.payment-receipt-paper-footer span:first-child{flex:1}
.payment-receipt-paper-footer span:last-child{flex:0 0 auto}
@media(max-width:480px){.period-payment-modal,.period-receipt-modal{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.period-payment-modal footer,.period-receipt-modal>footer{display:grid;grid-template-columns:1fr}.period-payment-modal footer button,.period-receipt-modal>footer button{width:100%;min-height:44px}.period-payment-summary-grid{grid-template-columns:1fr}.payment-receipt-sheet{margin:10px auto;padding:3mm;aspect-ratio:210 / 55}.payment-receipt-layout{grid-template-columns:minmax(0,40%) minmax(0,55%);gap:5%}.payment-receipt-title-line{gap:5px}.payment-receipt-title-line strong{font-size:14px}.payment-receipt-title-line h1{font-size:16px}.payment-receipt-title-line span{font-size:10px}.payment-receipt-layout dt,.payment-receipt-layout dd{font-size:9px;padding:1mm}.payment-signature-box{padding:2mm}.payment-signature-box h2{font-size:9px}.payment-receipt-recipient{gap:4px;padding-top:1mm;font-size:10px}.payment-receipt-recipient span{font-size:9px}.payment-receipt-signature-row{gap:6px;margin-top:20px;font-size:9px}.payment-receipt-paper-footer{font-size:8px}}

/* A4 portrait receipt layout prototype: one shared receipt template, repeated per page. */
.payment-receipt-preview-controls{display:flex;align-items:end;gap:18px;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--erp-border);background:var(--erp-surface-subtle);font-size:12px;color:var(--erp-text-muted)}
.payment-receipt-preview-controls>div{display:grid;gap:6px}
.payment-receipt-mode-buttons{display:flex;gap:6px;flex-wrap:wrap}
.payment-receipt-preview-controls .tf-action-button{min-height:36px}
.payment-receipt-long-text{display:flex!important;align-items:center;gap:8px;min-height:36px;margin-left:auto;white-space:nowrap;color:var(--erp-text)}
.payment-receipt-long-text input{accent-color:var(--erp-primary)}
.payment-receipt-a4-preview{display:grid;gap:24px;align-items:start;overflow:auto;padding:20px 16px 24px;background:#e8edf0}
.payment-receipt-a4-surface{box-sizing:border-box;width:min(210mm,100%);aspect-ratio:210 / 297;max-width:100%;margin:0 auto;padding:8mm;display:grid;grid-template-rows:repeat(var(--receipt-copies),minmax(0,1fr));min-height:0;background:#fff;border:1px solid #9aa8ad;box-shadow:0 5px 18px rgba(15,35,42,.16)}
.payment-receipt-a4-surface .payment-receipt-sheet{width:auto;max-width:none;height:auto;aspect-ratio:auto;min-height:0;margin:0;border-radius:0;box-shadow:none;break-inside:avoid;page-break-inside:avoid}
.payment-receipt-a4-surface .payment-receipt-sheet:not(:last-child){border-bottom-style:dashed}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-sheet{padding:4mm 5mm 3mm;gap:2mm}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-title-line strong{font-size:17px}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-title-line h1{font-size:19px}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-layout dt,.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-layout dd{font-size:10px;padding:1.5mm 2mm}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-signature-box h2{font-size:13px}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-recipient{font-size:11px}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-signature-row{margin-top:14px;font-size:10px}
.payment-receipt-a4-surface[data-receipt-mode="2"] .payment-receipt-paper-footer{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-sheet{padding:3mm 4mm 2.5mm;gap:1.5mm}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-title-line strong{font-size:15px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-title-line h1{font-size:17px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-layout dt,.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-layout dd{font-size:9px;padding:1.2mm 1.7mm}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-details h2{font-size:11px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-signature-box{padding:2.5mm 3.5mm}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-signature-box h2{font-size:12px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-recipient{gap:4px;padding-top:1.5mm;font-size:10px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-recipient span{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-signature-row{margin-top:9px;font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="3"] .payment-receipt-paper-footer{font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-sheet{padding:2.2mm 3mm 1.8mm;gap:1mm}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-title-line{gap:4px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-title-line strong{font-size:12px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-title-line h1{font-size:13px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-title-line span{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-layout{gap:4%}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-details h2{font-size:10px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-layout dt,.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-layout dd{font-size:8px;padding:1mm 1.3mm}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-signature-box{padding:1.8mm 2.5mm}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-signature-box h2{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-recipient{gap:3px;padding-top:1mm;font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-recipient span{font-size:7px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-signature-row{gap:6px;margin-top:6px;font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="4"] .payment-receipt-paper-footer{font-size:7px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-sheet{padding:1.6mm 2.4mm 1.35mm;gap:.75mm}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-title-line{gap:3px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-title-line strong{font-size:11px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-title-line h1{font-size:12px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-title-line span{font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-layout{gap:3.5%}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-details h2{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-layout dt,.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-layout dd{font-size:7.5px;padding:.75mm 1mm}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-signature-box{padding:1.35mm 2mm}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-signature-box h2{font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-recipient{gap:2px;padding-top:.7mm;font-size:7.5px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-recipient span{font-size:6.5px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-signature-row{gap:4px;margin-top:4px;font-size:7px}
.payment-receipt-a4-surface[data-receipt-mode="5"] .payment-receipt-paper-footer{font-size:6.5px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-sheet{padding:1.25mm 2mm 1.05mm;gap:.6mm}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-title-line{gap:2px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-title-line strong{font-size:12px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-title-line h1{font-size:13px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-title-line span{font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-layout{gap:3%}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-details h2{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-layout dt,.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-layout dd{font-size:8.5px;padding:.58mm .8mm}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-signature-box{padding:1.05mm 1.6mm}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-signature-box h2{font-size:9px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-recipient{gap:2px;padding-top:.55mm;font-size:8.5px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-recipient span{font-size:7.5px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-signature-row{gap:3px;margin-top:3px;font-size:8px}
.payment-receipt-a4-surface[data-receipt-mode="6"] .payment-receipt-paper-footer{font-size:7.5px}
/* Payment receipt print is intentionally black and white: field hierarchy comes from rules, not fills. */
.payment-receipt-sheet,.payment-receipt-layout dt,.payment-receipt-layout dd,.payment-signature-box{background:transparent}
.payment-receipt-layout dt,.payment-receipt-layout dd,.payment-signature-box{color:#15252b}
.payment-receipt-print-root{display:none}
@media print{
  body.printing-payment-receipt{display:block!important;width:auto!important;height:auto!important;min-height:0!important;margin:0;background:#fff;overflow:visible!important}
  body.printing-payment-receipt>*:not(.payment-receipt-print-root){display:none!important}
  body.printing-payment-receipt>.payment-receipt-print-root{display:block!important;visibility:visible!important;width:auto;margin:0;padding:0;background:#fff}
  body.printing-payment-receipt>.payment-receipt-print-root,body.printing-payment-receipt>.payment-receipt-print-root *{visibility:visible!important}
  body.printing-payment-receipt .payment-receipt-a4-surface{box-sizing:border-box;width:100%;height:281mm;max-width:none;aspect-ratio:auto;padding:0;margin:0;display:grid;grid-template-rows:repeat(var(--receipt-copies),minmax(0,1fr));border:0;box-shadow:none;overflow:hidden;break-after:page;page-break-after:always}
  body.printing-payment-receipt .payment-receipt-a4-surface.is-last-page{break-after:auto;page-break-after:auto}
  body.printing-payment-receipt .payment-receipt-sheet{position:static;top:auto;left:auto;width:100%;height:auto;max-width:none;aspect-ratio:auto;margin:0;border-radius:0;box-shadow:none;break-inside:avoid;page-break-inside:avoid}
  body.printing-payment-receipt .payment-receipt-layout dt,body.printing-payment-receipt .payment-receipt-layout dd,body.printing-payment-receipt .payment-signature-box{background:transparent!important;color:#15252b!important}
}
@media(max-width:720px){.payment-receipt-preview-controls{align-items:stretch;display:grid;grid-template-columns:1fr}.payment-receipt-long-text{margin-left:0}.payment-receipt-a4-preview{padding:12px 8px 18px}.payment-receipt-a4-surface{width:100%}}
.period-party-card.group-surface-a{background:#fff}.period-party-card.group-surface-b{background:#edf4f7;border-color:#c8dbe2}.period-party-card>.period-party-head>.period-row-toggle{border-radius:10px}.period-party-card.group-surface-a>.period-party-head>.period-row-toggle:hover,.period-party-card.group-surface-a>.period-party-head>.period-row-toggle:focus-visible{background:#f7fafb}.period-party-card.group-surface-b>.period-party-head>.period-row-toggle:hover,.period-party-card.group-surface-b>.period-party-head>.period-row-toggle:focus-visible{background:#e3eef2}
.period-status.source_changed,.period-status.requires_reconciliation{background:#fff7d6;color:#875d00}.period-source-changed{display:flex;gap:8px 18px;align-items:center;flex-wrap:wrap;margin:0 18px 12px 52px;padding:10px 12px;border:1px solid #e5b95f;border-radius:10px;background:#fff9e8;color:#7c5710;font-size:12px}.period-source-changed strong{color:#713f12}.period-source-changed span{overflow-wrap:anywhere}
@media(max-width:480px){.period-source-changed{margin:0 10px 10px;padding:10px}}
.period-shared-filters{display:flex;align-items:end;gap:12px;flex-wrap:wrap;padding:14px 16px;border:1px solid #dbe5e8;border-radius:14px;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.05)}.period-shared-filters label{display:grid;gap:5px;min-width:180px;font-size:12px;color:#64748b}.period-shared-filters select,.period-shared-filters input{min-height:40px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;padding:0 12px;font:inherit;color:#172b35}.period-shared-filters .tf-action-button{min-height:40px}.reconcile-module-tabs{margin:0}.accounting-period-workspace>.topbar{min-width:0}.accounting-period-workspace>.topbar>div{min-width:0}.accounting-period-workspace .other-expense-workspace{min-width:0}
@media(max-width:640px){.period-shared-filters{display:grid;grid-template-columns:1fr;align-items:stretch;gap:10px;padding:12px}.period-shared-filters label{min-width:0}.period-shared-filters .tf-action-button{width:100%;min-height:44px}.reconcile-module-tabs{margin:0}.reconcile-module-tabs button{min-height:44px}}
.payment-batch-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 16px;border:1px solid #c7d9de;border-radius:14px;background:#f7fbfc}.payment-batch-summary{display:grid;gap:4px;min-width:0}.payment-batch-summary strong{font-size:14px;color:#17333d}.payment-batch-summary span{font-size:12px;color:#64748b}.payment-batch-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.period-payment-selection{display:inline-flex!important;align-items:center;justify-content:center;flex:0 0 28px;width:28px;min-width:28px;height:32px;margin-left:2px;padding:0;border:0;border-radius:0;background:transparent;cursor:pointer}.period-payment-selection:hover{background:transparent}.period-payment-selection input{width:18px;height:18px;margin:0;accent-color:#0f858d}.period-payment-selection:focus-within{outline:0}.payment-receipt-batch-summary{display:flex;align-items:center;min-height:36px;padding:0 12px;border:1px solid #c7d9de;border-radius:9px;background:#fff;color:#145f55;font-weight:600}.payment-receipt-a4-surface[data-receipt-mode="6"]{grid-template-rows:repeat(var(--receipt-copies),minmax(0,1fr))}
@media(max-width:640px){.payment-batch-toolbar{align-items:stretch;flex-direction:column;gap:12px;padding:12px}.payment-batch-actions{display:grid;grid-template-columns:1fr;justify-content:stretch}.payment-batch-actions .tf-action-button{width:100%;min-height:44px}.period-payment-selection{align-self:flex-start;margin:0 0 0 2px}.period-party-head>.period-row-toggle{width:100%}}

.payment-receipt-batch-info{display:flex;align-items:center;min-height:36px;padding:8px 16px;border-bottom:1px solid var(--erp-border);color:var(--erp-text-secondary);font-size:13px;font-weight:600}
.payment-receipt-a4-surface[data-receipt-mode="single"]{width:min(210mm,100%);height:65mm;aspect-ratio:210 / 65;padding:0;grid-template-rows:minmax(0,1fr);align-content:start}
.payment-receipt-a4-surface[data-receipt-mode="single"] .payment-receipt-sheet{width:100%;height:65mm;aspect-ratio:auto}
.payment-receipt-a4-surface[data-receipt-mode="single"] .payment-receipt-layout dt,.payment-receipt-a4-surface[data-receipt-mode="single"] .payment-receipt-layout dd{font-size:11px;line-height:1.2;padding:.8mm 2mm}
.period-bank-modal{width:min(640px,100%)}
.period-bank-account-switch{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
.period-bank-account-switch button{min-width:0;min-height:40px;padding:0 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#172b35;white-space:nowrap}
.period-bank-account-switch button:hover,.period-bank-account-switch button:focus-visible{border-color:#0f858d;background:#f1faf9}
.period-bank-account-switch button.active{border-color:#0f858d;background:#e5f5f3;color:#0f7077;font-weight:700}
.period-bank-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0}
.period-bank-grid>div{min-width:0;padding:11px 12px;border:1px solid #dbe5e8;border-radius:10px;background:#f8fafc}
.period-bank-grid dt{font-size:11px;color:#64748b}
.period-bank-grid dd{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:4px 0 0;font-weight:700;overflow-wrap:anywhere}
.period-bank-grid dd span{min-width:0;overflow-wrap:anywhere}
.period-bank-grid .tf-icon-button{flex:0 0 auto}
.period-bank-grid .period-bank-note{grid-column:1/-1}
.period-bank-readonly{margin:16px 0 0;color:#64748b;font-size:12px}
@media(max-width:480px){.period-bank-modal{width:100%}.period-bank-account-switch{display:grid;grid-template-columns:1fr}.period-bank-account-switch button{width:100%;min-height:44px;text-align:left}.period-bank-grid{grid-template-columns:1fr}.period-bank-grid .period-bank-note{grid-column:auto}}

/* Keep shared TFERP controls authoritative inside the legacy modal shell. */
.period-modal .tf-action-button{border:1px solid var(--erp-border);border-radius:var(--erp-radius-md);min-height:var(--erp-control-height-md);padding:8px 13px;background:var(--erp-surface);color:var(--erp-text)}
.period-modal .tf-icon-button{min-height:0;padding:0;border:1px solid var(--erp-border);border-radius:var(--erp-radius-sm);background:var(--erp-surface);color:var(--erp-text)}
.period-modal .tf-action-button--primary{border-color:var(--erp-primary);background:var(--erp-primary);color:#fff}
.period-modal .tf-action-button--primary:hover:not(:disabled){border-color:var(--erp-primary-hover);background:var(--erp-primary-hover);color:#fff}
.period-modal .tf-action-button--primary:active:not(:disabled){border-color:var(--erp-primary-active);background:var(--erp-primary-active);color:#fff}
.period-modal .tf-action-button:focus-visible,.period-modal .tf-icon-button:focus-visible{outline:none;box-shadow:var(--erp-shadow-focus)}
.period-payment-readonly{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;padding:8px 12px;border:1px solid var(--erp-border);border-radius:var(--erp-radius-md);background:var(--erp-surface-subtle);color:var(--erp-text-secondary)}
.period-payment-readonly span{font-size:13px;color:var(--erp-text-muted)}
.period-payment-readonly strong{color:var(--erp-text);font-weight:var(--erp-font-weight-semibold)}
.period-reconciliation-modal{display:grid;grid-template-rows:auto minmax(0,1fr);width:min(620px,calc(100vw - 32px));max-height:min(760px,calc(100dvh - 32px));overflow:hidden}
.period-reconciliation-modal>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px;border-bottom:1px solid #e2e8f0}
.period-reconciliation-modal>header small{display:block;color:#64748b;font-size:12px}
.period-reconciliation-modal>header h2{margin:3px 0 0;font-size:22px}
.period-reconciliation-modal>header .tf-icon-button{flex:0 0 auto}
.period-reconciliation-body{min-width:0;max-width:100%;overflow-x:hidden;overflow-y:auto;padding:18px}
.period-modal .period-reconciliation-form,.period-reconciliation-form{display:grid;gap:14px;min-width:0;max-width:100%;padding:0}
.period-reconciliation-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 16px;align-items:start;min-width:0}
.period-reconciliation-grid>*{min-width:0}
.period-reconciliation-summary,.period-reconciliation-difference,.period-reconciliation-readonly{box-sizing:border-box;min-height:74px}
.period-reconciliation-summary{display:flex;align-items:center;justify-content:space-between;padding:12px;border-radius:10px;background:#f1f5f9}
.period-reconciliation-summary span{display:grid;gap:3px;font-size:13px;font-weight:700}
.period-reconciliation-summary small{color:#64748b;font-size:11px;font-weight:400}
.period-reconciliation-summary strong,.period-reconciliation-readonly strong{font-size:18px}
.period-reconciliation-control,.period-reconciliation-grid .reconciliation-reason-field{display:grid;gap:6px;align-content:start;font-size:13px}
.period-reconciliation-control>span,.period-reconciliation-readonly>span{font-weight:700}
.period-reconciliation-control input,.period-reconciliation-grid .reconciliation-reason-field .erp-entity-picker-trigger{box-sizing:border-box;width:100%;min-height:42px}
.period-reconciliation-difference{display:grid;grid-template-columns:1fr auto;gap:3px 10px;align-items:center;padding:10px 12px;border:1px solid #dbe5e8;border-radius:10px;background:#f8fafc}
.period-reconciliation-difference small{grid-column:1/-1;color:#64748b}
.period-reconciliation-readonly{display:grid;align-content:center;gap:6px;padding:10px 12px;border:1px solid #dbe5e8;border-radius:10px;background:#f8fafc}
.period-reconciliation-grid .reconciliation-note-field,.period-reconciliation-note{grid-column:1/-1}
.period-reconciliation-grid textarea{box-sizing:border-box;width:100%;max-width:100%;min-height:72px;resize:vertical}
.period-reconciliation-guidance{margin:0;color:#64748b;font-size:12px}
.period-reconciliation-form>footer,.expense-readonly-check>footer,.period-reconciliation-body>footer{position:static;display:flex;justify-content:flex-end;gap:8px;margin:0;padding:0;border:0;background:transparent}
.period-reconciliation-body>.expense-readonly-check{display:grid;gap:14px}
@media(max-width:640px){.period-reconciliation-modal{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.period-reconciliation-body{padding:14px 16px}.period-reconciliation-grid{grid-template-columns:1fr}.period-reconciliation-grid .reconciliation-note-field,.period-reconciliation-note{grid-column:auto}.period-reconciliation-form>footer,.expense-readonly-check>footer{flex-wrap:wrap}.period-reconciliation-form>footer .tf-action-button,.expense-readonly-check>footer .tf-action-button{flex:1 1 auto;min-height:44px}}
.period-party-card.supervisor-returned{border-color:#dc6b6b}.period-party-card.supervisor-approved{border-color:#4f9b78}.period-review-returned{margin:0 14px 10px;padding:8px 10px;border-left:2px solid #c74444;color:#9d2f2f;font-size:13px}.period-supervisor-modal{width:min(680px,calc(100vw - 24px))}
.period-adjustment-toolbar{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px dashed var(--erp-border);border-radius:10px;background:transparent}
.period-adjustment-toolbar button{min-height:34px;padding:0 12px;border:1px solid var(--erp-border);border-radius:8px;background:#fff;color:#0f6f75;font-weight:700}
.period-adjustment-toolbar small{color:var(--erp-text-muted)}
.period-inline-actions .danger-link{color:#b42318}
.period-adjustment-modal .period-adjustment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:18px}
.period-adjustment-modal .period-adjustment-grid label{display:grid;gap:6px}.period-adjustment-modal .period-adjustment-grid .full{grid-column:1/-1}.period-adjustment-modal .period-adjustment-grid small{color:var(--erp-text-muted)}
@media(max-width:640px){.period-adjustment-modal .period-adjustment-grid{grid-template-columns:1fr}.period-adjustment-modal .period-adjustment-grid .full{grid-column:auto}.period-adjustment-toolbar{align-items:flex-start;flex-direction:column}}
