:root {
  --bg: #F4F3F8; --panel: #FFFFFF; --ink: #2A2A38; --ink-soft: #6B6B7D; --line: #E3E1EC;
  --primary: #5A6B94; --primary-deep: #414F72; --primary-tint: #E6E9F3;
  --accent: #B87F93; --accent-tint: #F5E7EC; --accent-deep: #8C5468;
  --ok: #5C8567; --ok-tint: #E6EFE7;
  --warn: #BD8B4A; --warn-tint: #F5EBDB;
  --danger: #A85D6B; --danger-tint: #F3E4E8;
  --shadow: 0 1px 2px rgba(42,42,56,0.06), 0 8px 24px rgba(42,42,56,0.06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; min-height: 100vh; -webkit-font-smoothing: antialiased; }
.display { font-family: 'Fraunces', Georgia, serif; }

.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.authbox { width: 100%; max-width: 380px; text-align: center; }
.authbox input, .authbox select { text-align: left; }
.authbox h1 { font-size: 24px; font-weight: 600; margin: 0 0 4px; }
.authbox input, .authbox select { width: 100%; font-family: inherit; font-size: 14px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); margin-bottom: 10px; }
.errortext { color: var(--danger); font-size: 13px; min-height: 18px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h2 { font-weight: 500; font-size: 17px; margin: 0 0 4px; }
.panel .hint { color: var(--ink-soft); font-size: 13px; margin: 0 0 16px; }

.app { max-width: 1180px; margin: 0 auto; padding: 28px 20px 60px; }
header.top { margin-bottom: 22px; }
.logo-row { text-align: center; margin-bottom: 14px; }
.logo-header { height: 56px; width: auto; border-radius: 8px; }
.headerrow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand .mark { font-weight: 600; font-size: 20px; }
.eventname { font-family: 'Fraunces', serif; font-weight: 600; font-size: 20px; color: var(--accent-deep); }
.eventreveal { color: var(--ink-soft); font-size: 13px; }
.logo { height: 34px; width: auto; border-radius: 6px; }
.logo-big { width: 100%; max-width: 220px; height: auto; display: block; margin: 0 auto 14px; border-radius: 8px; }
.topright { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doorstoggle { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }

nav.tabs { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 22px; box-shadow: var(--shadow); }
nav.tabs button { appearance: none; border: none; background: transparent; color: var(--ink-soft); font-family: inherit; font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 9px; cursor: pointer; }
nav.tabs button.active { background: var(--primary); color: white; }

.view { display: none; }
.view.active { display: block; }
.grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.searchbox { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbox input { flex: 1; font-family: inherit; font-size: 15px; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.scanbtn { border: 1px solid var(--primary); background: var(--primary-tint); color: var(--primary-deep); border-radius: 10px; padding: 0 14px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }

.results { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-bottom: 4px; }
.result-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; border: 1px solid transparent; }
.result-row:hover { background: var(--bg); }
.result-row.selected { border-color: var(--primary); background: var(--primary-tint); }
.result-row .rname { font-weight: 600; }
.result-row .rmeta { color: var(--ink-soft); font-size: 12.5px; }

.status-chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.chip-pending { background: var(--warn-tint); color: var(--warn); }
.chip-arrived { background: var(--ok-tint); color: var(--ok); }
.chip-noshow { background: var(--danger-tint); color: var(--danger); }

.guestcard { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 16px; }
.guestcard .gname { font-family: 'Fraunces', serif; font-size: 21px; font-weight: 600; margin-bottom: 2px; }
.guestcard .gmeta { color: var(--ink-soft); font-size: 14px; margin-bottom: 14px; }
.guestcard .gmeta b { color: var(--ink); }
.notefield { margin-bottom: 12px; }
.notefield label { display: block; font-size: 12px; color: var(--ink-soft); font-weight: 600; margin-bottom: 5px; }
.notefield input { width: 100%; font-family: inherit; font-size: 13.5px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.hh-member { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn { font-family: inherit; font-size: 14px; font-weight: 600; padding: 11px 16px; border-radius: 10px; border: none; cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-confirm { background: var(--ok); color: white; }
.btn-noshow { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-primary { background: var(--primary); color: white; }
.btn-ghost { background: transparent; color: var(--primary-deep); border: 1px solid var(--primary); }
.btn-sm { font-size: 12.5px; padding: 7px 11px; border-radius: 8px; }

.empty-note { color: var(--ink-soft); font-size: 13.5px; padding: 10px 2px; }

.tableboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tabletile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 11px; background: var(--bg); }
.tabletile .tnum { font-family: 'Fraunces', serif; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.tabletile .tfill { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 600; line-height: 1; }
.tabletile .tcap { font-size: 12.5px; color: var(--ink-soft); }
.barwrap { height: 5px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.bar { height: 100%; background: var(--primary); border-radius: 4px; }
.tabletile .vacant-note { margin-top: 7px; font-size: 11.5px; color: var(--accent); font-weight: 600; }
.tabletile .releasebtn { margin-top: 9px; width: 100%; background: transparent; border: 1px dashed var(--line); color: var(--ink-soft); border-radius: 8px; padding: 6px 0; font-size: 11.5px; font-weight: 600; cursor: pointer; font-family: inherit; }

.seatlist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.seatrow { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 14px; flex-wrap: wrap; gap: 8px; }
.seatrow .stitle { font-weight: 600; }
.seatrow .ssub { color: var(--ink-soft); font-size: 12.5px; }
.seatrow .stag { font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-tint); padding: 3px 9px; border-radius: 999px; margin-left: 10px; white-space: nowrap; }
.seatrow .stag.buffer { color: var(--primary-deep); background: var(--primary-tint); }

.formrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.formrow .fld { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 130px; }
.formrow label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.formrow input, .formrow select { font-family: inherit; font-size: 14px; padding: 10px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.formrow .fld.grow { flex: 2; }

.log { margin-top: 20px; }
.logrow { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.logrow b { color: var(--ink); font-weight: 600; }

.importreport { margin-top: 12px; font-size: 12.5px; color: var(--ink-soft); white-space: pre-wrap; max-height: 160px; overflow-y: auto; }
.maprow { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13.5px; }
.maprow .maplabel { width: 110px; flex-shrink: 0; font-weight: 600; }
.maprow select { flex: 1; font-family: inherit; font-size: 13.5px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

.qrgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-top: 16px; }
.qrcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; font-size: 12px; }
.qrcard .qname { font-weight: 600; margin-top: 6px; }
.qrcard .qtable { color: var(--ink-soft); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; box-shadow: var(--shadow); z-index: 40; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.overlay { position: fixed; inset: 0; background: rgba(20,19,26,0.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.overlay.show { display: flex; }
.modal { background: var(--panel); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.modal h3 { font-weight: 600; font-size: 18px; margin: 0 0 4px; }
.modal p { color: var(--ink-soft); font-size: 13px; margin: 0 0 16px; }
.modal .fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.modal label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.modal input { font-family: inherit; font-size: 14px; padding: 10px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.modal .modalactions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.guestpage { max-width: 420px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.guestpage .tnum-big { font-family: 'Fraunces', serif; font-size: 64px; font-weight: 600; margin: 20px 0 6px; }
.guestpage .gname-big { font-size: 18px; color: var(--ink-soft); }
