* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', sans-serif;
  background: #F6F4FE;
  color: #1E1B2E;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font-family: 'Inter', sans-serif; }

.flash-wrap { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 100; }
.flash {
  background: #1E1B2E; color: #FBF7EE; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; margin-bottom: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

/* ---------- Storefront ---------- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: #1E1B2E;
}
.nav-brand { display: flex; align-items: center; gap: 9px; }
.nav-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.nav-brand-text { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; color: #FBF7EE; }
.accent { color: #FFD166; }
.nav-right { font-size: 12.5px; color: #FBF7EE; opacity: 0.8; }

.hero {
  padding: 48px 24px 40px;
  background: linear-gradient(160deg, #5B3DF5 0%, #7B4FF0 45%, #F6F4FE 100%);
  text-align: center;
}
.hero-ticket {
  display: inline-flex; flex-direction: column; gap: 2px;
  background: rgba(255,255,255,0.14); border: 1px dashed #FFD166;
  border-radius: 10px; padding: 8px 16px; margin-bottom: 20px;
}
.hero-ticket-row { font-size: 12px; color: #FFD166; font-weight: 700; letter-spacing: 0.04em; }
.hero-ticket-row2 { font-size: 11px; color: #FBF7EE; opacity: 0.85; }
.hero-title {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 34px; line-height: 1.2;
  color: #FBF7EE; margin-bottom: 14px;
}
.accent2 { color: #FFD166; }
.hero-sub { font-size: 14.5px; color: #FBF7EE; opacity: 0.9; max-width: 420px; margin: 0 auto; line-height: 1.6; }

.main { max-width: 760px; margin: 0 auto; padding: 8px 20px 40px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-eyebrow { font-size: 13px; font-weight: 700; color: #5B3DF5; letter-spacing: 0.03em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  background: #FFFFFF; border: 1px solid #EAE6F9; border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 2px 10px rgba(91,61,245,0.06);
}
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-image { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; margin-bottom: 2px; }
.stock-tag { font-size: 11px; color: #6B5FA8; font-weight: 600; }
.stock-tag.stock-low { color: #B5790A; }
.stock-tag.stock-out { color: #E0554A; }
.icon-bubble {
  width: 38px; height: 38px; border-radius: 11px; background: #5B3DF5; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: 'Sora', sans-serif;
}
.category-tag { font-size: 10.5px; color: #6B5FA8; background: #EFEAFE; padding: 3px 8px; border-radius: 20px; font-weight: 600; }
.card-name { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.card-price { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 15px; }
.buy-btn {
  display: flex; align-items: center; gap: 5px; background: #5B3DF5; color: #FBF7EE;
  border: none; border-radius: 9px; padding: 8px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}

.footer { text-align: center; padding: 18px; font-size: 11.5px; color: #8A85A3; border-top: 1px solid #EAE6F9; }

.overlay {
  position: fixed; inset: 0; background: rgba(30,27,46,0.55);
  align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal { background: #F6F4FE; border-radius: 18px; width: 100%; max-width: 380px; overflow: hidden; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; background: #1E1B2E;
  padding: 16px 20px; font-family: 'Sora', sans-serif; font-weight: 600; color: #FBF7EE;
}
.modal-head button { background: transparent; border: none; color: #FBF7EE; font-size: 16px; cursor: pointer; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-body label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #4A4460; font-weight: 600; }
.modal-body input {
  border: 1px solid #DCD5F5; border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #fff; color: #1E1B2E;
}
.pay-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, #FF6B4A, #FF8F6B); color: #fff; border: none; border-radius: 11px;
  padding: 13px; font-size: 14.5px; font-weight: 700; cursor: pointer; margin-top: 6px;
  box-shadow: 0 4px 14px rgba(255,107,74,0.35);
}

/* ---------- Delivery ticket ---------- */
.ticket-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ticket-wrap { background: #1E1B2E; border-radius: 20px; width: 100%; max-width: 380px; overflow: hidden; }
.ticket-top { display: flex; align-items: center; gap: 8px; padding: 16px 20px; color: #FBF7EE; font-weight: 700; font-size: 13px; }
.ticket-logo { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.ticket-body { background: #FBF7EE; padding: 22px 22px 26px; border-radius: 20px 20px 0 0; }
.delivered-badge {
  display: inline-flex; align-items: center; gap: 5px; background: #DFF7E6; color: #0F8A3F;
  font-size: 11.5px; font-weight: 700; padding: 5px 10px; border-radius: 20px; margin-bottom: 12px;
}
.ticket-product-name { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; margin-bottom: 14px; }
.ticket-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.ticket-row span:first-child { color: #8A85A3; }
.ticket-row span:last-child { font-family: 'JetBrains Mono', monospace; }
.deliver-label { font-size: 11.5px; color: #8A85A3; font-weight: 700; margin: 14px 0 6px; letter-spacing: 0.03em; }
.deliver-box {
  background: #FFFFFF; border: 1px dashed #5B3DF5; border-radius: 10px; padding: 12px; margin-bottom: 14px;
}
.deliver-box pre {
  white-space: pre-wrap; word-break: break-all; font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-bottom: 8px;
}
.download-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: #5B3DF5; color: #FBF7EE; padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 700;
}
.cancel-box { text-align: center; padding: 60px 20px; }

/* ---------- Admin ---------- */
.admin-page { min-height: 100vh; display: flex; }
.admin-sidebar { width: 220px; background: #1E1B2E; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.admin-brand { display: flex; align-items: center; gap: 9px; padding: 0 8px 18px; }
.admin-brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.admin-brand span { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 16px; color: #FBF7EE; }
.admin-sidebar-label { font-size: 10.5px; color: #6B6577; font-weight: 700; letter-spacing: 0.08em; padding: 0 8px 8px; }
.admin-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #B8B2D6; font-size: 13.5px; font-weight: 600;
}
.admin-nav-item.active { background: rgba(91,61,245,0.25); color: #FBF7EE; }
.admin-main { flex: 1; min-width: 0; }
.admin-topbar { padding: 16px 20px; background: #fff; border-bottom: 1px solid #EAE6F9; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 17px; }
.admin-section { padding: 20px; max-width: 900px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 10px; border: 1px solid #EAE6F9; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.stat-value { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 17px; }
.stat-label { font-size: 11.5px; color: #8A85A3; }

.admin-card { background: #fff; border-radius: 14px; border: 1px solid #EAE6F9; padding: 16px; }
.admin-card h3 { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 14.5px; margin-bottom: 8px; }

.table-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid #F0EDFA; gap: 10px; flex-wrap: wrap; }
.table-row:first-child { border-top: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; text-transform: capitalize; border: none; cursor: pointer; }
.pill-green { background: #DFF7E6; color: #0F8A3F; }
.pill-amber { background: #FEF3D6; color: #B5790A; }
.pill-muted { background: #EFEDF6; color: #8A85A3; }

.toolbar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px; background: #5B3DF5; color: #FBF7EE;
  border: none; border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-danger { color: #E0554A; background: #F6F4FE; border: none; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.btn-light { color: #5B3DF5; background: #F6F4FE; border: none; border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 16px; padding: 30px; width: 100%; max-width: 340px; box-shadow: 0 10px 30px rgba(91,61,245,0.12); }
.login-card h2 { font-family: 'Sora', sans-serif; margin-bottom: 18px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; margin-bottom: 12px; }
.login-card input { border: 1px solid #DCD5F5; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.login-card button { width: 100%; margin-top: 6px; }

.form-grid { display: flex; flex-direction: column; gap: 13px; max-width: 420px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #4A4460; font-weight: 700; }
.form-grid input, .form-grid select, .form-grid textarea {
  border: 1px solid #DCD5F5; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; background: #fff; color: #1E1B2E;
}
.form-grid textarea { min-height: 90px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }
.hint { font-weight: 400; font-size: 11px; color: #8A85A3; }
