:root {
  --bg: #f5f5f7;
  --panel: rgba(255, 255, 255, 0.8);
  --text: #1d1d1f;
  --subtext: #6e6e73;
  --line: rgba(29, 29, 31, 0.1);
  --accent: #0071e3;
  --accent-press: #005fc1;
  --danger: #d70015;
  --nav-bg: rgba(255, 255, 255, 0.7);
  --surface: rgba(255, 255, 255, 0.95);
  --badge-bg: rgba(29, 29, 31, 0.08);
  --muted-box: rgba(255, 255, 255, 0.5);
  --value: #3a3a3c;
  --theme-surface: rgba(255, 255, 255, 0.94);
  --radius: 22px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c10;
  --panel: rgba(22, 23, 28, 0.82);
  --text: #f5f5f7;
  --subtext: #a1a1aa;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #0a84ff;
  --accent-press: #006edb;
  --danger: #ff453a;
  --nav-bg: rgba(28, 28, 30, 0.78);
  --surface: rgba(34, 34, 38, 0.94);
  --badge-bg: rgba(255, 255, 255, 0.08);
  --muted-box: rgba(255, 255, 255, 0.04);
  --value: #e6e6ea;
  --theme-surface: rgba(43, 43, 48, 0.96);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

html[data-theme="system"] {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #0b0c10;
    --panel: rgba(22, 23, 28, 0.82);
    --text: #f5f5f7;
    --subtext: #a1a1aa;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #0a84ff;
    --accent-press: #006edb;
    --danger: #ff453a;
    --nav-bg: rgba(28, 28, 30, 0.78);
    --surface: rgba(34, 34, 38, 0.94);
    --badge-bg: rgba(255, 255, 255, 0.08);
    --muted-box: rgba(255, 255, 255, 0.04);
    --value: #e6e6ea;
    --theme-surface: rgba(43, 43, 48, 0.96);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", "SF Pro Text", "Apple SD Gothic Neo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -20%, color-mix(in srgb, var(--accent) 22%, white 78%) 0%, rgba(212, 243, 255, 0) 60%),
    radial-gradient(900px 460px at 100% 0%, color-mix(in srgb, var(--danger) 14%, white 86%) 0%, rgba(255, 232, 216, 0) 65%),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
}

.container {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 18px;
}

.nav .left,
.nav .right {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand {
  font-weight: 650;
  letter-spacing: 0.2px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.theme-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--theme-surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.theme-control span {
  color: var(--subtext);
}

.theme-control select {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
  cursor: pointer;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 30px;
  animation: rise 420ms ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: -0.9px;
}

h2 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: -0.6px;
}

p {
  margin: 0;
  color: var(--subtext);
  line-height: 1.6;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  font-size: 13px;
  color: var(--subtext);
  font-weight: 600;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
}

input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, white 55%);
  outline-offset: 1px;
}

.btn {
  border: 0;
  height: 46px;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-press);
}

.btn.ghost {
  background: rgba(0, 113, 227, 0.08);
  color: var(--accent);
}

.btn.danger {
  background: rgba(215, 0, 21, 0.1);
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.status {
  margin-top: 14px;
  min-height: 24px;
  font-size: 14px;
  color: var(--subtext);
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: #0f8b3d;
}

.hero {
  margin-bottom: 20px;
}

.muted-box {
  margin-top: 16px;
  border: 1px dashed var(--line);
  background: var(--muted-box);
  border-radius: 14px;
  padding: 14px;
}

.value {
  font-size: 14px;
  margin-top: 8px;
  color: var(--value);
  white-space: pre-line;
}

.member-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.member-table th,
.member-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.member-table td input {
  height: 36px;
  font-size: 13px;
  border-radius: 10px;
  padding: 0 10px;
}

.member-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn.small {
  height: 34px;
  font-size: 13px;
  padding: 0 12px;
}

.member-table th {
  color: var(--subtext);
  font-weight: 650;
}

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

  .container {
    width: min(680px, calc(100% - 20px));
    padding-top: 16px;
  }

  .card {
    padding: 22px;
  }

  .nav {
    border-radius: 24px;
    flex-wrap: wrap;
    gap: 12px;
  }
}
