/* Shared design tokens and reusable layout, control, status, table, and dialog styles. */
:root {
  color-scheme: light;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text: #182230;
  --muted: #667085;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --canvas: #f2f4f7;
  --border: #e4e7ec;
  --primary: #3157d5;
  --primary-hover: #2346bd;
  --danger: #c43232;
  --success: #138a5b;
  --status-blue: #175cd3;
  --status-green: #067647;
  --status-amber: #b54708;
  --status-red: #b42318;
  --status-purple: #6941c6;
  --status-teal: #0e746f;
  --status-gray: #475467;
  --shadow: 0 16px 48px rgb(16 24 40 / 14%);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --text: #e7edf6;
  --muted: #9aa8bb;
  --surface: #192331;
  --surface-soft: #202c3c;
  --canvas: #111923;
  --border: #344255;
  --primary: #3355ff;
  --primary-hover: #0000ff;
  --danger: #ff8585;
  --success: #54d3a0;
  --status-blue: #84adff;
  --status-green: #75e0a7;
  --status-amber: #fec84b;
  --status-red: #fda29b;
  --status-purple: #c3b5fd;
  --status-teal: #5fe9d0;
  --status-gray: #b8c2d0;
  --shadow: 0 16px 48px rgb(0 0 0 / 35%);
}

/* For the background pic */
.page-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font: 12px/1.45 var(--font);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--primary);
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.admin-page:not(.app-ready) .app-layout {
  visibility: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex: 0 0 216px;
  flex-direction: column;
  width: 216px;
  height: 100vh;
  padding: 14px 10px 10px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: width .18s, flex-basis .18s;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 9px 12px;
  font-size: 12px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: white;
  background: var(--canvas);
  border-radius: 7px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-toggle {
  position: absolute;
  top: 16px;
  right: 8px;
}

.sidebar nav {
  overflow-y: auto;
}

.nav-link {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

a.lead-queue-count,
a.loan-status-count,
a.customer-group-link,
a.customer-workflow-queue-member-link,
a.link-button {
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 650;
}

.nav-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.nav-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-chevron {
  width: 10px;
  margin-left: auto;
  text-align: center;
}

.group-toggle[aria-expanded="false"] .nav-chevron::before {
  content: "›";
}

.group-toggle[aria-expanded="true"] .nav-chevron::before {
  content: "⌄";
}

.nav-group {
  margin-top: 4px;
}

.nav-children {
  padding-left: 22px;
}

.nav-children .nav-link {
  min-height: 27px;
}

#navigation [hidden] {
  display: none !important;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 11px 9px 3px;
  color: var(--muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.sidebar.collapsed {
  flex-basis: 56px;
  width: 56px;
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-children {
  display: none;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding-inline: 4px;
}

.sidebar.collapsed .nav-children {
  display: none;
}

.sidebar.collapsed .sidebar-toggle {
  right: 3px;
}

.nav-children[hidden] {
  display: none;
}

.main-area {
  min-width: 0;
  flex: 1;
}

.main-area--product-type-editor {
  display: flex;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

.main-area--product-type-editor>.topbar {
  flex: 0 0 auto;
}

.ussd-simulator-layout {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(320px, 1fr);
  align-items: start;
  gap: 20px;
  max-width: 1040px;
  margin: 0 auto;
}

.ussd-device {
  width: min(100%, 330px);
  justify-self: center;
  padding: 16px 18px 12px;
  color: #f4f7fb;
  background: #202732;
  border: 1px solid #0f1720;
  border-radius: 34px;
  box-shadow: 0 16px 36px rgb(16 24 40 / 24%);
}

.ussd-device-speaker {
  width: 54px;
  height: 5px;
  margin: 0 auto 12px;
  background: #58616c;
  border-radius: 999px;
}

.ussd-phone-status {
  display: flex;
  justify-content: space-between;
  margin: 0 2px 7px;
  color: #d3dce8;
  font-size: 10px;
}

.ussd-screen {
  min-height: 185px;
  padding: 12px;
  overflow-wrap: anywhere;
  color: #17201b;
  background: #dbe7d8;
  border: 5px solid #111820;
  border-radius: 6px;
  font: 12px/1.5 ui-monospace, Consolas, monospace;
}

.ussd-screen p {
  margin: 0 0 5px;
  font-weight: 700;
}

.ussd-screen pre,
.ussd-transcript pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
}

.ussd-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ussd-controls>label {
  display: grid;
  gap: 3px;
  color: #d6deea;
  font-size: 11px;
}

.ussd-controls input {
  width: 100%;
  min-height: 30px;
  padding: 5px 7px;
  color: #f4f7fb;
  background: #111820;
  border: 1px solid #4a5563;
  border-radius: 4px;
}

.ussd-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.ussd-key {
  min-height: 31px;
  color: #f4f7fb;
  background: #36414e;
  border: 1px solid #4b5867;
  border-radius: 5px;
  cursor: pointer;
}

.ussd-key:hover:not(:disabled) {
  background: #465365;
}

.ussd-key:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.ussd-device-actions {
  display: flex;
  justify-content: space-between;
  gap: 7px;
}

.ussd-device-actions .button {
  min-width: 60px;
}

.ussd-device-home {
  width: 45px;
  height: 7px;
  margin: 12px auto 0;
  background: #58616c;
  border-radius: 999px;
}

.ussd-transcript-panel {
  min-width: 0;
}

.ussd-transcript-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.ussd-transcript-heading h2 {
  margin: 0;
}

.ussd-transcript {
  display: grid;
  gap: 9px;
  max-height: 550px;
  margin: 12px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.ussd-transcript li {
  padding: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.ussd-transcript-input {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.ussd-sandbox-note {
  margin: 12px 0 0;
}

.mpesa-simulator-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 920px;
  margin: 0 auto 10px;
}

.mpesa-simulator-modes [aria-selected="true"] {
  color: var(--primary);
  background: var(--surface-soft);
  border-color: var(--primary);
}

.mpesa-simulator-panel[hidden] {
  display: none !important;
}

.mpesa-simulator-panel,
.mpesa-callback-result {
  max-width: 920px;
  margin: 0 auto 14px;
}

.mpesa-simulator-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.mpesa-simulator-form>label {
  display: grid;
  align-content: start;
  gap: 4px;
  color: var(--muted);
}

.mpesa-simulator-form input,
.mpesa-simulator-form select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.mpesa-target-field {
  grid-column: 1 / -1;
}

.mpesa-target-field>span {
  font-size: 11px;
}

.mpesa-simulator-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.mpesa-result-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 12px 0 0;
}

.mpesa-result-details>div {
  min-width: 0;
}

.mpesa-result-details dt {
  color: var(--muted);
  font-size: 11px;
}

.mpesa-result-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.monthly-kpi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.monthly-kpi-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
}

.monthly-kpi-toolbar>label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.monthly-kpi-toolbar input,
.monthly-kpi-toolbar select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.monthly-kpi-toolbar .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.monthly-kpi-toolbar [hidden] {
  display: none !important;
}

.monthly-kpi-note {
  margin: 10px 0;
  color: var(--muted);
}

.monthly-kpi-publication {
  display: block;
  margin-top: 5px;
  color: var(--text);
}

.monthly-kpi-table-card {
  margin-top: 10px;
}

.monthly-kpi-table {
  min-width: 1820px;
  border-collapse: separate;
  border-spacing: 0;
}

.monthly-kpi-table th,
.monthly-kpi-table td {
  white-space: nowrap;
}

.monthly-kpi-table thead th {
  position: sticky;
  z-index: 2;
  background: var(--surface-soft);
}

.monthly-kpi-table thead tr:first-child th {
  top: 0;
}

.monthly-kpi-table thead tr:nth-child(2) th {
  top: 32px;
}

.monthly-kpi-table thead th:first-child,
.monthly-kpi-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 110px;
  box-shadow: 2px 0 4px rgb(20 30 50 / 8%);
}

.monthly-kpi-table thead th:first-child {
  z-index: 5;
}

.monthly-kpi-table .monthly-kpi-section-period {
  color: #222;
  background: #f0fbd6;
  text-transform: uppercase;
}

.monthly-kpi-table .section-0 {
  color: #222;
  background: #fbf7d6;
}

.monthly-kpi-table .section-1 {
  color: #222;
  background: #f0fbd6;
}

.monthly-kpi-table .section-2 {
  color: #222;
  background: #fbe5d6;
}

.monthly-kpi-table .section-3 {
  color: #222;
  background: #aed8ff;
}

.monthly-kpi-table .section-4 {
  color: #222;
  background: #d9d9d9;
}

.monthly-kpi-table .section-5 {
  color: #222;
  background: #8effb9;
}

.monthly-kpi-table .section-6 {
  color: #222;
  background: #ff9df7;
}

.monthly-kpi-table .section-0-dull {
  background: rgb(251 250 214 / 68%);
}

.monthly-kpi-table .section-1-dull {
  background: rgb(240 251 214 / 71%);
}

.monthly-kpi-table .section-2-dull {
  background: rgb(251 229 214 / 68%);
}

.monthly-kpi-table .section-3-dull {
  background: rgb(174 216 255 / 69%);
}

.monthly-kpi-table .section-4-dull {
  background: rgb(217 217 217 / 67%);
}

.monthly-kpi-table .section-5-dull {
  background: rgb(142 255 185 / 64%);
}

.monthly-kpi-table .section-6-dull {
  background: rgb(255 157 247 / 65%);
}

html[data-theme="dark"] .monthly-kpi-table .monthly-kpi-section-period,
html[data-theme="dark"] .monthly-kpi-table .section-0 {
  color: var(--text);
  background: color-mix(in srgb, var(--status-amber) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-1 {
  color: var(--text);
  background: color-mix(in srgb, var(--status-green) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-2 {
  color: var(--text);
  background: color-mix(in srgb, var(--status-red) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-3 {
  color: var(--text);
  background: color-mix(in srgb, var(--status-blue) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-4 {
  color: var(--text);
  background: color-mix(in srgb, var(--status-gray) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-5 {
  color: var(--text);
  background: color-mix(in srgb, var(--success) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-6 {
  color: var(--text);
  background: color-mix(in srgb, var(--status-purple) 25%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-0-dull {
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-1-dull {
  background: color-mix(in srgb, var(--status-green) 14%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-2-dull {
  background: color-mix(in srgb, var(--status-red) 14%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-3-dull {
  background: color-mix(in srgb, var(--status-blue) 14%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-4-dull {
  background: color-mix(in srgb, var(--status-gray) 14%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-5-dull {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
}

html[data-theme="dark"] .monthly-kpi-table .section-6-dull {
  background: color-mix(in srgb, var(--status-purple) 14%, var(--surface));
}

.monthly-kpi-basis {
  margin-top: 10px;
}

.monthly-kpi-basis summary {
  cursor: pointer;
  font-weight: 650;
}

.monthly-kpi-basis dl {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
}

.monthly-kpi-basis dl>div {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 10px;
}

.monthly-kpi-basis dt {
  color: var(--muted);
  text-transform: capitalize;
}

.monthly-kpi-basis dd {
  margin: 0;
}

@media (max-width: 760px) {
  .ussd-simulator-layout {
    grid-template-columns: 1fr;
  }

  .ussd-device {
    justify-self: center;
  }
}

@media (max-width: 600px) {

  .mpesa-simulator-form,
  .mpesa-result-details {
    grid-template-columns: 1fr;
  }

  .mpesa-target-field,
  .mpesa-simulator-actions {
    grid-column: auto;
  }
}

.topbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.breadcrumbs,
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.breadcrumbs {
  color: var(--muted);
}

.breadcrumbs strong {
  color: var(--text);
  font-weight: 600;
}

.separator {
  color: var(--border);
}

.top-actions {
  margin-left: auto;
}

.notification-center {
  position: relative;
}

.notification-center[hidden] {
  display: none;
}

.notification-toggle {
  position: relative;
}

.notification-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-count {
  position: absolute;
  top: -4px;
  right: -5px;
  display: grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  padding: 0 3px;
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--surface);
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  right: -34px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 70px));
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notification-panel[hidden] {
  display: none;
}

.notification-panel-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.notification-panel-header button[hidden] {
  display: none;
}

.notification-list {
  display: grid;
}

.notification-item {
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.notification-item:hover,
.notification-item.unread {
  background: var(--surface-soft);
}

.notification-item.unread strong::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 6px 1px 0;
  background: var(--primary);
  border-radius: 50%;
  content: "";
}

.notification-item span,
.notification-empty {
  color: var(--muted);
}

.notification-empty {
  padding: 14px 12px;
}

.scope-view-trigger {
  display: inline-flex;
  max-width: 190px;
  min-height: 28px;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.scope-view-trigger:hover {
  color: var(--text);
  border-color: var(--primary);
}

.scope-view-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.scope-view-trigger[hidden] {
  display: none;
}

.scope-view-trigger svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.scope-view-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Scope View Level: Global / All accessible */
.scope-view-trigger[data-scope-level="global"] {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 85%, var(--surface));
  border-color: var(--border);
}

.scope-view-trigger[data-scope-level="global"]:hover {
  background: var(--surface-soft);
  border-color: color-mix(in srgb, var(--text) 30%, var(--border));
}

/* Scope View Level: Region (Purple) */
.scope-view-trigger[data-scope-level="region"] {
  color: var(--status-purple);
  background: color-mix(in srgb, var(--status-purple) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--status-purple) 32%, var(--border));
}

.scope-view-trigger[data-scope-level="region"]:hover {
  background: color-mix(in srgb, var(--status-purple) 18%, var(--surface));
  border-color: var(--status-purple);
}

/* Scope View Level: Branch (Amber) */
.scope-view-trigger[data-scope-level="branch"] {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--status-amber) 32%, var(--border));
}

.scope-view-trigger[data-scope-level="branch"]:hover {
  background: color-mix(in srgb, var(--status-amber) 18%, var(--surface));
  border-color: var(--status-amber);
}

/* Scope View Level: Team (Teal) */
.scope-view-trigger[data-scope-level="team"] {
  color: var(--status-teal);
  background: color-mix(in srgb, var(--status-teal) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--status-teal) 32%, var(--border));
}

.scope-view-trigger[data-scope-level="team"]:hover {
  background: color-mix(in srgb, var(--status-teal) 18%, var(--surface));
  border-color: var(--status-teal);
}

/* Customer Type View: All customers */
.scope-view-trigger[data-customer-type="all"] {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 85%, var(--surface));
  border-color: var(--border);
}

.scope-view-trigger[data-customer-type="all"]:hover {
  background: var(--surface-soft);
  border-color: color-mix(in srgb, var(--text) 30%, var(--border));
}

/* Customer Type View: Individuals (Blue) */
.scope-view-trigger[data-customer-type="individual"] {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--status-blue) 32%, var(--border));
}

.scope-view-trigger[data-customer-type="individual"]:hover {
  background: color-mix(in srgb, var(--status-blue) 18%, var(--surface));
  border-color: var(--status-blue);
}

/* Customer Type View: Groups (Green) */
.scope-view-trigger[data-customer-type="group"] {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--status-green) 32%, var(--border));
}

.scope-view-trigger[data-customer-type="group"]:hover {
  background: color-mix(in srgb, var(--status-green) 18%, var(--surface));
  border-color: var(--status-green);
}

/* Temporary Topbar Quick Actions */
.topbar-quick-type-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-quick-type-actions[hidden],
.topbar-quick-btn[hidden] {
  display: none;
}

.topbar-quick-btn {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.topbar-quick-btn:hover {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--primary);
}

.topbar-quick-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.topbar-quick-btn[data-quick-customer-type="all"].is-active {
  color: var(--text);
  background: var(--surface-soft);
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.topbar-quick-btn[data-quick-customer-type="individual"].is-active {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--status-blue) 45%, var(--border));
}

.topbar-quick-btn[data-quick-customer-type="group"].is-active {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--status-green) 45%, var(--border));
}

.topbar-quick-lead-btn {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
}

.topbar-quick-lead-btn:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.topbar-quick-lead-btn svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.theme-toggle {
  color: var(--muted);
}

.theme-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

html[data-theme="light"] .theme-icon-sun,
html[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.profile-menu {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.profile-trigger:hover .profile-avatar,
.profile-trigger:focus-visible .profile-avatar {
  border-color: var(--primary);
}

.profile-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
}

.profile-avatar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-thumbnail {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 50%;
  vertical-align: middle;
}

.profile-preview {
  display: block;
  width: 88px;
  height: 88px;
  margin: 2px 0 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 50%;
}

.profile-preview-placeholder {
  display: grid;
  width: 88px;
  height: 88px;
  margin: 2px 0 8px;
  place-items: center;
  padding: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px dashed var(--border);
  border-radius: 50%;
  text-align: center;
  font-size: 10px;
}

.profile-chevron {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.profile-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: min(240px, calc(100vw - 24px));
  gap: 5px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.profile-panel[hidden] {
  display: none;
}

.profile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-contact {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.profile-logout {
  margin-top: 5px;
  padding: 7px 0 0;
  color: var(--danger);
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
}

.profile-logout:hover {
  color: var(--text);
}

.reference-panel {
  margin: 0 0 14px;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.reference-class-list {
  display: grid;
  gap: 2px;
}

.reference-inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.reference-inline-form>label {
  min-width: 210px;
}

.reference-import {
  border-style: dashed;
}

.reference-preview {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.reference-preview h3 {
  margin: 0;
  font-size: 12px;
}

.reference-preview dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
  margin: 0;
}

.reference-preview dl div {
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.reference-preview dt {
  color: var(--muted);
  text-transform: capitalize;
}

.reference-preview dd {
  margin: 2px 0 0;
  font-weight: 650;
}

.communication-balance,
.communication-topup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.communication-balance>div {
  display: grid;
  gap: 3px;
}

.communication-balance .eyebrow {
  margin: 0;
}

.communication-balance #sms-balance-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.communication-topup {
  justify-content: flex-start;
  color: var(--muted);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.communication-topup>strong {
  color: var(--text);
}

.communication-topup .button {
  margin-left: auto;
}

.communication-form {
  display: grid;
  gap: 11px;
  max-width: 760px;
}

.communication-form label {
  display: grid;
  gap: 4px;
}

.communication-form [hidden] {
  display: none;
}

.communication-form textarea {
  resize: vertical;
}

.lead-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
}

.lead-filters>label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  margin: 0;
  flex: 1 1 150px;
}

.lead-filters>label.lead-filter-search {
  flex: 1.5 1 200px;
  min-width: 180px;
  max-width: 340px;
}

.lead-filters select[multiple] {
  display: none;
}

.lead-filters input,
.lead-filters select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.lead-filters .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.lead-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.lead-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: end;
}

.lead-filter-actions .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
}

.communication-form code {
  padding: 1px 4px;
  background: var(--surface-soft);
  border-radius: 3px;
}

.communication-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.communication-divider::before,
.communication-divider::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: "";
}

.communication-template {
  justify-self: start;
}

.communication-field-grid,
.communication-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.communication-toggle {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
}

.communication-toggle input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.communication-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.communication-provider-grid>div {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.communication-provider-grid>div p {
  margin: 0;
}

.communication-feedback {
  margin-top: 10px;
  padding: 8px 10px;
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
  border-radius: 5px;
}

.communication-feedback.error {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
}

.communication-feedback[hidden] {
  display: none;
}

.lead-registration-shell {
  display: grid;
  min-height: 100vh;
  place-items: start center;
  padding: 24px 14px;
}

.lead-share-panel {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.lead-share-panel h2 {
  margin: 2px 0;
  font-size: 13px;
}

.lead-share-panel p {
  margin: 3px 0 0;
}

.lead-share-options {
  display: grid;
  gap: 6px;
}

.lead-share-option {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lead-share-option code {
  overflow-wrap: anywhere;
}

.lead-share-option .icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
}

.lead-share-option svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

@media (max-width: 700px) {
  .lead-share-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .lead-share-option {
    grid-template-columns: 1fr 32px;
  }

  .lead-share-option>.muted {
    grid-column: 1 / -1;
  }
}

.lead-registration-card {
  width: min(100%, 680px);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.lead-registration-card>header {
  margin-bottom: 18px;
}

.lead-registration-card h1 {
  margin: 6px 0;
  font-size: 20px;
}

.lead-registration-card header .brand-mark {
  display: inline-grid;
  margin-bottom: 8px;
}

.lead-checkbox-list {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.lead-checkbox-list legend {
  padding: 0 4px;
  font-weight: 600;
}

.lead-choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lead-group-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.lead-group-fields[hidden] {
  display: none;
}

.lead-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.reference-wide {
  grid-column: 1 / -1;
}

.reference-margin-grid {
  display: grid;
  gap: 10px;
}

.reference-margin-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.reference-margin-grid fieldset[hidden] {
  display: none;
}

.reference-size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.reference-size-grid>div {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.reference-schedule {
  display: block;
  margin: 2px 0;
}

.reference-dialog {
  width: min(880px, calc(100vw - 24px));
  max-height: min(90vh, 900px);
  padding: 16px;
  overflow: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.appraisal-settings-dialog {
  width: min(1100px, calc(100vw - 24px));
}

.payment-dialog {
  width: min(720px, calc(100vw - 24px));
}

.payment-status-note,
.payment-settings-section {
  margin-bottom: 12px;
  padding: 12px;
}

.payment-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-top: 12px;
}

.payment-add-form label {
  min-width: 130px;
  flex: 1;
}

.payment-add-form button {
  align-self: end;
}

.payment-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.payment-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.payment-filters label.payment-filter-search {
  flex: 1.5 1 200px;
  min-width: 180px;
  max-width: 340px;
}

.payment-filters input,
.payment-filters select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.payment-filters .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.payment-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.payment-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.payment-records-table {
  min-width: 970px;
}

.payment-records-table th:first-child,
.payment-records-table td:first-child {
  min-width: 190px;
}

.payment-records-table.has-sticky-actions th:last-child,
.payment-records-table.has-sticky-actions td:last-child {
  width: 1%;
  min-width: 0;
}

.wallet-records-table {
  min-width: 540px;
}

.payment-settings-section .data-table input:not([type="checkbox"]),
.payment-settings-section .data-table select {
  min-width: 100px;
}

.reference-dialog::backdrop {
  background: rgb(16 24 40 / 48%);
}

.reference-dialog form {
  display: grid;
  gap: 12px;
}

.reference-form-error,
.reference-feedback.error {
  color: var(--danger);
}

.reference-feedback {
  margin-top: 8px;
  color: var(--success);
}

.reference-feedback[hidden] {
  display: none;
}

button.danger {
  color: var(--danger);
}

.account-panel {
  margin-bottom: 14px;
}

.account-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.account-panel-heading h2 {
  margin-bottom: 4px;
}

.account-panel-heading p {
  margin-bottom: 0;
}

.account-type-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0;
  padding-bottom: 5px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.account-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.account-type-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.account-type-tab-count {
  min-width: 18px;
  padding: 1px 5px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 9px;
  font-size: 11px;
  text-align: center;
}

.account-type-panel[hidden] {
  display: none;
}

.account-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.account-category-list {
  display: grid;
  gap: 10px;
}

.account-category-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.account-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}

.account-category-heading h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.account-category-heading h3 .muted {
  font-size: 12px;
  font-weight: 400;
}

.account-category-heading p {
  margin: 3px 0 0;
}

.account-category-empty {
  margin: 0;
  padding: 12px;
}

.account-category-empty-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 6px;
  text-align: center;
}

.account-category-empty-state strong {
  color: var(--text);
}

.account-table {
  min-width: 960px;
}

.account-table td,
.account-table th {
  padding: 7px 9px;
}

.account-table th:nth-child(6),
.account-table th:nth-child(7),
.account-table th:nth-child(8) {
  text-align: right;
}

.account-actions {
  white-space: nowrap;
}

.account-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.account-action-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 4px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
}

.account-action-icon:hover,
.account-action-icon:focus-visible {
  background: var(--surface-soft);
  border-color: var(--border);
}

.account-action-icon.danger {
  color: var(--danger);
}

.account-action-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.account-total-values {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.account-total-values span {
  display: block;
}

.account-debit-values {
  color: var(--success);
}

.account-credit-values {
  color: var(--danger);
}

.account-statement-dialog {
  width: min(1180px, calc(100vw - 24px));
}

.account-statement {
  display: grid;
  gap: 10px;
}

.account-statement .page-heading {
  margin-bottom: 0;
}

.account-statement-dialog .account-statement-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.account-statement-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 150px;
  max-width: 260px;
  flex: 1 1 180px;
}

.account-statement-filters input,
.account-statement-filters select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.account-statement-filters .searchable-select {
  width: 100%;
  min-width: 150px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.account-statement-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.account-statement-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.account-statement-meta {
  color: var(--muted);
}

.account-statement-table {
  min-width: 900px;
}

.account-statement-table th,
.account-statement-table td {
  padding: 6px 8px;
}

.account-statement-table .account-statement-summary {
  font-weight: 600;
  background: var(--surface-soft);
}

.account-statement-reversal {
  opacity: .76;
}

.account-transfer-form .accounting-operation-wide {
  grid-column: 1 / -1;
}

.account-dialog {
  width: min(680px, calc(100vw - 24px));
}

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

.account-form-grid label {
  display: grid;
  gap: 4px;
}

.account-form-grid .account-checkbox {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 7px;
}

.account-form-grid .account-checkbox[hidden] {
  display: none;
}

.account-form-grid .account-checkbox input {
  width: 14px;
  min-height: 14px;
  margin: 0;
}

.account-dialog .muted {
  margin: 8px 0 0;
}

.account-form-error {
  color: var(--danger);
}

.account-form-error[hidden] {
  display: none;
}

.account-mappings {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.account-mapping-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(190px, 1.4fr) auto minmax(130px, 1fr);
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.account-mapping-form:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.account-mapping-form strong,
.account-mapping-form small {
  display: block;
}

.account-mapping-form small {
  margin-top: 3px;
  color: var(--muted);
}

.accounting-operation-form {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.accounting-operation-form .page-heading {
  margin-bottom: 9px;
}

.accounting-operation-form .muted {
  margin: 8px 0;
}

.accounting-operation-dialog {
  width: min(820px, calc(100vw - 24px));
}

.accounting-expense-details-dialog {
  width: min(760px, calc(100vw - 24px));
}

.accounting-expense-details-dialog .page-heading {
  align-items: flex-start;
}

.accounting-expense-details-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.accounting-expense-details-summary dt {
  color: var(--muted);
}

.accounting-expense-details-summary dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.accounting-expense-details-dialog .data-table {
  min-width: 600px;
}

.accounting-expense-details-dialog .data-table th:last-child,
.accounting-expense-details-dialog .data-table td:last-child {
  text-align: right;
}

.accounting-operation-dialog .accounting-operation-form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.accounting-operation-dialog .accounting-operation-form .page-heading {
  align-items: flex-start;
}

.accounting-operation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.accounting-operation-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.accounting-operation-grid .accounting-operation-wide {
  grid-column: 1 / -1;
}

.accounting-operation-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.accounting-operation-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.accounting-operation-filters input,
.accounting-operation-filters select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.accounting-operation-filters .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.accounting-operation-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.accounting-operation-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.accounting-operation-filters [hidden],
.accounting-operation-grid [hidden] {
  display: none;
}

.accounting-operation-form [data-operation-error] {
  margin: 8px 0 0;
  color: var(--danger);
}

.accounting-operation-form [data-operation-error][hidden] {
  display: none;
}

.accounting-operation-details {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.accounting-operation-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px;
}

.accounting-operations .data-table {
  min-width: 900px;
}

.accounting-operations .data-table td,
.accounting-operations .data-table th {
  padding: 6px 8px;
}

@media (max-width: 760px) {

  .reference-form-grid,
  .reference-size-grid {
    grid-template-columns: 1fr;
  }

  .reference-wide {
    grid-column: auto;
  }

  .communication-field-grid,
  .communication-provider-grid,
  .communication-event-grid {
    grid-template-columns: 1fr;
  }

  .accounting-expense-details-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-form-grid,
  .account-mapping-form,
  .accounting-operation-grid {
    grid-template-columns: 1fr;
  }

  .accounting-operation-grid .accounting-operation-wide {
    grid-column: auto;
  }
}

.content {
  min-width: 0;
  max-width: 100%;
  padding: 20px;
}

.content--product-type-editor {
  width: 100%;
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.page-heading .heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -.01em;
}

h2 {
  margin: 0;
  font-size: 12px;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.page-heading .muted {
  margin-bottom: 0;
}

.button {
  display: inline-flex;
  min-height: 29px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.button:hover {
  border-color: var(--primary);
}

.button:disabled {
  opacity: .72;
  cursor: wait;
}

.button.primary {
  color: white;
  background: #3157d5;
  border-color: #3157d5;
}

.button.primary:hover {
  background: #2346bd;
}

.button.subtle {
  background: transparent;
}

.button.danger {
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.icon-button:hover {
  background: var(--surface-soft);
  border-color: var(--border);
}

.mobile-menu {
  display: none;
}

.card,
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px;
}

.stat-card .stat-number {
  margin: 6px 0 2px;
  font-size: 12px;
  font-weight: 700;
}

.stat-card .stat-label {
  margin: 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.resource-toolbar {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#filters-host {
  min-width: 0;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
}

.filter-form label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.filter-form label.resource-filter-search,
.filter-form label.product-filter-search,
.filter-form label.audit-filter-search {
  flex: 1.5 1 200px;
  min-width: 180px;
  max-width: 340px;
}

.filter-form input,
.filter-form select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.filter-form input[type="search"] {
  min-width: 160px;
  max-width: 340px;
}

.filter-form .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.filter-form .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.filter-form .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.searchable-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 140px;
  padding: 0;
  border: 0;
  background: transparent;
}

.searchable-native {
  display: none !important;
}

.searchable-trigger {
  display: flex;
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 7px;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.searchable-trigger:hover,
.searchable-trigger:focus-visible {
  border-color: var(--primary);
  outline: none;
}

.searchable-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.2;
}

.searchable-trigger span[aria-hidden="true"] {
  flex: 0 0 auto;
  margin-left: 4px;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
}

.searchable-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 3px);
  left: 0;
  width: max(100%, 210px);
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.searchable-menu[hidden] {
  display: none;
}

.searchable-query {
  min-height: 29px;
  margin-bottom: 5px;
}

.searchable-options {
  display: grid;
  max-height: 210px;
  overflow: auto;
}

.searchable-option {
  display: flex;
  min-height: 29px;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px 6px;
  border-radius: 4px;
  font-weight: 400;
  cursor: pointer;
}

.searchable-option:hover {
  background: var(--surface-soft);
}

.searchable-option input {
  width: 14px;
  min-height: 14px;
  flex: 0 0 14px;
  margin: 0;
  accent-color: var(--primary);
}

.searchable-no-results {
  padding: 8px 6px;
  color: var(--muted);
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

.table-card .table-wrap,
.report-table-wrap {
  max-height: min(68vh, 640px);
  overscroll-behavior: contain;
}

.profile-finance-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: min(360px, 55vh);
  overscroll-behavior: contain;
}

.payment-records-table {
  width: max(100%, 970px);
}

.payment-records-table td.payment-actions-cell:not(.has-payment-actions) {
  box-shadow: none;
}

.profile-finance-table-wrap .group-receipts-table {
  min-width: 760px;
}

.profile-finance-table-wrap .group-receipts-table th:first-child,
.profile-finance-table-wrap .group-receipts-table td:first-child {
  min-width: 120px;
}

.profile-finance-table-wrap .group-receipts-table th:last-child,
.profile-finance-table-wrap .group-receipts-table td:last-child {
  min-width: 72px;
}

.loan-kpi-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.loan-kpi-help {
  margin-bottom: 10px;
  padding: 9px 11px;
  color: var(--muted);
  line-height: 1.5;
}

.loan-kpi-help strong {
  color: var(--text);
}

.loan-kpi-help span {
  display: block;
  margin-top: 3px;
}

.loan-kpi-toolbar {
  align-items: flex-end;
  justify-content: flex-start;
}

.loan-kpi-toolbar .filter-form {
  align-items: flex-end;
}

.loan-kpi-toolbar label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.loan-kpi-toolbar input,
.loan-kpi-toolbar select {
  min-width: 118px;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.loan-kpi-toolbar #loan-kpi-apply {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.loan-kpi-period {
  margin: 0 0 9px;
  font-size: 11px;
  line-height: 1.5;
}

.loan-kpi-summary {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  margin-bottom: 10px;
}

.loan-kpi-summary .stat-card {
  padding: 9px 11px;
}

.loan-kpi-summary .stat-number {
  font-size: 12px;
}

.loan-kpi-table-card {
  min-width: 0;
}

.loan-kpi-table {
  min-width: 1120px;
  font-size: 11px;
}

.loan-kpi-table th,
.loan-kpi-table td {
  padding: 5px 7px;
}

.loan-kpi-table th {
  white-space: normal;
}

.loan-kpi-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.loan-kpi-target {
  width: 120px;
  min-height: 27px;
  padding: 4px 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.loan-kpi-rate {
  display: inline-flex;
  min-width: 50px;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.loan-kpi-rate--good {
  color: #fff;
  background: #00b300;
}

.loan-kpi-rate--warning {
  color: #fff;
  background: #ff9100;
}

.loan-kpi-rate--poor {
  color: #fff;
  background: #e00000;
}

.loan-kpi-subtotal td {
  background: var(--surface-soft);
  font-weight: 700;
}

.loan-kpi-grand-total td {
  background: var(--surface-soft);
  font-weight: 700;
  border-top: 1px solid var(--border-strong, var(--border));
}

.loan-kpi-grand-total td {
  background: var(--surface);
}

.loan-kpi-legacy-table {
  min-width: 1030px;
  border-collapse: separate;
  border-spacing: 0;
}

.loan-kpi-legacy-table thead tr:nth-child(2) th:first-child,
.loan-kpi-legacy-table tbody td:first-child,
.loan-kpi-legacy-table tbody th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 2px 0 4px rgb(20 30 50 / 8%);
}

.loan-kpi-legacy-table thead tr:first-child th:first-child {
  position: sticky;
  left: 0;
  z-index: 4;
}

.loan-kpi-legacy-table thead tr:nth-child(2) th:first-child {
  z-index: 4;
}

.loan-kpi-legacy-table th,
.loan-kpi-legacy-table td {
  border: 1px solid var(--border);
  text-align: center;
}

.loan-kpi-legacy-table thead tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 3;
  font-weight: 700;
  text-transform: uppercase;
}

.loan-kpi-legacy-table thead tr:nth-child(2) th {
  position: sticky;
  top: 32px;
  z-index: 3;
  font-weight: 700;
}

.loan-kpi-legacy-table .loan-kpi-section-groups {
  color: #222;
  background: #fbf7d6;
}

.loan-kpi-legacy-table .loan-kpi-section-disbursements {
  color: #222;
  background: #fbe5d6;
}

.loan-kpi-legacy-table .loan-kpi-section-collections {
  color: #222;
  background: #aed8ff;
}

.loan-kpi-legacy-table .loan-kpi-column-headings th:nth-child(-n+2) {
  background: #fbfad6;
}

.loan-kpi-legacy-table .loan-kpi-column-headings th:nth-child(n+3):nth-child(-n+6) {
  background: #fbe9dc;
}

.loan-kpi-legacy-table .loan-kpi-column-headings th:nth-child(n+7) {
  background: #c6e2fc;
}

.loan-kpi-legacy-table .loan-kpi-branch-name {
  min-width: 150px;
  color: #1f2937;
  background: #f1f5f9 !important;
  text-align: left;
  vertical-align: middle;
}

.loan-kpi-branch-name strong,
.loan-kpi-branch-name small {
  display: block;
}

.loan-kpi-branch-name small {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  font-weight: 400;
}

.loan-kpi-legacy-table .loan-kpi-subtotal td {
  background: #f8fafc;
}

.loan-kpi-legacy-table .loan-kpi-grand-total td {
  background: #e2e8f0;
  border-top: 2px solid #94a3b8;
  font-weight: 700;
}

.loan-kpi-legacy-table .loan-kpi-rate {
  border-radius: 2px;
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-section-groups {
  color: var(--text);
  background: color-mix(in srgb, var(--status-amber) 25%, var(--surface));
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-section-disbursements {
  color: var(--text);
  background: color-mix(in srgb, var(--status-red) 25%, var(--surface));
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-section-collections {
  color: var(--text);
  background: color-mix(in srgb, var(--status-blue) 25%, var(--surface));
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-column-headings th:nth-child(-n+2) {
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-column-headings th:nth-child(n+3):nth-child(-n+6) {
  background: color-mix(in srgb, var(--status-red) 14%, var(--surface));
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-column-headings th:nth-child(n+7) {
  background: color-mix(in srgb, var(--status-blue) 14%, var(--surface));
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-branch-name {
  color: var(--text);
  background: var(--surface-soft) !important;
}

html[data-theme="dark"] .loan-kpi-branch-name small {
  color: var(--muted);
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-subtotal td {
  background: var(--surface-soft);
}

html[data-theme="dark"] .loan-kpi-legacy-table .loan-kpi-grand-total td {
  background: color-mix(in srgb, var(--status-blue) 18%, var(--surface));
  border-top-color: var(--border);
}

@media (max-width: 760px) {
  .loan-kpi-toolbar .filter-form {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loan-kpi-toolbar label {
    min-width: 0;
  }

  .loan-kpi-toolbar input,
  .loan-kpi-toolbar select {
    width: 100%;
    min-width: 0;
  }

  .loan-kpi-toolbar #loan-kpi-apply {
    align-self: end;
  }

  .loan-kpi-actions {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .loan-kpi-toolbar .filter-form {
    grid-template-columns: 1fr;
  }

  .loan-kpi-actions .button {
    flex: 1;
  }
}

.sticky-columns-table {
  border-collapse: separate;
  border-spacing: 0;
}

.sticky-columns-table th,
.sticky-columns-table td {
  background: var(--surface);
}

.sticky-columns-table thead th {
  position: sticky;
  z-index: 2;
  top: 0;
}

.sticky-columns-table thead th {
  background: var(--surface-soft);
}

.sticky-columns-table th:first-child,
.sticky-columns-table td:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
  min-width: 155px;
  box-shadow: 2px 0 4px rgb(20 30 50 / 8%);
}

.sticky-columns-table.data-table th:first-child,
.sticky-columns-table.data-table td:first-child {
  min-width: 190px;
}

.sticky-columns-table.customer-register-table th:first-child,
.sticky-columns-table.customer-register-table td:first-child {
  width: 1%;
  min-width: 0;
}

.sticky-columns-table thead th:first-child {
  z-index: 4;
}

.sticky-columns-table.has-sticky-actions th:last-child,
.sticky-columns-table.has-sticky-actions td:last-child {
  position: sticky;
  z-index: 1;
  right: 0;
  width: 1%;
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
  box-shadow: -2px 0 4px rgb(20 30 50 / 8%);
}

.sticky-columns-table.customer-register-table th:last-child,
.sticky-columns-table.customer-register-table td:last-child,
.sticky-columns-table.leads-register-table th:first-child,
.sticky-columns-table.leads-register-table td:first-child,
.sticky-columns-table.leads-register-table th:last-child,
.sticky-columns-table.leads-register-table td:last-child {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}

.sticky-columns-table.has-sticky-actions thead th:last-child {
  z-index: 4;
}

.sticky-columns-table tbody tr:hover td {
  background: var(--surface-soft);
}

.sticky-columns-table tbody tr:hover td:first-child,
.sticky-columns-table.has-sticky-actions tbody tr:hover td:last-child {
  background: var(--surface-soft);
}

.loan-report-table tfoot th {
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.loan-report-table tfoot th:first-child,
.loan-report-table tfoot th:last-child {
  background: var(--surface-soft);
}

.loan-report-table tfoot th.loan-report-total-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  width: max-content;
  margin-left: auto;
}

.row-action-menu {
  display: flex;
  justify-content: flex-end;
  position: relative;
  width: max-content;
  margin-left: auto;
}

td:has(> .row-actions),
td:has(> .row-action-menu),
td:has(> .bum-row-actions),
td.loan-row-actions,
td.account-actions,
td.payment-actions-cell {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
  padding-left: 6px;
  padding-right: 6px;
}

tbody tr.row-action-menu-open {
  position: relative;
  z-index: 12;
}

.sticky-columns-table tbody tr.row-action-menu-open td:first-child,
.sticky-columns-table.has-sticky-actions tbody tr.row-action-menu-open td:last-child {
  z-index: 12;
}

.row-action-menu-toggle {
  color: var(--muted);
}

.row-action-menu-toggle.button {
  color: var(--text);
}

.row-action-menu-toggle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.row-action-menu-toggle[aria-expanded="true"] {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--text);
}

.row-action-menu-panel {
  position: fixed;
  inset: auto;
  z-index: 40;
  display: grid;
  margin: 0;
  width: max-content;
  min-width: 176px;
  height: fit-content;
  max-width: min(260px, calc(100vw - 16px));
  padding: 4px;
  overflow: visible;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.row-action-menu-panel[hidden] {
  display: none;
}

.row-action-menu-panel:popover-open {
  display: grid;
}

.row-action-menu-panel .button,
.row-action-menu-panel .account-action-icon {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.row-action-menu-panel .button.primary {
  color: var(--text);
  background: transparent;
}

.row-action-menu-panel .button.danger,
.row-action-menu-panel .button.subtle.danger {
  color: var(--danger);
}

.row-action-menu-panel .button:hover,
.row-action-menu-panel .account-action-icon:hover,
.row-action-menu-panel .button:focus-visible,
.row-action-menu-panel .account-action-icon:focus-visible {
  background: var(--surface-soft);
}

.row-action-menu-panel hr,
.row-action-menu-panel .menu-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.smart-workflow-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.smart-workflow-action-btn.is-approve {
  color: white;
  background: var(--success, #15803d);
  border-color: var(--success, #15803d);
}

.smart-workflow-action-btn.is-approve:hover {
  filter: brightness(0.92);
  border-color: var(--success, #15803d);
}

.smart-workflow-action-btn.is-warning {
  color: #7c2d12;
  background: #fef3c7;
  border-color: #f59e0b;
}

.smart-workflow-action-btn.is-warning:hover {
  background: #fde68a;
  border-color: #d97706;
}

.smart-workflow-action-btn .smart-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  margin-left: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  background: var(--surface-soft);
}

.badge.active,
.badge.success {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
}

.badge.inactive,
.badge.danger {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
}

.status-badge {
  white-space: nowrap;
}

.status-assessment-pending,
.status-pending-hq-approval {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 13%, var(--surface));
}

.status-pending-approval,
.status-pending-branch-approval,
.status-pending-membership-fee {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

.status-pending-region-approval,
.status-pending-hq-approval {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

.status-approved,
.status-active {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 13%, var(--surface));
}

.status-inactive {
  color: var(--status-gray);
  background: color-mix(in srgb, var(--status-gray) 13%, var(--surface));
}

.status-rejected {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 13%, var(--surface));
}

.status-withdrawn,
.status-dormant,
.status-unknown {
  color: var(--status-gray);
  background: color-mix(in srgb, var(--status-gray) 13%, var(--surface));
}

.status-pending-region-approval {
  color: var(--status-purple);
  background: color-mix(in srgb, var(--status-purple) 13%, var(--surface));
}

.status-onboarding-in-progress {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 13%, var(--surface));
}

.status-in-progress {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 13%, var(--surface));
}

.status-onboarding-submitted {
  color: var(--status-teal);
  background: color-mix(in srgb, var(--status-teal) 13%, var(--surface));
}

.status-returned-for-correction {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 16%, var(--surface));
}

.status-rejected,
.status-blacklisted {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 16%, var(--surface));
}

.status-unresolved {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 15%, var(--surface));
}

.status-unallocated {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 14%, var(--surface));
}

.status-partially-allocated {
  color: var(--status-purple);
  background: color-mix(in srgb, var(--status-purple) 14%, var(--surface));
}

.status-allocated {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 14%, var(--surface));
}

.status-outstanding {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 15%, var(--surface));
}

.status-partially-paid {
  color: var(--status-purple);
  background: color-mix(in srgb, var(--status-purple) 14%, var(--surface));
}

.status-settled {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 14%, var(--surface));
}

.status-void {
  color: var(--status-gray);
  background: color-mix(in srgb, var(--status-gray) 14%, var(--surface));
}

.status-not-assessed {
  color: var(--muted);
  background: var(--surface-soft);
}

.loan-status-pending-branch-approval {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

.loan-status-pending-region-approval {
  color: var(--status-purple);
  background: color-mix(in srgb, var(--status-purple) 14%, var(--surface));
}

.loan-status-pending-hq-approval {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 14%, var(--surface));
}

.loan-status-approved {
  color: var(--status-teal);
  background: color-mix(in srgb, var(--status-teal) 14%, var(--surface));
}

.loan-status-disbursed {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 14%, var(--surface));
}

.loan-status-active {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 14%, var(--surface));
}

.loan-status-settled {
  color: var(--status-gray);
  background: color-mix(in srgb, var(--status-gray) 14%, var(--surface));
}

.loan-status-defaulted {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 14%, var(--surface));
}

.loan-status-rejected {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 18%, var(--surface));
}

.loan-status-withdrawn {
  color: var(--status-gray);
  background: color-mix(in srgb, var(--status-gray) 14%, var(--surface));
}

.loan-application-status-submitted {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

.loan-application-status-matched {
  color: var(--status-purple);
  background: color-mix(in srgb, var(--status-purple) 14%, var(--surface));
}

.loan-application-status-used {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 14%, var(--surface));
}

.loan-application-status-withdrawn {
  color: var(--status-gray);
  background: color-mix(in srgb, var(--status-gray) 14%, var(--surface));
}

.loan-application-status-rejected {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 14%, var(--surface));
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 9px 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.pagination-count {
  margin-right: auto;
}

.pagination-page-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-page-size select {
  min-height: 28px;
  padding: 3px 6px;
}

.loading-state {
  padding: 26px 14px;
  color: var(--muted);
  text-align: center;
}

.loading-state {
  display: grid;
  min-height: 158px;
  align-content: center;
  justify-items: center;
  gap: 9px;
}

.loading-state.compact {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 7px;
}

.loading-state.compact .loading-skeleton {
  display: none;
}

.empty-state-card {
  display: grid;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 26px 16px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin-bottom: 3px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
  border-radius: 17px;
  animation: empty-float 3s ease-in-out infinite;
}

.empty-state-icon svg {
  width: 35px;
  height: 35px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.empty-state-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.empty-state-card p {
  max-width: 340px;
  margin: 0 0 5px;
  color: var(--muted);
}

.empty-state-card.compact {
  min-height: 0;
  gap: 4px;
  padding: 10px 6px;
}

.empty-state-card.compact .empty-state-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  animation: none;
}

.empty-state-card.compact .empty-state-icon svg {
  width: 23px;
  height: 23px;
}

.empty-state-card.compact p {
  margin-bottom: 0;
}

.empty-state-row>td {
  padding: 0;
}

.field-empty-state {
  min-width: 0;
  margin-bottom: 11px;
}

.field-empty-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

.load-error-state {
  display: grid;
  min-height: 140px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 20px;
  color: var(--danger);
  text-align: center;
}

.load-error-state span {
  color: var(--muted);
}

.access-denied {
  display: grid;
  min-height: 190px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px 16px;
  color: var(--text);
  text-align: center;
}

.access-denied-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 2px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 18%, var(--border));
  border-radius: 16px;
}

.access-denied-icon svg {
  width: 34px;
  height: 34px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.access-denied h2 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.access-denied p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
}

.record-dialog .access-denied {
  grid-column: 1 / -1;
  min-height: 190px;
}

@keyframes empty-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--primary) 22%, transparent);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.spinner-small {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

.loading-skeleton {
  display: grid;
  width: min(420px, 90%);
  gap: 6px;
  margin-top: 5px;
}

.loading-skeleton i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-soft) 20%, var(--border) 45%, var(--surface-soft) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.loading-skeleton i:nth-child(2) {
  width: 84%;
}

.loading-skeleton i:nth-child(3) {
  width: 68%;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
}

.auth-card {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow);
  z-index: 0;
}

.auth-card h1 {
  margin-bottom: 5px;
}

.auth-card .muted {
  margin-bottom: 19px;
}

.auth-card input {
  background: none;
}

.auth-card select {
  background: none;
}

.auth-link {
  margin: 14px 0 0;
  text-align: center;
}

.status-message {
  margin: 10px 0;
  color: var(--success);
}

.status-message.error {
  color: var(--danger);
}

.password-reset-success {
  padding-top: 8px;
  text-align: center;
}

.password-reset-success h1 {
  margin-bottom: 8px;
}

.password-reset-success .auth-link {
  margin-top: 18px;
}

label {
  display: grid;
  gap: 5px;
  margin-bottom: 11px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 31px;
  padding: 6px 8px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

input[type="checkbox"] {
  width: 14px;
  min-height: 14px;
  accent-color: var(--primary);
}

textarea {
  min-height: 68px;
  resize: vertical;
}

.full {
  width: 100%;
}

.error {
  color: var(--danger);
}

.record-dialog {
  width: min(580px, calc(100vw - 24px));
  max-height: min(88vh, 720px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.lead-record-dialog {
  width: min(820px, calc(100vw - 24px));
  max-height: min(90vh, 860px);
  overflow: auto;
}

.lead-record-dialog>#lead-dialog-content>.reference-panel,
.lead-record-dialog>.lead-dialog-content>.reference-panel {
  margin: 0;
  border: 0;
}

.lead-detail-view {
  padding: 16px;
}

.lead-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.lead-detail-heading h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.lead-detail-section {
  padding-top: 12px;
}

.lead-detail-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.lead-detail-grid>div {
  min-width: 0;
}

.lead-detail-grid dt {
  color: var(--muted);
  font-size: 10px;
}

.lead-detail-grid dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.lead-detail-wide {
  grid-column: 1 / -1;
}

.lead-detail-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

.lead-record-dialog .lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.lead-record-dialog .lead-form-grid[hidden],
.lead-record-dialog [hidden] {
  display: none !important;
}

.lead-type-selector {
  margin-bottom: 12px;
  background: var(--surface-soft);
}

.lead-type-selector.has-error {
  border-color: var(--danger);
}

.lead-type-choice {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}

.lead-type-choice:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.lead-field-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
}

.lead-record-dialog .lead-form-wide {
  grid-column: 1 / -1;
}

.lead-picker-field {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.lead-picker-field label {
  margin: 0;
}

.lead-picker-field input[type="search"] {
  width: 100%;
}

@media (max-width: 620px) {

  .lead-record-dialog .lead-form-grid,
  .lead-detail-grid {
    grid-template-columns: 1fr;
  }

  .lead-record-dialog .lead-form-wide,
  .lead-detail-wide {
    grid-column: auto;
  }
}

.record-dialog::backdrop {
  background: rgb(7 15 27 / 48%);
}

.record-dialog form {
  padding: 18px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--border);
}

.form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
  padding: 13px 0 4px;
}

.form-fields>.full-width,
.form-fields>.row-actions {
  grid-column: 1 / -1;
}

.form-managed-status {
  grid-column: 1 / -1;
  margin: 0 0 10px;
  padding: 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 4px;
}

.form-loading {
  display: grid;
  min-height: 190px;
  align-content: center;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
}

.form-fields label:has(textarea),
.form-fields label.full-width {
  grid-column: 1 / -1;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-weight: 500;
}

.checkbox-list {
  min-width: 0;
  margin: 0 0 11px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.checkbox-list legend {
  padding: 0 4px;
  font-weight: 600;
}

.checkbox-list-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 2px 10px;
  max-height: 170px;
  overflow: auto;
}

.checkbox-list-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 4px;
  border-radius: 4px;
  font-weight: 400;
}

.checkbox-list-option:hover {
  background: var(--surface-soft);
}

.checkbox-list-option input {
  flex: 0 0 14px;
}

.checkbox-list-option span {
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.product-editor-card {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
}

#product-type-form,
.product-identity-grid,
.product-policy-editor {
  min-width: 0;
  max-width: 100%;
}

.product-identity-grid>*,
.product-settings-grid>*,
.product-policy-editor .product-policy-fields>*,
.product-affordability-grid>* {
  min-width: 0;
  max-width: 100%;
}

.product-editor-card>.page-heading>div {
  min-width: 0;
}

.product-identity-grid,
.product-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.product-identity-grid label,
.product-settings-grid label {
  min-width: 0;
}

.product-wide {
  grid-column: 1 / -1;
}

.product-policy-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.product-policy-editor h3 {
  margin: 0;
  font-size: 13px;
}

.product-policy-editor .product-policy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.product-policy-editor .penalty-charge-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.product-policy-editor .penalty-charge-fields label {
  min-width: 0;
}

.product-affordability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.product-affordability-factor {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.product-affordability-factor label {
  min-width: 0;
}

.product-affordability-factor [data-affordability-enabled] {
  width: auto;
}

.product-policy-editor [data-affordability-type-factor] input[type="checkbox"] {
  width: auto;
}

.product-policy-editor [data-pledged-asset-type] input[type="checkbox"] {
  width: auto;
}

.pledged-asset-category-name {
  display: block;
  margin-bottom: 5px;
}

.pledged-asset-field-options {
  display: grid;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.pledged-asset-field-heading,
.pledged-asset-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
}

.pledged-asset-field-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
}

.pledged-asset-field-heading span:first-child,
.pledged-asset-field-row>span {
  text-align: left;
}

.pledged-asset-field-row {
  min-height: 28px;
  border-top: 1px solid var(--border);
}

.pledged-asset-field-row:hover {
  background: var(--surface-soft);
}

.pledged-asset-field-row input[type="checkbox"] {
  justify-self: center;
  width: 14px;
  min-height: 14px;
  margin: 0;
}

.pledged-asset-field-row>span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pledged-asset-guidance {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.pledged-asset-guidance summary {
  width: fit-content;
  cursor: pointer;
}

.pledged-asset-guidance p {
  margin: 3px 0 0;
}

.product-affordability-factor [data-pledged-asset-enabled] {
  width: auto;
}

.reassessment-trigger {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 8px;
  margin-block: 7px;
}

.reassessment-trigger label {
  min-width: 0;
}

.product-policy-editor table input,
.product-policy-editor table select {
  min-width: 100px;
  width: 100%;
}

.product-policy-editor .row-actions {
  justify-content: flex-start;
  padding: 6px 0;
}

.product-policy-editor [hidden],
.product-charge-definitions [hidden] {
  display: none !important;
}

.product-charge-definitions {
  display: grid;
  gap: 8px;
}

.product-charge-definitions>[data-charge-definitions] {
  display: grid;
  gap: 8px;
}

.product-charge-definitions [data-charge-definition] {
  margin: 0;
}

.product-charge-definitions [data-charge-definition]>.checkbox-list {
  margin-top: 7px;
}

.product-charge-definitions [data-charge-definition]>.checkbox-list legend {
  text-transform: capitalize;
}

.product-charge-list {
  display: grid;
  gap: 9px;
}

.product-charge-list h3 code {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
}

.product-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 5px;
}

.product-rules-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
}

.product-rules-table {
  min-width: 880px;
}

.product-rules-table th {
  position: static;
}

.product-rules-table .product-category-row th {
  position: static;
  padding: 6px 9px;
  color: var(--primary);
  background: var(--surface-soft);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.product-setting-description {
  display: block;
  margin-top: 2px;
  font-weight: 400;
}

.product-rule-bounds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 5px;
}

.product-guidance {
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.product-form-error {
  margin: 0;
}

.scope-view-options {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 4px;
  border: 0;
}

.scope-view-global {
  display: flex;
  justify-content: flex-start;
}

.scope-view-global .button[aria-pressed="true"] {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--surface-soft);
}

.scope-view-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.scope-view-level {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
}

.scope-view-level .searchable-select {
  color: var(--text);
}

.scope-view-level .searchable-trigger {
  width: 100%;
}

.customer-type-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}

.customer-type-choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--surface-soft);
}

.customer-type-choice input {
  width: 14px;
  min-height: 14px;
}

.toast-region {
  position: fixed;
  z-index: 2147483647;
  inset: auto;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  width: min(400px, calc(100vw - 28px));
  gap: 8px;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: inherit;
  background: transparent;
  border: 0;
  pointer-events: none;
}

.toast-region[popover]:not(:popover-open) {
  display: none;
}

.toast {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: 9px;
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toast-enter .18s ease-out both;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: white;
  background: var(--success);
  border-radius: 50%;
  font-weight: 700;
}

.toast.error .toast-icon {
  background: var(--danger);
}

.toast-message {
  overflow-wrap: anywhere;
}

.toast-dismiss {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 18px;
  cursor: pointer;
}

.toast-dismiss:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.toast-leaving {
  opacity: 0;
  transform: translateX(12px);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateX(12px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Operations overview grid */
.ops-grid {
  margin-bottom: 16px;
}

.ops-grid>.page-heading {
  margin-bottom: 12px;
}

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

.ops-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ops-card {
  position: relative;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 4px solid var(--border);
}

.ops-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ops-card-heading {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.ops-card-header .ops-card-heading {
  margin-bottom: 0;
}

.ops-card-header .status-badge {
  font-size: 10px;
  padding: 2px 6px;
}

.ops-card-subheading {
  margin: 10px 0 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ops-accent-teal {
  border-left-color: var(--status-teal);
}

.ops-accent-blue {
  border-left-color: var(--status-blue);
}

.ops-accent-amber {
  border-left-color: var(--status-amber);
}

.ops-accent-purple {
  border-left-color: var(--status-purple);
}

.ops-accent-red {
  border-left-color: var(--status-red);
}

.ops-card .lead-queue-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}

.ops-card .loan-status-grid {
  margin-bottom: 0;
}

.ops-card .lead-queue-card {
  padding: 8px 9px;
}

.ops-card .lead-queue-card h2 {
  margin-bottom: 5px;
  font-size: 9px;
}

.ops-card .lead-queue-count strong {
  font-size: 17px;
}

.ops-card-action {
  font-size: 11px;
  padding: 2px 8px;
  min-height: 24px;
}

.lead-dashboard-heading {
  margin-bottom: 10px;
}

.lead-dashboard-heading h1,
.lead-analytics-heading h1 {
  margin: 0;
}

.lead-queue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lead-queue-card {
  min-width: 0;
  padding: 10px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.lead-queue-card h2 {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.lead-queue-counts {
  display: flex;
  gap: 7px;
}

.lead-queue-count {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  color: var(--text);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.lead-queue-count:hover strong {
  color: var(--primary);
}

.lead-queue-count strong {
  font-size: 19px;
  line-height: 1.1;
}

.lead-queue-count span {
  color: var(--muted);
  font-size: 10px;
}

.customer-workflow-queue-counts {
  justify-content: flex-start;
  gap: 16px;
}

.customer-workflow-queue-type {
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 2px;
}

.customer-workflow-queue-count {
  align-items: center;
  gap: 5px;
}

.customer-workflow-queue-count span {
  min-width: 52px;
}

.customer-workflow-queue-member-link {
  padding: 0;
  color: var(--status-blue);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 9px;
}

.customer-workflow-queue-member-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.loan-status-grid {
  margin-bottom: 10px;
}

.loan-status-counts {
  flex-wrap: wrap;
  gap: 10px;
}

.loan-status-count {
  align-items: center;
  gap: 4px;
}

.loan-performance {
  display: grid;
  gap: 9px;
  margin-bottom: 16px;
}

.loan-performance-heading {
  margin-bottom: 0;
}

.loan-metric-trigger,
.loan-default-trigger,
.loan-idr-trigger {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.loan-metric-trigger {
  padding: 2px 3px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: inherit;
}

.loan-metric-trigger:hover,
.loan-default-trigger:hover strong,
.loan-idr-trigger:hover .loan-idr-rate {
  text-decoration: underline;
}

.loan-metric-trigger:focus-visible,
.loan-default-trigger:focus-visible,
.loan-idr-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.loan-metric-count {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding-left: 0;
  font-size: 9px;
}

.loan-activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.loan-activity-card,
.loan-default-card,
.loan-idr-card {
  min-width: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.loan-card-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  margin-bottom: 8px;
}

.loan-card-heading h2 {
  margin: 0;
  font-size: 11px;
}

.loan-card-icon {
  display: grid;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  place-items: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 11%, var(--surface));
  border-radius: 5px;
  font-size: 13px;
  font-weight: 750;
}

.loan-card-icon.danger {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 12%, var(--surface));
}

.loan-activity-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.loan-activity-period {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 7px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.loan-activity-period>span,
.loan-activity-period small {
  color: var(--muted);
  font-size: 9px;
}

.loan-activity-period>strong {
  min-width: 0;
  font-size: 10px;
  font-weight: 650;
}

.loan-metric-amounts {
  display: grid;
  gap: 2px;
  overflow-wrap: anywhere;
}

.loan-default-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.loan-default-counts>button {
  display: grid;
  gap: 5px;
  padding: 8px 6px;
  color: var(--text);
  background: var(--surface-soft);
  border: 0;
  border-radius: 5px;
  text-align: left;
}

.loan-default-counts span {
  color: var(--muted);
  font-size: 9px;
}

.loan-default-counts strong {
  font-size: 17px;
  line-height: 1.1;
}

.loan-dashboard-section {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.loan-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.loan-section-heading h2 {
  margin: 0;
  font-size: 12px;
}

.loan-section-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.loan-due-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.loan-due-card {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.loan-due-card:nth-child(1) {
  border-top: 2px solid var(--status-blue);
}

.loan-due-card:nth-child(2) {
  border-top: 2px solid var(--status-amber);
}

.loan-due-card:nth-child(3) {
  border-top: 2px solid var(--status-red);
}

.loan-due-card>span:first-child {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.loan-due-count {
  display: block;
  width: fit-content;
  padding: 1px 0;
  color: var(--text);
}

.loan-due-count strong {
  font-size: 18px;
  line-height: 1.1;
}

.loan-due-card>strong small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.loan-due-card .loan-metric-amounts {
  color: var(--muted);
  font-size: 10px;
}

.loan-idr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.loan-idr-card>.loan-card-heading {
  justify-content: space-between;
}

.loan-idr-currency {
  display: grid;
  gap: 6px;
  padding: 7px 0;
  border-top: 1px solid var(--border);
}

.loan-idr-trigger {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
}

.loan-idr-topline,
.loan-idr-amounts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.loan-idr-topline {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.loan-idr-rate {
  font-size: 19px;
  line-height: 1;
}

.loan-idr-rate.good {
  color: var(--status-green);
}

.loan-idr-rate.warning {
  color: var(--status-amber);
}

.loan-idr-rate.danger {
  color: var(--status-red);
}

.loan-idr-meter {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  appearance: none;
  background: var(--surface-soft);
  border: 0;
  border-radius: 999px;
}

.loan-idr-meter::-webkit-progress-bar {
  background: var(--surface-soft);
  border-radius: 999px;
}

.loan-idr-meter.good::-webkit-progress-value {
  background: var(--status-green);
  border-radius: 999px;
}

.loan-idr-meter.warning::-webkit-progress-value {
  background: var(--status-amber);
  border-radius: 999px;
}

.loan-idr-meter.danger::-webkit-progress-value {
  background: var(--status-red);
  border-radius: 999px;
}

.loan-idr-meter.good::-moz-progress-bar {
  background: var(--status-green);
  border-radius: 999px;
}

.loan-idr-meter.warning::-moz-progress-bar {
  background: var(--status-amber);
  border-radius: 999px;
}

.loan-idr-meter.danger::-moz-progress-bar {
  background: var(--status-red);
  border-radius: 999px;
}

.loan-idr-amounts {
  color: var(--muted);
  font-size: 9px;
}

.loan-idr-amounts strong {
  color: var(--text);
  font-weight: 650;
}

.loan-idr-currency>small {
  color: var(--muted);
  font-size: 9px;
}

.loan-idr-empty,
.loan-dashboard-note {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.loan-dashboard-note {
  padding: 7px 9px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.loan-idr-settings-help {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 10px;
}

.loan-idr-settings-help strong {
  color: var(--text);
  font-size: 11px;
}

.loan-idr-settings-toolbar {
  margin-bottom: 8px;
  padding: 8px;
}

.loan-idr-settings-toolbar label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.loan-idr-settings-toolbar select {
  min-height: 30px;
  padding: 4px 7px;
}

.loan-idr-settings-table {
  min-width: 700px;
}

.loan-idr-settings-table td {
  vertical-align: middle;
}

.loan-idr-setting-threshold {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loan-idr-setting-threshold input {
  width: 82px;
  min-height: 28px;
  padding: 3px 6px;
}

.loan-idr-setting-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.loan-idr-setting-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--primary);
}

.loan-idr-settings-heading {
  align-items: end;
  gap: 10px;
}

.loan-idr-lock-rollups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0;
}

.loan-idr-lock-rollup {
  display: grid;
  gap: 5px;
  padding: 8px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.loan-idr-lock-rollup h3 {
  margin: 0;
  font-size: 10px;
}

.loan-idr-lock-rollup p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.loan-idr-lock-table {
  min-width: 640px;
}

.loan-idr-lock-status {
  min-width: 0;
}

.loan-idr-lock-summary {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-green);
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.loan-idr-lock-summary.is-locked {
  border-left-color: var(--status-red);
}

.loan-idr-lock-summary:hover {
  background: var(--surface-soft);
}

.loan-idr-lock-summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.loan-idr-lock-summary-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 12%, transparent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 750;
}

.loan-idr-lock-summary.is-locked .loan-idr-lock-summary-icon {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 12%, transparent);
}

.loan-idr-lock-summary-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.loan-idr-lock-summary-copy strong {
  font-size: 10px;
  line-height: 1.2;
}

.loan-idr-lock-summary-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loan-idr-lock-summary-action {
  margin-left: auto;
  color: var(--primary);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.loan-idr-lock-dialog {
  width: min(940px, calc(100vw - 24px));
}

.loan-idr-lock-table td {
  vertical-align: middle;
}

.loan-idr-lock-state {
  display: inline-flex;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  white-space: nowrap;
}

.loan-idr-lock-state.is-locked {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 12%, transparent);
}

.loan-idr-lock-state.is-open {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 12%, transparent);
}

.loan-idr-lock-state.is-muted {
  color: var(--muted);
  background: var(--surface-soft);
}

.loan-idr-lock-period-note {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 9px;
}

.loan-breakdown-dialog {
  width: min(940px, calc(100vw - 24px));
}

.loan-breakdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.loan-breakdown-toolbar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.loan-breakdown-toolbar-wrap .loan-breakdown-toolbar {
  margin: 0;
}

.loan-breakdown-toggle-all-btn {
  font-size: 11px;
  padding: 4px 10px;
}

.loan-breakdown-table {
  min-width: 650px;
}

.loan-breakdown-table.is-idr {
  min-width: 820px;
}

.loan-breakdown-table td {
  vertical-align: middle;
}

.loan-breakdown-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.loan-breakdown-table th.numeric {
  text-align: right;
}

.loan-breakdown-table .rate-col {
  text-align: center;
}

.loan-breakdown-unsettled {
  color: var(--status-red);
  font-weight: 650;
}

.loan-breakdown-parent-row {
  cursor: pointer;
  user-select: none;
}

.loan-breakdown-parent-row td {
  background: var(--surface);
  transition: background-color 0.15s ease;
}

.loan-breakdown-parent-row:hover td {
  background: color-mix(in srgb, var(--surface-soft) 85%, var(--surface)) !important;
}

.loan-breakdown-parent-row.is-expanded td {
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.loan-breakdown-parent-row.is-expanded:hover td {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface)) !important;
}

.loan-breakdown-org-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.loan-breakdown-toggle-btn {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.loan-breakdown-toggle-btn:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--surface-soft);
}

.loan-breakdown-toggle-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.18s ease;
}

.loan-breakdown-parent-row.is-expanded .loan-breakdown-toggle-icon,
.loan-breakdown-toggle-btn[aria-expanded="true"] .loan-breakdown-toggle-icon {
  transform: rotate(90deg);
}

.loan-breakdown-child-row {
  display: none;
}

.loan-breakdown-child-row.is-open:not([hidden]) {
  display: table-row;
}

.loan-breakdown-child-row td {
  background: color-mix(in srgb, var(--surface-soft) 45%, var(--surface));
  font-size: 0.95em;
  transition: background-color 0.15s ease;
}

.loan-breakdown-child-row:hover td {
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--surface)) !important;
}

.loan-breakdown-child-indent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 22px;
}

.loan-breakdown-branch-marker {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  opacity: 0.7;
}

.loan-breakdown-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
}

.loan-breakdown-type-pill.cumulative {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  color: var(--primary);
  font-weight: 600;
}

.loan-breakdown-type-pill.individual {
  background: color-mix(in srgb, var(--status-blue, #2563eb) 8%, var(--surface));
  border-color: color-mix(in srgb, var(--status-blue, #2563eb) 25%, var(--border));
  color: var(--status-blue, #2563eb);
}

.loan-breakdown-type-pill.group_member {
  background: color-mix(in srgb, #8b5cf6 8%, var(--surface));
  border-color: color-mix(in srgb, #8b5cf6 25%, var(--border));
  color: #8b5cf6;
}

.loan-idr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
}

.loan-idr-badge.good {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--status-green) 26%, var(--border));
}

.loan-idr-badge.warning {
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--status-amber) 30%, var(--border));
}

.loan-idr-badge.danger {
  color: var(--status-red);
  background: color-mix(in srgb, var(--status-red) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--status-red) 30%, var(--border));
}

.loan-breakdown-table .button {
  min-height: 26px;
  padding: 3px 7px;
}

.loan-dashboard-filter-note {
  flex: 1 1 100%;
  margin: 0;
  padding: 6px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 4px;
  font-size: 10px;
}

.loan-report-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
}

.loan-report-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.loan-report-filters label.loan-filter-search {
  flex: 1.5 1 200px;
  min-width: 180px;
  max-width: 340px;
}

.loan-report-filters select,
.loan-report-filters input {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.loan-report-filters .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.loan-report-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.link-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.link-button:hover {
  text-decoration: underline;
}

.loan-report-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.loan-report-table-wrap {
  max-height: min(68vh, 640px);
  overscroll-behavior: contain;
}

.loan-report-table {
  min-width: 1180px;
}

.lead-analytics-heading {
  align-items: end;
  gap: 12px;
  margin-bottom: 10px;
}

.lead-analytics-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
}

.lead-analytics-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 110px;
  max-width: 220px;
}

.lead-analytics-filters select,
.lead-analytics-filters input {
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.lead-analytics-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.lead-analytics-filters [data-custom-date][hidden] {
  display: none;
}

.lead-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.lead-metric-card {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.lead-metric-card>span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.lead-metric-card>strong {
  font-size: 22px;
  line-height: 1.15;
}

.lead-metric-card small {
  color: var(--muted);
  font-size: 10px;
}

.lead-metric-card small .positive {
  color: var(--success);
}

.lead-metric-card small .negative {
  color: var(--danger);
}

.lead-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 8px;
}

.lead-analytics-panel {
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.lead-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.lead-panel-heading h2 {
  margin: 0;
  font-size: 11px;
}

.lead-chart-legend {
  display: flex;
  gap: 12px;
  margin: 0 0 3px 3px;
  color: var(--muted);
  font-size: 10px;
}

.lead-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lead-chart-legend i {
  width: 13px;
  border-top: 2px solid var(--primary);
}

.lead-chart-legend i.approved-line {
  border-color: var(--success);
}

.lead-trend-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.lead-trend-chart text {
  fill: var(--muted);
  font: 9px var(--font);
}

.chart-grid-line {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-total-line,
.chart-approved-line {
  fill: none;
  stroke: var(--primary);
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.chart-approved-line {
  stroke: var(--success);
}

.lead-chart-empty {
  display: grid;
  min-height: 112px;
  place-items: center;
  color: var(--muted);
}

.lead-funnel,
.lead-status-list,
.lead-source-metrics {
  display: grid;
  gap: 8px;
}

.lead-funnel-row>div:first-child,
.lead-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.lead-funnel-row>div:first-child {
  margin-bottom: 4px;
}

.lead-funnel-row span,
.lead-status-row>span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-funnel-row strong,
.lead-status-row strong {
  text-align: right;
}

.lead-progress {
  display: block;
  width: 100%;
  height: 6px;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
}

.lead-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--surface-soft);
}

.lead-progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--primary);
}

.lead-progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--primary);
}

.lead-funnel-row:nth-child(2) .lead-progress::-webkit-progress-value {
  background: #8295e8;
}

.lead-funnel-row:nth-child(2) .lead-progress::-moz-progress-bar {
  background: #8295e8;
}

.lead-funnel-row:nth-child(3) .lead-progress::-webkit-progress-value {
  background: var(--success);
}

.lead-funnel-row:nth-child(3) .lead-progress::-moz-progress-bar {
  background: var(--success);
}

.lead-status-row {
  grid-template-columns: minmax(110px, 1fr) minmax(50px, 1.4fr) 28px;
  gap: 7px;
}

.lead-status-row:nth-child(2n) .lead-progress::-webkit-progress-value {
  background: var(--success);
}

.lead-status-row:nth-child(2n) .lead-progress::-moz-progress-bar {
  background: var(--success);
}

.lead-source-metric {
  display: grid;
  grid-template-columns: minmax(75px, 1fr) minmax(50px, 1.4fr) 28px auto;
  align-items: center;
  gap: 7px;
  padding: 0;
  color: var(--text);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.lead-source-metric:hover .lead-source-name {
  color: var(--primary);
}

.lead-source-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-source-progress::-webkit-progress-value {
  background: #8295e8;
}

.lead-source-progress::-moz-progress-bar {
  background: #8295e8;
}

.lead-source-metric small {
  color: var(--muted);
  white-space: nowrap;
}

.lead-detail-panel {
  grid-column: 1 / -1;
}

.lead-performance-table {
  white-space: normal;
}

.lead-performance-table th,
.lead-performance-table td {
  padding: 6px 8px;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 740px) {
  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0;
    width: 56px;
    flex-basis: 56px;
    transition: width .18s;
  }

  .main-area {
    width: calc(100% - 56px);
    margin-left: 56px;
  }

  .sidebar .brand-name,
  .sidebar .nav-label,
  .sidebar .nav-chevron,
  .sidebar .nav-children {
    display: none;
  }

  .sidebar .nav-link {
    justify-content: center;
    padding-inline: 4px;
  }

  .sidebar.mobile-expanded {
    width: 216px;
  }

  .sidebar.mobile-expanded .brand-name,
  .sidebar.mobile-expanded .nav-label,
  .sidebar.mobile-expanded .nav-chevron {
    display: initial;
  }

  .sidebar.mobile-expanded .nav-children {
    display: block;
  }

  .sidebar.mobile-expanded .nav-children[hidden] {
    display: none;
  }

  .sidebar.mobile-expanded .nav-link {
    justify-content: flex-start;
    padding-inline: 9px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 5px;
    padding-inline: 10px;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-quick-type-actions {
    flex-wrap: wrap;
  }

  .topbar-quick-btn {
    min-height: 26px;
    padding: 3px 8px;
  }

  .loan-idr-lock-rollups {
    grid-template-columns: 1fr;
  }

  .breadcrumbs {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .breadcrumbs strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-actions {
    min-width: 0;
    flex: 0 0 auto;
    gap: 5px;
  }

  .scope-view-trigger {
    width: 30px;
    max-width: 30px;
    flex: 0 0 30px;
    justify-content: center;
    padding-inline: 5px;
  }

  .scope-view-trigger span {
    display: none;
  }

  .content {
    padding: 14px 10px;
  }

  .form-fields {
    grid-template-columns: 1fr;
  }

  .product-identity-grid,
  .product-settings-grid {
    grid-template-columns: 1fr;
  }

  .product-policy-editor .product-policy-fields {
    grid-template-columns: 1fr;
  }

  .product-policy-editor .penalty-charge-fields {
    grid-template-columns: 1fr;
  }

  .product-affordability-grid {
    grid-template-columns: 1fr;
  }

  .reassessment-trigger {
    grid-template-columns: 1fr;
  }

  .product-wide {
    grid-column: auto;
  }

  .form-fields label:has(textarea) {
    grid-column: auto;
  }

  .toolbar,
  .resource-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ops-grid-columns {
    grid-template-columns: 1fr;
  }

  .resource-toolbar>.button {
    align-self: flex-end;
  }

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

  .lead-analytics-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-analytics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-detail-panel {
    grid-column: auto;
  }

  .loan-activity-grid {
    grid-template-columns: 1fr;
  }

  .loan-due-grid,
  .loan-idr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {

  .loan-report-filters,
  .customer-register-filters,
  .lead-filters,
  .payment-filters,
  .accounting-operation-filters,
  .account-statement-dialog .account-statement-filters,
  .lead-analytics-filters,
  .bum-filters,
  .monthly-kpi-toolbar,
  .filter-form {
    align-items: stretch;
    gap: 6px;
  }

  .loan-report-filters>label,
  .customer-register-filters>label,
  .lead-filters>label,
  .payment-filters>label,
  .accounting-operation-filters>label,
  .account-statement-dialog .account-statement-filters>label,
  .lead-analytics-filters>label,
  .bum-filters>label,
  .monthly-kpi-toolbar>label,
  .filter-form>label {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  .loan-report-filters select,
  .loan-report-filters input,
  .customer-register-filters select,
  .customer-register-filters input,
  .lead-filters select,
  .lead-filters input,
  .payment-filters select,
  .payment-filters input,
  .accounting-operation-filters select,
  .accounting-operation-filters input,
  .account-statement-dialog .account-statement-filters select,
  .account-statement-dialog .account-statement-filters input,
  .lead-analytics-filters select,
  .lead-analytics-filters input,
  .bum-filters select,
  .bum-filters input,
  .monthly-kpi-toolbar select,
  .monthly-kpi-toolbar input,
  .filter-form select,
  .filter-form input,
  .searchable-select,
  .searchable-trigger {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .lead-filter-actions {
    width: 100%;
    display: flex;
    gap: 6px;
  }

  .lead-filter-actions .button,
  .loan-report-filters .button,
  .customer-register-filters .button,
  .payment-filters .button,
  .accounting-operation-filters .button,
  .monthly-kpi-toolbar .button {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 480px) {

  .lead-queue-grid,
  .lead-metric-grid {
    grid-template-columns: 1fr;
  }

  .lead-queue-card {
    padding: 9px;
  }

  .lead-source-metric {
    grid-template-columns: minmax(60px, 1fr) minmax(35px, 1fr) 24px auto;
    gap: 5px;
  }

  .loan-due-grid,
  .loan-idr-grid {
    grid-template-columns: 1fr;
  }

  .loan-activity-period {
    padding: 6px 4px;
  }

  .loan-activity-period>strong {
    font-size: 9px;
  }
}

.individual-onboarding {
  padding: 14px;
}

.individual-onboarding [hidden] {
  display: none !important;
}

.onboarding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.onboarding-heading h2 {
  margin: 0 0 4px;
  font-size: 16px;
}

.onboarding-heading .muted {
  margin: 0;
}

.onboarding-steps {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 9px 0;
}

.onboarding-step {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
}

.onboarding-step span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
}

.onboarding-step.active {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.onboarding-section {
  padding: 8px 0 10px;
}

.onboarding-section h3,
.onboarding-section h4,
.onboarding-income-section h3,
.onboarding-income-section h4 {
  margin: 5px 0 9px;
  font-size: 12px;
}

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

.onboarding-grid>label,
.onboarding-conditional>label,
.onboarding-repeat-row>label {
  min-width: 0;
  font-size: 11px;
}

.onboarding-grid input,
.onboarding-grid select,
.onboarding-grid textarea,
.onboarding-repeat-row input {
  font-size: 12px;
}

.onboarding-wide {
  grid-column: 1 / -1;
}

.onboarding-source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 9px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.onboarding-source-list legend {
  padding: 0 4px;
  font-weight: 600;
}

.onboarding-source-list .communication-toggle {
  margin: 0;
}

.onboarding-income-section {
  margin: 8px 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.onboarding-income-section[hidden],
.onboarding-section[hidden] {
  display: none !important;
}

.onboarding-income-section>.onboarding-grid {
  gap: 0 9px;
}

.onboarding-repeat-list {
  display: grid;
  gap: 7px;
}

.onboarding-repeat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.onboarding-repeat-row legend {
  padding: 0 4px;
  font-weight: 600;
}

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

.onboarding-partner>button {
  justify-self: start;
}

.onboarding-attachment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.onboarding-attachment {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 7px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.onboarding-attachment label {
  margin: 0;
  font-size: 11px;
}

.onboarding-attachment input[type="file"] {
  min-height: auto;
  padding: 3px;
  font-size: 10px;
}

.onboarding-attachment a {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.onboarding-additional-documents {
  display: grid;
  gap: 6px;
  margin-bottom: 7px;
}

.onboarding-additional-row {
  display: grid;
  grid-template-columns: minmax(100px, .6fr) minmax(0, 1fr);
  gap: 6px;
  align-items: end;
}

.onboarding-additional-row>label {
  margin: 0;
  font-size: 11px;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
}

.onboarding-error {
  margin: 8px 0;
  padding: 7px 9px;
  color: var(--danger);
  background: var(--surface-soft);
  border-radius: 4px;
}

.onboarding-error[hidden] {
  display: none !important;
}

.customer-register-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
  padding: 0;
  background: transparent;
  border: 0;
}

.customer-register-group-member {
  display: inline-block;
  max-width: 180px;
  padding: 3px 7px;
  overflow: hidden;
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-blue) 25%, var(--border));
  border-radius: 999px;
  font-size: 10px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.customer-register-filter-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  padding: 5px 8px;
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-blue) 24%, var(--border));
  border-radius: 5px;
  font-size: 11px;
}

.customer-register-filter-notice .button {
  min-height: 24px;
  padding: 3px 7px;
  font-size: 11px;
}

.customer-register-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.customer-register-filters label.customer-filter-search {
  flex: 1.5 1 200px;
  min-width: 180px;
  max-width: 320px;
}

.customer-register-filters input,
.customer-register-filters select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.customer-register-filters .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.customer-register-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.customer-register-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.customer-profile {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
}

.customer-profile-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.customer-profile-photo {
  display: grid;
  flex: 0 0 90px;
  width: 90px;
  height: 90px;
  overflow: hidden;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.customer-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-profile-photo-empty {
  font-size: 11px;
}

.customer-profile-identity {
  min-width: 0;
  flex: 1;
}

.customer-profile-identity h1 {
  margin: 2px 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.customer-profile-identity>p:not(.eyebrow) {
  margin: 2px 0 7px;
  color: var(--muted);
}

.customer-profile-status {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.customer-profile-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.customer-obligation-trigger {
  display: inline-flex;
  min-width: 26px;
  height: 24px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 11px;
}

.customer-obligation-trigger:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.customer-obligations-dialog,
.customer-appraisals-dialog {
  width: min(900px, calc(100vw - 28px));
  max-width: 900px;
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.customer-obligations-dialog::backdrop,
.customer-appraisals-dialog::backdrop {
  background: rgb(10 20 32 / 55%);
}

.customer-profile-transfer-dialog {
  width: min(560px, calc(100vw - 28px));
  max-width: 560px;
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.customer-profile-transfer-dialog::backdrop {
  background: rgb(10 20 32 / 55%);
}

.customer-profile-transfer-dialog .dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: -14px -14px 12px;
  padding: 12px 14px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.customer-profile-transfer-dialog .dialog-header h2 {
  margin: 2px 0;
  font-size: 15px;
}

.customer-profile-transfer-dialog .form-grid {
  margin-bottom: 8px;
}

.customer-transfer-loans-option {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0;
  font-size: 12px;
}

.customer-transfer-feedback {
  min-height: 16px;
  margin: 8px 0;
  color: var(--danger);
  font-size: 11px;
}

.customer-organization-transfer-link {
  padding: 0;
  color: var(--primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.customer-organization-transfer-link:hover {
  text-decoration-style: solid;
}

.customer-obligations-dialog .dialog-header,
.customer-appraisals-dialog .group-finance-card-heading {
  position: sticky;
  top: -14px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: -14px -14px 10px;
  padding: 12px 14px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.customer-obligations-dialog .dialog-header h2,
.customer-appraisals-dialog h2 {
  margin: 2px 0;
  font-size: 15px;
}

.customer-obligations-dialog .dialog-header p {
  margin: 2px 0;
}

.customer-appraisals {
  display: grid;
  gap: 8px;
}

.customer-appraisals-dialog .customer-appraisals {
  padding: 0;
  border: 0;
}

.customer-loan-limits-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: 760px;
  max-height: min(86vh, 820px);
  overflow: auto;
  padding: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.customer-loan-limits-dialog::backdrop {
  background: rgb(10 20 32 / 55%);
}

.customer-loan-limits-dialog .dialog-header {
  position: sticky;
  top: -14px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: -14px -14px 10px;
  padding: 12px 14px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.customer-loan-limits-dialog .dialog-header h2 {
  margin: 2px 0;
  font-size: 15px;
}

.customer-loan-limit-list {
  display: grid;
  gap: 8px;
}

.customer-loan-limit {
  padding: 9px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.customer-loan-limit>header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.customer-loan-limit>header>div {
  display: grid;
  gap: 2px;
}

.customer-loan-limit>header small {
  color: var(--muted);
}

.customer-loan-limit dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 7px;
  margin: 9px 0;
}

.customer-loan-limit dl>div {
  min-width: 0;
}

.customer-loan-limit dt {
  color: var(--muted);
}

.customer-loan-limit dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.customer-loan-limit-approval {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr) auto;
  align-items: end;
  gap: 7px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.customer-loan-limit-approval textarea {
  min-height: 34px;
  resize: vertical;
}

.customer-loan-operations {
  display: grid;
  gap: 9px;
}

.customer-loan-operations .customer-group-roster-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-loan-operations .customer-group-roster-heading h3 {
  margin: 0;
  font-size: 12px;
}

.loan-profile-tabs {
  min-width: 0;
}

.loan-profile-tabs {
  display: grid;
  gap: 8px;
}

.loan-profile-tabs>[role="tabpanel"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.loan-profile-tabs .tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 1px solid var(--border);
}

.loan-profile-tabs .tab-button {
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.loan-profile-tabs .tab-button.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.loan-profile-tabs [hidden] {
  display: none !important;
}

.loan-application-list,
.loan-record-list,
.group-exit-request-panel {
  min-width: 0;
}

.loan-application-list,
.loan-record-list {
  padding: 7px 0;
}

.profile-tab-table-wrap {
  max-height: min(360px, 55vh);
  overscroll-behavior: contain;
}

.profile-table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 10px;
}

.profile-table-pagination-count {
  margin-right: auto;
}

.profile-table-pagination label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-table-pagination select,
.profile-table-pagination .button {
  min-height: 26px;
  padding: 3px 6px;
  font-size: 10px;
}

.profile-table-pagination-page {
  white-space: nowrap;
}

.loan-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.loan-row-actions .button {
  padding: 3px 6px;
  font-size: 10px;
}

.loan-ownership-summary {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}

.loan-workflow-dialog {
  width: min(900px, calc(100vw - 24px));
  max-width: 900px;
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.loan-workflow-dialog::backdrop {
  background: rgb(10 20 32 / 55%);
}

.loan-profile-dialog {
  width: min(1240px, calc(100vw - 24px));
  max-width: 1240px;
  max-height: min(92vh, 1100px);
  overflow: auto;
  padding: 16px;
  color: var(--text);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.loan-profile-dialog::backdrop {
  background: rgb(10 20 32 / 58%);
}

.loan-profile-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.loan-profile-dialog-heading h2 {
  margin: 2px 0;
  font-size: 17px;
}

.loan-profile-dialog-heading p {
  margin: 3px 0;
}

.loan-profile-heading-actions,
.loan-profile-actions,
.loan-profile-section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.loan-profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.loan-profile-summary article {
  display: grid;
  gap: 4px;
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.loan-profile-summary article span {
  color: var(--muted);
  font-size: 11px;
}

.loan-profile-summary article strong {
  font-size: 15px;
}

.loan-profile-section {
  margin-top: 9px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.loan-profile-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.loan-profile-section-heading h3 {
  margin: 0;
}

.loan-profile-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin: 0;
}

.loan-profile-metadata>div {
  min-width: 0;
}

.loan-profile-metadata dt {
  color: var(--muted);
  font-size: 11px;
}

.loan-profile-metadata dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.loan-profile-section pre {
  max-height: 300px;
  overflow: auto;
  padding: 9px;
  background: var(--surface-soft);
  border-radius: 5px;
  font-size: 11px;
  white-space: pre-wrap;
}

.loan-waiver-form {
  display: grid;
  gap: 7px;
}

.loan-waiver-form[hidden] {
  display: none;
}

.loan-waiver-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.loan-waiver-lines {
  display: grid;
  gap: 5px;
  max-height: 360px;
  overflow: auto;
}

.loan-waiver-line {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) minmax(100px, 150px);
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.loan-waiver-line small,
.loan-waiver-history small {
  display: block;
  color: var(--muted);
}

.loan-waiver-line input[type="number"] {
  width: 100%;
}

.loan-waiver-line input:disabled {
  opacity: .6;
}

.loan-waiver-history {
  display: grid;
  gap: 7px;
  padding: 0;
  list-style: none;
}

.loan-waiver-history li {
  padding: 7px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.loan-waiver-approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.loan-terms-snapshot>summary {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.loan-terms-intro {
  margin: 6px 0 9px;
  color: var(--muted);
  font-size: 11px;
}

.loan-terms-product {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.loan-terms-product span {
  color: var(--muted);
}

.loan-terms-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.loan-terms-summary article {
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.loan-terms-summary article span {
  color: var(--muted);
  font-size: 10px;
}

.loan-terms-summary article strong {
  font-size: 13px;
}

.loan-terms-section {
  min-width: 0;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.loan-terms-section h4 {
  margin: 0 0 7px;
  font-size: 12px;
}

.loan-terms-installments {
  margin-top: 7px;
}

.loan-terms-installments>summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 11px;
}

.loan-terms-installments .table-wrap {
  max-height: 260px;
  margin-top: 6px;
}

.loan-terms-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.loan-terms-settings {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
}

.loan-terms-charge-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 7px;
}

.loan-terms-card {
  min-width: 0;
  padding: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.loan-terms-card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 7px;
}

.loan-terms-card .loan-profile-metadata {
  grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
}

.loan-terms-card ul {
  margin: 7px 0 0;
  padding-left: 18px;
}

.loan-terms-card li {
  margin-top: 3px;
}

.loan-profile-history {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.loan-profile-history li {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
}

.loan-profile-history li p {
  flex-basis: 100%;
  margin: 0;
}

.loan-profile-history time {
  color: var(--muted);
}

.loan-profile-disbursement-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: end;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.loan-profile-disbursement-form[hidden] {
  display: none;
}

.loan-profile-disbursement-heading {
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 8px;
}

.loan-profile-disbursement-form form {
  display: contents;
}

.loan-profile-disbursement-form form>p,
.loan-profile-disbursement-form form>button {
  align-self: end;
}

.loan-profile-disbursement-form form>p {
  margin: 5px 0;
}

.loan-profile-disbursement-form small {
  color: var(--muted);
}

.loan-profile-dialog .table-wrap {
  max-height: 420px;
}

.loan-workflow-dialog .dialog-header {
  position: sticky;
  top: -12px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: -12px -12px 9px;
  padding: 10px 12px 7px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.loan-workflow-dialog .dialog-header h2 {
  margin: 2px 0;
  font-size: 14px;
}

.loan-workflow-dialog form {
  display: grid;
  gap: 8px;
}

.group-loan-applications-grid-scroll {
  max-height: min(45vh, 420px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.group-loan-applications-grid {
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
}

.group-loan-applications-grid th,
.group-loan-applications-grid td {
  min-width: 120px;
  padding: 5px;
  vertical-align: top;
}

.group-loan-applications-grid th:first-child,
.group-loan-applications-grid td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 150px;
  background: var(--surface);
}

.group-loan-applications-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
}

.group-loan-applications-grid thead th:first-child {
  z-index: 2;
  background: var(--surface-soft);
}

.group-loan-applications-grid input,
.group-loan-applications-grid select {
  width: 100%;
}

.group-loan-member-controls {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.group-loan-member-controls input,
.group-loan-member-controls select {
  min-width: 0;
}

.group-loan-member-collateral {
  display: block;
  min-width: 110px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}

.group-loan-applicant-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-loan-applicant-name input {
  width: auto;
  flex: 0 0 auto;
}

.group-loan-applications-grid [data-member-product-hint] {
  display: block;
  margin-top: 2px;
  white-space: normal;
}

.loan-workflow-dialog>form>label {
  min-width: 0;
}

.loan-workflow-dialog input,
.loan-workflow-dialog select,
.loan-workflow-dialog textarea {
  min-height: 29px;
  font-size: 11px;
}

.loan-workflow-dialog textarea {
  min-height: 54px;
}

.loan-workflow-dialog [data-target-group-field][hidden] {
  display: none;
}

.loan-workflow-dialog .dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.group-exit-request-panel {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.customer-workflow-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
}

.customer-decision-notice {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--status-amber);
  border-radius: 5px;
}

.customer-decision-notice.is-rejected,
.customer-decision-notice.is-blacklisted {
  border-left-color: var(--status-red);
}

.customer-decision-notice strong {
  color: var(--text);
}

.customer-decision-notice span,
.customer-decision-notice p {
  margin: 0;
  color: var(--muted);
}

.customer-history {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.customer-history li {
  padding-left: 3px;
}

.customer-history li>div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.customer-history p {
  margin: 3px 0 0;
  white-space: pre-wrap;
}

.customer-profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 7px;
}

.customer-profile-summary>div,
.customer-profile-section {
  min-width: 0;
  max-width: 100%;
  padding: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.customer-profile-summary>div {
  display: grid;
  align-content: start;
  gap: 4px;
}

.customer-profile-summary>div>span,
.customer-profile-section dt {
  color: var(--muted);
}

.customer-profile-summary strong {
  overflow-wrap: anywhere;
}

.customer-credit-summary {
  display: grid;
  gap: 8px;
}

.customer-credit-summary>.group-finance-card-heading {
  margin: 0;
}

.profile-credit-section {
  display: grid;
  gap: 7px;
}

.profile-credit-section>h3 {
  margin: 4px 0 0;
  font-size: 12px;
}

.profile-credit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 7px;
}

.profile-credit-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.profile-credit-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 7px;
}

.profile-credit-card-heading>div {
  min-width: 0;
}

.profile-credit-card-heading strong,
.profile-credit-total>strong {
  overflow-wrap: anywhere;
}

.profile-credit-card-heading p {
  margin: 3px 0 0;
}

.profile-credit-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
  gap: 6px;
  margin: 0;
}

.profile-credit-metrics>div {
  min-width: 0;
}

.profile-credit-metrics dt {
  color: var(--muted);
  font-size: 11px;
}

.profile-credit-metrics dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.profile-credit-total {
  border-color: color-mix(in srgb, var(--primary) 36%, var(--border));
}

.profile-credit-application-count {
  font-size: 18px;
  font-weight: 700;
}

.profile-credit-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
}

.receipt-funding-options {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.receipt-funding-options h3 {
  margin: 0;
  font-size: 12px;
}

.receipt-funding-options p {
  margin: 0;
}

.receipt-funding-options select[multiple] {
  min-height: 78px;
}

.receipt-stk-toggle {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.receipt-stk-toggle input {
  width: auto;
}

.receipt-funding-options [data-receipt-stk-fields] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 7px;
}

.receipt-funding-options [data-receipt-stk-fields][hidden] {
  display: none;
}

.customer-group-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: min(230px, 100%);
  padding: 3px 7px;
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-blue) 30%, var(--border));
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
}

.customer-group-link-prefix {
  flex: 0 0 auto;
  font-weight: 650;
}

.customer-group-link-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-group-link:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--status-blue) 17%, var(--surface));
}

.customer-group-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.customer-group-membership {
  color: var(--status-blue);
  background: color-mix(in srgb, var(--status-blue) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-blue) 30%, var(--border));
  font-size: 11px;
}

.customer-individual-membership {
  color: var(--status-green);
  background: color-mix(in srgb, var(--status-green) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-green) 30%, var(--border));
  font-size: 11px;
}

.customer-profile-section h2 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: capitalize;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px 12px;
  margin: 0;
}

.customer-detail-grid>div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-detail-grid dd {
  margin: 2px 0 0;
  white-space: pre-wrap;
}

.customer-detail-list {
  margin: 3px 0 0;
  padding-left: 18px;
}

.customer-nested-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 7px;
}

.customer-nested-card {
  min-width: 0;
  padding: 8px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.customer-nested-card h3 {
  margin: 0 0 7px;
  font-size: 12px;
}

.customer-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.customer-attachment-card {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 6px;
  color: var(--text);
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: zoom-in;
}

.customer-attachment-card img {
  width: 100%;
  height: 105px;
  object-fit: cover;
  border-radius: 3px;
}

.customer-attachment-card span {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.customer-group-members {
  display: grid;
  gap: 6px;
}

.customer-group-members article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.customer-group-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.customer-group-member-individual-fee {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.customer-group-members p {
  margin: 2px 0 0;
}

.customer-group-roster {
  display: grid;
  gap: 8px;
}

.customer-group-roster-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-group-roster-heading h2 {
  margin-bottom: 0;
}

.customer-group-roster-heading .eyebrow {
  margin: 0 0 2px;
}

.customer-group-member-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.customer-group-member-identity>div {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-group-member-avatar {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-weight: 700;
}

.customer-group-member-status {
  margin-top: 4px;
}

.customer-group-member-status .badge {
  white-space: normal;
}

.customer-group-member-fee-progress {
  display: grid;
  justify-items: start;
  gap: 3px;
  margin-top: 4px;
}

.customer-group-member-fee-progress small {
  color: var(--muted);
  font-size: 11px;
}

.customer-profile-group-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.customer-profile-group .customer-group-roster>.muted {
  margin: 0;
}

.group-finance-panel {
  display: grid;
  gap: 8px;
}

.group-payments-section,
.customer-payments-section,
.group-payments-tabs,
.customer-payment-tabs,
[data-group-payments-host],
[data-owner-payments-host],
[data-owner-unallocated-payments-host] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.group-payments-tabs,
.customer-payment-tabs {
  display: grid;
  gap: 8px;
}

.group-payments-tabs>section,
.customer-payment-tabs>section {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.group-payments-tabs .tab-list,
.customer-payment-tabs .tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 1px solid var(--border);
}

.group-payments-tabs .tab-button,
.customer-payment-tabs .tab-button {
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.group-payments-tabs .tab-button.is-active,
.customer-payment-tabs .tab-button.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

.group-payments-tabs [hidden],
.customer-payment-tabs [hidden] {
  display: none !important;
}

.customer-payments-section {
  margin-top: 10px;
}

.owner-wallet-balances {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.owner-wallet-balance {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 10px;
}

.owner-wallet-balance>span {
  color: var(--muted);
}

.owner-wallet-balance>strong {
  font-size: 14px;
}

.wallet-history-trigger {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.wallet-history-trigger>span,
.wallet-history-trigger>small {
  color: var(--muted);
}

.wallet-history-trigger>strong {
  font-size: 14px;
}

.wallet-history-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.wallet-breakdown-card>button {
  justify-self: start;
}

.wallet-breakdown-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  padding: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.wallet-breakdown-dialog::backdrop {
  background: rgb(0 0 0 / 55%);
}

.wallet-breakdown-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wallet-breakdown-heading h2 {
  margin: 0;
}

.wallet-breakdown-heading p {
  margin: 2px 0;
}

.group-member-collateral-summary {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.group-member-collateral-summary h3 {
  margin: 0;
}

.group-collateral-members-table input {
  width: min(100%, 180px);
}

.group-finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.group-finance-card {
  min-width: 0;
  margin: 0;
}

.group-finance-card h3 {
  margin: 0;
  font-size: 13px;
}

.group-finance-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.group-finance-card-heading p {
  margin: 2px 0;
}

.group-upcoming-card {
  display: grid;
  gap: 6px;
}

.group-upcoming-meeting {
  display: grid;
  gap: 4px;
  padding: 10px;
  color: white;
  background: var(--primary);
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.group-upcoming-meeting small {
  color: rgb(255 255 255 / 85%);
}

.group-upcoming-meeting .badge {
  justify-self: start;
  color: var(--text);
}

.group-finance-latest {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
}

.group-finance-latest p {
  flex: 1 1 100%;
  margin: 0;
  white-space: pre-wrap;
}

.group-finance-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(90vh, 850px);
}

.group-meeting-dialog {
  width: min(1100px, calc(100vw - 24px));
}

.group-member-dialog,
.group-exit-dialog {
  width: min(1050px, calc(100vw - 24px));
}

.group-meeting-section,
.group-meeting-inline-form {
  display: grid;
  gap: 6px;
}

.group-meeting-section {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.group-meeting-section h3,
.group-meeting-inline-form h4 {
  margin: 0;
}

.group-meeting-inline-form {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.group-meeting-inline-form>p {
  margin: 0;
}

.group-finance-dialog .dialog-heading {
  position: sticky;
  top: -16px;
  z-index: 1;
  margin: -16px -16px 10px;
  padding: 12px 16px;
  background: var(--surface);
}

.group-finance-dialog .dialog-heading h2 {
  margin: 0;
  font-size: 16px;
}

.group-finance-dialog .dialog-heading p {
  margin: 3px 0 0;
}

.group-meeting-detail-form {
  display: grid !important;
  gap: 10px !important;
}

.group-meeting-detail-form>label {
  display: grid;
  gap: 4px;
}

.group-meeting-detail-form h3 {
  margin: 4px 0 0;
  font-size: 13px;
}

.group-meeting-detail-form .table-wrap {
  max-height: 300px;
  overflow: auto;
}

.group-meeting-exit-form {
  display: grid;
  gap: 8px;
}

.group-meeting-exit-form>label {
  display: grid;
  gap: 4px;
}

.group-exit-request-grid-scroll,
.group-member-addition-grid-scroll {
  max-width: 100%;
  overflow: auto;
}

.group-exit-request-grid,
.group-member-addition-grid {
  table-layout: fixed;
}

.group-exit-request-grid {
  min-width: 940px;
}

.group-exit-request-grid th:nth-child(1),
.group-exit-request-grid td:nth-child(1) {
  width: 270px;
}

.group-exit-request-grid th:nth-child(2),
.group-exit-request-grid td:nth-child(2) {
  width: 180px;
}

.group-exit-request-grid th:nth-child(3),
.group-exit-request-grid td:nth-child(3) {
  width: 150px;
}

.group-exit-request-grid th:nth-child(4),
.group-exit-request-grid td:nth-child(4) {
  width: 240px;
}

.group-exit-request-grid th:nth-child(5),
.group-exit-request-grid td:nth-child(5) {
  width: 100px;
}

.group-member-addition-grid {
  min-width: 990px;
}

.group-member-addition-grid th:nth-child(1),
.group-member-addition-grid td:nth-child(1) {
  width: 140px;
}

.group-member-addition-grid th:nth-child(2),
.group-member-addition-grid td:nth-child(2) {
  width: 300px;
}

.group-member-addition-grid th:nth-child(3),
.group-member-addition-grid td:nth-child(3) {
  width: 150px;
}

.group-member-addition-grid th:nth-child(4),
.group-member-addition-grid td:nth-child(4) {
  width: 140px;
}

.group-member-addition-grid th:nth-child(5),
.group-member-addition-grid td:nth-child(5) {
  width: 160px;
}

.group-member-addition-grid th:nth-child(6),
.group-member-addition-grid td:nth-child(6) {
  width: 100px;
}

.group-exit-request-grid th,
.group-exit-request-grid td,
.group-member-addition-grid th,
.group-member-addition-grid td {
  padding: 5px;
  vertical-align: top;
}

.group-exit-request-grid input,
.group-exit-request-grid select,
.group-exit-request-grid textarea,
.group-member-addition-grid input,
.group-member-addition-grid select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
}

.group-exit-request-grid textarea {
  min-height: 34px;
  resize: vertical;
}

.group-exit-request-grid td:first-child input {
  margin-bottom: 4px;
}

.group-member-addition-form {
  display: grid;
  gap: 8px;
}

.group-member-addition-grid [data-member-mode="proposed"] {
  display: grid;
  gap: 4px;
}

.group-member-addition-grid [data-member-mode="existing"] {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.group-member-addition-grid [data-member-mode="proposed"][hidden],
.group-member-addition-grid [data-member-mode="existing"][hidden] {
  display: none;
}

.group-row-error {
  display: block;
  max-width: 240px;
  margin-top: 4px;
  color: var(--danger);
}

.group-row-error[hidden] {
  display: none;
}

.group-meeting-exit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-meeting-list-item {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 9px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
}

.group-meeting-list-item+.group-meeting-list-item {
  margin-top: 5px;
}

.group-meeting-list-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  white-space: pre-wrap;
}

.group-finance-list {
  display: grid;
  gap: 8px;
}

.group-receipt-dialog {
  width: min(900px, calc(100vw - 24px));
}

.group-receipt-grid-scroll {
  max-height: min(52vh, 500px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.group-receipt-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.group-receipt-grid th,
.group-receipt-grid td {
  min-width: 130px;
  padding: 5px;
  background: var(--surface);
}

.group-receipt-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  vertical-align: top;
}

.group-receipt-grid th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 145px;
  background: var(--surface);
}

.group-receipt-grid thead th:first-child {
  z-index: 4;
  background: var(--surface-soft);
}

.group-receipt-grid tbody th:first-child {
  text-align: left;
}

.group-receipt-grid th small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 400;
}

.group-receipt-grid .group-receipt-cell-details {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.group-receipt-grid input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 6px;
  text-align: right;
}

.group-receipt-grid .group-receipt-guidance-output {
  display: block;
  min-width: 90px;
  min-height: 30px;
  padding: 6px;
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.group-receipt-grid .group-receipt-guidance-output.is-pending {
  color: var(--status-amber);
}

.group-receipt-grid .group-receipt-guidance-output.is-balanced {
  color: var(--success);
}

.group-receipt-grid .group-receipt-guidance-output.is-overallocated {
  color: var(--danger);
}

.group-receipt-grid input:disabled {
  color: var(--muted);
  background: var(--surface-soft);
  cursor: not-allowed;
}

.group-receipt-grid tfoot th,
.group-receipt-grid tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: var(--surface-soft);
  font-weight: 600;
}

.group-receipt-grid tfoot th:first-child {
  z-index: 3;
  background: var(--surface-soft);
}

.group-receipt-grid output {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  box-sizing: border-box;
  text-align: right;
  white-space: nowrap;
}

.group-receipt-total {
  margin: 0;
  text-align: right;
}

.receipt-payment-choices {
  display: grid;
  max-height: 190px;
  gap: 5px;
  overflow: auto;
}

.receipt-payment-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
}

.receipt-payment-choice input {
  width: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.receipt-payment-choice span {
  min-width: 0;
}

.receipt-payment-choice small {
  display: block;
  overflow-wrap: anywhere;
  color: var(--muted);
}

.receipt-payment-balance {
  white-space: nowrap;
  font-weight: 600;
}

.group-membership-fee-progress {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.group-membership-fee-progress-table {
  max-height: 210px;
}

@media (max-width: 700px) {
  .group-finance-summary-grid {
    grid-template-columns: 1fr;
  }

  .group-finance-card-heading {
    align-items: flex-start;
  }

}

.customer-details-dialog,
.customer-image-dialog {
  width: min(920px, calc(100vw - 24px));
  max-width: 920px;
  max-height: min(88vh, 900px);
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.appraisal-dialog [hidden] {
  display: none !important;
}

.customer-details-dialog::backdrop,
.customer-image-dialog::backdrop {
  background: rgb(7 15 27 / 58%);
}

.customer-details-heading,
.customer-image-heading {
  position: sticky;
  top: -12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -12px -12px 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.customer-details-heading h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.customer-details-content {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.customer-image-dialog {
  width: min(1000px, calc(100vw - 24px));
}

.customer-image-dialog>img {
  display: block;
  max-width: 100%;
  max-height: calc(84vh - 60px);
  margin: 0 auto;
  object-fit: contain;
}

.appraisal-settings-layout {
  display: grid;
  gap: 12px;
}

.appraisal-settings-layout>.reference-panel {
  min-width: 0;
}

.appraisal-type-form {
  display: grid;
  gap: 12px;
}

.appraisal-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.appraisal-editor-grid>label,
.appraisal-field {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.appraisal-required-option {
  display: flex !important;
  align-items: center;
  align-self: end;
  gap: 6px !important;
}

.appraisal-product-picker,
.appraisal-step-editor,
.appraisal-field-editor,
.appraisal-step {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.appraisal-product-picker>div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 5px;
}

.appraisal-product-option {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 7px;
  background: var(--surface-soft);
  border-radius: 5px;
}

.appraisal-product-option span,
.appraisal-product-option small {
  display: block;
}

.appraisal-step-editors,
.appraisal-field-editors,
.appraisal-steps {
  display: grid;
  gap: 8px;
}

.appraisal-step-editors {
  margin-bottom: 8px;
}

.appraisal-step-editor-heading,
.appraisal-field-editor-heading,
.customer-appraisal-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.appraisal-step-editor-heading>span,
.appraisal-field-editor-heading>span {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.appraisal-step-editor-heading h3 {
  margin: 0;
  font-size: 13px;
}

.appraisal-options-field {
  grid-column: 1 / -1;
}

.appraisal-field-editor textarea {
  min-height: 62px;
}

.appraisal-dialog {
  width: min(800px, calc(100vw - 24px));
  max-height: min(90vh, 900px);
  padding: 14px;
  overflow: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.appraisal-dialog::backdrop {
  background: rgb(7 15 27 / 58%);
}

.appraisal-dialog form {
  display: grid;
  gap: 10px;
}

.appraisal-dialog .dialog-header {
  position: sticky;
  top: -14px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin: -14px -14px 4px;
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.appraisal-dialog h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.appraisal-step legend {
  padding: 0 5px;
  font-weight: 650;
}

.appraisal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.appraisal-predefined-field {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  min-width: 0;
}

.appraisal-predefined-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-soft);
}

.appraisal-predefined-row .appraisal-field {
  min-width: 0;
}

.reference-picker-wrapper {
  position: relative;
  width: 100%;
}

.reference-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  margin-top: 2px;
}

.reference-picker-item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.9em;
  min-height: 38px;
  justify-content: center;
}

.reference-picker-item:last-child {
  border-bottom: none;
}

.reference-picker-item:hover,
.reference-picker-item:focus,
.reference-picker-item.is-selected {
  background: var(--surface-soft, #f0f4f8);
  color: var(--primary, inherit);
}

.reference-picker-item strong {
  font-weight: 600;
  line-height: 1.2;
}

.reference-picker-item small {
  font-size: 0.8em;
  color: var(--muted);
  margin-top: 2px;
}

.appraisal-predefined-setting {
  display: grid;
  gap: 5px;
}

.appraisal-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.appraisal-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.appraisal-radio-field {
  grid-template-columns: auto auto auto;
  align-items: center;
}

.appraisal-radio-field legend {
  grid-column: 1 / -1;
}

.appraisal-radio-field label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.appraisal-radio-field small {
  grid-column: 1 / -1;
}

.appraisal-field select[multiple] {
  min-height: 90px;
}

.appraisal-boolean {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.appraisal-boolean small {
  grid-column: 2;
}

.customer-appraisals {
  display: grid;
  gap: 8px;
}

.customer-appraisal-option {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.customer-appraisal-option>div:first-child {
  display: grid;
  min-width: 180px;
  flex: 1;
  gap: 3px;
}

.customer-appraisal-history {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
}

.customer-appraisal-history-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.appraisal-detail-dialog {
  width: min(920px, calc(100vw - 24px));
}

.appraisal-detail-dialog .customer-details-heading h2 {
  font-size: 16px;
}

.appraisal-detail-dialog .customer-profile-section h3 {
  margin: 0 0 5px;
  font-size: 13px;
}

.appraisal-detail-rows {
  display: grid;
  gap: 7px;
}

.appraisal-detail-row {
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.appraisal-detail-image {
  width: min(100%, 240px);
}

.appraisal-detail-image img {
  height: auto;
  max-height: 180px;
  object-fit: contain;
}

@media (max-width: 620px) {

  .appraisal-editor-grid,
  .appraisal-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .appraisal-options-field {
    grid-column: auto;
  }

  .customer-appraisal-option>button {
    width: 100%;
  }
}

.group-existing-search {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
  margin-bottom: 9px;
}

.group-existing-search label {
  min-width: 210px;
  flex: 1;
}

.group-existing-search [data-existing-results] {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  width: 100%;
}

.group-member-list {
  display: grid;
  gap: 7px;
  margin: 8px 0;
}

.group-member-card {
  min-width: 0;
  margin: 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.group-member-card legend {
  padding: 0 5px;
  color: var(--muted);
}

.group-member-card[data-kind="existing"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.group-member-card p {
  margin: 2px 0 0;
}

.group-onboarding-pending-leads,
.group-onboarding-approved-members {
  margin-top: 10px;
}

.group-onboarding-leads-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.group-onboarding-leads-heading h4,
.group-onboarding-approved-members h4 {
  margin: 0;
  font-size: 12px;
}

.group-onboarding-lead-controls {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.group-onboarding-lead-controls .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.group-meeting-readiness-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  color: var(--status-amber);
  background: color-mix(in srgb, var(--status-amber) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--status-amber) 35%, var(--border));
  border-radius: 6px;
  font-size: 12px;
}

.group-income-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-income-sources legend {
  width: 100%;
}

@media (max-width: 620px) {

  .individual-onboarding,
  .group-onboarding {
    padding: 10px;
  }

  .onboarding-grid,
  .onboarding-attachment-grid,
  .onboarding-partner {
    grid-template-columns: 1fr;
  }

  .onboarding-wide {
    grid-column: auto;
  }
}

.bum-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 7px;
  margin: 0 0 10px;
}

.bum-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  min-width: 140px;
  max-width: 240px;
  flex: 1 1 150px;
}

.bum-filters input,
.bum-filters select {
  width: 100%;
  min-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.bum-filters .searchable-select {
  width: 100%;
  min-width: 140px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.bum-filters .searchable-trigger {
  width: 100%;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.bum-filters .button {
  min-height: 29px;
  padding: 4px 8px;
  font-size: 12px;
  align-self: end;
}

.bum-date-filter[hidden],
#bum-other-team-wrap[hidden],
#bum-due-date-wrap[hidden] {
  display: none;
}

.bum-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 7px;
  margin: 10px 0;
}

.bum-summary-card {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--bum-summary-tone) 55%, var(--border));
  background: color-mix(in srgb, var(--bum-summary-tone) 12%, var(--surface));
}

.bum-summary-card>span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.bum-summary-card strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.bum-summary--opening {
  --bum-summary-tone: #0066cc;
}

.bum-summary--collections {
  --bum-summary-tone: #28a745;
}

.bum-summary--disbursements {
  --bum-summary-tone: #dc3545;
}

.bum-summary--expenses {
  --bum-summary-tone: #ffc107;
}

.bum-summary--injections {
  --bum-summary-tone: #6c757d;
}

.bum-summary--transfers {
  --bum-summary-tone: #6f42c1;
}

.bum-summary--borrowing {
  --bum-summary-tone: #c864ff;
}

.bum-summary--repayments {
  --bum-summary-tone: #6941c6;
}

.bum-summary--reserves {
  --bum-summary-tone: #17a2b8;
}

.bum-summary--commitments {
  --bum-summary-tone: #b54708;
}

.bum-summary--cash {
  --bum-summary-tone: #0e7490;
}

.bum-summary--available {
  --bum-summary-tone: #3157d5;
}

.bum-policy-note {
  margin: 8px 0;
  color: var(--muted);
}

.bum-table-wrap {
  max-height: min(70vh, 700px);
}

.bum-table {
  min-width: 1780px;
  border-collapse: separate;
  border-spacing: 0;
}

.bum-table thead th {
  position: sticky;
  z-index: 2;
  text-align: center;
}

.bum-table thead .bum-section-headings th {
  top: 0;
}

.bum-table thead .bum-column-headings th {
  top: 32px;
}

.bum-table thead th:first-child,
.bum-table tfoot th:first-child {
  left: 0;
  z-index: 5;
  min-width: 220px;
  text-align: left;
}

.bum-table tbody td:first-child,
.bum-table tbody th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 220px;
}

.bum-table tbody .bum-unit-name {
  background: var(--surface);
}

.bum-table .bum-section-headings th {
  color: #222;
  font-weight: 700;
}

.bum-table .bum-section-scope {
  background: #fbf7d6;
}

.bum-table .bum-col-unit {
  background: rgb(251 250 214 / 68%);
}

.bum-table .bum-section-cash-movements {
  background: #fbe5d6;
}

.bum-table .bum-section-borrowing {
  background: #ff9df7;
}

.bum-table .bum-section-position {
  background: #aed8ff;
}

.bum-table .bum-col-opening {
  background: rgb(174 216 255 / 69%);
}

.bum-table .bum-col-collections {
  background: rgb(142 255 185 / 64%);
}

.bum-table .bum-col-disbursements {
  background: rgb(251 229 214 / 68%);
}

.bum-table .bum-col-expenses {
  background: rgb(255 224 130 / 58%);
}

.bum-table .bum-col-injections {
  background: rgb(217 217 217 / 67%);
}

.bum-table .bum-col-transfers {
  background: rgb(230 220 255 / 72%);
}

.bum-table .bum-col-borrowing {
  background: rgb(255 157 247 / 65%);
}

.bum-table .bum-col-repayments {
  background: rgb(195 181 253 / 56%);
}

.bum-table .bum-col-reserves {
  background: rgb(174 216 255 / 56%);
}

.bum-table .bum-col-cash,
.bum-table .bum-col-available {
  background: rgb(142 232 244 / 62%);
}

.bum-table .bum-col-commitments {
  background: rgb(255 224 130 / 48%);
}

.bum-movements-table-wrap {
  max-height: min(70vh, 700px);
  overscroll-behavior: contain;
}

.bum-movements-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.bum-movements-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
}

.bum-movements-table thead th:first-child,
.bum-movements-table tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 120px;
  background: var(--surface);
}

.bum-movements-table thead th:first-child {
  z-index: 5;
  background: var(--surface-soft);
}

.bum-table tfoot th {
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}

.bum-table .bum-region-divider th {
  left: 0;
  z-index: 3;
  padding: 6px 9px;
  color: var(--text);
  background: var(--surface-soft);
  text-align: left;
}

.bum-table .bum-region-divider th:first-child {
  min-width: 220px;
}

.bum-position-row--region td {
  background: color-mix(in srgb, var(--status-blue) 10%, var(--surface));
  font-weight: 700;
}

.bum-position-row--branch td {
  background: color-mix(in srgb, var(--status-amber) 7%, var(--surface));
  font-weight: 600;
}

.bum-position-row--region .bum-unit-name {
  background: color-mix(in srgb, var(--status-blue) 10%, var(--surface));
}

.bum-position-row--branch .bum-unit-name {
  background: color-mix(in srgb, var(--status-amber) 7%, var(--surface));
}

.bum-position-row--team .bum-unit-name {
  padding-left: 24px;
}

.bum-navigation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.bum-pagination {
  justify-content: flex-end;
}

.bum-pagination>span:first-child {
  margin-right: auto;
}

.bum-inflow {
  color: var(--success, #23844d);
}

.bum-outflow {
  color: var(--danger, #ba3b42);
}

html[data-theme="dark"] .bum-table .bum-section-headings th {
  color: var(--text);
}

html[data-theme="dark"] .bum-table .bum-section-scope {
  background: color-mix(in srgb, var(--status-amber) 25%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-section-cash-movements {
  background: color-mix(in srgb, var(--status-red) 25%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-section-borrowing {
  background: color-mix(in srgb, var(--status-purple) 25%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-section-position {
  background: color-mix(in srgb, var(--status-blue) 25%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-unit {
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-opening,
html[data-theme="dark"] .bum-table .bum-col-reserves {
  background: color-mix(in srgb, var(--status-blue) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-collections {
  background: color-mix(in srgb, var(--success) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-disbursements {
  background: color-mix(in srgb, var(--status-red) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-expenses,
html[data-theme="dark"] .bum-table .bum-col-commitments {
  background: color-mix(in srgb, var(--status-amber) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-injections {
  background: color-mix(in srgb, var(--status-gray) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-transfers,
html[data-theme="dark"] .bum-table .bum-col-repayments,
html[data-theme="dark"] .bum-table .bum-col-borrowing {
  background: color-mix(in srgb, var(--status-purple) 14%, var(--surface));
}

html[data-theme="dark"] .bum-table .bum-col-cash,
html[data-theme="dark"] .bum-table .bum-col-available {
  background: color-mix(in srgb, var(--status-teal) 14%, var(--surface));
}

html[data-theme="dark"] .bum-position-row--region td {
  background: color-mix(in srgb, var(--status-blue) 12%, var(--surface));
}

html[data-theme="dark"] .bum-position-row--branch td {
  background: color-mix(in srgb, var(--status-amber) 9%, var(--surface));
}

html[data-theme="dark"] .bum-position-row--region .bum-unit-name {
  background: color-mix(in srgb, var(--status-blue) 12%, var(--surface));
}

html[data-theme="dark"] .bum-position-row--branch .bum-unit-name {
  background: color-mix(in srgb, var(--status-amber) 9%, var(--surface));
}

.bum-transactions-heading {
  margin-top: 18px;
}

.bum-transactions-heading h2 {
  margin: 0;
  font-size: 15px;
}

.bum-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  width: max-content;
  margin-left: auto;
}

.bum-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bum-dialog::backdrop {
  background: rgb(7 15 27 / 58%);
}

.bum-dialog .dialog-close-row {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 6px 8px 0;
}

.bum-dialog .dialog-body {
  padding: 8px 16px 16px;
}

.bum-dialog h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

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

.bum-dialog .form-grid>label {
  display: grid;
  gap: 4px;
}

.bum-dialog .form-grid-wide {
  grid-column: 1 / -1;
}

.bum-dialog .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 620px) {
  .bum-filters {
    align-items: stretch;
  }

  .bum-filters label {
    min-width: 100%;
  }

  .bum-dialog .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bum-dialog .form-grid-wide {
    grid-column: auto;
  }

  .onboarding-additional-row {
    grid-template-columns: 1fr;
  }

  .onboarding-steps {
    justify-content: flex-start;
  }

  .onboarding-step {
    flex: 0 0 auto;
  }

  .customer-profile-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .customer-profile-photo {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }

  .customer-profile-heading-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .customer-profile-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-profile-heading-actions .customer-workflow-actions {
    justify-content: flex-start;
  }

  .customer-profile-group-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-group-members article {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-group-members article>.button {
    align-self: flex-start;
    max-width: 100%;
    white-space: normal;
  }

  .customer-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-details-dialog,
  .customer-image-dialog {
    padding: 9px;
  }

  .customer-loan-limit-approval {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Support pages reuse the shared tokens while keeping message content readable. */
.support-page {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.support-page-heading {
  align-items: flex-start;
}

.support-page-heading h1 {
  margin: 2px 0;
  overflow-wrap: anywhere;
}

.support-page-heading .muted {
  margin: 3px 0 0;
}

.support-back-button {
  margin-bottom: 5px;
}

.support-toolbar,
.support-detail-meta,
.support-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.support-toolbar {
  justify-content: space-between;
}

.support-toolbar label,
.support-detail-meta label,
.support-compose label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.support-toolbar select,
.support-detail-meta select,
.support-compose input,
.support-compose textarea {
  min-height: 30px;
  padding: 5px 7px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.support-table-wrap {
  max-height: min(65vh, 720px);
}

.support-subject-link {
  padding: 0;
  color: var(--primary);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
}

.support-subject-link:hover {
  text-decoration: underline;
}

.support-compose {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.support-compose h2 {
  margin: 0;
  font-size: 13px;
}

.support-compose input,
.support-compose textarea {
  width: 100%;
}

.support-compose textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.5;
}

.support-form-actions {
  justify-content: flex-end;
}

.support-form-actions .muted {
  margin-right: auto;
}

.support-detail-meta {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.support-messages {
  display: grid;
  gap: 8px;
  max-height: min(55vh, 620px);
  overflow: auto;
  padding: 2px;
}

.support-message {
  justify-self: start;
  width: min(760px, 90%);
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.support-message-own {
  justify-self: end;
  background: var(--surface-soft);
}

.support-message header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
}

.support-message time {
  color: var(--muted);
  font-size: 10px;
}

.support-message p {
  margin: 7px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.support-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.support-message-attachments a {
  display: grid;
  width: min(180px, 42vw);
  gap: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
}

.support-message-attachments img {
  display: block;
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.support-message-attachments span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .notification-panel {
    right: -34px;
    width: min(360px, calc(100vw - 20px));
  }

  .support-page-heading {
    flex-direction: column;
  }

  .support-message {
    width: 96%;
  }
}

.customer-details-decision-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.customer-details-decision-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-details-decision-heading h3 {
  margin: 2px 0 0;
  font-size: 14px;
}

.customer-details-decision-hint {
  margin: 0;
}

.customer-details-reason-field {
  display: grid;
  gap: 5px;
}

.customer-details-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.loan-waiver-approval-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
