:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --line: #e5e7eb;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --radius: 20px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #dbeafe 0, transparent 35%), var(--bg);
}
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(460px, 100%);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(37,99,235,.25);
}
.brand h1, .brand p { margin: 0; }
.brand h1 { font-size: 24px; }
.brand p { color: var(--muted); font-size: 14px; }
.field { margin-bottom: 16px; }
label { display: block; margin-bottom: 8px; color: #374151; font-weight: 700; font-size: 14px; }
input, select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37,99,235,.1); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 800;
  transition: .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: #eef2ff; color: #3730a3; }
.btn-green { background: #dcfce7; color: #166534; }
.btn-red { background: #fee2e2; color: #991b1b; }
.btn-amber { background: #fef3c7; color: #92400e; }
.btn-full { width: 100%; }
.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
  display: none;
}
.alert.show { display: block; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 280px;
  background: #0f172a;
  color: white;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { margin-bottom: 30px; }
.sidebar .brand p { color: #94a3b8; }
.nav { display: grid; gap: 8px; }
.nav button {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 800;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,.1); color: white; }
.main { flex: 1; padding: 28px; min-width: 0; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.topbar h2 { margin: 0; font-size: 30px; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.stat-title { color: var(--muted); font-weight: 800; }
.stat-value { font-size: 42px; font-weight: 900; margin-top: 8px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-title h3 { margin: 0; font-size: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #475569; font-size: 13px; background: #f8fafc; }
tr:hover td { background: #f9fafb; }
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.suspended { background: #fee2e2; color: #991b1b; }
.badge.expired { background: #e5e7eb; color: #374151; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #111827;
  color: white;
  box-shadow: var(--shadow);
  display: none;
  z-index: 10;
}
.toast.show { display: block; }
.small { color: var(--muted); font-size: 13px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: #f1f5f9; padding: 5px 7px; border-radius: 8px; }
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main { padding: 18px; }
  .grid, .form-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
