:root {
  --ink: #141414;
  --muted: #6e737c;
  --line: #e6e8ec;
  --paper: #ffffff;
  --wash: #f5f6f8;
  --navy: #17324d;
  --blue: #2f6fed;
  --green: #16735f;
  --mint: #e8f6f1;
  --coral: #d95d45;
  --gold: #b98222;
  --shadow: 0 18px 50px rgba(20, 20, 20, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(23, 50, 77, 0.06), transparent 340px),
    var(--wash);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.privacy-meter p,
small {
  color: var(--muted);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border-radius: 8px;
  color: var(--muted);
  padding: 11px 12px;
  text-decoration: none;
}

.nav-item.active,
.nav-item:hover {
  color: var(--ink);
  background: #eef2f6;
}

.privacy-meter {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.meter-head,
.signal-header,
.signal-row,
.panel-head,
.topbar,
.top-actions,
.check-row,
.toggle-row {
  display: flex;
  align-items: center;
}

.meter-head,
.signal-header,
.signal-row,
.panel-head,
.topbar,
.toggle-row {
  justify-content: space-between;
  gap: 16px;
}

.meter-track {
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf0;
}

.meter-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

main {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 30px;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

.top-actions {
  flex-wrap: wrap;
}

.icon-button,
.lang-toggle,
.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
}

.icon-button {
  width: 42px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 22px;
}

.lang-toggle {
  min-width: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 900;
}

.primary-button {
  padding: 0 18px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
}

.primary-button:hover {
  background: var(--navy);
}

.primary-button.full {
  width: 100%;
}

.hero-grid,
.workspace-grid,
.metrics-row {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
}

.hero-panel {
  min-height: 310px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1fr);
  gap: 22px;
  overflow: hidden;
  padding: 28px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(20, 20, 20, 0.92), rgba(23, 50, 77, 0.88)),
    radial-gradient(circle at 80% 20%, rgba(47, 111, 237, 0.55), transparent 32%);
  box-shadow: var(--shadow);
}

.hero-copy {
  align-self: end;
}

.hero-copy h2 {
  margin: 18px 0 12px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
}

.hero-copy p {
  max-width: 520px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 16px;
  line-height: 1.7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.muted {
  color: var(--green);
  background: var(--mint);
}

.intro-flow {
  display: grid;
  align-content: center;
  gap: 12px;
}

.flow-person,
.flow-line {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.flow-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
}

.avatar.navy {
  background: var(--blue);
}

.avatar.green {
  background: var(--green);
}

.avatar.coral {
  background: var(--coral);
}

.avatar.gold {
  background: var(--gold);
}

.flow-line {
  position: relative;
  padding: 10px 14px 10px 38px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-line::before {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translateY(-50%);
}

.flow-line.approved {
  color: #89dfc5;
}

.flow-line.pending {
  color: #ffd187;
}

.signal-panel,
.panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.signal-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 24px;
}

.signal-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.signal-row {
  padding: 12px 0;
}

.signal-row span,
.signal-header span,
.metric-card span {
  color: var(--muted);
}

.signal-row strong {
  font-size: 28px;
}

.metrics-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 20px;
}

.metric-card strong {
  font-size: 34px;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  align-items: start;
}

.bottom-grid {
  margin-top: 18px;
}

.panel {
  padding: 22px;
}

.panel-head {
  margin-bottom: 18px;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #eef1f4;
}

.segmented-control button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segmented-control button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 8px rgba(20, 20, 20, 0.08);
}

.contact-list,
.timeline,
.privacy-list,
.intro-form {
  display: grid;
  gap: 12px;
}

.contact-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.contact-card h3,
.timeline-item strong {
  margin: 0;
  font-size: 15px;
}

.contact-card p,
.timeline-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag {
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--navy);
  background: #eef4fb;
  font-size: 12px;
  font-weight: 700;
}

.consent-badge {
  min-width: 86px;
  border-radius: 999px;
  padding: 7px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.consent-badge.shareable {
  color: var(--green);
  background: var(--mint);
}

.consent-badge.locked {
  color: #a04436;
  background: #fbecea;
}

.intro-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.intro-form input,
.intro-form select,
.intro-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.intro-form textarea {
  resize: vertical;
}

.intro-form input:focus,
.intro-form select:focus,
.intro-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.13);
}

.permission-box {
  border: 1px solid #d7eadf;
  border-radius: 8px;
  padding: 12px;
  background: #f3fbf7;
}

.check-row {
  grid-template-columns: 18px minmax(0, 1fr);
  justify-content: start;
  color: var(--green);
  font-weight: 800;
}

.timeline-item {
  position: relative;
  padding: 14px 14px 14px 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.timeline-item::before {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

.timeline-item.pending::before {
  background: var(--gold);
}

.timeline-item.approved::before {
  background: var(--green);
}

.timeline-item.blocked::before {
  background: var(--coral);
}

.toggle-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toggle-row span {
  display: grid;
  gap: 4px;
}

.toggle-row input {
  width: 42px;
  height: 24px;
  accent-color: var(--green);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 14px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px 20px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .privacy-meter {
    display: none;
  }

  .hero-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .metrics-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  main {
    padding: 20px;
  }

  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 22px;
  }

  .metrics-row {
    grid-template-columns: 1fr;
  }

  .contact-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .consent-badge {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }
}
