:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf2ff;
  --ink: #07133d;
  --text: #111827;
  --muted: #64748b;
  --soft: #94a3b8;
  --line: rgba(148, 163, 184, .14);
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --blue: #2563eb;
  --teal: #0f9f8f;
  --amber: #d99a0b;
  --orange: #ea7a12;
  --purple: #6d5df6;
  --green: #059669;
  --slate: #64748b;
  --font-body: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: "Manrope", "Inter", system-ui, sans-serif;
  --shadow-card: 0 12px 30px rgba(15, 23, 42, .052), 0 2px 8px rgba(15, 23, 42, .018);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, .04);
  --shadow-blue: 0 16px 34px rgba(37, 99, 235, .16);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #eef3fb; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 8% 8%, rgba(151, 137, 236, .12), transparent 31%),
    radial-gradient(circle at 92% 86%, rgba(125, 211, 252, .1), transparent 30%),
    linear-gradient(135deg, #f4f2ff 0%, #fbfdff 48%, #eef7ff 100%);
}

a, button { font: inherit; -webkit-tap-highlight-color: transparent; }
a { text-decoration: none; color: inherit; }
button { border: 0; cursor: pointer; background: none; }

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 9px 0;
}

.app-shell {
  position: relative;
  isolation: isolate;
  width: min(390px, calc(100vw - 18px));
  height: min(826px, calc(100vh - 18px));
  min-height: 760px;
  overflow: hidden;
  padding: 24px 20px 18px;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 38px;
  background: rgba(255, 255, 255, .91);
  box-shadow: 0 30px 88px rgba(31, 54, 110, .12), inset 0 0 0 1px rgba(255, 255, 255, .72);
}

.ambient-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 54% 2%, rgba(255, 255, 255, .98), transparent 30%),
    radial-gradient(circle at 0% 62%, rgba(96, 165, 250, .045), transparent 35%),
    radial-gradient(circle at 100% 82%, rgba(45, 212, 191, .052), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(252, 254, 255, .98));
}

.ambient-bg::before {
  content: "";
  position: absolute;
  width: 306px;
  height: 188px;
  right: -144px;
  top: -78px;
  border: 1.2px solid rgba(109, 130, 255, .1);
  border-radius: 50%;
  transform: rotate(44deg);
}

.content-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 132px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.content-scroll::-webkit-scrollbar { display: none; }
.content-scroll:focus { outline: none; }

.screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 0;
}

.screen-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 36px;
  line-height: .99;
  font-weight: 640;
  letter-spacing: -.045em;
}

.screen-header p {
  margin: 9px 0 0;
  color: #5f7094;
  font-size: 14.5px;
  line-height: 1.42;
  font-weight: 400;
  letter-spacing: -.01em;
}

.header-action {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  margin-top: -1px;
  border-radius: 19px;
  color: #1767f2;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(37, 99, 235, .1);
  box-shadow: var(--shadow-soft);
}

.header-action svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.05;
  stroke-linecap: round;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-top: 24px;
}

.stat-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 11px;
  min-height: 82px;
  padding: 12px 13px;
  border-radius: 21px;
  border: 1px solid rgba(148, 163, 184, .12);
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(251, 253, 255, .82));
  box-shadow: var(--shadow-card);
}

.stat-icon {
  display: grid;
  place-items: center;
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  border-radius: 18px;
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
}

.stat-icon svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card strong {
  display: block;
  min-width: 0;
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 23px;
  line-height: 1;
  font-weight: 620;
  letter-spacing: -.028em;
}

.stat-card p {
  min-width: 0;
  margin: 5px 0 0;
  color: #657491;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -.01em;
}

.stat-blue { --accent: #2563eb; --accent-bg: #eef5ff; }
.stat-orange { --accent: #ea7a12; --accent-bg: #fff4e8; }
.stat-purple { --accent: #6d5df6; --accent-bg: #f4f1ff; }
.stat-green { --accent: #059669; --accent-bg: #ecfbf5; }

.search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  margin-top: 18px;
  padding: 0 19px;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, .13);
  background: rgba(241, 245, 249, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.search-card svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  stroke: #7d89a1;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.search-card span {
  color: #8793a9;
  font-size: 15.5px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -.01em;
}

.team-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.team-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 14px 14px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, .72);
  background: linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(253, 254, 255, .94));
  box-shadow: 0 13px 28px rgba(15, 23, 42, .055), 0 2px 8px rgba(15, 23, 42, .018);
}

.team-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 21px;
  color: var(--accent);
  background: var(--accent-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 18px rgba(15, 23, 42, .035);
}

.team-avatar svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.team-copy {
  min-width: 0;
  flex: 1;
}

.team-copy h2 {
  margin: 0;
  color: #101827;
  font-size: 17.2px;
  line-height: 1.16;
  font-weight: 660;
  letter-spacing: -.024em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-copy p {
  margin: 7px 0 0;
  color: #6b7892;
  font-size: 13.5px;
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -.006em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  min-width: 34px;
  color: #7a879d;
  font-size: 12.5px;
  line-height: 1;
  font-weight: 560;
}

.team-meta strong {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 8px 16px rgba(37, 99, 235, .18);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.team-meta em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  color: #b42318;
  background: #fff1f1;
  border: 1px solid rgba(239, 68, 68, .18);
  font-style: normal;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 650;
  white-space: nowrap;
}

.team-card.needs-attention {
  border-color: rgba(239, 68, 68, .16);
  box-shadow: 0 13px 28px rgba(15, 23, 42, .052), 0 0 0 1px rgba(239, 68, 68, .035);
}

.accent-blue { --accent: #2563eb; --accent-bg: #eef5ff; }
.accent-teal { --accent: #0f9f8f; --accent-bg: #eafbfa; }
.accent-yellow { --accent: #d97706; --accent-bg: #fff5dc; }
.accent-slate { --accent: #64748b; --accent-bg: #f1f5f9; }
.accent-purple { --accent: #7c3aed; --accent-bg: #f3edff; }

.fab {
  position: absolute;
  right: 28px;
  bottom: 88px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 62%, #1d4ed8 100%);
  box-shadow: var(--shadow-blue);
}

.fab svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
}

.bottom-nav {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  height: 62px;
  padding: 6px 8px;
  border-radius: 29px;
  border: 1px solid rgba(148, 163, 184, .105);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .052), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 49px;
  border-radius: 21px;
  color: #64748f;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: -.005em;
}

.nav-item.active {
  color: #1062e8;
  background: linear-gradient(180deg, rgba(239, 247, 255, .96), rgba(226, 240, 255, .72));
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-icon.chat-icon svg path:first-child,
.nav-icon.team-icon svg path {
  fill: currentColor;
  stroke: none;
}
.nav-icon.chat-icon svg path:last-child { stroke: currentColor; }
.nav-item.active .nav-icon.chat-icon svg path:last-child { stroke: white; }

@media (max-width: 380px) {
  .preview-stage { padding: 0; }
  .app-shell {
    width: 100vw;
    height: 100vh;
    min-height: 760px;
    border-radius: 0;
    padding: 24px 18px 18px;
  }
  .screen-header h1 { font-size: 34px; }
  .stats-grid { gap: 10px; margin-top: 22px; }
  .stat-card { min-height: 80px; padding: 12px; }
  .stat-icon { width: 42px; height: 42px; }
  .team-list { gap: 10px; margin-top: 18px; }
  .team-card { min-height: 80px; padding: 13px 12px; gap: 12px; }
  .team-avatar { width: 50px; height: 50px; border-radius: 19px; }
  .team-meta em { padding: 0 8px; font-size: 10px; }
  .bottom-nav { left: 16px; right: 16px; }
  .fab { right: 24px; bottom: 92px; }
}
