:root {
  --bg: #0e1318;
  --bg-elev: rgba(18, 26, 34, 0.88);
  --fg: #e9eef3;
  --muted: #8b9aaa;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #2f9d7a;
  --accent-2: #3eb892;
  --danger: #d96a6a;
  --ok: #3eb892;
  --info: #6aa7d9;
  --radius: 14px;
  --font: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
  --display: "Segoe UI Semibold", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.45;
}

.bg-orb {
  position: fixed;
  inset: auto;
  width: 48vw;
  height: 48vw;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-orb-a {
  top: -12vw; left: -10vw;
  background: #1a3d36;
}
.bg-orb-b {
  right: -14vw; bottom: -16vw;
  background: #1a2a3d;
  animation-delay: -6s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4vw, -3vw) scale(1.08); }
}

.topbar, .shell { position: relative; z-index: 1; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
  text-decoration: none;
}
.nav { display: flex; align-items: center; gap: 0.9rem; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--fg); }
.nav-user { color: var(--fg); font-size: 0.95rem; }
.badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(62, 184, 146, 0.45);
  color: var(--accent-2);
  border-radius: 999px;
}

.shell {
  width: min(520px, calc(100% - 2rem));
  margin: 2.5rem auto 3rem;
}
.shell-wide { width: min(880px, calc(100% - 2rem)); }

.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.5rem;
  backdrop-filter: blur(14px);
  animation: rise 0.45s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  font-weight: 700;
}
.lead {
  margin: 0 0 1.4rem;
  color: var(--muted);
}

label {
  display: block;
  margin: 0.85rem 0 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--fg);
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  font: inherit;
}
input:focus, select:focus {
  outline: 2px solid rgba(47, 157, 122, 0.45);
  border-color: transparent;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.8rem;
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.35rem;
}
.btn {
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #07140f;
  font-weight: 650;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { filter: brightness(1.05); }
.btn-small { padding: 0.45rem 0.85rem; font-size: 0.9rem; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover { color: var(--fg); }

.meta-link {
  color: var(--muted);
  font-size: 0.92rem;
}
.meta-link a { color: var(--accent-2); }

.alert {
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  font-size: 0.95rem;
}
.alert-error { background: rgba(217, 106, 106, 0.12); border-color: rgba(217, 106, 106, 0.35); color: #f0c0c0; }
.alert-success { background: rgba(62, 184, 146, 0.12); border-color: rgba(62, 184, 146, 0.35); color: #bfe9d8; }
.alert-info { background: rgba(106, 167, 217, 0.12); border-color: rgba(106, 167, 217, 0.35); color: #c5daf0; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(0,0,0,0.18);
}
.stat strong { display: block; font-size: 1.2rem; margin-top: 0.2rem; }
.stat span { color: var(--muted); font-size: 0.85rem; }
