.cpcrm-wrap {
  color: #171717;
  max-width: 1440px;
}


.cpcrm-wrap a {
  text-decoration: none;
}

.cpcrm-hero {
  align-items: center;
  background: linear-gradient(135deg, #111 0%, #2b2b2b 62%, #c7a451 100%);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 15, 15, 0.16);
  color: #fff;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 24px 0 18px;
  padding: 24px;
}

.cpcrm-brand {
  align-items: center;
  display: flex;
  gap: 18px;
}

.cpcrm-brand img {
  background: #fff;
  border-radius: 16px;
  height: 74px;
  object-fit: contain;
  padding: 8px;
  width: 74px;
}

.cpcrm-brand h1 {
  color: #fff;
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}

.cpcrm-brand p,
.cpcrm-card-head p {
  color: rgba(255, 255, 255, 0.76);
  margin: 7px 0 0;
}

.cpcrm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cpcrm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.cpcrm-tabs a {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #3f3f46;
  font-weight: 700;
  padding: 11px 16px;
}

.cpcrm-tabs a.is-active,
.cpcrm-tabs a:hover {
  background: #171717;
  border-color: #171717;
  color: #fff;
}

.cpcrm-stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.cpcrm-stat,
.cpcrm-card {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(25, 25, 25, 0.07);
}

.cpcrm-stat {
  min-height: 132px;
  padding: 20px;
}

.cpcrm-stat span,
.cpcrm-stat small,
.cpcrm-table span {
  color: #737373;
}

.cpcrm-stat strong {
  display: block;
  font-size: 30px;
  line-height: 1.2;
  margin: 10px 0 8px;
}

.cpcrm-grid {
  display: grid;
  gap: 16px;
}

.cpcrm-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpcrm-grid.form-list {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
}

.cpcrm-card {
  padding: 20px;
}

.cpcrm-card-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cpcrm-card-head h2 {
  font-size: 18px;
  margin: 0;
}

.cpcrm-card-head p {
  color: #737373;
}

.cpcrm-card-head form {
  margin: 0;
}

.cpcrm-record-actions,
.cpcrm-editor-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.cpcrm-record-actions form {
  min-width: min(320px, 100%);
}

.cpcrm-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpcrm-form label {
  display: grid;
  gap: 7px;
}

.cpcrm-form label.wide,
.cpcrm-line-items,
.cpcrm-total-preview,
.cpcrm-form .button-large {
  grid-column: 1 / -1;
}

.cpcrm-form span {
  color: #404040;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cpcrm-form input,
.cpcrm-form select,
.cpcrm-form textarea,
.cpcrm-card-head input[type="search"] {
  border: 1px solid #dfe3e8;
  border-radius: 10px;
  box-shadow: none;
  min-height: 42px;
  padding: 8px 11px;
  width: 100%;
}

.cpcrm-form textarea {
  min-height: 96px;
}

.cpcrm-table {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
}

.cpcrm-table th {
  color: #737373;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cpcrm-pill {
  background: #f5f1e6;
  border-radius: 999px;
  color: #6d5520;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.cpcrm-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cpcrm-row-actions form {
  margin: 0;
}

.cpcrm-empty {
  background: #fafafa;
  border: 1px dashed #d4d4d4;
  border-radius: 12px;
  color: #737373;
  padding: 26px;
  text-align: center;
}

.cpcrm-line-items {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;
}

.cpcrm-line-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cpcrm-line-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 58px 140px minmax(220px, 1fr) 116px 82px 110px 110px 120px auto;
  margin-top: 8px;
}

.cpcrm-total-preview {
  background: #111;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  padding: 14px 16px;
}

.cpcrm-total-preview strong {
  color: #f3d47b;
  font-size: 20px;
  margin-left: 8px;
}

.cpcrm-settings {
  max-width: 940px;
}

.cpcrm-print-wrap {
  color: var(--cpcrm-pdf-text);
  max-width: 1020px;
}

.cpcrm-print-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 18px 0;
}

.cpcrm-document {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  color: var(--cpcrm-pdf-text);
  padding: 44px;
}

.cpcrm-document header {
  border-bottom: 3px solid var(--cpcrm-brand);
  display: flex;
  gap: 28px;
  justify-content: space-between;
  padding-bottom: 24px;
}

.cpcrm-document header img {
  height: 72px;
  margin-bottom: 12px;
  object-fit: contain;
  width: 72px;
}

.cpcrm-document h1 {
  color: var(--cpcrm-brand);
  font-size: 24px;
  margin: 0 0 8px;
}

.cpcrm-document header strong {
  color: var(--cpcrm-brand);
  display: block;
  font-size: 38px;
  letter-spacing: 0.08em;
}

.cpcrm-document header span {
  background: var(--cpcrm-pdf-soft);
  border-radius: 999px;
  color: var(--cpcrm-brand);
  display: inline-block;
  font-weight: 800;
  margin-top: 12px;
  padding: 8px 14px;
}

.cpcrm-doc-meta {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr 1fr;
  margin: 28px 0;
}

.cpcrm-doc-meta div,
.cpcrm-doc-note {
  background: var(--cpcrm-pdf-soft);
  border-left: 4px solid var(--cpcrm-accent);
  border-radius: 12px;
  padding: 16px;
}

.cpcrm-document table {
  border-collapse: collapse;
  margin: 20px 0;
  width: 100%;
}

.cpcrm-document th {
  background: var(--cpcrm-brand);
  color: #fff;
  text-align: left;
}

.cpcrm-document th,
.cpcrm-document td {
  border-bottom: 1px solid #e5e5e5;
  padding: 12px;
}

.cpcrm-doc-total {
  margin-left: auto;
  max-width: 340px;
}

.cpcrm-doc-total div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.cpcrm-doc-total .grand {
  border-top: 3px solid var(--cpcrm-brand);
  color: var(--cpcrm-brand);
  font-size: 22px;
  margin-top: 8px;
}

.cpcrm-doc-note {
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .cpcrm-stat-grid,
  .cpcrm-grid.two,
  .cpcrm-grid.form-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .cpcrm-hero,
  .cpcrm-card-head,
  .cpcrm-document header,
  .cpcrm-doc-meta {
    display: grid;
  }

  .cpcrm-form,
  .cpcrm-line-row {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4;
  margin: 10mm;
}

@media print {
  #adminmenumain,
  #wpadminbar,
  #wpfooter,
  .cpcrm-print-actions,
  .notice {
    display: none !important;
  }

  #wpcontent {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  html,
  html.wp-toolbar {
    margin: 0 !important;
    padding-top: 0 !important;
  }

  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cpcrm-print-wrap {
    margin: 0;
    max-width: none;
  }

  .cpcrm-document {
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
}

/* Modern app upgrade */
body.toplevel_page_clearpage-digital-crm {
  background: #f4f5f7;
}

.cpcrm-wrap {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cpcrm-wrap .button {
  border-radius: 10px;
  font-weight: 700;
  min-height: 38px;
  padding: 5px 14px;
}

.cpcrm-wrap .button-primary {
  background: #111;
  border-color: #111;
  box-shadow: none;
}

.cpcrm-wrap .button-primary:hover,
.cpcrm-wrap .button-primary:focus {
  background: #2b2b2b;
  border-color: #2b2b2b;
}

.cpcrm-hero {
  background:
    radial-gradient(circle at 86% 12%, rgba(199, 164, 81, 0.42), transparent 28%),
    linear-gradient(135deg, #0d0d0d 0%, #1f1f1f 58%, #37301f 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  margin-top: 18px;
  overflow: hidden;
  position: relative;
}

.cpcrm-hero::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  content: "";
  height: 1px;
  left: 24px;
  position: absolute;
  right: 24px;
  top: 0;
}

.cpcrm-tabs {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e6e8ec;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(17, 17, 17, 0.06);
  padding: 8px;
  width: fit-content;
}

.cpcrm-tabs a {
  border: 0;
  box-shadow: none;
}

.cpcrm-tab-group {
  align-items: center;
  color: #8a6a1f;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0 6px 0 10px;
  text-transform: uppercase;
}

.cpcrm-kicker {
  color: #a67d22;
  display: block;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.cpcrm-doc-builder {
  align-items: start;
  display: block;
  margin-bottom: 22px;
}

.cpcrm-editor-card,
.cpcrm-live-panel,
.cpcrm-records-card {
  border-radius: 24px;
}

.cpcrm-editor-card {
  padding: 28px;
}

.cpcrm-editor-head {
  margin-bottom: 22px;
}

.cpcrm-editor-head h2 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.cpcrm-editor-head p {
  color: #737373;
  margin: 7px 0 0;
}

.cpcrm-doc-form {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}

.cpcrm-form-section {
  background: #fff;
  border: 1px solid #eceef1;
  border-radius: 18px;
  padding: 18px;
}

.cpcrm-form-section h3 {
  font-size: 15px;
  letter-spacing: -0.01em;
  margin: 0 0 15px;
}

.cpcrm-form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpcrm-doc-form label,
.cpcrm-line-row label {
  margin: 0;
}

.cpcrm-doc-form span,
.cpcrm-line-row span {
  color: #454545;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.cpcrm-doc-form input,
.cpcrm-doc-form select,
.cpcrm-doc-form textarea {
  background: #fbfbfc;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  color: #20242b;
  font-size: 16px;
  min-height: 50px;
  padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cpcrm-doc-form input:focus,
.cpcrm-doc-form select:focus,
.cpcrm-doc-form textarea:focus {
  background: #fff;
  border-color: #c7a451;
  box-shadow: 0 0 0 4px rgba(199, 164, 81, 0.16);
  outline: 0;
}

.cpcrm-doc-form textarea {
  min-height: 120px;
}

.cpcrm-line-items {
  background: #faf8f3;
  border-color: #eadfca;
}

.cpcrm-line-head {
  border-bottom: 1px solid #eadfca;
  padding-bottom: 12px;
}

.cpcrm-line-head strong {
  font-size: 16px;
}

.cpcrm-line-row {
  align-items: end;
  background: #fff;
  border: 1px solid #eceef1;
  border-radius: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: 58px 140px minmax(260px, 1fr) 116px 82px 118px 118px 126px auto;
  margin-top: 12px;
  padding: 12px;
}

.cpcrm-line-row.is-dragging {
  opacity: 0.55;
}

.cpcrm-drag-handle {
  align-self: stretch;
  background: #f4efe4;
  border: 1px solid #e7d8b7;
  border-radius: 12px;
  color: #8a6a1f;
  cursor: grab;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  min-height: 44px;
  text-transform: uppercase;
}

.cpcrm-drag-handle:active {
  cursor: grabbing;
}

.cpcrm-line-row input,
.cpcrm-line-row select {
  min-height: 44px;
}

.cpcrm-line-row textarea {
  min-height: 78px;
  resize: both;
}

.cpcrm-line-desc {
  min-width: 0;
}

.cpcrm-deposit-fields {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cpcrm-deposit-fields[hidden],
.cpcrm-live-deposit[hidden],
[data-preview-receipt-wrap][hidden] {
  display: none !important;
}

.cpcrm-deposit-override {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
}

.cpcrm-deposit-override summary {
  color: #6b7280;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.cpcrm-deposit-override[open] summary {
  margin-bottom: 10px;
}

.cpcrm-client-picker {
  position: relative;
}

.cpcrm-client-picker.wide {
  grid-column: 1 / -1;
}

.cpcrm-client-results {
  background: #fff;
  border: 1px solid #dfe3e8;
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(17, 17, 17, 0.12);
  left: 0;
  margin-top: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  position: absolute;
  right: 0;
  z-index: 12;
}

.cpcrm-client-results button {
  background: #fff;
  border: 0;
  border-radius: 10px;
  color: #20242b;
  cursor: pointer;
  display: grid;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.cpcrm-client-results button:hover {
  background: #faf8f3;
}

.cpcrm-client-results span {
  color: #737373;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  margin-top: 2px;
  text-transform: none;
}

.cpcrm-upload-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.cpcrm-color-field {
  align-items: center;
  background: #fafafa;
  border: 1px solid #eceef1;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 1fr 58px auto;
  padding: 12px;
}

.cpcrm-color-field input[type="color"] {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  height: 42px;
  min-height: 42px;
  padding: 0;
  width: 58px;
}

.cpcrm-color-field small {
  color: #737373;
  font-family: monospace;
  padding-left: 8px;
}

.cpcrm-help {
  color: #737373;
  display: block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
  margin-top: 8px;
  text-transform: none;
}

.cpcrm-remove-line {
  align-self: end;
  color: #b42318 !important;
}

.cpcrm-save-bar {
  align-items: center;
  background: #111;
  border-radius: 18px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px;
  position: sticky;
  bottom: 18px;
  z-index: 2;
}

.cpcrm-save-bar .button-primary {
  background: #c7a451;
  border-color: #c7a451;
  color: #111;
  min-width: 180px;
}

.cpcrm-total-preview {
  background: transparent;
  border-radius: 0;
  color: #fff;
  padding: 0 0 0 4px;
}

.cpcrm-total-preview strong {
  color: #f3d47b;
  font-size: 28px;
}

.cpcrm-live-panel {
  display: none;
}

.cpcrm-live-panel.is-open {
  display: block;
}

.cpcrm-preview-backdrop {
  background: rgba(15, 23, 42, 0.55);
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 100000;
}

.cpcrm-preview-shell {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.26);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  left: 50%;
  max-height: calc(100vh - 48px);
  max-width: 980px;
  overflow: hidden;
  position: fixed;
  top: 24px;
  transform: translateX(-50%);
  width: min(980px, calc(100vw - 48px));
  z-index: 100001;
}

.cpcrm-preview-toolbar {
  align-items: center;
  background: #111;
  border-radius: 0;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.cpcrm-preview-actions {
  display: flex;
  gap: 8px;
}

.cpcrm-preview-toolbar span {
  color: #c7a451;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cpcrm-preview-toolbar strong {
  display: block;
  font-size: 15px;
  margin-top: 2px;
}

.cpcrm-live-preview {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0;
  box-shadow: none;
  color: var(--cpcrm-pdf-text);
  font-size: 12px;
  min-height: 0;
  overflow: auto;
  padding: 28px;
}

.cpcrm-live-preview header {
  border-bottom: 2px solid var(--cpcrm-brand);
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr auto;
  padding-bottom: 18px;
}

.cpcrm-live-preview img {
  height: 58px;
  object-fit: contain;
  width: 58px;
}

.cpcrm-live-preview h2 {
  color: var(--cpcrm-brand);
  font-size: 18px;
  margin: 10px 0 6px;
}

.cpcrm-live-preview p {
  margin: 0;
}

.cpcrm-live-preview header strong {
  color: var(--cpcrm-brand);
  display: block;
  font-size: 28px;
  letter-spacing: 0.08em;
  text-align: right;
}

.cpcrm-live-preview header span {
  background: var(--cpcrm-pdf-soft);
  border-radius: 999px;
  color: var(--cpcrm-brand);
  display: block;
  font-weight: 900;
  margin-top: 8px;
  padding: 7px 10px;
  text-align: center;
}

.cpcrm-live-meta {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin: 20px 0;
}

.cpcrm-live-meta div,
.cpcrm-live-note {
  background: var(--cpcrm-pdf-soft);
  border-left: 3px solid var(--cpcrm-accent);
  border-radius: 12px;
  padding: 13px;
}

.cpcrm-live-preview b {
  color: var(--cpcrm-brand);
}

.cpcrm-live-preview table {
  border-collapse: collapse;
  margin: 18px 0;
  width: 100%;
}

.cpcrm-live-preview th {
  background: var(--cpcrm-brand);
  color: #fff;
  font-size: 10px;
  text-align: left;
  text-transform: uppercase;
}

.cpcrm-live-preview th,
.cpcrm-live-preview td {
  border-bottom: 1px solid #eceef1;
  padding: 9px 8px;
}

.cpcrm-live-total {
  margin-left: auto;
  max-width: 290px;
}

.cpcrm-live-total div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.cpcrm-live-total .grand {
  border-top: 2px solid var(--cpcrm-brand);
  color: var(--cpcrm-brand);
  font-size: 18px;
  margin-top: 6px;
  padding-top: 10px;
}

.cpcrm-live-note {
  margin-top: 14px;
}

.cpcrm-records-card {
  padding: 24px;
}

@media (max-width: 1320px) {
  .cpcrm-preview-shell {
    top: 14px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 28px);
  }
}

@media (max-width: 780px) {
  .cpcrm-form-grid,
  .cpcrm-deposit-fields,
  .cpcrm-line-row,
  .cpcrm-live-preview header,
  .cpcrm-live-meta,
  .cpcrm-save-bar {
    grid-template-columns: 1fr;
  }

  .cpcrm-save-bar {
    display: grid;
  }

  .cpcrm-save-bar .button-primary {
    width: 100%;
  }
}

/* Borderless PDF / quotation design */
.cpcrm-document,
.cpcrm-live-preview {
  border: 0;
  color: #4b5563;
}

.cpcrm-document {
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.10);
  padding: 56px 76px;
}

.cpcrm-live-preview {
  border-radius: 0;
  padding: 34px;
}

.cpcrm-document header,
.cpcrm-live-preview header {
  border-bottom: 0;
  align-items: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.75fr);
  gap: 36px;
  padding-bottom: 28px;
}

.cpcrm-document header img,
.cpcrm-live-preview img {
  height: var(--cpcrm-logo-size, 54px);
  margin: 0 0 16px;
  object-fit: contain;
  width: var(--cpcrm-logo-size, 54px);
}

.cpcrm-document h1,
.cpcrm-live-preview h2 {
  color: #111827;
  font-size: var(--cpcrm-title-size, 17px);
  font-weight: var(--cpcrm-title-weight, 900);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.cpcrm-document header p,
.cpcrm-live-preview header p {
  color: #6b7280;
  font-size: var(--cpcrm-doc-details-size, 12px);
  font-weight: var(--cpcrm-doc-details-weight, 400);
  line-height: 1.55;
}

.cpcrm-document header strong,
.cpcrm-live-preview header strong {
  color: #111827;
  display: block;
  font-size: var(--cpcrm-doc-label-size, 16px);
  font-weight: var(--cpcrm-doc-label-weight, 900);
  letter-spacing: 0;
  text-align: right;
}

.cpcrm-document header span,
.cpcrm-live-preview header span {
  background: transparent;
  border-radius: 0;
  color: #4b5563;
  display: block;
  font-size: var(--cpcrm-doc-number-size, 13px);
  font-weight: var(--cpcrm-doc-number-weight, 800);
  margin-top: 8px;
  padding: 0;
  text-align: right;
}

.cpcrm-doc-meta,
.cpcrm-live-meta {
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.75fr);
  margin: 0 0 34px;
}

.cpcrm-doc-meta div,
.cpcrm-live-meta div,
.cpcrm-doc-note,
.cpcrm-live-note {
  background: transparent;
  border: 0;
  border-left: 0;
  border-radius: 0;
  padding: 0;
}

.cpcrm-doc-meta div:last-child,
.cpcrm-live-meta div:last-child {
  text-align: right;
}

.cpcrm-document b,
.cpcrm-live-preview b {
  color: #374151;
  display: block;
  font-size: var(--cpcrm-doc-section-title-size, 12px);
  font-weight: var(--cpcrm-doc-section-title-weight, 900);
  margin-bottom: 6px;
}

.cpcrm-document p,
.cpcrm-live-preview p {
  color: #6b7280;
  font-size: var(--cpcrm-doc-details-size, 12px);
  font-weight: var(--cpcrm-doc-details-weight, 400);
  line-height: 1.58;
}

.cpcrm-document table,
.cpcrm-live-preview table {
  border-collapse: collapse;
  margin: 28px 0 24px;
  width: 100%;
}

.cpcrm-document th,
.cpcrm-live-preview th {
  background: #f3f6f8;
  border: 0;
  color: #374151;
  font-size: var(--cpcrm-doc-table-header-size, 11px);
  font-weight: var(--cpcrm-doc-table-header-weight, 900);
  letter-spacing: 0.02em;
  padding: 10px 12px;
  text-align: left;
}

.cpcrm-document td,
.cpcrm-live-preview td {
  border: 0;
  border-bottom: 1px solid #edf0f3;
  color: #4b5563;
  font-size: var(--cpcrm-doc-details-size, 12px);
  font-weight: var(--cpcrm-doc-details-weight, 400);
  padding: 12px;
  vertical-align: top;
}

.cpcrm-document td:first-child,
.cpcrm-live-preview td:first-child,
.cpcrm-document th:first-child,
.cpcrm-live-preview th:first-child {
  text-align: center;
  width: 44px;
}

.cpcrm-document td:nth-child(3),
.cpcrm-live-preview td:nth-child(3),
.cpcrm-document td:nth-child(4),
.cpcrm-live-preview td:nth-child(4),
.cpcrm-document td:nth-child(5),
.cpcrm-live-preview td:nth-child(5),
.cpcrm-document th:nth-child(3),
.cpcrm-live-preview th:nth-child(3),
.cpcrm-document th:nth-child(4),
.cpcrm-live-preview th:nth-child(4),
.cpcrm-document th:nth-child(5),
.cpcrm-live-preview th:nth-child(5) {
  text-align: right;
}

.cpcrm-document th:nth-child(2),
.cpcrm-live-preview th:nth-child(2),
.cpcrm-document td:nth-child(2),
.cpcrm-live-preview td:nth-child(2) {
  width: 58%;
}

.cpcrm-document th:nth-child(3),
.cpcrm-live-preview th:nth-child(3) {
  width: 12%;
}

.cpcrm-document th:nth-child(4),
.cpcrm-live-preview th:nth-child(4),
.cpcrm-document th:nth-child(5),
.cpcrm-live-preview th:nth-child(5) {
  width: 13%;
}

.cpcrm-item-detail strong {
  color: #374151;
  display: inline;
  font-size: var(--cpcrm-doc-details-size, 12px);
  font-weight: 800;
}

.cpcrm-item-detail div {
  color: #4b5563;
  line-height: 1.55;
  margin-top: 4px;
  white-space: normal;
}

.cpcrm-breakdown-line {
  display: block;
}

.cpcrm-item-detail em {
  color: #8a6a1f;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.cpcrm-line-calc {
  display: block;
  line-height: 1.45;
}

.cpcrm-line-calc em {
  color: #8a6a1f;
  font-style: normal;
  font-weight: 800;
}

.cpcrm-line-calc strong {
  color: #111827;
  display: inline;
  font-weight: 900;
}

.cpcrm-doc-total,
.cpcrm-live-total {
  margin: 10px 0 48px auto;
  max-width: 360px;
}

.cpcrm-doc-total div,
.cpcrm-live-total div {
  border-bottom: 1px solid #edf0f3;
  color: #4b5563;
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
}

.cpcrm-doc-total .grand,
.cpcrm-live-total .grand {
  border-top: 0;
  color: #111827;
  font-size: var(--cpcrm-doc-total-size, 14px);
  font-weight: var(--cpcrm-doc-total-weight, 900);
  margin-top: 0;
}

.cpcrm-doc-total b,
.cpcrm-live-total b {
  font-size: var(--cpcrm-doc-total-size, 14px);
  font-weight: var(--cpcrm-doc-total-weight, 900);
  margin-bottom: 0;
}

.cpcrm-doc-note,
.cpcrm-live-note {
  margin-top: 34px;
}

.cpcrm-doc-note b,
.cpcrm-live-note b {
  border-top: 1px solid #edf0f3;
  padding-top: 22px;
}

.cpcrm-doc-note p,
.cpcrm-live-note p {
  font-size: 12px;
  margin: 0;
  white-space: pre-line;
}

.cpcrm-doc-footer {
  border-top: 1px solid #edf0f3;
  color: #6b7280;
  font-size: 12px;
  margin-top: 42px;
  padding-top: 18px;
  text-align: center;
}

@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  #wpcontent,
  #wpbody,
  #wpbody-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .cpcrm-print-wrap {
    box-sizing: border-box !important;
    margin: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .cpcrm-document {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .cpcrm-document header {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr) !important;
  }

  .cpcrm-document table {
    table-layout: auto !important;
    width: 100% !important;
  }

  .cpcrm-document th,
  .cpcrm-document td,
  .cpcrm-doc-note p {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  .cpcrm-document th {
    background: #f3f6f8 !important;
    color: #374151 !important;
  }

  .cpcrm-document td {
    border-bottom: 1px solid #edf0f3 !important;
  }
}

.cpcrm-period-filter [data-period-date][hidden] { display: none !important; }
