:root {
  --bg: #07030f;
  --panel: #120b22;
  --panel-2: #1b1033;
  --panel-3: #26134b;
  --line: #3a226a;
  --line-hot: #8e35ff;
  --text: #f7f0ff;
  --muted: #b7a8cf;
  --blue: #8b5cff;
  --cyan: #22e8ff;
  --green: #31f5b4;
  --red: #ff477e;
  --yellow: #ffd166;
  --glow: 0 0 18px rgba(142, 53, 255, .34), 0 0 34px rgba(34, 232, 255, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(142, 53, 255, .12) 0 1px, transparent 1px 84px),
    linear-gradient(28deg, transparent 0 44%, rgba(34, 232, 255, .08) 44% 45%, transparent 45% 100%),
    radial-gradient(circle at 18% 0%, rgba(142, 53, 255, .18), transparent 28%),
    var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, Segoe UI, sans-serif;
}
a { color: #c7a8ff; text-decoration: none; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, rgba(23, 10, 48, .98), rgba(10, 5, 22, .98));
  border-right: 1px solid rgba(142, 53, 255, .45);
  box-shadow: 12px 0 34px rgba(0, 0, 0, .28);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-size: 19px;
  font-weight: 900;
  margin-bottom: 28px;
  color: #fff;
  text-shadow: 0 0 16px rgba(142, 53, 255, .85), 0 0 28px rgba(34, 232, 255, .34);
}
.brand::before { content: "V"; color: var(--cyan); margin-right: 8px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar a { color: var(--muted); padding: 10px 12px; border-radius: 8px; border: 1px solid transparent; }
.sidebar a:hover {
  background: linear-gradient(90deg, rgba(142, 53, 255, .2), rgba(34, 232, 255, .08));
  border-color: rgba(142, 53, 255, .36);
  color: var(--text);
  box-shadow: var(--glow);
}
.main { flex: 1; padding: 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 26px; }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: 0; }
.muted, small { color: var(--muted); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip img { width: 34px; height: 34px; border-radius: 50%; }
.grid { display: grid; gap: 14px; }
.stats-grid { grid-template-columns: repeat(5, minmax(130px, 1fr)); margin-bottom: 18px; }
.stat-card, .panel, .item-card {
  background: linear-gradient(180deg, rgba(24, 13, 45, .96), rgba(13, 7, 27, .96));
  border: 1px solid rgba(142, 53, 255, .35);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .2);
}
.stat-card { padding: 18px; position: relative; overflow: hidden; }
.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 16px 0 auto;
  width: 42px;
  height: 64px;
  background: linear-gradient(150deg, transparent 0 38%, var(--cyan) 39% 43%, transparent 44% 55%, var(--line-hot) 56% 60%, transparent 61%);
  opacity: .46;
}
.stat-card span { display: block; color: var(--muted); }
.stat-card strong { font-size: 30px; color: #fff; text-shadow: 0 0 18px rgba(142, 53, 255, .7); }
.panel { padding: 18px; margin-bottom: 18px; overflow-x: auto; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 11px 10px; border-bottom: 1px solid rgba(142, 53, 255, .22); text-align: left; vertical-align: top; }
th { color: #d7c4ff; font-size: 12px; text-transform: uppercase; }
pre { white-space: pre-wrap; max-width: 540px; color: #c8d4ec; }
.button {
  border: 1px solid rgba(142, 53, 255, .48);
  color: var(--text);
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  padding: 9px 13px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 rgba(142, 53, 255, 0);
}
.button:hover { box-shadow: var(--glow); }
.button.primary {
  background: linear-gradient(135deg, #7c2cff, #b331ff 52%, #18dfff);
  border-color: rgba(255, 255, 255, .18);
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, .38);
}
.button.danger { background: var(--red); border-color: var(--red); color: #fff; }
.button.ghost { background: transparent; }
.button.wide { width: 100%; }
input, textarea, select {
  width: 100%;
  background: #0b0616;
  border: 1px solid rgba(142, 53, 255, .42);
  color: var(--text);
  border-radius: 7px;
  padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 232, 255, .14); }
.search-form { display: flex; gap: 8px; min-width: 320px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-stack { display: grid; gap: 10px; max-width: 760px; }
.item-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; margin-bottom: 8px; }
.checkbox { display: flex; gap: 8px; align-items: center; }
.checkbox input { width: auto; }
.status { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.status-approved, .status-redeemed { color: var(--green); border-color: rgba(49, 245, 180, .45); }
.status-pending { color: var(--yellow); border-color: rgba(242, 201, 76, .45); }
.status-denied, .status-revoked { color: var(--red); border-color: rgba(255, 71, 126, .45); }
.detail-list { display: grid; grid-template-columns: 180px 1fr; gap: 8px 16px; }
.detail-list dt { color: var(--muted); }
.item-list { display: grid; gap: 8px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.item-card { padding: 14px; display: grid; gap: 5px; }
.flash { border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.flash.success { background: rgba(49, 245, 180, .12); color: var(--green); border: 1px solid rgba(49, 245, 180, .3); }
.flash.error { background: rgba(255, 71, 126, .12); color: var(--red); border: 1px solid rgba(255, 71, 126, .3); }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(420px, 100%); background: linear-gradient(180deg, rgba(24, 13, 45, .97), rgba(10, 5, 22, .97)); border: 1px solid rgba(142, 53, 255, .45); border-radius: 8px; padding: 28px; box-shadow: var(--glow); }
.eyebrow { color: var(--cyan); text-transform: uppercase; font-size: 12px; font-weight: 800; }
.narrow { max-width: 680px; }
.result-box { background: #0b0616; border: 1px solid rgba(142, 53, 255, .42); border-radius: 8px; padding: 12px; }
.hidden { display: none; }
@media (max-width: 900px) {
  .app-shell, .topbar, .two-column { display: block; }
  .sidebar { width: 100%; height: auto; position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 18px; }
  .panel-heading { display: block; }
}
