/* ============================================================
   OBSEPIO CAPITAL — PARTNER PORTAL STYLES
   Extends shared/css/base.css

   Tokens only — no literal hex anywhere below. getThemeColors() reads the
   same custom properties at runtime so the NAV chart re-themes with the page.

   Three blocks here are deliberate copies rather than shared code, and it is
   worth knowing which: the language switch (investor.css), the document
   folders (investor.css) and the modal shell (admin.css). Each of those lives
   in a portal stylesheet today, not in base.css, so there was nothing to
   import. If a fourth portal ever needs one of them, that is the moment to
   promote all three into base.css rather than make a fourth copy — see the
   note in TODO.md. The parts that ARE shared already live in base.css:
   .prospect-event* (prospectEventHtml) and .badge-* (prospectStageBadgeHtml).
   ============================================================ */

/* ============================================================
   LANGUAGE SWITCH  (mirrors investor.css)
   ============================================================ */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-switch button {
  padding: 0.3125rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 999px;
  letter-spacing: 0.05em;
  transition: color var(--transition), background var(--transition);
  min-height: 28px;
}
.lang-switch button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.2);
}

/* ============================================================
   COMMISSION SUMMARY
   ============================================================ */
.commission-note {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ============================================================
   PIPELINE — one collapsible section per PROSPECT_STAGES entry
   ============================================================ */
.pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.stage:hover { border-color: var(--border-strong); }

.stage-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background var(--transition);
  user-select: none;
  -webkit-user-select: none;
}
.stage-header:hover { background: var(--surface-2); }
.stage-header:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.stage-icon {
  display: grid; place-items: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text-muted);
  flex-shrink: 0;
}
.stage-icon [data-lucide], .stage-icon .lucide { width: 1.05rem; height: 1.05rem; }
/* Tone families come from PROSPECT_STAGES.tone and name existing tokens only. */
.stage.tone-primary .stage-icon { background: var(--primary-soft); color: var(--primary); }
.stage.tone-warning .stage-icon { background: var(--warning-bg);   color: var(--warning); }
.stage.tone-success .stage-icon { background: var(--success-bg);   color: var(--success); }
.stage.tone-error   .stage-icon { background: var(--error-bg);     color: var(--error); }

.stage-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1875rem 0.625rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-chevron { color: var(--text-faint); flex-shrink: 0; transition: transform var(--transition); }
.stage-chevron [data-lucide], .stage-chevron .lucide { width: 1rem; height: 1rem; display: block; }
.stage.open .stage-chevron { transform: rotate(180deg); }

.stage-body {
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.stage-empty { font-size: 0.8125rem; color: var(--text-faint); margin: 0; }

/* ============================================================
   PROSPECT CARD
   ============================================================ */
.prospect-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.875rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.prospect-card:hover { background: var(--surface-3); border-color: var(--border-strong); }
.prospect-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.prospect-main { min-width: 0; }
.prospect-name {
  font-size: 0.9375rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prospect-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.125rem; }

.prospect-side {
  display: flex; align-items: center; gap: 0.875rem;
  flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end;
}
.prospect-amount {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 0.875rem; font-weight: 500; color: var(--text);
}
/* Indicative by default, earned only once the fund has confirmed it — the
   colour difference is doing real work here, so keep them distinct. */
.prospect-money {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 0.8125rem; color: var(--text-faint);
}
.prospect-money.earned { color: var(--success); font-weight: 600; }
.prospect-next {
  display: inline-flex; align-items: center; gap: 0.3125rem;
  font-size: 0.75rem; color: var(--text-muted);
}
.prospect-next [data-lucide], .prospect-next .lucide { width: 0.8125rem; height: 0.8125rem; }

/* ============================================================
   DOCUMENT FOLDERS  (mirrors investor.css, minus the upload button —
   a partner never uploads, so there is no button to hide)
   ============================================================ */
.doc-folders { display: flex; flex-direction: column; gap: 0.75rem; }

.doc-folder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.doc-folder:hover { border-color: var(--border-strong); }

.doc-folder-header {
  width: 100%;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  cursor: pointer; text-align: left;
  color: var(--text); font-size: 0.9375rem; font-weight: 600;
  transition: background var(--transition);
  user-select: none; -webkit-user-select: none;
}
.doc-folder-header:hover { background: var(--surface-2); }
.doc-folder-header:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.doc-folder-icon {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius);
  background: var(--primary-soft); color: var(--primary);
  flex-shrink: 0;
}
.doc-folder-icon [data-lucide], .doc-folder-icon .lucide { width: 1.25rem; height: 1.25rem; }

.doc-folder-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-folder-count {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1875rem 0.625rem;
  white-space: nowrap; flex-shrink: 0; margin-left: auto;
}
.doc-folder-chevron { color: var(--text-faint); flex-shrink: 0; transition: transform var(--transition); }
.doc-folder-chevron [data-lucide], .doc-folder-chevron .lucide { width: 1rem; height: 1rem; display: block; }
.doc-folder.open .doc-folder-chevron { transform: rotate(180deg); }

.doc-folder-body { border-top: 1px solid var(--border); padding: 1rem 1.125rem; }
.doc-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.doc-folder-body .doc-card { box-shadow: none; background: var(--surface-2); }
.doc-folder-body .doc-card:hover { background: var(--surface-3); border-color: var(--border-strong); }

/* ============================================================
   MODAL  (mirrors admin.css)
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  animation: fade-in 150ms var(--ease);
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  animation: modal-in 200ms var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 1.25rem 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-body .form-field { margin-bottom: 1rem; }
.modal-body .form-field:last-child { margin-bottom: 0; }
.modal-body .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
.modal-body select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23797876' stroke-width='1.5'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}
.modal-body .form-input:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.9;
}
.modal-body textarea.form-input { resize: vertical; min-height: 80px; }

/* A note under a field, and its louder variant for the closed-prospect lock. */
.modal-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
}
.modal-hint.locked {
  margin: 0 0 1rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  background: var(--success-bg);
  color: var(--success);
  font-weight: 500;
}

/* ============================================================
   TIMELINE BLOCK inside the prospect modal
   (.prospect-event* themselves live in base.css — prospectEventHtml() is shared)
   ============================================================ */
.timeline-block {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.timeline-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.timeline-title {
  font-size: 0.75rem; font-weight: 600;
  color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.note-box { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.875rem; }
.note-box .btn { align-self: flex-start; width: auto; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .prospect-card { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .prospect-side { justify-content: flex-start; }
  .modal-body .form-grid { grid-template-columns: 1fr; }
  .doc-grid-inner { grid-template-columns: 1fr; }
  .stage-header { padding: 0.75rem 0.875rem; font-size: 0.875rem; }
  .stage-body { padding: 0.75rem 0.875rem; }
  .chart-header { flex-wrap: wrap; gap: 0.625rem; align-items: flex-start; }
  .chart-timeframes { width: 100%; justify-content: flex-start; }
  .lang-switch button { padding: 0.25rem 0.5625rem; font-size: 0.6875rem; }
}


/* ——————————————————————————————————————————
   Preview banner — only ever rendered by partner/preview.html, which is a
   local design preview and is not deployed. Kept here rather than inline so
   preview.html needs no <style> block of its own.
—————————————————————————————————————————— */
.preview-banner {
  position: relative;
  z-index: 60;
  padding: 0.75rem 1.25rem;
  background: var(--warning-bg);
  border-bottom: 1px solid var(--warning);
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.preview-banner strong { color: var(--warning); font-weight: 600; }
.preview-banner code {
  padding: 0.05rem 0.3rem;
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* A committed amount is the fund's number, not the partner's estimate — it
   reads as settled rather than provisional. Pairs with the title attribute
   set in prospectCardHtml(). */
.prospect-amount.confirmed { color: var(--text); font-weight: 600; }
