:root{
  --bg:#f6f7fb;
  --bg-2:#fafbff;
  --surface:#ffffff;
  --surface-2:#eef1fb;
  --text:#1f2441;
  --muted:#717796;
  --primary:#5a5eb3;
  --primary-dark:#484b98;
  --accent:#adc52f;
  --border:#e7e9f4;
  --success:#1ea971;
  --warning:#b37a09;
  --danger:#d64c61;
  --shadow:0 18px 48px rgba(69, 76, 139, 0.10);
  --radius:22px;
}
*{box-sizing:border-box}
body{
  margin:0;
  background:linear-gradient(180deg,var(--bg-2) 0%, var(--bg) 100%);
  color:var(--text);
  font-family:'Poppins',sans-serif;
}
.container{width:min(1200px,calc(100% - 32px));margin:0 auto}
.topbar{padding:20px 0}
.topbar-inner{display:flex;justify-content:space-between;align-items:center;gap:20px}
.brand{
  color:var(--primary);
  text-decoration:none;
  font-size:42px;
  line-height:1;
  font-weight:800;
  letter-spacing:-1px;
}
.brand small{
  display:block;
  color:var(--accent);
  font-size:11px;
  letter-spacing:3px;
  margin-top:2px;
  margin-left:4px;
}
.top-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.top-actions > a{
  color:var(--muted);
  text-decoration:none;
  font-weight:600;
  padding:12px 14px;
  border-radius:14px;
}
.top-actions > a.active,.top-actions > a:hover{
  color:var(--primary);
  background:#eef0fb;
}
.user-pill{
  padding:12px 16px;border-radius:999px;background:#fff;border:1px solid var(--border);
  font-weight:700;color:var(--text);
}
.btn,button{
  border:0;border-radius:14px;padding:13px 18px;font-family:inherit;font-weight:700;
  cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center
}
.btn-primary{background:linear-gradient(135deg,var(--primary) 0%, #6c72d9 100%);color:#fff;box-shadow:var(--shadow)}
.btn-secondary{background:#eef0fb;color:var(--primary)}
.btn-danger{background:#fff1f3;color:var(--danger)}
.page{padding-bottom:36px}
.hero{
  background:linear-gradient(135deg,#5a5eb3 0%, #6c72d9 100%);
  border-radius:30px;
  padding:34px;
  color:#fff;
  box-shadow:var(--shadow);
  position:relative;
  overflow:hidden;
}
.hero:after{
  content:"";
  position:absolute;
  width:320px;height:320px;border-radius:50%;
  background:rgba(255,255,255,.08);
  right:-80px;top:-60px;
  filter:blur(2px);
}
.hero h1{margin:0 0 10px;font-size:42px;line-height:1.06;max-width:700px}
.hero p{margin:0;max-width:720px;color:rgba(255,255,255,.88)}
.hero .cta{margin-top:22px;display:inline-flex;padding:11px 14px;border-radius:999px;background:rgba(255,255,255,.12);font-weight:700}
.grid{display:grid;gap:24px}
.stats{grid-template-columns:repeat(4,1fr);margin-top:24px}
.card,.auth-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.card{padding:22px}
.card h2,.card h3{margin-top:0}
.stat-card{
  background:linear-gradient(180deg,#fff 0%, #fafbff 100%);
  border:1px solid var(--border);
  border-radius:20px;
  padding:18px;
}
.stat-label{font-size:13px;color:var(--muted);margin-bottom:10px}
.stat-value{font-size:28px;font-weight:800}
.toolbar{display:flex;justify-content:space-between;gap:16px;align-items:center;flex-wrap:wrap}
.table-wrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{padding:14px 12px;border-bottom:1px solid var(--border);text-align:left;font-size:14px}
th{color:var(--muted);font-weight:700}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.form-group{display:grid;gap:8px}
.form-group.full{grid-column:1/-1}
label{font-size:14px;font-weight:700}
input,select,textarea{
  width:100%;padding:14px 16px;border-radius:16px;border:1px solid var(--border);
  background:#fff;font-family:inherit;color:var(--text);outline:none
}
textarea{min-height:120px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:#c4c8ff;box-shadow:0 0 0 4px rgba(90,94,179,.08)}
.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px}
.auth-card{width:min(560px,100%);padding:30px}
.auth-card h1{margin:0 0 8px;font-size:34px}
.auth-card p{margin:0 0 24px;color:var(--muted)}
.flash{padding:14px 16px;border-radius:14px;font-weight:700;margin-bottom:18px}
.flash-success{background:#ebfff6;color:#118554}
.flash-error{background:#fff1f3;color:#bf3550}
.flash-warning{background:#fff7e8;color:#9e6910}
.badge{display:inline-flex;padding:8px 12px;border-radius:999px;font-size:12px;font-weight:800}
.badge-success{background:#e9fff5;color:#118554}
.badge-warning{background:#fff7e8;color:#9e6910}
.badge-danger{background:#fff1f3;color:#bf3550}
.badge-primary{background:#eef0ff;color:var(--primary)}
.qr-preview{
  max-width:260px;display:block;border:1px solid var(--border);border-radius:20px;
  background:#fff;padding:10px;
}
.inline-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.muted{color:var(--muted)}
code.box{
  display:block;
  padding:14px 16px;
  border-radius:16px;
  background:#f7f8fe;
  border:1px solid var(--border);
  overflow:auto;
}
.footer-note{font-size:13px;color:var(--muted)}
@media (max-width: 980px){
  .stats,.form-grid{grid-template-columns:1fr}
  .hero h1{font-size:34px}
  .topbar-inner{align-items:flex-start;flex-direction:column}
}
