/* ============================================================================
 * PM Acquisitions Portal — Obsidian Glass + Molten Brass
 * A live acquisition command center: ambient aurora, glass surfaces, cursor
 * spotlights, motion-first interactions. Bricolage Grotesque display,
 * Instrument Sans UI, Geist Mono data.
 * ============================================================================ */

:root {
  /* Background layers — warm obsidian, lifted a few steps so the room has light */
  --bg:          #0a0d20;
  --bg-surface:  #11152b;
  --card:        #171c36;
  --card-glass:  rgba(23, 28, 54, 0.72);
  --card-solid:  rgba(22, 27, 52, 0.92); /* glass look without backdrop-filter cost */
  --card-alt:    #1d2342;
  --card-hover:  #1d2342;

  /* Hairline borders — warm, low alpha */
  --border:        rgba(186, 205, 255, 0.14);
  --border-muted:  rgba(186, 205, 255, 0.09);
  --border-strong: rgba(186, 205, 255, 0.24);
  --border-glow:   rgba(64, 150, 255, 0.58);

  /* Text — warm paper tones */
  --text:        #f7f9ff;
  --text-muted:  #b6c0da;
  --text-dim:    #98a2c2; /* AA on --bg and --card at small sizes */

  /* Commitment status ramp — secured money is sage, promised is brass */
  --signed:      #33c08d;
  --signed-bg:   rgba(16, 185, 129, 0.10);
  --hard:        #4aa8ff;
  --hard-bg:     rgba(24, 152, 255, 0.10);
  --soft:        #76809f;
  --soft-text:   #b0bad6;
  --soft-bg:     rgba(118, 128, 159, 0.14);
  --outstanding: #232a4d;
  --outstanding-text: #98a2c2;

  /* Actions — molten brass */
  --accent:       #1898ff;
  --accent-hover: #45acff;
  --accent-bright:#9ccfff;
  --accent-ink:   #ffffff;
  --danger:       #e25555;
  --danger-hover: #ef6b6b;

  /* Type families */
  --font-display: 'Bricolage Grotesque', 'Instrument Sans', -apple-system, sans-serif;
  --font-ui:      'Instrument Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, 'SF Mono', 'Menlo', monospace;

  /* Spacing */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  /* Typography scale */
  --font-xs:   11px;
  --font-sm:   12.5px;
  --font-base: 14px;
  --font-lg:   16px;
  --font-xl:   21px;
  --font-2xl:  28px;

  --label-tracking: 0.12em;

  /* Radius */
  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-xl: 14px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  /* Shadows */
  --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 28px -16px rgba(0, 0, 0, 0.5);
  --shadow-lift:  0 18px 44px -18px rgba(0, 0, 0, 0.7),
                  0 8px 24px -12px rgba(24, 152, 255, 0.20);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.6);
}

/* ============================================================================
 * Reset + Base
 * ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-ui);
  font-size: var(--font-base);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(24, 152, 255, 0.32); color: var(--text); }

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Thin warm scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(186, 205, 255, 0.16) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(186, 205, 255, 0.14); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(186, 205, 255, 0.24); }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
 * Ambient background — drifting aurora + grain + faint grid
 * Pre-softened radial gradients (no blur filters); transform-only animation.
 * ============================================================================ */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Static ambient wash — a soft warm ceiling light so the page never reads pitch-black */
.bg-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 55% at 50% -10%, rgba(235, 245, 255, 0.07), transparent 58%),
    radial-gradient(120% 75% at 50% -12%, rgba(24, 152, 255, 0.075), transparent 62%);
}

/* Drifting white-blue light — the "white" in the background lives as light, not surface */
.bg-scene::after {
  content: '';
  position: absolute;
  width: 48vw;
  height: 48vw;
  top: 24vh;
  left: 30vw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(225, 240, 255, 0.10), transparent 70%);
  animation: drift-d 72s ease-in-out infinite;
  will-change: transform;
}

@keyframes drift-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  35%      { transform: translate(14vw, -8vh) scale(1.15); }
  70%      { transform: translate(-10vw, 10vh) scale(0.9); }
}

.aurora {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}

.aurora-1 {
  width: 68vw; height: 68vw;
  top: -24vw; left: -14vw;
  background: radial-gradient(closest-side, rgba(24, 152, 255, 0.30), transparent 72%);
  animation: drift-a 52s ease-in-out infinite;
}

.aurora-2 {
  width: 58vw; height: 58vw;
  top: 10vh; right: -22vw;
  background: radial-gradient(closest-side, rgba(6, 182, 212, 0.22), transparent 72%);
  animation: drift-b 68s ease-in-out infinite;
}

.aurora-3 {
  width: 72vw; height: 72vw;
  bottom: -36vh; left: 8vw;
  background: radial-gradient(closest-side, rgba(203, 172, 249, 0.15), transparent 72%);
  animation: drift-c 84s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(10vw, 8vh) scale(1.18); }
  66%      { transform: translate(-5vw, 14vh) scale(0.94); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%      { transform: translate(-14vw, -6vh) scale(1.12); }
  72%      { transform: translate(-4vw, 10vh) scale(1.02); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30%      { transform: translate(8vw, -10vh) scale(1.08); }
  65%      { transform: translate(-10vw, -4vh) scale(0.92); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(186, 205, 255, 0.085) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, black 25%, transparent 78%);
}

.bg-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: 0.05;
}

/* ============================================================================
 * Motion primitives
 * ============================================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.reveal {
  animation: rise 0.55s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.view-anim { animation: view-in 0.34s var(--ease-out) both; }

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

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

@keyframes pulse-ring {
  0%        { transform: scale(0.5); opacity: 0.9; }
  70%, 100% { transform: scale(1.9); opacity: 0; }
}

@keyframes row-flash {
  0%   { background: rgba(24, 152, 255, 0.16); }
  100% { background: transparent; }
}

/* Skeleton loaders */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(186, 205, 255, 0.06);
  border-radius: var(--r-sm);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(186, 205, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s ease-in-out infinite;
}

.skel-card {
  background: var(--card-glass);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
}

.skel-line { height: 12px; margin-bottom: 12px; }
.skel-bar  { height: 8px; border-radius: 4px; margin: 18px 0 14px; }

/* ============================================================================
 * Layout
 * ============================================================================ */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top bar — frosted glass over the aurora */
.topbar {
  padding: 0 40px;
  background: rgba(10, 13, 32, 0.66);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow 0.3s, border-color 0.3s, background 0.3s;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: 1560px;
  margin: 0 auto;
}

.topbar.scrolled {
  background: rgba(10, 13, 32, 0.82);
  border-bottom-color: var(--border-strong);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.7);
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-md);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  font-variation-settings: 'opsz' 40;
  color: var(--text);
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.topbar-brand .brand-mark {
  align-self: center;
  display: inline-flex;
  color: var(--accent);
  transition: transform 0.5s var(--ease-spring), color 0.3s;
}

.topbar-brand:hover .brand-mark {
  transform: rotate(90deg);
  color: var(--accent-hover);
}

.topbar-brand span {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  border-left: 1px solid var(--border-strong);
  padding-left: var(--sp-md);
}

.topbar-nav {
  display: flex;
  gap: var(--sp-xl);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
}

/* Main content area */
.main-content {
  flex: 1;
  padding: 44px 40px 72px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================================
 * Icons + avatars — the texture layer
 * ============================================================================ */
.icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn .icon { width: 14px; height: 14px; }

/* Inputs with a leading magnifier */
.input-iconwrap { position: relative; }

.input-iconwrap > .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.input-iconwrap > input { padding-left: 36px; width: 100%; }

.pipeline-toolbar .input-iconwrap { flex: 1; max-width: 280px; }

/* Deterministic initial avatars (background hue set inline from name hash) */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 6px -2px rgba(0, 0, 0, 0.5);
}

.avatar--sm { width: 28px; height: 28px; font-size: 10.5px; }

.pipe-contact-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pipe-contact-id { min-width: 0; flex: 1; }

.typeahead-id { min-width: 0; flex: 1; }

/* ============================================================================
 * Buttons
 * ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: 8px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: var(--font-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  transition: background 0.18s, border-color 0.18s, color 0.18s,
              transform 0.18s var(--ease-out), box-shadow 0.25s;
  white-space: nowrap;
}

.btn:active { transform: translateY(0) scale(0.97); }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #2ea0ff, #155eef);
  color: var(--accent-ink);
  border-color: rgba(140, 200, 255, 0.45);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #45acff, #1d6cf5);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px -8px rgba(24, 152, 255, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.btn-secondary {
  background: rgba(186, 205, 255, 0.04);
  color: var(--text-muted);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  color: var(--text);
  border-color: rgba(186, 205, 255, 0.36);
  background: rgba(186, 205, 255, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.6);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  padding: 6px 10px;
  font-weight: 500;
}

.btn-ghost:hover { background: rgba(186, 205, 255, 0.07); color: var(--text); }

.btn-danger {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}

.btn-danger:hover {
  color: var(--danger);
  background: rgba(226, 85, 85, 0.12);
  transform: translateY(-1px);
}

/* Top navigation — brass underline grows in from the left */
.btn-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-muted);
  padding: 6px 2px;
  font-size: var(--font-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  transition: color 0.2s;
}

.btn-nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(24, 152, 255, 0.25));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s var(--ease-out);
}

.btn-nav:hover { color: var(--text); }
.btn-nav:hover::after { transform: scaleX(0.45); }
.btn-nav.active { color: var(--text); }
.btn-nav.active::after { transform: scaleX(1); }
.btn-nav:active { transform: none; }

.btn-sm {
  padding: 5px 14px;
  font-size: var(--font-xs);
}

.btn-icon {
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.3;
  border-radius: var(--r-sm);
}

.btn:disabled, .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================================
 * Cards — glass over the aurora, inner top-light
 * ============================================================================ */
.card {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.card-header {
  padding: 18px 28px;
  border-bottom: 1px solid var(--border-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 28px;
}

.card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
}

.card-subtitle {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================================
 * Stacked Progress Bar (.stack-bar) — animated fills with live shimmer
 * ============================================================================ */
.stack-bar-wrapper {
  margin: 18px 0 10px;
}

.stack-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--outstanding);
  gap: 2px;
}

.stack-bar-seg {
  position: relative;
  overflow: hidden;
  height: 100%;
  min-width: 2px;
  transition: width 1s var(--ease-out);
}

/* One-shot entrance glint that chases each segment's fill — not an infinite loop */
.stack-bar-seg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s var(--ease-out) 1;
  animation-delay: calc(var(--shim-d, 0s) + 0.9s);
}

.stack-bar-seg--signed      { background: linear-gradient(180deg, #4cd6a3, #23a474); }
.stack-bar-seg--hard        { background: linear-gradient(180deg, #57b1ff, #1f7fe8); }
.stack-bar-seg--soft        { background: linear-gradient(180deg, #8b95b5, #6d7794); }
.stack-bar-seg--outstanding { background: var(--outstanding); flex: 1; }
.stack-bar-seg--outstanding::after { animation: none; }

.stack-bar-legend {
  display: flex;
  gap: 14px 28px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}

.legend-item > span:first-of-type {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-dot--signed      { background: var(--signed); box-shadow: 0 0 6px rgba(51, 192, 141, 0.5); }
.legend-dot--hard        { background: var(--hard); box-shadow: 0 0 6px rgba(74, 168, 255, 0.5); }
.legend-dot--soft        { background: var(--soft); }
.legend-dot--outstanding { background: #323a63; }

.legend-amount {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ============================================================================
 * Status pills
 * ============================================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px 2px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill--signed {
  background: var(--signed-bg);
  color: var(--signed);
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.pill--hard {
  background: var(--hard-bg);
  color: var(--hard);
  border: 1px solid rgba(24, 152, 255, 0.32);
}

.pill--soft {
  background: var(--soft-bg);
  color: var(--soft-text);
  border: 1px solid rgba(118, 128, 159, 0.32);
}

.pill--raising {
  background: var(--hard-bg);
  color: var(--hard);
  border: 1px solid rgba(24, 152, 255, 0.32);
}

.pill--closed {
  background: var(--signed-bg);
  color: var(--signed);
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.pill--archived {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
}

/* ============================================================================
 * Document chips (DOCS column in commitments table)
 * ============================================================================ */
.doc-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Base chip — shared between missing and done states */
.doc-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px 2px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}

/* Missing doc — muted outline button */
.doc-chip--missing {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  transition: color 0.15s, border-color 0.15s;
}
.doc-chip--missing:hover {
  color: var(--text-muted);
  border-color: rgba(186, 205, 255, 0.45);
}
.doc-chip--missing:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Uploaded doc — emerald success wrapper span */
.doc-chip--done {
  display: inline-flex;
  align-items: center;
  background: var(--signed-bg);
  color: var(--signed);
  border: 1px solid rgba(16, 185, 129, 0.30);
  border-radius: var(--r-sm);
  padding: 0;
  gap: 0;
}

/* Inner buttons inside the done chip — inherit all chrome from parent */
.doc-chip-main,
.doc-chip-x {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}
.doc-chip-main {
  padding: 3px 6px 2px 8px;
}
.doc-chip-x {
  padding: 3px 7px 2px 3px;
  opacity: 0.65;
  transition: opacity 0.15s;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}
.doc-chip-x:hover {
  opacity: 1;
}
.doc-chip-main:focus-visible,
.doc-chip-x:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: var(--r-sm);
}

/* ============================================================================
 * Totals strip — molten gradient figures, spotlight on hover
 * ============================================================================ */
.totals-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 4px 28px;
  margin-bottom: 44px;
}

.totals-cell {
  position: relative;
  background: transparent;
  padding: 22px 28px 22px 0;
  transition: background 0.3s;
}

.totals-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(90, 170, 255, 0.10), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.totals-cell:hover::before { opacity: 1; }

.totals-cell + .totals-cell {
  border-left: 1px solid var(--border-muted);
  padding-left: var(--sp-xl);
}

.totals-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  margin-bottom: 9px;
}

.totals-value {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 48;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  background-image: linear-gradient(135deg, #f5f9ff 5%, #6db5ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* color:transparent must be restated — the generic .text-* utilities share
   specificity with .totals-value and appear later in the cascade */
.totals-value.text-signed { background-image: linear-gradient(135deg, #c4ffe3 5%, #2fd49f 90%); color: transparent; }
.totals-value.text-hard   { background-image: linear-gradient(135deg, #d6eaff 5%, #4aa8ff 90%); color: transparent; }
.totals-value.text-soft   { background-image: linear-gradient(135deg, #e2e7f5 5%, #98a2c0 90%); color: transparent; }
.totals-value.text-muted  { background-image: linear-gradient(135deg, #d4dcef 5%, #8b95b5 90%); color: transparent; }

.totals-sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ============================================================================
 * Deal cards grid — lift, glow, spotlight, sheen
 * ============================================================================ */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.deal-card {
  position: relative;
  overflow: hidden;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  cursor: pointer;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.35s var(--ease-out), border-color 0.3s,
              box-shadow 0.35s, background 0.3s;
}

/* Cursor-tracking spotlight */
.deal-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%),
              rgba(90, 170, 255, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}

/* Diagonal sheen sweep — compositor-only (transform), forward on hover,
   snaps home invisibly on mouse-out (transition lives on :hover only) */
.deal-card::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80%;
  width: 50%;
  background: linear-gradient(105deg, transparent, rgba(190, 225, 255, 0.07), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
  z-index: 0;
}

.deal-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  background: rgba(29, 35, 66, 0.8);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(90, 170, 255, 0.12);
}

.deal-card:hover::before { opacity: 1; }
.deal-card:hover::after {
  transition: transform 0.65s ease;
  transform: translateX(420%) skewX(-18deg); /* 420% of the 50%-wide pseudo ≈ full card travel */
}

.deal-card > * { position: relative; z-index: 1; }

.deal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.deal-name {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 30;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  flex: 1;
  margin-right: var(--sp-sm);
  transition: color 0.25s;
}

.deal-card:hover .deal-name { color: var(--accent-bright); }

.deal-target {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 10px;
}

.deal-target strong {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Deal card right rail — status pill over a hero "% raised" figure */
.deal-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-left: var(--sp-md);
  flex-shrink: 0;
}

.deal-pct {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 48;
  font-size: 31px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  background-image: linear-gradient(135deg, #f5f9ff 5%, #6db5ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.deal-pct-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  margin-top: -4px;
}

/* Totals micro progress bars — each stat\'s share of target */
.totals-mini {
  height: 3px;
  max-width: 150px;
  border-radius: 2px;
  background: rgba(186, 205, 255, 0.10);
  margin-top: 10px;
  overflow: hidden;
}

.totals-mini-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 1.1s var(--ease-out) 0.15s;
}

.totals-mini-fill--signed      { background: linear-gradient(90deg, #2fd49f, #23a474); }
.totals-mini-fill--hard        { background: linear-gradient(90deg, #57b1ff, #1f7fe8); }
.totals-mini-fill--soft        { background: linear-gradient(90deg, #aeb8d6, #8b95b5); }
.totals-mini-fill--outstanding { background: rgba(186, 205, 255, 0.28); }

/* ============================================================================
 * New deal form
 * ============================================================================ */
.new-deal-section {
  margin-bottom: var(--sp-lg);
}

.form-card {
  position: relative;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: rise 0.4s var(--ease-out) both;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 140px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
}

.form-input {
  background: rgba(7, 10, 28, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--text);
  font-size: var(--font-base);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
}

.form-input:focus {
  border-color: rgba(24, 152, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(24, 152, 255, 0.14);
  background: rgba(7, 10, 28, 0.8);
}

.form-input::placeholder { color: var(--text-dim); }

.form-select {
  background-color: rgba(7, 10, 28, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--text);
  font-size: var(--font-base);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239c937f' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.form-select:focus {
  border-color: rgba(24, 152, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(24, 152, 255, 0.14);
}

/* ============================================================================
 * Deal detail view
 * ============================================================================ */
.detail-header {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-bottom: 36px;
}

.detail-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60;
  font-size: var(--font-2xl);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
  flex: 1;
}

.detail-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Commitments table — ledger with brass edge on hover */
.commitments-table {
  width: 100%;
  border-collapse: collapse;
}

.commitments-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
}

.commitments-table td {
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
  transition: background 0.18s, box-shadow 0.18s;
}

.commitments-table tr:last-child td { border-bottom: none; }

.commitments-table tbody tr:hover td { background: rgba(186, 205, 255, 0.045); }
.commitments-table tbody tr:hover td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

.commitments-table tbody tr.row-flash td { animation: row-flash 1.4s ease-out both; }

/* Inline amount edit — ledger convention: amounts right-aligned */
.commitments-table th:nth-child(2) { text-align: right; }

.amount-cell {
  min-width: 140px;
  text-align: right;
}

.amount-wrap {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.amount-currency {
  color: var(--text-dim);
  font-size: var(--font-sm);
}

.amount-wrap .amount-input { padding-left: 3px; }

.amount-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  padding: 4px 8px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  text-align: right;
  width: 120px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.25s;
}

.amount-input:hover { border-color: var(--border-strong); background: rgba(7, 10, 28, 0.5); }
.amount-input:focus {
  border-color: rgba(24, 152, 255, 0.6);
  background: rgba(7, 10, 28, 0.7);
  box-shadow: 0 0 0 3px rgba(24, 152, 255, 0.12);
}
.amount-input--error { border-color: var(--danger) !important; }

/* Status flip buttons */
.status-actions {
  display: flex;
  gap: var(--sp-xs);
  align-items: center;
}

/* ============================================================================
 * Typeahead
 * ============================================================================ */
.typeahead-wrap {
  position: relative;
  max-width: 420px;
}

.typeahead-input {
  width: 100%;
  background: rgba(7, 10, 28, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 9px 14px;
  color: var(--text);
  font-size: var(--font-base);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.typeahead-input::placeholder { color: var(--text-dim); }
.typeahead-input:focus {
  border-color: rgba(24, 152, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(24, 152, 255, 0.14);
}

@keyframes dd-in {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: rgba(24, 29, 56, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}

.typeahead-dropdown.open {
  display: block;
  animation: dd-in 0.18s var(--ease-out) both;
}

.typeahead-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  border-bottom: 1px solid var(--border-muted);
  border-left: 2px solid transparent;
  transition: background 0.15s, border-left-color 0.15s;
}

.typeahead-item:last-child { border-bottom: none; }
.typeahead-item:hover,
.typeahead-item.active {
  background: rgba(186, 205, 255, 0.07);
  border-left-color: var(--accent);
  padding-left: calc(var(--sp-lg) + 3px);
}

.typeahead-name {
  font-weight: 600;
  color: var(--text);
  font-size: var(--font-base);
}

.typeahead-email {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.typeahead-hints {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ---- Address autocomplete ---- */
.addr-ac-wrap { position: relative; }
.addr-ac-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: rgba(24, 29, 56, 0.92);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-modal);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  display: none;
}
.addr-ac-dropdown.open {
  display: block;
  animation: dd-in 0.18s var(--ease-out) both;
}
.addr-ac-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.addr-ac-item:last-child { border-bottom: none; }
.addr-ac-item:hover,
.addr-ac-item.active { background: rgba(24, 152, 255, 0.12); }

/* Commitment amount mini-form */
.add-commitment-form {
  display: none;
  margin-top: var(--sp-md);
  padding: var(--sp-lg);
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.add-commitment-form.open {
  display: block;
  animation: rise 0.35s var(--ease-out) both;
}

.selected-contact-banner {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-md);
}

.selected-contact-banner strong { color: var(--text); font-weight: 600; }

/* ============================================================================
 * Pipeline view
 * ============================================================================ */
.pipeline-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.sync-info {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.sync-info.syncing { color: var(--accent); }
.sync-info.error   { color: var(--danger); }

/* Live pulse — the portal is connected and breathing */
.live-dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signed);
  margin-right: 8px;
  flex-shrink: 0;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--signed);
  animation: pulse-ring 2.4s ease-out infinite;
}

.sync-info.syncing .live-dot { background: var(--accent); }
.sync-info.syncing .live-dot::after { border-color: var(--accent); animation-duration: 1s; }
.sync-info.error .live-dot { background: var(--danger); }
.sync-info.error .live-dot::after { border-color: var(--danger); }

.pipeline-search {
  flex: 1;
  max-width: 280px;
  background: rgba(7, 10, 28, 0.55);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--text);
  font-size: var(--font-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.25s;
}

.pipeline-search::placeholder { color: var(--text-dim); }
.pipeline-search:focus {
  border-color: rgba(24, 152, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(24, 152, 255, 0.14);
}

/* Pipeline columns layout */
.pipe-cols {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: var(--sp-lg);
  align-items: flex-start;
}

.pipe-col {
  flex: 1 1 340px;
  min-width: 300px;
  max-width: 480px;
  background: rgba(20, 25, 48, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s;
}

.pipe-col:hover { border-color: var(--border-strong); }

.pipe-col-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(186, 205, 255, 0.035), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipe-col-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
}

.pipe-col-count {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  background-image: linear-gradient(135deg, #f5f9ff, #6db5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pipe-col-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 330px);
  min-height: 320px;
  overflow-y: auto;
}

/* Pipeline contact cards — solid (hundreds in DOM), spotlight + slide on hover */
.pipe-contact-card {
  position: relative;
  overflow: hidden;
  flex-shrink: 0; /* overflow:hidden zeroes a flex item's min-height — don't let 900 cards crush */
  content-visibility: auto; /* ~1000 cards in DOM; skip layout/paint offscreen */
  contain-intrinsic-size: auto 148px; /* cards are uniform — exact, so column scroll never jumps */
  background: var(--card);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-md);
  padding: 15px 17px;
  transition: border-color 0.2s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}

.pipe-contact-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%),
              rgba(90, 170, 255, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
  z-index: 0;
}

/* Lift content above the spotlight overlay (same pattern as .deal-card) */
.pipe-contact-card > * { position: relative; z-index: 1; }

.pipe-contact-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.6);
}

.pipe-contact-card:hover::before { opacity: 1; }

.pipe-contact-name {
  font-weight: 600;
  color: var(--text);
  font-size: var(--font-sm);
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipe-contact-email {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipe-contact-capital {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--hard);
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.pipe-tags {
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 5px;
  margin-top: 9px;
  min-height: 21px;
  align-items: center;
}

.pipe-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(186, 205, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid var(--border-muted);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  transition: color 0.2s, border-color 0.2s;
}

.pipe-contact-card:hover .pipe-tag { color: var(--text-muted); border-color: var(--border); }

.pipe-tag--more {
  color: var(--accent-bright);
  background: rgba(24, 152, 255, 0.08);
  border-color: rgba(24, 152, 255, 0.3);
  flex-shrink: 0;
}

/* placeholder that holds an empty slot's line so every card is the same height */
.pipe-none {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  opacity: 0.55;
}

/* ============================================================================
 * Contact actions modal — GHL deep link / note / follow-up task
 * ============================================================================ */
.contact-link {
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: color 0.15s;
}

.contact-link:hover {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 18, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: overlay-in 0.2s ease-out both;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 86vh;
  overflow-y: auto;
  background: rgba(22, 27, 52, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 28px;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: rise 0.32s var(--ease-out) both;
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.modal-id { flex: 1; min-width: 0; }

.modal-name {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 30;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.modal-email {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-section { margin-top: 4px; }

.modal-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  margin-bottom: 12px;
}

.cm-notes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.cm-note {
  border-left: 2px solid rgba(24, 152, 255, 0.45);
  background: rgba(186, 205, 255, 0.04);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 10px 14px;
}

.cm-note-body { font-size: 13px; color: var(--text-muted); line-height: 1.5; word-break: break-word; }

.cm-note-date {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.cm-notes-empty { font-size: 12.5px; color: var(--text-dim); padding: 2px 0 4px; }

.cm-textarea { width: 100%; resize: vertical; min-height: 70px; line-height: 1.5; }

.modal-actions { display: flex; justify-content: flex-end; margin-top: 12px; }

.cm-status {
  min-height: 20px;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: right;
}

.cm-status.ok  { color: var(--signed); }
.cm-status.err { color: var(--danger); }

input[type="date"].form-input { color-scheme: dark; }

/* ============================================================================
 * Section headers / view titles
 * ============================================================================ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.view-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 60;
  font-size: var(--font-2xl);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text);
}

/* ============================================================================
 * Empty states
 * ============================================================================ */
.empty-state {
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--accent);
}

.empty-state-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 48;
  font-size: 24px;
  font-weight: 650;
  margin-bottom: var(--sp-md);
  background-image: linear-gradient(135deg, #f5f9ff 5%, #6db5ff 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.empty-state-body {
  font-size: var(--font-base);
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

.empty-state-cta { margin-top: 24px; }

/* ============================================================================
 * Spinner
 * ============================================================================ */
.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid rgba(234, 228, 216, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

.btn-primary .spinner { border-top-color: var(--accent-ink); }

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

/* ============================================================================
 * Misc utilities
 * ============================================================================ */
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-signed { color: var(--signed); }
.text-hard   { color: var(--hard); }
.text-soft   { color: var(--soft-text); }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

.mt-sm { margin-top: var(--sp-sm); }
.mt-md { margin-top: var(--sp-md); }
.mt-lg { margin-top: var(--sp-lg); }

.hidden { display: none !important; }

.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;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--sp-xl) 0;
}

.inline-error {
  font-size: var(--font-xs);
  color: var(--danger);
  margin-top: var(--sp-xs);
}

/* ============================================================================
 * Login page — aurora at full strength, glass card, orbiting mark
 * ============================================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: var(--sp-xl);
}

.login-body .aurora-1 { background: radial-gradient(closest-side, rgba(24, 152, 255, 0.36), transparent 72%); }
.login-body .aurora-2 { background: radial-gradient(closest-side, rgba(6, 182, 212, 0.26), transparent 72%); }
.login-body .aurora-3 { background: radial-gradient(closest-side, rgba(203, 172, 249, 0.19), transparent 72%); }

.login-card {
  position: relative;
  background: rgba(22, 27, 52, 0.62);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(186, 205, 255, 0.13);
  border-radius: var(--r-xl);
  padding: 56px 44px 40px;
  width: 100%;
  max-width: 408px;
  text-align: center;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.75),
              inset 0 1px 0 rgba(255, 255, 255, 0.09);
  animation: rise 0.7s var(--ease-out) both;
}

/* Brass top edge-light */
.login-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(100, 180, 255, 0.55), transparent);
}

.login-logo {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--sp-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(24, 152, 255, 0.08);
  border: 1px solid rgba(24, 152, 255, 0.30);
  color: var(--accent);
}

/* Slow orbiting dashed ring */
.login-logo::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px dashed rgba(24, 152, 255, 0.34);
  animation: spin-slow 28s linear infinite;
}

.login-eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: var(--sp-md);
}

.login-title {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 80;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 0.005em;
  margin-bottom: var(--sp-sm);
  line-height: 1.15;
  background-image: linear-gradient(135deg, #f5f9ff 10%, #6db5ff 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-subtitle {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-xl);
}

.login-rule {
  width: 40px;
  height: 1px;
  background: var(--border-strong);
  margin: 0 auto var(--sp-xl);
  border: none;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

.login-input {
  width: 100%;
  background: rgba(7, 10, 28, 0.5);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  color: var(--text);
  font-size: var(--font-base);
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.3s, background 0.2s;
}

.login-input::placeholder { color: var(--text-dim); }
.login-input:focus {
  border-color: rgba(24, 152, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(24, 152, 255, 0.15), 0 0 24px -6px rgba(24, 152, 255, 0.32);
  background: rgba(7, 10, 28, 0.75);
}

.login-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 12px;
  background: linear-gradient(180deg, #2ea0ff, #155eef);
  color: var(--accent-ink);
  border: 1px solid rgba(140, 200, 255, 0.45);
  border-radius: var(--r-md);
  font-family: var(--font-ui);
  font-size: var(--font-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: background 0.2s, transform 0.2s var(--ease-out), box-shadow 0.3s;
}

/* Occasional light pass — the door knows you're there */
.login-btn::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -70%;
  width: 40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-20deg);
  animation: login-sheen 8.5s ease-in-out infinite;
}

.login-btn:disabled::after { animation: none; }

@keyframes login-sheen {
  0%, 78%   { left: -70%; }
  96%, 100% { left: 130%; }
}

.login-btn:hover {
  background: linear-gradient(180deg, #45acff, #1d6cf5);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -8px rgba(24, 152, 255, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.login-btn:active { transform: scale(0.98); }
.login-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

.login-error {
  font-size: var(--font-sm);
  color: var(--danger);
  text-align: center;
  min-height: 20px;
}

.login-foot {
  margin-top: var(--sp-2xl);
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ============================================================================
 * Responsive
 * ============================================================================ */
@media (max-width: 768px) {
  .main-content { padding: var(--sp-lg) var(--sp-lg) var(--sp-2xl); }
  .deals-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; align-items: stretch; }
  .totals-strip { grid-template-columns: repeat(2, 1fr); }
  .totals-cell { padding: var(--sp-md) var(--sp-md) var(--sp-md) 0; }
  .totals-cell + .totals-cell { padding-left: var(--sp-md); }
  .totals-cell:nth-child(odd) { border-left: none; padding-left: 0; }
  .totals-value { font-size: 20px; }
  .pipe-cols { gap: var(--sp-sm); }
  .pipe-col { flex: 0 0 260px; min-width: 260px; }
  .topbar { padding: 0 var(--sp-lg); }
  .topbar-inner { gap: var(--sp-md); }
  .topbar-brand { font-size: 16px; gap: var(--sp-sm); }
  .topbar-brand span { display: none; }
  .topbar-nav { gap: var(--sp-lg); }
  .view-title { font-size: 22px; }
  .commitments-table th, .commitments-table td { padding: var(--sp-md) var(--sp-md); }
  .aurora { display: none; }  /* battery-friendly on phones */
}

/* Raise-progress donut (deal detail) */
.raise-progress-row {
  display: flex;
  align-items: center;
  gap: 24px;
}
.raise-donut { width: 110px; height: 110px; flex: 0 0 110px; }
.raise-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-track {
  fill: none;
  stroke: var(--outstanding, #323a63);
  stroke-width: 12;
}
.donut-seg { fill: none; stroke-width: 12; stroke-linecap: butt; }
.donut-seg--signed { stroke: #33c08d; }
.donut-seg--hard   { stroke: #4aa8ff; }
.donut-seg--soft   { stroke: #8b95b5; }
.donut-pct, .donut-sub {
  transform: rotate(90deg);
  transform-origin: 50px 50px;
  fill: var(--text, #e8ecff);
}
.donut-pct { font-size: 20px; font-weight: 700; }
.donut-sub { font-size: 9px; fill: var(--text-dim, #8b95b5); letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 560px) {
  .raise-progress-row { flex-direction: column; align-items: stretch; }
  .raise-donut { margin: 0 auto; }
}

/* ===== PM Acquisitions additions (260611-pm1) ===== */

/* ── Tier pills (model: .pill--signed / --hard / --soft) ─────────────────── */
.pill--buy {
  background: var(--signed-bg);
  color: var(--signed);
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.pill--watch {
  background: var(--hard-bg);
  color: var(--hard);
  border: 1px solid rgba(24, 152, 255, 0.32);
}

.pill--skip {
  background: var(--soft-bg);
  color: var(--soft-text);
  border: 1px solid rgba(118, 128, 159, 0.32);
}

.pill--cluster {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
}

/* ── Doors-confidence pills (small, inline in facts card) ────────────────── */
.pill--conf-high,
.pill--conf-med,
.pill--conf-low {
  padding: 2px 7px 1px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.pill--conf-high {
  background: var(--signed-bg);
  color: var(--signed);
  border: 1px solid rgba(16, 185, 129, 0.30);
}

.pill--conf-med {
  background: var(--hard-bg);
  color: var(--hard);
  border: 1px solid rgba(24, 152, 255, 0.32);
}

.pill--conf-low {
  background: var(--soft-bg);
  color: var(--soft-text);
  border: 1px solid rgba(118, 128, 159, 0.32);
}

/* ── Stage accents — shared by .stage-dot markers and timeline rows ──────── */
.stage-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--soft);
  color: var(--soft);
  box-shadow: 0 0 7px -1px currentColor;
}

/* Relationship-temperature stages (PM Outreach pipeline) */
.stage--new-lead  { background: #1898ff; color: #1898ff; }  /* accent blue */
.stage--contacted { background: #76809f; color: #76809f; }  /* neutral */
.stage--cold      { background: #5b80aa; color: #5b80aa; }  /* muted blue */
.stage--warm      { background: #d9a441; color: #d9a441; }  /* gold */
.stage--hot       { background: #e8593c; color: #e8593c; }  /* red/amber heat */
.stage--dq        { background: #7d7486; color: #7d7486; opacity: 0.6; }  /* desaturated */

/* DQ sections read as struck-out */
.stage--dq + .stage-section-name {
  text-decoration: line-through;
  text-decoration-color: rgba(125, 116, 134, 0.7);
  color: var(--text-dim);
}

/* ── Pipeline view: stage sections ───────────────────────────────────────── */
.stage-section { margin-bottom: var(--sp-2xl); }

.stage-section-header {
  display: flex;
  align-items: baseline;
  gap: var(--sp-md);
}

.stage-section-header .stage-dot { align-self: center; }

.stage-section-name {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 30;
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.stage-section-count {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* Company cards stack vertically so .card-foot can pin to the bottom */
.stage-section .deals-grid .deal-card {
  display: flex;
  flex-direction: column;
}

.card-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-md);
  margin-top: auto;
  padding-top: var(--sp-md);
  font-size: var(--font-xs);
  color: var(--text-dim);
  min-width: 0;
}

/* ── Toolbar: Skip-tier toggle (matches toolbar control styling) ─────────── */
.skip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-sm);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.skip-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.skip-toggle:hover { color: var(--text); }

/* ── Hottest-targets strip ───────────────────────────────────────────────── */
.hot-strip {
  display: flex;
  align-items: stretch;
  gap: var(--sp-md);
  overflow-x: auto;
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-xl);
}

.hot-chip {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 14px;
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.3s var(--ease-out), border-color 0.25s, box-shadow 0.3s;
}

/* Cursor-tracking spotlight (same pattern as .deal-card) */
.hot-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%),
              rgba(90, 170, 255, 0.16), transparent 65%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}

.hot-chip:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(90, 170, 255, 0.12);
}

.hot-chip:hover::before { opacity: 1; }

.hot-chip > * { position: relative; z-index: 1; }

/* ── Detail view: two-column row ─────────────────────────────────────────── */
.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .detail-cols { grid-template-columns: 1fr; }
}

/* ── Detail view: facts / profile rows ───────────────────────────────────── */
.fact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: var(--sp-md);
  align-items: baseline;
  padding-block: 6px;
  font-size: var(--font-sm);
  border-bottom: 1px solid var(--border-muted);
}

.fact-row:last-child { border-bottom: none; }

/* ── Detail view: stage control button row ───────────────────────────────── */
.stage-ctl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Detail view: activity timeline ──────────────────────────────────────── */
.tl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-muted);
}

.tl-item:last-child { border-bottom: none; }

.tl-item .stage-dot { margin-top: 4px; }

.tl-item.row-flash { animation: row-flash 1.4s ease-out both; }

.tl-item--stage {
  background: rgba(24, 152, 255, 0.05);
  border-radius: var(--r-sm);
}

.tl-item--system {
  color: var(--text-dim);
  opacity: 0.75;
}

.tl-body {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--font-sm);
  line-height: 1.55;
  color: var(--text-muted);
}

.tl-meta {
  font-family: var(--font-mono);
  font-size: var(--font-xs);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  flex-shrink: 0;
}

/* ── Overdue next-action date ────────────────────────────────────────────── */
.overdue { color: var(--danger); }
