@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  color-scheme: light;
  --ink: #172033;
  --ink-soft: #344054;
  --muted: #667085;
  --brand: #9e1f63;
  --brand-dark: #711546;
  --brand-deep: #520b31;
  --brand-soft: #fce7f3;
  --brand-faint: #fff5fa;
  --bg: #f7f6f9;
  --surface: #ffffff;
  --surface-soft: #fbf9fc;
  --line: #e8e3e9;
  --line-strong: #d9d1da;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #93370d;
  --warning-soft: #fffaeb;
  --shadow-sm: 0 1px 2px rgba(45, 24, 38, 0.05);
  --shadow: 0 14px 40px rgba(70, 27, 53, 0.08);
  --shadow-lg: 0 28px 70px rgba(70, 27, 53, 0.13);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(158, 31, 99, 0.09), transparent 30rem),
    linear-gradient(180deg, #fff 0, var(--bg) 19rem);
  font: 400 15px/1.6 "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection { color: #fff; background: var(--brand); }
a { color: var(--brand); font-weight: 650; text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; }

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(232, 227, 233, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 0 rgba(82, 11, 49, 0.02);
  backdrop-filter: blur(18px) saturate(1.25);
}
nav, main { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
nav > a:not(.brand) { text-decoration: none; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font: 800 1.08rem/1 Manrope, sans-serif;
  text-decoration: none;
  letter-spacing: -0.025em;
}
.brand:hover { color: var(--ink); }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.nav-links, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.nav-links > a {
  padding: 8px 12px;
  border-radius: 9px;
  text-decoration: none;
}
.nav-links > a:hover { background: var(--brand-faint); }

main { padding-block: clamp(30px, 5vw, 58px) 70px; }
h1, h2, h3 {
  margin-top: 0;
  color: var(--ink);
  font-family: Manrope, "DM Sans", sans-serif;
  letter-spacing: -0.035em;
}
h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; }
h2 { margin-bottom: 12px; font-size: clamp(1.2rem, 2vw, 1.5rem); line-height: 1.2; }
p { margin-top: 0; }
.muted { color: var(--muted); }

.event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.event-head > div:first-child > p { margin-bottom: 0; }
.event-head .actions { justify-content: flex-end; }

.card {
  position: relative;
  margin-bottom: 22px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 22px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(158, 31, 99, 0.2), transparent);
}
.auth-shell {
  width: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 24px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(158, 31, 99, 0.07), transparent 36rem),
    #f7f7fa;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: var(--ink);
  font: 800 1.22rem/1 Manrope, sans-serif;
  letter-spacing: -0.035em;
  text-decoration: none;
}
.auth-brand img { width: 38px; height: 38px; object-fit: contain; }
.auth-card {
  width: min(100%, 456px);
  padding: clamp(26px, 5vw, 40px);
  border: 1px solid #eceaf0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(31, 25, 39, 0.08), 0 2px 8px rgba(31, 25, 39, 0.03);
}
.auth-panel-heading { margin-bottom: 27px; }
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--brand);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.auth-kicker > span { width: 7px; height: 7px; border-radius: 50%; background: #cc4c91; }
.auth-panel-heading h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 6vw, 2.15rem); letter-spacing: -0.045em; }
.auth-panel-heading p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.auth-form { display: grid; gap: 18px; }
.auth-field { min-width: 0; }
.auth-field label { margin: 0 0 7px; color: #374151; font-size: 0.83rem; }
.auth-field input { min-height: 50px; border-color: #e2e0e7; border-radius: 10px; background: #fff; font-size: 0.92rem; }
.auth-field input::placeholder { color: #a2a0a9; }
.auth-field input:focus { border-color: var(--brand); background: #fff; }
.auth-password-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-password-label a { font-size: 0.78rem; font-weight: 700; text-decoration: none; }
.auth-submit {
  width: 100%;
  min-height: 50px;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 0;
  padding: 12px 17px;
  border-radius: 10px;
  background: var(--brand);
  box-shadow: 0 7px 15px rgba(158, 31, 99, 0.16);
  font-size: 0.9rem;
}
.auth-submit span { font-size: 1.1rem; }
.auth-submit:hover { background: var(--brand-dark); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; color: #96909a; font-size: 0.74rem; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: #eeeaf0; content: ""; }
.social-login { display: grid; gap: 10px; margin-top: 15px; }
.social-login-button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid #e6e3e8;
  border-radius: 10px;
  box-shadow: none;
  font: 700 0.84rem/1.3 "DM Sans", sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
}
.social-login-button:hover { transform: translateY(-1px); }
.social-login-button:focus-visible { outline: 3px solid rgba(23, 32, 51, 0.25); outline-offset: 3px; }
.social-login-facebook { border-color: #1877f2; background: #1877f2; color: #fff; }
.social-login-facebook:hover { background: #0866d9; color: #fff; }
.social-login-google { border-color: #e5e7eb; background: #fff; color: #5f6368; }
.social-login-google:hover { background: #fafafa; color: #3c4043; }
.social-login-button:disabled { opacity: 1; cursor: not-allowed; transform: none; }
.social-login-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.social-login-note { margin: 1px 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.45; text-align: center; }
.auth-switch { margin: 22px 0 0; color: var(--muted); font-size: 0.8rem; text-align: center; }
.auth-switch a { margin-left: 3px; font-weight: 750; text-decoration: none; }
.auth-security { margin: 18px 0 0; color: #898590; font-size: 0.73rem; text-align: center; }
.auth-security span { margin-right: 5px; color: var(--success); font-weight: 800; }

label {
  display: block;
  margin: 18px 0 7px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 13px;
  font: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
select {
  appearance: none;
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
input:hover, select:hover, textarea:hover { border-color: #bbaeb8; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(158, 31, 99, 0.11);
  background: #fff;
}
textarea { min-height: 180px; resize: vertical; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }

.button, button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(135deg, #ad286e, var(--brand));
  box-shadow: 0 8px 18px rgba(158, 31, 99, 0.18);
  color: #fff;
  padding: 10px 17px;
  font: 750 0.92rem "DM Sans", sans-serif;
  text-decoration: none;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.button:hover, button:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(158, 31, 99, 0.24);
}
.button:active, button:active { transform: translateY(0); }
.button:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(158, 31, 99, 0.24);
  outline-offset: 2px;
}
.button.secondary {
  border-color: #efd1e2;
  background: var(--brand-soft);
  box-shadow: none;
  color: var(--brand-deep);
}
.button.secondary:hover { background: #f7d5e7; color: var(--brand-deep); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.danger-button { background: var(--danger); box-shadow: 0 8px 18px rgba(180, 35, 24, 0.15); }

.error, .success {
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 12px;
  font-weight: 600;
}
.error { border-color: #fecdca; background: var(--danger-soft); color: var(--danger); }
.success { border-color: #abefc6; background: var(--success-soft); color: var(--success); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 28px;
}
.metric {
  min-height: 126px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #fff, #fcf9fb);
  box-shadow: var(--shadow-sm);
}
.metric::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(158, 31, 99, 0.055);
}
.metric > span { color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.metric strong { position: relative; z-index: 1; display: block; font: 800 clamp(1.35rem, 2.3vw, 1.8rem)/1.2 Manrope, sans-serif; }
.metric strong .currency-total { display: block; color: inherit; font: inherit; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}
.stat { min-width: 0; padding: 16px; background: var(--surface-soft); }
.stat strong { display: block; overflow-wrap: anywhere; font: 800 1.2rem/1.25 Manrope, sans-serif; }
.stat span { display: block; margin-top: 3px; font-size: 0.78rem; }
.progress { height: 9px; overflow: hidden; border-radius: 99px; background: #eee8ed; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #d9468d); box-shadow: 0 0 14px rgba(158, 31, 99, 0.3); }

.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, 0.9fr); gap: 22px; align-items: start; }
.admin-grid aside { position: sticky; top: 94px; }
.danger-zone { border-color: #fecdca; background: linear-gradient(180deg, #fff, #fffafa); }
.danger-zone::before { background: linear-gradient(90deg, transparent, rgba(180, 35, 24, 0.25), transparent); }
.inline-form { margin: 0; }
.inline-form button { min-height: 36px; padding: 6px 11px; font-size: 0.82rem; }

.table-wrap { overflow-x: auto; margin-inline: -4px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; text-align: left; background: var(--surface); }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #fbf8fa; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--brand-faint); }
.badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 9px; font-size: 0.74rem; font-weight: 800; text-transform: capitalize; }
.badge.valid, .badge.success { background: #dcfae6; color: var(--success); }
.badge.scanned { background: var(--brand-soft); color: var(--brand-deep); }
.badge.pending, .badge.initiating, .badge.otp { background: var(--warning-soft); color: var(--warning); }
.badge.failed, .badge.reversed { background: #fee4e2; color: var(--danger); }

.ticket { max-width: 640px; margin: 0 auto 24px; text-align: center; }
.qr { display: flex; justify-content: center; margin: 24px; }
.qr canvas, .qr img { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.uuid { max-width: 100%; overflow-wrap: anywhere; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid aside { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  nav, main { width: min(100% - 24px, 1180px); }
  nav { min-height: 64px; }
  .brand img { width: 34px; height: 34px; }
  .nav-links .muted { display: none; }
  main { padding-top: 26px; }
  .event-head { display: block; }
  .event-head .actions { justify-content: flex-start; margin-top: 18px; }
  .grid { grid-template-columns: 1fr; }
  .card { border-radius: 18px; padding: 20px; }
  .summary-grid { gap: 10px; }
  .metric { min-height: 110px; padding: 16px; }
  .auth-shell { width: 100%; padding: 24px 16px; }
  .auth-brand { margin-bottom: 20px; }
  .auth-card { border-radius: 16px; }
  .auth-field input { min-height: 50px; font-size: 16px; }
  .social-login-button { min-height: 49px; }
}
@media (max-width: 440px) {
  .summary-grid, .stats { grid-template-columns: 1fr; }
  .actions .button { flex: 1 1 auto; }
  .auth-shell { padding: 18px 12px; }
  .auth-brand { margin-bottom: 16px; }
  .auth-card { padding: 25px 20px; }
  .auth-panel-heading { margin-bottom: 23px; }
  .auth-form { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
