/* Restore the existing money form design in blue; card layouts are untouched. */
.reference-controls{margin:0 0 16px}
.reference-company-brand{display:flex!important;align-items:center}
.reference-shell .reference-company-link{min-width:0;flex:1;display:flex;flex-direction:column;gap:4px;text-decoration:none;color:#fff}
.reference-shell .reference-company-link strong{font-size:20px!important;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:100%}
.reference-shell .reference-company-link small{font-size:10px!important;line-height:1.4}
.reference-shell .reference-brand-mark{display:grid;border:0;font:inherit;font-weight:800;cursor:pointer;width:42px;height:42px;flex-shrink:0}
.reference-shell .reference-brand-mark:hover{background:#eaf2ff}
.reference-shell .reference-brand-mark:focus-visible,.reference-shell #referenceProfileButton:focus-visible{outline:3px solid #b7d5ff;outline-offset:3px}
.reference-shell #referenceProfileButton{cursor:pointer;display:inline-grid;flex-shrink:0;border-radius:50%;font-size:16px;font-weight:700}
dialog.money-ui{width:min(792px,calc(100% - 28px));border-radius:22px!important}
dialog.money-ui .dialog-head{background:linear-gradient(115deg,#f6f9ff,#edf3ff)}
dialog.money-ui .dialog-head::before{background:#2458b8;box-shadow:0 9px 18px #2458b824}
dialog.money-ui .finance-brand{color:#2458b8}
dialog.money-ui .dialog-head>button{display:grid!important}
dialog.money-ui .new-balance{background:#eff5ff;border-color:#c5d7f4}
dialog.money-ui .new-balance strong{color:#2458b8}
dialog.money-ui .dialog-actions .primary-btn,dialog.money-ui .dialog-actions .btn.primary{background:#2458b8;border-color:#2458b8;color:#fff;box-shadow:0 6px 14px #2458b820}
dialog.money-ui .dialog-actions .primary-btn:hover:not(:disabled),dialog.money-ui .dialog-actions .btn.primary:hover:not(:disabled){background:#1d489a;border-color:#1d489a}
dialog.money-ui .dialog-actions .btn.danger{background:#fff2f3;border-color:#edc8cc;color:#b63746}
dialog.money-ui .payment-balance-card{margin-top:0}
dialog.money-ui .payment-amount-field{display:flex;flex-direction:column;gap:7px;margin-top:18px}
dialog.money-ui .payment-amount-field input{width:100%;height:48px;font-size:18px;font-weight:700;padding:11px 14px}
#paymentDialog.money-ui #paymentGroupSelect{width:100%;padding:0;border:0;min-height:40px;background:transparent;font-size:16px;font-weight:700;color:#26394a}
#paymentDialog.money-ui .payment-fill-row{display:flex;justify-content:space-between;align-items:center;margin-top:8px;margin-bottom:14px;gap:12px;font-size:11px;color:#6d7d93}
#paymentDialog.money-ui .payment-fill-row button{border:0;background:transparent;color:#2458b8;font-size:12px;font-weight:700;cursor:pointer;min-height:28px}
dialog.money-ui .payment-safety{padding:14px 17px;margin-top:17px;background:#f0f5ff;border:1px solid #dae6fa;border-radius:12px;color:#526681}
dialog.money-ui .dialog-grid{margin-top:16px}
dialog.money-ui form>label{display:flex;flex-direction:column;gap:7px;margin-top:16px}
dialog.money-ui .dialog-actions{flex-wrap:wrap}
dialog.money-ui .dialog-actions button{min-height:44px}
dialog.money-ui .template-library-actions,.money-ui .dispute-library-actions{display:flex;flex-wrap:wrap;gap:8px}
dialog.money-ui .template-library-actions button{min-height:36px;padding:8px 11px;border-radius:8px;font-size:12px}
dialog.money-ui .dialog-head h2,dialog.money-ui .dialog-head h3{font-size:23px!important}
dialog.money-ui#officePersonDialog{width:min(560px,calc(100% - 28px))}
/* Commission retains its existing field structure and uses the same blue header/footer. */
#commissionDialog .commission-header{background:linear-gradient(115deg,#f6f9ff,#edf3ff)}
#commissionDialog .commission-header-icon{background:#2458b8;color:#fff}
#commissionDialog .commission-brand{color:#2458b8}
#commissionDialog .commission-actions .commission-save{background:#2458b8;border-color:#2458b8;color:#fff}
#commissionDialog .commission-footer{background:#f8fafb;border-top:1px solid #e5ebf0}
/* Paid office ledger actions. */
#office-payments .office-payment-row{grid-template-columns:34px minmax(0,1fr) auto auto minmax(145px,auto)}
#office-payments .office-payment-row-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;max-width:240px}
#office-payments .office-payment-row-actions button{min-height:36px;padding:8px 10px;border:1px solid #cfdbef;border-radius:8px;background:#f5f8ff;color:#2458b8;font-size:12px;font-weight:650;line-height:1.25;cursor:pointer}
#office-payments .office-payment-row-actions .office-delete-payment{background:#fff4f5;border-color:#eccbd0;color:#b13c49}
#office-payments .office-payment-row-actions button:disabled{opacity:.5;cursor:wait}
@media(min-width:821px){.reference-sidebar-collapsed .reference-company-link{display:none!important}.reference-sidebar-collapsed .reference-company-brand{padding:0 17px!important}}
@media(max-width:900px){#office-payments .office-payment-row{grid-template-columns:34px minmax(0,1fr) auto}#office-payments .office-send-status{grid-column:2}#office-payments .office-payment-row-actions{grid-column:2/-1;justify-content:flex-start;max-width:none}#office-payments .office-payment-row-actions button{grid-column:auto;grid-row:auto}}
@media(max-width:650px){dialog.money-ui .dialog-head h2,dialog.money-ui .dialog-head h3{font-size:21px!important}dialog.money-ui input:not([type=radio]):not([type=checkbox]),dialog.money-ui select,dialog.money-ui textarea{font-size:16px}dialog.money-ui .dialog-actions button{flex:1 1 140px}#paymentDialog.money-ui #paymentGroupSelect{font-size:16px}}

/* Ticket editor and preview dialogs share the finance header/footer, not the ticket cards. */
dialog.money-ui .ticket-check{display:flex;flex-direction:row;align-items:center;gap:10px}
dialog.money-ui .ticket-check input{width:auto;min-height:0}
dialog.money-ui:not(:has(>form)) > :not(.dialog-head):not(.dialog-actions){margin-left:28px;margin-right:28px}
dialog.money-ui > pre{white-space:pre-wrap;overflow-wrap:anywhere;padding:16px;border:1px solid #dde6f3;border-radius:12px;background:#f7faff;font-size:14px;line-height:1.8}
@media(max-width:650px){dialog.money-ui:not(:has(>form)) > :not(.dialog-head):not(.dialog-actions){margin-left:18px;margin-right:18px}}

/* Separate ledger headings from rows and separate every row field. */
#office-payments .office-approval-history,#office-payments .office-payment-history{margin-top:22px;overflow:hidden}
#office-payments .panel-title{padding:20px;border-bottom:1px solid #e2e9f4;background:#fff}
#office-payments .panel-title>div{display:flex;align-items:center;gap:13px}
#office-payments .panel-icon{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:12px;background:#edf3ff;color:#2458b8;font-size:20px}
#office-payments .panel-icon svg{width:23px;height:23px}
#office-payments .panel-title .eyebrow{margin:0 0 5px;color:#64758f;font-size:10px;letter-spacing:.08em}
#office-payments .panel-title h2{margin:0;color:#172b4c;font-size:18px;line-height:1.4}
#office-payments .office-approval-list,#office-payments .office-payment-list{padding:18px 20px;gap:12px}
#office-payments .office-approval-row{padding:18px;border-color:#dce5f1;gap:18px}
#office-payments .office-approval-main{gap:9px;line-height:1.5}
#office-payments .office-approval-main>div{gap:12px}
#office-payments .office-approval-main>div strong{font-size:15px;color:#223653}
#office-payments .office-approval-main>b{font-size:18px;color:#2458b8;line-height:1.4}
#office-payments .office-approval-main small{display:block;font-size:12px;color:#65758d;line-height:1.6}
#office-payments .office-approval-status{display:inline-flex;align-items:center;padding:5px 10px;line-height:1.4;font-size:11px}
#office-payments .office-payment-row{padding:16px;gap:14px;border-color:#dce5f1}
#office-payments .office-payment-row-main{display:grid;gap:6px;min-width:0;line-height:1.5}
#office-payments .office-payment-row-main strong{font-size:15px;color:#223653}
#office-payments .office-payment-row-main span,#office-payments .office-payment-row-main small{display:block;font-size:12px;color:#65758d;overflow-wrap:anywhere}
#office-payments .office-payment-amount{font-size:16px;color:#2458b8;white-space:nowrap}
#office-payments .office-send-status{padding:6px 10px;line-height:1.4;font-size:11px;white-space:normal}
#office-payments .office-payment-heading h2{color:#172b4c}
#office-payments .office-payment-metrics{grid-template-columns:repeat(5,minmax(0,1fr))}
#office-payments .office-payment-metrics article{background:#fff;border-color:#dce5f1}
#office-payments .office-person-grid{margin-bottom:22px}
.reference-admin-menu{position:relative;flex:none;z-index:1}
.reference-admin-menu summary{display:flex;align-items:center;gap:7px;list-style:none;cursor:pointer;color:#233953;font-size:13px;min-height:42px;padding:0 6px;border-radius:8px}
.reference-admin-menu summary::-webkit-details-marker{display:none}
.reference-admin-menu summary>svg{width:17px;height:17px;transition:transform .15s}
.reference-admin-menu[open] summary>svg{transform:rotate(180deg)}
.reference-admin-items{position:absolute;right:0;top:calc(100% + 10px);display:grid;min-width:220px;padding:7px;border:1px solid #dce5f1;border-radius:12px;background:#fff;box-shadow:0 15px 40px #19375c26}
.reference-admin-items button{display:flex;align-items:center;gap:11px;border:0;background:#fff;color:#263c5d;padding:11px 12px;min-height:42px;text-align:left;font-size:13px;border-radius:7px;cursor:pointer}
.reference-admin-items svg{width:19px;height:19px;flex:none;color:#4a6790}
.reference-admin-items button:hover:not(:disabled){background:#eef4ff;color:#2458b8}
.reference-admin-items button:disabled{opacity:.45;cursor:not-allowed}
.reference-admin-menu summary:focus-visible{outline:2px solid #2458b8;outline-offset:3px}
.reference-activity-symbol.activity-money{background:#e3f6ec;color:#00a761}
.reference-activity-symbol.activity-groups{background:#e6efff;color:#0767ff}
.reference-activity-symbol.activity-plane{background:#e8f1ff;color:#0664ff}
.reference-activity-symbol.activity-loan{background:#fff1df;color:#ed900c}
.reference-activity-symbol.activity-clock{background:#fff1df;color:#ed900c}
.reference-activity-symbol.failed{background:#ffe9ed!important;color:#d63d51!important}
.reference-activity .reference-activity-copy{min-width:0;flex:1}
@media(max-width:1100px){#office-payments .office-payment-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:650px){#office-payments .office-payment-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}#office-payments .panel-title{padding:17px 16px}#office-payments .office-approval-list,#office-payments .office-payment-list{padding:14px 12px}#office-payments .office-approval-row,#office-payments .office-payment-row{padding:14px;gap:12px}.reference-admin-items{max-width:calc(100vw - 28px)}.reference-admin-menu summary{min-height:40px}}

#office-payments .office-payment-row-icon svg{width:22px;height:22px}
