:root {
  --coral: #FD6262;
  --coral-deep: #B83232;
  --coral-ink: #8F2424;
  --coral-tint: #FFE8E8;
  --coral-wash: #FFF1F1;
  --ink: #141414;
  --ink-2: #3A3A37;
  --mute: #5C5C58;
  --line: #D6D6D1;
  --line-2: #BDBDB7;
  --soft: #ECECE8;
  --ground: #F7F5F4;
  --white: #FFFFFF;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --display: 'Archivo', 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
h1 { font-size: 26px; } h2 { font-size: 16px; } h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--coral-deep); } a:hover { color: var(--coral-ink); }
button { font-family: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.app { min-height: 100vh; display: flex; flex-direction: column; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.note { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.stack-xs { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row-tight { display: flex; flex-wrap: wrap; gap: 8px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }

/* Top bar */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { height: 32px; width: auto; display: block; }
.brand .wordmark { height: 22px; width: auto; display: block; }
.vsep { width: 1px; height: 24px; background: var(--line); }
.product { font-family: var(--display); font-weight: 700; font-size: 16px; }
.chip { border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; text-transform: none; letter-spacing: 0; }
.topright { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.userchip { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.userchip small { display: block; color: var(--mute); font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--coral); color: var(--ink); font-weight: 700; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }

/* Buttons */
.btn { border-radius: 8px; padding: 0 16px; min-height: 44px; font-size: 14px; font-weight: 600; border: 1px solid var(--line-2); background: var(--white); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-primary { background: var(--coral); border-color: var(--coral); color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: #F04F4F; border-color: #F04F4F; }
.btn-secondary:hover:not(:disabled) { background: var(--ground); }
.btn-sm { padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-dashed { border: 1.5px dashed #8A8A85; }
.btn-link { background: transparent; border: 0; padding: 0; min-height: 44px; color: var(--coral-deep); font-weight: 600; font-size: inherit; }
.btn-link:hover { color: var(--coral-ink); text-decoration: underline; }
.btn-sso { width: 100%; justify-content: flex-start; padding-left: 14px; }
.btn-sso .logo-ph { width: 20px; height: 20px; border: 1.5px dashed #8A8A85; border-radius: 4px; flex: none; }
.btn-sso span.grow { flex: 1; text-align: center; margin-right: 34px; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--soft); border-radius: 10px; }
.seg button { border: 0; border-radius: 7px; padding: 0 14px; min-height: 44px; font-size: 13px; background: transparent; color: #4A4A47; font-weight: 500; }
.seg button.on { background: var(--white); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Shell */
.shell { display: flex; flex-wrap: wrap; flex: 1; align-items: stretch; }
.sidenav { flex: 1 1 220px; background: var(--white); border-right: 1px solid var(--line); padding: 20px 16px; display: flex; flex-direction: column; gap: 4px; }
.sidenav .org { font-weight: 600; padding: 4px 12px 16px; }
.sidenav .mono { padding: 0 12px; }
.sidenav button { text-align: left; border: 0; border-radius: 8px; padding: 0 12px; min-height: 44px; font-size: 14px; background: transparent; color: var(--ink-2); font-weight: 500; }
.sidenav button.on { background: var(--soft); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--coral); }
.sidenav .spacer { flex: 1; min-height: 24px; }
.sidenav .ph-note { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--mute); }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.buyer-shell { flex: 1; display: flex; justify-content: center; padding: 28px 24px 56px; }
.buyer-inner { width: 100%; max-width: 1120px; display: flex; flex-direction: column; gap: 20px; }

/* Cards & bits */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card.pad-lg { padding: 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 18px; }
.kpi .val { font-family: var(--display); font-size: 28px; font-weight: 700; }
.flex-1 { flex: 1 1 340px; }
.flex-14 { flex: 1.4 1 380px; }
.bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.bar.thin { height: 6px; }
.bar > div { height: 100%; background: var(--coral); }
.ph { position: relative; border: 1.5px dashed #A8A8A2; border-radius: 10px; background: var(--soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph svg line { vector-effect: non-scaling-stroke; stroke: #C4C4BE; stroke-width: 1; }
.ph > span, .ph > button { position: relative; }
.ph > span { font-family: var(--mono); font-size: 12px; color: var(--mute); background: var(--soft); padding: 4px 8px; }
.thumb { border: 1.5px dashed var(--line-2); border-radius: 8px; flex: none; }
.listrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--soft); }
.listrow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; }
.badge-live { background: var(--coral-tint); color: var(--coral-ink); }
.badge-draft { background: var(--white); color: #4A4A47; border: 1px dashed #8A8A85; }
.badge-ended { background: var(--soft); color: #4A4A47; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--white); border: 1.5px solid #8A8A85; }
.dot.on { background: var(--coral); border-color: var(--coral); }
.toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: var(--white); border-radius: 10px; padding: 10px 10px 10px 16px; }
.toast button { background: transparent; color: var(--white); border: 1px solid var(--mute); border-radius: 8px; padding: 0 14px; min-height: 44px; }

/* Tables (grid) */
.tablebox { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.trow { display: grid; grid-template-columns: var(--cols); gap: 12px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--soft); }
.trow.th { padding: 12px 20px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 32px 20px; text-align: center; color: var(--mute); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.input { height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--white); width: 100%; }
textarea.input { height: auto; padding: 12px; resize: vertical; }
select.input { padding: 0 10px; }
.input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--coral-tint); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.fgrid-lg { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 400; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--coral-deep); }
.radio-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.radio-card.on { border: 2px solid var(--coral); }
.radio-card input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--coral-deep); }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-size: 13px; font-weight: 600; padding: 0 0 10px; }
.typecard { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #FAFAF8; }
.typecard .f3 { flex: 3 1 200px; } .typecard .f1 { flex: 1 1 110px; } .typecard .f15 { flex: 1 1 150px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { flex: 1 1 200px; }
.steps button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border-radius: 10px; padding: 0 14px; min-height: 52px; font-size: 14px; background: var(--white); border: 1px solid var(--line); font-weight: 500; color: var(--ink-2); }
.steps button.on { border: 2px solid var(--coral); font-weight: 600; color: var(--ink); }
.num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; background: var(--soft); color: var(--ink-2); }
.num.on { background: var(--coral); color: var(--ink); }
.footer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--soft); padding-top: 18px; }

/* Check-in */
.viewfinder { position: relative; height: 280px; background: #2A2A28; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.viewfinder .frame { width: 170px; height: 170px; border: 2px dashed #8A8A85; border-radius: 12px; }
.viewfinder .cap { position: absolute; bottom: 14px; font-family: var(--mono); font-size: 12px; color: var(--line); }
.scan { display: flex; flex-direction: column; gap: 4px; border-radius: 10px; padding: 14px 16px; }
.scan.ok { background: var(--coral-tint); color: var(--coral-ink); border: 2px solid var(--coral); }
.scan.bad { background: var(--ink); color: var(--white); border: 2px solid var(--ink); }
.scan .who { font-size: 18px; font-weight: 700; }

/* Buyer */
.bsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
.bsteps li { display: flex; align-items: center; gap: 8px; color: #4A4A47; }
.bsteps li.on { color: var(--ink); font-weight: 600; }
.bsteps .num { width: 24px; height: 24px; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split .content { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.split .side { flex: 1 1 340px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.title-xl { font-size: 34px; line-height: 1.15; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--white); font-size: 18px; }
.stepper .qty { width: 24px; text-align: center; font-weight: 700; }
.hold { border: 1px solid #FFC9C9; background: var(--coral-wash); border-radius: 10px; padding: 8px 8px 8px 16px; }
.sumline { display: flex; justify-content: space-between; gap: 8px; }
.total { font-size: 18px; font-weight: 700; border-top: 1px solid var(--line); padding-top: 12px; }
.tick { width: 56px; height: 56px; border-radius: 50%; background: var(--coral); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.qr { position: relative; width: 112px; height: 112px; border: 1.5px dashed #8A8A85; border-radius: 8px; flex: none; }
.qr i { position: absolute; width: 24px; height: 24px; border: 3px solid var(--ink); }
.qr i:nth-child(1) { top: 10px; left: 10px; } .qr i:nth-child(2) { top: 10px; right: 10px; } .qr i:nth-child(3) { bottom: 10px; left: 10px; }
.qr span { position: absolute; bottom: 12px; right: 14px; font-family: var(--mono); font-size: 11px; color: var(--mute); }

/* Auth */
.auth { flex: 1; display: flex; flex-wrap: wrap; }
.auth-brand { position: relative; flex: 1 1 420px; background: var(--ink); color: var(--white); padding: 56px 48px; overflow: hidden; display: flex; align-items: center; }
.auth-brand .watermark { position: absolute; right: -30px; bottom: -40px; height: 230px; width: auto; opacity: .2; pointer-events: none; }
.auth-brand .inner { position: relative; max-width: 440px; display: flex; flex-direction: column; gap: 18px; }
.auth-brand .mono { color: #FFB0B0; }
.auth-brand h1 { font-size: 40px; line-height: 1.1; }
.auth-brand h1 em { font-style: normal; color: var(--coral); }
.auth-brand p { color: #D6D6D1; font-size: 16px; }
.ticks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: flex; align-items: center; gap: 10px; color: #EDEDEA; }
.ticks li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex: none; }
.auth-form-wrap { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h2 { font-size: 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 12px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.pw { position: relative; display: block; }
.pw .input { padding-right: 64px; }
.pw .btn-link { position: absolute; right: 12px; top: 0; font-size: 13px; }
.alert { border-radius: 8px; padding: 10px 12px; background: var(--coral-tint); color: var(--coral-ink); font-size: 13px; font-weight: 500; }
.demo { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.demo code { font-family: var(--mono); font-size: 12px; }
.auth-buyer { justify-content: center; padding: 40px 24px 56px; }
.buyer-auth { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 16px; }
.buyer-auth .auth-card { max-width: none; }
.event-mini { display: flex; align-items: center; gap: 14px; padding: 14px; }
.event-mini .ph { width: 72px; height: 54px; flex: none; }
.event-mini strong { font-family: var(--display); font-size: 16px; }

/* SSO overlay */
.overlay { position: fixed; inset: 0; background: rgba(20,20,20,.55); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10; }
.overlay .box { background: var(--white); border-radius: 14px; padding: 28px; max-width: 380px; width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--coral-tint); border-top-color: var(--coral); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media (max-width: 640px) {
  .main { padding: 20px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .auth-brand { padding: 40px 24px; }
  .auth-brand h1 { font-size: 30px; }
  .buyer-shell { padding: 20px 16px 40px; }
}
