@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

.mfi-portal,
.mfi-command-panel {
  --mfi-ink: #173b43;
  --mfi-muted: #697e80;
  --mfi-line: #dce7e3;
  --mfi-paper: #f5f7f2;
  --mfi-card: #fffefa;
  --mfi-primary: #17645f;
  --mfi-primary-strong: #104b49;
  --mfi-accent: #dfa750;
  --mfi-accent-wash: #fcf1dc;
  --mfi-green-wash: #e8f2eb;
  --mfi-red: #a0443e;
  --mfi-red-wash: #faece8;
  --mfi-shadow: 0 14px 42px rgba(29, 66, 61, .08);
  color: var(--mfi-ink);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.mfi-portal *,
.mfi-command-panel * {
  box-sizing: border-box;
}

.mfi-portal {
  min-height: 100dvh;
  padding: 24px clamp(16px, 3vw, 42px) 48px;
  background:
    radial-gradient(ellipse at 94% 0%, rgba(223, 167, 80, .13), transparent 27rem),
    var(--mfi-paper);
}

.mfi-portal button,
.mfi-command-panel button,
.mfi-portal input,
.mfi-command-panel input,
.mfi-portal select,
.mfi-command-panel select,
.mfi-portal textarea,
.mfi-command-panel textarea {
  font: inherit;
}

.mfi-portal button,
.mfi-command-panel button {
  cursor: pointer;
}

.mfi-portal .mfi-shell,
.mfi-command-panel .mfi-shell {
  max-width: 1440px;
  margin: 0 auto;
}

.mfi-portal .mfi-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin: 0 0 26px;
}

.mfi-portal .mfi-brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.mfi-portal .mfi-brand-mark,
.mfi-command-panel .mfi-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 15px 15px 15px 5px;
  background: var(--mfi-primary);
  color: #fffefa;
  font-family: Manrope, sans-serif;
  font-weight: 800;
  letter-spacing: -.08em;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--mfi-primary) 22%, transparent);
}

.mfi-portal .mfi-brand-mark img,
.mfi-command-panel .mfi-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mfi-portal .mfi-brand-copy strong {
  display: block;
  max-width: min(52vw, 420px);
  overflow: hidden;
  color: var(--mfi-ink);
  font: 800 17px/1.2 Manrope, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mfi-portal .mfi-brand-copy span {
  display: block;
  margin-top: 4px;
  color: var(--mfi-muted);
  font: 500 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mfi-portal .mfi-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 7px;
  border: 1px solid var(--mfi-line);
  border-radius: 999px;
  background: rgba(255, 254, 250, .8);
}

.mfi-portal .mfi-user-avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #e6eee7;
  color: var(--mfi-primary);
  font: 700 11px Manrope, sans-serif;
}

.mfi-portal .mfi-user-chip strong {
  display: block;
  color: var(--mfi-ink);
  font-size: 12px;
  line-height: 1.15;
}

.mfi-portal .mfi-user-chip span {
  color: var(--mfi-muted);
  font-size: 10px;
  text-transform: capitalize;
}

.mfi-portal .mfi-page-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 0 0 24px;
}

.mfi-portal .mfi-eyebrow,
.mfi-command-panel .mfi-eyebrow {
  margin: 0 0 7px;
  color: var(--mfi-primary);
  font: 600 10px/1.2 "IBM Plex Mono", monospace;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.mfi-portal .mfi-page-intro h1,
.mfi-command-panel .mfi-page-intro h1 {
  margin: 0;
  color: var(--mfi-ink);
  font: 800 clamp(24px, 3vw, 34px)/1.12 Manrope, sans-serif;
  letter-spacing: -.045em;
}

.mfi-portal .mfi-page-intro p,
.mfi-command-panel .mfi-page-intro p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--mfi-muted);
}

.mfi-portal .mfi-nav {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin: 0 0 23px;
  padding: 5px;
  border: 1px solid var(--mfi-line);
  border-radius: 14px;
  background: rgba(255, 254, 250, .82);
  scrollbar-width: thin;
}

.mfi-portal .mfi-nav button {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--mfi-muted);
  font-size: 12px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.mfi-portal .mfi-nav button:hover {
  color: var(--mfi-primary);
  transform: translateY(-1px);
}

.mfi-portal .mfi-nav button[aria-current="page"] {
  background: var(--mfi-primary);
  color: #fffefa;
  box-shadow: 0 4px 10px rgba(23, 100, 95, .17);
}

.mfi-portal .mfi-panel,
.mfi-command-panel .mfi-panel {
  padding: clamp(17px, 2.2vw, 27px);
  border: 1px solid var(--mfi-line);
  border-radius: 18px;
  background: var(--mfi-card);
  box-shadow: var(--mfi-shadow);
}

.mfi-portal .mfi-section-head,
.mfi-command-panel .mfi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.mfi-portal .mfi-section-head h2,
.mfi-command-panel .mfi-section-head h2 {
  margin: 0;
  font: 800 18px/1.2 Manrope, sans-serif;
  letter-spacing: -.03em;
}

.mfi-portal .mfi-section-head p,
.mfi-command-panel .mfi-section-head p {
  margin: 5px 0 0;
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-portal .mfi-action-row,
.mfi-command-panel .mfi-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.mfi-portal .mfi-btn,
.mfi-command-panel .mfi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--mfi-primary);
  color: #fffefa;
  font-size: 12px;
  font-weight: 700;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}

.mfi-portal .mfi-btn:hover,
.mfi-command-panel .mfi-btn:hover {
  background: var(--mfi-primary-strong);
  transform: translateY(-1px);
}

.mfi-portal .mfi-btn:disabled,
.mfi-command-panel .mfi-btn:disabled {
  cursor: wait;
  opacity: .62;
  transform: none;
}

.mfi-portal .mfi-btn--quiet,
.mfi-command-panel .mfi-btn--quiet {
  border-color: var(--mfi-line);
  background: var(--mfi-card);
  color: var(--mfi-ink);
}

.mfi-portal .mfi-btn--quiet:hover,
.mfi-command-panel .mfi-btn--quiet:hover {
  border-color: #b6cbc3;
  background: #f3f7f2;
}

.mfi-portal .mfi-btn--danger,
.mfi-command-panel .mfi-btn--danger {
  background: var(--mfi-red);
}

.mfi-portal .mfi-btn--danger:hover,
.mfi-command-panel .mfi-btn--danger:hover {
  background: #853934;
}

.mfi-portal .mfi-btn--small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.mfi-portal .mfi-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--mfi-line);
  border-radius: 9px;
  background: #fffefa;
  color: var(--mfi-primary);
  font-size: 13px;
  font-weight: 700;
}

.mfi-portal .mfi-icon-btn:hover {
  border-color: #a9c5bb;
  background: #eff5ef;
}

.mfi-portal .mfi-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.mfi-portal .mfi-metric {
  position: relative;
  min-height: 118px;
  padding: 18px 19px;
  overflow: hidden;
  border: 1px solid var(--mfi-line);
  border-radius: 16px;
  background: var(--mfi-card);
}

.mfi-portal .mfi-metric::after {
  position: absolute;
  right: -14px;
  bottom: -36px;
  width: 95px;
  height: 95px;
  border: 1px solid rgba(23, 100, 95, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 13px rgba(23, 100, 95, .025), 0 0 0 26px rgba(23, 100, 95, .02);
  content: "";
}

.mfi-portal .mfi-metric-label {
  color: var(--mfi-muted);
  font-size: 11px;
  font-weight: 600;
}

.mfi-portal .mfi-metric-value {
  display: block;
  margin-top: 11px;
  color: var(--mfi-ink);
  font: 800 30px/1 Manrope, sans-serif;
  letter-spacing: -.05em;
}

.mfi-portal .mfi-metric-note {
  display: block;
  margin-top: 7px;
  color: var(--mfi-muted);
  font-size: 11px;
  font-weight: 600;
}

.mfi-portal .mfi-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 16px;
}

.mfi-portal .mfi-activity-list {
  display: grid;
  gap: 0;
}

.mfi-portal .mfi-activity-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid #edf1ec;
}

.mfi-portal .mfi-activity-item:first-child {
  border-top: 0;
}

.mfi-portal .mfi-activity-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--mfi-green-wash);
  color: var(--mfi-primary);
  font: 700 11px "IBM Plex Mono", monospace;
}

.mfi-portal .mfi-activity-item strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.mfi-portal .mfi-activity-item span {
  display: block;
  margin-top: 3px;
  color: var(--mfi-muted);
  font-size: 11px;
}

.mfi-portal .mfi-activity-item time {
  color: var(--mfi-muted);
  font: 10px "IBM Plex Mono", monospace;
  white-space: nowrap;
}

.mfi-portal .mfi-quick-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  padding: 22px;
  border-radius: 17px;
  background:
    linear-gradient(145deg, rgba(16, 75, 73, .96), rgba(23, 100, 95, .96)),
    var(--mfi-primary);
  color: #fffefa;
}

.mfi-portal .mfi-quick-panel .mfi-eyebrow {
  color: #f0c873;
}

.mfi-portal .mfi-quick-panel h2 {
  max-width: 330px;
  margin: 0;
  font: 800 23px/1.2 Manrope, sans-serif;
  letter-spacing: -.04em;
}

.mfi-portal .mfi-quick-panel p {
  max-width: 340px;
  margin: 10px 0 0;
  color: rgba(255, 254, 250, .76);
  font-size: 12px;
}

.mfi-portal .mfi-quick-panel .mfi-btn {
  align-self: start;
  margin-top: 23px;
  background: #f1c36c;
  color: #173b43;
}

.mfi-portal .mfi-quick-panel .mfi-btn:hover {
  background: #f6d48f;
}

.mfi-portal .mfi-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px;
}

.mfi-portal .mfi-field,
.mfi-command-panel .mfi-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mfi-portal .mfi-field label,
.mfi-command-panel .mfi-field label {
  color: #50696b;
  font-size: 11px;
  font-weight: 700;
}

.mfi-portal .mfi-control,
.mfi-command-panel .mfi-control {
  width: 100%;
  min-height: 39px;
  padding: 9px 11px;
  border: 1px solid #d7e2dd;
  border-radius: 9px;
  outline: none;
  background: #fffefa;
  color: var(--mfi-ink);
  font-size: 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.mfi-portal .mfi-control:focus,
.mfi-command-panel .mfi-control:focus {
  border-color: var(--mfi-primary);
  box-shadow: 0 0 0 3px rgba(23, 100, 95, .11);
}

.mfi-portal textarea.mfi-control,
.mfi-command-panel textarea.mfi-control {
  min-height: 84px;
  resize: vertical;
}

.mfi-portal .mfi-search {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.mfi-portal .mfi-search .mfi-control {
  padding-left: 36px;
}

.mfi-portal .mfi-search::before {
  position: absolute;
  top: 8px;
  left: 13px;
  z-index: 1;
  color: #78908c;
  content: "⌕";
  font-size: 20px;
  line-height: 1;
}

.mfi-portal .mfi-select-compact {
  width: min(210px, 34vw);
}

.mfi-portal .mfi-table-wrap,
.mfi-command-panel .mfi-table-wrap {
  overflow-x: auto;
  border: 1px solid #e4ebe6;
  border-radius: 12px;
}

.mfi-portal .mfi-table,
.mfi-command-panel .mfi-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.mfi-portal .mfi-table th,
.mfi-command-panel .mfi-table th {
  padding: 11px 13px;
  background: #f3f6f1;
  color: #728682;
  font: 600 9px "IBM Plex Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mfi-portal .mfi-table td,
.mfi-command-panel .mfi-table td {
  padding: 12px 13px;
  border-top: 1px solid #edf1ed;
  color: #405d60;
  font-size: 12px;
  vertical-align: middle;
}

.mfi-portal .mfi-table tbody tr:hover,
.mfi-command-panel .mfi-table tbody tr:hover {
  background: #fbfcf8;
}

.mfi-portal .mfi-primary-cell {
  min-width: 170px;
}

.mfi-portal .mfi-primary-cell strong,
.mfi-command-panel .mfi-primary-cell strong {
  display: block;
  color: var(--mfi-ink);
  font-size: 12px;
}

.mfi-portal .mfi-primary-cell span,
.mfi-command-panel .mfi-primary-cell span {
  display: block;
  margin-top: 3px;
  color: var(--mfi-muted);
  font-size: 10px;
}

.mfi-portal .mfi-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--mfi-green-wash);
  color: #2e6d50;
  font: 600 10px "IBM Plex Mono", monospace;
  text-transform: capitalize;
}

.mfi-portal .mfi-status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.mfi-portal .mfi-status--inactive {
  background: #eff1ee;
  color: #778681;
}

.mfi-portal .mfi-status--attention {
  background: var(--mfi-accent-wash);
  color: #8c641d;
}

.mfi-portal .mfi-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.mfi-portal .mfi-skeleton {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.mfi-portal .mfi-skeleton span {
  display: block;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf2ed 20%, #f7f8f4 45%, #edf2ed 70%);
}

.mfi-portal .mfi-state {
  display: grid;
  justify-items: center;
  padding: 38px 18px;
  color: var(--mfi-muted);
  text-align: center;
}

.mfi-portal .mfi-state-symbol {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 12px;
  border: 1px solid var(--mfi-line);
  border-radius: 14px;
  background: #f2f6f0;
  color: var(--mfi-primary);
  font: 700 13px "IBM Plex Mono", monospace;
}

.mfi-portal .mfi-state strong {
  color: var(--mfi-ink);
  font: 700 14px Manrope, sans-serif;
}

.mfi-portal .mfi-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mfi-portal .mfi-form-error,
.mfi-command-panel .mfi-form-error {
  margin: 0 0 15px;
  padding: 10px 12px;
  border: 1px solid #efcbc5;
  border-radius: 9px;
  background: var(--mfi-red-wash);
  color: var(--mfi-red);
  font-size: 12px;
}

.mfi-portal .mfi-state p {
  max-width: 420px;
  margin: 7px 0 15px;
  font-size: 12px;
}

.mfi-portal .mfi-error-state .mfi-state-symbol {
  background: var(--mfi-red-wash);
  color: var(--mfi-red);
}

.mfi-portal .mfi-placeholder {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px dashed #cbd9d1;
  border-radius: 15px;
  background: rgba(255, 254, 250, .7);
  text-align: center;
}

.mfi-portal .mfi-placeholder strong {
  color: var(--mfi-ink);
  font: 800 17px Manrope, sans-serif;
}

.mfi-portal .mfi-placeholder p {
  margin: 8px 0 0;
  color: var(--mfi-muted);
  font-size: 12px;
}

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

.mfi-portal .mfi-form-grid .mfi-span-2,
.mfi-command-panel .mfi-form-grid .mfi-span-2 {
  grid-column: span 2;
}

.mfi-portal .mfi-form-section {
  grid-column: 1 / -1;
  margin: 8px 0 -4px;
  padding-top: 13px;
  border-top: 1px solid #e6ece7;
  color: var(--mfi-primary);
  font: 700 10px "IBM Plex Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.mfi-portal .mfi-file-note {
  margin: 1px 0 0;
  color: var(--mfi-muted);
  font-size: 10px;
}

.mfi-portal .mfi-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 45, 45, .48);
  backdrop-filter: blur(4px);
}

.mfi-portal .mfi-modal {
  width: min(660px, 100%);
  max-height: min(90dvh, 920px);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 18px;
  background: var(--mfi-card);
  box-shadow: 0 25px 80px rgba(13, 38, 38, .25);
}

.mfi-portal .mfi-modal--wide {
  width: min(840px, 100%);
}

.mfi-portal .mfi-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 21px 23px 16px;
  border-bottom: 1px solid #e7ece8;
}

.mfi-portal .mfi-modal-head h2 {
  margin: 0;
  font: 800 19px Manrope, sans-serif;
  letter-spacing: -.03em;
}

.mfi-portal .mfi-modal-head p {
  margin: 5px 0 0;
  color: var(--mfi-muted);
  font-size: 11px;
}

.mfi-portal .mfi-modal-body {
  padding: 20px 23px 22px;
}

.mfi-portal .mfi-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 15px 23px;
  border-top: 1px solid #e7ece8;
  background: #fafbf7;
}

.mfi-portal .mfi-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--mfi-line);
  border-radius: 8px;
  background: #fffefa;
  color: var(--mfi-muted);
  font-size: 17px;
}

.mfi-portal .mfi-subtabs {
  display: flex;
  gap: 5px;
  margin-bottom: 17px;
  padding: 4px;
  border-radius: 10px;
  background: #f1f5f0;
}

.mfi-portal .mfi-subtabs button {
  padding: 8px 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--mfi-muted);
  font-size: 11px;
  font-weight: 700;
}

.mfi-portal .mfi-subtabs button[aria-selected="true"] {
  background: #fffefa;
  color: var(--mfi-primary);
  box-shadow: 0 2px 7px rgba(40, 73, 61, .08);
}

.mfi-portal .mfi-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}

.mfi-portal .mfi-info-item {
  padding: 12px 0;
  border-bottom: 1px solid #edf1ed;
}

.mfi-portal .mfi-info-item span {
  display: block;
  color: var(--mfi-muted);
  font-size: 10px;
}

.mfi-portal .mfi-info-item strong {
  display: block;
  margin-top: 4px;
  color: var(--mfi-ink);
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mfi-command-panel {
  padding: 22px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(223, 167, 80, .12), transparent 25rem),
    var(--mfi-paper);
}

.mfi-command-panel .mfi-page-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 4px 0 20px;
}

.mfi-command-panel .mfi-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.mfi-command-panel .mfi-metric {
  padding: 15px 17px;
  border: 1px solid var(--mfi-line);
  border-radius: 13px;
  background: var(--mfi-card);
}

.mfi-command-panel .mfi-metric span {
  display: block;
  color: var(--mfi-muted);
  font-size: 10px;
}

.mfi-command-panel .mfi-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--mfi-ink);
  font: 800 25px Manrope, sans-serif;
}

.mfi-command-panel .mfi-brand-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mfi-command-panel .mfi-brand-preview .mfi-brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 11px 11px 11px 4px;
}

.mfi-command-panel .mfi-inline-form {
  margin-bottom: 16px;
}

@media (max-width: 850px) {
  .mfi-portal .mfi-metrics,
  .mfi-command-panel .mfi-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mfi-portal .mfi-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .mfi-portal .mfi-section-head {
    align-items: start;
  }
}

@media (max-width: 600px) {
  .mfi-portal {
    padding: 16px 13px 34px;
  }

  .mfi-portal .mfi-topbar {
    margin-bottom: 21px;
  }

  .mfi-portal .mfi-brand-copy strong {
    max-width: 47vw;
    font-size: 14px;
  }

  .mfi-portal .mfi-user-chip {
    padding: 5px;
    border: 0;
    background: transparent;
  }

  .mfi-portal .mfi-user-chip > div:last-child {
    display: none;
  }

  .mfi-portal .mfi-page-intro,
  .mfi-command-panel .mfi-page-intro {
    align-items: start;
    flex-direction: column;
  }

  .mfi-portal .mfi-nav {
    margin-right: -13px;
    border-radius: 12px 0 0 12px;
  }

  .mfi-portal .mfi-nav button {
    padding: 9px 12px;
  }

  .mfi-portal .mfi-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .mfi-portal .mfi-section-head .mfi-action-row {
    justify-content: flex-start;
  }

  .mfi-portal .mfi-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .mfi-portal .mfi-select-compact {
    width: 100%;
  }

  .mfi-portal .mfi-metric {
    min-height: 102px;
    padding: 15px;
  }

  .mfi-portal .mfi-metric-value {
    font-size: 26px;
  }

  .mfi-portal .mfi-form-grid,
  .mfi-command-panel .mfi-form-grid,
  .mfi-portal .mfi-info-grid {
    grid-template-columns: 1fr;
  }

  .mfi-portal .mfi-form-grid .mfi-span-2,
  .mfi-command-panel .mfi-form-grid .mfi-span-2 {
    grid-column: auto;
  }

  .mfi-portal .mfi-modal-head,
  .mfi-portal .mfi-modal-body {
    padding-right: 17px;
    padding-left: 17px;
  }

  .mfi-portal .mfi-modal-foot {
    padding-right: 17px;
    padding-left: 17px;
  }

  .mfi-portal .mfi-activity-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .mfi-portal .mfi-activity-item time {
    grid-column: 2;
  }

  .mfi-command-panel {
    padding: 13px;
  }

.mfi-settings-tabs {
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.mfi-portal .mfi-subpanel {
  padding: 18px;
  border: 1px solid var(--mfi-line);
  border-radius: 14px;
  background: var(--mfi-card);
}

.mfi-portal .mfi-subpanel h3 {
  margin: 0 0 14px;
  color: var(--mfi-ink);
  font: 700 15px/1.35 "Manrope", sans-serif;
}

.mfi-collateral-detail {
  display: grid;
  gap: 15px;
}

.mfi-collateral-status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-collateral-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
  gap: 14px;
}

.mfi-collateral-description,
.mfi-muted-copy {
  margin: 14px 0 0;
  color: var(--mfi-muted);
  line-height: 1.65;
}

.mfi-portal .mfi-score-large {
  color: var(--mfi-primary);
  font: 800 28px/1 "Manrope", sans-serif;
}

.mfi-portal .mfi-score-large small {
  color: var(--mfi-muted);
  font-size: 12px;
  font-weight: 600;
}

.mfi-score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--mfi-line);
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-score-row strong {
  color: var(--mfi-ink);
  white-space: nowrap;
}

.mfi-score-row small {
  color: var(--mfi-primary);
  font-size: 11px;
}

.mfi-portal .mfi-score-pill {
  display: inline-grid;
  min-width: 38px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--mfi-green-wash);
  color: var(--mfi-primary-strong);
  font: 700 12px "IBM Plex Mono", monospace;
}

.mfi-photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mfi-photo-gallery img {
  width: min(190px, 42vw);
  height: 140px;
  object-fit: cover;
  border: 1px solid var(--mfi-line);
  border-radius: 11px;
}

.mfi-document-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
  color: var(--mfi-ink);
}

.mfi-document-list a {
  color: var(--mfi-primary);
  overflow-wrap: anywhere;
}

.mfi-valuation-note {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--mfi-green-wash);
}

.mfi-valuation-note span,
.mfi-valuation-note p {
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-valuation-note p {
  margin: 0;
}

.mfi-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mfi-timeline-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 15px;
}

.mfi-timeline-dot {
  width: 9px;
  height: 9px;
  margin: 5px auto 0;
  border-radius: 50%;
  background: var(--mfi-primary);
  box-shadow: 0 0 0 4px var(--mfi-green-wash);
}

.mfi-timeline-item strong {
  color: var(--mfi-ink);
  font-size: 13px;
}

.mfi-timeline-item p {
  margin: 3px 0;
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-timeline-item time {
  color: var(--mfi-muted);
  font: 11px "IBM Plex Mono", monospace;
}

.mfi-timeline-empty {
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-link-button {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mfi-primary);
  font: 600 12px "DM Sans", sans-serif;
}

.mfi-collateral-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .mfi-collateral-detail-grid {
    grid-template-columns: 1fr;
  }

  .mfi-collateral-detail .mfi-section-head {
    align-items: flex-start;
  }

  .mfi-portal .mfi-subpanel {
    padding: 14px;
  }

  .mfi-collateral-actions {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .mfi-collateral-actions .mfi-btn {
    flex: 1 1 100%;
  }
}

.mfi-portal .mfi-loans-tabs {
  overflow-x: auto;
  white-space: nowrap;
}

.mfi-portal .mfi-loan-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: capitalize;
  white-space: nowrap;
}

.mfi-portal .mfi-loan-status--draft,
.mfi-portal .mfi-loan-status--cancelled {
  color: #4c5867;
  background: #edf0f3;
}

.mfi-portal .mfi-loan-status--submitted {
  color: #96520c;
  background: #fff0dc;
}

.mfi-portal .mfi-loan-status--pending_director {
  color: #6637a2;
  background: #f1e9ff;
}

.mfi-portal .mfi-loan-status--approved {
  color: #176441;
  background: #e2f4e9;
}

.mfi-portal .mfi-loan-status--rejected {
  color: #a13333;
  background: #fbe8e7;
}

.mfi-portal .mfi-loan-status--changes_requested {
  color: #775a00;
  background: #fff4c7;
}

.mfi-portal .mfi-loan-status--cancelled {
  text-decoration: line-through;
}

.mfi-portal .mfi-loan-form-panel {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--mfi-line);
  border-radius: 16px;
  background: var(--mfi-paper);
}

.mfi-portal .mfi-loan-form-panel textarea.mfi-control {
  min-height: 84px;
  resize: vertical;
}

.mfi-portal .mfi-loan-readonly {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--mfi-muted);
  background: var(--mfi-paper);
}

.mfi-portal .mfi-loan-check {
  display: flex;
  align-items: flex-end;
  min-height: 58px;
}

.mfi-portal .mfi-loan-check label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mfi-portal .mfi-loan-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--mfi-primary);
}

.mfi-portal .mfi-loan-preview,
.mfi-portal .mfi-loan-phase-note {
  display: block;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--mfi-line);
  border-radius: 13px;
  background: var(--mfi-accent-wash);
}

.mfi-portal .mfi-loan-preview p,
.mfi-portal .mfi-loan-phase-note span {
  display: block;
  margin: 5px 0 0;
  color: var(--mfi-muted);
  font-size: 13px;
}

.mfi-portal .mfi-loan-preview small {
  display: block;
  margin-top: 7px;
  color: var(--mfi-muted);
}

.mfi-portal .mfi-disbursement-preview-table {
  max-height: 220px;
  margin-top: 12px;
  overflow: auto;
}

.mfi-portal .mfi-disbursement-preview-table .mfi-table {
  min-width: 560px;
}

.mfi-portal .mfi-disbursement-preview-table th,
.mfi-portal .mfi-disbursement-preview-table td {
  padding: 8px;
}

.mfi-portal .mfi-loan-confirm {
  margin: 14px 0;
  border: 1px solid var(--mfi-line);
  border-radius: 14px;
}

.mfi-portal .mfi-loan-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mfi-portal .mfi-loan-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0 0 18px;
}

.mfi-portal .mfi-loan-filters > .mfi-btn {
  min-height: 42px;
}

.mfi-portal .mfi-loan-customer-photo {
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  object-fit: cover;
  border: 1px solid var(--mfi-line);
  border-radius: 14px;
}

.mfi-portal .mfi-loan-detail-actions {
  justify-content: flex-start;
  margin: 0 0 16px;
}

.mfi-portal .mfi-loan-detail .mfi-timeline {
  margin-top: 10px;
}

.mfi-portal .mfi-loans small {
  display: block;
  margin-top: 3px;
  color: var(--mfi-muted);
  font-size: 11px;
}

.mfi-portal .mfi-loan-status--active,
.mfi-portal .mfi-loan-status--paid {
  color: #176441;
  background: #e2f4e9;
}

.mfi-portal .mfi-loan-status--past_due,
.mfi-portal .mfi-loan-status--overdue,
.mfi-portal .mfi-loan-status--partial {
  color: #96520c;
  background: #fff0dc;
}

.mfi-portal .mfi-loan-status--defaulted,
.mfi-portal .mfi-loan-status--written_off {
  color: #a13333;
  background: #fbe8e7;
}

.mfi-portal .mfi-loan-status--completed,
.mfi-portal .mfi-loan-status--pending {
  color: #4c5867;
  background: #edf0f3;
}

.mfi-portal .mfi-portfolio-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mfi-portal .mfi-loan-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
}

.mfi-portal .mfi-loan-progress-track {
  height: 8px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: var(--mfi-line);
}

.mfi-portal .mfi-loan-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--mfi-primary);
}

.mfi-portal .mfi-loan-progress small {
  margin: 0;
  white-space: nowrap;
}

.mfi-portal .mfi-loan-overview {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 14px;
}

.mfi-portal .mfi-loan-overview .mfi-subpanel {
  margin: 0;
}

.mfi-portal .mfi-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mfi-portal .mfi-info-item {
  min-width: 0;
}

.mfi-portal .mfi-info-item span,
.mfi-portal .mfi-info-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.mfi-portal .mfi-info-item span {
  color: var(--mfi-muted);
  font-size: 12px;
}

.mfi-portal .mfi-info-item strong {
  margin-top: 3px;
  font-size: 14px;
}

.mfi-portal .mfi-next-installment {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.mfi-portal .mfi-next-installment > strong {
  color: var(--mfi-primary);
  font-size: 24px;
}

.mfi-portal .mfi-next-installment > span,
.mfi-portal .mfi-next-installment > small {
  color: var(--mfi-muted);
}

.mfi-portal .mfi-loan-detail-tabs {
  margin: 12px 0 18px;
  overflow-x: auto;
}

.mfi-portal .mfi-loan-detail-tabs button[aria-selected="true"] {
  color: var(--mfi-primary);
  border-color: var(--mfi-primary);
  font-weight: 700;
}

.mfi-portal .mfi-loan-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(16 35 40 / 54%);
}

.mfi-portal .mfi-loan-modal {
  width: min(100%, 760px);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--mfi-line);
  border-radius: 18px;
  background: var(--mfi-paper);
  box-shadow: 0 22px 70px rgb(16 35 40 / 24%);
}

.mfi-portal .mfi-loan-modal textarea.mfi-control {
  min-height: 76px;
  resize: vertical;
}

.mfi-portal .mfi-loan-allocation-preview {
  margin: 15px 0;
  padding: 15px;
  border: 1px solid var(--mfi-line);
  border-radius: 14px;
  background: var(--mfi-accent-wash);
}

.mfi-portal .mfi-loan-allocation-preview > strong {
  display: block;
  margin-bottom: 10px;
}

.mfi-portal .mfi-loan-allocation-preview > small {
  margin-top: 10px;
}

.mfi-portal .mfi-loan-receipt-success {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #badfc7;
  border-radius: 12px;
  background: #eaf7ee;
}

.mfi-portal .mfi-loan-receipt-success > div {
  flex: 1;
}

.mfi-portal .mfi-loan-receipt-success span {
  display: block;
  margin-top: 3px;
  color: var(--mfi-muted);
}

.mfi-portal .mfi-loan-overdue {
  display: block;
  margin-top: 6px;
  color: #a13333;
  text-align: right;
}

.mfi-portal .mfi-loan-schedule-print {
  overflow-x: auto;
}

@media (max-width: 760px) {
  .mfi-portal .mfi-loan-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mfi-portal .mfi-portfolio-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mfi-portal .mfi-loan-overview {
    grid-template-columns: 1fr;
  }

  .mfi-portal .mfi-loan-filters {
    grid-template-columns: 1fr;
  }

  .mfi-portal .mfi-loan-form-panel {
    padding: 14px;
  }

  .mfi-portal .mfi-loan-detail-actions {
    flex-wrap: wrap;
  }

  .mfi-portal .mfi-loan-modal-backdrop {
    padding: 10px;
  }

  .mfi-portal .mfi-loan-modal {
    max-height: 95vh;
    padding: 15px;
  }

  .mfi-portal .mfi-loan-receipt-success {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

/* Phase 3C-3 reports and borrower self-service */
.mfi-portal .mfi-reports-ui,
.mfi-portal .mfi-borrower-ui {
  color: var(--mfi-ink);
}

.mfi-portal .mfi-report-tabs,
.mfi-portal .mfi-report-inner-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.mfi-portal .mfi-report-content,
.mfi-portal .mfi-report-umra {
  display: grid;
  gap: 16px;
}

.mfi-portal .mfi-report-heading {
  align-items: end;
  margin: 3px 0 0;
}

.mfi-portal .mfi-report-heading h2 {
  margin: 0;
  font: 800 19px/1.2 Manrope, sans-serif;
  letter-spacing: -.035em;
}

.mfi-portal .mfi-report-heading > div > p:last-child {
  margin: 5px 0 0;
  color: var(--mfi-muted);
  font-size: 11px;
}

.mfi-portal .mfi-report-filter,
.mfi-portal .mfi-report-period-form {
  display: flex;
  align-items: end;
  gap: 11px;
  flex-wrap: wrap;
  padding: 13px;
  border: 1px solid var(--mfi-line);
  border-radius: 13px;
  background: #f2f6f1;
}

.mfi-portal .mfi-report-filter .mfi-field {
  width: min(230px, 100%);
}

.mfi-portal .mfi-report-filter .mfi-report-loan-input {
  flex: 1 1 270px;
}

.mfi-portal .mfi-report-period-fields {
  display: flex;
  align-items: end;
  gap: 10px;
}

.mfi-portal .mfi-report-period-fields .mfi-field {
  width: 155px;
}

.mfi-portal .mfi-report-financial-year {
  padding-left: 12px;
  border-left: 1px solid #d5e0d8;
}

.mfi-portal .mfi-report-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  overflow: hidden;
  border: 1px solid var(--mfi-line);
  border-radius: 13px;
  background: var(--mfi-card);
}

.mfi-portal .mfi-report-kpis > div {
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid #e7ede7;
}

.mfi-portal .mfi-report-kpis > div:last-child {
  border-right: 0;
}

.mfi-portal .mfi-report-kpis span {
  display: block;
  color: var(--mfi-muted);
  font-size: 10px;
}

.mfi-portal .mfi-report-kpis strong {
  display: block;
  margin-top: 6px;
  color: var(--mfi-ink);
  font: 800 20px/1.2 Manrope, sans-serif;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.mfi-portal .mfi-report-kpis--director {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mfi-portal .mfi-report-kpis--director strong {
  font-size: clamp(15px, 1.8vw, 21px);
}

.mfi-portal .mfi-report-grid,
.mfi-portal .mfi-report-director-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 14px;
}

.mfi-portal .mfi-report-inset {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--mfi-line);
  border-radius: 13px;
  background: var(--mfi-card);
}

.mfi-portal .mfi-report-table-section {
  padding: 17px;
}

.mfi-portal .mfi-report-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.mfi-portal .mfi-report-subhead h3 {
  margin: 0;
  color: var(--mfi-ink);
  font: 800 13px Manrope, sans-serif;
}

.mfi-portal .mfi-report-subhead > span {
  color: var(--mfi-muted);
  font-size: 10px;
}

.mfi-portal .mfi-report-subhead .mfi-report-legend-disbursed,
.mfi-portal .mfi-report-subhead .mfi-report-legend-collected {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 4px 0 8px;
  border-radius: 50%;
  background: var(--mfi-primary);
}

.mfi-portal .mfi-report-subhead .mfi-report-legend-collected {
  background: var(--mfi-accent);
}

.mfi-portal .mfi-report-cell-note {
  display: block;
  color: var(--mfi-muted);
  font-size: 10px;
  margin-top: 3px;
}

.mfi-portal .mfi-report-number,
.mfi-portal .mfi-report-empty-cell {
  white-space: nowrap;
}

.mfi-portal .mfi-report-empty-cell {
  padding: 25px 13px !important;
  color: var(--mfi-muted) !important;
  text-align: center;
}

.mfi-portal .mfi-report-empty {
  display: grid;
  justify-items: center;
  padding: 30px 16px;
  border: 1px dashed #cad8d0;
  border-radius: 12px;
  background: #fafbf7;
  text-align: center;
}

.mfi-portal .mfi-report-empty-mark {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 11px;
  background: var(--mfi-green-wash);
  color: var(--mfi-primary);
  font: 700 13px "IBM Plex Mono", monospace;
}

.mfi-portal .mfi-report-empty strong {
  color: var(--mfi-ink);
  font-size: 12px;
}

.mfi-portal .mfi-report-empty p,
.mfi-portal .mfi-report-footnote {
  max-width: 450px;
  margin: 5px 0 0;
  color: var(--mfi-muted);
  font-size: 11px;
}

.mfi-portal .mfi-report-loading {
  min-height: 210px;
  align-content: center;
  border: 1px solid var(--mfi-line);
  border-radius: 13px;
  background: var(--mfi-card);
}

.mfi-portal .mfi-report-skeleton {
  display: grid;
  width: min(460px, 100%);
  gap: 8px;
  margin-bottom: 11px;
}

.mfi-portal .mfi-report-skeleton span {
  height: 12px;
  border-radius: 8px;
  background: linear-gradient(90deg, #e6eee7 20%, #f5f7f2 48%, #e6eee7 76%);
  background-size: 220% 100%;
  animation: mfi-report-shimmer 1.6s linear infinite;
}

.mfi-portal .mfi-report-skeleton span:nth-child(2) { width: 82%; }
.mfi-portal .mfi-report-skeleton span:nth-child(3) { width: 63%; }

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

.mfi-portal .mfi-report-bars {
  display: flex;
  align-items: end;
  justify-content: space-around;
  gap: 8px;
  min-height: 130px;
  margin: 9px 0 15px;
  padding: 13px 8px 0;
  border-bottom: 1px solid #dce7e3;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, #edf2ed 32px);
}

.mfi-portal .mfi-report-bar-group {
  display: grid;
  flex: 1;
  justify-items: center;
  gap: 5px;
  height: 100%;
  color: var(--mfi-muted);
  font: 9px "IBM Plex Mono", monospace;
}

.mfi-portal .mfi-report-bar-pair {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100px;
}

.mfi-portal .mfi-report-bar-pair i {
  width: min(18px, 36%);
  height: var(--bar-height);
  border-radius: 4px 4px 0 0;
  background: var(--mfi-primary);
}

.mfi-portal .mfi-report-bar-pair .mfi-report-bar--collection {
  background: var(--mfi-accent);
}

.mfi-portal .mfi-report-chart-wrap {
  height: 190px;
  margin: 4px 0 14px;
}

.mfi-portal .mfi-report-rank {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: var(--mfi-accent-wash);
  color: #805c1a;
  font: 600 10px "IBM Plex Mono", monospace;
}

.mfi-portal .mfi-report-notice {
  display: grid;
  gap: 3px;
  padding: 12px 15px;
  border: 1px solid #d9e6dc;
  border-left: 4px solid var(--mfi-primary);
  border-radius: 10px;
  background: var(--mfi-green-wash);
}

.mfi-portal .mfi-report-notice strong {
  color: var(--mfi-primary-strong);
  font: 700 12px Manrope, sans-serif;
}

.mfi-portal .mfi-report-notice span {
  color: #59716c;
  font-size: 11px;
}

.mfi-portal .mfi-report-notice--statutory {
  border-color: #eedebd;
  border-left-color: #c48e32;
  background: #fbf3e3;
}

.mfi-portal .mfi-report-meta-line,
.mfi-portal .mfi-report-total-line,
.mfi-portal .mfi-report-grand-total {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--mfi-muted);
  font-size: 11px;
}

.mfi-portal .mfi-report-meta-line strong,
.mfi-portal .mfi-report-total-line strong,
.mfi-portal .mfi-report-grand-total strong {
  color: var(--mfi-ink);
}

.mfi-portal .mfi-report-total-line {
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--mfi-line);
}

.mfi-portal .mfi-report-grand-total {
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 11px;
  background: #e7f0e9;
}

.mfi-portal .mfi-report-grand-total strong {
  font: 800 15px Manrope, sans-serif;
}

.mfi-portal .mfi-borrower-ui {
  display: grid;
  gap: 18px;
}

.mfi-portal .mfi-borrower-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 34px);
  border-radius: 18px;
  background: linear-gradient(120deg, #174e4d, var(--mfi-primary));
  color: #fffefa;
}

.mfi-portal .mfi-borrower-banner .mfi-eyebrow { color: #efd08c; }
.mfi-portal .mfi-borrower-banner h1 {
  margin: 0;
  font: 800 clamp(24px, 3.3vw, 35px)/1.1 Manrope, sans-serif;
  letter-spacing: -.045em;
}
.mfi-portal .mfi-borrower-banner p {
  margin: 8px 0 0;
  color: rgba(255, 254, 250, .78);
  font-size: 12px;
}
.mfi-portal .mfi-borrower-banner-meta {
  display: grid;
  min-width: 180px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
}
.mfi-portal .mfi-borrower-banner-meta span,
.mfi-portal .mfi-borrower-banner-meta small { color: rgba(255,255,255,.72); font-size: 10px; }
.mfi-portal .mfi-borrower-banner-meta strong { margin: 3px 0; color: #fffefa; font: 700 13px Manrope, sans-serif; }
.mfi-portal .mfi-borrower-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr); gap: 15px; align-items: start; }
.mfi-portal .mfi-borrower-profile-panel,
.mfi-portal .mfi-borrower-loans-panel { min-width: 0; }
.mfi-portal .mfi-borrower-profile-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mfi-portal .mfi-borrower-profile-intro > div:nth-child(2) { flex: 1; min-width: 130px; }
.mfi-portal .mfi-borrower-profile-intro h3 { margin: 0; font: 800 16px Manrope, sans-serif; }
.mfi-portal .mfi-borrower-profile-intro p { margin: 3px 0 0; color: var(--mfi-muted); font-size: 11px; }
.mfi-portal .mfi-borrower-initials {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: #e8f0e9;
  color: var(--mfi-primary);
  font: 800 14px Manrope, sans-serif;
}
.mfi-portal .mfi-borrower-permission-note,
.mfi-portal .mfi-borrower-readonly-note,
.mfi-portal .mfi-borrower-footer {
  color: var(--mfi-muted);
  font-size: 11px;
  line-height: 1.55;
}
.mfi-portal .mfi-borrower-permission-note { margin: 13px 0 0; }
.mfi-portal .mfi-borrower-readonly-note { margin: 13px 0; padding: 10px 12px; border-radius: 9px; background: #f1f5f0; }
.mfi-portal .mfi-borrower-count { padding: 5px 9px; border-radius: 999px; background: var(--mfi-green-wash); color: var(--mfi-primary); font: 600 10px "IBM Plex Mono", monospace; }
.mfi-portal .mfi-borrower-loan-detail { display: grid; gap: 14px; }
.mfi-portal .mfi-borrower-loan-kpis strong { font-size: 17px; }
.mfi-portal .mfi-borrower-loan-meta { margin: 6px 0; }
.mfi-portal .mfi-borrower-footer { margin: 0; padding: 0 3px; }

@media (max-width: 850px) {
  .mfi-portal .mfi-report-grid,
  .mfi-portal .mfi-report-director-grid,
  .mfi-portal .mfi-borrower-grid { grid-template-columns: 1fr; }
  .mfi-portal .mfi-report-kpis--director { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .mfi-portal .mfi-report-filter,
  .mfi-portal .mfi-report-period-form { align-items: stretch; flex-direction: column; }
  .mfi-portal .mfi-report-filter .mfi-field,
  .mfi-portal .mfi-report-period-fields,
  .mfi-portal .mfi-report-period-fields .mfi-field { width: 100%; }
  .mfi-portal .mfi-report-period-fields { align-items: stretch; flex-direction: column; }
  .mfi-portal .mfi-report-financial-year { padding: 0; border: 0; }
  .mfi-portal .mfi-report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mfi-portal .mfi-report-kpis > div { border-bottom: 1px solid #e7ede7; }
  .mfi-portal .mfi-report-kpis--director { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mfi-portal .mfi-borrower-banner { align-items: stretch; flex-direction: column; }
  .mfi-portal .mfi-borrower-banner-meta { min-width: 0; }
  .mfi-portal .mfi-borrower-profile-intro > .mfi-btn { width: 100%; }
}
}

@media print {
  @page { size: landscape; margin: 12mm; }
  .mfi-portal .mfi-topbar,
  .mfi-portal .mfi-nav,
  .mfi-portal .mfi-page-intro,
  .mfi-portal .mfi-report-tabs,
  .mfi-portal .mfi-report-filter,
  .mfi-portal .mfi-report-period-form,
  .mfi-portal [data-report-action] { display: none !important; }
  .mfi-portal .mfi-view,
  .mfi-portal .mfi-report-content { margin: 0 !important; padding: 0 !important; }
  .mfi-portal .mfi-report-inset,
  .mfi-portal .mfi-report-kpis { break-inside: avoid; box-shadow: none !important; }
  .mfi-portal .mfi-table-wrap { overflow: visible !important; }
  .mfi-portal .mfi-table { width: 100%; font-size: 8pt; }
}