/* --- Home hero — architectural photo, ascetic whitespace --- */
.ds-hero {
  position: relative;
  text-align: center;
  padding: 7.5rem 2.5rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  border: none;
  border-radius: 0;
  background-color: var(--color-navy);
  background-image: url("/assets/images/hero-cityscape.jpg");
  background-size: cover;
  background-position: center 35%;
  box-shadow: none;
  overflow: hidden;
}

@media (min-width: 768px) {
  .ds-hero {
    margin-left: -1rem;
    margin-right: -1rem;
  }
}

/* Photo carries the tone — no heavy tint overlay. */
.ds-hero--arch::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(2, 36, 56, 0.35) 0%,
    rgba(2, 36, 56, 0.15) 45%,
    rgba(2, 36, 56, 0.45) 100%
  );
  pointer-events: none;
}

.ds-hero--arch .ds-page-header {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.ds-hero--arch .ds-page-title {
  color: var(--color-white);
  font-size: clamp(2.75rem, 3.5vw + 1.5rem, 4.25rem);
  font-weight: var(--ds-weight-normal);
}

.ds-hero--arch .ds-page-lead {
  color: rgba(255, 255, 255, 0.82);
  max-width: 36rem;
}

.ds-hero--arch .ds-overline {
  color: var(--color-coral);
}

/* Inline page heroes (terms, etc.) — calm parchment, no photo. */
.ds-hero:not(.ds-hero--arch) {
  padding: 3rem 2.5rem;
  background: var(--color-white);
  background-image: none;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 0;
  box-shadow: none;
}

.ds-hero-rule {
  display: none;
}

/* --- Stat cards (home page) --- */
.ds-stat-card {
  border-left: 3px solid var(--color-navy) !important;
}
.ds-stat-card h2 {
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-h2);
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-h2);
  color: var(--ds-mahogany-deep);
}

/* --- Action cards (home page) --- */
.ds-action-card {
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  border: 1px solid var(--ds-parchment-shadow) !important;
  border-radius: 0;
  box-shadow: none !important;
}
.ds-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 36, 56, 0.08) !important;
  border-color: var(--color-navy) !important;
}
.ds-action-card i {
  color: var(--color-navy);
}
.ds-action-card i.ds-icon-accent {
  color: var(--color-coral);
}
.ds-action-card h5 {
  font-family: var(--ds-font-display);
  font-weight: var(--ds-weight-normal);
  color: var(--ds-mahogany-deep);
}

/* --- Upload zone — bigger, calmer --- */
.ds-upload-zone {
  border: 2px dashed var(--color-navy) !important;
  border-radius: 0 !important;
  background: linear-gradient(180deg, var(--color-white) 0%, var(--ds-parchment-mid) 100%) !important;
  transition: all 0.25s ease;
}
.ds-upload-zone:hover {
  border-color: var(--color-teal) !important;
  box-shadow: inset 0 0 0 1px rgba(2, 36, 56, 0.08);
  background: linear-gradient(180deg, var(--color-white) 0%, var(--ds-parchment-mid) 100%) !important;
}

/* --- Muted text --- */
.ds-app .text-muted {
  color: var(--ds-ink-soft) !important;
}

/* --- Documents queue rows ------------------------------------------------
   Scannable, denser work-queue rows: a strong document name, a
   human-meaningful metadata line (recipient · template · waiting time)
   in place of the old raw UUID, a status badge, a derived urgency pill,
   a copy-ID control, and a safe Open + overflow (⋯) action cluster. */

.ds-app .ds-doc-list .ds-doc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* ~30% tighter than the default list-group padding for density. */
  padding: 0.5rem 0.75rem;
  transition: background 0.12s ease;
}

.ds-app .ds-doc-list .ds-doc-row:hover {
  background: var(--ds-parchment-mid);
}

.ds-app .ds-doc-list .ds-doc-row-submitted {
  background: color-mix(in srgb, var(--ds-brass) 12%, var(--ds-parchment-mid));
  box-shadow: inset 3px 0 0 var(--ds-brass);
}

.ds-doc-urgency-changes {
  background: #fef3c7;
  color: #92400e;
}

.ds-doc-row-icon {
  color: var(--color-navy);
  font-size: var(--ds-text-lg);
  flex: 0 0 auto;
}

.ds-doc-main {
  flex: 1 1 auto;
  min-width: 0;
}

.ds-doc-name {
  display: block;
  font-weight: 600;
  color: var(--ds-mahogany-deep) !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ds-doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.1rem;
  font-size: var(--ds-text-sm);
  font-weight: 400;
  color: var(--ds-ink-soft);
}

.ds-doc-meta-recipient {
  font-weight: 500;
  color: var(--ds-ink);
}

.ds-doc-meta-sep {
  color: var(--ds-parchment-shadow);
}

/* Document-type pill — teal tint so it reads on parchment rows. */
.ds-app .ds-doc-meta-kind {
  background: rgba(40, 86, 102, 0.12) !important;
  border: 1px solid rgba(40, 86, 102, 0.3) !important;
  color: var(--ds-mahogany-deep) !important;
  font-weight: 600;
  font-size: var(--ds-text-sm);
  letter-spacing: 0.01em;
}

/* Investor rows — name, type/fund meta, status, age pill, and Open. */
.ds-doc-row--investor {
  gap: 0.65rem;
}

.ds-doc-meta-updated {
  white-space: nowrap;
}

.ds-doc-status {
  flex: 0 0 auto;
}

.ds-doc-urgency-cell {
  flex: 0 0 auto;
  min-width: 0;
}

/* Urgency pill — derived from days in review (no SLA field yet). */
.ds-doc-urgency {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.ds-doc-urgency-high {
  background: #fee2e2;
  color: #991b1b;
}
.ds-doc-urgency-med {
  background: #fef3c7;
  color: #854d0e;
}
.ds-doc-urgency-low {
  background: #dcfce7;
  color: #166534;
}

.ds-doc-copy-cell {
  flex: 0 0 auto;
}

.ds-app .ds-doc-copy {
  color: var(--ds-parchment-shadow);
  font-size: var(--ds-text-sm);
  transition: color 0.12s ease;
}
.ds-app .ds-doc-row:hover .ds-doc-copy {
  color: var(--ds-ink-soft);
}

.ds-doc-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.ds-app .ds-doc-overflow-toggle {
  color: var(--ds-ink-soft) !important;
  box-shadow: none !important;
  line-height: 1;
}
.ds-app .ds-doc-overflow-toggle:hover,
.ds-app .ds-doc-overflow-toggle:focus {
  color: var(--ds-mahogany-deep) !important;
}

/* Collapse the lower-priority columns on narrow viewports so the row
   stays readable instead of wrapping into a tall block. */
@media (max-width: 640px) {
  .ds-doc-copy-cell,
  .ds-doc-urgency-cell {
    display: none;
  }

  .ds-hero,
  .ds-hero--arch {
    padding: 5rem 1.25rem;
  }
}

/* --- Documents action flash (global shell; filled after submit / return) --- */
.ds-documents-flash:not(:empty) {
  margin-bottom: 0.75rem;
}

/* --- Documents page header (title + "New assignment" action) --- */
.ds-docs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.ds-docs-header-text {
  min-width: 0;
}
.ds-docs-header-action {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* --- "Assign a template" drawer --- */
.ds-assign-drawer .offcanvas-title {
  font-family: var(--ds-font-display);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-mahogany-deep);
}

/* --- Create fund modal (centered) --- */
.ds-create-fund-modal .modal-title {
  font-family: var(--ds-font-display);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-mahogany-deep);
}
.ds-create-fund-modal .modal-content {
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.25);
}
.ds-create-fund-modal .modal-body {
  padding-top: 0.5rem;
}

/* --- Create fund: first-class hero CTA on the funds home --- */
.ds-fund-create-hero-btn {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* --- Funds hub toolbar (admin client / law-firm filters) --- */
.ds-funds-hub-toolbar {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ds-parchment-mid) 70%, var(--color-white));
  border: 1px solid color-mix(in srgb, var(--ds-parchment-shadow) 55%, transparent);
}
.ds-funds-hub-filter-label {
  display: block;
  font-size: var(--ds-text-sm);
  font-weight: 600;
  color: var(--ds-ink-soft);
  margin-bottom: 0.35rem;
}
.ds-funds-roster-empty {
  font-size: var(--ds-text-body);
  line-height: 1.45;
  padding: 0.25rem 0.15rem;
}

/* --- Fund roster cards (admin / manager home) --- */
.ds-fund-roster-link {
  display: flex;
  width: 100%;
  color: inherit;
}
.ds-fund-roster-card {
  width: 100%;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ds-fund-roster-card:hover {
  background: var(--ds-parchment-mid);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.ds-fund-roster-card-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ds-fund-roster-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
}
.ds-fund-roster-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ds-fund-roster-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.ds-fund-roster-title {
  font-family: var(--ds-font-display);
  font-size: var(--ds-text-h3);
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-h3);
  letter-spacing: var(--ds-tracking-tight);
  color: var(--ds-mahogany-deep);
}
.ds-fund-roster-link:hover .ds-fund-roster-title {
  color: var(--ds-mahogany-deep);
}
.ds-fund-status-badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.ds-fund-roster-pitch {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.35;
  flex: 1 1 auto;
}
.ds-fund-roster-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.15rem;
  font-size: var(--ds-text-sm);
  color: var(--ds-ink-soft);
}
.ds-fund-roster-meta-sep {
  color: var(--ds-parchment-shadow);
}
.ds-fund-logo--roster {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex: 0 0 auto;
}
.ds-fund-missing-docs-icon {
  color: var(--color-coral);
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.85;
}
.ds-fund-missing-docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--color-coral);
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.9;
  cursor: pointer;
}
.ds-fund-missing-docs-btn:hover,
.ds-fund-missing-docs-btn:focus {
  opacity: 1;
  outline: none;
  transform: scale(1.08);
}
.ds-fund-section-card.needs-attention > .card {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-coral) 35%, transparent);
}

.ds-fund-section-row {
  align-items: stretch;
}
/* Override .ds-app .card gradient so the coral wash can fade in. */
.ds-fund-section-card > .card,
.ds-fund-section-card > .card > .card-body {
  background: var(--color-white);
}
.ds-fund-section-card > .card {
  height: 100%;
  /* Slow open/close on hover; pin overrides with a shorter duration below. */
  transition:
    background 0.65s ease,
    box-shadow 0.65s ease,
    border-color 0.65s ease;
}
.ds-fund-section-card > .card > .card-body {
  transition: background 0.65s ease;
}
.ds-fund-section-card .card-body {
  display: flex;
  flex-direction: column;
}
.ds-fund-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
/* Start closed; expand via grid 0fr → 1fr (no display:none snap). */
.ds-fund-section-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows 0.7s ease,
    opacity 0.55s ease,
    margin-top 0.7s ease;
}
.ds-fund-section-body-inner {
  min-height: 0;
  overflow: hidden;
}
/* Open only while hovered or pinned — not while focus remains inside. */
.ds-fund-section-card:hover .ds-fund-section-body,
.ds-fund-section-card.is-pinned .ds-fund-section-body {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 1rem;
}
.ds-fund-section-card:hover > .card,
.ds-fund-section-card:hover > .card > .card-body,
.ds-fund-section-card.is-pinned > .card,
.ds-fund-section-card.is-pinned > .card > .card-body {
  background: color-mix(in srgb, var(--color-coral) 12%, var(--color-white));
}
.ds-fund-section-card:hover > .card,
.ds-fund-section-card.is-pinned > .card,
.ds-fund-section-card.needs-attention:hover > .card,
.ds-fund-section-card.needs-attention.is-pinned > .card {
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--color-coral) 45%, transparent),
    0 0 0 1px color-mix(in srgb, var(--color-coral) 14%, transparent);
}
/* Pin opens/closes faster than hover. */
.ds-fund-section-card.is-pinned > .card,
.ds-fund-section-card.is-pinned > .card > .card-body {
  transition:
    background 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}
.ds-fund-section-card.is-pinned .ds-fund-section-body {
  transition:
    grid-template-rows 0.28s ease,
    opacity 0.2s ease,
    margin-top 0.28s ease;
}
.ds-fund-section-pin {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 50%;
  background: transparent;
  color: var(--ds-ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}
.ds-fund-section-card:hover .ds-fund-section-pin,
.ds-fund-section-card.is-pinned .ds-fund-section-pin {
  opacity: 1;
}
.ds-fund-section-pin:hover,
.ds-fund-section-pin:focus {
  color: var(--color-coral);
  border-color: color-mix(in srgb, var(--color-coral) 55%, var(--ds-parchment-shadow));
  background: color-mix(in srgb, var(--color-coral) 10%, var(--color-white));
}
.ds-fund-section-pin-icon-pinned {
  display: none;
}
.ds-fund-section-card.is-pinned .ds-fund-section-pin-icon-open {
  display: none;
}
.ds-fund-section-card.is-pinned .ds-fund-section-pin-icon-pinned {
  display: inline;
}
.ds-fund-section-card.is-pinned .ds-fund-section-pin {
  color: var(--color-coral);
  border-color: color-mix(in srgb, var(--color-coral) 50%, var(--ds-parchment-shadow));
  background: color-mix(in srgb, var(--color-coral) 12%, var(--color-white));
  transform: rotate(-18deg);
}
/* Touch / narrow: pin control always visible; card stays closed until pinned. */
@media (hover: none), (max-width: 991.98px) {
  .ds-fund-section-pin {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ds-fund-section-card > .card,
  .ds-fund-section-card > .card > .card-body,
  .ds-fund-section-card.is-pinned > .card,
  .ds-fund-section-card.is-pinned > .card > .card-body,
  .ds-fund-section-body,
  .ds-fund-section-card.is-pinned .ds-fund-section-body {
    transition-duration: 0.01ms;
  }
}

/* --- Premium create-fund form fields --- */
.ds-field-label {
  display: flex;
  align-items: baseline;
  font-family: var(--ds-font-sans);
  font-weight: var(--ds-weight-bold);
  font-size: var(--ds-text-sm);
  color: var(--ds-mahogany-deep);
  margin-bottom: 6px;
}
.ds-field-optional {
  font-weight: var(--ds-weight-normal);
  font-size: var(--ds-text-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--ds-tracking-eyebrow);
  color: var(--ds-ink-soft);
  margin-left: 8px;
}

/* --- Investor fund cards (LP dashboard) --- */
.ds-investor-fund-card {
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ds-investor-fund-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.ds-investor-fund-title {
  color: var(--ds-mahogany-deep);
}
.ds-investor-fund-title:hover {
  color: var(--ds-brass);
}
.ds-investor-fund-action {
  flex: 1 1 auto;
  white-space: nowrap;
}
.ds-fund-request-item {
  border-left: 3px solid transparent;
}
.ds-fund-request-item:hover {
  background: #fbf8f1;
}

.ds-fund-logo,
.ds-fund-logo-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  object-fit: contain;
  background: var(--ds-parchment-mid);
  border: 1px solid var(--ds-parchment-shadow);
}
.ds-fund-logo--header {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}
.ds-fund-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ds-ink-soft);
  font-size: 1.5rem;
}
.ds-fund-header-logo-wrap {
  flex: 0 0 auto;
}
.ds-fund-logo-upload-preview {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.ds-fund-logo-upload-preview .ds-fund-logo,
.ds-fund-logo-upload-preview .ds-fund-logo-placeholder {
  margin: 0 auto;
}
.ds-fund-logo-upload {
  display: block;
  width: 100%;
  border: 2px dashed var(--ds-parchment-shadow);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.ds-fund-logo-upload-inner {
  padding: 1rem;
  text-align: center;
  pointer-events: none; /* clicks/drops hit the Upload root, not nested text */
}
.ds-fund-logo-upload:hover {
  border-color: var(--ds-gold);
  background: rgba(201, 162, 39, 0.08);
}
