/* Maliban Cream Cracker re-launch - registration. Shared by index.html (desk) and admin.html.
 * Colours sampled from "Maliban Cream Cracker Logo.pdf": red #d61820 (background), blue #223d92 (outline), yellow #f8eb1d */
:root {
  --bg: #fbf4e6;            /* cream-cracker cream */
  --surface: #ffffff;
  --surface-2: #f6eddb;
  --line: #eadcc0;
  --text: #1a2a63;          /* deep Maliban blue for text */
  --muted: #6f6a7d;
  --red: #d61820;           /* logo background */
  --red-dark: #b3121a;
  --red-soft: rgba(214, 24, 32, .10);
  --blue: #223d92;          /* logo outline */
  --yellow: #f8eb1d;        /* logo "NEW" flash */
  --green: #1e9a52;
  --green-soft: rgba(30, 154, 82, .10);
  --amber: #e39b12;
  --amber-soft: rgba(227, 155, 18, .14);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 var(--font);
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

/* ---------- Brand header: the logo sits on its own red, yellow flash underneath ---------- */
.brand {
  background: var(--red);
  color: #fff;
  border-bottom: 6px solid var(--yellow);
}
.brand-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px;
  padding: 8px 20px;
}
.brand-main { height: 112px; width: auto; display: block; }
.brand-title { font-size: 14px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); }
.brand-title b {
  display: block; color: #fff; font-size: 44px; line-height: 1.05; letter-spacing: .01em; font-weight: 900;
  -webkit-text-stroke: 5px var(--blue); paint-order: stroke fill;   /* same white + blue outline as "CREAM CRACKER" */
}
.brand-spacer { flex: 1; }
.brand-links { display: flex; gap: 8px; align-items: center; }
.brand-links a {
  white-space: nowrap; text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; background: #fff; color: var(--blue); border: 2px solid #fff;
}
.brand-links a.active { background: var(--blue); color: #fff; border-color: #fff; }

.hero {
  max-width: 1280px; margin: 0 auto; padding: 16px 20px 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hero-title { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero-title b { display: block; color: var(--text); font-size: 20px; letter-spacing: .04em; }
.sync { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot.off { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.dot.err { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

main { max-width: 1280px; margin: 0 auto; padding: 10px 20px 60px; }

/* ---------- Controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.search { flex: 1 1 320px; position: relative; }
.search input {
  width: 100%; height: 58px; padding: 0 48px 0 52px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  font-size: 19px; outline: none; color: var(--text);
}
.search input::placeholder { color: #a39c8c; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(34, 61, 146, .12); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search svg { position: absolute; left: 17px; top: 18px; width: 22px; height: 22px; color: var(--blue); }
.search .clear {
  position: absolute; right: 8px; top: 9px; width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 22px;
}
select, .input {
  height: 58px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 0 14px; font-size: 16px; outline: none; min-width: 0; color: var(--text); font-weight: 600;
}
select:focus, .input:focus { border-color: var(--blue); }
select option { background: var(--surface); }

.btn {
  height: 58px; padding: 0 20px; border-radius: var(--radius); border: 2px solid var(--line);
  background: var(--surface); font-weight: 800; white-space: nowrap; color: var(--text);
}
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.ghost { background: transparent; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: 0 1px 0 rgba(26, 42, 99, .04); }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 30px; font-weight: 900; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--blue); }
.stat .v small { font-size: 15px; color: var(--muted); font-weight: 700; }
.bar { height: 7px; background: var(--surface-2); border-radius: 7px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 7px; width: 0; transition: width .4s; }

/* ---------- Guest list ---------- */
.list { display: grid; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 12px 12px 18px; min-height: 78px; box-shadow: 0 1px 0 rgba(26, 42, 99, .04);
}
.row.done { border-color: rgba(30, 154, 82, .45); background: linear-gradient(90deg, var(--green-soft), var(--surface) 55%); }
.row .who { flex: 1; min-width: 0; }
.row .name { font-size: 20px; font-weight: 800; overflow-wrap: anywhere; color: var(--text); }
.row .name mark { background: var(--yellow); color: var(--text); border-radius: 3px; padding: 0 1px; }
.row .meta { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.tag { border: 1px solid var(--line); padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface); }
.tag.cat { color: var(--blue); border-color: rgba(34, 61, 146, .3); font-weight: 600; }
.tag.new { border-color: var(--red); color: var(--red); }
.tag.ok { border-color: rgba(30, 154, 82, .5); color: var(--green); font-weight: 700; }
.row .act { display: flex; gap: 8px; align-items: center; }
.go {
  min-width: 150px; height: 58px; border-radius: 12px; border: 0; font-weight: 900; font-size: 17px;
  background: var(--red); color: #fff; letter-spacing: .02em; box-shadow: 0 3px 0 var(--red-dark);
}
.go.undo { background: transparent; border: 1px solid var(--line); color: var(--muted); min-width: 0; padding: 0 16px; font-weight: 700; box-shadow: none; }
.go:active { transform: translateY(2px); box-shadow: none; }
.empty { text-align: center; color: var(--muted); padding: 50px 10px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.more { text-align: center; color: var(--muted); font-size: 14px; padding: 12px; }

/* ---------- Modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(26, 20, 10, .55); display: grid; place-items: center; z-index: 50; padding: 16px;
}
.modal {
  width: min(520px, 100%); background: var(--surface); border-radius: 18px; padding: 22px;
  max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.modal h2 { margin: 0 0 14px; font-size: 20px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); letter-spacing: .04em; font-weight: 600; }
.field .input, .field select { height: 50px; width: 100%; }
.check { display: flex; gap: 10px; align-items: center; margin: 6px 0 4px; color: var(--muted); }
.check input { width: 20px; height: 20px; accent-color: var(--red); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ---------- Confirm dialog + event pill ---------- */
.modal.confirm { width: min(560px, 100%); text-align: center; padding: 0 0 24px; overflow: hidden; }
.modal.confirm .confirm-top { background: var(--red); border-bottom: 5px solid var(--yellow); padding: 14px; }
.modal.confirm h2 { margin: 18px 24px 6px; font-size: 18px; color: var(--muted); font-weight: 700; }
.confirm-top { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.confirm-step { font-size: 13px; color: #fff; letter-spacing: .06em; font-weight: 700; }
.confirm-name { font-size: 32px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; color: var(--blue); padding: 0 24px; }
.confirm-meta { color: var(--muted); margin-top: 6px; font-size: 15px; padding: 0 24px; }
.confirm-warn { color: var(--red); margin: 14px 24px 0; font-size: 15px; font-weight: 600; }
.modal.confirm .modal-actions { justify-content: center; margin: 22px 24px 0; }
.modal.confirm .modal-actions .btn { flex: 1; max-width: 240px; font-size: 18px; }
.event-pill {
  display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 900;
  letter-spacing: .14em; text-transform: uppercase; background: var(--yellow); color: var(--blue); white-space: nowrap;
}
.event-pill.ev-pr { background: #fff; color: var(--red); }
.event-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.event-tabs a {
  text-decoration: none; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); color: var(--muted); font-weight: 800;
}
.event-tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(560px, calc(100% - 32px)); }
.toast {
  background: #fff; color: var(--text); border-radius: 12px; padding: 13px 16px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(26, 42, 99, .25); border-left: 6px solid var(--green);
  display: flex; gap: 12px; align-items: center; animation: tin .2s ease-out;
}
.toast.warn { border-left-color: var(--amber); }
.toast.err { border-left-color: var(--red); }
.toast span { flex: 1; }
.toast button { border: 0; background: var(--surface-2); border-radius: 8px; padding: 6px 12px; font-weight: 800; color: var(--blue); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Admin ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--red); font-weight: 900; }
.cats { width: 100%; border-collapse: collapse; font-size: 15px; }
.cats th, .cats td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.cats th { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.cats td.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cats .bar { margin-top: 0; min-width: 80px; }
.cats tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { position: sticky; top: 0; background: var(--surface); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.tbl td.t { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.tbl .nm { font-weight: 700; }
.mini { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--text); }
.mini.red { background: var(--red); border-color: var(--red); color: #fff; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.log { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; font-size: 14px; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.log li time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.links { display: grid; gap: 6px; font-size: 14px; }
.link-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.link-row span { flex: 1; }
.links a { color: var(--blue); text-decoration: none; white-space: nowrap; padding: 6px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; }
.links a:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .brand-main { height: 84px; }
  .brand-title b { font-size: 32px; -webkit-text-stroke-width: 4px; }
  .brand-links { gap: 6px; }
  .brand-links a { padding: 7px 11px; font-size: 13px; }
}
@media (max-width: 640px) {
  .brand-inner { padding: 6px 16px; gap: 12px; flex-wrap: wrap; }
  .brand-main { height: 72px; }
  .brand-title { font-size: 11px; }
  .brand-title b { font-size: 26px; -webkit-text-stroke-width: 3px; }
  .brand-spacer { display: none; }
  .brand-links { width: 100%; padding-bottom: 6px; }
  .brand-links a { flex: 1; text-align: center; padding: 7px 6px; }
  .hero { padding: 12px 16px 0; }
  main { padding: 8px 16px 60px; }
  .toolbar select, .toolbar .btn { flex: 1 1 45%; }
  .row { flex-wrap: wrap; padding: 12px; }
  .row .act { width: 100%; }
  .go { flex: 1; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .k { font-size: 10px; letter-spacing: .08em; }
  .stat .v { font-size: 24px; }
}
