:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #21252e;
  --border: #2c313c;
  --text: #e7e9ee;
  --muted: #9aa1ad;
  --primary: #5b8def;
  --primary-hover: #4b7be0;
  --danger: #e5484d;
  --accent: #36c98e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 1rem; }
.user-email { color: var(--muted); font-size: 0.9rem; }

.container { max-width: 980px; margin: 2rem auto; padding: 0 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}
.auth-card { max-width: 380px; margin: 3rem auto; }

h1 { margin-top: 0; }
h2 { margin-top: 0; font-size: 1.15rem; }

label { display: block; margin-bottom: 1rem; font-size: 0.9rem; color: var(--muted); }
input, select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }

.btn {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.inline { display: inline; margin: 0; }

.muted { color: var(--muted); font-size: 0.9rem; }

.alert { padding: 0.7rem 0.9rem; border-radius: 8px; font-size: 0.9rem; margin-bottom: 1rem; }
.alert-error { background: rgba(229,72,77,0.12); border: 1px solid var(--danger); color: #ff9a9d; }
.alert-info { background: rgba(54,201,142,0.12); border: 1px solid var(--accent); color: #7ee3bb; }

.summary {
  background: linear-gradient(135deg, #1f3b66, #25304a);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.summary-label { color: var(--muted); font-size: 0.9rem; }
.summary-value { font-size: 2.4rem; font-weight: 700; }
.summary-sub { color: var(--muted); font-size: 0.85rem; }

.grid { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

.sub-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sub-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--border); }
.sub-table td { padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
.sub-table tr:last-child td { border-bottom: none; }
