/* ==================================================================
   Sri Deepam MLMS — "Stable Horizon" Design System
   Hand-written local CSS translating the Stable Horizon token set
   (see stable_horizon/DESIGN.md in the original UI export) into
   plain CSS custom properties + component classes. No Tailwind, no
   CDN — this file plus icons.svg and fonts.css are the entire visual
   dependency chain, all served locally.

   Organisation:
     1. Design tokens (custom properties)
     2. Reset / base
     3. Typography
     4. Layout (app shell: sidebar, topbar, content)
     5. Buttons
     6. Form fields
     7. Chips / status tags
     8. Cards
     9. Tables
     10. Modal
     11. Toast
     12. Avatar
     13. Utility classes
   ================================================================== */

/* ---------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------- */
:root {
  /* Color: surfaces */
  --color-surface: #f7f9fb;
  --color-surface-dim: #d8dadc;
  --color-surface-bright: #f7f9fb;
  --color-surface-container-lowest: #ffffff;
  --color-surface-container-low: #f2f4f6;
  --color-surface-container: #eceef0;
  --color-surface-container-high: #e6e8ea;
  --color-surface-container-highest: #e0e3e5;
  --color-on-surface: #191c1e;
  --color-on-surface-variant: #444651;
  --color-inverse-surface: #2d3133;
  --color-inverse-on-surface: #eff1f3;
  --color-outline: #757682;
  --color-outline-variant: #c5c5d3;
  --color-surface-border: #e2e8f0;
  --color-form-control-border: #d1d5db;
  --form-control-radius: 6px;

  /* Color: brand */
  --color-primary: #1e3a8a;
  --color-primary-strong: #00236f;
  --color-on-primary: #ffffff;
  --color-primary-container: #1e3a8a;
  --color-on-primary-container: #90a8ff;
  --color-secondary: #3b82f6;
  --color-secondary-strong: #0058be;
  --color-on-secondary: #ffffff;
  --color-secondary-container: #2170e4;
  --color-tertiary: #0f172a;
  --color-on-tertiary: #ffffff;

  /* Color: functional */
  --color-error: #ba1a1a;
  --color-on-error: #ffffff;
  --color-error-container: #ffdad6;
  --color-on-error-container: #93000a;
  --color-success: #10b981;
  --color-success-bg: #d1fae5;
  --color-success-text: #047857;
  --color-warning: #f59e0b;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --color-error-red: #ef4444;
  --color-error-bg: #fee2e2;
  --color-error-text: #b91c1c;
  --color-info: #0ea5e9;
  --color-info-bg: #e0f2fe;
  --color-info-text: #075985;
  --color-neutral-bg: #f1f5f9;
  --color-neutral-text: #475569;

  --color-background: #f8fafc;
  --color-on-background: #191c1e;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  --fs-headline-lg: 32px;
  --lh-headline-lg: 40px;
  --fs-headline-md: 24px;
  --lh-headline-md: 32px;
  --fs-headline-sm: 20px;
  --lh-headline-sm: 28px;
  --fs-body-lg: 16px;
  --lh-body-lg: 24px;
  --fs-body-md: 14px;
  --lh-body-md: 20px;
  --fs-body-sm: 12px;
  --lh-body-sm: 16px;
  --fs-label-md: 13px;
  --lh-label-md: 16px;
  --fs-label-sm: 11px;
  --lh-label-sm: 14px;

  /* Spacing (8px rhythm) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;
  --space-8: 48px;
  --gutter: 24px;
  --container-max: 1440px;

  /* Radius */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;

  /* Elevation */
  --shadow-level2: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.25);

  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* ---------------------------------------------------------------
   2. Reset / base
   --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-on-surface);
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, p { margin: 0; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------
   3. Typography
   --------------------------------------------------------------- */
.text-headline-lg { font-size: var(--fs-headline-lg); line-height: var(--lh-headline-lg); font-weight: 700; letter-spacing: 0; }
.text-headline-md { font-size: var(--fs-headline-md); line-height: var(--lh-headline-md); font-weight: 600; }
.text-headline-sm { font-size: var(--fs-headline-sm); line-height: var(--lh-headline-sm); font-weight: 600; }
.text-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); font-weight: 400; }
.text-body-md { font-size: var(--fs-body-md); line-height: var(--lh-body-md); font-weight: 400; }
.text-body-sm { font-size: var(--fs-body-sm); line-height: var(--lh-body-sm); font-weight: 400; }
.text-label-md { font-family: var(--font-mono); font-size: var(--fs-label-md); line-height: var(--lh-label-md); font-weight: 500; }
.text-label-sm { font-family: var(--font-mono); font-size: var(--fs-label-sm); line-height: var(--lh-label-sm); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.text-muted { color: var(--color-on-surface-variant); }
.text-mono { font-family: var(--font-mono); }

/* ---------------------------------------------------------------
   4. Layout — app shell
   --------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--color-surface-container-lowest);
  border-right: 1px solid var(--color-surface-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}


.sidebar-brand { padding: var(--space-5) var(--space-5) var(--space-4); }
.sidebar-brand .org-name { font-size: var(--fs-headline-sm); font-weight: 700; color: var(--color-primary); }
.sidebar-brand .org-sub { font-size: var(--fs-body-sm); color: var(--color-on-surface-variant); opacity: 0.8; margin-top: 2px; }
.sidebar-whoami { font-size: var(--fs-body-sm); color: var(--color-on-surface-variant); margin-top: var(--space-2); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 var(--space-3); display: flex; flex-direction: column; gap: 2px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-md);
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-link:hover { background: var(--color-surface-container-high); color: var(--color-on-surface); }
.nav-link.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-secondary-strong);
  font-weight: 700;
  border-right: 3px solid var(--color-secondary);
}
.nav-link .icon { flex-shrink: 0; }

.sidebar-footer { padding: var(--space-4) var(--space-3) var(--space-5); border-top: 1px solid var(--color-surface-border); }

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-6);
  background: var(--color-surface-container-lowest);
  border-bottom: 1px solid var(--color-surface-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-box {
  position: relative;
  max-width: 380px;
  width: 100%;
}
.search-box .icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--color-outline); }
.search-box input {
  width: 100%;
  padding: 9px var(--space-4) 9px 38px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-full);
  background: var(--color-surface-container-low);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input:focus { border-color: var(--color-secondary); box-shadow: var(--shadow-focus-ring); background: var(--color-surface-container-lowest); }

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content-body { padding: var(--space-6); max-width: var(--container-max); width: 100%; margin: 0 auto; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); flex-wrap: wrap; }
.page-header h1 { font-size: var(--fs-headline-md); line-height: var(--lh-headline-md); font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }

/* ---------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px var(--space-4);
  font-size: var(--fs-body-md);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, opacity 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-strong); }

.btn-secondary { background: transparent; color: var(--color-secondary); border-color: var(--color-secondary); }
.btn-secondary:hover:not(:disabled) { background: rgba(59, 130, 246, 0.08); }

.btn-ghost { background: transparent; color: var(--color-secondary); }
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-container-high); }

.btn-outline { background: transparent; color: var(--color-on-surface-variant); border-color: var(--color-surface-border); }
.btn-outline:hover:not(:disabled) { background: var(--color-surface-container-low); border-color: var(--color-outline); }

.btn-sm { padding: 6px var(--space-3); font-size: var(--fs-body-sm); }
.btn-icon { padding: 8px; border-radius: var(--radius-full); background: transparent; color: var(--color-on-surface-variant); }
.btn-icon:hover:not(:disabled) { background: var(--color-surface-container-high); color: var(--color-secondary); }
.btn-icon:disabled, button:disabled { opacity: 0.4 !important; cursor: not-allowed !important; }

.btn-block { width: 100%; }

/* ---------------------------------------------------------------
   6. Form fields
   --------------------------------------------------------------- */
.field { margin-bottom: var(--space-4); }
.field-label { display: block; font-size: var(--fs-body-sm); font-weight: 600; color: var(--color-on-surface-variant); margin-bottom: var(--space-2); }
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 10px var(--space-3);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-lowest);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: var(--shadow-focus-ring);
}
.field-textarea { min-height: 84px; resize: vertical; }
.field-input[readonly],
.field-textarea[readonly] {
  background: var(--color-surface-container-low);
  cursor: not-allowed;
}
.field-input[readonly]:focus,
.field-textarea[readonly]:focus {
  border-color: var(--color-surface-border);
  box-shadow: none;
}
.field-hint { font-size: var(--fs-body-sm); color: var(--color-on-surface-variant); margin-top: var(--space-1); }

.filter-select {
  padding: 8px var(--space-3);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-lowest);
  min-width: 160px;
}

/* ---------------------------------------------------------------
   7. Chips / status tags
   --------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--fs-body-sm);
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.chip-success { background: var(--color-success-bg); color: var(--color-success-text); }
.chip-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.chip-error { background: var(--color-error-bg); color: var(--color-error-text); }
.chip-info { background: var(--color-info-bg); color: var(--color-info-text); }
.chip-neutral { background: var(--color-neutral-bg); color: var(--color-neutral-text); }

/* ---------------------------------------------------------------
   8. Cards
   --------------------------------------------------------------- */
.card {
  background: var(--color-surface-container-lowest);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
}
.card-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-surface-border); }
.card-header h2, .card-header h3 { font-size: var(--fs-headline-sm); font-weight: 600; }
.card-body { padding: var(--space-5); }

/* ---------------------------------------------------------------
   9. Tables
   --------------------------------------------------------------- */
.table-wrap {
  background: var(--color-surface-container-lowest);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--color-neutral-bg); }
.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-on-surface-variant);
  border-bottom: 1px solid var(--color-surface-border);
  cursor: pointer;
  user-select: none;
}
.data-table th:hover { background: var(--color-surface-container-high); }
.data-table th:not(:has(button))::after { content: "↕"; margin-left: 6px; font-size: 10px; opacity: .35; }
.data-table th[aria-sort]::after { margin-left: 6px; font-size: 10px; opacity: .75; }
.data-table th[aria-sort="ascending"]::after { content: "▲"; }
.data-table th[aria-sort="descending"]::after { content: "▼"; }
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-surface-border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--color-surface-container-low); }
.data-table tbody tr:hover { background: var(--color-surface-container-high); }
.data-table td.mono, .data-table th.mono { font-family: var(--font-mono); }
.data-table td.text-right, .data-table th.text-right { text-align: right; }
.data-table td.text-center, .data-table th.text-center { text-align: center; }
.table-subtext { display: block; margin-top: 2px; color: var(--color-on-surface-variant); font-size: 10px; }
.table-empty { text-align: center; color: var(--color-on-surface-variant); padding: var(--space-6); }

/* ---------------------------------------------------------------
   10. Modal
   --------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal-dialog {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface-container-lowest);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-level2);
}
.modal-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--color-surface-border); }
.modal-header h2 { font-size: var(--fs-headline-sm); font-weight: 600; }
#formModalForm {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-5);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-footer { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--color-surface-border); }
.modal-form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-form .form-group {
  margin-bottom: var(--space-4);
}
.modal-form .form-group:last-child {
  margin-bottom: 0;
}
.expense-summary {
  background: var(--color-surface-container);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-surface-border);
  font-size: var(--fs-label-md);
}
.summary-row:last-child {
  border-bottom: none;
}
.summary-row span {
  color: var(--color-on-surface-variant);
}
.summary-row strong {
  color: var(--color-on-surface);
  font-weight: 600;
}
.modal-dialog.branch-details-dialog { max-width: 960px; }
.modal-dialog.centre-collection-dialog { max-width: 780px; }
.modal-dialog.centre-collection-dialog .modal-body { padding: 28px; }
.modal-dialog.centre-collection-dialog .modal-footer { padding: 16px 28px; }
.modal-dialog.repayment-schedule-dialog { width: min(1180px, 96vw); max-width: 1180px; max-height: 94vh; }
.modal-dialog.repayment-schedule-dialog .modal-body { padding: 0; }
.modal-dialog.repayment-schedule-dialog .modal-footer { padding: 14px 24px; }

.repayment-detail { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.repayment-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-surface-border);
}
.repayment-detail-status { flex: 0 0 auto; }
.repayment-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.repayment-detail-facts > div {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
}
.repayment-detail-facts span,
.repayment-detail-metrics span {
  display: block;
  margin-bottom: 6px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-label-sm);
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.repayment-detail-facts strong { display: block; overflow-wrap: anywhere; color: var(--color-on-surface); font-size: var(--fs-body-md); }
.repayment-detail-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.repayment-detail-metrics article {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}
.repayment-detail-metrics strong { display: block; color: var(--color-primary); font-size: var(--fs-headline-sm); line-height: 1.25; }
.repayment-detail-metrics small { display: block; margin-top: 5px; color: var(--color-on-surface-variant); }
.repayment-installments-panel { overflow: hidden; border: 1px solid var(--color-surface-border); border-radius: var(--radius-lg); background: var(--color-surface-container-lowest); }
.repayment-installments-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--color-surface-border); }
.repayment-installments-heading h3 { margin: 0; color: var(--color-on-surface); font-size: var(--fs-title-md); }
.repayment-installments-heading p { margin: 3px 0 0; color: var(--color-on-surface-variant); font-size: var(--fs-body-sm); }
.repayment-installments-panel .table-wrap { margin: 0; border: 0; border-radius: 0; overflow-x: auto; }
.repayment-installments-panel .data-table { min-width: 880px; }

@media (max-width: 820px) {
  .repayment-detail { padding: 18px; }
  .repayment-detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repayment-detail-metrics { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .modal-overlay:has(.repayment-schedule-dialog) { padding: 8px; }
  .modal-dialog.repayment-schedule-dialog { width: 100%; max-height: calc(100vh - 16px); border-radius: var(--radius-md); }
  .repayment-schedule-table { min-width: 0 !important; }
  .repayment-schedule-table thead { display: none; }
  .repayment-schedule-table,
  .repayment-schedule-table tbody,
  .repayment-schedule-table tr { display: block; width: 100%; }
  .repayment-schedule-table tbody { padding: 12px; background: var(--color-surface-container-low); }
  .repayment-schedule-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--color-surface-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-container-lowest);
  }
  .repayment-schedule-table tbody tr:last-child { margin-bottom: 0; }
  .repayment-schedule-table tbody td,
  .repayment-schedule-table tbody td.text-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .repayment-schedule-table tbody td::before {
    content: attr(data-label);
    color: var(--color-on-surface-variant);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}

@media (max-width: 520px) {
  .repayment-detail-hero { align-items: flex-start; }
  .repayment-detail-facts { grid-template-columns: 1fr; }
  .repayment-installments-heading { align-items: flex-start; flex-direction: column; }
  .repayment-schedule-table tbody tr { grid-template-columns: 1fr 1fr; }
}
.branch-detail-header,
.branch-manager-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.branch-detail-address { margin-top: var(--space-1); }
.branch-detail-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}
.branch-detail-metric {
  padding: var(--space-3);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
}
.branch-detail-metric span {
  display: block;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}
.branch-detail-metric strong {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--fs-title-lg);
}
.branch-detail-section { margin-top: var(--space-5); }
.branch-detail-section h3 { margin-bottom: var(--space-3); font-size: var(--fs-title-md); }
.branch-manager-card {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
}
.branch-manager-card + .branch-manager-card { margin-top: var(--space-2); }
.branch-manager-card p,
.branch-detail-created,
.branch-detail-empty {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}
.branch-manager-contact { display: flex; align-items: center; gap: var(--space-3); }
.branch-detail-created { margin-top: var(--space-5); }
@media (max-width: 800px) {
  .branch-detail-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-detail-header,
  .branch-manager-card,
  .branch-manager-contact { align-items: flex-start; flex-direction: column; }
}

/* ---------------------------------------------------------------
   11. Toast
   --------------------------------------------------------------- */
.toast-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-body-md);
  font-weight: 500;
  margin: 0;
  border: 1px solid transparent;
  box-shadow: 0 10px 28px rgba(25, 28, 30, .18);
  transform: translateX(-50%);
  animation: toast-enter .18s ease-out;
}
.toast-banner.hidden { display: none; }
.toast-banner .icon { flex: 0 0 auto; }
.toast-banner span { line-height: 1.45; }
.toast-success { background: var(--color-success-bg); color: var(--color-success-text); border-color: rgba(16, 185, 129, 0.3); }
.toast-danger { background: var(--color-error-bg); color: var(--color-error-text); border-color: rgba(239, 68, 68, 0.3); }
.toast-info { background: var(--color-info-bg); color: var(--color-info-text); border-color: rgba(14, 165, 233, 0.3); }

@keyframes toast-enter {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 600px) {
  .toast-banner {
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom));
    left: 16px;
    width: auto;
    max-width: none;
    transform: none;
  }

  @keyframes toast-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ---------------------------------------------------------------
   12. Avatar
   --------------------------------------------------------------- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-body-sm);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
   13. Utility classes
   --------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-3 { margin-top: var(--space-3); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.w-full { width: 100%; }
.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }
.icon-xs { width: 13px; height: 13px; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------
   Login screen
   --------------------------------------------------------------- */
.login-screen {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background: var(--color-background);
  padding: 72px var(--space-4) 88px;
}

.login-shell {
  width: min(100%, 1000px);
  min-height: 640px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--color-soft-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-container-lowest);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.login-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 40px;
  color: var(--color-on-primary);
  background:
    linear-gradient(160deg, #133e87 0%, #0c2b64 50%, #001944 100%),
    var(--color-primary-container);
}

.login-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.login-brand,
.login-hero-copy,
.login-mobile-brand {
  position: relative;
  z-index: 1;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.login-brand .login-brand-mark {
  width: min(88%, 360px);
  height: auto;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 24px 64px rgba(0, 10, 35, 0.55), 0 0 0 10px rgba(255, 255, 255, 0.12);
  padding: 10px;
}

.login-mobile-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand-mark {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
  color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(0, 35, 111, 0.18);
}

.login-brand h1,
.login-mobile-brand h1 {
  color: inherit;
  font-size: var(--fs-headline-sm);
  line-height: var(--lh-headline-sm);
  font-weight: 850;
}

.login-brand p,
.login-mobile-brand p {
  margin-top: 4px;
  color: var(--color-on-primary-container);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.login-hero-copy h2 {
  max-width: 470px;
  color: #ffffff;
  font-size: var(--fs-headline-lg);
  line-height: var(--lh-headline-lg);
  font-weight: 850;
  letter-spacing: 0;
}

.login-hero-copy p {
  max-width: 430px;
  margin-top: 24px;
  color: var(--color-on-primary-container);
  font-size: var(--fs-body-lg);
  line-height: 28px;
}

.login-stats {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  margin-top: 42px;
}

.login-stats strong {
  display: block;
  color: #ffffff;
  font-size: var(--fs-headline-sm);
  line-height: var(--lh-headline-sm);
  font-weight: 850;
}

.login-stats span {
  display: block;
  margin-top: 4px;
  color: var(--color-on-primary-container);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.login-stat-divider {
  width: 1px;
  height: 42px;
  background: rgba(182, 196, 255, 0.35);
}

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 72px 80px;
}

.login-mobile-brand {
  display: none;
  margin-bottom: 48px;
  color: var(--color-primary);
}

.login-mobile-brand .login-brand-mark {
  width: 48px;
  height: 48px;
  box-shadow: none;
}

.login-mobile-brand p {
  color: var(--color-on-surface-variant);
}

.login-heading {
  margin-bottom: 40px;
}

.login-heading h2 {
  color: var(--color-on-surface);
  font-size: var(--fs-headline-md);
  line-height: var(--lh-headline-md);
  font-weight: 850;
}

.login-heading p {
  max-width: 420px;
  margin-top: 12px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
}

.login-form {
  display: grid;
  gap: 24px;
}

.login-field {
  display: grid;
  gap: 10px;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-label {
  color: var(--color-on-surface);
  font-family: var(--font-mono);
  font-size: var(--fs-label-md);
  line-height: var(--lh-label-md);
  font-weight: 800;
}

.login-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-secondary);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--fs-label-md);
  line-height: var(--lh-label-md);
  font-weight: 800;
}

.login-link:hover,
.login-link:focus-visible {
  color: var(--color-secondary-strong);
  text-decoration: underline;
  outline: none;
}

.login-input-wrap {
  position: relative;
  color: var(--color-on-surface-variant);
}

.login-input-wrap > .icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: currentColor;
  pointer-events: none;
}

.login-input {
  width: 100%;
  min-height: 62px;
  padding: 16px 48px 16px 50px !important;
  border: 1px solid var(--color-soft-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
  color: var(--color-on-surface);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

/* Chrome/Safari Autofill Styles override to maintain consistency */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover, 
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-on-surface) !important;
  -webkit-box-shadow: 0 0 0px 1000px var(--color-surface-container-lowest) inset !important;
  box-shadow: 0 0 0px 1000px var(--color-surface-container-lowest) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

.login-input::placeholder {
  color: var(--color-outline-variant);
}

.login-input-wrap:focus-within {
  color: var(--color-secondary);
}

.login-input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(0, 88, 190, 0.16);
}

.login-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface-variant);
  cursor: pointer;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
  background: var(--color-surface-container-low);
  color: var(--color-on-surface);
  outline: none;
}

.login-remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-md);
  cursor: pointer;
  user-select: none;
}

.login-remember input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.login-submit {
  min-height: 70px;
  border-radius: var(--radius-lg);
  font-size: var(--fs-headline-sm);
  line-height: var(--lh-headline-sm);
  font-weight: 850;
}

.login-submit.is-loading .icon {
  animation: login-spin 0.8s linear infinite;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

.login-form .toast-banner {
  margin-bottom: 0;
}

.login-security-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--color-soft-border);
  color: var(--color-on-surface-variant);
}

.login-security-note .icon {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--color-primary);
}

.login-security-note p {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-md);
}

.login-copyright {
  position: absolute;
  left: var(--space-4);
  right: var(--space-4);
  bottom: 20px;
  color: rgba(68, 70, 81, 0.62);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}

/* Drill-down breadcrumbs used on Centres/Members screens */
.drilldown-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }

.section-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-5);
  padding: 4px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}

.section-tab {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-on-surface-variant);
  font-weight: 700;
  cursor: pointer;
}

.section-tab:hover,
.section-tab:focus-visible {
  background: var(--color-surface-container-low);
  color: var(--color-secondary);
  outline: none;
}

.section-tab.is-active {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.centre-tab-panel {
  min-width: 0;
}

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: translateX(0); }
  .search-box { max-width: 220px; }
}

/* ---------------------------------------------------------------
   Stitch minimalist interface refinements
   --------------------------------------------------------------- */
:root {
  --color-surface: #f7f9fb;
  --color-background: #f7f9fb;
  --color-primary: #00236f;
  --color-primary-strong: #00164e;
  --color-primary-container: #1e3a8a;
  --color-secondary: #0058be;
  --color-secondary-strong: #004395;
  --color-secondary-fixed: #d8e2ff;
  --color-on-secondary-fixed: #001a42;
  --color-tertiary: #222a3e;
  --color-surface-border: #c5c5d3;
  --color-soft-border: #e2e8f0;
  --shadow-level1: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-level2: 0 6px 18px rgba(15, 23, 42, 0.10);
}

html { scrollbar-gutter: stable; }

body {
  overflow: hidden;
  background: var(--color-background);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.text-headline-lg,
.text-label-sm,
.data-table th {
  letter-spacing: 0;
}

.app-shell {
  min-height: 100vh;
  overflow: hidden;
  background: var(--color-background);
}

.sidebar {
  width: 288px;
  border-right-color: var(--color-surface-border);
  overflow-y: auto;
  z-index: 50;
}


.sidebar-brand {
  padding: 28px 28px 24px;
}

.sidebar-brand .org-name {
  font-size: 22px;
  line-height: 28px;
  color: var(--color-primary);
}

.sidebar-brand .org-sub,
.sidebar-whoami {
  font-weight: 500;
  opacity: 0.72;
}

.sidebar-nav {
  padding: 0 14px;
  gap: 4px;
}

.nav-link {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--fs-label-md);
  line-height: var(--lh-label-md);
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-link:hover {
  background: var(--color-surface-container-high);
}

.nav-link.active {
  background: rgba(216, 226, 255, 0.38);
  color: var(--color-secondary);
  border-right: 4px solid var(--color-secondary);
}

/* Back control atop a sidebar drill-down submenu (see NAV_SUBMENUS) -
   set apart from the sub-view items below it with a divider. */
.nav-back-link {
  color: var(--color-on-surface-variant);
  font-weight: 700;
  margin-bottom: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-surface-border);
}
.nav-back-link:hover {
  color: var(--color-secondary);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px 24px;
  border-top: none;
}

.sidebar-divider {
  width: 100%;
  height: 1px;
  background: var(--color-surface-border);
  margin: 4px 0 8px;
}

.footer-link {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--fs-label-md);
  font-weight: 600;
  text-align: left;
}

.footer-link:hover {
  background: var(--color-surface-container-high);
  color: var(--color-secondary);
}

.footer-link-danger {
  color: var(--color-error-red);
}

.footer-link-danger:hover {
  background: var(--color-error-container);
  color: var(--color-on-error-container);
}

.main-content {
  height: 100vh;
  overflow: hidden;
  background: var(--color-background);
}

.topbar {
  height: 72px;
  padding: 0 32px;
  border-bottom-color: var(--color-surface-border);
  z-index: 40;
}

.search-box {
  max-width: 520px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.search-box:focus-within {
  transform: scale(1.015);
}

.search-box input {
  min-height: 48px;
  border-color: var(--color-surface-border);
  background: var(--color-surface-container-low);
  font-size: var(--fs-body-lg);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-icon,
.btn-icon {
  border: 0;
  cursor: pointer;
}

.topbar-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-on-surface-variant);
}

.topbar-icon:hover {
  color: var(--color-secondary);
  background: var(--color-surface-container-low);
}

.notification-center {
  position: relative;
}

.notification-trigger {
  position: relative;
}

.notification-trigger.has-unread {
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: rgba(254, 226, 226, 0.72);
  color: var(--color-error-red);
}

.notification-trigger.has-unread:hover {
  border-color: rgba(220, 38, 38, 0.55);
  background: var(--color-error-bg);
  color: var(--color-error-red);
}

.field-amount-display {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid #b8c7e8;
  border-radius: var(--radius-md);
  background: #edf3ff;
  color: var(--color-primary-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  font-weight: 700;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: var(--radius-full);
  background: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 12px);
  right: 0;
  width: min(390px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 92px));
  overflow: hidden;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-level3);
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-surface-border);
}

.notification-panel-header h2 {
  color: var(--color-primary);
  font-size: var(--fs-headline-sm);
}

.notification-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.notification-mark-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  background: #f1f5f9;
  color: var(--color-primary);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  white-space: nowrap;
}

.notification-mark-all-btn:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

.notification-mark-all-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.notification-mark-all-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.notification-mark-all-btn .icon {
  width: 13px;
  height: 13px;
}

.notification-kicker {
  color: var(--color-outline);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notification-list {
  max-height: min(520px, calc(100vh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--color-surface-border);
  background: var(--color-surface-container-lowest);
}

.notification-item.unread {
  box-shadow: inset 4px 0 0 var(--color-secondary);
  background: rgba(216, 226, 255, 0.32);
}

.notification-item.read {
  background: var(--color-surface-container-lowest);
}

.notification-item-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.notification-item-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.notification-item-heading strong {
  color: var(--color-primary);
}

.notification-state {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notification-state::before {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  content: "";
}

.notification-state.unread {
  background: var(--color-info-bg);
  color: var(--color-info-text);
}

.notification-state.unread::before {
  background: var(--color-secondary);
}

.notification-state.read {
  background: var(--color-surface-container);
  color: var(--color-on-surface-variant);
}

.notification-state.read::before {
  border: 1px solid var(--color-outline);
  background: transparent;
}

.notification-item p {
  margin-top: 5px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-md);
}

.notification-meta {
  display: block;
  margin-top: 7px;
  color: var(--color-outline);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
}

.notification-action {
  margin-top: 12px;
}

.notification-empty,
.notification-loading,
.notification-error {
  padding: 32px 20px;
  color: var(--color-on-surface-variant);
  text-align: center;
}

.notification-error {
  color: var(--color-error-text);
}

.topbar-divider {
  width: 1px;
  height: 36px;
  background: var(--color-surface-border);
  margin: 0 4px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profile-copy {
  text-align: right;
  min-width: 0;
}

.profile-name {
  font-weight: 800;
  color: var(--color-primary);
  white-space: nowrap;
}

.profile-role {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
  color: var(--color-on-surface-variant);
}

.avatar {
  width: 42px;
  height: 42px;
  border: 2px solid var(--color-primary-container);
  box-shadow: 0 0 0 2px var(--color-surface-container-lowest);
}

.content-body {
  flex: 1;
  max-width: 1440px;
  padding: 40px 32px 96px;
  overflow-y: auto;
}

.page-header {
  align-items: flex-end;
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: var(--fs-headline-lg);
  line-height: var(--lh-headline-lg);
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-info-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-outline);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.section-info-btn:hover,
.section-info-btn:focus-visible {
  border-color: var(--color-surface-border);
  background: var(--color-surface-container-low);
  color: var(--color-secondary);
  outline: none;
}

.page-subtitle {
  margin-top: 6px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
}

.btn {
  min-height: 40px;
  border-radius: var(--radius-lg);
  font-weight: 750;
  transition: background 0.15s, border-color 0.15s, transform 0.05s, opacity 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--color-primary);
  box-shadow: 0 4px 10px rgba(0, 35, 111, 0.16);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-strong);
  box-shadow: 0 8px 18px rgba(0, 35, 111, 0.22);
}

.btn-secondary {
  background: var(--color-secondary-fixed);
  border-color: transparent;
  color: var(--color-on-secondary-fixed);
}

.btn-secondary:hover:not(:disabled) {
  background: #cbd9ff;
}

.btn-outline {
  border-color: var(--color-surface-border);
  background: var(--color-surface-container-lowest);
  color: var(--color-on-surface-variant);
}

.btn-outline:hover:not(:disabled) {
  background: var(--color-surface-container-low);
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-outline);
}

.btn-icon:hover:not(:disabled) {
  background: var(--color-surface-container-low);
  color: var(--color-secondary);
}

.btn-table {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  color: var(--color-on-surface-variant, #64748b);
  border: 1px solid var(--color-outline-variant, #e2e8f0);
  transition: all 0.15s ease-in-out;
}

.data-table .btn-table {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: transparent;
  color: var(--color-on-surface-variant, #64748b);
  border: 1px solid var(--color-outline-variant, #e2e8f0);
  transition: all 0.15s ease-in-out;
}

.data-table .btn-table:hover:not(:disabled),
.btn-table:hover:not(:disabled) {
  background: var(--color-surface-container-high, #f1f5f9);
  color: var(--color-secondary, #07162e);
  border-color: var(--color-secondary-border, #cbd5e1);
}

.data-table .btn-table .icon,
.btn-table .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.btn-table-label {
  display: none !important;
}

.btn-danger-soft,
.btn-table.btn-danger-soft,
.data-table .btn-table.btn-danger-soft,
.data-table .btn-table.text-danger {
  color: #dc2626;
  border-color: #fee2e2;
  background: #fef2f2;
}

.btn-danger-soft:hover:not(:disabled),
.btn-table.btn-danger-soft:hover:not(:disabled),
.data-table .btn-table.btn-danger-soft:hover:not(:disabled),
.data-table .btn-table.text-danger:hover:not(:disabled) {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}

.field-input,
.field-select,
.field-textarea,
.filter-select {
  min-height: 44px;
  border-color: var(--color-surface-border);
  border-radius: var(--radius-md);
}

.filter-select {
  min-width: 190px;
  color: var(--color-on-surface);
}

.field-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
  letter-spacing: 0;
  text-transform: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.metric-card {
  position: relative;
  min-height: 118px;
  padding: 24px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-level1);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.metric-card:hover {
  border-color: var(--color-secondary);
  transform: translateY(-1px);
}

.metric-info-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-outline);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.metric-info-btn:hover,
.metric-info-btn:focus-visible {
  border-color: var(--color-surface-border);
  background: var(--color-surface-container-low);
  color: var(--color-secondary);
  outline: none;
}

.metric-label {
  padding-right: 24px;
  margin-bottom: 10px;
  color: var(--color-outline);
  font-family: var(--font-mono);
  font-size: var(--fs-label-md);
  line-height: var(--lh-label-md);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

/* Stacked variant: for a delta too long to sit beside the value (a branch
   name, not a short "+2" style figure) - wraps below, left-aligned, instead
   of squeezing onto the same line. */
.metric-row.stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.metric-row.stacked .metric-delta,
.metric-row.stacked .metric-icon {
  margin-bottom: 0;
  white-space: normal;
}

.metric-value {
  color: var(--color-primary);
  font-size: 34px;
  line-height: 1.08;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.metric-value.metric-warning { color: var(--color-warning); }
.metric-value.metric-danger { color: var(--color-error-red); }
.metric-value.metric-success { color: var(--color-success); }

.metric-delta,
.metric-icon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-weight: 800;
  color: var(--color-secondary);
  white-space: nowrap;
}

.metric-delta.success,
.metric-icon.success { color: var(--color-success); }
.metric-delta.warning,
.metric-icon.warning { color: var(--color-warning); }
.metric-delta.danger,
.metric-icon.danger { color: var(--color-error-red); }

.mini-progress {
  width: 72px;
  height: 4px;
  margin-bottom: 9px;
  border-radius: var(--radius-full);
  background: var(--color-surface-container);
  overflow: hidden;
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-secondary);
}

.surface-panel {
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-level1);
  overflow: hidden;
}

#loanMemberSelector {
  margin-bottom: var(--space-5);
}

#loanWorkflowArea {
  scroll-margin-top: calc(var(--topbar-height) + var(--space-4));
}

.loan-application-workspace {
  overflow: hidden;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-level1);
}

.loan-detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  background:
    radial-gradient(circle at 85% 10%, rgba(15, 118, 110, 0.16), transparent 38%),
    linear-gradient(135deg, var(--color-primary) 0%, #173c43 100%);
  color: #fff;
}

.loan-detail-identity,
.loan-detail-hero-status,
.loan-detail-actionbar {
  display: flex;
  align-items: center;
}

.loan-detail-identity {
  gap: 18px;
  min-width: 0;
}

.loan-detail-icon {
  display: grid;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.12);
}

.loan-detail-eyebrow,
.loan-detail-action-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.loan-detail-eyebrow {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
}

.loan-detail-hero h2 {
  color: #fff;
  font-size: var(--fs-headline-lg);
  line-height: var(--lh-headline-lg);
}

.loan-detail-hero p {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.76);
}

.loan-detail-hero-status {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.loan-detail-hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.loan-detail-hero .btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
}

.loan-detail-actionbar {
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-surface-border);
  background: var(--color-surface-container-low);
}

.loan-detail-action-label {
  color: var(--color-primary);
}

.loan-detail-actionbar p {
  margin-top: 3px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}

.loan-detail-grid {
  padding: 24px;
}

.loan-product-decision {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.loan-product-decision strong {
  color: var(--color-primary-strong);
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
}

.loan-product-decision-amount {
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  font-weight: 750;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-surface-border);
  background: rgba(242, 244, 246, 0.35);
}

.panel-header h2,
.panel-header h3 {
  color: var(--color-primary);
  font-size: var(--fs-headline-sm);
  line-height: var(--lh-headline-sm);
  font-weight: 750;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-title-block {
  min-width: 0;
}

.panel-subtitle {
  margin-top: 4px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

.panel-info-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-outline);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.panel-info-btn:hover,
.panel-info-btn:focus-visible {
  border-color: var(--color-surface-border);
  background: var(--color-surface-container-low);
  color: var(--color-secondary);
  outline: none;
}

.panel-actions,
.panel-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.panel-body {
  padding: 24px;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-surface-border);
  background: rgba(242, 244, 246, 0.35);
}

.pagination-summary {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}

.pagination-summary strong {
  color: var(--color-on-surface);
}

.pagination-muted {
  color: var(--color-on-surface-variant);
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rows-per-page-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 700;
}

.rows-per-page-select {
  min-height: 34px;
  padding: 4px 28px 4px 10px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-lowest);
  color: var(--color-on-surface);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
}

.page-pill {
  min-width: 58px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-on-surface);
  font-family: var(--font-mono);
  font-weight: 700;
}

.page-pill.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.surface-panel .table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow-x: auto;
}

.data-table thead {
  background: var(--color-surface-container-low);
}

.data-table th {
  padding: 16px 24px;
  border-bottom-color: var(--color-surface-border);
  font-family: var(--font-mono);
  font-size: var(--fs-label-md);
  line-height: var(--lh-label-md);
  font-weight: 700;
  color: var(--color-on-surface-variant);
}

.data-table td {
  padding: 18px 24px;
  border-bottom-color: var(--color-surface-border);
  font-size: var(--fs-body-md);
}

.data-table tbody tr:nth-child(even) {
  background: transparent;
}

.data-table tbody tr:hover {
  background: var(--color-surface-container-low);
}

.data-table tbody tr.row-selectable {
  cursor: pointer;
}

.data-table tbody tr.row-selectable.is-selected {
  background: var(--color-secondary-fixed);
  box-shadow: inset 3px 0 0 var(--color-secondary);
}

.data-table tbody tr.row-selectable.is-selected:hover {
  background: var(--color-secondary-fixed);
}

#centreTimetablePanel .panel-header {
  align-items: flex-start;
  flex-wrap: wrap;
}

#centreTimetablePanel .panel-tools {
  flex: 1 1 760px;
  gap: 10px;
  justify-content: flex-end;
}

#centreTimetablePanel .filter-select,
#centreTimetablePanel .timetable-date-input {
  min-width: 160px;
  width: auto;
}

.timetable-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.timetable-filter-grid .filter-field {
  margin: 0;
}

.timetable-filter-grid .filter-select,
.timetable-filter-grid .timetable-date-input {
  width: 100%;
  min-width: 0;
}

#centreTimetable > .surface-panel + .surface-panel {
  margin-top: 24px;
}

.timetable-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}

.timetable-view-toggle .section-tab {
  min-height: 34px;
  padding: 6px 12px;
  font-size: var(--fs-body-sm);
}

.timetable-export-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timetable-export-actions .btn {
  min-height: 36px;
  padding: 7px 12px;
  font-size: var(--fs-body-sm);
}

.planner-dashboard {
  padding: 0 24px 24px;
  --planner-low-border: #bbf7d0;
  --planner-low-bg: #f0fdf4;
  --planner-low-text: #166534;
  --planner-review-border: #99f6e4;
  --planner-review-bg: #ecfeff;
  --planner-review-text: #0f766e;
  --planner-medium-border: #bfdbfe;
  --planner-medium-bg: #eff6ff;
  --planner-medium-text: #1d4ed8;
  --planner-high-border: #fecaca;
  --planner-high-bg: #fef2f2;
  --planner-high-text: #991b1b;
}

.planner-title {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--color-surface-border);
}

.planner-title strong {
  color: var(--color-primary);
  font-size: var(--fs-headline-sm);
  line-height: var(--lh-headline-sm);
}

.planner-title span {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}

.planner-dashboard .metric-grid {
  margin: 24px 0;
}

.planner-dashboard .metric-value.metric-warning,
.planner-dashboard .metric-delta.warning,
.planner-dashboard .metric-icon.warning {
  color: var(--planner-review-text);
}

.planner-insight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.planner-insight-strip > div,
.planner-staff-card {
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}

.planner-insight-strip > div {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.planner-insight-strip span,
.planner-section-header span,
.planner-staff-card small,
.planner-heatmap-staff span,
.planner-heatmap-cell span {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}

.planner-insight-strip strong {
  color: var(--color-primary);
  font-size: var(--fs-body-lg);
}

.planner-section {
  margin-top: 24px;
}

.planner-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.planner-section-header h3 {
  color: var(--color-on-surface);
  font-size: var(--fs-headline-sm);
  line-height: var(--lh-headline-sm);
}

.planner-heatmap {
  min-width: 760px;
  overflow-x: auto;
}

.planner-heatmap-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(var(--planner-days), minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.planner-heatmap-head > div {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 800;
  text-align: center;
}

.planner-heatmap-staff,
.planner-heatmap-cell {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-lowest);
}

.planner-heatmap-staff {
  display: grid;
  align-content: center;
  gap: 4px;
}

.planner-heatmap-cell {
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--color-on-surface);
  text-align: center;
}

.planner-heatmap-cell strong {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
}

.planner-heatmap-cell:not(.empty) strong,
.planner-heatmap-cell:not(.empty) strong span,
.planner-heatmap-cell:not(.empty) strong small {
  color: var(--color-primary);
}

.planner-heatmap-cell strong span {
  font-size: var(--fs-body-lg);
}

.planner-heatmap-cell strong small {
  font-family: var(--font-body);
  font-size: var(--fs-label-sm);
  font-weight: 900;
}

.planner-heatmap-cell.empty {
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
}

.planner-heatmap-cell.low {
  border-color: var(--planner-low-border);
  background: var(--planner-low-bg);
}

.planner-heatmap-cell.medium {
  border-color: var(--planner-medium-border);
  background: var(--planner-medium-bg);
}

.planner-heatmap-cell.high {
  border-color: var(--planner-high-border);
  background: var(--planner-high-bg);
}

.planner-staff-list {
  display: grid;
  gap: 12px;
}

.planner-staff-card {
  overflow: hidden;
}

.planner-staff-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.planner-staff-card summary::-webkit-details-marker {
  display: none;
}

.planner-staff-identity {
  display: grid;
  gap: 4px;
}

.planner-staff-metrics {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.planner-staff-metrics span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--color-info-bg);
  color: var(--color-info-text);
  font-size: var(--fs-body-sm);
  font-weight: 800;
}

.planner-route-list {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.planner-route-day {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}

.planner-route-day.tone-empty {
  background: var(--color-surface-container-low);
}

.planner-route-day.tone-medium {
  border-color: var(--planner-medium-border);
  background: var(--planner-medium-bg);
}

.planner-route-day.tone-high {
  border-color: var(--planner-high-border);
  background: var(--planner-high-bg);
}

.planner-route-day-head {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
}

.planner-route-day-head strong {
  color: var(--color-on-surface);
  font-size: var(--fs-body-sm);
  font-weight: 900;
}

.planner-route-day-head span,
.planner-route-day-head small {
  overflow: hidden;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-label-sm);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-route-stops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
  min-width: 0;
}

.planner-stop {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--color-soft-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-xs);
}

.planner-stop-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.planner-stop-meta span {
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
  line-height: 16px;
}

.planner-stop-meta strong {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: var(--color-success-bg);
  color: var(--color-success-text);
  font-size: 11px;
  font-weight: 900;
  line-height: 14px;
}

.planner-stop-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-top: 6px;
}

.planner-stop-main strong,
.planner-stop-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-stop-main strong {
  color: var(--color-on-surface);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
}

.planner-stop-main small {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
}

.planner-route-free {
  align-self: center;
  justify-self: center;
  padding: 10px 12px;
  border: 1px dashed var(--color-surface-border);
  border-radius: var(--radius-md);
  color: var(--color-on-surface-variant);
  font-size: var(--fs-label-sm);
  font-weight: 700;
}

@media (max-width: 760px) {
  .planner-staff-card summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .planner-staff-metrics {
    justify-content: flex-start;
  }

  .planner-route-day {
    grid-template-columns: 1fr;
  }

  .planner-route-day-head {
    grid-template-columns: repeat(3, minmax(0, auto));
    align-items: center;
    justify-content: start;
    gap: 8px;
  }

  .planner-route-stops {
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  }
}

.planner-empty-state {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
  text-align: center;
}

.weekly-matrix-report {
  min-width: 0;
}

.weekly-matrix-title {
  display: grid;
  gap: 4px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-surface-border);
  text-align: center;
}

.weekly-matrix-title strong {
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
}

.weekly-matrix-title span {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}

.weekly-matrix-wrap {
  overflow-x: auto;
}

.weekly-matrix-table {
  min-width: 1280px;
}

.weekly-matrix-table th {
  padding: 10px 8px;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

.weekly-matrix-table td {
  min-width: 96px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: top;
}

.weekly-matrix-table .weekly-staff-index {
  min-width: 48px;
}

.weekly-matrix-table .weekly-staff-name {
  min-width: 150px;
  background: var(--color-surface-container-low);
  color: var(--color-primary);
  font-weight: 800;
  vertical-align: middle;
}

.weekly-centre-entry + .weekly-centre-entry {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--color-surface-border);
}

.weekly-row-total {
  background: var(--color-surface-container-low);
  font-weight: 800;
}

.weekly-staff-total td,
.weekly-grand-total td {
  background: var(--color-secondary-fixed);
  color: var(--color-on-secondary-fixed);
  font-weight: 800;
}

@media (max-width: 700px) {
  #centreTimetablePanel .panel-tools {
    justify-content: flex-start;
  }

  .timetable-view-toggle,
  .timetable-export-actions {
    width: 100%;
  }

  .timetable-export-actions .btn {
    flex: 1 1 120px;
  }

  .planner-dashboard {
    padding: 0 16px 16px;
  }

  .planner-insight-strip {
    grid-template-columns: 1fr;
  }

  .planner-section-header {
    align-items: flex-start;
  }

  .planner-staff-card summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.entity-title {
  color: var(--color-primary);
  font-size: var(--fs-body-lg);
  line-height: var(--lh-body-lg);
  font-weight: 800;
}

.entity-subtitle {
  margin-top: 2px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.action-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.action-cell-center {
  justify-content: flex-start;
}

/* Keep every table's action header and controls on the same left edge. */
.data-table th.table-actions-heading,
.data-table td:has(.action-cell),
.data-table td:has(.btn-table) {
  text-align: left;
}

.recovery-actions {
  justify-content: flex-start;
}

#followUpsPanel .data-table th:last-child,
#followUpsPanel .data-table td:last-child {
  text-align: left;
}

.branch-actions {
  min-width: 126px;
}
.staff-row-actions {
  min-width: 88px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}
.staff-row-action {
  flex: 0 0 auto;
}
.staff-row-action .icon { width: 15px; height: 15px; }
.staff-row-action:focus-visible {
  outline: 0;
  background: var(--color-surface-container-low);
  color: var(--color-secondary);
  box-shadow: var(--shadow-focus-ring);
}
.staff-row-action:active:not(:disabled) {
  background: var(--color-surface-container-high);
  transform: scale(.96);
}

#staffTable .data-table { min-width: 1120px; }
#staffTable .data-table th:nth-child(1) { width: 220px; }
#staffTable .data-table th:nth-child(2) { width: 160px; }
#staffTable .data-table th:nth-child(3) { width: 150px; }
#staffTable .data-table th:nth-child(4) { width: 70px; }
#staffTable .data-table th:nth-child(5) { width: 135px; }
#staffTable .data-table th:nth-child(6) { width: 190px; }
#staffTable .data-table th:nth-child(7) { width: 125px; }

#staffTable .data-table th:last-child,
#staffTable .data-table td:last-child {
  position: sticky;
  right: 0;
  min-width: 112px;
  background: var(--color-surface-container-lowest);
  box-shadow: -8px 0 14px -12px rgba(24, 33, 54, .45);
  z-index: 2;
}

#staffTable .data-table th:last-child {
  background: var(--color-surface-container-low);
  z-index: 3;
}

#staffTable .data-table tbody tr:hover td:last-child { background: #f7f9fd; }

.staff-edit-page .enrollment-section {
  scroll-margin-top: 20px;
}

.staff-edit-identity-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid #c7d3e8;
  border-radius: var(--radius-md);
  background: #f4f7fc;
  color: var(--color-primary);
}

.staff-edit-identity-note .icon { flex: 0 0 auto; margin-top: 2px; }
.staff-edit-identity-note strong { display: block; font-size: var(--fs-body-sm); }
.staff-edit-identity-note p {
  margin-top: 3px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
}

.readonly-field {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px dashed #b8c4d8;
  border-radius: var(--radius-sm);
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
  font-weight: 700;
}

.readonly-field .icon { flex: 0 0 auto; color: var(--color-primary); }
.staff-immutable-field .field-hint { color: #64748b; }
.staff-proof-readonly { overflow: hidden; }
.staff-proof-readonly.missing { border-style: dashed; }

.staff-edit-proof-preview {
  position: relative;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-container-low);
  color: var(--color-primary);
  text-decoration: none;
}

.staff-edit-proof-preview img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #eef1f6;
}

.staff-edit-proof-preview > span {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.immutable-proof-state,
.immutable-proof-meta {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-container-low);
  color: var(--color-on-surface-variant);
}

.immutable-proof-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body-sm);
}

.immutable-proof-meta { display: grid; gap: 4px; }
.immutable-proof-meta span,
.immutable-proof-meta small { font-size: var(--fs-label-sm); }
.immutable-proof-meta strong { color: var(--color-primary); font-size: var(--fs-body-md); }
.immutable-proof-meta small { display: flex; align-items: center; gap: 6px; color: #64748b; }

.table-heading-center {
  display: block;
  text-align: left;
}

.row-avatar {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-surface-border);
  background: var(--color-secondary-fixed);
  color: var(--color-on-secondary-fixed);
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  font-weight: 800;
}

.row-avatar.neutral {
  background: var(--color-surface-dim);
  color: var(--color-on-surface);
}

.row-avatar.primary {
  background: var(--color-primary-container);
  color: var(--color-on-primary);
}

.row-avatar.danger {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-color: rgba(239, 68, 68, 0.32);
}

.chip {
  padding: 5px 12px;
  font-size: var(--fs-body-sm);
  font-weight: 800;
  text-transform: none;
}

.role-chip {
  background: rgba(30, 58, 138, 0.10);
  color: var(--color-primary);
}

.role-chip.secondary {
  background: rgba(0, 88, 190, 0.10);
  color: var(--color-secondary);
}

.role-chip.tertiary {
  background: rgba(34, 42, 62, 0.10);
  color: var(--color-tertiary);
}

.role-chip.neutral {
  background: var(--color-neutral-bg);
  color: var(--color-neutral-text);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--color-surface-border);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-field label {
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
  font-weight: 800;
}

.screen-filters-panel {
  margin-bottom: 24px;
  overflow: visible;
}

.screen-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding: 22px;
}

.screen-filter-grid .filter-select,
.screen-filter-grid .field-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

.screen-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 22px 22px;
}

.data-table tbody tr.screen-filter-hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .screen-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .screen-filter-grid { grid-template-columns: 1fr; padding: 18px; }
  .screen-filter-actions { padding: 0 18px 18px; }
}

.collection-verification-workspace {
  display: grid;
  gap: 20px;
  margin: 0;
}

.collections-tab-panel {
  display: grid;
  gap: 0;
  min-width: 0;
}

.collections-tab-panel > .metric-grid,
.collections-tab-panel > .analytics-grid {
  margin: 0;
}

.collections-tab-panel .metric-card {
  min-height: 126px;
  padding: 22px;
}

.collections-tab-panel .metric-row {
  gap: 12px;
}

.collections-tab-panel .metric-value {
  font-size: 29px;
  overflow-wrap: normal;
  white-space: nowrap;
}

.collections-tab-panel .metric-delta {
  flex: 0 1 auto;
  line-height: 1.2;
  text-align: right;
  white-space: normal;
}

.collections-section-stack {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.collection-filters-panel {
  overflow: visible;
  margin: 0 0 24px;
}

#installmentFiltersPanel .filter-bar {
  border-bottom: 0;
}

#collectionMetricsWrap,
#verificationMetricsWrap {
  margin: 0 0 32px;
}

#collectionMetricsWrap .metric-grid,
#verificationMetricsWrap .metric-grid {
  margin-bottom: 0;
}

.collection-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: end;
  padding: 22px;
}

.collection-filter-grid .filter-select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

#targetsPanel,
#collectionsPanel,
#loansPanel,
#targetsTableWrap,
#collectionsTableWrap,
#loansTableWrap {
  min-width: 0;
}

#targetsPanel .data-table,
#collectionsPanel .data-table,
#loansPanel .data-table {
  white-space: nowrap;
}

#targetsPanel .data-table {
  min-width: 780px;
}

#collectionsPanel .data-table {
  min-width: 980px;
}

#loansPanel .data-table {
  min-width: 1100px;
}

#targetsPanel .data-table th:last-child,
#targetsPanel .data-table td:last-child,
#collectionsPanel .data-table th:last-child,
#collectionsPanel .data-table td:last-child {
  text-align: left;
}

.collection-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-low);
}

.collection-view-switch-btn {
  min-height: 34px;
  padding: 7px 13px;
  border: 0;
  border-radius: calc(var(--radius-lg) - 3px);
  background: transparent;
  color: var(--color-on-surface-variant);
  font: inherit;
  font-size: var(--fs-label-md);
  font-weight: 700;
  cursor: pointer;
}

.collection-view-switch-btn.is-active {
  background: var(--color-surface-container-lowest);
  color: var(--color-primary);
  box-shadow: var(--shadow-level1);
}

.collection-progress {
  width: 92px;
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-surface-container-high);
}

.collection-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-success);
}

.collection-verify-summary {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-low);
}

.collection-verify-summary p,
.collection-verify-summary small {
  margin: 0;
}

.collection-verify-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.collection-verify-summary small {
  color: var(--color-on-surface-variant);
}

#collectionsPanel .action-cell {
  justify-content: flex-start;
}

.collection-action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--color-on-surface-variant);
  font-family: var(--font-sans);
  font-size: var(--fs-label-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.collection-action-link:hover,
.collection-action-link:focus-visible {
  background: transparent;
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.collection-action-link.is-primary {
  color: var(--color-primary);
}

.collection-action-link:disabled {
  color: var(--color-outline);
  cursor: not-allowed;
  opacity: 0.55;
  text-decoration: none;
}

.collection-filter-action {
  display: flex;
  align-items: flex-end;
}

.collection-filter-action .btn {
  width: 100%;
  min-height: 42px;
}

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 28px;
  margin-top: 32px;
}

.map-placeholder {
  min-height: 260px;
  position: relative;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
    linear-gradient(135deg, #e8ecf2, #d9e2ef 55%, #edf2f7);
  background-size: 28px 28px, 28px 28px, auto;
  overflow: hidden;
}

.map-marker {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 3px solid var(--color-surface-container-lowest);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 4px 10px rgba(0, 35, 111, 0.25);
}

.map-marker.warning {
  background: var(--color-warning);
}

.legend {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 12px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
}

.legend-row,
.insight-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.legend-row {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.legend-dot.warning {
  background: var(--color-warning);
}

.insight-list {
  display: grid;
  gap: 12px;
}

.insight-row {
  justify-content: space-between;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(242, 244, 246, 0.58);
}

.insight-row strong {
  font-size: var(--fs-body-lg);
}

.insight-value {
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  font-weight: 800;
}

.insight-value.success { color: var(--color-success); }
.insight-value.warning { color: var(--color-warning); }
.insight-value.danger { color: var(--color-error-red); }

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 28px;
  margin-top: 32px;
}

.bar-chart {
  height: 260px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding-top: 18px;
}

.bar-item {
  flex: 1;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.bar {
  width: 100%;
  max-width: 84px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--color-primary-container);
}

.bar.alt { background: var(--color-secondary); }
.bar.soft { background: #c8d1df; }
.bar.mid { background: #94a3bd; }

.bar-label {
  color: var(--color-outline);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 30px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--color-surface-border);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 5px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--color-surface-container-lowest);
  border-radius: var(--radius-full);
  background: var(--color-success);
}

.definition-copy {
  color: var(--color-on-surface);
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-lg);
}

.info-summary {
  margin-bottom: 16px;
}

.info-summary .definition-copy:last-child,
.info-details .definition-copy:last-child {
  margin-bottom: 0;
}

.info-summary .definition-copy + .definition-copy {
  margin-top: 12px;
}

.info-more-toggle {
  margin-bottom: 16px;
}

.info-details {
  padding: 16px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-low);
}

.info-detail-copy + .info-detail-copy {
  margin-top: 12px;
}

.timeline-dot.warning { background: var(--color-warning); }
.timeline-dot.info { background: var(--color-secondary); }

.timeline-title {
  font-weight: 800;
  color: var(--color-on-surface);
}

.timeline-copy,
.timeline-time {
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

.text-success { color: var(--color-success-text); }

.btn-danger-text {
  color: var(--color-error-red);
  border-color: rgba(239, 68, 68, 0.42);
}

.btn-danger-text:hover:not(:disabled) {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border-color: rgba(239, 68, 68, 0.62);
}

.stitch-page-detail {
  margin-bottom: 32px;
}

.stitch-detail-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stitch-detail-header h2 {
  color: var(--color-primary);
  font-size: var(--fs-headline-lg);
  line-height: var(--lh-headline-lg);
  font-weight: 850;
  letter-spacing: 0;
}

.stitch-detail-header p {
  margin-top: 6px;
  color: var(--color-on-surface-variant);
}

.stitch-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 28px;
}

.stitch-main-column,
.stitch-side-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.stitch-profile-panel {
  padding: 24px;
  overflow: visible;
}

.stitch-loan-detail-panel {
  overflow: hidden;
}

.stitch-loan-detail-panel .panel-header {
  margin-bottom: 0;
}

.stitch-loan-detail-panel .stitch-loan-metrics {
  padding: 24px;
}

.stitch-loan-detail-panel .schedule-preview-title {
  margin: 8px 24px 14px;
}

.stitch-loan-detail-panel > .table-wrap {
  width: auto;
  margin: 0 24px 24px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
  overflow-x: auto;
  overflow-y: hidden;
}

.stitch-loan-detail-panel > .table-wrap .data-table th,
.stitch-loan-detail-panel > .table-wrap .data-table td {
  padding-left: 28px;
  padding-right: 28px;
}

.stitch-documents-panel .document-grid {
  padding: 24px;
}

.member-profile-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--color-surface-border);
}

.stitch-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.stitch-label {
  margin-bottom: 5px;
  color: var(--color-outline);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  line-height: var(--lh-label-sm);
  font-weight: 800;
  text-transform: uppercase;
}

.stitch-value {
  color: var(--color-on-surface);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.stitch-loan-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.stitch-mini-card {
  min-height: 116px;
  padding: 20px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-low);
}

.stitch-mini-card p {
  margin-bottom: 6px;
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  font-weight: 750;
}

.stitch-mini-card strong {
  display: block;
  color: var(--color-primary);
  font-size: 26px;
  line-height: 32px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.stitch-mini-card span {
  display: block;
  margin-top: 4px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-sm);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.document-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 96px;
  padding: 18px 20px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}

.document-tile > div {
  min-width: 0;
}

.kyc-review-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0;
}
.kyc-proof-groups { display: grid; gap: 22px; margin-top: 18px; }
.kyc-proof-group {
  padding: 16px; border: 1px solid #dfe5f0; border-radius: 14px; background: #f8faff;
}
.kyc-proof-group.nominee { border-color: #e4dcf4; background: #fbf9ff; }
.kyc-proof-group-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kyc-proof-group-header h4 { font-size: 18px; line-height: 1.3; color: #20345e; }
.kyc-proof-group.nominee .kyc-proof-group-header h4 { color: #60459c; }
.kyc-proof-group-header p { margin-top: 4px; color: var(--color-on-surface-variant); font-size: 13px; line-height: 1.45; }
.kyc-proof-group-header > span {
  padding: 5px 9px; border-radius: 999px; background: white; color: #52627f;
  box-shadow: inset 0 0 0 1px #dce3ef; font: 700 12px var(--font-mono);
}
.kyc-proof-group .kyc-review-grid { margin-bottom: 0; }

.member-workspace {
  overflow: hidden; border: 1px solid var(--color-surface-border); border-radius: 18px;
  background: #f5f7fb; box-shadow: 0 18px 50px rgba(38, 50, 80, .08);
}
.member-profile-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 24px 28px; border-bottom: 1px solid var(--color-surface-border);
  background: linear-gradient(115deg, #152a5d 0%, #274a91 70%, #315cae 100%); color: white;
}
.member-profile-identity, .member-profile-hero-status, .profile-card-title, .profile-side-card-title {
  display: flex; align-items: center; gap: 12px;
}
.member-profile-avatar {
  display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 58px;
  border: 2px solid rgba(255,255,255,.35); border-radius: 16px; background: rgba(255,255,255,.14);
  color: white; font-size: 24px; font-weight: 800;
}
.member-profile-eyebrow { margin-bottom: 3px; color: #c9d7ff; font: 700 10px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.member-profile-hero h2 { font-size: 24px; color: white; }
.member-profile-hero p { margin-top: 4px; color: #d8e2ff; font-size: 12px; }
.member-profile-hero-status { align-items: flex-end; flex-direction: column; }
.member-profile-hero-status .btn { border-color: rgba(255,255,255,.35); color: white; background: rgba(255,255,255,.08); }
.member-profile-overview {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 190px; gap: 16px; padding: 20px;
}
.member-profile-overview.uniform-profile-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.uniform-profile-overview .stitch-profile-panel { margin: 0; }
.uniform-profile-overview .member-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.uniform-profile-overview .profile-finance-card { grid-column: 1 / -1; }
.profile-person-card, .profile-finance-card, .profile-section, .profile-side-card {
  border: 1px solid var(--color-surface-border); border-radius: 13px; background: white;
}
.profile-person-card { padding: 17px; }
.profile-person-card.nominee { border-top: 3px solid #7557c6; }
.profile-card-title { padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--color-surface-border); }
.profile-card-title strong, .profile-side-card-title strong { display: block; font-size: 13px; }
.profile-card-title small, .profile-side-card-title small { display: block; margin-top: 2px; color: var(--color-on-surface-variant); font-size: 10px; }
.profile-card-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: #eaf0ff; color: var(--color-primary);
}
.profile-card-icon .icon { width: 18px; height: 18px; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.profile-facts .wide { grid-column: 1 / -1; }
.profile-facts dt { color: var(--color-on-surface-variant); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.profile-facts dd { margin: 3px 0 0; color: var(--color-on-surface); font-size: 12px; line-height: 1.45; }
.profile-facts dd.mono { font-family: var(--font-mono); }
.profile-finance-card { padding: 18px; background: linear-gradient(145deg, #f1f6ff, white); }
.profile-finance-card > span { color: var(--color-on-surface-variant); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.profile-finance-card > strong { display: block; margin: 8px 0 14px; font: 800 22px var(--font-mono); color: var(--color-primary); }
.profile-finance-card small { display: block; margin-top: 11px; color: var(--color-on-surface-variant); font-size: 10px; }
.member-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 0 20px 20px; align-items: start; }
.profile-section { padding: 20px; }
.profile-section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 16px; }
.profile-section-kicker { color: var(--color-primary); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.profile-section-header h3 { margin-top: 3px; font-size: 18px; }
.profile-section-header p { margin-top: 4px; color: var(--color-on-surface-variant); font-size: 11px; }
.member-review-sidebar { display: grid; gap: 14px; }
.profile-side-card { padding: 16px; }
.profile-side-card-title { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--color-surface-border); }
.profile-side-card-title > .icon { width: 20px; height: 20px; color: var(--color-primary); }
.profile-side-card #uploadDocForm { display: grid; gap: 10px; margin-top: 0 !important; }
.profile-side-card #uploadDocForm > div, .profile-side-card #uploadDocForm .field-select, .profile-side-card #uploadDocForm .field-input { width: 100%; }
.profile-decision-form { display: grid; gap: 10px; }
.profile-decision-form .field-textarea { min-height: 78px; }
.profile-decision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.profile-decision-actions .btn { min-width: 0; min-height: 42px; justify-content: center; text-align: center; }
.profile-decision-actions .btn span { line-height: 1.2; }
.profile-review-completion {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--color-surface-border);
}
.profile-review-completion-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: stretch;
}
.profile-review-completion-form .field-textarea { min-height: 72px; resize: vertical; }
.profile-review-completion-actions { display: flex; gap: 10px; align-items: stretch; }
.profile-review-completion-actions .btn {
  min-width: 148px;
  justify-content: center;
  text-align: center;
}
.profile-history { display: grid; gap: 12px; }
.profile-history-item { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 9px; }
.profile-history-item .timeline-dot { position: static; margin-top: 4px; }
.profile-history-item strong { font-size: 11px; }
.profile-history-item p { margin: 2px 0; color: var(--color-on-surface-variant); font-size: 10px; }
.profile-history-item small { color: var(--color-on-surface-variant); font-size: 9px; }
.profile-empty-state { padding: 18px 10px; text-align: center; color: var(--color-on-surface-variant); }
.profile-empty-state .icon { width: 24px; height: 24px; margin-bottom: 6px; }
.profile-empty-state p { font-size: 10px; }

@media (max-width: 1120px) {
  .member-profile-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-finance-card { grid-column: 1 / -1; }
  .member-workspace-grid { grid-template-columns: 1fr; }
  .member-review-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .member-profile-hero { align-items: flex-start; padding: 20px; }
  .member-profile-hero-status { align-items: flex-end; }
  .member-profile-hero-status > .status-badge { display: none; }
  .member-profile-overview,
  .member-profile-overview.uniform-profile-overview { grid-template-columns: 1fr; padding: 14px; }
  .profile-finance-card { grid-column: auto; }
  .member-workspace-grid { padding: 0 14px 14px; }
  .member-review-sidebar { grid-template-columns: 1fr; }
  .profile-review-completion-form { grid-template-columns: 1fr; }
  .profile-review-completion-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .profile-review-completion-actions .btn { min-width: 0; }
}
@media (max-width: 480px) {
  .member-profile-identity { align-items: flex-start; }
  .member-profile-avatar { width: 44px; height: 44px; flex-basis: 44px; border-radius: 12px; font-size: 18px; }
  .member-profile-hero h2 { font-size: 19px; }
  .member-profile-hero-status .btn span { display: none; }
  .profile-facts { grid-template-columns: 1fr; }
  .profile-facts .wide { grid-column: auto; }
  .profile-section { padding: 14px; }
  .profile-section-header .secure-badge { display: none; }
}
.kyc-review-summary {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 14px;
  overflow: hidden; padding: 15px 16px 19px; margin-top: 12px; border: 1px solid var(--color-surface-border);
  border-radius: 11px; background: var(--color-surface-container-low);
}
.kyc-review-summary span, .kyc-review-summary strong { display: block; }
.kyc-review-summary > div > span { color: var(--color-on-surface-variant); font-size: 13px; }
.kyc-review-summary > div > strong { margin-top: 4px; font-size: 16px; line-height: 1.4; }
.kyc-summary-counts { display: flex; align-items: center; gap: 7px; }
.kyc-progress { position: absolute; inset: auto 0 0; height: 4px; background: #e1e5ee; }
.kyc-progress span { height: 100%; border-radius: 0 4px 4px 0; background: #2f9e62; transition: width .25s ease; }
.kyc-review-card {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 430px;
  overflow: hidden; border: 1px solid #dce3ef; border-radius: 13px;
  background: var(--color-surface-container-lowest); box-shadow: 0 4px 14px rgba(35, 55, 90, .06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kyc-review-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(35, 55, 90, .11); }
.kyc-review-card.approved { border-color: #a8dbbd; }
.kyc-review-card.rejected { border-color: #efb0ab; }
.kyc-review-card.pending { border-color: #e6cc91; }
.kyc-proof-preview {
  position: relative; display: block; width: 100%; aspect-ratio: 2 / 1;
  overflow: hidden; border-bottom: 1px solid #dce3ef; background: #edf0f6;
}
.kyc-proof-preview img { width: 100%; height: 100%; object-fit: contain; display: block; background: #f2f4f8; }
.kyc-open-overlay {
  position: absolute; inset: auto 8px 8px; display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 7px; border-radius: 8px; background: rgba(20, 31, 57, .84); color: white;
  font-size: 11px; font-weight: 800;
}
.kyc-preview-hint {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 8px; border-radius: 7px; background: rgba(24, 38, 67, .8); color: white;
  font-size: 12px; font-weight: 800; opacity: 0; transform: translateY(-3px); transition: .18s ease;
}
.kyc-proof-preview:hover .kyc-preview-hint { opacity: 1; transform: translateY(0); }
.kyc-preview-shell { position: relative; }
.kyc-inline-upload-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kyc-inline-upload-label { position: relative; width: 100%; justify-content: center; margin-top: 8px; cursor: pointer; }
.kyc-inline-number, .kyc-inline-doc-type { width: 100%; margin-top: 8px; }
.kyc-pdf-preview { height: 100%; min-height: 138px; display: grid; place-content: center; gap: 6px; text-align: center; color: var(--color-primary); }
.kyc-pdf-preview .icon { width: 32px; height: 32px; margin: auto; }
.kyc-review-copy { min-width: 0; display: flex; flex-direction: column; padding: 16px; }
.kyc-review-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.kyc-review-title strong { font-size: 18px; line-height: 1.35; }
.kyc-review-title .status-badge { padding: 7px 12px; font-size: 12px; }
.kyc-review-copy > span, .kyc-review-copy small {
  display: block; color: var(--color-on-surface-variant); font-size: 13px; line-height: 1.5;
}
.kyc-reviewed-by { margin-top: 4px; }
.kyc-document-number {
  margin: 4px 0 12px; padding: 7px 9px; border-radius: 7px; background: var(--color-surface-container-low);
  font: 700 12px var(--font-mono); letter-spacing: .04em;
}
.kyc-number-block { padding: 10px 12px; margin: 2px 0 10px; border-radius: 10px; background: #f3f6fb; }
.kyc-number-block span { display: block; color: var(--color-on-surface-variant); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kyc-number-block strong { display: block; margin-top: 6px; overflow-wrap: anywhere; font: 700 16px var(--font-mono); line-height: 1.4; color: #21345d; }
.kyc-review-note {
  display: flex; align-items: center; gap: 7px; padding: 10px 12px; margin-bottom: 16px;
  border-radius: 9px; background: #f4f7ff; color: var(--color-on-surface-variant); font-size: 13px; line-height: 1.5;
}
.kyc-existing-remark {
  padding: 7px 9px; margin-top: 9px; border-left: 3px solid #e8a63c; border-radius: 5px;
  background: #fff8e9; color: var(--color-on-surface-variant); font-size: 13px;
}
.kyc-existing-remark strong { display: block; margin-bottom: 4px; color: var(--color-on-surface); font-size: 14px; }
.kyc-review-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
}
.kyc-review-result[hidden] { display: none; }
.kyc-review-result > div { min-width: 0; }
.kyc-review-result span { display: block; overflow-wrap: anywhere; line-height: 1.45; }
.kyc-review-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid #d4b56f;
  border-radius: 8px;
  background: white;
  color: #785619;
  cursor: pointer;
}
.kyc-review-icon-btn:hover { border-color: #c28d27; background: #fff4d8; }
.kyc-review-icon-btn .icon { width: 16px; height: 16px; }
.kyc-proof-actions { padding-top: 11px; margin-top: auto; border-top: 1px solid var(--color-surface-border); }
.kyc-proof-actions.is-collapsed { display: none; }
.kyc-review-edit-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.kyc-proof-actions .field-input { min-height: 44px; padding: 10px 12px; font-size: 13px; }
.kyc-review-edit-field .kyc-review-icon-btn { border-color: var(--color-surface-border); color: var(--color-on-surface-variant); }
.kyc-proof-action-buttons { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.kyc-proof-action-buttons.review-only { grid-template-columns: 1fr 1fr; }
.kyc-proof-action-buttons .btn {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}
.kyc-proof-action-buttons .btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.kyc-proof-actions .reject { color: #b42318; border-color: #efb2ad; }
.kyc-view-proof-btn { color: #344667; border-color: #bac5d8; background: #f7f9fc; }
.kyc-action-replace { position: relative; cursor: pointer; }
.kyc-action-replace input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.kyc-review-card.missing { border-style: dashed; border-color: #d0d8e6; background: rgba(255,255,255,.72); box-shadow: none; }
.kyc-review-card.missing:hover { transform: none; box-shadow: none; }
.kyc-missing-preview {
  display: grid; place-content: center; justify-items: center; gap: 8px; width: 100%; aspect-ratio: 2 / 1;
  background: repeating-linear-gradient(135deg, #f1f4f9, #f1f4f9 10px, #f7f9fc 10px, #f7f9fc 20px);
  color: #8290aa; text-align: center; font-size: 13px;
}
.kyc-missing-preview .icon { width: 26px; height: 26px; }
.kyc-missing-message { margin-top: 10px; color: var(--color-on-surface-variant); font-size: 13px; line-height: 1.55; }
.kyc-required-label {
  display: flex; align-items: center; gap: 6px; padding: 8px; margin-top: auto; border-radius: 7px;
  background: #fff5e6; color: #935b13; font-size: 12px; font-weight: 700;
}
.kyc-final-lock {
  display: flex; gap: 10px; padding: 12px 14px; margin: 10px 0 14px; border: 1px solid #efd9a4;
  border-radius: 9px; background: #fff9e9; color: #785619;
}
.kyc-final-lock .icon { flex: 0 0 20px; }
.kyc-final-lock strong { font-size: 12px; }
.kyc-final-lock p { margin-top: 2px; font-size: 10px; }
@media (max-width: 900px) {
  .kyc-review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .kyc-proof-group { padding: 11px; }
  .kyc-review-card { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 400px; }
  .kyc-review-summary { align-items: flex-start; flex-direction: column; }
  .kyc-proof-action-buttons { grid-template-columns: 1fr 1fr; }
  .kyc-view-proof-btn { grid-column: 1 / -1; }
}

.hierarchy-list {
  display: grid;
  gap: var(--space-2);
}

.hierarchy-node {
  border-left: 2px solid var(--color-surface-border);
  padding: var(--space-2) 0 var(--space-2) var(--space-3);
}

.stitch-progress-row {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.stitch-progress {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-surface-container);
}

.stitch-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--color-primary);
}

.stitch-progress span.success { background: var(--color-success); }
.stitch-progress span.warning { background: var(--color-warning); }
.stitch-progress span.danger { background: var(--color-error-red); }

.stitch-insight {
  padding: 16px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: rgba(216, 226, 255, 0.32);
}

.stitch-insight strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  font-family: var(--font-mono);
  font-size: var(--fs-body-sm);
  font-weight: 850;
}

.stitch-insight p {
  margin-top: 10px;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-md);
}

.compact-map {
  min-height: 160px;
  height: 160px;
}

.collection-trend-bars {
  height: 210px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0 8px;
  border-left: 1px solid var(--color-outline-variant);
  border-bottom: 1px solid var(--color-outline-variant);
}

.collection-trend-bar {
  flex: 1 1 0;
  min-width: 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: rgba(0, 35, 111, 0.18);
}

.collection-trend-bar.active {
  background: var(--color-secondary);
}

.collection-trend-bar.projected {
  border: 2px dashed rgba(0, 88, 190, 0.42);
  background: transparent;
}

.collection-trend-labels {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  font-size: var(--fs-label-sm);
  font-weight: 800;
  text-align: center;
}

.sync-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.penalty-rule-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.penalty-rule-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-container-low);
}

.penalty-rule-card.muted {
  opacity: 0.62;
}

.penalty-rule-card .metric-icon {
  margin-bottom: 0;
}

.penalty-rule-card strong {
  color: var(--color-primary);
  font-size: var(--fs-body-lg);
}

.modal-dialog {
  border: 1px solid var(--color-surface-border);
}

.mobile-nav {
  display: none;
}

.app-footer {
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-body-sm);
  opacity: 0.62;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .stitch-detail-grid {
    grid-template-columns: 1fr;
  }

  .stitch-info-grid,
  .stitch-loan-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    overflow: visible;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    height: 100vh;
  }

  .topbar {
    height: auto;
    min-height: 68px;
    padding: 12px 16px;
  }

  .search-box {
    max-width: none;
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar-icon:nth-child(2),
  .topbar-icon:nth-child(3),
  .topbar-divider,
  .profile-copy {
    display: none;
  }

  .content-body {
    padding: 28px 16px 112px;
  }

  .loan-detail-hero,
  .loan-detail-actionbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .loan-detail-hero-status {
    width: 100%;
    justify-content: space-between;
  }

  .loan-detail-actionbar .panel-actions {
    width: 100%;
  }

  .page-header {
    align-items: stretch;
  }

  .page-header h1 {
    font-size: var(--fs-headline-md);
    line-height: var(--lh-headline-md);
  }

  .page-header .btn {
    width: 100%;
  }

  .metric-grid,
  .filter-bar,
  .collection-filter-grid,
  .stitch-info-grid,
  .stitch-loan-metrics,
  .document-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .collections-tab-panel .metric-grid,
  .collection-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-filter-grid {
    gap: 18px;
  }

  .stitch-detail-header {
    align-items: stretch;
  }

  .stitch-detail-header .panel-actions {
    width: 100%;
  }

  .stitch-detail-header .panel-actions > * {
    flex: 1 1 100%;
  }

  .metric-card {
    min-height: 104px;
  }

  .panel-header,
  .panel-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions,
  .panel-tools {
    width: 100%;
  }

  .panel-actions > *,
  .panel-tools > *,
  .filter-select {
    flex: 1 1 100%;
    width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 14px 16px;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    height: 70px;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow: hidden;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-surface-border);
    background: var(--color-surface-container-lowest);
  }

  .mobile-nav-link {
    min-width: 0;
    flex: 1 1 0;
    height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: var(--radius-md);
    color: var(--color-on-surface-variant);
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-nav-link.active {
    color: var(--color-secondary);
    background: rgba(216, 226, 255, 0.5);
  }

  /* Bottom bar is horizontal, so the back control gets a side divider
     instead of the sidebar's bottom one. */
  .mobile-nav-link.nav-back-link {
    border-bottom: none;
    border-right: 1px solid var(--color-surface-border);
    margin-bottom: 0;
    padding-bottom: 4px;
  }

  .app-footer {
    display: none;
  }
}

@media (max-width: 640px) {
  .collections-tab-panel .metric-grid,
  .collection-filter-grid {
    grid-template-columns: 1fr;
  }

  .loan-detail-hero {
    padding: 22px 18px;
  }

  .loan-detail-identity {
    align-items: flex-start;
  }

  .loan-detail-icon {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .loan-detail-hero-status,
  .loan-detail-hero-status .btn,
  .loan-detail-actionbar .panel-actions,
  .loan-detail-actionbar .panel-actions .btn {
    width: 100%;
  }

  .loan-detail-actionbar .panel-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .loan-detail-grid {
    padding: 16px;
  }
}

@media (max-width: 1040px) {
  .login-shell {
    width: min(100%, 920px);
  }

  .login-visual {
    padding: 48px 40px;
  }

  .login-form-panel {
    padding: 56px 48px;
  }

  .login-hero-copy h2 {
    font-size: 30px;
    line-height: 38px;
  }
}

@media (max-width: 760px) {
  .login-screen {
    height: auto;
    min-height: 100vh;
    display: grid;
    place-items: start center;
    padding: 24px 16px 48px;
  }

  .login-shell {
    width: 100%;
    display: block;
    min-height: 0;
    max-width: 480px;
  }

  .login-visual {
    display: none;
  }

  .login-form-panel {
    padding: 32px 24px;
  }

  .login-mobile-brand {
    display: flex;
  }

  .login-heading {
    margin-bottom: 32px;
  }

  .login-heading h2 {
    font-size: var(--fs-headline-md);
    line-height: var(--lh-headline-md);
  }

  .login-heading p {
    font-size: var(--fs-body-md);
    line-height: var(--lh-body-md);
  }

  .login-form {
    gap: 20px;
  }

  .login-label-row {
    align-items: flex-start;
  }

  .login-input {
    min-height: 56px;
  }

  .login-submit {
    min-height: 58px;
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body-lg);
  }

  .login-security-note {
    margin-top: 32px;
    padding-top: 24px;
  }

  .login-copyright {
    position: static;
    margin-top: 28px;
    padding: 0 16px;
  }
}

@media (max-height: 760px) and (min-width: 761px) {
  .login-screen {
    align-items: flex-start;
    padding-top: 32px;
    padding-bottom: 72px;
  }

  .login-shell {
    min-height: 600px;
  }

  .login-form-panel {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .login-copyright {
    bottom: 18px;
  }
}

/* Full-page member enrollment */
.enrollment-page { max-width: 1240px; margin: 0 auto; }
.enrollment-topbar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  margin-bottom: 22px;
}
.enrollment-topbar h1 { font-size: 26px; line-height: 1.25; }
.enrollment-topbar p { margin-top: 3px; color: var(--color-on-surface-variant); }
.enrollment-topbar-with-back {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "back back"
    "heading security";
  row-gap: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-surface-border);
}
.directory-back {
  grid-area: back;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 14px 0 11px;
  border: 1px solid #c8d2e5;
  border-radius: 10px;
  background: var(--color-surface-container-lowest);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(24, 48, 92, .06);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.directory-back .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.directory-back:hover {
  border-color: #9aafd3;
  background: #f3f6fc;
  box-shadow: 0 3px 8px rgba(24, 48, 92, .1);
}
.directory-back:focus-visible {
  outline: 3px solid rgba(25, 82, 173, .2);
  outline-offset: 2px;
}
.directory-back:active { transform: translateY(1px); }
.enrollment-page-heading { grid-area: heading; align-self: center; }
.enrollment-topbar-with-back .secure-badge { grid-area: security; align-self: center; }
.secure-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px;
  border-radius: 999px; background: #eaf8f0; color: #18784b; font-size: 12px; font-weight: 800;
}
.enrollment-layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 24px; align-items: start; }
.enrollment-rail {
  position: sticky; top: 20px; padding: 18px; border: 1px solid var(--color-surface-border);
  border-radius: var(--radius-lg); background: var(--color-surface-container-lowest);
}
.enrollment-rail h3 { margin: 0 0 14px; font-size: 14px; }
.enrollment-step {
  display: flex; align-items: center; gap: 11px; padding: 10px 8px; border-radius: 10px;
  color: var(--color-on-surface-variant); text-decoration: none;
}
.enrollment-step:hover, .enrollment-step.active { background: var(--color-surface-container-low); color: var(--color-primary); }
.enrollment-step > span {
  display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px;
  border: 1px solid var(--color-surface-border); border-radius: 50%; font: 700 12px var(--font-mono); background: white;
}
.enrollment-step strong, .enrollment-step small { display: block; }
.enrollment-step strong { font-size: 13px; color: var(--color-on-surface); }
.enrollment-step small { margin-top: 2px; font-size: 11px; }
.enrollment-help {
  display: flex; gap: 9px; margin-top: 16px; padding: 12px; border-radius: 10px;
  background: #f5f7ff; color: var(--color-on-surface-variant); font-size: 11px; line-height: 1.45;
}
.enrollment-help .icon { flex: 0 0 18px; color: var(--color-primary); }
.enrollment-help strong { color: var(--color-on-surface); font-size: 12px; }
.enrollment-help p { margin-top: 3px; }
.enrollment-form { display: grid; gap: 18px; min-width: 0; }
.enrollment-section {
  padding: 24px; border: 1px solid var(--color-surface-border); border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest); scroll-margin-top: 20px;
}
.enrollment-section-head {
  display: flex; align-items: center; gap: 12px; padding-bottom: 18px; margin-bottom: 20px;
  border-bottom: 1px solid var(--color-surface-border);
}
.section-number {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--color-primary); color: white; font: 800 13px var(--font-mono);
}
.enrollment-section-head h2 { font-size: 18px; }
.enrollment-section-head p { margin-top: 2px; color: var(--color-on-surface-variant); font-size: 12px; }
.section-status, .required-chip {
  margin-left: auto; padding: 5px 9px; border-radius: 999px; background: #fff3dc;
  color: #9a5b00; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.enrollment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.enrollment-grid .span-2 { grid-column: 1 / -1; }
.required-mark { color: #c43d3d; }
.enrollment-proof-card {
  padding: 17px; margin-top: 13px; border: 1px solid var(--color-surface-border);
  border-radius: 12px; background: var(--color-surface-container-low);
}
.enrollment-proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.enrollment-proof-grid .enrollment-proof-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 300px;
  margin-top: 0;
  padding: 16px;
  border-radius: 12px;
}
.enrollment-proof-grid .proof-card-heading {
  min-height: 44px;
  margin-bottom: 14px;
}
.enrollment-proof-grid .proof-card-heading h4 { font-size: 14px; }
.enrollment-proof-grid .proof-card-heading p { font-size: 10px; }
.enrollment-proof-grid .proof-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
}
.enrollment-proof-grid .proof-icon .icon { width: 16px; height: 16px; }
.enrollment-proof-grid .required-chip {
  padding: 4px 7px;
  font-size: 9px;
}
.enrollment-proof-grid .enrollment-proof-card.has-proof { border-color: #9fd6b5; }
.enrollment-proof-grid .required-chip.selected { background: #e7f8ef; color: #16794b; }
.enrollment-proof-grid .enrollment-proof-fields {
  grid-template-columns: 1fr;
  gap: 12px;
}
.enrollment-proof-grid .field-input,
.enrollment-proof-grid .field-select { min-height: 42px; }
.enrollment-proof-grid .field-hint { font-size: 10px; line-height: 1.4; }
.enrollment-proof-grid .proof-dropzone {
  min-height: 84px;
  padding: 9px;
}
.enrollment-proof-grid .identity-choice { margin-bottom: 12px; }
.enrollment-proof-grid .identity-choice span { padding: 7px 13px; }
.enrollment-proof-grid .compact-proof .proof-dropzone {
  flex: 1;
  min-height: 174px;
  margin-top: 0;
}
.proof-card-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.proof-card-heading h4 { font-size: 14px; }
.proof-card-heading p { margin-top: 2px; color: var(--color-on-surface-variant); font-size: 11px; }
.proof-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: #e8eeff; color: var(--color-primary);
}
.proof-icon .icon { width: 18px; height: 18px; }
.enrollment-proof-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: start; }
.proof-upload-field { min-width: 0; }
.proof-upload-field > .field-label { display: block; margin-bottom: 6px; }
.proof-upload-field .proof-dropzone { width: 100%; }
.proof-dropzone {
  position: relative;
  min-height: 66px; display: grid; place-items: center; padding: 10px; border: 1.5px dashed #9aabd1;
  border-radius: 10px; background: white; color: var(--color-primary); cursor: pointer; overflow: hidden;
}
.proof-dropzone:hover { border-color: var(--color-primary); background: #f7f9ff; }
.proof-dropzone input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  cursor: pointer; z-index: 2;
}
.proof-dropzone span { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; font-size: 12px; }
.proof-dropzone small { width: 100%; text-align: center; color: var(--color-on-surface-variant); font-size: 10px; }
.proof-dropzone.wide { margin-top: 6px; }
.proof-dropzone.has-file { border-style: solid; border-color: #36a66a; background: #f1fbf5; color: #18784b; }
.proof-dropzone.has-file strong {
  display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.identity-choice { display: flex; gap: 10px; margin-bottom: 14px; }
.identity-choice label { position: relative; cursor: pointer; }
.identity-choice input { position: absolute; opacity: 0; }
.identity-choice span {
  display: block; padding: 8px 15px; border: 1px solid var(--color-surface-border);
  border-radius: 9px; background: white; font-size: 12px; font-weight: 700;
}
.identity-choice input:checked + span { border-color: var(--color-primary); background: #eaf0ff; color: var(--color-primary); }
.compact-proof .proof-card-heading { margin-bottom: 8px; }
.enrollment-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 20px; border: 1px solid var(--color-surface-border); border-radius: var(--radius-lg);
  background: var(--color-surface-container-lowest);
}
.enrollment-actions strong { font-size: 14px; }
.enrollment-actions p { margin-top: 2px; color: var(--color-on-surface-variant); font-size: 11px; }

@media (max-width: 900px) {
  .enrollment-layout { grid-template-columns: 1fr; }
  .enrollment-rail { position: static; display: none; }
}
@media (max-width: 640px) {
  .enrollment-topbar { grid-template-columns: auto 1fr; }
  .enrollment-topbar-with-back {
    grid-template-columns: 1fr;
    grid-template-areas: "back" "heading";
    row-gap: 12px;
  }
  .directory-back { width: 100%; justify-content: flex-start; }
  .secure-badge { display: none; }
  .enrollment-topbar h1 { font-size: 20px; }
  .enrollment-section { padding: 17px; }
  .enrollment-grid, .enrollment-proof-fields, .enrollment-proof-grid { grid-template-columns: 1fr; }
  .enrollment-grid .span-2 { grid-column: auto; }
  .section-status { display: none; }
  .enrollment-actions div { display: none; }
  .enrollment-actions .btn { width: 100%; justify-content: center; }
}

/* Stitch-inspired member profile: compact professional field utility */
.member-workspace {
  border-color: #c5c5d3;
  border-radius: 12px;
  background: #f7f9fb;
  box-shadow: 0 2px 6px rgba(25, 28, 30, .06);
}

.member-profile-hero {
  padding: 28px;
  border-bottom: 0;
  background: #00236f;
}

.member-profile-avatar {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
  border-radius: 12px;
  background: rgba(255,255,255,.14);
  font-size: 24px;
}

.member-profile-eyebrow {
  color: #dce1ff;
  font-size: 11px;
  letter-spacing: .09em;
}

.member-profile-hero h2 { margin-top: 2px; font-size: 28px; line-height: 1.3; }
.member-profile-hero p { color: #d3e4fe; font-size: 14px; }
.member-profile-hero-status { flex-direction: row; align-items: center; }
.member-profile-hero-status .status-badge { padding: 9px 14px; }
.member-profile-hero-status .btn { min-height: 44px; border-radius: 8px; }

.member-profile-overview.uniform-profile-overview {
  grid-template-columns: minmax(0, 5fr) minmax(0, 5fr) minmax(180px, 2fr);
  gap: 18px;
  padding: 20px;
}

.uniform-profile-overview .stitch-profile-panel {
  padding: 20px;
  border: 1px solid #c5c5d3;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(25, 28, 30, .04);
}

.uniform-profile-overview .profile-finance-card {
  grid-column: auto;
  padding: 20px;
  border: 0;
  border-radius: 10px;
  background: #1e3a8a;
  color: white;
  box-shadow: none;
}

.uniform-profile-overview .profile-finance-card > span,
.uniform-profile-overview .profile-finance-card small { color: #d3e4fe; font-size: 11px; }
.uniform-profile-overview .profile-finance-card > strong {
  margin: 10px 0 20px;
  color: white;
  font-size: 26px;
}
.uniform-profile-overview .profile-finance-card .status-badge {
  background: #16a34a;
  color: white;
}

.uniform-profile-overview .member-profile-block {
  align-items: center;
  flex-wrap: nowrap;
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.uniform-profile-overview .person-cell { min-width: 0; }
.uniform-profile-overview .person-cell h2 { font-size: 18px; }
.uniform-profile-overview .person-cell p {
  max-width: 300px;
  overflow: hidden;
  color: #444651;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uniform-profile-overview .chip {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 10px;
  text-transform: uppercase;
}
.uniform-profile-overview .member-info-grid { gap: 18px 24px; }
.uniform-profile-overview .member-centre-panel { grid-column: 1 / -1; }
.uniform-profile-overview .member-centre-info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.uniform-profile-overview .stitch-label { margin-bottom: 2px; color: #444651; font-size: 10px; }
.uniform-profile-overview .stitch-value { font-size: 14px; line-height: 1.4; }

.member-workspace-grid { padding: 0 20px 20px; }
.profile-section {
  padding: 0;
  overflow: hidden;
  border-color: #c5c5d3;
  border-radius: 10px;
  background: #f2f4f6;
  box-shadow: 0 1px 3px rgba(25, 28, 30, .04);
}
.profile-section-header { padding: 28px 28px 0; margin: 0; }
.profile-section-kicker { color: #00236f; font-size: 11px; }
.profile-section-header h3 { margin-top: 5px; font-size: 22px; }
.profile-section-header p { margin-top: 5px; color: #444651; font-size: 14px; }
.secure-badge { border-radius: 999px; background: #e4f4eb; color: #16794b; }

.kyc-review-summary {
  margin: 20px 28px 28px;
  padding: 16px 18px 22px;
  border-color: #c5c5d3;
  border-radius: 10px;
  background: white;
}
.kyc-review-summary > div > span { font-size: 12px; }
.kyc-review-summary > div > strong { font-size: 16px; }
.kyc-progress { inset: auto 18px 14px; height: 6px; border-radius: 999px; }
.kyc-progress span { border-radius: 999px; background: #16a34a; }

.kyc-proof-groups {
  gap: 0;
  margin: 0;
  border-top: 1px solid #c5c5d3;
  background: white;
}
.kyc-proof-group,
.kyc-proof-group.nominee {
  padding: 24px 28px;
  border: 0;
  border-bottom: 1px solid #c5c5d3;
  border-radius: 0;
  background: white;
}
.kyc-proof-group-header h4 { color: #191c1e; font-size: 18px; }
.kyc-proof-group.nominee .kyc-proof-group-header h4 { color: #191c1e; }
.kyc-proof-group-header p { font-size: 12px; }
.kyc-proof-group-header > span { padding: 5px 10px; background: #eceef0; font-size: 10px; }

.kyc-review-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.kyc-review-card {
  min-height: 0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(25, 28, 30, .05);
  transform: none;
}
.kyc-review-card:hover { transform: none; box-shadow: 0 2px 7px rgba(25, 28, 30, .09); }
.kyc-review-card.approved { border-color: #a7dbbb; }
.kyc-review-card.rejected { border-color: #f0aaa5; }
.kyc-review-card.pending { border-color: #ca8a04; box-shadow: 0 0 0 2px rgba(0,35,111,.85); }
.kyc-proof-preview { aspect-ratio: 4 / 2.25; }
.kyc-missing-preview { aspect-ratio: 4 / 2.25; }
.kyc-preview-hint {
  top: 8px;
  right: 8px;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 10px;
  opacity: 1;
  transform: none;
}
.kyc-review-copy { padding: 14px; }
.kyc-review-title { margin-bottom: 10px; }
.kyc-review-title strong { font-size: 16px; }
.kyc-review-title .status-badge { padding: 5px 7px; font-size: 9px; }
.kyc-number-block { padding: 9px 10px; margin-bottom: 10px; border-radius: 7px; background: #f2f4f6; }
.kyc-number-block span { font-size: 9px; }
.kyc-number-block strong { margin-top: 4px; font-size: 14px; }
.kyc-review-copy > span,
.kyc-review-copy small { font-size: 11px; }
.kyc-existing-remark { margin-top: 10px; font-size: 11px; }
.kyc-existing-remark strong { font-size: 12px; }
.kyc-review-icon-btn { width: 30px; height: 30px; flex-basis: 30px; border: 0; background: transparent; }
.kyc-proof-actions .field-input { min-height: 42px; font-size: 12px; }
.kyc-proof-action-buttons .btn { min-height: 42px; padding: 7px 5px; border-radius: 7px; font-size: 11px; }

.kyc-review-note {
  margin: 22px 28px;
  padding: 14px 16px;
  border: 1px solid #b6c4e0;
  background: #f0f3fa;
  color: #00236f;
}
.profile-review-completion {
  margin: 0;
  padding: 28px;
  border-top: 1px solid #c5c5d3;
}
.profile-review-completion-form .field-textarea {
  min-height: 94px;
  border-radius: 8px;
  background: white;
}
.profile-review-completion-actions { flex-direction: column-reverse; }
.profile-review-completion-actions .btn { min-width: 240px; min-height: 48px; border-radius: 8px; }
.profile-review-completion-actions .btn-primary { background: #16a34a; border-color: #16a34a; }

/* Staff profile follows the member-profile workspace language */
.staff-workspace .member-profile-hero-status .role-chip {
  padding: 9px 14px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.14);
  color: white;
}
.member-profile-overview.staff-profile-overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.staff-profile-overview .stitch-profile-panel { min-width: 0; }
.staff-workspace-grid { gap: 20px; }
.staff-workspace .profile-section + .profile-section { margin-top: 20px; }
.staff-proof-summary {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 28px 28px;
  padding: 16px 18px 24px;
  border: 1px solid #c5c5d3;
  border-radius: 10px;
  background: white;
}
.staff-proof-summary > div:first-child span,
.staff-proof-summary > div:first-child strong { display: block; }
.staff-proof-summary > div:first-child span { color: #444651; font-size: 12px; }
.staff-proof-summary > div:first-child strong { margin-top: 3px; font-size: 16px; }
.staff-proof-summary .kyc-progress { position: absolute; inset: auto 18px 13px; }
.staff-proof-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 28px 28px;
}
.staff-proof-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #c5c5d3;
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 3px rgba(25, 28, 30, .05);
}
.staff-proof-card.missing { border-style: dashed; }
.staff-proof-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  border-bottom: 1px solid #d7d9dd;
  background: #e9edf3;
  color: #00236f;
  text-decoration: none;
}
.staff-proof-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.staff-proof-file-preview,
.staff-proof-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #444651;
}
.staff-proof-file-preview .icon,
.staff-proof-missing .icon { width: 26px; height: 26px; color: #00236f; }
.staff-proof-file-preview strong { font-size: 13px; }
.staff-proof-file-preview small,
.staff-proof-missing span { font-size: 11px; }
.staff-proof-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(0, 35, 111, .9);
  color: white;
  font-size: 10px;
  font-weight: 700;
}
.staff-proof-copy { padding: 16px; }
.staff-proof-copy > div {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.staff-proof-copy > div > strong { font-size: 16px; }
.staff-proof-copy > span {
  color: #444651;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.staff-proof-copy > p { margin-top: 4px; font-size: 14px; font-weight: 700; }
.staff-proof-copy > small { display: block; margin-top: 11px; color: #5f626c; font-size: 11px; }
.staff-operations-section { background: white; }
.staff-operations-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px 28px 28px;
}
.staff-operation-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid #c5c5d3;
  border-radius: 10px;
  background: #f8f9fb;
}
.staff-operation-card .profile-side-card-title {
  justify-content: flex-start;
  min-height: 44px;
}
.staff-operation-card .table-wrap {
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  background: white;
}
.staff-operation-card .data-table th,
.staff-operation-card .data-table td { padding: 11px 12px; }
.staff-operation-card .hierarchy-list { display: grid; gap: 9px; }
.staff-operation-card .hierarchy-node {
  padding: 10px 12px;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  background: white;
}

.division-branch-picker { display: grid; gap: 20px; }
.division-branch-picker-copy {
  margin: 0;
  color: #5f626c;
  font-size: 13px;
  line-height: 1.55;
}
.division-branch-search { position: relative; }
.division-branch-search > .icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  color: #70737c;
  pointer-events: none;
  transform: translateY(-50%);
}
.division-branch-search .field-input { padding-left: 40px; }
.division-branch-hint {
  display: block;
  margin-top: 6px;
  color: #70737c;
  font-size: 11px;
}
.division-branch-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #30323a;
  font-size: 12px;
}
.division-branch-section-heading span {
  color: #5f626c;
  font-size: 11px;
  font-weight: 600;
}
.division-branch-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  background: #f8f9fb;
}
.division-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 28px;
  padding: 3px 5px 3px 10px;
  border: 1px solid #b8c7e8;
  border-radius: 999px;
  background: #edf3ff;
  color: #00236f;
  font-size: 12px;
  font-weight: 700;
}
.division-branch-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.division-branch-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #00236f;
  cursor: pointer;
}
.division-branch-remove .icon { width: 13px; height: 13px; }
.division-branch-remove:hover { background: #d9e5fc; }
.division-branch-remove:focus-visible,
.division-branch-result:focus-visible {
  outline: 2px solid #2457a7;
  outline-offset: 2px;
}
.division-branch-results {
  position: relative;
  z-index: 0;
  display: grid;
  gap: 7px;
  max-height: min(230px, 34vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3px;
}
.division-branch-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  background: white;
  color: #30323a;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.division-branch-result:hover {
  border-color: #9eb4df;
  background: #f5f8ff;
  transform: translateY(-1px);
}
.division-branch-result:active { transform: translateY(0); }
.division-branch-result-copy { display: grid; gap: 2px; min-width: 0; }
.division-branch-result-copy strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.division-branch-result-copy small { color: #70737c; font-size: 10px; }
.division-branch-add-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #00236f;
  font-size: 11px;
  font-weight: 800;
}
.division-branch-add-label .icon { width: 14px; height: 14px; }
.division-branch-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  color: #70737c;
  font-size: 12px;
  text-align: center;
}
.division-branch-error {
  margin: 7px 0 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.credential-autofill-decoy {
  position: fixed;
  top: -10000px;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 1320px) {
  .kyc-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .member-profile-overview.uniform-profile-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uniform-profile-overview .profile-finance-card { grid-column: 1 / -1; }
  .uniform-profile-overview .member-centre-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .division-branch-chip { max-width: 100%; }
  .division-branch-result { min-height: 52px; }
  .member-profile-hero { padding: 20px; }
  .member-profile-hero h2 { font-size: 23px; }
  .member-profile-hero-status { align-items: flex-end; flex-direction: column; }
  .member-profile-overview.uniform-profile-overview { grid-template-columns: 1fr; }
  .uniform-profile-overview .profile-finance-card { grid-column: auto; }
  .uniform-profile-overview .member-centre-panel { grid-column: auto; }
  .uniform-profile-overview .member-centre-info-grid { grid-template-columns: 1fr; }
  .profile-section-header { padding: 20px 18px 0; }
  .kyc-review-summary { margin: 18px; }
  .kyc-proof-group, .kyc-proof-group.nominee { padding: 20px 18px; }
  .kyc-review-grid { grid-template-columns: 1fr; }
  .kyc-review-note { margin: 18px; }
  .profile-review-completion { padding: 20px 18px; }
  .profile-review-completion-actions { display: grid; grid-template-columns: 1fr 1fr; flex-direction: initial; }
  .profile-review-completion-actions .btn { min-width: 0; }
  .member-profile-overview.staff-profile-overview,
  .staff-proof-grid,
  .staff-operations-grid { grid-template-columns: 1fr; }
  .staff-proof-summary { margin: 18px; align-items: flex-start; }
  .staff-proof-grid { padding: 0 18px 20px; }
  .staff-operations-grid { padding: 20px 18px; }
}

/* ---------------------------------------------------------------
   Application-wide form control consistency
   Keep text fields and dropdowns visually identical, and do not rely
   on the browser-specific select arrow supplied by the operating system.
   --------------------------------------------------------------- */
:where(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="tel"],
  input[type="email"],
  textarea,
  select
) {
  border: 1px solid var(--color-form-control-border) !important;
  border-radius: var(--form-control-radius) !important;
  background-color: var(--color-surface-container-lowest);
  color: var(--color-on-surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

:where(
  input[type="text"],
  input[type="search"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="tel"],
  input[type="email"],
  textarea,
  select
):focus {
  border-color: var(--color-secondary) !important;
  box-shadow: var(--shadow-focus-ring);
}

select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;
  cursor: pointer;
}

select:not([multiple]):disabled {
  background-color: var(--color-surface-container-low);
  cursor: not-allowed;
  opacity: 0.72;
}

:where(input:not([type="checkbox"]):not([type="radio"]), textarea):is([readonly], [disabled]) {
  background-color: var(--color-surface-container-low);
  cursor: not-allowed;
}

:where(input:not([type="checkbox"]):not([type="radio"]), textarea):is([readonly], [disabled]):focus {
  border-color: var(--color-form-control-border) !important;
  box-shadow: none;
}

/* Expense Management Modal Styles */
.modal-form {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-form .form-group {
  margin-bottom: var(--space-4);
}
.modal-form .form-group:last-child {
  margin-bottom: 0;
}
.expense-summary {
  background: var(--color-surface-container);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-surface-border);
  font-size: var(--fs-label-md);
}
.summary-row:last-child {
  border-bottom: none;
}
.summary-row span {
  color: var(--color-on-surface-variant);
}
.summary-row strong {
  color: var(--color-on-surface);
  font-weight: 600;
}

/* =================================================================
   Loan Product Full-Screen Wizard & Financial Summary
   ================================================================= */
.cashflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}
.cashflow-card {
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--color-surface-border);
  background: var(--color-surface-container-lowest);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cashflow-card.outgoing {
  border-left: 4px solid #ba1a1a;
  background: #fff8f7;
}
.cashflow-card.incoming {
  border-left: 4px solid #168846;
  background: #f4fbf6;
}
.cashflow-badge {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cashflow-card.outgoing .cashflow-badge {
  background: #ffdad6;
  color: #93000a;
}
.cashflow-card.incoming .cashflow-badge {
  background: #c8edd6;
  color: #0c6b32;
}
.cashflow-amount {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  margin: 4px 0;
}
.cashflow-card.outgoing .cashflow-amount {
  color: #ba1a1a;
}
.cashflow-card.incoming .cashflow-amount {
  color: #168846;
}
.cashflow-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  color: var(--color-on-surface-variant);
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 10px;
  margin-top: 4px;
}
.cashflow-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cashflow-list-item strong {
  color: var(--color-on-surface);
  font-family: var(--font-mono);
}

/* Live Projection Box (Section 3) */
.live-projection-box {
  background: #ffffff;
  border: 1px solid #dbe3f1;
  border-radius: 14px;
  padding: 20px 24px;
  width: 100%;
  box-shadow: 0 2px 8px rgba(0, 35, 102, 0.04);
}
.live-projection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 14px;
}
.live-projection-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  width: 100%;
}
.live-projection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
}
.live-projection-item .item-label {
  color: var(--color-on-surface-variant);
  font-size: 14px;
}
.live-projection-item .item-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-on-surface);
}
.live-projection-hr {
  border-top: 1px solid #e2e8f0;
  margin: 6px 0;
}
.live-projection-item.profit {
  padding: 10px 14px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #dcfce7;
}
.live-projection-item.profit .item-label {
  font-weight: 700;
  color: #166534;
  font-size: 14px;
}
.live-projection-item.profit .item-val {
  color: #168846;
  font-size: 16px;
  font-weight: 800;
}
.live-projection-profit-card {
  padding: 14px 18px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.profit-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.profit-title {
  font-size: 15px;
  font-weight: 700;
  color: #166534;
}
.profit-total {
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #168846;
}
.profit-breakdown-row {
  font-size: 12px;
  color: #15803d;
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #bbf7d0;
  padding-top: 6px;
  margin-top: 2px;
}
.item-sub {
  font-size: 11px;
  color: var(--color-on-surface-variant);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* Modal Summary on Save */
.product-summary-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.product-summary-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.product-summary-box {
  padding: 14px 16px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-summary-box.outgoing {
  background: #ffdad6;
  border: 1px solid #ffb4ab;
  color: #93000a;
}
.product-summary-box.incoming {
  background: #d4f4e1;
  border: 1px solid #9fd6b5;
  color: #0c6b32;
}
.product-summary-box .summary-box-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.product-summary-box .summary-box-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.product-summary-box .summary-box-sub {
  font-size: 11px;
  opacity: 0.85;
}
.product-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}
.product-summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-surface-border);
}
.product-summary-table tr:last-child td {
  border-bottom: none;
}
.product-summary-table tr.highlight-row {
  background: #f5f7ff;
  font-weight: 700;
}


/* Gift Fund hints stay visually lighter than entered values. */
#disburseGiftAmountInput::placeholder,
#disburseGiftPurposeInput::placeholder {
  color: var(--color-text-muted, #94a3b8);
  font-weight: 400;
  opacity: 0.65;
}


/* Brand Header Row Alignment */

.sidebar-brand-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sidebar-brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  margin-top: 2px;
}
.sidebar-brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sidebar-brand .org-name {
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
}
.sidebar-brand .org-sub {
  font-size: 11.5px;
  line-height: 15px;
  font-weight: 500;
  color: #64748b;
  margin-top: 2px;
}
.sidebar-whoami {
  font-size: 11.5px;
  line-height: 16px;
  font-weight: 600;
  color: #1d4ed8 !important;
  margin-top: 4px;
  display: block;
  opacity: 1 !important;
  letter-spacing: 0.01em;
}

/* ---------------------------------------------------------------
   Modern Rounded Card Login Screen (Tailwind Stitch Spec)
   --------------------------------------------------------------- */
.login-screen-stitch {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  background-color: #F3F6FB !important;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif !important;
  color: #1e293b;
  position: relative;
  box-sizing: border-box;
}

.login-shell-stitch {
  width: 100%;
  max-width: 1152px;
  background-color: #ffffff;
  border-radius: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(226, 232, 240, 0.8), 0 10px 25px -5px rgba(15, 23, 42, 0.05);
  border: 1px solid #f1f5f9;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 620px;
}

.login-brand-stitch {
  width: 50%;
  background-color: rgba(248, 250, 252, 0.6);
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-right: 1px solid #f1f5f9;
}

.login-logo-stitch-card {
  width: 260px;
  height: 260px;
  border-radius: 1.5rem;
  background-color: #ffffff;
  padding: 24px;
  box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  border: 1px solid #f1f5f9;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.login-logo-stitch-card:hover {
  transform: scale(1.05);
}

.login-logo-stitch-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-brand-stitch h1 {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0F2854;
  line-height: 1.25;
  text-align: center;
  max-width: 380px;
  margin: 0;
}

.login-form-stitch {
  width: 50%;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
}

.login-form-stitch-inner {
  width: 100%;
  max-width: 440px;
}

.login-field-stitch {
  margin-bottom: 24px;
}

.login-field-stitch label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #334155;
  margin-bottom: 10px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.login-input-stitch-wrap {
  position: relative;
  width: 100%;
}

.login-input-stitch {
  display: block;
  width: 100%;
  padding: 16px 20px;
  font-size: 18px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background-color: rgba(248, 250, 252, 0.6);
  color: #0f172a;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.login-input-stitch:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #0F2854;
  box-shadow: 0 0 0 3px rgba(15, 40, 84, 0.12);
}

.login-input-stitch.password-input {
  padding-right: 56px;
}

.login-password-toggle-stitch {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 6px;
  transition: color 0.15s ease;
}

.login-password-toggle-stitch:hover {
  color: #475569;
}

.login-submit-stitch {
  width: 100%;
  padding: 18px 28px;
  border-radius: 1rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #ffffff;
  background-color: #0F2854;
  border: none;
  cursor: pointer;
  box-shadow: 0 16px 28px -6px rgba(15, 40, 84, 0.3);
  transition: all 0.2s ease;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-submit-stitch:hover {
  background-color: #0A1D3D;
  box-shadow: 0 20px 32px -6px rgba(15, 40, 84, 0.4);
}

.login-submit-stitch:active {
  transform: scale(0.99);
}

.login-footer-stitch {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
  pointer-events: none;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

@media (max-width: 900px) {
  .login-screen-stitch {
    height: auto;
    min-height: 100vh;
    padding: 32px 16px;
  }
  .login-shell-stitch {
    flex-direction: column;
    min-height: auto;
    border-radius: 1.75rem;
    max-width: 520px;
  }
  .login-brand-stitch {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 36px 24px;
  }
  .login-logo-stitch-card {
    width: 200px;
    height: 200px;
    margin-bottom: 20px;
    padding: 18px;
  }
  .login-brand-stitch h1 {
    font-size: 24px;
  }
  .login-form-stitch {
    width: 100%;
    padding: 36px 24px 44px;
  }
  .login-footer-stitch {
    position: static;
    margin-top: 24px;
  }
}
