:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 8px;
}

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

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 { font-size: 1.25rem; margin: 0; }
header nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  font-size: 0.95rem;
}
header nav a:hover,
header nav a.active { color: var(--primary); }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; }

button, .button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { background: var(--primary-dark); }
button.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
button.secondary:hover { background: var(--border); }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

input, select, textarea {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}
label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--muted); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge.free { background: #e0f2fe; color: #0369a1; }
.badge.paid { background: #dcfce7; color: #166534; }
.badge.admin { background: #ede9fe; color: #5b21b6; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.info { background: #e0f2fe; color: #0369a1; }

pre, code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
}
code { background: #f1f5f9; padding: 0.15rem 0.3rem; border-radius: 4px; }
pre { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: var(--radius); overflow-x: auto; }

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login .card { width: 100%; max-width: 420px; }

.empty { color: var(--muted); text-align: center; padding: 2rem; }
