/* Epic Venture Partners — investor portal stylesheet.
 *
 * The design system of record is docs/design.md; the tokens below mirror it
 * by name and must not drift from it. One stylesheet, no framework, no
 * build step (README Decisions). */

:root {
  --font-display: Charter, "Iowan Old Style", Georgia, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --canvas: #ffffff;
  --ink: #191918;
  --ink-muted: #6e6e68;
  --hairline: #e7e7e3;
  /* The marketing site's canvas tint (epicventurepartners.com) */
  --hover: #fbfbf8;
  --surface-dark: #17181c;
  --ink-on-dark: #f4f4f2;
  --muted-on-dark: #a3a39e;
  --accent: #0e8a5e;
  --accent-bright: #7ce0b8;
  --chip-positive-bg: #e4f3ec;
  --chip-positive-fg: #0b6b47;
  --chip-neutral-bg: #efefec;
  --chip-neutral-fg: #5a5a54;
  --danger: #b42318;

  --content-max: 1040px;
}

/* --- Base --- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1 {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 400;
  margin: 0 0 8px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.muted {
  color: var(--ink-muted);
}

/* --- Shell --- */

/* A full-width top bar (wordmark + account actions) over a shell row:
 * nav sidebar (signed in only) beside the content frame. */

.topbar {
  border-bottom: 1px solid var(--hairline);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding-inline: 24px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.wordmark:hover {
  text-decoration: none;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user form {
  margin: 0;
}

.topbar-email {
  font-size: 13px;
  color: var(--ink-muted);
}

.shell {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.frame main {
  flex: 1;
  padding-block: 32px 64px;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
}

/* The divider lives on the frame, not the sidebar: the sticky sidebar is
 * only as tall as its nav, but the frame always spans the full column, so
 * the hairline runs the whole window height. */
.sidebar + .frame {
  border-left: 1px solid var(--hairline);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: block;
  position: relative;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color 120ms ease;
}

.sidebar-nav a:hover {
  background: var(--hover);
  text-decoration: none;
}

.sidebar-nav a.active {
  font-weight: 600;
  background: var(--hover);
}

/* Long labels shorten on the mobile strip (spans in base.html). */
.nav-short {
  display: none;
}

/* Straight, square-cornered accent bar: a pseudo-element, because anything
 * painted inside the item (inset shadow, gradient) curves with its 8px
 * radius. */
.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
}

.footer {
  border-top: 1px solid var(--hairline);
  padding-block: 24px;
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
}

.messages {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.messages li {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 8px;
}

/* --- Page structure --- */

.page-header {
  margin-bottom: 32px;
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-muted);
  margin: 4px 0 0;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  margin-bottom: 16px;
}

.section {
  margin-top: 48px;
}

.section-label {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 12px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head .section-label {
  margin: 0;
}

.view-all {
  font-size: 13px;
}

/* --- Summary card (the one dark surface per screen) --- */

.summary-card {
  background: var(--surface-dark);
  color: var(--ink-on-dark);
  border-radius: 8px;
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
}

.stat-label {
  display: block;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  margin-bottom: 8px;
}

.summary-figure {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 44px;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

.summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  margin: 0;
}

.summary-stats dt {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  margin-bottom: 8px;
}

.summary-stats dd {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* --- Data table --- */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}

th {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: left;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

tbody tr:hover {
  background: var(--hover);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Chips --- */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.chip-positive {
  background: var(--chip-positive-bg);
  color: var(--chip-positive-fg);
}

.chip-neutral {
  background: var(--chip-neutral-bg);
  color: var(--chip-neutral-fg);
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

a.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--canvas);
}

.btn-primary:hover {
  background: #2e2e2c;
}

.btn-outline {
  background: transparent;
  border-color: var(--hairline);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--hover);
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* --- Updates --- */

.update-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

a.update-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px 20px;
  color: var(--ink);
}

a.update-row:hover {
  background: var(--hover);
  text-decoration: none;
}

.update-deal {
  font-size: 13px;
  color: var(--ink-muted);
}

.update-title {
  font-size: 15px;
  font-weight: 600;
}

.update-date {
  font-size: 13px;
  color: var(--ink-muted);
  margin-left: auto;
}

article.update-card {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 24px;
}

.update-card .update-deal {
  margin: 0 0 4px;
}

.update-card h3 a {
  color: var(--ink);
}

.update-excerpt {
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-muted);
  max-width: 70ch;
  margin: 12px 0 8px;
}

.read-more {
  font-size: 13px;
  font-weight: 500;
}

.update-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.update-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}

.update-body {
  max-width: 70ch;
  font-size: 15px;
  line-height: 24px;
}

.update-body p {
  margin: 0 0 12px;
}

.update-body img {
  max-width: 100%;
}

/* --- Opportunities --- */

.opp-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.opp-card {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.opp-name {
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 24px;
  font-weight: 600;
  margin: 0;
}

.opp-spv {
  font-size: 13px;
  margin: 0;
}

.opp-excerpt {
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-muted);
  margin: 0;
}

.opp-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.opp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

/* --- Logo tiles --- */

/* Square mark with monogram fallback: the tile shows the company initial
 * until a logo exists. Sizes: sm 24, default 32, lg 48. */
.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--hover);
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  user-select: none;
}

.logo-tile:has(img) {
  background: var(--canvas);
}

.logo-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}

.logo-sm {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
}

.logo-lg {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.cell-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.page-header.with-logo {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.update-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* --- Alerts (action required — the only non-form use of --danger) --- */

.alert-required {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 21px;
}

.alert-required p {
  margin: 0 0 6px;
}

.alert-required p:last-child {
  margin-bottom: 0;
}

.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.confirm-row form {
  margin: 0;
}

.confirm-title {
  margin: 0;
  font-size: 14px;
}

.confirm-note {
  margin: 2px 0 0;
  font-size: 13px;
}

.nav-badge {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
  margin-left: 6px;
  vertical-align: 2px;
}

/* --- Portfolio companies --- */

.company-list {
  display: flex;
  flex-direction: column;
}

.company-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-block: 14px;
  border-bottom: 1px solid var(--hairline);
}

.company-item:last-child {
  border-bottom: 0;
}

.company-body {
  min-width: 0;
}

.company-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.company-name a {
  color: var(--ink);
}

.company-desc {
  font-size: 13px;
  margin: 2px 0 0;
}

/* --- Banking --- */

.bank-on-file {
  font-size: 16px;
  margin: 0 0 8px;
}

.steps {
  margin: 0 0 20px;
  padding-left: 22px;
  font-size: 14px;
  line-height: 22px;
}

.steps li {
  margin-bottom: 4px;
}

/* --- News --- */

.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: flex;
  gap: 14px;
  padding-block: 20px;
  border-bottom: 1px solid var(--hairline);
}

.news-item-body {
  min-width: 0;
}

.news-item:first-child {
  padding-top: 0;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 13px;
  margin: 0 0 4px;
}

.news-company {
  font-weight: 600;
}

.news-title {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}

.news-summary {
  font-size: 14px;
  line-height: 21px;
  color: var(--ink-muted);
  max-width: 70ch;
  margin: 0;
}

/* --- Entrance (auth screens) --- */

.entrance {
  display: flex;
  justify-content: center;
  padding-block: 48px;
  padding-inline: 24px;
}

.entrance-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 32px;
}

.entrance-card h1 {
  font-size: 24px;
  line-height: 30px;
  margin: 0 0 20px;
}

.entrance-card form > p {
  margin: 0 0 16px;
}

.entrance-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.entrance-card input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-family: var(--font-ui);
  /* 16px, not the 15px body size: mobile Safari force-zooms any focused
   * input below 16px, which would hit every investor at sign-in. */
  font-size: 16px;
  color: var(--ink);
  background: var(--canvas);
}

.entrance-card button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 999px;
  padding: 10px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  background: var(--ink);
  color: var(--canvas);
  cursor: pointer;
  margin-top: 4px;
}

.entrance-card button:hover {
  background: #2e2e2c;
}

.entrance-card button + button {
  margin-top: 12px;
}

.entrance-card button.btn-outline {
  background: transparent;
  border-color: var(--hairline);
  color: var(--ink);
}

.entrance-card button.btn-outline:hover {
  background: var(--hover);
}

.entrance-card hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 24px 0;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-checkbox label {
  margin: 0;
}

.entrance-alt {
  margin: 16px 0 0;
  font-size: 13px;
  text-align: center;
}

.errorlist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  color: var(--danger);
  font-size: 13px;
}

/* --- Landing, empty and error states --- */

.landing {
  text-align: center;
  padding-block: 96px 64px;
}

.landing h1 {
  font-size: 40px;
  line-height: 44px;
  margin: 0 0 8px;
}

.landing-sub {
  font-size: 15px;
  color: var(--ink-muted);
  margin: 0 0 32px;
}

.empty-state {
  text-align: center;
  padding-block: 96px;
}

.empty-state p {
  margin: 4px 0;
}

.empty-state .empty-title {
  font-size: 15px;
  font-weight: 500;
}

.empty-state .muted {
  font-size: 14px;
}

/* --- Responsive --- */

@media (max-width: 900px) {
  .shell {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    max-height: none;
    padding: 0 12px;
    border-bottom: 1px solid var(--hairline);
  }

  .sidebar + .frame {
    border-left: 0;
  }

  /* One scrollable row, never two: short labels make all five items fit
   * a 375px viewport; overflow scrolls (scrollbar hidden) as the fallback. */
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav a {
    padding: 12px 6px;
    border-radius: 0;
    font-size: 13px;
    white-space: nowrap;
  }

  .sidebar-nav a:hover,
  .sidebar-nav a.active {
    background: transparent;
  }

  /* Horizontal strip: the accent bar moves from left edge to bottom edge. */
  .sidebar-nav a.active::before {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 0;
    width: auto;
    height: 2px;
  }

  .nav-full {
    display: none;
  }

  .nav-short {
    display: inline;
  }

  .topbar-email {
    display: none;
  }
}

@media (max-width: 720px) {
  .container {
    padding-inline: 16px;
  }

  .summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    padding: 24px;
  }

  .entrance-card {
    padding: 24px;
    border: 0;
  }

  h1 {
    font-size: 24px;
    line-height: 30px;
  }

  /* Column priority: phones show Deal / Amount / Status; SPV, entity, and
   * close date are one tap away on the deal page (docs/design.md). */
  .col-secondary {
    display: none;
  }

  td.num,
  th.num {
    white-space: nowrap;
  }

  .update-card header {
    flex-wrap: wrap;
  }
}

@media (max-width: 400px) {
  .wordmark {
    font-size: 16px;
  }

  .topbar-inner {
    padding-inline: 16px;
  }
}
