/* Reference CRM adaptation: scoped to the WordPress CRM workspace. */
.cpcrm-wrap, .cpcrm-wrap * { box-sizing: border-box; }
.cpcrm-wrap { font-family: Arial, sans-serif; font-size: 13px; color: #334155; }
.cpcrm-app-shell { grid-template-columns: 230px minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); }
.cpcrm-sidebar { padding: 22px 14px; border-right: 1px solid #e2e8f0; overflow-y: auto; }
.cpcrm-sidebar-toggle { align-items: center; align-self: flex-end; background: #fff; border: 1px solid #dbe2ea; border-radius: 5px; color: #475569; cursor: pointer; display: inline-flex; height: 32px; justify-content: center; margin: 0 0 14px; padding: 0; width: 32px; }
.cpcrm-sidebar-toggle:hover { background: #f8fafc; color: #0f172a; }
.cpcrm-sidebar-toggle .material-symbols-rounded { font-size: 19px; }
.cpcrm-app-shell.is-sidebar-collapsed { grid-template-columns: 72px minmax(0,1fr); }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-sidebar { padding-inline: 10px; }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-sidebar-toggle { align-self: center; }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-brand { justify-content: center; margin-inline: 0; padding-inline: 0; }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-brand > span,
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs .cpcrm-tab-group,
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs a > span:last-child,
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-accounting-subnav,
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-sidebar-foot > span:last-child { display: none; }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs a { justify-content: center; padding-inline: 10px; }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs a .material-symbols-rounded { margin: 0; }
.cpcrm-app-shell.is-sidebar-collapsed .cpcrm-sidebar-foot { justify-content: center; padding-inline: 0; }
.cpcrm-tabs { flex: 0 0 auto; }
.cpcrm-sidebar-foot { margin-top: auto; }
.cpcrm-tabs a { min-height: 40px; font-size: 13px; }
.cpcrm-tabs a.is-active { background: #eef2f6; color: #1e293b; }
.cpcrm-accounting-subnav { display: grid; gap: 2px; margin: 2px 0 8px 18px; padding-left: 12px; border-left: 1px solid #dbe2ea; }
.cpcrm-tabs .cpcrm-accounting-subnav a, .cpcrm-tabs .cpcrm-accounting-subnav a:hover, .cpcrm-tabs .cpcrm-accounting-subnav a.is-active { min-height: 34px; padding: 7px 10px; color: #64748b; background: transparent; font-size: 12px; font-weight: 400; transform: none; }
.cpcrm-tabs .cpcrm-accounting-subnav a:hover { color: #1e293b; background: #f6f8fa; }
.cpcrm-tabs .cpcrm-accounting-subnav a.is-active { color: #0f172a; background: #eef2f6; font-weight: 500; }
.cpcrm-tabs .cpcrm-accounting-subnav .material-symbols-rounded { font-size: 17px; }
.cpcrm-topbar { padding: 18px 24px; min-height: 76px; }
.cpcrm-page-title h1 { font-size: 20px; font-weight: 600; }
.cpcrm-page-title p { font-size: 13px; }
.cpcrm-main { background: #f1f3f6; }
.cpcrm-content { max-width: none; width: 100%; padding: 24px; }
.cpcrm-card, .cpcrm-stat { border-radius: 5px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px #0f172a0a; }
.cpcrm-stat::before { display: none; }
.cpcrm-stat { min-height: 104px; }
.cpcrm-stat strong { font-size: 26px; color: #334155; }
.cpcrm-card-head h2 { font-size: 17px; }
.cpcrm-kicker { display: none; }
.cpcrm-wrap .button { border-radius: 4px; min-height: 34px; font-size: 12px; font-weight: 500; }
.cpcrm-wrap .button-primary { background: #1e293b; border-color: #1e293b; }
.cpcrm-editor-card { padding: 0; overflow: visible; }
.cpcrm-editor-head { margin: 0; padding: 20px 24px; flex-wrap: wrap; }
.cpcrm-editor-head h2 { font-size: 18px; }
.cpcrm-editor-head p { display: none; }
.cpcrm-editor-actions { flex-wrap: wrap; }
.cpcrm-doc-form { grid-template-columns: minmax(0,1fr); gap: 0 !important; }
.cpcrm-doc-form > .cpcrm-form-section { border: 0; border-bottom: 1px solid #e2e8f0; border-radius: 0; background: #fff; padding: 24px; }
.cpcrm-form-section h3 { color: #334155; font-size: 15px; font-weight: 600; margin-bottom: 20px; }
.cpcrm-form-grid { gap: 20px 32px; }
.cpcrm-form-grid > label, .cpcrm-form-grid > div { min-width: 0; }
.cpcrm-form label > span, .cpcrm-line-row label > span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: #334155; margin-bottom: 0; }
.cpcrm-form input, .cpcrm-form select, .cpcrm-form textarea { font: inherit; background: #fafbfc; border-radius: 5px; min-height: 40px; padding: 7px 10px; }
.cpcrm-form input:focus, .cpcrm-form select:focus, .cpcrm-form textarea:focus { border-color: #64748b; box-shadow: 0 0 0 2px #cbd5e166; }
.cpcrm-line-head { border-color: #e2e8f0; padding-bottom: 16px; margin-bottom: 0; }
.cpcrm-line-head strong { color: #334155; font-size: 15px; font-weight: 600; }
.cpcrm-line-row { grid-template-columns: 36px repeat(11,minmax(0,1fr)) !important; background: #f8fafc !important; border-radius: 0; box-shadow: none !important; border-color: #e2e8f0 !important; gap: 16px !important; margin-top: 16px; padding: 16px !important; }
.cpcrm-line-row > .cpcrm-drag-handle { width: 32px; height: 36px; min-height: 36px; border: 0; background: transparent; margin-top: 24px; }
.cpcrm-line-row > .cpcrm-remove-line { width: 36px; min-height: 36px; height: 36px; }
.cpcrm-line-row input, .cpcrm-line-row select { min-height: 40px; }
.cpcrm-line-row textarea { font: inherit; min-height: 90px !important; }
.cpcrm-terms-section textarea { min-height: 240px !important; font: inherit; line-height: 1.6; }
.cpcrm-save-bar { position: static; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 24px; margin: 0; padding: 20px 24px; background: #fff; box-shadow: none; border: 0; border-radius: 0; }
.cpcrm-save-bar .cpcrm-total-preview { background: transparent; color: #475569; border: 0; padding: 0; font-size: 14px; }
.cpcrm-save-bar .cpcrm-total-preview strong { color: #1e293b; font-size: 24px; margin-left: 16px; }
.cpcrm-table { width: 100%; font-size: 13px; }
.cpcrm-table-scroll { max-width: 100%; overflow-x: auto; padding-bottom: 6px; scrollbar-gutter: stable; }
.cpcrm-tab-accounting .cpcrm-table-scroll .cpcrm-table { min-width: 920px; }
.cpcrm-table-scroll::-webkit-scrollbar { height: 9px; }
.cpcrm-table-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border: 2px solid #fff; border-radius: 999px; }
.cpcrm-table-scroll::-webkit-scrollbar-track { background: #f8fafc; }
.cpcrm-table th { background: #f1f5f9; font-size: 12px; text-align: left !important; text-transform: none; letter-spacing: 0; }
.cpcrm-table td { padding: 12px; }
.cpcrm-records-card { overflow-x: auto; }
.cpcrm-record-actions { flex-wrap: wrap; }
.cpcrm-record-actions form { min-width: 0; }
@media(max-width:1200px) {
  .cpcrm-line-row { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
  .cpcrm-line-row > .cpcrm-drag-handle { margin-top: 0; }
}
@media(max-width:782px) {
  .cpcrm-app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto minmax(0,1fr); }
  .cpcrm-content { padding: 14px; }
  .cpcrm-doc-form > .cpcrm-form-section, .cpcrm-editor-head { padding: 16px; }
  .cpcrm-form-grid { grid-template-columns: minmax(0,1fr); }
}
@media(max-width:700px) {
  .cpcrm-line-row { grid-template-columns: minmax(0,1fr) !important; }
}

/* Transaction editor: shared table columns, not repeated field cards. */
.cpcrm-status-form { margin: 0; }
.cpcrm-status-select, .cpcrm-status-field, .cpcrm-pill[class*="cpcrm-status-"] { background: var(--status-bg,#f1f5f9) !important; color: var(--status-fg,#475569) !important; border-color: var(--status-border,#cbd5e1) !important; }
.cpcrm-wrap .cpcrm-status-select { width: auto; min-width: 100px; max-width: 145px; min-height: 32px; padding: 4px 24px 4px 10px; border: 3px solid; border-radius: 6px; font: 500 12px/1.5 Arial,sans-serif; cursor: pointer; }
.cpcrm-status-draft { --status-bg:#f1f5f9; --status-fg:#475569; --status-border:#cbd5e1; }
.cpcrm-status-issued { --status-bg:#cffafe; --status-fg:#155e75; --status-border:#67e8f9; }
.cpcrm-status-sent { --status-bg:#dbeafe; --status-fg:#1e40af; --status-border:#93c5fd; }
.cpcrm-status-accepted { --status-bg:#dcfce7; --status-fg:#166534; --status-border:#86efac; }
.cpcrm-status-rejected { --status-bg:#fee2e2; --status-fg:#991b1b; --status-border:#fca5a5; }
.cpcrm-status-cancelled { --status-bg:#f3e8ff; --status-fg:#6b21a8; --status-border:#d8b4fe; }
.cpcrm-status-active { --status-bg:#d1fae5; --status-fg:#065f46; --status-border:#6ee7b7; }
.cpcrm-status-follow-up { --status-bg:#ffedd5; --status-fg:#9a3412; --status-border:#fdba74; }
.cpcrm-status-inactive { --status-bg:#e2e8f0; --status-fg:#334155; --status-border:#94a3b8; }
.cpcrm-status-unpaid { --status-bg:#ffe4e6; --status-fg:#9f1239; --status-border:#fda4af; }
.cpcrm-status-partial { --status-bg:#fef3c7; --status-fg:#92400e; --status-border:#fcd34d; }
.cpcrm-status-paid { --status-bg:#ecfccb; --status-fg:#3f6212; --status-border:#bef264; }
.cpcrm-wrap .button.cpcrm-trash { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; width: 34px; padding: 6px !important; background: #dc2626 !important; color: #fff !important; border: 1px solid #dc2626 !important; }
.cpcrm-wrap .button.cpcrm-trash:hover { background: #b91c1c !important; border-color: #b91c1c !important; }
.cpcrm-wrap .button.cpcrm-trash .material-symbols-rounded { font-size: 19px; color: #fff !important; }
.cpcrm-feedback { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid #bfdbfe; border-radius: 6px; background: #eff6ff; color: #1e40af; }
.cpcrm-feedback p { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.cpcrm-wrap .cpcrm-feedback .material-symbols-rounded { color: #1e40af; font-size: 20px; }
.cpcrm-dismiss-feedback { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.cpcrm-dismiss-feedback:hover { background: #dbeafe; }
.cpcrm-dismiss-feedback:focus-visible { outline: 2px solid #1e40af; outline-offset: 2px; }
.cpcrm-form .wp-editor-wrap { width: 100%; min-width: 0; border: 3px solid #cbd5e1; border-radius: 4px; box-sizing: border-box; overflow: hidden; }
.cpcrm-form .wp-editor-wrap button { min-height: 0; box-shadow: none; }
.cpcrm-document .cpcrm-rich-body, .cpcrm-live-preview .cpcrm-rich-body { font-size: 14px; font-weight: 400; margin-top: 10px; overflow-wrap: anywhere; }
.cpcrm-document .cpcrm-rich-body p, .cpcrm-live-preview .cpcrm-rich-body p { font-size: inherit !important; white-space: normal; margin: 0 0 10px; }
.cpcrm-document .cpcrm-rich-body b, .cpcrm-document .cpcrm-rich-body strong, .cpcrm-live-preview .cpcrm-rich-body b, .cpcrm-live-preview .cpcrm-rich-body strong { font-weight: 700 !important; display: inline; font-size: inherit; border: 0; padding: 0; }
.cpcrm-rich-body ul { list-style: disc outside; padding-left: 24px; }
.cpcrm-rich-body ol { list-style: decimal outside; padding-left: 24px; }
.cpcrm-rich-body li { margin-bottom: 4px; }
.cpcrm-extra-section { display: grid; gap: 16px; border-top: 1px solid #e2e8f0; padding: 24px 0; margin-top: 20px; }
.cpcrm-extra-section .cpcrm-remove-section { justify-self: start; }
.cpcrm-add-section { margin-top: 20px !important; }

/* The same light document layout is used by drafts, print and shared links. */
.cpcrm-document, .cpcrm-live-preview { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); column-gap: 36px; padding: 48px !important; color: #334155; font: 400 14px/1.5 Arial, sans-serif; }
.cpcrm-document > *, .cpcrm-live-preview > * { grid-column: 1 / -1; min-width: 0; }
.cpcrm-document > header, .cpcrm-live-preview > header { grid-column: 1; grid-row: 1; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 12px; margin: 0 0 32px; padding: 0; }
.cpcrm-document > .cpcrm-doc-meta, .cpcrm-live-preview > .cpcrm-live-meta { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 18px; text-align: right; margin-bottom: 32px; }
.cpcrm-document header strong, .cpcrm-live-preview header strong { display: none; }
.cpcrm-document header span, .cpcrm-live-preview header span { text-align: left; font-size: 18px; font-weight: 500; margin: 0; }
.cpcrm-document h1, .cpcrm-live-preview h2 { font-size: 14px; font-weight: 500; letter-spacing: 0; }
.cpcrm-document b, .cpcrm-document strong, .cpcrm-live-preview b, .cpcrm-live-preview strong { font-weight: 500 !important; }
.cpcrm-document p, .cpcrm-live-preview p { font-size: 14px !important; line-height: 1.5; margin: 8px 0; overflow-wrap: anywhere; }
.cpcrm-document .cpcrm-doc-items, .cpcrm-live-preview .cpcrm-doc-items { table-layout: fixed; width: 100%; margin: 0; }
.cpcrm-document .cpcrm-doc-items th, .cpcrm-live-preview .cpcrm-doc-items th { font-size: 13px; font-weight: 400 !important; text-transform: none; letter-spacing: 0; padding: 10px; background: #f1f5f9; border: 1px solid #e2e8f0; }
.cpcrm-document .cpcrm-doc-items td, .cpcrm-live-preview .cpcrm-doc-items td { padding: 10px; font-size: 14px; font-weight: 400; vertical-align: top; overflow-wrap: anywhere; }
.cpcrm-doc-items th:first-child { width: 5%; }
.cpcrm-doc-items th:nth-child(2) { width: 59%; }
.cpcrm-doc-items th:nth-child(3), .cpcrm-doc-items th:nth-child(4), .cpcrm-doc-items th:nth-child(5) { width: 12%; }
.cpcrm-document .cpcrm-doc-total, .cpcrm-live-preview .cpcrm-live-total { justify-self: end; width: 48%; margin: 24px 0 0; }
.cpcrm-document .cpcrm-doc-total div, .cpcrm-live-preview .cpcrm-live-total div { padding: 10px 0; font-size: 14px; }
.cpcrm-document .cpcrm-doc-total b, .cpcrm-live-preview .cpcrm-live-total b { font-size: 14px; font-weight: 400 !important; }
.cpcrm-document .cpcrm-doc-total .grand, .cpcrm-live-preview .cpcrm-live-total .grand { font-size: 14px; font-weight: 500; }
.cpcrm-document .cpcrm-doc-note, .cpcrm-live-preview .cpcrm-live-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid #e2e8f0; }
.cpcrm-live-preview [hidden], .cpcrm-document [hidden] { display: none !important; }
.cpcrm-document .cpcrm-doc-note b, .cpcrm-live-preview .cpcrm-live-note b { border-top: 0; padding-top: 0; font-size: 14px; }
.cpcrm-document, .cpcrm-preview-shell { border-radius: 0; }
.cpcrm-shared-document { margin: 0; background: #f1f5f9; font-family: Arial,sans-serif; }
.cpcrm-shared-document .cpcrm-print-wrap { max-width: 1080px; margin: 24px auto; padding: 16px; }
.cpcrm-shared-document .cpcrm-document { background: white; box-sizing: border-box; }
.cpcrm-shared-document .cpcrm-print-actions { margin-bottom: 16px; }
.cpcrm-shared-document button { padding: 10px 16px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; cursor: pointer; }
@media(max-width:600px) {
 .cpcrm-document, .cpcrm-live-preview { padding: 20px !important; column-gap: 16px; }
 .cpcrm-document > header, .cpcrm-live-preview > header { grid-column: 1 / -1; }
 .cpcrm-document > .cpcrm-doc-meta, .cpcrm-live-preview > .cpcrm-live-meta { grid-column: 1 / -1; grid-row: 2; text-align: left; }
 .cpcrm-document .cpcrm-doc-meta div:last-child, .cpcrm-live-preview .cpcrm-live-meta div:last-child { text-align: left; }
 .cpcrm-document .cpcrm-doc-total, .cpcrm-live-preview .cpcrm-live-total { width: 100%; }
 .cpcrm-document .cpcrm-doc-items td, .cpcrm-live-preview .cpcrm-doc-items td, .cpcrm-document .cpcrm-doc-items th, .cpcrm-live-preview .cpcrm-doc-items th { padding: 6px 3px; font-size: 11px; }
}
@media print { .cpcrm-shared-document { background: white; } .cpcrm-shared-document .cpcrm-print-wrap { margin: 0; padding: 0; max-width: none; } .cpcrm-print-actions { display: none !important; } }
.cpcrm-doc-form > .cpcrm-document-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px;
  padding-bottom: 34px;
}
.cpcrm-document-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cpcrm-billing-address { border-top: 1px solid #e2e8f0; padding-top: 16px; min-height: 108px; font-size: 13px; }
.cpcrm-billing-address strong { font-weight: 500; }
.cpcrm-billing-address p { margin: 10px 0 0; line-height: 1.6; color: #64748b; }
.cpcrm-document-column textarea[name="notes"] { min-height: 112px; resize: vertical; }
.cpcrm-document-column .cpcrm-form-grid { gap: 18px; }
.cpcrm-items-scroll { overflow-x: auto; max-width: 100%; padding-bottom: 2px; }
.cpcrm-items-table { min-width: 1100px; border: 1px solid #dfe3e8; }
.cpcrm-item-head, .cpcrm-items-table .cpcrm-line-row {
  display: grid;
  grid-template-columns: 30px minmax(160px, 1.6fr) minmax(210px, 2fr) minmax(110px,.8fr) minmax(95px,.85fr) minmax(85px,.8fr) minmax(125px,1fr) minmax(100px,.9fr) 40px !important;
  gap: 12px !important;
}
.cpcrm-item-head { background: #f1f3f6; padding: 12px; border-bottom: 1px solid #dfe3e8; }
.cpcrm-doc-form .cpcrm-item-head > span { color: #1e293b; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.cpcrm-items-table .cpcrm-line-row { margin: 0; border: 0; border-bottom: 1px solid #e2e8f0; padding: 22px 12px !important; align-items: start; border-radius: 0; }
.cpcrm-items-table .cpcrm-line-row:last-child { border-bottom: 0; }
.cpcrm-items-table .cpcrm-line-row > label { position: relative; grid-row: 1 !important; min-width: 0; }
.cpcrm-items-table .cpcrm-line-row > label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(1) { grid-column: 2 !important; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(2) { grid-column: 3 !important; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(3) { grid-column: 3 !important; grid-row: 2 !important; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(3) > span { position: static; width: auto; height: auto; clip-path: none; font-size: 11px; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(4) { grid-column: 4 !important; }
.cpcrm-items-table .cpcrm-qty-field { display: flex; flex-direction: column; gap: 7px; }
.cpcrm-items-table .cpcrm-qty-field .cpcrm-qty-label { min-height: 32px; padding: 5px 7px; font-size: 11px; }
.cpcrm-doc-qty-label { color: #64748b; font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(5) { grid-column: 5 !important; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(6) { grid-column: 6 !important; }
.cpcrm-items-table .cpcrm-line-row > label:nth-of-type(7) { grid-column: 7 !important; }
.cpcrm-items-table .cpcrm-line-row > .cpcrm-drag-handle { grid-column: 1 !important; grid-row: 1 !important; margin: 0; width: 28px !important; }
.cpcrm-items-table .cpcrm-line-row > .cpcrm-remove-line { grid-column: 9 !important; grid-row: 1 !important; align-self: start; width: 34px !important; }
.cpcrm-row-amount { grid-column: 8; grid-row: 1; text-align: right; padding-top: 10px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cpcrm-items-table textarea { min-height: 94px !important; resize: vertical; }
.cpcrm-doc-form .cpcrm-line-head { border: 0; padding-bottom: 22px; }
.cpcrm-invoice-summary { margin: 38px 0 0 auto; width: 65%; max-width: 760px; }
.cpcrm-invoice-summary > div { display: flex; align-items: center; justify-content: flex-end; gap: 24px; padding: 12px 0; border-top: 1px solid #e2e8f0; min-height: 44px; }
.cpcrm-invoice-summary output { min-width: 125px; text-align: right; font-variant-numeric: tabular-nums; }
.cpcrm-invoice-summary label { display: grid; grid-template-columns: auto minmax(90px,200px); align-items: center; gap: 18px; }
.cpcrm-summary-grand { font-size: 15px; }
.cpcrm-doc-form .cpcrm-invoice-summary > div > span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
@media(max-width:800px) {
  .cpcrm-doc-form > .cpcrm-document-columns { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .cpcrm-invoice-summary { width: 100%; }
}
@media(max-width:480px) {
  .cpcrm-invoice-summary > div { gap: 12px; }
  .cpcrm-invoice-summary label { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .cpcrm-invoice-summary output { min-width: 100px; }
}

/* Basic accounting workspace */
.cpcrm-accounting-nav { display: flex; gap: 8px; margin-bottom: 20px; padding: 5px; width: fit-content; max-width: 100%; overflow-x: auto; border: 1px solid #e2e8f0; background: #fff; }
.cpcrm-accounting-nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 13px; color: #64748b; text-decoration: none; white-space: nowrap; }
.cpcrm-accounting-nav a:hover { color: #0f172a; background: #f8fafc; }
.cpcrm-accounting-nav a.is-active { color: #0f172a; background: #eef2f6; font-weight: 600; }
.cpcrm-accounting-nav .material-symbols-rounded { font-size: 18px; }
.cpcrm-accounting-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 18px; }
.cpcrm-accounting-head h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.cpcrm-accounting-head p, .cpcrm-records-card .cpcrm-card-head p { margin: 0; color: #64748b; }
.cpcrm-period-filter { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.cpcrm-period-filter label { display: grid; gap: 5px; color: #64748b; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cpcrm-wrap .cpcrm-period-filter input, .cpcrm-wrap .cpcrm-period-filter select { min-height: 38px; padding: 6px 9px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; font: inherit; }
.cpcrm-accounting-stats { grid-template-columns: repeat(5,minmax(0,1fr)); }
.cpcrm-account-list, .cpcrm-activity-list { display: grid; }
.cpcrm-account-list > div, .cpcrm-activity-list > div { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 0; border-bottom: 1px solid #edf0f3; }
.cpcrm-account-list > div:last-child, .cpcrm-activity-list > div:last-child { border-bottom: 0; }
.cpcrm-account-list > div > .material-symbols-rounded { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 6px; color: #334155; background: #f1f5f9; }
.cpcrm-account-list p, .cpcrm-activity-list p { display: grid; gap: 2px; flex: 1; min-width: 0; margin: 0; }
.cpcrm-account-list strong, .cpcrm-activity-list strong { overflow: hidden; color: #1e293b; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.cpcrm-account-list small, .cpcrm-activity-list small { color: #94a3b8; }
.cpcrm-account-list b, .cpcrm-activity-list b { color: #1e293b; font-weight: 600; font-variant-numeric: tabular-nums; }
.cpcrm-activity-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.cpcrm-activity-icon.is-income { color: #166534; background: #dcfce7; }
.cpcrm-activity-icon.is-expense { color: #991b1b; background: #fee2e2; }
.cpcrm-activity-icon .material-symbols-rounded { font-size: 18px; }
.cpcrm-activity-list b.is-income, .cpcrm-money.is-income, .cpcrm-profit-report .is-income { color: #15803d; }
.cpcrm-activity-list b.is-expense, .cpcrm-money.is-expense, .cpcrm-profit-report .is-expense { color: #b91c1c; }
.cpcrm-accounting-entry { align-items: start; }
.cpcrm-accounting-entry > .cpcrm-card:first-child { position: sticky; top: 18px; }
.cpcrm-accounting-entry .cpcrm-upload-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.cpcrm-category-field { grid-column: 1 / -1; min-width: 0; }
.cpcrm-wrap .cpcrm-category-trigger { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 46px; padding: 9px 12px; border: 3px solid #cbd5e1; border-radius: 6px; color: #1e293b; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.cpcrm-category-trigger [data-category-label] { margin: 0; color: #334155; font-size: 14px; font-weight: 400; letter-spacing: 0; line-height: 1.35; text-transform: none; }
.cpcrm-category-trigger:hover { border-color: #94a3b8; }
.cpcrm-category-trigger .material-symbols-rounded { color: #64748b; font-size: 20px; }
.cpcrm-category-modal[hidden] { display: none !important; }
.cpcrm-category-modal { position: fixed; z-index: 100100; inset: 0; display: grid; place-items: center; min-width: 0; min-height: 0; padding: 24px; }
.cpcrm-category-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(15,23,42,.48); cursor: default; }
.cpcrm-category-dialog { position: relative; display: grid; width: min(600px,100%); height: min(660px,calc(100dvh - 48px)); min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #dbe2ea; border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.24); }
.cpcrm-category-picker-pane, .cpcrm-category-editor-pane { display: grid; grid-template-rows: auto minmax(0,1fr) auto; min-width: 0; min-height: 0; }
.cpcrm-category-picker-pane[hidden], .cpcrm-category-editor-pane[hidden] { display: none !important; }
.cpcrm-category-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid #e5e7eb; }
.cpcrm-category-dialog h2 { margin: 3px 0 0; color: #0f172a; font-size: 21px; font-weight: 650; }
.cpcrm-category-close, .cpcrm-category-remove { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 6px; color: #64748b; background: transparent; cursor: pointer; }
.cpcrm-category-close:hover { color: #0f172a; background: #f1f5f9; }
.cpcrm-category-list { min-height: 0; overflow-y: auto; padding: 12px 24px; }
.cpcrm-category-list details { border-bottom: 1px solid #eef2f6; }
.cpcrm-category-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px; color: #334155; font-weight: 400; cursor: pointer; list-style: none; }
.cpcrm-category-list summary::-webkit-details-marker { display: none; }
.cpcrm-category-list details[open] summary .material-symbols-rounded { transform: rotate(180deg); }
.cpcrm-category-list details > div { display: grid; gap: 4px; padding: 0 0 12px; }
.cpcrm-category-list [data-category-value] { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 9px 12px; border: 0; border-radius: 6px; color: #334155; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.cpcrm-category-list [data-category-value]:hover { color: #0f172a; background: #f1f5f9; }
.cpcrm-category-list [data-category-value] .material-symbols-rounded { color: #64748b; font-size: 18px; }
.cpcrm-category-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid #e5e7eb; background: #f8fafc; }
.cpcrm-category-dialog footer .button { display: inline-flex; align-items: center; gap: 7px; }
.cpcrm-category-editor-form { display: grid; grid-template-rows: minmax(0,1fr) auto; min-height: 0; }
.cpcrm-category-editor-list { display: grid; align-content: start; gap: 12px; min-height: 0; overflow-y: auto; padding: 18px 24px; }
.cpcrm-category-editor-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr); align-items: start; gap: 12px; padding: 16px 58px 16px 16px; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; }
.cpcrm-category-editor-row label { display: grid; gap: 6px; color: #475569; font-size: 12px; font-weight: 600; }
.cpcrm-category-editor-row label span { display: flex; justify-content: space-between; gap: 8px; }
.cpcrm-category-editor-row small { color: #94a3b8; font-weight: 400; }
.cpcrm-category-editor-row input, .cpcrm-category-editor-row textarea { box-sizing: border-box; width: 100%; min-height: 44px; padding: 8px 10px; border: 2px solid #cbd5e1; border-radius: 5px; color: #334155; background: #fff; font: inherit; font-weight: 400; }
.cpcrm-category-editor-row textarea { min-height: 84px; resize: vertical; }
.cpcrm-category-remove { position: absolute; top: 16px; right: 14px; margin: 0; color: #dc2626; background: #fef2f2; }
body.cpcrm-category-open { overflow: hidden; }
.cpcrm-form .cpcrm-check { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; min-height: 34px; margin: 0; cursor: pointer; }
.cpcrm-form .cpcrm-check input[type="checkbox"], .cpcrm-form input[type="checkbox"] { appearance: auto; flex: 0 0 18px; width: 18px !important; height: 18px !important; min-height: 18px !important; margin: 0; padding: 0; border: 1px solid #94a3b8; box-shadow: none; }
.cpcrm-form .cpcrm-check > span { margin: 0; color: #334155; font-size: 13px; font-weight: 500; letter-spacing: 0; line-height: 1.4; text-transform: none; }
.cpcrm-source-badge { display: inline-flex; padding: 3px 7px; border: 1px solid #bfdbfe; border-radius: 999px; color: #1d4ed8; background: #eff6ff; font-size: 11px; font-weight: 600; }
.cpcrm-source-badge.is-manual { border-color: #d8b4fe; color: #7e22ce; background: #faf5ff; }
.cpcrm-money { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cpcrm-reconcile-form { margin: 0; }
.cpcrm-reconcile-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 9px; border: 1px solid #cbd5e1; border-radius: 5px; color: #64748b; background: #fff; font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.cpcrm-reconcile-button.is-reconciled { border-color: #bbf7d0; color: #166534; background: #f0fdf4; }
.cpcrm-reconcile-button .material-symbols-rounded { font-size: 17px; }
.cpcrm-aging-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
.cpcrm-aging-badge { display: inline-flex; padding: 4px 7px; border-radius: 999px; color: #475569; background: #f1f5f9; font-size: 11px; }
.cpcrm-aging-badge.is-overdue { color: #991b1b; background: #fee2e2; }
.cpcrm-report-grid, .cpcrm-monthly-report { margin-top: 18px; }
.cpcrm-category-report h3 { margin: 18px 0 8px; color: #64748b; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.cpcrm-category-report h3:first-child { margin-top: 0; }
.cpcrm-category-report > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #edf0f3; }
.cpcrm-category-report > div b { font-weight: 500; font-variant-numeric: tabular-nums; }
.cpcrm-account-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.cpcrm-account-cards article { display: grid; gap: 16px; min-height: 165px; padding: 18px; border: 1px solid #e2e8f0; background: #fff; }
.cpcrm-account-cards article > div, .cpcrm-account-cards footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cpcrm-account-cards article > div > span:last-child, .cpcrm-account-cards footer > span { color: #64748b; font-size: 12px; }
.cpcrm-account-cards h3 { margin: 0; color: #334155; font-size: 15px; font-weight: 500; }
.cpcrm-account-cards article > strong { color: #0f172a; font-size: 25px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cpcrm-account-cards footer > span:not(:empty) { padding: 4px 7px; border-radius: 999px; color: #166534; background: #dcfce7; }
.cpcrm-report-card { max-width: 920px; margin: 0 auto; }
.cpcrm-report-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #e2e8f0; }
.cpcrm-report-title > div { display: grid; gap: 4px; }
.cpcrm-report-title span { color: #64748b; font-size: 12px; }
.cpcrm-report-title strong { color: #1e293b; font-weight: 500; }
.cpcrm-report-title .button { display: inline-flex; align-items: center; gap: 7px; }
.cpcrm-profit-report { width: min(100%,620px); margin: 28px 0 0 auto; }
.cpcrm-profit-report > div { display: flex; justify-content: space-between; gap: 24px; padding: 15px 0; border-top: 1px solid #e2e8f0; }
.cpcrm-profit-report b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cpcrm-profit-report .is-total { margin-top: 8px; color: #0f172a; font-size: 17px; font-weight: 600; border-top: 2px solid #334155; }
@media(max-width:1200px) { .cpcrm-accounting-stats { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media(max-width:800px) {
 .cpcrm-sidebar-toggle { display: none; }
 .cpcrm-app-shell.is-sidebar-collapsed { grid-template-columns: minmax(0,1fr); }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-sidebar { padding: 12px; }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-brand { justify-content: flex-start; margin-inline: 0; padding-inline: 0; }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-brand > span { display: grid; }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs .cpcrm-tab-group { display: block; }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs a > span:last-child,
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-sidebar-foot > span:last-child { display: inline; }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-accounting-subnav { display: flex; }
 .cpcrm-app-shell.is-sidebar-collapsed .cpcrm-tabs a { justify-content: center; }
 .cpcrm-accounting-head { align-items: stretch; flex-direction: column; }
 .cpcrm-period-filter { width: 100%; }
 .cpcrm-period-filter label { flex: 1 1 130px; }
 .cpcrm-period-filter input, .cpcrm-period-filter select { width: 100%; }
 .cpcrm-accounting-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .cpcrm-accounting-entry > .cpcrm-card:first-child { position: static; }
 .cpcrm-account-cards { grid-template-columns: minmax(0,1fr); }
 .cpcrm-aging-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .cpcrm-tabs .cpcrm-accounting-subnav { display: flex; grid-column: 1 / -1; gap: 4px; margin: 0; padding: 5px 0 0; overflow-x: auto; border-left: 0; border-top: 1px solid #e2e8f0; }
 .cpcrm-tabs .cpcrm-accounting-subnav a, .cpcrm-tabs .cpcrm-accounting-subnav a:hover, .cpcrm-tabs .cpcrm-accounting-subnav a.is-active { flex: 0 0 auto; justify-content: center; padding: 7px 10px; }
}
@media(max-width:480px) {
 .cpcrm-accounting-stats { grid-template-columns: minmax(0,1fr); }
 .cpcrm-accounting-entry .cpcrm-upload-row { grid-template-columns: minmax(0,1fr); }
 .cpcrm-report-title { align-items: stretch; flex-direction: column; }
 .cpcrm-aging-stats { grid-template-columns: minmax(0,1fr); }
 .cpcrm-category-modal { padding: 10px; }
 .cpcrm-category-dialog { height: calc(100dvh - 20px); }
 .cpcrm-category-dialog footer { align-items: stretch; flex-direction: column; }
 .cpcrm-category-dialog footer > div { display: flex; gap: 8px; }
}

/* Document entry and reusable item library, 1.24.0. */
.cpcrm-doc-form .cpcrm-line-head { flex-wrap: wrap; gap: 16px; }
.cpcrm-item-picker { position: relative; width: min(420px,100%); }
.cpcrm-item-picker input { width: 100%; }
.cpcrm-item-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid #dfe3e8; border-radius: 6px; box-shadow: 0 8px 24px #0f172a1a; }
.cpcrm-item-results[hidden] { display: none; }
.cpcrm-item-result { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 12px 14px; text-align: left; border: 0; border-bottom: 1px solid #edf0f4; background: #fff; cursor: pointer; color: #334155; font: inherit; }
.cpcrm-item-result strong { font-weight: 500; }
.cpcrm-item-result:hover, .cpcrm-item-result:focus-visible { background: #f1f5f9; outline: 2px solid #64748b; outline-offset: -2px; }
.cpcrm-item-result small { white-space: nowrap; color: #64748b; }
.cpcrm-item-empty, .cpcrm-item-help { margin: 0 0 16px; color: #64748b; font-size: 13px; }
.cpcrm-item-empty { padding: 14px; margin: 0; }
.cpcrm-item-message { color: #b45309; margin: 0 0 12px; font-size: 13px; }
.cpcrm-items-table .cpcrm-item-entry { background: #f8fafc !important; border-bottom: 2px solid #dfe3e8; }
.cpcrm-entry-spacer { grid-column: 1; grid-row: 1; }
.cpcrm-items-table .cpcrm-confirm-item { grid-column: 9; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 40px; min-height: 40px; padding: 0 !important; background: #1e293b !important; color: #fff !important; border-color: #1e293b !important; border-radius: 6px; }
.cpcrm-confirm-item svg { display: block; flex: none; }
.cpcrm-wrap .cpcrm-add-section { display: inline-flex !important; align-items: center !important; justify-content: center; gap: 6px; line-height: 1 !important; }
.cpcrm-wrap .cpcrm-add-section .material-symbols-rounded { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; font-size: 18px; line-height: 1 !important; flex: none; vertical-align: middle; }
.cpcrm-library-help { padding: 0 24px; color: #64748b; font-size: 13px; }
.cpcrm-library-search { padding: 0 24px 20px; display: flex; gap: 10px; align-items: center; }
.cpcrm-library-search label { flex: 1; min-width: 0; }
.cpcrm-library-search input { width: 100%; }
.cpcrm-library-actions, .cpcrm-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cpcrm-library-actions form { margin: 0; }
.cpcrm-library-layout .cpcrm-table td:nth-child(2) { white-space: normal; min-width: 180px; }
.cpcrm-library-layout .cpcrm-form-actions { margin-top: 20px; }
@media (max-width: 700px) {
  .cpcrm-item-picker { width: 100%; }
  .cpcrm-doc-form .cpcrm-line-head { display: flex; flex-direction: column; align-items: stretch; }
  .cpcrm-library-search { padding: 0 16px 16px; }
}
.cpcrm-wrap .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cpcrm-terms-section > .cpcrm-form-grid > label { grid-column: 1 / -1; }
.cpcrm-library-layout .cpcrm-card > .cpcrm-form > * { grid-column: 1 / -1; }
.cpcrm-library-search input { box-sizing: border-box; font: inherit; min-height: 40px; padding: 7px 10px; background: #fafbfc; color: #334155; border: 3px solid #cfd5dc; border-radius: 5px; }
.cpcrm-library-search input:focus { border-color: #64748b; outline: none; box-shadow: 0 0 0 2px #cbd5e166; }
.cpcrm-settings-terms { grid-column: 1 / -1; display: grid; gap: 18px; min-width: 0; }
.cpcrm-settings-terms h3 { margin: 0; color: #334155; font-size: 15px; font-weight: 600; }

.cpcrm-date-control { position: relative; display: block; width: 100%; }
.cpcrm-wrap .cpcrm-date-control [data-date-display] { box-sizing: border-box; width: 100%; padding-right: 42px; }
.cpcrm-date-calendar { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 22px; color: #64748b; pointer-events: none; }
.cpcrm-wrap .cpcrm-date-control [data-date-value] { position: absolute; right: 0; top: 0; width: 38px; height: 100%; opacity: 0; cursor: pointer; padding: 0; }
.cpcrm-date-control [data-date-value]::-webkit-calendar-picker-indicator { width: 100%; height: 100%; cursor: pointer; }

.cpcrm-report-graphs { margin: 20px 0; align-items: start; }
.cpcrm-chart-legend { display:flex; gap:20px; padding: 0 22px 16px; font-size:12px; }
.cpcrm-chart-legend span::before { content:''; display:inline-block; width:10px; height:10px; margin-right:6px; border-radius:3px; background:#438463; }
.cpcrm-chart-legend .is-expense::before { background:#c87962; }
.cpcrm-chart-rows { padding:0 22px 22px; max-height:460px; overflow:auto; }
.cpcrm-chart-month { margin-bottom:22px; }
.cpcrm-chart-month h3 { margin:0 0 10px; font-size:13px; }
.cpcrm-chart-row { display:grid; grid-template-columns:64px minmax(30px,1fr) 110px; align-items:center; gap:10px; margin:8px 0; font-size:12px; }
.cpcrm-chart-row b { text-align:right; font-variant-numeric:tabular-nums; }
.cpcrm-chart-track { background:#f1f5f9; height:14px; border-radius:4px; overflow:hidden; }
.cpcrm-chart-track i { display:block; height:100%; background:#438463; border-radius:4px; }
.cpcrm-chart-track .is-expense { background:#c87962; }
.cpcrm-chart-category { margin:0 0 22px; }
.cpcrm-chart-category > div:first-child { display:flex; justify-content:space-between; gap:12px; font-size:13px; margin-bottom:10px; overflow-wrap:anywhere; }
.cpcrm-chart-category b { white-space:nowrap; }
.cpcrm-chart-empty { color:#64748b; font-size:13px; }
@media(max-width:600px) { .cpcrm-chart-row { grid-template-columns:58px minmax(25px,1fr) 96px; gap:6px; font-size:11px; } }

/* Document item titles use a fixed, readable emphasis in shared, preview and print views. */
.cpcrm-document .cpcrm-item-detail > strong,
.cpcrm-live-preview .cpcrm-item-detail > strong { font-size: 16px !important; font-weight: 700 !important; }

/* Payment labels are shared by invoice lists, previews and printable documents. */
.cpcrm-payment-badge {
  display: inline-block; width: auto; padding: 4px 10px; border-radius: 6px;
  background: var(--status-bg) !important; color: var(--status-fg) !important; border: 1px solid var(--status-border);
  font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.cpcrm-payment-badge.cpcrm-status-paid { --status-bg:#dcfce7; --status-fg:#166534; --status-border:#86efac; }
.cpcrm-payment-badge.cpcrm-status-partial { --status-bg:#fef3c7; --status-fg:#92400e; --status-border:#fcd34d; }
.cpcrm-payment-badge.cpcrm-status-unpaid { --status-bg:#fee2e2; --status-fg:#991b1b; --status-border:#fca5a5; }
.cpcrm-doc-payment .cpcrm-payment-badge, .cpcrm-live-payment .cpcrm-payment-badge { font-size:12px; }
.cpcrm-wrap [hidden] { display:none !important; }
.cpcrm-deposit-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.cpcrm-invoice-payments { padding:24px; margin-bottom:20px; }
.cpcrm-mobile-bar, .cpcrm-mobile-close, .cpcrm-mobile-backdrop { display:none; }
@media(max-width:800px) {
  .cpcrm-wrap .cpcrm-app-shell, .cpcrm-wrap .cpcrm-app-shell.is-sidebar-collapsed {
    grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr);
  }
  .cpcrm-wrap .cpcrm-topbar { display:none !important; }
  .cpcrm-wrap .cpcrm-main { grid-column:1; grid-row:2; min-width:0; min-height:0; }
  .cpcrm-wrap .cpcrm-mobile-bar { display:flex; grid-column:1; grid-row:1; padding:10px 14px; background:#fff; border-bottom:1px solid #e2e8f0; }
  .cpcrm-mobile-menu, .cpcrm-mobile-close { align-items:center; justify-content:center; gap:8px; min-height:44px; padding:8px 12px; border:1px solid #cbd5e1; border-radius:6px; background:#fff; color:#334155; cursor:pointer; }
  .cpcrm-mobile-menu { display:inline-flex; }
  .cpcrm-wrap .cpcrm-sidebar, .cpcrm-wrap .is-sidebar-collapsed .cpcrm-sidebar {
    position:fixed; inset:0 auto 0 0; z-index:100101; display:flex; flex-direction:column;
    width:min(290px,85vw); height:100dvh; padding:18px; overflow-y:auto;
    background:#fff; transform:translateX(-100%); visibility:hidden; border-right:1px solid #cbd5e1;
  }
  .cpcrm-wrap .is-mobile-menu-open .cpcrm-sidebar { transform:translateX(0); visibility:visible; }
  .cpcrm-wrap .cpcrm-sidebar-toggle { display:none; }
  .cpcrm-wrap .cpcrm-mobile-close { display:inline-flex; align-self:flex-end; margin-bottom:14px; }
  .cpcrm-wrap .is-mobile-menu-open .cpcrm-mobile-backdrop { display:block; position:fixed; inset:0; z-index:100100; border:0; border-radius:0; background:rgba(15,23,42,.4); width:100%; height:100dvh; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-brand { justify-content:flex-start; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-brand > span { display:grid; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-tabs { display:flex; flex-direction:column; align-items:stretch; gap:5px; overflow:visible; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-tabs .cpcrm-tab-group { display:block; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-tabs a { display:flex; justify-content:flex-start; min-height:44px; width:100%; padding:10px 12px; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-tabs a > span:last-child { display:inline; }
  .cpcrm-wrap .cpcrm-sidebar .cpcrm-tabs .cpcrm-accounting-subnav { display:flex; flex-direction:column; overflow:visible; margin:0 0 0 12px; padding:0 0 0 8px; border-left:1px solid #e2e8f0; border-top:0; }
  .cpcrm-wrap .cpcrm-sidebar-foot > span:last-child { display:inline; }
  .cpcrm-wrap .cpcrm-deposit-fields { grid-template-columns:minmax(0,1fr); }
}

.cpcrm-bank-manager { border-top:1px solid #e2e8f0; padding-top:20px; }
.cpcrm-bank-account-list { display:grid; gap:16px; margin-bottom:16px; }
.cpcrm-bank-account-row { display:grid; gap:12px; padding:16px; border:1px solid #cbd5e1; border-radius:8px; background:#f8fafc; }
.cpcrm-bank-account-row:first-child { border-left:4px solid #334155; }
.cpcrm-bank-account-row:first-child::before { content:'Default account'; font-weight:700; color:#334155; }
.cpcrm-bank-actions { display:flex; flex-wrap:wrap; gap:10px; }
.cpcrm-bank-summary { white-space:pre-line; border:1px solid #e2e8f0; border-radius:6px; padding:12px; font-size:12px; color:#475569; }

.cpcrm-income-records-table th:nth-child(2),
.cpcrm-income-records-table td:nth-child(2) { min-width: 145px; white-space: nowrap; }

/* Give data tables their natural width inside the existing scroll regions. */
.cpcrm-table-scroll { width: 100%; }
.cpcrm-table-scroll > .cpcrm-table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.cpcrm-table-scroll > .cpcrm-table th,
.cpcrm-table-scroll > .cpcrm-table td {
  min-width: 130px;
}
.cpcrm-table-scroll > .cpcrm-table th { white-space: nowrap; }
.cpcrm-table-scroll > .cpcrm-table td { white-space: nowrap; }
.cpcrm-table-scroll > .cpcrm-table .cpcrm-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
}
.cpcrm-table-scroll > .cpcrm-table .cpcrm-row-actions .button {
  white-space: nowrap;
}
.cpcrm-tab-accounting .cpcrm-table .cpcrm-row-actions .button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 5px 12px; }
.cpcrm-payment-modal[hidden] { display: none !important; }
.cpcrm-payment-modal { position: fixed; z-index: 100200; inset: 0; display: grid; place-items: center; padding: 16px; }
.cpcrm-payment-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.6); }
.cpcrm-payment-dialog { position: relative; width: min(100%, 580px); max-height: min(90dvh, 850px); overflow-y: auto; padding: 24px; border-radius: 10px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cpcrm-payment-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cpcrm-payment-head h2 { margin: 0; }
.cpcrm-payment-close { border: 0; background: transparent; font-size: 28px; cursor: pointer; }
.cpcrm-payment-actions { display: flex; justify-content: flex-start; gap: 10px; }
.cpcrm-payment-form select[name="payment_status"] { background: var(--status-bg,#f1f5f9) !important; color: var(--status-fg,#475569) !important; border: 2px solid var(--status-border,#cbd5e1) !important; font-weight: 600; }
.cpcrm-accounting-stats .cpcrm-stat-title { display: inline-flex; align-items: center; gap: 7px; }
.cpcrm-accounting-stats .cpcrm-stat-title .material-symbols-rounded { font-size: 18px; line-height: 1; color: #475569; }
body.cpcrm-payment-open { overflow: hidden; }
