/* Mattr brand (Brand Guidelines v06, May 2023)
   Navy PMS 654C #003A70 (primary) · Teal PMS 631C #2EADC8 · Royal Blue PMS 2935C #0055B8
   Dark Grey PMS 430C #727C84 · Light Grey PMS 427C #CED2D5 · Type: Montserrat (Arial fallback)
   Graphics: 30° angles and connector lines, both taken from the logomark. */
:root {
  --navy: #003a70;
  --teal: #2eadc8;
  --royal: #0055b8;
  --grey: #727c84;
  --grey-light: #ced2d5;
  --ink: #14263a;
  --muted: #5f6a73;
  --line: #dde1e4;
  --bg: #f3f5f6;
  --card: #ffffff;
  --ok: #1d7a45;
  --ok-bg: #e5f4eb;
  --warn: #7a5300;
  --warn-bg: #fff3d6;
  --err: #a12222;
  --err-bg: #fbe9e9;
  --radius: 6px;
  /* Connector-line motif, white, for use on navy */
  --connector: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 200' fill='none' stroke='%23ffffff' stroke-opacity='.28' stroke-width='3'%3E%3Cpath d='M52 150 L130 62 M150 62 L232 118 M248 110 L300 30'/%3E%3Ccircle cx='40' cy='162' r='16'/%3E%3Ccircle cx='140' cy='52' r='16'/%3E%3Ccircle cx='242' cy='124' r='16'/%3E%3Ccircle cx='306' cy='20' r='12'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 Montserrat, Arial, Helvetica, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; }
a { color: var(--royal); }
h1, h2, h3 { color: var(--navy); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; margin: 1.4rem 0 .8rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 .6rem; font-weight: 600; }
h3 { font-size: 1rem; margin: 0 0 .4rem; font-weight: 600; }
p { margin: .4rem 0 .8rem; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header: navy with the white knockout logo ---------- */
.statusbar { text-align: center; font-size: .78rem; padding: 4px 8px; color: #fff; font-weight: 500; letter-spacing: .02em; }
.statusbar.open { background: var(--ok); }
.statusbar.closed { background: var(--grey); }
.statusbar a { color: #fff; }
.topbar { background: var(--navy); color: #fff; border-bottom: 4px solid var(--teal); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 96px; padding-top: 22px; padding-bottom: 22px; }
/* Clear space around the logo ≈ the width of the connector icon, per the guidelines */
.brand { display: flex; align-items: center; gap: 32px; text-decoration: none; color: #fff; }
.brand img { height: 48px; width: auto; display: block; }
.brand-label { font-weight: 500; font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; padding-left: 32px; border-left: 1px solid rgba(255,255,255,.35); line-height: 1.2; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a, .nav .linklike { text-decoration: none; color: rgba(255,255,255,.88); padding: 7px 11px; border-radius: var(--radius); font-size: .88rem; font-weight: 500; }
.nav a:hover, .nav .linklike:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav a.active { background: #fff; color: var(--navy); }
.nav .pill { background: var(--teal); color: var(--navy); font-weight: 700; }
.nav .pill:hover { background: #4cbdd5; color: var(--navy); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--teal); color: var(--navy); font-size: .72rem; font-weight: 700; text-align: center; }
.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--royal); padding: 0; }
.footer { color: var(--muted); font-size: .78rem; padding: 28px 0; margin-top: 40px; border-top: 1px solid var(--line); background: #fff; }

/* Sign-in / register: a navy wedge cut at the brand's 30° angle */
body.bare { background: linear-gradient(150deg, var(--navy) 0 34%, var(--teal) 34% 35.2%, var(--bg) 35.2%) fixed; }
body.bare .topbar { background: transparent; border-bottom: 0; }
body.bare .footer { background: transparent; border-top: 0; }
body.bare .narrow { box-shadow: 0 12px 40px rgba(0, 30, 60, .18); border: 0; }

/* ---------- Flash ---------- */
.flash { margin: 16px 0; padding: 11px 14px; border-radius: var(--radius); font-weight: 500; border-left: 4px solid currentColor; }
.flash-ok { background: var(--ok-bg); color: var(--ok); }
.flash-err { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--warn-bg); color: var(--warn); }

/* ---------- Panels ---------- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 12px 0; }
.narrow { max-width: 430px; margin: 40px auto; padding: 28px; }
.closed-box { text-align: center; padding: 56px 20px; border-top: 4px solid var(--navy); }
.closed-box h1 { margin-top: 0; }

/* Hero: navy band, teal stripe and royal-blue corner at 30°, connector lines behind */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius);
  background:
    var(--connector) right 28px bottom 14px / 230px auto no-repeat,
    linear-gradient(150deg, var(--navy) 0 64%, var(--teal) 64% 66%, var(--royal) 66%);
  padding: 22px 26px; margin: 20px 0; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
}
.hero > div:first-child { flex: 1 1 340px; max-width: 620px; }
.hero h1 { color: #fff; }
.hero .muted, .hero .hint { color: rgba(255,255,255,.82); }
.hero a { color: #fff; }
.hero label { color: #fff; }
.hero .balance { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.hero .btn { background: #fff; color: var(--navy); }
.hero .btn:hover { background: var(--teal); color: var(--navy); }

/* ---------- Products ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 18px; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.product:hover { box-shadow: 0 6px 22px rgba(0, 40, 80, .10); }
.product .img { aspect-ratio: 1 / 1; background: linear-gradient(150deg, #eef1f3 0 78%, var(--grey-light) 78%); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product .img img { width: 100%; height: 100%; object-fit: cover; }
.product .img .ph { font-size: 2.4rem; font-weight: 700; color: var(--navy); opacity: .28; letter-spacing: .04em; }
.product .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; border-top: 3px solid var(--navy); }
.product h3 { margin: 0; }
.product .price { font-weight: 700; color: var(--royal); font-size: 1.05rem; }
.product .desc { color: var(--muted); font-size: .85rem; margin: 0; }
.product form { margin-top: auto; padding-top: 8px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.product form select { grid-column: span 3; }
.product form .full { grid-column: 1 / -1; }
.product form input[type=number] { grid-column: span 2; padding-left: 8px; padding-right: 4px; }
.product form .btn { grid-column: span 4; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); font-weight: 700; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.filters a { text-decoration: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--grey-light); background: var(--card); color: var(--navy); font-size: .82rem; font-weight: 500; }
.filters a:hover { border-color: var(--navy); }
.filters a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Forms ---------- */
label { display: block; font-size: .82rem; font-weight: 600; margin: 12px 0 4px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #c3c9ce; border-radius: var(--radius); font: inherit; font-size: .92rem; background: #fff; color: var(--ink);
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.choices { border: 0; padding: 0; margin: 0 0 6px; }
.choices legend { font-weight: 700; color: var(--navy); font-size: .95rem; margin-bottom: 8px; padding: 0; }
.choice { display: inline-flex; align-items: center; gap: 10px; margin: 0 10px 10px 0; padding: 12px 18px; border: 1px solid #c3c9ce; border-radius: var(--radius); cursor: pointer; font-size: .92rem; font-weight: 600; color: var(--ink); background: #fff; }
.choice:hover { border-color: var(--navy); }
.choice:has(input:checked) { border-color: var(--navy); background: #eef4fa; box-shadow: inset 0 0 0 1px var(--navy); }
.choice input { accent-color: var(--navy); width: 18px; height: 18px; margin: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; margin-top: 3px; }
.btn { display: inline-block; border: 0; border-radius: var(--radius); padding: 10px 18px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; background: var(--navy); color: #fff; text-decoration: none; text-align: center; transition: background .15s; }
.btn:hover { background: var(--royal); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid #b9c1c7; }
.btn.secondary:hover { border-color: var(--navy); background: #f5f8fa; }
.btn.danger { background: var(--err); }
.btn.danger:hover { background: #861b1b; }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #166238; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn.big { padding: 14px 28px; font-size: 1rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--navy); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* ---------- Tables ---------- */
.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: .87rem; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f1f4f6; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--navy); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; background: #f1f4f6; color: var(--navy); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; background: var(--bg); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.err { background: var(--err-bg); color: var(--err); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: #eef1f3; display: block; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: var(--radius); padding: 14px 16px; }
.stat .v { font-size: 1.45rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: .78rem; font-weight: 500; }
.toggle-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 5px solid var(--navy); }
.toggle-panel .state { font-size: 1.3rem; font-weight: 700; }
.toggle-panel .state.open { color: var(--ok); }
.toggle-panel .state.closed { color: var(--grey); }

/* ---------- Printable gift cards & packing list ---------- */
.packing h2 { border-bottom: 2px solid var(--navy); padding-bottom: 4px; }
.packing .person { break-inside: avoid; margin-bottom: 22px; }
.code-mono { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .04em; }

/* ---------- Event QR ---------- */
.allowance-note { background: #e9f6fa; border-left: 4px solid var(--teal); color: var(--navy); padding: 10px 14px; border-radius: var(--radius); margin: 0 0 10px; font-size: .92rem; }
.qr-panel { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.qr-box { width: 220px; max-width: 100%; flex: none; }
.qr-box svg, .poster-qr svg { width: 100%; height: auto; display: block; }
.poster { max-width: 680px; margin: 0 auto; text-align: center; padding: 48px 40px 56px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  background-image: linear-gradient(150deg, transparent 0 88%, var(--teal) 88% 89.5%, var(--navy) 89.5%);
  -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.poster-logo { height: 72px; width: auto; margin-bottom: 28px; }
.poster-title { font-size: 2.6rem; font-weight: 700; color: var(--navy); line-height: 1.1; letter-spacing: -.02em; }
.poster-sub { font-size: 1.15rem; color: var(--muted); margin: 10px 0 24px; }
.poster-qr { width: 340px; max-width: 80%; margin: 0 auto; padding: 14px; border: 3px solid var(--navy); border-radius: 12px; }
.poster-steps { display: inline-block; text-align: left; margin: 26px auto 10px; padding-left: 26px; font-size: 1.15rem; font-weight: 600; color: var(--ink); line-height: 1.9; }
.poster-url { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; color: var(--royal); margin-top: 8px; }
.poster-deadline { margin-top: 14px; font-weight: 700; color: var(--navy); }

/* ---------- Printable vouchers: 8 per US letter sheet (2 × 4), cut on the dashed lines ---------- */
.voucher-page { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 2.55in; width: 7.8in; margin: 0 auto 28px; background: #fff; box-shadow: 0 4px 18px rgba(0, 30, 60, .12); }
.voucher {
  border: 1px dashed #9aa3aa; margin: -.5px; padding: .16in .2in .12in; display: flex; flex-direction: column; overflow: hidden;
  border-top: 4px solid var(--navy);
  background: linear-gradient(150deg, #fff 0 90%, var(--teal) 90% 91.5%, var(--navy) 91.5%);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.voucher-head { display: flex; justify-content: space-between; align-items: center; }
.voucher-logo { height: .32in; width: auto; }
.voucher-amt { font-size: 24pt; font-weight: 700; color: var(--navy); line-height: 1; }
.voucher-body { display: flex; gap: .14in; align-items: center; flex: 1; margin-top: .06in; }
.voucher-qr { width: 1.25in; flex: none; }
.voucher-qr svg { width: 100%; height: auto; display: block; }
.voucher-title { font-size: 10.5pt; font-weight: 700; color: var(--navy); line-height: 1.2; }
.voucher-for { font-size: 8.5pt; font-weight: 600; color: var(--royal); margin-top: 2px; }
.voucher-steps { margin: 5px 0 0; padding-left: 14px; font-size: 8pt; line-height: 1.45; color: var(--ink); }
.voucher-deadline { font-size: 7.5pt; font-weight: 700; color: var(--navy); margin-top: 4px; }
.voucher-foot { font-size: 6.5pt; color: var(--muted); padding-right: .35in; line-height: 1.3; }

@media print {
  @page { size: letter; margin: .35in; }
  .voucher-page { box-shadow: none; margin: 0 auto; break-after: page; }
  .voucher-page:last-child { break-after: auto; }
  .poster { border: 0; max-width: none; padding-top: 24px; }
  .location-group + .location-group { break-before: page; }
  .topbar, .statusbar, .footer, .no-print, .flash { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .table-wrap, .panel { border: 0; }
}
@media (max-width: 960px) {
  .hero { background: linear-gradient(150deg, var(--navy) 0 64%, var(--teal) 64% 66%, var(--royal) 66%); }
}
@media (max-width: 700px) {
  h1 { font-size: 1.35rem; }
  .topbar .wrap { justify-content: center; }
  .topbar .wrap { min-height: 0; padding-top: 18px; padding-bottom: 14px; }
  .brand img { height: 40px; }
  .brand-label { font-size: .78rem; padding-left: 22px; }
  .brand { gap: 22px; }
  .hero { background: linear-gradient(150deg, var(--navy) 0 72%, var(--teal) 72% 74%, var(--royal) 74%); }
  .hero .right { text-align: left; }
}
