@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/montserrat-400.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/montserrat-600.woff2") format("woff2");
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/montserrat-700.woff2") format("woff2");
}
@font-face {
  font-family: "Aleo"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/aleo-700.woff2") format("woff2");
}

/* Lead Console.
   Styled to community.holdfastdata.io: its tokens, its type scale, its buttons,
   inputs, panels and tables, and the same branded sign-in treatment, so the two
   surfaces read as one product rather than two that merely share a customer. */

:root {
  /* Community Mortgage's own values, so the console and the site read as one. */
  --bg: #192434; --bg-2: #22314a; --bg-3: #30415A;
  --panel: #22314a; --panel-2: #30415A;
  --line: #32435c; --line-warm: #445d7d;
  --text: #ffffff; --muted: #aec6d8;
  --accent: #b9d5e8; --accent-2: #8fb7d4; --accent-dim: #d3e5f2;
  --accent-soft: rgba(185, 213, 232, .14);
  --accent-solid: #667b47;
  --good: #8fbf6a; --warn: #e0a458; --bad: #e08a7d;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --b-hi: #2c4160; --b-mid: #1f2f45; --b-lo: #101a26;
  --b-accent: #667b47; --b-accent-hi: #9dbd72;
  --b-sky: #b9d5e8; --b-glow: rgba(185, 213, 232, .9);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; color: var(--text);
  font: 15px/1.55 "Montserrat", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(at left top, #1e3a2a 0%, #192434 60%) fixed;
  min-height: 100vh; color-scheme: dark;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0 0 6px; line-height: 1.25; font-family: "Aleo", Georgia, serif; letter-spacing: normal; }
h2 { font-size: 17px; color: var(--accent-dim); font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; max-width: 70ch; }
.empty { color: var(--muted); padding: 18px; font-size: 14px; }

.wrap { width: min(1180px, 100% - 32px); margin: 20px auto 60px; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: none; border-color: var(--accent); box-shadow: rgba(79, 70, 229, .18) 0 0 0 3px;
}

/* Buttons, as on the analytics site */

.btn, button {
  padding: 8px 16px; background: linear-gradient(180deg, #7b9456, var(--accent-solid));
  /* Dark ink on the lighter blue: white on #60a5fa is about 2.5:1 and fails. */
  border: 0; color: #ffffff; border-radius: 5px; cursor: pointer; font-weight: 600;
  font-size: 13px; transition: .15s; letter-spacing: .2px; box-shadow: var(--shadow);
  font-family: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.btn:hover, button:hover {
  background: linear-gradient(180deg, var(--accent-solid), #55673b);
  box-shadow: var(--shadow-md); transform: translateY(-1px);
}
.btn:disabled, button:disabled { background: var(--bg-3); color: var(--muted); cursor: wait; box-shadow: none; transform: none; }
.btn-line, button.secondary {
  background: var(--panel); border: 1px solid var(--line); color: var(--accent); box-shadow: var(--shadow);
}
.btn-line:hover, button.secondary:hover {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dim);
  box-shadow: var(--shadow); transform: none;
}
.btn-block { display: flex; width: 100%; padding: 11px; }

/* Branded sign-in ---------------------------------------------------------- */

.brand-bg {
  /* Not a negative z-index: body paints its own light gradient, which would sit
     on top of it. This layer covers that, and the card is lifted above it. */
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 100% at 50% 0%, var(--b-hi) 0%, var(--b-mid) 55%, var(--b-lo) 100%);
}
.brand-bg svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.brand-orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45;
  animation: brandDrift 38s ease-in-out infinite alternate; will-change: transform;
}
.brand-orb.o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: var(--b-accent); }
.brand-orb.o2 {
  width: 40vmax; height: 40vmax; right: -14vmax; bottom: -16vmax; background: var(--b-sky);
  animation-duration: 46s; animation-delay: -12s;
}
.brand-orb.o3 {
  width: 26vmax; height: 26vmax; left: 55%; top: 8%; background: var(--b-sky); opacity: .25;
  animation-duration: 54s; animation-delay: -30s;
}
@keyframes brandDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}

.bl-link {
  fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 1.3; stroke-dasharray: 6 10;
  animation: brandDash 30s linear infinite;
}
@keyframes brandDash { to { stroke-dashoffset: -320; } }
.bl-pulse { fill: #fff; filter: drop-shadow(0 0 6px var(--b-glow)) drop-shadow(0 0 14px var(--b-glow)); }
.bl-pulse.g { fill: var(--b-accent-hi); }

.brand-word {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: clamp(2.6rem, 9vw, 8rem); font-weight: 800; letter-spacing: -0.04em;
  white-space: nowrap; color: rgba(255, 255, 255, .05); user-select: none;
}

/* The console itself sits on the light theme, so the backdrop is only the door. */
body.signed-in .brand-bg { display: none; }

@media (prefers-reduced-motion: reduce) {
  .brand-orb, .bl-link { animation: none; }
  .bl-pulse { display: none; }
}

.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }

/* Jason on the left, the form on the right, as one panel. */
.gate-split {
  display: grid; grid-template-columns: 1fr; border-radius: 12px; overflow: hidden;
  box-shadow: rgba(2, 10, 18, .6) 0 24px 60px, rgba(255, 255, 255, .05) 0 0 0 1px;
  max-width: 100%;
}
.gate-face { position: relative; display: none; background: var(--b-mid); }
.gate-face picture, .gate-face img { display: block; width: 100%; height: 100%; }
.gate-face img { object-fit: cover; object-position: 50% 14%; }
.gate-face-tag {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 20px;
  background: linear-gradient(180deg, rgba(6, 36, 58, 0), rgba(6, 36, 58, .92));
  display: grid; gap: 2px;
}
.gate-face-tag strong { color: #fff; font-size: 15px; }
.gate-face-tag span { color: rgba(255, 255, 255, .72); font-size: 11.5px; }

@media (min-width: 820px) {
  .gate-split { grid-template-columns: 300px 360px; }
  .gate-face { display: block; }
}
.gate-card {
  width: 100%; max-width: 100%; padding: 36px 32px;
  background: rgba(30, 41, 59, .95); border: 0;
  backdrop-filter: blur(6px); position: relative; z-index: 1;
}
.mark { display: block; width: 44px; height: 44px; margin-bottom: 16px; }
.gate-card h1 { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: .3px; margin-bottom: 4px; }
.gate-lede { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.gate-note { font-size: 13px; color: var(--text); margin-bottom: 12px; }
.gate-hint { font-size: 11px; color: var(--muted); margin: -4px 0 12px; }
.gate-card .field { margin-bottom: 10px; }
.gate-card .field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.gate-card input { border-color: rgba(148, 197, 255, .28); }
.gate-msg { font-size: 12px; font-weight: 600; color: var(--bad); min-height: 16px; margin: 10px 0 0; }
.gate-foot { font-size: 11px; color: var(--muted); margin: 18px 0 0; text-align: center; }

/* Header */

.bar { background: var(--bg-2); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.bar-in {
  width: min(1180px, 100% - 32px); margin-inline: auto; display: flex; align-items: center;
  gap: 16px; padding: 10px 0; flex-wrap: wrap;
}
.brand { margin-right: auto; }
.brand-name { display: block; font-weight: 700; font-size: 15px; }
.brand-name span { color: var(--accent); }
.brand-sub { display: block; font-size: 11px; color: var(--muted); }

.tabs { display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.tab {
  background: transparent; color: var(--muted); border: 0; padding: 6px 14px; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border-radius: 0; box-shadow: none;
}
.tab:hover { background: var(--accent-soft); color: var(--accent-dim); transform: none; box-shadow: none; }
.tab.on { background: var(--accent-solid); color: #fff; }
.tab.on:hover { background: var(--accent-solid); color: #fff; }

/* Numbers */

.stats {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; list-style: none;
  margin: 4px 0 18px; padding: 0;
}
.stats li { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); }
.stats strong { display: block; font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); margin-top: 2px; display: block; }

/* Work cards */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); }
.card.hot { border-color: var(--warn); }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.do {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: #fff; background: var(--accent-solid); padding: 3px 7px; border-radius: 4px;
}
.card.hot .do { background: var(--warn); color: #22314a; }
.age { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card h3 { margin-bottom: 2px; }
.why { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.facts { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.card-do { display: flex; gap: 6px; }
.card-do .btn { flex: 1; }

/* Filters and the grid */

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; align-items: flex-end; }
.field { display: block; }
.field.grow { flex: 1; min-width: 200px; }
.field > span { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%; padding: 10px 12px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 5px; font: inherit; color-scheme: dark;
}
textarea { resize: vertical; }

.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
.grid th {
  text-align: left; background: var(--bg-3); color: var(--accent); font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px; font-weight: 700;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: rgba(185, 213, 232, .07); }

.pill {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg-2);
  text-transform: uppercase; letter-spacing: .4px;
}
.pill-new { border-color: var(--warn); color: var(--warn); background: rgba(251, 191, 36, .12); }
.pill-contacted, .pill-working { border-color: var(--accent); color: var(--accent-dim); background: var(--accent-soft); }
.pill-application { border-color: var(--accent-2); color: var(--accent-2); background: var(--accent-soft); }
.pill-closed { background: var(--accent-solid); color: #fff; border-color: var(--accent-solid); }
.pill-lost { color: var(--bad); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .12); }

/* Funnels */

.bars section {
  margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px; box-shadow: var(--shadow);
}
/* Named apart from the header's .bar, which it was otherwise restyling. */
.fbar { display: grid; grid-template-columns: 11rem 1fr 3rem; gap: 10px; align-items: center; margin-bottom: 6px; }
.bar-k { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { background: var(--bg-3); border-radius: 999px; height: 10px; overflow: hidden; }
.bar-f { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-solid), #8fb56a); border-radius: 999px; }
.bar-n { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Lead detail: a centred panel, not a side drawer. A lead is the thing you are
   working on, so it takes the screen rather than a strip of it. */

.drawer {
  position: fixed; inset: 0; background: rgba(9, 15, 24, .72); z-index: 50;
  display: grid; place-items: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.drawer-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  width: min(1060px, 100%); max-height: min(88vh, 900px);
  display: grid; grid-template-rows: auto 1fr auto;
  box-shadow: 0 30px 70px rgba(3, 9, 16, .6); overflow: hidden;
  animation: modalIn .18s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .drawer-card { animation: none; } }

.d-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
#d-name { font-size: 21px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
.d-meta { font-size: 12px; color: var(--muted); margin: 0; }
.drawer-x {
  background: transparent; border: 0; box-shadow: none; color: var(--muted);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 0 6px; flex: none;
}
.drawer-x:hover { background: transparent; color: var(--text); transform: none; box-shadow: none; }

/* Two columns, so the width earns its place: the record on the left, what you
   change on the right. */
.d-body {
  display: grid; grid-template-columns: 1fr; gap: 24px;
  padding: 20px 24px; overflow-y: auto;
}
.d-col { min-width: 0; display: flex; flex-direction: column; }

.d-actions { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.d-actions .btn { flex: 1; min-width: 92px; }

.d-facts, .d-consent dl { margin: 0 0 16px; display: grid; gap: 7px; }
.d-facts > div, .d-consent dl > div {
  display: grid; grid-template-columns: 9rem 1fr; gap: 12px; font-size: 13.5px;
  padding-bottom: 7px; border-bottom: 1px solid var(--line);
}
.d-facts dt, .d-consent dt { color: var(--muted); margin: 0; }
.d-facts dd, .d-consent dd { margin: 0; overflow-wrap: anywhere; }

.d-consent { border-top: 1px solid var(--line); padding-top: 14px; margin-top: auto; }
.d-consent summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--accent); margin-bottom: 10px; }

.drawer .field { margin-bottom: 14px; }
.d-notes-field { flex: 1; display: flex; flex-direction: column; }
.d-notes-field textarea { flex: 1; min-height: 200px; resize: none; }

.d-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--line); background: var(--bg-2);
}
.d-msg { flex: 1; font-size: 13px; font-weight: 600; color: var(--accent); margin: 0; min-height: 16px; }

@media (min-width: 860px) {
  .d-body { grid-template-columns: 1.05fr .95fr; gap: 32px; }
}

@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .brand { width: 100%; }
  .fbar { grid-template-columns: 7rem 1fr 2.5rem; }
  .d-facts > div, .d-consent dl > div { grid-template-columns: 1fr; gap: 0; }
  .d-foot { flex-wrap: wrap; }
  .d-msg { flex: 1 0 100%; }
}
