:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #102a43;
  --muted: #5c6b7a;
  --brand: #0f4c81;
  --brand-2: #f4a259;
  --line: #d8e1eb;
  --ok: #1f8f5f;
  --warn: #d17a22;
  --bad: #c94141;
  --shadow: 0 10px 30px rgba(16, 42, 67, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 20% -20%, rgba(15, 76, 129, 0.14), transparent),
    radial-gradient(900px 400px at 100% -20%, rgba(244, 162, 89, 0.2), transparent),
    var(--bg);
  font-family: 'Manrope', sans-serif;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: 'Sora', sans-serif;
  margin-top: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  color: var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #1f74b6);
  color: #fff;
  font-size: 0.8rem;
}

.main-nav,
.auth-nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.main-nav {
  justify-content: center;
}

.main-nav a {
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.main-nav a:hover {
  background: #eaf2fa;
  text-decoration: none;
}

.auth-nav {
  justify-content: flex-end;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  background: #eaf2fa;
  font-size: 0.85rem;
  font-weight: 700;
}

.user-name {
  color: #204666;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #e0ecf8;
  color: #1e4f79;
}

.role-pill.role-customer {
  background: #dff8ec;
  color: #177047;
}

.role-pill.role-organizer {
  background: #ffeccf;
  color: #905300;
}

.role-pill.role-staff {
  background: #e4efff;
  color: #2355a8;
}

.role-pill.role-super_admin {
  background: #fde6d0;
  color: #8f3a00;
}

.role-banner {
  max-width: 1160px;
  margin: 0.8rem auto 0;
  padding: 0 1rem;
}

.role-banner p {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #cfe1f3;
  background: linear-gradient(135deg, #f8fcff, #eff6fd);
  font-size: 0.86rem;
}

.container {
  max-width: 1160px;
  margin: 1.8rem auto 2.8rem;
  padding: 0 1rem;
}

.hero {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1.5fr 1fr;
  padding: 1.6rem;
  background: linear-gradient(135deg, #fff, #f7fbff);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.shop-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(300px 120px at 80% 0%, rgba(244, 162, 89, 0.35), transparent),
    radial-gradient(450px 180px at 20% 100%, rgba(23, 141, 214, 0.2), transparent),
    linear-gradient(135deg, #ffffff, #f3f9ff);
  animation: heroFloat 8s ease-in-out infinite;
}

.shop-spotlight {
  border: 1px solid #cde1f5;
  background: linear-gradient(160deg, #ffffff, #f4faff);
}

.eyebrow {
  display: inline-flex;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #d7e9fa;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.82rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 2.8vw, 2.35rem);
  margin-bottom: 0.5rem;
}

.hero-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
}

.metrics-grid.wide {
  margin: 1rem 0;
}

.metrics-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 0.9rem;
  box-shadow: var(--shadow);
}

.metrics-grid strong {
  display: block;
  font-size: 1.3rem;
}

.metrics-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.section-head > div {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.event-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ticket-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ticket-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 30px rgba(15, 76, 129, 0.16);
}

.event-card > div {
  padding: 0.9rem;
}

.event-card img,
.event-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.event-cover {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #ddeeff, #ffe7d0);
  color: var(--muted);
  font-weight: 700;
}

.filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.storefront-filter {
  padding: 0.75rem;
  border: 1px solid #d2e4f6;
  border-radius: 14px;
  background: #f9fcff;
}

.browse-head h1 {
  margin: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.customer-panel {
  border: 1px solid #cde1f5;
  background:
    radial-gradient(400px 120px at 0% 0%, rgba(12, 128, 204, 0.08), transparent),
    #fff;
}

.form {
  display: grid;
  gap: 0.7rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #9ec8ef;
  border-color: #9ec8ef;
}

.btn {
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #1c6fae);
  color: #fff;
  font-weight: 700;
  padding: 0.58rem 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn.small {
  padding: 0.35rem 0.55rem;
  font-size: 0.84rem;
}

.btn.ghost {
  background: #e9f2fb;
  color: var(--brand);
}

.inline {
  display: inline;
}

.alert {
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  margin-bottom: 0.9rem;
  font-weight: 600;
}

.alert.success {
  background: #e5f7ef;
  color: #186f48;
  border: 1px solid #b9eacc;
}

.alert.error {
  background: #fdecec;
  color: #8e2525;
  border: 1px solid #f7c4c4;
}

.muted {
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #edf4fb;
  color: #385c7a;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill.status-valid {
  background: #e5f7ef;
  color: var(--ok);
}

.pill.status-used {
  background: #fff3e3;
  color: var(--warn);
}

.pill.status-cancelled {
  background: #fdecec;
  color: var(--bad);
}

.split {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-col {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.58rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.event-hero {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.5fr 1fr;
}

.ticket-board {
  border: 1px solid #cde1f5;
  background: linear-gradient(160deg, #ffffff, #f2f8ff);
}

.event-copy .btn {
  margin-top: 0.6rem;
}

.mini-ticket {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  margin-bottom: 0.6rem;
}

.ticket-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
}

.ticket-buy-row {
  border: 1px solid #cce0f4;
  background: linear-gradient(155deg, #ffffff, #f7fbff);
}

.ticket-type-editor {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0.8rem;
  border: 1px dashed #9eb8ce;
  border-radius: 12px;
  margin-bottom: 0.7rem;
}

.stack {
  display: grid;
  gap: 0.7rem;
}

.total-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  padding: 0.7rem;
}

.checkout-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.6fr 0.9fr;
}

.checkout-main {
  min-width: 0;
}

.checkout-side {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  padding: 0.9rem;
  border: 1px solid #d3e5f7;
  border-radius: 14px;
  background: linear-gradient(160deg, #f9fcff, #eef6ff);
}

.checkout-total {
  border: 1px solid #bed8f2;
  background: linear-gradient(145deg, #edf6ff, #f8fbff);
}

.checkout-total #checkout-total {
  font-size: 1.45rem;
  margin: 0.2rem 0 0;
}

.customer-head h1 {
  margin-bottom: 0;
}

.auth-wrap {
  max-width: 520px;
  margin: 2rem auto;
}

.scanner-box {
  width: 100%;
  min-height: 260px;
  border-radius: 12px;
  border: 1px dashed #8ea6bd;
  overflow: hidden;
}

.scan-result {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
}

.scan-result.success {
  background: #e5f7ef;
  border-color: #b6e3ca;
  color: #15633f;
}

.scan-result.error {
  background: #fdecec;
  border-color: #f2b9b9;
  color: #7e2020;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}

.site-footer div {
  display: flex;
  gap: 1rem;
}

.prose p {
  line-height: 1.7;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
}

@keyframes heroFloat {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  50% {
    background-position: 20px -8px, -16px 12px, 0 0;
  }
  100% {
    background-position: 0 0, 0 0, 0 0;
  }
}

@media (max-width: 1000px) {
  .hero,
  .event-hero,
  .split,
  .ticket-row,
  .checkout-shell {
    grid-template-columns: 1fr;
  }

  .ticket-type-editor,
  .two-col,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .auth-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    margin-top: 1.2rem;
  }
}

@media (max-width: 700px) {
  .site-header {
    padding: 0.7rem 0.85rem;
    gap: 0.65rem;
  }

  .main-nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
  }

  .main-nav a {
    white-space: nowrap;
  }

  .auth-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.55rem;
  }

  .auth-nav form {
    margin: 0;
  }

  .user-chip {
    max-width: 100%;
    flex-wrap: wrap;
    border-radius: 12px;
  }

  .role-banner {
    margin-top: 0.55rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .hero,
  .panel {
    padding: 0.85rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-head > div {
    width: 100%;
  }

  .section-head > div .btn {
    flex: 1 1 180px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .ticket-type-editor {
    grid-template-columns: 1fr;
  }

  .form .btn {
    width: 100%;
  }

  th,
  td {
    font-size: 0.88rem;
    padding: 0.5rem;
  }

  .inline {
    display: inline-flex;
    margin: 0.1rem 0.2rem 0.1rem 0;
  }
}

@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .btn.small {
    padding: 0.42rem 0.6rem;
    font-size: 0.82rem;
  }

  .role-pill {
    font-size: 0.68rem;
  }
}
