/* Nautica PSOP – dark, Apple-style */

:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --separator: rgba(84, 84, 88, 0.55);
  --text: #f5f5f7;
  --text-2: rgba(235, 235, 245, 0.62);
  --text-3: rgba(235, 235, 245, 0.38);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.15);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.15);
  --red: #ff453a;
  --red-soft: rgba(255, 69, 58, 0.15);
  --radius: 18px;
  --radius-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Inter, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}
.topbar-inner {
  max-width: 1040px; margin: 0 auto; height: 56px;
  padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; }
.brand-mark { height: 26px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a, .nav button {
  background: none; border: 0; cursor: pointer;
  color: var(--text-2); font-size: 14px; padding: 7px 12px; border-radius: 999px;
}
.nav a:hover, .nav button:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav .who { color: var(--text-3); font-size: 13px; padding: 0 8px; }

/* ---------- layout ---------- */
.app { max-width: 1040px; margin: 0 auto; padding: 28px 20px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.eyebrow { color: var(--text-2); font-size: 13px; font-weight: 500; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; margin: 2px 0 0; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 40px 0 14px; }
h3 { font-size: 17px; font-weight: 600; margin: 0; }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 24px;
}
.card + .card { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > .card + .card, .grants > .card + .card { margin-top: 0; }

/* ---------- hero ---------- */
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.big { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.big small { font-size: 20px; font-weight: 600; color: var(--text-2); letter-spacing: -0.01em; margin-left: 6px; }
.pct-pill { font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 5px 10px; border-radius: 999px; white-space: nowrap; }

.bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 22px 0 12px; display: flex; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.bar.thin { height: 6px; margin: 14px 0 8px; }

.legend { display: flex; gap: 18px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.legend .dot-a { background: var(--accent); }
.legend .dot-b { background: var(--surface-3); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; border-top: 0.5px solid var(--separator); }
.stat { padding: 18px 16px 2px 0; }
.stat + .stat { padding-left: 18px; border-left: 0.5px solid var(--separator); }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* ---------- value card ---------- */
.value-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.value-main { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.value-rows { margin-top: 16px; display: grid; gap: 10px; }
.value-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.value-row span:last-child { font-variant-numeric: tabular-nums; }
.footnote { font-size: 12px; color: var(--text-3); margin-top: 16px; line-height: 1.5; }

/* ---------- chart ---------- */
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--separator); stroke-width: 0.5; }
.chart .axis text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .today line { stroke: var(--text-2); stroke-dasharray: 3 3; stroke-width: 1; }
.chart .today text { fill: var(--text-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .bar-past { fill: var(--accent); }
.chart .bar-future { fill: var(--accent); opacity: 0.38; }
.chart .bar-hit { fill: transparent; cursor: default; }
.chart .bar-hl { fill: rgba(255,255,255,0.06); }
.chart .area-past { fill: var(--accent); opacity: 0.22; }
.chart .area-future { fill: var(--accent); opacity: 0.08; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.chart .line-future { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; opacity: 0.55; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); margin-top: 12px; flex-wrap: wrap; }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none;
  background: rgba(44, 44, 46, 0.96); border: 0.5px solid var(--separator);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; min-width: 160px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.tooltip .tt-title { font-weight: 600; margin-bottom: 6px; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; color: var(--text-2); }
.tooltip .tt-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 500;
  padding: 5px 14px; border-radius: 7px; color: var(--text-2); white-space: nowrap;
}
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

/* ---------- grant cards ---------- */
.grants { display: grid; gap: 16px; }
.grant-toggle { cursor: pointer; margin: -22px -24px; padding: 22px 24px; border-radius: var(--radius); outline: none; }
.grant-toggle:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.grant-head-right { display: flex; align-items: center; gap: 10px; }
.chev-toggle { width: 9px; height: 9px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.grant.open .chev-toggle { transform: rotate(-135deg) translate(-2px, -2px); }
.grant.open .grant-body { margin-top: 22px; }
.grant-body .facts { margin-top: 0; }
.hero-sub { margin-top: 6px; font-size: 15px; }
.card.person { display: block; width: 100%; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; transition: background .15s; }
.card.person:hover { background: #232325; }
.card.person:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.person-value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.grant-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.grant-title { font-size: 13px; color: var(--text-2); }
.grant-options { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.grant-options small { font-size: 15px; font-weight: 500; color: var(--text-2); margin-left: 4px; letter-spacing: 0; }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 16px; margin: 20px 0 0; padding-top: 18px; border-top: 0.5px solid var(--separator); }
.facts dt { font-size: 12px; color: var(--text-2); }
.facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 550; font-variant-numeric: tabular-nums; }
.facts dd .sub { display: block; font-size: 12px; font-weight: 400; color: var(--text-3); }
.calc {
  margin-top: 18px; background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 14px; display: grid; gap: 4px;
}
.calc-label { font-size: 12px; color: var(--text-2); }
.calc-eq { font-variant-numeric: tabular-nums; }
.calc-eq b { font-weight: 650; }
.calc-note { font-size: 14px; color: var(--text); white-space: pre-wrap; }

.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge.vesting { color: var(--accent); background: var(--accent-soft); }
.badge.vested { color: var(--green); background: var(--green-soft); }
.badge.cliff { color: var(--orange); background: var(--orange-soft); }
.badge.upcoming { color: var(--text-2); background: var(--surface-2); }
.badge.admin { color: var(--text); background: var(--surface-3); }
.badge.current { color: var(--green); background: var(--green-soft); }

.empty { text-align: center; padding: 56px 24px; color: var(--text-2); }
.empty h3 { color: var(--text); margin-bottom: 6px; }

.banner {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--accent-soft); color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 14px; margin-bottom: 20px;
}

/* ---------- buttons ---------- */
.btn {
  border: 0; cursor: pointer; border-radius: 999px; padding: 9px 18px;
  font-size: 15px; font-weight: 500; background: var(--surface-2); color: var(--text);
  transition: filter .15s, background .15s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: .5; cursor: default; filter: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.ghost { background: none; color: var(--accent); padding-left: 8px; padding-right: 8px; }
.btn.small { font-size: 13px; padding: 6px 12px; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; background: var(--surface-2); border: 1px solid transparent; border-radius: 10px;
  padding: 11px 13px; font-size: 15px; outline: none; transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
select.input {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--accent); background: var(--surface-3); }
.input::placeholder { color: var(--text-3); }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-size: 15px; pointer-events: none; }
.input-affix > .input { padding-left: 50px; }
input[type="date"].input::-webkit-calendar-picker-indicator { filter: invert(0.7); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

.switch-row > label:first-child { flex: 1; cursor: pointer; }
.switch-row { display: flex; justify-content: space-between; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 10px 13px; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: background .2s; cursor: pointer; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.3); transition: transform .2s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.preview { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 4px 0 16px; font-size: 14px; }
.preview .preview-big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.preview .preview-lines { color: var(--text-2); margin-top: 6px; display: grid; gap: 2px; }
.preview.warn { background: var(--orange-soft); }

/* ---------- login ---------- */
.login { min-height: calc(100vh - 60px); display: grid; place-items: center; }
.login-box { width: 100%; max-width: 360px; text-align: center; }
.login-logo { width: 190px; height: auto; margin: 0 auto 36px; display: block; }
.login-box h1 { font-size: 26px; margin-bottom: 6px; }
.login-box p { color: var(--text-2); margin: 0 0 28px; }
.login-box form { text-align: left; }
.login-box .input { padding: 14px 15px; font-size: 16px; }

/* ---------- admin lists ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.list { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.list-row {
  display: grid; align-items: center; gap: 14px; padding: 14px 20px; width: 100%;
  border: 0; background: none; text-align: left; cursor: pointer;
  grid-template-columns: 40px 1fr auto auto;
}
.list-row + .list-row { border-top: 0.5px solid var(--separator); }
.list-row:hover { background: rgba(255,255,255,0.03); }
.list-row .title { font-weight: 550; }
.list-row .sub { font-size: 13px; color: var(--text-2); }
.list-row .right { text-align: right; font-variant-numeric: tabular-nums; }
.list-row .chev { color: var(--text-3); font-size: 18px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, #636366, #3a3a3c); font-weight: 600; font-size: 14px;
}
.list-row.grant-row { grid-template-columns: 1fr auto auto; }
.list-row.price-row { grid-template-columns: 1fr auto auto; }
.list-empty { padding: 36px 20px; text-align: center; color: var(--text-2); }

/* ---------- sheet / dialog ---------- */
.sheet {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 48px);
  border: 0; border-radius: 22px; padding: 0; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.sheet::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet[open] { animation: sheet-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-in { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { position: sticky; top: 0; z-index: 2; background: var(--surface); display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 6px; }
.sheet-head h3 { font-size: 19px; }
.sheet-body { padding: 12px 22px 8px; }
.sheet-foot { position: sticky; bottom: 0; z-index: 2; background: var(--surface); border-top: 0.5px solid var(--separator); display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 22px 18px; }
.sheet-foot .actions:last-child { margin-left: auto; }
.close-x {
  border: 0; background: var(--surface-2); color: var(--text-2); width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; font-size: 17px; line-height: 1;
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  background: rgba(58,58,60,.96); color: var(--text); padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.5);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.toast.error { background: rgba(255,69,58,.95); }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app { padding: 20px 16px 64px; }
  .topbar-inner { padding: 0 16px; }
  .brand-text { display: none; }
  .nav .who { display: none; }
  h1 { font-size: 28px; }
  .big { font-size: 44px; }
  .card { padding: 18px; }
  .grant-toggle { margin: -18px; padding: 18px; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { padding-left: 0; border-left: 0; border-top: 0.5px solid var(--separator); }
  .stat { padding: 14px 0 0; }
  .stat + .stat { margin-top: 14px; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .list-row { padding: 12px 16px; grid-template-columns: 36px 1fr auto; }
  .list-row .hide-sm { display: none; }
  .list-row.grant-row, .list-row.price-row { grid-template-columns: 1fr auto; }
  .avatar { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
