/* WellSpent Deal Desk prototype styles. All brand tokens live in :root. */
:root {
  --navy: #16283C;
  --gold: #B3905F;
  --paper: #FBF9F5;
  --sand: #F2ECE1;
  --ink: #1F2933;
  --muted: #6B7280;
  --success: #2E7D4F;
  --warn: #B7791F;
  --danger: #B23A3A;
  --white: #FFFFFF;
  --hairline: rgba(179, 144, 95, 0.55);
  --divider: rgba(31, 41, 51, 0.10);

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;

  --radius: 4px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: var(--navy); text-decoration-color: var(--gold); text-underline-offset: 2px; }
a:hover { color: var(--gold); }
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); font-weight: 600; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 36px; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
p { margin: 0 0 10px; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Kickers: gold, letterspaced, uppercase */
.kicker {
  font-family: var(--font-body);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 4px;
}

/* Header */
.ws-header {
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 14px var(--gutter);
}
.ws-brand { display: flex; align-items: baseline; gap: 12px; }
.ws-wordmark { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--white); text-decoration: none; }
.ws-wordmark:hover { color: var(--white); }
.ws-brand .kicker { margin: 0; }
.ws-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; flex: 1 1 auto; justify-content: center; }
.ws-nav a { color: #D9DEE5; text-decoration: none; font-size: 14px; padding: 4px 0; border-bottom: 2px solid transparent; }
.ws-nav a:hover { color: var(--white); }
.ws-nav a.active { color: var(--white); border-bottom-color: var(--gold); }
.ws-role { display: flex; align-items: center; gap: 12px; }
.ws-toggle { display: inline-flex; border: 1px solid var(--gold); border-radius: var(--radius); overflow: hidden; }
.ws-toggle button {
  font: inherit; font-size: 13px; padding: 5px 12px; border: 0; cursor: pointer;
  background: transparent; color: #D9DEE5;
}
.ws-toggle button[aria-pressed="true"] { background: var(--gold); color: var(--navy); font-weight: 600; }
.ws-user { font-size: 13px; color: #D9DEE5; }

/* Banners */
.banner {
  background: var(--sand);
  border-left: 3px solid var(--gold);
  padding: 8px var(--gutter);
  font-size: 13px;
  color: var(--ink);
}
.banner-junior { background: #F7EBD3; border-left-color: var(--warn); }

/* Layout */
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 8px; }
.sec { border-top: 1px solid var(--hairline); padding-top: 18px; margin-top: 26px; }
.sec h2 { margin-bottom: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Callouts and panels */
.callout {
  background: var(--sand);
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 14px;
}
.card { background: var(--white); border: 1px solid var(--divider); border-radius: var(--radius); padding: 20px; }
.notice { text-align: left; padding: 40px 0; }

/* Key value grid */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 24px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.kv .wide { grid-column: 1 / -1; }
.prose p { max-width: 75ch; }
.prose h3 { margin-top: 16px; }

/* Buttons and inputs */
.btn {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  background: var(--navy); color: var(--white); border: 1px solid var(--navy);
}
.btn:hover { background: #22395A; color: var(--white); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--gold); }
.btn-ghost:hover { background: var(--sand); color: var(--navy); }
.btn[disabled] { background: #C9CDD3; border-color: #C9CDD3; color: #5B6470; cursor: not-allowed; }
.input, select.input, textarea.input {
  font: inherit; font-size: 14px; width: 100%; padding: 7px 9px;
  border: 1px solid #CDD2D8; border-radius: var(--radius); background: var(--white); color: var(--ink);
}
.input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input[type="number"].input { font-family: var(--font-mono); }
textarea.input { min-height: 84px; resize: vertical; }
.invalid { border-color: var(--danger) !important; background: #FBEEEE; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.field label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.field .req { color: var(--danger); }
.readonly { padding: 7px 0; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0; }
.filters .input { max-width: 340px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-btn {
  font: inherit; font-size: 13px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  background: var(--white); border: 1px solid #CDD2D8; color: var(--ink);
}
.pill-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--divider); border-radius: var(--radius); background: var(--paper); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  background: var(--navy); color: var(--white); font-weight: 500; text-align: left;
  padding: 9px 12px; white-space: nowrap; font-size: 13px;
}
.table td { padding: 9px 12px; border-top: 1px solid var(--divider); vertical-align: top; background: var(--paper); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover td { background: var(--sand); }
.table tr.total td { font-weight: 600; border-top: 2px solid var(--gold); }
.table-foot { margin-top: 10px; font-size: 13px; color: var(--muted); }
.nowrap { white-space: nowrap; }

/* Matrix cells */
.cell-btn { font: inherit; background: transparent; border: 0; padding: 0; cursor: pointer; }

/* Pills */
.pill {
  display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 999px;
  white-space: nowrap; background: #E6E9ED; color: var(--ink); border: 1px solid transparent;
}
.pill-new { background: #E8EEF5; color: var(--navy); }
.pill-screening { background: var(--sand); color: #6B5330; }
.pill-pre-screen-sent { background: #EFE5D3; color: #6B5330; border-color: var(--gold); }
.pill-buyer-outreach { background: #F7EBD3; color: #7A5214; }
.pill-term-sheet { background: #E2F0E7; color: var(--success); }
.pill-processing { background: var(--navy); color: var(--white); }
.pill-closed { background: var(--success); color: var(--white); }
.pill-dead { background: #F4E1E1; color: var(--danger); }
.pill-not-sent { background: transparent; color: var(--muted); border-color: #CDD2D8; }
.pill-sent { background: #E8EEF5; color: var(--navy); }
.pill-interested { background: #F7EBD3; color: #7A5214; }
.pill-pass { background: #F4E1E1; color: var(--danger); }
.pill-funded { background: var(--success); color: var(--white); }

/* Sources and uses */
.su-table td.label { color: var(--ink); }
.su-table td.gap { border-left: 1px solid var(--hairline); }

/* Commentary block */
.mono-block {
  font-family: var(--font-mono); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--white); border: 1px solid var(--divider); border-left: 3px solid var(--gold);
  padding: 16px; margin: 0;
}

/* Email card */
.email-card { background: var(--paper); border: 1px solid var(--hairline); padding: 20px; overflow-x: auto; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--navy); color: var(--white); border-left: 3px solid var(--gold);
  padding: 10px 18px; border-radius: var(--radius); font-size: 14px; z-index: 50;
  transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  h1 { font-size: 30px; }
  .ws-nav { justify-content: flex-start; order: 3; flex-basis: 100%; }
  .ws-role { margin-left: auto; }
  .wrap { padding-top: 18px; }
}

/* ---------------------------------------------------------------------------
   V1 additions (V1_SPEC 15): queue hero box, badges, panels, timeline, print.
   --------------------------------------------------------------------------- */
.ws-header-btn { font: inherit; font-size: 13px; background: transparent; color: #D9DEE5; border: 1px solid rgba(255,255,255,0.35); border-radius: var(--radius); padding: 4px 10px; cursor: pointer; }
.ws-header-btn:hover { color: var(--white); border-color: var(--gold); }
.badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 11px; font-weight: 600; text-align: center; margin-left: 4px; }
.banner-env { background: #E8EEF5; border-left-color: var(--navy); }

.hero { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 18px 20px; margin: 16px 0 8px; }
.hero h2 { color: var(--white); margin-bottom: 8px; }
.hero .kicker { color: var(--gold); }
.hero ul { list-style: none; margin: 0; padding: 0; }
.hero li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 0; border-top: 1px solid rgba(179,144,95,0.35); }
.hero a { color: var(--white); }
.hero .mono { color: #F2ECE1; }

.pill-exception { background: #F4E1E1; color: var(--danger); }
.pill-warn { background: #F7EBD3; color: #7A5214; }
.pill-missing { background: var(--sand); color: #6B5330; }
.pill-ok { background: #E2F0E7; color: var(--success); }
.pill-tbc, .pill-not_applicable, .pill-missing_data { background: #E6E9ED; color: var(--ink); }
.pill-ready_to_send { background: #EFE5D3; color: #6B5330; border-color: var(--gold); }
.pill-buyer_outreach { background: #F7EBD3; color: #7A5214; }
.pill-term_sheet { background: #E2F0E7; color: var(--success); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-top: 1px solid var(--divider); }
.list-plain li:first-child { border-top: 0; }
.list-plain .grow { flex: 1 1 220px; min-width: 0; }
.timeline li { align-items: baseline; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inline-form .input { width: auto; flex: 1 1 200px; }
.warn-text { color: var(--warn); font-size: 13px; }
.error-text { color: var(--danger); font-size: 13px; }
.form-section-note { margin: -6px 0 12px; }

@media print {
  .ws-header, .banner, .actions, .no-print, .toast, .inline-form, button { display: none !important; }
  body { background: var(--paper); font-size: 12px; }
  .wrap { max-width: none; padding: 0; }
  .sec { break-before: auto; break-inside: avoid-page; }
  .sec.page-break { break-before: page; }
  .table-wrap { overflow: visible; border: 0; }
  a { color: var(--ink); text-decoration: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.toast.error { border-left-color: var(--danger); }
