:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg2: #080d17;
  --panel: rgba(12, 18, 31, 0.78);
  --panel-2: rgba(15, 23, 42, 0.96);
  --panel-3: rgba(255, 255, 255, 0.045);
  --line: rgba(148, 163, 184, 0.18);
  --line-soft: rgba(148, 163, 184, 0.12);
  --text: #f8fafc;
  --muted: #9aa7bb;
  --quiet: #667085;
  --blue: #3b82f6;
  --blue2: #60a5fa;
  --green: #22c55e;
  --yellow: #f2b84b;
  --red: #ff6b6b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.2);
  --radius: 14px;
  font-family:
    Inter, Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app,
#stats-app {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.2), transparent 30rem),
    radial-gradient(circle at 84% 12%, rgba(34, 197, 94, 0.1), transparent 26rem),
    linear-gradient(180deg, #060912 0%, var(--bg2) 42%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
.page-title,
.profile-name,
.metric-value,
.section-title {
  font-family: "Space Grotesk", Inter, Arial, sans-serif;
  letter-spacing: 0;
}

.marketing-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(18px);
}

.marketing-nav-inner {
  width: min(calc(100% - 32px), 1180px);
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.marketing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.marketing-brand img,
.brand-logo,
.welcome-logo {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.18);
}

.marketing-brand strong {
  display: block;
  font-family: "Space Grotesk", Inter, Arial, sans-serif;
  font-size: 1.08rem;
  line-height: 1;
}

.marketing-brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.marketing-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.marketing-links a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.marketing-links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.welcome {
  min-height: calc(100vh - 78px);
  display: grid;
  align-items: center;
  width: min(calc(100% - 36px), 1320px);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 120px) 0 clamp(72px, 8vw, 110px);
}

.welcome-panel {
  position: relative;
  overflow: hidden;
  width: min(920px, 100%);
  padding: clamp(30px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.22), transparent 24rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025)),
    var(--panel);
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.38);
}

.welcome-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.45;
}

.welcome-panel > * {
  position: relative;
}

.welcome-panel h1 {
  max-width: 820px;
  margin: 18px 0 24px;
  font-size: clamp(4.1rem, 10vw, 8rem);
  line-height: 0.98;
  font-family: "Space Grotesk", Inter, Arial, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.welcome-panel h1 span {
  background: linear-gradient(135deg, #dbeafe 0%, #60a5fa 36%, #2563eb 76%, #22c55e 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.welcome-panel p:not(.eyebrow) {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.welcome-actions {
  justify-content: flex-start;
  margin-top: 28px;
}

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

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(18px);
  padding: 22px 18px;
  overflow-y: auto;
}

.brand {
  margin-bottom: 26px;
}

.brand-logo { margin-bottom: 14px; }

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav-label {
  margin: 22px 10px 8px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
  text-decoration: none;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.nav-link:hover,
.nav-link.active {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--quiet);
}

.nav-link.active .nav-dot {
  background: var(--green);
}

.user-block {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.user-block strong {
  display: block;
  font-size: 13px;
}

.user-block span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--blue2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-title {
  margin: 5px 0 0;
  font-size: 34px;
  line-height: 1.05;
}

.page-subtitle {
  margin: 8px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 750;
}

.button.primary {
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(135deg, #60a5fa, #2563eb 72%, #1d4ed8);
  color: #fff;
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.22);
}

.button.ghost,
.button.secondary {
  background: transparent;
  color: var(--muted);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.grid {
  display: grid;
  gap: 14px;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.026)), var(--panel);
  box-shadow: var(--shadow);
}

.card.pad {
  padding: 16px;
}

.metric-card {
  min-height: 124px;
  padding: 16px;
  border-radius: 10px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 10px;
  font-size: 34px;
  font-weight: 900;
  color: #fff;
}

.metric-note {
  margin-top: 7px;
  color: var(--quiet);
  font-size: 13px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--quiet);
  font-size: 11px;
  text-transform: uppercase;
}

td {
  color: var(--muted);
  font-size: 14px;
}

td strong,
.strong {
  color: var(--text);
}

.row-action {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.status,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.active,
.tag.good {
  border-color: rgba(53, 209, 154, 0.45);
  color: var(--green);
}

.status.onboarding,
.tag.warn {
  border-color: rgba(242, 184, 75, 0.45);
  color: var(--yellow);
}

.status.attention,
.tag.bad {
  border-color: rgba(255, 107, 107, 0.45);
  color: var(--red);
}

.list {
  display: grid;
  gap: 10px;
}

.activity {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.activity:last-child {
  border-bottom: 0;
}

.activity-date {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.activity-body strong {
  display: block;
  color: var(--text);
}

.activity-body span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.profile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  margin-bottom: 14px;
}

.profile-name {
  margin: 4px 0 10px;
  font-size: 32px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.info-item {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(15, 31, 37, 0.65);
}

.info-item span {
  display: block;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.info-item strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
}

.progress-line {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-3);
}

.progress-line div {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.check-row,
.task-row,
.note-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.check-row:last-child,
.task-row:last-child,
.note-row:last-child {
  border-bottom: 0;
}

.check-row input {
  margin-top: 4px;
  accent-color: var(--green);
}

.check-row strong,
.task-row strong,
.note-row strong {
  display: block;
  color: var(--text);
}

.check-row span,
.task-row span,
.note-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 7, 13, 0.72);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.report {
  display: grid;
  gap: 14px;
}

.report-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 31, 37, 0.5);
}

.report-block h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.report-block p,
.report-block li {
  color: var(--muted);
  line-height: 1.5;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 14px;
}

.empty {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

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

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .grid.cols-4,
  .grid.cols-3,
  .profile-head,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .main {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .toolbar {
    justify-content: stretch;
  }

  .button {
    width: 100%;
  }

  .grid.cols-2,
  .form-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .activity {
    grid-template-columns: 1fr;
  }
}
