:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1c2430;
  --muted: #6b7785;
  --line: #e2e6ec;
  --brand: #0b8f6a;
  --brand-dark: #097256;
  --warn: #b8860b;
  --error: #c0392b;
  --success: #157347;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.banner {
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
}
.banner-mock { background: #fff3cd; color: #7a5b00; border-bottom: 1px solid #f0d98c; }

.event-header { margin-bottom: 24px; }
.event-header h1 { margin: 0 0 4px; font-size: 28px; }
.tagline { margin: 0 0 12px; color: var(--muted); font-size: 18px; }
.description { margin: 0 0 12px; }
.fee { margin: 0; }

form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px 24px; }

fieldset { border: none; border-top: 1px solid var(--line); padding: 16px 0; margin: 0; }
fieldset:first-of-type { border-top: none; }
legend { font-weight: 700; font-size: 16px; padding: 0; }

label { display: block; margin: 12px 0; font-weight: 600; font-size: 14px; }
input[type="text"], input[type="email"], select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand); border-color: var(--brand); }

.muted { color: var(--muted); font-weight: 400; font-size: 13px; }

.guest-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 14px; margin-bottom: 12px; background: #fafbfc; }
.guest-fields label { margin: 10px 0; }
.guest-row .btn-remove { margin-top: 4px; }

.code-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.code-row input { flex: 1; margin-top: 0; }
.code-row .btn-secondary { flex-shrink: 0; margin: 0; }
.code-msg-invalid { color: var(--error); }

button { font-size: 15px; cursor: pointer; border-radius: 8px; }
.btn-primary {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 12px 20px;
  font-weight: 700;
  margin-top: 8px;
  text-decoration: none;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary {
  display: inline-block;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
  margin: 8px 8px 0 0;
}
.btn-secondary:disabled { color: var(--muted); cursor: not-allowed; }
.btn-remove {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--error);
  padding: 8px 10px;
}

.summary {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 16px;
}
.summary-line { display: flex; justify-content: space-between; padding: 4px 0; }
.summary-discount { color: var(--success); }
.summary-total { font-weight: 700; font-size: 18px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }

.notice { border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.notice h2 { margin: 0 0 6px; }
.notice-error { background: #fdecea; border: 1px solid #f5c2bd; color: #7a1f17; }
.notice-warn { background: #fff8e6; border: 1px solid #f0d98c; color: #7a5b00; }
.notice-success { background: #e6f4ec; border: 1px solid #aedec1; color: #0f5132; }
.notice ul { margin: 8px 0 0; padding-left: 20px; }

.receipt { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.receipt h3 { margin-top: 0; }
.receipt-list { list-style: none; margin: 0; padding: 0; }
.receipt-list li { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.receipt-list li:last-child { border-bottom: none; }
.receipt-total { font-weight: 700; font-size: 17px; }

code { background: #eef1f4; padding: 2px 6px; border-radius: 4px; font-size: 0.95em; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; }
.footer a { color: var(--muted); }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; flex: 1; min-width: 120px; }
.stat-num { display: block; font-size: 24px; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f0f2f5; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
td.meals { white-space: normal; min-width: 180px; }

.status { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; text-transform: capitalize; }
.status-confirmed { background: #e6f4ec; color: var(--success); }
.status-pending { background: #fff8e6; color: var(--warn); }
.status-failed { background: #fdecea; color: var(--error); }

.mock-actions { display: flex; gap: 12px; align-items: center; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px 20px; margin-bottom: 24px; }
.panel h2 { margin-bottom: 4px; }
.catering { display: flex; flex-wrap: wrap; gap: 20px; }
.catering-course { flex: 1; min-width: 200px; }
.catering-course h3 { margin: 12px 0 6px; }
.catering-course ul { list-style: none; margin: 0; padding: 0; }
.catering-course li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.catering-course .count { font-weight: 700; }
.dietary-list { margin: 6px 0 0; padding-left: 20px; }
.dietary-list li { padding: 3px 0; }

.attendee { border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px 10px; margin-bottom: 12px; background: #fafbfc; }
.attendee-name { font-weight: 700; margin: 10px 0 6px; }
.attendee-courses { list-style: none; margin: 0; padding: 0; }
.attendee-courses li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.attendee-courses li:last-child { border-bottom: none; }
td.dietary { white-space: normal; min-width: 200px; }

/* ── Wide container for admin ─────────────────────────────────────────────── */
.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── Responsive table: stack as labelled cards on narrow screens ─────────── */
@media (max-width: 720px) {
  .table-responsive thead { display: none; }
  .table-responsive tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--card);
    overflow: hidden;
  }
  .table-responsive td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    font-size: 14px;
  }
  .table-responsive td:last-child { border-bottom: none; }
  .table-responsive td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    flex: 0 0 80px;
    padding-top: 1px;
  }
  .table-wrap { background: transparent; border: none; border-radius: 0; overflow: visible; }
}

/* ── Mobile polish ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Catering courses stack full-width */
  .catering-course { min-width: 100%; }

  /* Action buttons go full-width and stack */
  .btn-primary, .btn-secondary {
    display: block;
    text-align: center;
    margin-right: 0;
    width: 100%;
  }
  /* ...except the Apply button, which sits inline next to its input */
  .code-row .btn-secondary {
    width: auto;
    flex-shrink: 0;
  }
}
