:root {
  --ink: #1F2623; --ink2: #31403A; --cream: #FFF8F1; --card: #FFFFFF; --warm: #F4E7D8;
  --line: #E6D6C3; --line2: #F1E4D5; --orange: #E37B3D; --green: #2F6B4F; --green-bg: #E4F0E8;
  --red: #A33A2A; --red-bg: #F7E1DC; --amber: #8A5A12; --amber-bg: #FBEFD9; --muted: #626963;
  --disp: 'Archivo', 'Lato', sans-serif; --body: 'Lato', 'Helvetica Neue', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--disp); margin: 0; letter-spacing: 0; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
a { color: inherit; }

/* Shell */
.top { background: var(--ink); color: var(--cream); display: flex; align-items: center; gap: 18px; padding: 0 24px; min-height: 60px; }
.brand { font: 800 18px var(--disp); display: flex; align-items: center; gap: 10px; }
.brand b { background: var(--orange); color: var(--ink); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab { background: none; border: 0; color: #cfd6d2; padding: 8px 12px; border-radius: 8px; font-weight: 900; }
.tab[aria-current="true"] { background: var(--ink2); color: #fff; }
.me { background: none; border: 1px solid #56635d; color: var(--cream); border-radius: 999px; padding: 6px 12px; font-weight: 900; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 60px; display: grid; gap: 18px; }

/* Blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.empty { color: var(--muted); padding: 22px; text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.grid > * { min-width: 0; }
.grid { align-items: start; }
.back { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 900; justify-self: start; text-align: left; }
.date-link { color: var(--ink); font-weight: 900; max-width: 280px; min-width: 160px; }

/* Buttons & fields */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 9px; border: 1px solid var(--ink); background: transparent; padding: 0 14px; font-weight: 900; white-space: nowrap; }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: grid; gap: 4px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fff; min-height: 38px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); }
textarea { min-height: 90px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: end; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
td input, td select { min-height: 32px; padding: 4px 8px; min-width: 70px; }
td select { min-width: 105px; }
input[type=checkbox], input[type=radio] { width: auto; min-height: auto; margin: 0; }
tr.off td { opacity: .5; }

/* Status */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 900; background: var(--warm); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.alert { border-radius: 10px; padding: 10px 14px; font-weight: 700; }
.alert.red { background: var(--red-bg); color: var(--red); }
.alert.green { background: var(--green-bg); color: var(--green); }
.alert.amber { background: var(--amber-bg); color: var(--amber); }
.big { font: 800 30px var(--disp); }
.notes { white-space: pre-line; }
.attendees { margin-top: 6px; display: grid; gap: 2px; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 12px; }
.product-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
details.card > summary { cursor: pointer; }
.bar { height: 8px; background: var(--line2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }
.bar i.full { background: var(--red); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--cream); padding: 12px 18px; border-radius: 12px; font-weight: 900; z-index: 10; max-width: calc(100% - 32px); }
.toast.bad { background: var(--red); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); display: grid; gap: 14px; }

/* What's On */
.tab-light { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-weight: 900; }
.tab-light[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.chip-link { background: none; border: 0; padding: 2px 4px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; }
.chip-link[aria-current="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.event-tile { padding: 0; overflow: hidden; text-align: left; display: grid; }
.event-thumb { position: relative; display: block; aspect-ratio: 2 / 1; background: var(--warm); }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-weight: 700; }
.event-date, .site-date { position: absolute; left: 10px; top: 10px; background: var(--card); border-radius: 10px; padding: 4px 10px; text-align: center; font-size: 12px; font-weight: 900; text-transform: uppercase; line-height: 1.1; }
.event-date b, .site-date b { display: block; font: 800 20px var(--disp); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.preview-col { position: sticky; top: 16px; }
.site-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.site-band { position: relative; aspect-ratio: 2 / 1; background: var(--warm); }
.site-band img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-status { position: absolute; right: 10px; top: 10px; background: var(--ink); color: var(--cream); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 900; }
.site-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.site-cat { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; color: var(--orange); }
.site-title { font: 800 19px var(--disp); }
.site-blurb { font-size: 14px; line-height: 1.45; }
label.row { font-weight: 700; }
.indent { margin-left: 26px; }
.card-inset { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; background: var(--cream); }
.builder-row { flex-wrap: nowrap; }
.meta a { color: var(--copper, #9D572C); font-weight: 700; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .preview-col { position: static; order: -1; }
}
@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
}

/* door check-in */
.checkin { max-width: 560px; margin: 0 auto; }
.checkin-status { border-radius: 12px; padding: 18px; font: 800 24px var(--disp); text-align: center; background: var(--warm); }
.checkin-status.ready { background: var(--green-bg); color: var(--green); }
.checkin-status.ok { background: var(--green); color: #fff; }
.checkin-status.warn { background: var(--amber-bg); color: var(--amber); }
.checkin-status.bad { background: var(--red-bg); color: var(--red); font-size: 18px; }
.ticket-facts { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; margin: 0; }
.ticket-facts dt { font-size: 12px; font-weight: 900; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.ticket-facts dd { margin: 0; }
.big-btn { font-size: 18px; padding: 14px 28px; }
button.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
button.link:disabled { opacity: .5; cursor: default; }
.attendee { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* booking form */
.voucher { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--card); }
.voucher.bad { border-color: var(--red); background: var(--red-bg); }
.quote { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--cream); display: grid; gap: 6px; }
.quote:empty { display: none; }
.quote .total { border-top: 1px solid var(--line); padding-top: 6px; font-size: 18px; }
#voucherCode::placeholder { text-transform: none; }

/* bookings tab */
.chips { gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--cream); }
.date-card { cursor: pointer; }
.today { border-top: 4px solid var(--orange); }

@media print {
  header.top, .back, #bookSection, button, .btn { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* run sheet */
.big-date { font-size: 20px; font-weight: 800; }
.runsheet-stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.big.warn { color: var(--red); }
.big.amber-text { color: var(--amber); }
.allergy-box { border: 2px solid var(--red); background: var(--red-bg); border-radius: 10px; padding: 12px 16px; }
.allergy-box ul { margin: 6px 0 0; padding-left: 20px; }
.runsheet-table tr.has-allergy td { background: var(--red-bg); }
.runsheet-table .allergy { color: var(--red); font-weight: 900; }
.runsheet-table .tick { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 4px; text-align: center; font-weight: 900; line-height: 18px; }
@media print {
  .runsheet { border: 0; padding: 0; }
  .runsheet-table tr.has-allergy td, .allergy-box { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

th button.sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
th button.sort:hover { color: var(--ink); }

/* Guest details QR (a booking's details.html link, shown to the guest) */
.qr-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(31, 38, 35, .6); display: grid; place-items: center; padding: 16px; }
.qr-card { max-width: 420px; width: 100%; text-align: center; }
.qr-card .qr { width: min(100%, 300px); margin: 14px auto; background: #fff; padding: 10px; border-radius: 12px; }
.qr-card .qr svg { display: block; width: 100%; height: auto; }
