:root {
  --bg: #07080a;
  --bg-2: #0e1114;
  --card: #12151c;
  --card-2: #171a22;
  --line: rgba(255, 255, 255, 0.07);
  --text: #eceef2;
  --muted: #8b93a7;
  --accent: #00b389;
  --accent-dim: rgba(0, 179, 137, 0.16);
  --paypal: #00b389;
  --stripe: #7b8cff;
  --patreon: #ff5c6c;
  --discord: #5865f2;
  --danger: #ff6b7a;
  --radius: 18px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(0, 179, 137, 0.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(123, 140, 255, 0.08), transparent 45%),
    linear-gradient(180deg, #0a0c10 0%, var(--bg) 40%);
}

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.03em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }

.eyebrow {
  margin: 0 0 2px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.app-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 8, 10, 0.78);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 12px;
  height: 32px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent);
  animation: pulse 3.2s ease-in-out infinite;
}

.topbar-right { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }

.topbar-discord {
  position: absolute;
  right: -38px;
  top: 50%;
  transform: translateY(-50%);
  width: 92px;
  height: 92px;
  color: var(--discord);
  opacity: 0.28;
  pointer-events: none;
}

.topbar-discord svg {
  width: 100%;
  height: auto;
  display: block;
}

.discord-mini {
  width: 18px;
  height: 18px;
  color: var(--discord);
  flex-shrink: 0;
  display: block;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
}

.user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
}

.ghost-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
  background: var(--card);
}

.banner {
  margin: 16px 28px 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 108, 122, 0.35);
  background: rgba(255, 108, 122, 0.1);
  color: #ffc4cb;
  font-size: 0.9rem;
  animation: fadeUp 0.45s ease both;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 28px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.kpi, .panel {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.kpi:hover, .panel:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.12);
}

.kpi header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot.paypal { background: var(--paypal); box-shadow: 0 0 10px var(--paypal); }
.dot.stripe { background: var(--stripe); box-shadow: 0 0 10px var(--stripe); }
.dot.patreon { background: var(--patreon); box-shadow: 0 0 10px var(--patreon); }

.kpi-month {
  margin: 14px 0 6px;
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.kpi-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.kpi-sub span { color: var(--text); font-family: var(--mono); }

.charts {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 16px;
}

.panel-hint {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chart-box { position: relative; height: 260px; }
.chart-box-donut { height: 240px; }

.table-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chip:hover { color: var(--text); }
.chip.is-on {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.table-scroll { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr {
  transition: background 0.2s;
}
tbody tr:hover { background: rgba(255,255,255,0.03); }

.amount {
  font-family: var(--mono);
  font-weight: 500;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
}

.muted { color: var(--muted); }

.col-action {
  width: 48px;
  text-align: right;
}

.row-menu {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.row-menu:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.row-menu.has-meta { color: var(--accent); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  animation: fadeUp 0.25s ease both;
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(480px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
}

.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.modal-card input,
.modal-card textarea {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.modal-card textarea { resize: vertical; min-height: 120px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.modal-save {
  width: auto;
  padding: 10px 18px;
}
.empty {
  margin: 24px 0 8px;
  text-align: center;
  color: var(--muted);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-aurora {
  position: fixed;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 30%, rgba(0, 179, 137, 0.18), transparent 35%),
    radial-gradient(circle at 70% 60%, rgba(88, 101, 242, 0.16), transparent 40%);
  filter: blur(12px);
  animation: drift 14s ease-in-out infinite alternate;
}

.login-card {
  position: relative;
  width: min(420px, 100%);
  padding: 40px 32px 32px;
  background: rgba(18, 21, 28, 0.88);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(18px);
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  overflow: hidden;
}

.login-discord-mark {
  position: absolute;
  right: -44px;
  top: 12px;
  width: 160px;
  height: 160px;
  color: var(--discord);
  opacity: 0.32;
  pointer-events: none;
}

.login-discord-mark svg {
  width: 100%;
  height: auto;
  display: block;
}

.login-card > *:not(.login-discord-mark) {
  position: relative;
  z-index: 1;
}

.login-card h1 { font-size: 2.2rem; margin-bottom: 8px; }
.login-lead { color: var(--muted); line-height: 1.5; margin: 0 0 28px; }

.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 108, 122, 0.12);
  color: #ffc4cb;
  font-size: 0.88rem;
}

.discord-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--discord);
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, filter 0.2s;
}

.discord-btn svg,
.discord-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

.discord-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

.local-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.local-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.login-foot {
  margin: 16px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.05); }
}

@media (max-width: 900px) {
  .kpis, .charts { grid-template-columns: 1fr; }
  .topbar, .wrap { padding-left: 16px; padding-right: 16px; }
  .banner { margin-left: 16px; margin-right: 16px; }
  .topbar { flex-wrap: wrap; }
}
