/* ============================================================================
 * Capital Raise Portal — Institutional Theme
 * Warm ink + brass. Fraunces display over Instrument Sans.
 * Design language: private placement memorandum rendered as software.
 * ============================================================================ */

:root {
  /* Background layers — warm ink, not blue-slate */
  --bg:          #0c0b09;
  --bg-surface:  #131110;
  --card:        #161412;
  --card-alt:    #1d1a16;
  --card-hover:  #1a1714;

  /* Hairline borders — warm, low alpha */
  --border:        rgba(216, 203, 178, 0.11);
  --border-muted:  rgba(216, 203, 178, 0.07);
  --border-strong: rgba(216, 203, 178, 0.19);

  /* Text — warm paper tones */
  --text:        #eae4d8;
  --text-muted:  #9c937f;
  --text-dim:    #6e675a;

  /* Commitment status ramp — secured money is sage, promised is brass */
  --signed:      #5ba882;
  --signed-bg:   rgba(91, 168, 130, 0.10);
  --hard:        #c2a567;
  --hard-bg:     rgba(194, 165, 103, 0.10);
  --soft:        #8a8070;
  --soft-text:   #a89d8a;   /* lighter variant for text on dark — bar/dot use --soft */
  --soft-bg:     rgba(138, 128, 112, 0.12);
  --outstanding: #26221c;
  --outstanding-text: #6e675a;

  /* Actions — brass, never blue */
  --accent:       #c2a567;
  --accent-hover: #d5bb80;
  --accent-ink:   #171410;   /* text on brass */
  --danger:       #c4604f;
  --danger-hover: #d4715f;

  /* Type families */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui:      'Instrument Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;

  /* 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 convention — fund-factsheet uppercase */
  --label-tracking: 0.12em;

  /* Radius — restrained, print-adjacent */
  --r-sm: 2px;
  --r-md: 4px;
  --r-lg: 8px;
  --r-xl: 10px;

  /* Shadows — used sparingly (dropdown elevation only) */
  --shadow-card: none;
  --shadow-modal: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ============================================================================
 * 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(194, 165, 103, 0.28); color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a: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: 1px solid var(--accent);
  outline-offset: 2px;
}

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

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

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

/* Top bar — quiet, hairline-ruled */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-2xl);
  height: 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: var(--sp-md);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 550;
  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);
}

.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: var(--sp-2xl) var(--sp-2xl) var(--sp-3xl);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================================
 * Buttons
 * ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-xs);
  padding: 7px 16px;
  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.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.btn-secondary:hover { color: var(--text); border-color: rgba(216, 203, 178, 0.34); background: var(--card); }

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

.btn-danger {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}
.btn-danger:hover { color: var(--danger); background: rgba(196, 96, 79, 0.08); }

/* Top navigation — understated, brass underline on active */
.btn-nav {
  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);
  box-shadow: inset 0 -1px 0 transparent;
  transition: color 0.15s, box-shadow 0.15s;
}
.btn-nav:hover { color: var(--text); }
.btn-nav.active {
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--accent);
}

.btn-sm {
  padding: 4px 12px;
  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;
}

/* ============================================================================
 * Cards — flat, hairline-bordered
 * ============================================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

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

.card-body {
  padding: var(--sp-xl);
}

.card-title {
  font-size: var(--font-xs);
  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)
 * ============================================================================ */
.stack-bar-wrapper {
  margin: var(--sp-md) 0 var(--sp-sm);
}

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

.stack-bar-seg {
  height: 100%;
  min-width: 2px;
  transition: width 0.3s ease;
}

.stack-bar-seg--signed      { background: var(--signed); }
.stack-bar-seg--hard        { background: var(--hard); }
.stack-bar-seg--soft        { background: var(--soft); }
.stack-bar-seg--outstanding { background: var(--outstanding); flex: 1; }

.stack-bar-legend {
  display: flex;
  gap: var(--sp-xl);
  flex-wrap: wrap;
  margin-top: var(--sp-md);
}

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

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

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

.legend-dot--signed      { background: var(--signed); }
.legend-dot--hard        { background: var(--hard); }
.legend-dot--soft        { background: var(--soft); }
.legend-dot--outstanding { background: #3a352c; }

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

/* ============================================================================
 * Status pills — squared, uppercase, tracked
 * ============================================================================ */
.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(91, 168, 130, 0.28);
}

.pill--hard {
  background: var(--hard-bg);
  color: var(--hard);
  border: 1px solid rgba(194, 165, 103, 0.30);
}

.pill--soft {
  background: var(--soft-bg);
  color: var(--soft-text);
  border: 1px solid rgba(138, 128, 112, 0.30);
}

.pill--raising {
  background: var(--hard-bg);
  color: var(--hard);
  border: 1px solid rgba(194, 165, 103, 0.30);
}

.pill--closed {
  background: var(--signed-bg);
  color: var(--signed);
  border: 1px solid rgba(91, 168, 130, 0.28);
}

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

/* ============================================================================
 * Totals strip — fund-factsheet summary band
 * ============================================================================ */
.totals-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-2xl);
}

.totals-cell {
  background: transparent;
  padding: var(--sp-lg) var(--sp-xl) var(--sp-lg) 0;
}

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

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

.totals-value {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 28;
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.totals-value.text-signed { color: var(--signed); }
.totals-value.text-hard   { color: var(--hard); }
.totals-value.text-soft   { color: var(--soft-text); }

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

/* ============================================================================
 * Deal cards grid
 * ============================================================================ */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}

.deal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.deal-card:hover {
  border-color: rgba(194, 165, 103, 0.45);
  background: var(--card-hover);
}

.deal-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-md);
}

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

.deal-target {
  font-size: var(--font-sm);
  color: var(--text-dim);
  margin-top: var(--sp-sm);
}

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

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

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

.form-row {
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
  align-items: flex-end;
}

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

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

.form-input {
  background: var(--bg);
  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.15s;
}

.form-input:focus {
  border-color: rgba(194, 165, 103, 0.55);
}

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

.form-select {
  background: var(--bg);
  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;
}

.form-select:focus { border-color: rgba(194, 165, 103, 0.55); }

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

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

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

/* Commitments table — ledger styling */
.commitments-table {
  width: 100%;
  border-collapse: collapse;
}

.commitments-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  padding: var(--sp-md) var(--sp-xl);
  border-bottom: 1px solid var(--border);
}

.commitments-table td {
  padding: var(--sp-md) var(--sp-xl);
  border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
}

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

.commitments-table tbody tr { transition: background 0.12s; }
.commitments-table tbody tr:hover td { background: rgba(216, 203, 178, 0.045); }

.investor-name {
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.005em;
}

.investor-email {
  font-size: var(--font-xs);
  color: var(--text-dim);
  margin-top: 1px;
}

/* 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-size: var(--font-base);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  text-align: right;
  width: 120px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.amount-input:hover { border-color: var(--border-strong); background: var(--bg); }
.amount-input:focus { border-color: rgba(194, 165, 103, 0.55); background: var(--bg); }
.amount-input--error { border-color: var(--danger) !important; }

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

/* ============================================================================
 * Add investor typeahead
 * ============================================================================ */
.add-investor-section {
  margin-top: var(--sp-2xl);
  padding-top: var(--sp-xl);
  border-top: 1px solid var(--border);
}

.add-investor-section h4 {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  margin-bottom: var(--sp-md);
}

.typeahead-wrap {
  position: relative;
  max-width: 420px;
}

.typeahead-input {
  width: 100%;
  background: var(--bg);
  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.15s;
}

.typeahead-input::placeholder { color: var(--text-dim); }
.typeahead-input:focus { border-color: rgba(194, 165, 103, 0.55); }

.typeahead-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card-alt);
  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; }

.typeahead-item {
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  border-bottom: 1px solid var(--border-muted);
  transition: background 0.1s;
}

.typeahead-item:last-child { border-bottom: none; }
.typeahead-item:hover,
.typeahead-item.active { background: rgba(216, 203, 178, 0.06); }

.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-size: var(--font-xs);
  color: var(--text-dim);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

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

.add-commitment-form.open { display: block; }

.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: var(--sp-md);
  flex-wrap: wrap;
  margin-bottom: var(--sp-xl);
}

.sync-info {
  font-size: var(--font-xs);
  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); }

.pipeline-search {
  flex: 1;
  max-width: 280px;
  background: var(--bg);
  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.15s;
}

.pipeline-search::placeholder { color: var(--text-dim); }
.pipeline-search:focus { border-color: rgba(194, 165, 103, 0.55); }

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

.pipe-col {
  min-width: 290px;
  max-width: 330px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.pipe-col-header {
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pipe-col-name {
  font-size: 10.5px;
  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: var(--font-base);
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}

.pipe-col-body {
  padding: var(--sp-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  max-height: 560px;
  overflow-y: auto;
}

/* Pipeline contact cards */
.pipe-contact-card {
  background: var(--card);
  border: 1px solid var(--border-muted);
  border-radius: var(--r-md);
  padding: 10px var(--sp-md);
  transition: border-color 0.15s;
}

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

.pipe-contact-name {
  font-weight: 600;
  color: var(--text);
  font-size: var(--font-sm);
  letter-spacing: 0.005em;
}

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

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

.pipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 6px;
}

.pipe-tag {
  font-size: 9.5px;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-muted);
  padding: 1px 6px;
  border-radius: var(--r-sm);
}

/* ============================================================================
 * Section headers / view titles
 * ============================================================================ */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-xl);
}

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

/* ============================================================================
 * Empty states — typographic, no emoji
 * ============================================================================ */
.empty-state {
  text-align: center;
  padding: var(--sp-3xl) var(--sp-xl);
  color: var(--text-muted);
}

.empty-state-icon { display: none; }

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--font-lg);
  font-weight: 500;
  margin-bottom: var(--sp-sm);
  color: var(--text-muted);
}

.empty-state-body { font-size: var(--font-sm); color: var(--text-dim); }

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

@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
 * ============================================================================ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: var(--sp-xl);
}

.login-card {
  background: transparent;
  border: none;
  padding: var(--sp-2xl);
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-xl);
  color: var(--accent);
}

.login-eyebrow {
  font-size: 10px;
  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' 72;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--text);
  margin-bottom: var(--sp-sm);
  line-height: 1.15;
}

.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: var(--sp-md); }

.login-input {
  width: 100%;
  background: var(--bg-surface);
  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.15s;
}

.login-input::placeholder { color: var(--text-dim); }
.login-input:focus { border-color: rgba(194, 165, 103, 0.55); }

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  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;
  transition: background 0.15s;
}

.login-btn:hover { background: var(--accent-hover); }
.login-btn:disabled { opacity: 0.6; cursor: wait; }

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

.login-foot {
  margin-top: var(--sp-2xl);
  font-size: 10px;
  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 { min-width: 250px; }
  .topbar { padding: 0 var(--sp-lg); 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); }
}
