:root {
  --ink: #3b3b3b;
  --muted: #5f6f89;
  --line: #dfe7f2;
  --bg: #f7fafc;
  --paper: #ffffff;
  --primary: #4fa65c;
  --primary-dark: #3b3b3b;
  --primary-soft: #eef8f0;
  --amber: #e0a100;
  --red: #cf3f3f;
  --shadow: 0 20px 50px rgba(59, 59, 59, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: 0; }
.brand-logo { display: block; width: 168px; height: auto; }
.sidebar .brand-logo { filter: brightness(0) invert(1); }
.navlinks { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 15px; }
.actions { display: flex; align-items: center; gap: 10px; }
.btn {
  border: 0; border-radius: 8px; padding: 11px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; cursor: pointer; font-weight: 700;
  background: var(--ink); color: #fff;
}
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn.primary { background: var(--primary); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.hero {
  min-height: calc(100vh - 72px);
  display: grid; align-items: center;
  padding: 46px 0 34px;
  background:
    linear-gradient(110deg, rgba(247,250,252,.98), rgba(247,250,252,.76)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1800&q=82") center/cover;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 42px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; }
h1 { font-size: clamp(42px, 6vw, 72px); line-height: .98; margin: 14px 0 18px; letter-spacing: 0; }
.lead { font-size: 20px; line-height: 1.55; color: #34445d; max-width: 680px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0; }
.pill { border: 1px solid var(--line); background: rgba(255,255,255,.82); border-radius: 999px; padding: 9px 12px; font-weight: 700; color: #31415a; }
.product-shot {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shot-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.shot-body { padding: 18px; display: grid; gap: 14px; }
.doc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.doc-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; }
.small { color: var(--muted); font-size: 13px; }
.status { border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 800; background: #eef3fb; color: #37506e; white-space: nowrap; }
.status.signed { background: var(--primary-soft); color: var(--primary-dark); }
.status.pending { background: #fff6dd; color: #8a6100; }
.section { padding: 72px 0; }
.section h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin: 0 0 14px; letter-spacing: 0; }
.muted { color: var(--muted); line-height: 1.6; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: 0 10px 30px rgba(20,33,61,.05); }
.card h3 { margin: 0 0 8px; font-size: 20px; }
.split-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.app-shell { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 100vh; background: #f5f6f7; font-weight: 400; }
.sidebar {
  background: #f9faf9;
  color: #2f3530;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #e2e7e2;
  overflow: auto;
}
.sidebar .brand { color: var(--ink); margin-bottom: 24px; }
.sidebar .brand-logo { filter: none; width: 170px; }
.profile-switcher {
  display: grid;
  gap: 7px;
  background: white;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.profile-switcher select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  outline: 0;
}
.profile-switcher small { color: #667369; }
.profile-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  margin-bottom: 18px;
}
.profile-create input {
  min-width: 0;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  padding: 9px 10px;
  background: white;
}
.profile-create button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.side-nav { display: grid; gap: 7px; }
.side-nav a, .side-nav summary {
  padding: 11px 14px;
  border-radius: 8px;
  color: #303733;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}
.side-nav a:hover, .side-nav a.active, .side-nav summary:hover { background: #edf7ef; color: #1f6f3a; }
.side-nav a.active { background: #4fa65c; color: white; box-shadow: 0 12px 26px rgba(79,166,92,.18); }
.side-nav details { display: grid; gap: 4px; }
.side-nav details a { margin-left: 24px; padding: 8px 12px; color: #627066; }
.side-nav summary { list-style: none; }
.side-nav summary::-webkit-details-marker { display: none; }
.plan-box {
  margin-top: 24px;
  background: white;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 10px;
}
.plan-box strong { font-size: 17px; }
.plan-box p { margin: 0; }
.plan-box a { color: #1f6f3a; font-weight: 600; }
.plan-bar { height: 8px; border-radius: 999px; background: #e4e8e4; overflow: hidden; }
.plan-bar span { display: block; height: 100%; background: #4fa65c; }
.main { padding: 0 28px 28px; min-width: 0; }
.app-topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e3e7e3;
  margin: 0 -28px 28px;
  padding: 0 28px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-actions { display: flex; align-items: center; gap: 18px; color: #4f5952; }
.top-actions > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #dde5dd;
  background: white;
  font-size: 13px;
}
.user-menu { position: relative; }
.user-menu button {
  border: 0;
  background: transparent;
  display: grid;
  text-align: right;
  cursor: pointer;
  color: var(--ink);
}
.user-menu button strong { font-weight: 600; }
.user-menu button small { color: #707a73; }
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  min-width: 190px;
  background: white;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
}
.user-menu:hover .user-dropdown, .user-menu:focus-within .user-dropdown { display: grid; }
.user-dropdown a { padding: 10px 12px; border-radius: 8px; color: #303733; }
.user-dropdown a:hover { background: #f4f7f4; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 34px; line-height: 1.1; margin: 0 0 6px; }
.table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: 13px; background: #fbfdff; }
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}
.toolbar input, .toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.metric {
  background: white;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(59,59,59,.07);
  position: relative;
  overflow: hidden;
}
.metric::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 78px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid rgba(79,166,92,.18);
  border-left-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(-8deg);
}
.metric span { color: var(--ink); display: block; font-size: 18px; font-weight: 500; }
.metric strong { display: block; margin-top: 8px; font-size: 38px; line-height: 1; font-weight: 500; }
.metric small { color: #667369; display: block; margin-top: 4px; }
.metric-pending::after { border-color: rgba(224,161,0,.2); border-left-color: transparent; border-bottom-color: transparent; }
.metric-expiring::after { border-color: rgba(119,83,182,.18); border-left-color: transparent; border-bottom-color: transparent; }
.metric-refused::after { border-color: rgba(207,63,63,.16); border-left-color: transparent; border-bottom-color: transparent; }
.app-search {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 8px;
  margin-bottom: 20px;
}
.app-search input, .app-search select {
  border: 1px solid #dde5dd;
  border-radius: 999px;
  min-height: 46px;
  padding: 0 18px;
  background: white;
  color: var(--ink);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  margin-top: 18px;
}
.panel-card {
  background: white;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(59,59,59,.07);
  padding: 18px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.panel-head h2, .quick-links h2, .recent-panel h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
}
.panel-head span, .panel-head a { color: #667369; font-size: 14px; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-area { fill: rgba(79,166,92,.22); }
.chart-line { fill: none; stroke: #74b987; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: white; stroke: #74b987; stroke-width: 3; }
.chart-wrap text { fill: #6a736c; font-size: 13px; }
.quick-links { display: grid; gap: 13px; align-content: start; }
.quick-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dde5dd;
  border-radius: 8px;
  padding: 12px;
  font-weight: 500;
  background: #fff;
}
.quick-link span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}
.quick-green span { background: #daf2e3; color: #2a8550; }
.quick-purple span { background: #eee8fb; color: #7753b6; }
.quick-orange span { background: #fae8dc; color: #b86633; }
.recent-panel { margin-top: 18px; }
.activity-list { display: grid; gap: 4px; }
.activity-row {
  display: grid;
  grid-template-columns: 36px minmax(140px, .8fr) minmax(160px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1ed;
}
.activity-row strong { font-weight: 500; }
.activity-row span:not(.avatar-mini), .activity-row time { color: #667369; }
.avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eaf5ed;
  color: #286c38;
  font-weight: 700;
}
.activity-empty { padding: 18px 0; color: #667369; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(220px, .85fr);
  gap: 14px;
  margin-bottom: 16px;
}
.progress {
  height: 10px;
  border-radius: 999px;
  background: #edf3fa;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.copy-line input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 800; font-size: 14px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px 13px; background: white; color: var(--ink);
}
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f2f7fb; }
.auth-box { width: min(440px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 26px; box-shadow: var(--shadow); }
.validator-box { width: min(760px, 100%); }
.validation-result { margin-top: 18px; }
.validation-list { display: grid; gap: 10px; margin-top: 12px; }
.flash { border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.flash.error { background: #ffecec; color: #a32020; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(59, 59, 59, .48);
  backdrop-filter: blur(5px);
}
.modal-backdrop.is-hidden { display: none; }
.modal-box {
  position: relative;
  width: min(520px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(59, 59, 59, .24);
  padding: 28px;
}
.modal-box .brand { margin-bottom: 18px; }
.modal-box h2 { margin: 0 0 12px; font-size: 28px; line-height: 1.12; letter-spacing: 0; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.waitlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}
.waitlist-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
}
.sign-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.viewer { background: #dce5ef; padding: 18px; }
.viewer iframe { width: 100%; height: calc(100vh - 36px); border: 0; background: white; border-radius: 8px; }
.sign-panel { background: white; border-left: 1px solid var(--line); padding: 24px; overflow: auto; }
.signature-pad { width: 100%; height: 180px; border: 1px dashed #9eb0c7; border-radius: 8px; background: #fbfdff; touch-action: none; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef3fb; padding: 2px 6px; border-radius: 6px; }
footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); background: white; }

@media (max-width: 860px) {
  .navlinks { display: none; }
  .hero { min-height: auto; }
  .hero-grid, .grid3, .app-shell, .sign-layout, .metric-grid, .detail-grid, .toolbar, .dashboard-grid, .app-search { grid-template-columns: 1fr; }
  .waitlist-form { grid-template-columns: 1fr; }
  .split-band { flex-direction: column; align-items: flex-start; padding: 22px; }
  .sidebar { position: static; height: auto; }
  .side-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .side-nav details { grid-column: 1 / -1; }
  .side-nav details a { margin-left: 0; }
  .main { padding: 18px; }
  .app-topbar { position: static; height: auto; margin: -18px -18px 18px; padding: 14px 18px; }
  .top-actions { margin-left: auto; gap: 10px; }
  .activity-row { grid-template-columns: 36px minmax(0, 1fr); }
  .activity-row time { grid-column: 2; }
  .page-head { flex-direction: column; }
  .table { display: block; overflow-x: auto; }
  .sign-panel { border-left: 0; border-top: 1px solid var(--line); }
  .viewer iframe { height: 60vh; }
}
