/* Equity Source brand font (2026-09-14, from logo package: Fonts/Mulish -
   Google Fonts.url). Self-hosted rather than pulled from Google's CDN so
   this doesn't need a CSP allowlist change (style-src/font-src only permit
   'self' and cdnjs.cloudflare.com -- see app.py) and so the page doesn't
   depend on a third-party font host at all. Both files are the variable-font
   build (one file covers the whole weight range via `font-weight: 200 1000`)
   converted from the .ttf in the brand package to .woff2 for a much smaller
   download; the OFL license text that permits this is kept alongside them
   in static/fonts/. font-display: swap avoids invisible text while the font
   loads -- text renders immediately in the fallback stack and swaps in. */
@font-face {
  font-family: 'Mulish';
  src: url('fonts/Mulish-Variable.woff2') format('woff2-variations'),
       url('fonts/Mulish-Variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mulish';
  src: url('fonts/Mulish-Italic-Variable.woff2') format('woff2-variations'),
       url('fonts/Mulish-Italic-Variable.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

/* Equity Source brand palette (from logo package / email signature):
   navy #012E4C (primary), cyan #05D0E0 (accent), grey #828485.
   Overriding Bootstrap's CSS custom properties here (loaded after
   bootstrap.min.css) recolors .btn-primary, links, etc. without having
   to hand-patch every Bootstrap utility class. */
:root {
  --bs-body-font-family: 'Mulish', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-primary: #012E4C;
  --bs-primary-rgb: 1, 46, 76;
  --bs-link-color: #012E4C;
  --bs-link-color-rgb: 1, 46, 76;
  --bs-link-hover-color: #05D0E0;
  --bs-link-hover-color-rgb: 5, 208, 224;
}
.btn-primary {
  --bs-btn-bg: #012E4C;
  --bs-btn-border-color: #012E4C;
  --bs-btn-hover-bg: #024368;
  --bs-btn-hover-border-color: #024368;
  --bs-btn-active-bg: #011f33;
  --bs-btn-active-border-color: #011f33;
}

/* Remove number-input spin buttons sitewide (2026-09-11, requested for lender
   criteria page) -- the up/down arrows only make sense for small increments;
   this app's numeric fields are dollar amounts, percentages and credit
   scores, so the +/-1 steppers are just visual clutter and a mis-click
   risk. */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Explicit fallback alongside the --bs-body-font-family variable above --
   Bootstrap 5.3's reboot reads that variable on `body`, but setting the
   property directly here too means the brand font still applies even if a
   future Bootstrap upgrade stops reading that variable the same way. */
body { background: #f4f6f8; font-family: var(--bs-body-font-family); }
h1, h2, h3, h4, h5, h6 { font-family: 'Mulish', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 800; }
.card { margin-bottom: 1rem; }
.lender-card { border-left: 4px solid #012E4C; }
.stat-box { background: white; border-radius: 8px; padding: 1.2rem; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-box .num { font-size: 2rem; font-weight: 700; color: #012E4C; }
table.table { background: white; }

/* 2026-10-02, Matthew's request: the agent/lender deal tables still run
   wide even after collapsing the final-rate/fee/LTV/amount columns into one
   "Final terms" cell above (agent_deals.html, lender_deals.html) -- tighter
   cell padding and a smaller font buy back more columns before
   .table-responsive's horizontal scrollbar kicks in, without hiding any
   data. */
.table-responsive table.table td,
.table-responsive table.table th {
  padding: .4rem .5rem;
  font-size: .875rem;
  vertical-align: middle;
}

/* 2026-09-30, Matthew's request (#441/#442): the action buttons at the right
   edge of the wide deal tables (agent_deals.html, lender_deals.html) were
   getting pushed off-screen, needing a horizontal scroll just to find them.
   Each template now wraps its table in .table-responsive (contains the
   scroll to the table, not the whole page) and pins the action column(s) to
   the right with position:sticky so Update/Documents/Confirm/Reject/Notes
   stay visible on screen no matter how far the table is scrolled. */
.table-responsive .sticky-action-col,
.table-responsive .sticky-review-col,
.table-responsive .sticky-notes-col {
  position: sticky;
  background: white;
}
.table-responsive .sticky-action-col {
  right: 0;
  min-width: 160px;
  box-shadow: -2px 0 4px rgba(0,0,0,.08);
}
.table-responsive .sticky-notes-col {
  right: 0;
  min-width: 110px;
  box-shadow: -2px 0 4px rgba(0,0,0,.08);
}
.table-responsive .sticky-review-col {
  right: 110px;
  min-width: 100px;
}


/* Lender logo and badges (2026-11-06) */
.lender-logo { object-fit: contain; display: block; background: #fff; border-radius: 6px; }
.lender-logo-sm { max-height: 48px; max-width: 140px; }
.lender-logo-lg { max-height: 80px; max-width: 220px; }
.es-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.es-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: #012E4C;
  background: #e6fbfd; border: 1px solid #05D0E0; border-radius: 999px; padding: 2px 10px; }
.es-badge::before { content: "\2713"; color: #028a96; font-weight: 800; }
.es-badge-trust { background: #012E4C; color: #fff; border-color: #012E4C; }
.es-badge-trust::before { color: #05D0E0; }

/* 2026-11-26, Matthew: on the admin lender page the Account card ran underneath the Lending criteria card. Cause: tables nested
   inside the Account card (FSRA checks, agreement record) and the email/contact forms had a minimum width larger than the card
   (about 40% of the page), so they spilled into the next column. Fix, three parts: (1) those blocks are stacked lists that wrap
   (.es-rec-list / .es-rec; templates/_fsra_checks.html, _agreement_record.html); (2) on the admin detail pages (.es-detail)
   long unbroken text such as an IPv6 address or a long email wraps instead of forcing the cell wider; (3) form fields in those
   cards may shrink. The columns also stack below 992px instead of 768px. */
.es-rec-list { list-style: none; margin: 0; padding: 0; overflow-wrap: anywhere; }
.es-rec { padding: .35rem 0; border-top: 1px solid var(--bs-border-color, #dee2e6); }
.es-rec:first-child { border-top: 0; padding-top: 0; }
.es-detail table.table td { overflow-wrap: anywhere; }   /* not th: the labels are short words and must not break mid-word */
.es-detail .form-control { min-width: 0; }

/* 2026-11-26, Matthew: layout sweep found the top menu cramped on laptop-width screens (1093 to 1366 px wide, for example a 1366 laptop
   or a 1920 screen at 125% scaling): link names ("All Deals", "Profile Edits"), the user name and the Log out button each broke onto
   two lines, and at 1024 px the Log out button was cut off by the edge of the window. Links and the button now never break inside
   themselves; when the row is too long the menu flows onto a second line instead of squeezing. */
.es-nav-items { row-gap: .25rem; }
.navbar .nav-link, .navbar .btn { white-space: nowrap; }

/* 2026-11-26 layout sweep: wide list tables (admin lenders, agents, deals, kept records, security log; agent lender performance)
   forced the WHOLE page to scroll sideways on tablets and phones. The scroll now stays inside the table's own box. Not
   .table-responsive on purpose: that class also shrinks the font and padding (see the deal tables above), which these tables
   should keep as they are. */
.es-table-scroll { overflow-x: auto; }
