:root {
  --bg: #06080d;
  --sidebar: #0a0e14;
  --card: #111827;
  --border: rgba(255,255,255,0.08);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #06b6d4;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #3b82f6, #06b6d4);
  --radius: 12px;
  --font: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Auth screens ── */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(59,130,246,0.12), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(6,182,212,0.08), transparent 50%),
    var(--bg);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 28px;
}

.auth-logo span {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  display: grid; place-items: center;
}

.auth-card h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-card .sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--gradient); color: white; width: 100%; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.88rem;
}

.auth-switch a { color: var(--accent-2); cursor: pointer; }

.error-msg {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.no-kyc-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 10px;
  color: #86efac;
  font-size: 0.82rem;
  margin-bottom: 20px;
}

/* ── Dashboard layout ── */
.dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  padding: 8px 12px;
  margin-bottom: 24px;
}

.sidebar-logo span {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient);
  display: grid; place-items: center;
  font-size: 0.9rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.92rem;
  margin-bottom: 4px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font: inherit;
}

.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: rgba(59,130,246,0.15); color: #93c5fd; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
}

.main {
  padding: 24px 32px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.page-header h1 { font-size: 1.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.stat-card .label { color: var(--muted); font-size: 0.82rem; margin-bottom: 8px; }
.stat-card .value { font-size: 1.6rem; font-weight: 700; }
.stat-card .value.gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 { font-size: 1rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

th { color: var(--muted); font-weight: 500; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-paid { background: rgba(34,197,94,0.15); color: var(--success); }
.status-pending, .status-check, .status-process { background: rgba(245,158,11,0.15); color: var(--warning); }
.status-locked { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-cancel { background: rgba(148,163,184,0.15); color: var(--muted); }

.mono {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.api-key-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.api-key-box code {
  flex: 1;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: #86efac;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 12px;
}

.lang-switch button {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.lang-switch button.active {
  background: rgba(59, 130, 246, 0.2);
  color: var(--text);
}

.sidebar .lang-switch { margin: 0 16px 12px; }
.auth-card .lang-switch { margin-bottom: 16px; justify-content: center; display: flex; width: fit-content; margin-left: auto; margin-right: auto; }
