@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --primary: #af1d25;
  --primary-shade-1: #84151c;
  --primary-shade-2: #580e12;
  --gold: #E4C796;
  --black: #1f1415;
  --white: #fff;
  --white-offset: #f5f5f5;
  --light-gray: #f5f5f5;
  --light-gray-shade-1: #e9e9e9;
  --light-gray-shade-2: #d1d1d1;
  --steel: #949494;

  --fg: var(--black);
  --muted: var(--steel);
  --border: var(--light-gray-shade-1);
  --bg: var(--white);
  --bg-soft: var(--white-offset);

  --danger-bg: #fdecea;
  --danger-fg: var(--primary-shade-1);
  --info-bg: #fff7e6;
  --info-fg: var(--primary-shade-2);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.3;
  color: var(--fg);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-shade-1); text-decoration: underline; }

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  flex: 1 0 auto;
}

/* Header */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  font-weight: 600;
  font-size: 1rem;
}
header.site-header .brand:hover { text-decoration: none; color: var(--fg); }
header.site-header .brand img { height: 36px; width: auto; display: block; }
header.site-header nav a { margin-left: 16px; color: var(--muted); }
header.site-header nav a:hover { color: var(--primary); text-decoration: none; }

/* Footer */
footer.site-footer {
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  padding: 28px 20px;
  margin-top: 48px;
  text-align: center;
  font-size: 0.875rem;
}
footer.site-footer a { color: var(--gold); }
footer.site-footer a:hover { color: var(--white); }
footer.site-footer .footer-logo img {
  height: 40px;
  margin-bottom: 12px;
  filter: brightness(0) invert(1);
}
footer.site-footer .footer-line { margin: 4px 0; opacity: 0.85; }

/* Headings */
h1 {
  font-size: 1.85rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--primary);
}
h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--fg);
}
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* Cards */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Event meta */
.event-meta p { margin: 4px 0; color: var(--muted); }
.event-meta b { color: var(--fg); font-weight: 600; }

/* Tier rows */
.tier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.tier-row:last-of-type { border-bottom: none; }
.tier-row .label { font-weight: 600; font-size: 1.05rem; }
.tier-row .price { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }

.qty-control { display: flex; align-items: center; }
.qty-control button {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--fg);
  font-family: inherit;
}
.qty-control button:hover:not(:disabled) {
  background: var(--bg-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.qty-control button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-input {
  width: 56px;
  height: 36px;
  text-align: center;
  margin: 0 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}
.form-group input[type="email"],
.form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
}
.form-group input[type="email"]:focus,
.form-group input[type="text"]:focus,
.qty-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(175, 29, 37, 0.15);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover:not(:disabled) {
  background: var(--primary-shade-1);
  border-color: var(--primary-shade-1);
  color: var(--white);
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-soft);
  color: var(--fg);
  border-color: var(--light-gray-shade-2);
}
.btn-danger {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary);
}
.btn-danger:hover:not(:disabled) {
  background: var(--primary);
  color: var(--white);
}
.btn-sm { padding: 6px 14px; font-size: 0.875rem; }

/* Total row */
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.total-amount { font-size: 1.5rem; font-weight: 600; color: var(--fg); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-top: 16px;
  border: 1px solid transparent;
}
.alert-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: rgba(132, 21, 28, 0.2); }
.alert-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--gold); }
.hidden { display: none; }

.text-danger { color: var(--primary); }
.text-success { color: #1a7d3e; }
.text-end { text-align: right; }

/* Admin dashboard */
.dashboard-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.dashboard-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.summary-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.summary-card .label { color: var(--muted); font-size: 0.85rem; }
.summary-card .value {
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 4px;
  color: var(--primary);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
table.data th {
  color: var(--muted);
  font-weight: 500;
  background: var(--bg-soft);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .tier-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .qty-control { align-self: flex-end; }
  .total-row { flex-direction: column; gap: 12px; align-items: stretch; }
  .total-row .btn { width: 100%; }
  header.site-header .brand img { height: 30px; }
  header.site-header { padding: 10px 16px; }
}
