:root {
  --bg: #0a1631;
  --sidebar: #0e1f42;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-soft: rgba(255,255,255,0.84);
  --primary: #2f6bff;
  --line: rgba(18, 46, 106, 0.12);
  --text: #102041;
  --muted: #6f7f9f;
  --success: #0ea863;
  --danger: #d84848;
  --shadow: 0 24px 60px rgba(8, 23, 58, 0.18);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Manrope', system-ui, sans-serif; color: var(--text);
  background: linear-gradient(135deg, #edf4ff 0%, #f7fbff 60%, #eaf2ff 100%);
}
a { color: inherit; text-decoration: none; }
.admin-shell { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: linear-gradient(180deg, #0f1d3d 0%, #132752 100%);
  color: #fff; padding: 24px 18px; position: sticky; top: 0; height: 100vh;
}
.admin-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-dot { width: 14px; height: 14px; border-radius: 999px; background: linear-gradient(135deg, #78d7ff, #2f6bff); box-shadow: 0 0 24px rgba(120,215,255,.8); }
.admin-brand strong { display: block; }
.admin-brand small { color: rgba(255,255,255,.72); }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a { color: rgba(255,255,255,.84); padding: 12px 14px; border-radius: 16px; font-weight: 700; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-main { padding: 24px; }
.admin-topbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.admin-topbar h1 { margin: 8px 0 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.admin-user-pill { background: #fff; padding: 12px 16px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 800; }
.admin-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.metric-card, .panel {
  background: var(--panel); border: 1px solid rgba(255,255,255,.95); border-radius: 24px; box-shadow: var(--shadow);
}
.metric-card { padding: 20px; }
.metric-card span { display: block; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.metric-card strong { font-size: 1.8rem; }
.admin-grid { display: grid; gap: 18px; margin-top: 18px; }
.admin-grid.two-col { grid-template-columns: 1.1fr .9fr; }
.panel { padding: 22px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.stack-form { display: grid; gap: 14px; }
.stack-form label span { display: block; font-weight: 800; margin-bottom: 8px; }
.stack-form input, .stack-form textarea, .stack-form select {
  width: 100%; min-height: 52px; border-radius: 16px; border: 1px solid var(--line); background: #fff; padding: 14px 16px; font: inherit;
}
.stack-form textarea { min-height: 180px; resize: vertical; }
.admin-inline-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 12px; }
.checkbox-row input { width: 18px; min-height: 18px; }
.btn-dark, .btn-muted {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 18px;
  border-radius: 16px; border: 0; font-weight: 800; cursor: pointer;
}
.btn-dark { background: linear-gradient(135deg, #15347d, #2f6bff); color: #fff; }
.btn-muted { background: #eff4ff; color: var(--text); }
.table-wrap { overflow: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 640px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 14px 12px; border-bottom: 1px solid #eef3fb; font-size: .95rem; }
.table-wrap th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.table-status { display: inline-flex; padding: 8px 10px; border-radius: 999px; font-weight: 800; }
.status-paid { background: rgba(14,168,99,.12); color: var(--success); }
.status-pending, .status-expired { background: rgba(47,107,255,.12); color: var(--primary); }
.status-failed, .status-cancelled { background: rgba(216,72,72,.12); color: var(--danger); }
.admin-flash { padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; font-weight: 800; }
.admin-flash-error { background: rgba(216,72,72,.12); color: var(--danger); }
.admin-flash-success { background: rgba(14,168,99,.12); color: var(--success); }
.stack-list { display: grid; gap: 12px; }
.list-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; background: #f6f9ff; border: 1px solid #edf3ff; }
.inventory-preview { width: 100%; min-height: 300px; border-radius: 18px; border: 1px solid var(--line); padding: 16px; background: #f7fbff; font: 600 .95rem/1.6 'Manrope', system-ui, sans-serif; }
.panel-note { color: var(--muted); margin-top: 12px; }
.top-gap { margin-top: 18px; }
.admin-login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(circle at top, rgba(47,107,255,.32), transparent 34%), linear-gradient(180deg, #eef4ff 0%, #f9fbff 100%);
}
.admin-login-shell { width: min(100%, 500px); padding: 24px; }
.admin-login-card {
  background: rgba(255,255,255,.94); padding: 32px; border-radius: 30px; box-shadow: var(--shadow);
}
.eyebrow { display: inline-block; color: var(--primary); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
@media (max-width: 1024px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
  .admin-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-grid.two-col, .admin-inline-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-main { padding: 16px; }
  .admin-topbar, .list-row { flex-direction: column; align-items: flex-start; }
  .admin-cards { grid-template-columns: 1fr; }
  .admin-login-card { padding: 24px; }
}
