/* Swap these two families when licensed Gilroy + Degular files arrive. */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/static/fonts/plus-jakarta-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("/static/fonts/outfit-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sky: #d9e6ff;
  --electric: #0048fc;
  --crimson: #ff5757;
  --eco: #84e296;
  --charcoal: #282828;
  --white: #ffffff;
  --ink: #282828;
  --muted: #5c5c5c;
  --line: #c5d4f0;
  --bg: #d9e6ff;
  --card: #ffffff;
  --accent: #0048fc;
  --accent-soft: #e8efff;
  --danger: #c4232a;
  --danger-fill: #ff5757;
  --danger-soft: #ffe3e3;
  --success: #1b6b32;
  --success-fill: #84e296;
  --success-soft: #e6f8ea;
  --warn: #92400e;
  --shadow: 0 12px 32px rgba(0, 72, 252, 0.08);
  --font-text: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-display: "Outfit", "Plus Jakarta Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--ink);
}

body {
  display: flex;
  flex-direction: column;
}

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

.shell {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 32px));
  margin: 64px auto 40px;
}

.logo {
  display: block;
  height: 52px;
  width: auto;
  margin: 0 0 22px;
}

.app-top .logo {
  height: 40px;
  margin: 0 0 12px;
}

.admin-badge {
  display: block;
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-login h1 {
  font-size: 28px;
  letter-spacing: -0.02em;
}

.pill-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 18px;
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.pill-sm {
  font-size: 14px;
  padding: 5px 12px 5px 14px;
  margin: 0;
}

.card > .pill-sm {
  margin: 0 0 12px;
}

.pill .sparkle {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.section-label .line-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.doc-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-heading .line-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.deco {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: min(420px, 70vw);
  height: auto;
  opacity: 0.95;
}

.deco-tr {
  top: -24px;
  right: -48px;
}

.deco-bl {
  bottom: -40px;
  left: -56px;
  transform: rotate(180deg);
}

h1, h2, .journey-title {
  font-family: var(--font-display);
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 8px;
  font-weight: 600;
}

.lede {
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 22px 20px;
  box-shadow: var(--shadow);
}

label {
  display: block;
  font-size: 13px;
  font-family: var(--font-text);
  font-weight: 600;
  margin: 0 0 6px;
}

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  margin-bottom: 14px;
}

textarea {
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button, .btn {
  font-family: var(--font-text);
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
}

button.secondary {
  background: var(--white);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

button:disabled { opacity: 0.55; cursor: wait; }

.msg {
  font-family: var(--font-text);
  font-size: 13px;
  margin: 0 0 12px;
  min-height: 1.2em;
}

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

.hint {
  font-size: 13px;
  color: var(--muted);
  margin: 16px 0 0;
}

.app-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: min(760px, calc(100% - 32px));
  margin: 36px auto 18px;
}

.app-grid {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto 48px;
  display: grid;
  gap: 12px;
}

.account {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 14px 16px;
}

.account.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.meta {
  font-family: var(--font-text);
  font-size: 13px;
  color: var(--muted);
}

.placeholder {
  color: var(--muted);
  font-size: 15px;
}

.admin-top, .admin-grid {
  width: min(980px, calc(100% - 32px));
}

.admin-nav {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-btn {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.nav-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-text);
  font-size: 14px;
}

table.data th, table.data td {
  text-align: left;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.staff-list {
  list-style: none;
  padding: 16px 0 0;
  margin: 0;
  font-family: var(--font-text);
  font-size: 14px;
}

.staff-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.cell-input {
  margin: 0;
  font-size: 13px;
  padding: 6px 8px;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 10px;
}

label.inline input {
  width: auto;
  margin: 0;
}

.add-stage {
  margin-top: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
}

.toolbar .msg {
  margin: 0;
  min-height: 0;
}

.deal-list {
  display: grid;
  gap: 12px;
}

.deal {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}

.deal h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.deal p {
  margin: 0 0 4px;
}

.doc-heading {
  font-size: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  margin: 16px 0 8px;
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-text);
  font-size: 14px;
}

.file-list li.placeholder {
  display: block;
  border-bottom: 0;
  padding: 4px 0 12px;
}

.file-list button {
  padding: 6px 10px;
  font-size: 13px;
  flex-shrink: 0;
}

.upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.upload-row input[type="file"] {
  margin: 0;
  flex: 1;
}

.box-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.doc-box {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.doc-box-title {
  margin: 0 0 2px;
  font-weight: 650;
}

.doc-box-status {
  margin: 8px 0 4px;
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--success);
}

.doc-box.on-file {
  background: var(--success-soft);
  margin: 0 -12px;
  padding: 12px;
  border-radius: 10px;
  border-bottom: 0;
}

.doc-box.needed .upload-row {
  margin-top: 8px;
}

.ai-review {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
}

.ai-review-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
}

.ai-review-title .line-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.ai-review-status {
  margin: 0;
  font-family: var(--font-text);
  font-size: 14px;
  color: var(--muted);
}

.ai-review.waiting .ai-review-status::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--accent);
  border-right-color: transparent;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.ai-review.complete {
  background: var(--success-soft);
}

.ai-review.complete .ai-review-status {
  color: var(--success);
}

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

.follow-up {
  color: var(--danger);
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 650;
}

.th-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.info {
  position: relative;
  display: inline-flex;
}

.info::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 12px;
}

button.info-i {
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 11px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

button.info-i:hover,
button.info-i:focus-visible {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.info-callout {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(28, 25, 23, 0.08);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  z-index: 8;
}

.info-callout::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.info-callout-end {
  left: auto;
  right: 0;
  transform: none;
}

.info-callout-end::before {
  left: auto;
  right: 10px;
  transform: rotate(45deg);
}

.info:hover .info-callout,
.info:focus-within .info-callout {
  display: block;
}

#section-stages .table-wrap {
  overflow: visible;
}

.deal.has-journey .secondary {
  margin-top: 10px;
}

.journey-title {
  font-size: 22px;
  margin: 0 0 8px;
}

.journey-prompt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 8px;
}

.journey-prompt .doc-box-title {
  margin: 0;
  flex: 1;
}

.journey-track {
  height: 6px;
  background: var(--line);
  border-radius: 99px;
  margin: 0 0 16px;
  overflow: hidden;
}

.journey-track span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.journey-stale {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--danger);
}

.choice-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

label.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 500;
  background: #fff;
}

label.choice input {
  width: auto;
  margin: 0;
}

.section-banner {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 10px;
  color: var(--ink);
}

.info-item-list {
  display: grid;
  gap: 10px;
  margin: 0 0 8px;
}

.info-item-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}

.info-item-card .secondary {
  margin-top: 8px;
}

/* Build version. Rides along with the page's own top-right element rather
   than floating over the layout, so it never collides with Sign out. */
.version-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.7;
  white-space: nowrap;
  user-select: none;
}

/* Signed-in pages: version sits above Sign out, both flush right. */
.app-top-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Sign-in pages: version balances the brand line on the same baseline. */
.shell-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 22px;
}

.shell-top .logo {
  margin: 0;
}

body.page-login {
  overflow-x: hidden;
}

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

.staff-list button.remove-admin,
button.info-i {
  border-radius: 6px;
}

button.info-i {
  border-radius: 50%;
}

@media (max-width: 640px) {
  .logo { height: 44px; }
  .app-top .logo { height: 36px; }
  .pill { font-size: 16px; }
  h1 { font-size: 26px; }
  .deco { width: min(280px, 80vw); }
}
