@font-face {
  font-family: Inter;
  src: url("/assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #101819;
  --rail: #0d1415;
  --panel: #162022;
  --card: #1a2729;
  --border: #2b3b3c;
  --text: #edf5f3;
  --muted: #a7b9b7;
  --green: #90edc2;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-family: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--text); line-height: 1.5; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 2; top: 14px; left: 14px; border-radius: 8px; padding: 10px; color: var(--rail); background: var(--green); }

.shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: 100dvh;
  padding: 23px 17px 15px;
  border-right: 1px solid var(--border);
  background: var(--rail);
}

.identity { display: flex; align-items: center; align-self: start; gap: 11px; padding: 5px 8px; font-size: 24px; font-weight: 730; letter-spacing: -.06em; }
.mark { display: flex; align-items: end; justify-content: center; gap: 2.5px; width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: var(--green); }
.mark i { width: 4px; height: 43%; border-radius: 1px; background: #102c24; }
.mark i:nth-child(2) { height: 69%; }
.mark i:nth-child(3) { height: 96%; }

.nav { display: grid; gap: 5px; margin-top: 36px; }
.nav a, .back { display: flex; min-height: 43px; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 580; }
.nav a:hover, .back:hover { background: var(--panel); color: var(--text); }
.nav a[aria-current] { border-color: #254138; background: #172b26; color: var(--green); }
.nav-glyph { width: 18px; text-align: center; font-size: 17px; }
.back { margin-top: auto; }

.workspace { min-width: 0; background: radial-gradient(ellipse at 82% 0%, #1a2928, var(--page) 48%); }

.topbar {
  display: flex;
  min-height: 68px;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px clamp(18px, 3.5vw, 52px);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.top-actions { display: flex; align-items: center; gap: 14px; }
.sample-label { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 12px; font-weight: 650; white-space: nowrap; }
.sample-label i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.button { min-height: 38px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); font-weight: 625; font-size: 13px; }
.button.quiet { background: transparent; color: var(--muted); }
.button:hover { border-color: var(--green); color: var(--text); }
.button.primary { border-color: var(--green); background: var(--green); color: #0c231b; }
.button.primary:hover { background: #b0f9da; }

.content { max-width: 1510px; margin-inline: auto; padding: 39px clamp(18px, 3.5vw, 52px) 51px; }
.heading { margin-bottom: 29px; }
.heading h1 { font-size: clamp(35px, 4.3vw, 62px); font-weight: 710; line-height: 1.05; letter-spacing: -.064em; }
.heading p { margin-top: 10px; color: var(--muted); font-size: 15px; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 28px; }
.metric { display: flex; flex-direction: column; gap: 9px; padding: 15px 16px; border: 1px solid var(--border); border-radius: 12px; background: linear-gradient(150deg, #1d2a2c, var(--panel)); }
.metric span { color: var(--muted); font-size: 12px; font-weight: 560; }
.metric strong { font: 610 clamp(21px, 2.45vw, 34px)/1.1 var(--mono); letter-spacing: -.063em; }
.metric:nth-child(2) strong { color: var(--green); }

.filters { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.filter-fields { display: flex; flex-wrap: wrap; gap: 9px; min-width: 0; }
.search, .market select, .stage-form select { min-height: 41px; border: 1px solid var(--border); border-radius: 8px; background: #131d1f; }
.search { display: flex; align-items: center; gap: 7px; min-width: 125px; padding: 0 11px; color: var(--muted); }
.search > span:first-child { font-size: 20px; line-height: 1; }
.search input { min-width: 0; width: min(205px, 100%); border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.market select, .stage-form select { max-width: 100%; padding: 6px 12px; font-size: 13px; }
.mode { display: flex; flex: 0 0 auto; gap: 2px; height: 41px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: #131d1f; }
.mode button { border: 0; border-radius: 6px; padding: 0 13px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 620; }
.mode button:hover { color: var(--text); }
.mode button[aria-pressed="true"] { background: #263637; color: var(--text); }

.board-scroll, .table-scroll { overflow-x: auto; scrollbar-color: #3b5252 var(--panel); scrollbar-width: thin; }
.board { display: grid; grid-template-columns: repeat(5, minmax(152px, 1fr)); gap: 11px; min-width: 804px; padding-bottom: 10px; }
.lane { min-height: 325px; border: 1px solid var(--border); border-radius: 11px; background: #151f20; }
[data-stage="pursuit"] { --stage: #b4c3c2; }
[data-stage="valuation"] { --stage: #ebc38d; }
[data-stage="marketing"] { --stage: #8be9bc; }
[data-stage="contract"] { --stage: #a4c8f2; }
[data-stage="closed"] { --stage: #c7b4ed; }
.lane-title { display: flex; align-items: center; gap: 7px; margin: 0; padding: 11px 9px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 670; white-space: nowrap; }
.lane-title i, .stage-pill i { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--stage); }
.lane-title > span { margin-left: auto; color: var(--muted); font: 11px var(--mono); }
.lane-cards { display: grid; align-content: start; gap: 8px; padding: 8px; min-height: 270px; }
.lane.drop-target { border-color: var(--green); background: #1b312b; }

.deal-card { display: flex; flex-direction: column; min-width: 0; min-height: 105px; padding: 11px 9px 9px; border: 1px solid #304445; border-radius: 8px; background: var(--card); text-align: left; }
.deal-card:hover { border-color: #60847a; background: #203031; }
.deal-card strong { width: 100%; min-height: 1.4em; font-size: 13px; font-weight: 680; letter-spacing: -.018em; }
.deal-place { margin-top: 2px; color: var(--muted); font-size: 11px; }
.deal-values { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; width: 100%; min-height: 24px; margin-top: auto; padding-top: 10px; }
.deal-values b { font: 605 13px var(--mono); color: var(--green); }
.deal-values > span { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.empty-lane, .empty-results { padding: 12px; color: var(--muted); font-size: 13px; }
.empty-results { padding: 26px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }

.table-scroll { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
table { width: 100%; min-width: 630px; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
thead th { background: #202d2e; color: var(--muted); font-size: 11px; font-weight: 680; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: #1b292a; }
td { color: var(--muted); }
.number { font-family: var(--mono); color: var(--text); }
.table-link { padding: 1px 0; border: 0; background: transparent; color: var(--text); font-weight: 680; text-align: left; }
.table-link:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

.stage-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 5px; color: var(--stage); font-size: 11px; white-space: nowrap; }

.persona { display: flex; align-items: center; gap: 9px; }
.persona small { display: block; color: var(--muted); font-weight: 500; }
.avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: #26433a; color: var(--green); font-size: 10px; }

dialog { width: min(calc(100% - 28px), 518px); max-height: calc(100dvh - 30px); padding: 23px 25px; border: 1px solid #415654; border-radius: 17px; background: var(--panel); color: var(--text); box-shadow: 0 20px 80px #0008; }
dialog::backdrop { background: #060b0bc0; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; }
.close { width: 35px; height: 35px; border: 1px solid var(--border); border-radius: 50%; background: var(--card); font-size: 24px; line-height: 1; }
dialog h2 { font-size: clamp(28px, 5vw, 40px); line-height: 1.13; letter-spacing: -.058em; }
.detail-subtitle { margin-top: 7px; color: var(--muted); font-size: 14px; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 20px; }
.detail-facts > div { padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.detail-facts dt { color: var(--muted); font-size: 11px; }
.detail-facts dd { margin-top: 2px; font: 600 13px/1.4 var(--mono); }
.detail-section { padding-top: 14px; }
.detail-section h3 { margin-bottom: 3px; font-size: 13px; }
.detail-section p { color: var(--muted); font-size: 14px; }
.stage-form { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); }
.stage-form label { display: grid; flex: 1; gap: 5px; color: var(--muted); font-size: 13px; }
.stage-form .button { min-height: 41px; white-space: nowrap; }
.linked-deals { padding: 0; list-style: none; }
.linked-deals li { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 0; font-size: 14px; }

.status { position: fixed; z-index: 1; right: 15px; bottom: 15px; max-width: calc(100% - 30px); padding: 12px 16px; border: 1px solid #4b775f; border-radius: 9px; background: #203b30; color: #cdf4df; font-size: 13px; }

@media (max-width: 975px) {
  .shell { grid-template-columns: 167px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
}

@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: 1fr auto; align-items: center; height: auto; padding: 9px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .identity { padding: 1px 3px; font-size: 22px; }
  .nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 3px; margin-top: 6px; }
  .nav a { padding: 7px 7px; min-height: 37px; gap: 4px; white-space: nowrap; }
  .nav-glyph { width: 14px; }
  .back { grid-row: 1; grid-column: 2; margin: 0; padding: 5px 4px; min-height: 36px; }
  .topbar { min-height: 49px; }
  .top-actions { gap: 8px; }
  .topbar .button { min-height: 32px; padding-inline: 7px; font-size: 12px; }
  .content { padding-block: 25px 30px; }
  .heading { margin-bottom: 18px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 16px; }
  .metric { gap: 5px; padding: 10px 11px; }
  .filters { flex-wrap: wrap; }
  .lane { min-height: 300px; }
}

@media (max-width: 365px) {
  .workspace-name { display: none; }
  .top-actions { margin-left: auto; }
  .filter-fields { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }
}
