:root {
  --bg: #071018;
  --bg-soft: #0e1b2a;
  --panel: rgba(12, 24, 37, 0.84);
  --panel-strong: rgba(15, 28, 43, 0.96);
  --line: rgba(154, 174, 198, 0.14);
  --text: #eef4ff;
  --muted: #99abc6;
  --primary: #76f0c4;
  --secondary: #8fb3ff;
  --danger: #ff7d7d;
  --warning: #ffca75;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Outfit", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(118, 240, 196, 0.16), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(143, 179, 255, 0.18), transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03), transparent 32%),
    linear-gradient(180deg, #060d14 0%, #071018 100%);
}

.dashboard-shell { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(118, 240, 196, 0.12), transparent 30%),
    rgba(6, 13, 21, 0.82);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #041118;
  font-size: 26px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.brand h1, .workspace h2, .panel h3, .panel h4 { margin: 0; }

.sidebar-nav { display: grid; gap: 10px; }

.nav-item {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
  color: var(--text);
  border-radius: 20px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-item span, .nav-item small { display: block; }
.nav-item small { color: var(--muted); margin-top: 4px; }
.nav-item.active, .nav-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border-color: rgba(118,240,196,0.18);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

.sidebar-card,
.panel,
.hero-card,
.stat-card,
.toast,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
}

.sidebar-card { margin-top: auto; padding: 20px; }
.ghost-link { color: var(--text); text-decoration: none; }
.sidebar-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 16px;
}

.sidebar-badges span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(154, 174, 198, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  position: relative;
  padding: 26px;
  overflow: auto;
}

.workspace::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 300px;
  height: 220px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(118, 240, 196, 0.06), transparent);
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.topbar-actions, .inline-actions, .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sync-meta {
  display: grid;
  gap: 4px;
  min-width: 180px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(118, 240, 196, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.sync-meta small {
  color: var(--muted);
  font-size: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(118, 240, 196, 0.12);
  color: #b4ffe2;
}

.live-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.03);
}

.live-pill.syncing {
  background: rgba(255, 202, 117, 0.12);
  color: #ffe1ad;
}

.live-pill.error {
  background: rgba(255, 125, 125, 0.12);
  color: #ffc0c0;
}

.live-pill.idle {
  background: rgba(154, 174, 198, 0.12);
  color: #c8d5ea;
}

.button {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.button.primary { background: linear-gradient(135deg, var(--primary) 0%, #a0ffd9 100%); color: #041118; }
.button.secondary { background: rgba(255,255,255,0.06); color: var(--text); }
.button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.2);
}

.auth-panel { padding: 26px; display: grid; grid-template-columns: 1.2fr minmax(280px, 420px); gap: 24px; }
.auth-form, .form-grid, .filter-row { display: grid; gap: 14px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-row { grid-template-columns: 1fr 1fr auto; align-items: end; }

label { display: grid; gap: 8px; }
label span { font-size: 14px; color: var(--muted); font-weight: 600; }

input, select {
  width: 100%;
  border: 1px solid rgba(154,174,198,0.14);
  background: rgba(4,11,18,0.72);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
}

.wide { grid-column: span 2; }
.section { display: none; }
.section.active { display: grid; gap: 22px; }

.hero-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(118,240,196,0.14), transparent 32%),
    radial-gradient(circle at bottom left, rgba(143,179,255,0.12), transparent 28%),
    var(--panel-strong);
}

.hero-copy {
  max-width: 680px;
}

.hero-copy h3 {
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
  max-width: 12ch;
}

.hero-notes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-notes span {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(154,174,198,0.12);
  color: #dfe8f8;
  font-size: 13px;
  font-weight: 600;
}

.hero-side {
  display: grid;
  gap: 16px;
  min-width: min(100%, 310px);
}

.hero-stack {
  display: grid;
  gap: 12px;
}

.hero-stack-item {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(154,174,198,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
}

.hero-stack-item strong,
.hero-stack-item span {
  display: block;
}

.hero-stack-item span {
  margin-top: 6px;
  color: var(--muted);
}

.muted, .setup-notes p, .sidebar-card p, .auth-copy p, .member-card p, .log-meta { color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(118,240,196,0.1), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -24px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(143,179,255,0.18), transparent 68%);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(118,240,196,0.18);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
.stat-card span, .stat-card small { display: block; color: var(--muted); }
.stat-card strong { display: block; margin: 12px 0 8px; font-size: 30px; }

.overview-grid, .access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.members-layout { display: grid; grid-template-columns: minmax(360px, 460px) 1fr; gap: 22px; }
.panel {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.03)),
    var(--panel);
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 10px; border-bottom: 1px solid rgba(154,174,198,0.1); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.stack-list, .log-list, .member-grid { display: grid; gap: 14px; }

.stack-item,
.log-item,
.member-card,
.invite-output,
.code-block,
.steps {
  border-radius: 22px;
  border: 1px solid rgba(154,174,198,0.12);
  background: rgba(255,255,255,0.04);
}

.stack-item, .log-item, .member-card, .invite-output, .code-block {
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.member-card-head, .log-item header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.member-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.member-card {
  background:
    radial-gradient(circle at top right, rgba(118,240,196,0.08), transparent 35%),
    rgba(255,255,255,0.04);
  transition: transform 180ms ease, border-color 180ms ease;
}
.member-card:hover {
  transform: translateY(-2px);
  border-color: rgba(118,240,196,0.18);
}

.log-item {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.03));
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.pill.good { background: rgba(118,240,196,0.12); color: #b4ffe2; }
.pill.bad { background: rgba(255,125,125,0.12); color: #ffc0c0; }
.pill.warn { background: rgba(255,202,117,0.12); color: #ffe1ad; }

.code-block pre, code { margin: 0; font-family: var(--mono); white-space: pre-wrap; word-break: break-word; }
.steps { margin: 0; padding: 22px 22px 22px 40px; }
.steps li { margin-bottom: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 14px 18px; }
.error-text { color: var(--danger); }
.hidden { display: none !important; }

@media (max-width: 1180px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .overview-grid, .members-layout, .access-grid, .stat-grid, .auth-panel { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .workspace { padding: 18px; }
  .hero-card, .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { flex-direction: column; }
  .sync-meta { width: 100%; }
  .form-grid, .filter-row { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
}
