.crm-workspace,
.portal-workspace,
.portal-admin {
  min-width: 0;
  max-width: 100%;
  color: var(--text, #182b27);
  letter-spacing: 0;
}
.crm-workspace .finance-toolbar,
.portal-workspace .finance-toolbar,
.portal-admin .finance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-block: 14px;
}
.crm-tabs {
  border-bottom: 1px solid #cdd7d3;
  padding-bottom: 12px;
}
.crm-workspace h3,
.portal-admin h3 {
  margin: 24px 0 12px;
  font-size: 18px;
}
.crm-tabs button {
  border-radius: 6px;
  max-width: 100%;
  white-space: normal;
}
.crm-search {
  margin-inline-start: auto;
  min-width: 180px;
}
.crm-workspace input,
.crm-workspace select,
.portal-workspace input,
.portal-workspace select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.crm-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-block: 20px;
  padding-block: 16px;
  border-block: 1px solid #cdd7d3;
}
.crm-metrics > div {
  min-width: 150px;
  flex: 1;
}
.crm-metrics dt {
  font-size: 13px;
  color: var(--muted, #53645e);
  margin-bottom: 5px;
}
.crm-metrics dd {
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.crm-detail {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr);
  gap: 10px;
  width: 100%;
  grid-column: 1/-1;
}
.crm-detail dt {
  font-weight: 650;
  text-transform: capitalize;
}
.crm-detail dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.crm-check {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  grid-column: 1/-1;
  line-height: 1.5;
}
.crm-check input {
  width: 18px !important;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 3px;
}
.portal-hash {
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: 12px;
}
.portal-preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.portal-document {
  grid-column: 1/-1;
  max-width: 100%;
  min-width: 0;
}
.portal-document h4 {
  font-size: 18px;
  line-height: 1.4;
}
.portal-page {
  margin: 0;
  background: #f5f7f6;
  color: #182b27;
  font-family: Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
}
.portal-page * {
  box-sizing: border-box;
}
.portal-page header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  background: #0b161b;
  color: #f3f7fb;
  border-bottom: 1px solid #223c42;
}
.portal-page header img {
  width: 168px;
  max-width: 100%;
  height: auto;
}
.portal-page header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.portal-page main {
  width: min(1260px, 100%);
  margin: auto;
  padding: 24px;
}
.portal-page h1 {
  font-size: 28px;
  margin: 0 0 24px;
}
.portal-page h2 {
  font-size: 24px;
  margin: 0;
}
.portal-page h3 {
  font-size: 18px;
  margin: 24px 0 12px;
}
.portal-page a {
  color: #006a60;
  text-underline-offset: 3px;
}
.portal-page header a {
  color: #d5eee9;
}
.portal-page button,
.portal-page input,
.portal-page select {
  font: inherit;
  min-height: 42px;
  border-radius: 5px;
  border: 1px solid #aebeb6;
  padding: 10px 12px;
}
.portal-page button {
  cursor: pointer;
}
.portal-page button:disabled {
  opacity: 0.6;
  cursor: wait;
}
.portal-page .primary-button {
  background: #006a60;
  color: #fff;
  border-color: #006a60;
}
.portal-page .secondary-button,
.portal-page .ghost-button {
  background: white;
  color: #182b27;
}
.portal-page label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}
.portal-page input,
.portal-page select,
.portal-page textarea {
  min-width: 0;
  max-width: 100%;
  background: white;
  color: #182b27;
}
.portal-page :focus-visible {
  outline: 3px solid #bd680c;
  outline-offset: 3px;
}
.portal-login {
  max-width: 420px;
  margin: 5vh auto;
}
.portal-login form {
  display: grid;
  gap: 18px;
}
.portal-page .finance-error {
  color: #a92836;
}
.portal-page .table-scroll {
  overflow: auto;
  max-width: 100%;
  border: 1px solid #d8e0dc;
  border-radius: 4px;
  background: #fff;
}
.portal-page .data-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px;
  font-size: 14px;
}
.portal-page th,
.portal-page td {
  padding: 12px;
  text-align: start;
  border-bottom: 1px solid #e4eae7;
  vertical-align: top;
  overflow-wrap: anywhere;
  max-width: 350px;
}
.portal-page th {
  background: #edf2ef;
  font-weight: 600;
  white-space: nowrap;
}
.portal-page .finance-dialog {
  border: 1px solid #bacbc1;
  border-radius: 8px;
  width: min(900px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 24px;
  color: #182b27;
  overflow: auto;
}
.portal-page .finance-dialog::backdrop {
  background: #12241a80;
}
.portal-page .finance-dialog h3 {
  margin-top: 0;
}
.portal-page .finance-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  padding: 0;
  margin: 18px 0;
  min-width: 0;
}
.portal-page .finance-form > p,
.portal-page .finance-form > .finance-toolbar {
  grid-column: 1/-1;
}
.portal-page .finance-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.portal-page .finance-toolbar > label { min-width: 0; max-width: 100%; }
.portal-page .finance-toolbar > label:first-child { flex: 1 1 220px; }
.portal-page h2, .portal-page h3, .portal-page h4 { overflow-wrap: anywhere; }
.portal-page button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.portal-page .crm-check { flex-direction: row; }
.portal-page .crm-check input { min-height: 18px; padding: 0; }
.portal-page footer {
  border-top: 1px solid #d8e0dc;
  padding: 20px 24px;
  text-align: center;
}
[hidden] {
  display: none !important;
}
@media (max-width: 600px) {
  .portal-page header {
    padding: 14px 16px;
  }
  .portal-page main {
    padding: 20px 14px;
  }
  .portal-page h1 {
    font-size: 24px;
  }
  .portal-page h2 {
    font-size: 21px;
  }
  .portal-page .finance-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .portal-page .finance-dialog {
    padding: 18px;
  }
  .crm-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .crm-detail dd {
    margin-bottom: 10px;
  }
  .crm-search {
    margin-inline-start: 0;
    flex: 1;
  }
  .crm-metrics {
    gap: 14px;
  }
  .crm-metrics > div {
    min-width: 125px;
  }
}
@media print {
  .portal-page header,
  .portal-page footer,
  .portal-page main,
  .portal-page dialog .finance-toolbar,
  .portal-page dialog [data-print],
  .portal-page dialog [role="status"] {
    display: none !important;
  }
  .portal-page dialog[open] {
    position: static;
    display: block !important;
    width: 100%;
    max-height: none;
    border: 0;
    padding: 0;
  }
  .portal-page .table-scroll {
    overflow: visible;
  }
  .portal-page .data-table {
    min-width: 0;
  }
  .portal-page dialog::backdrop {
    background: none;
  }
}
