/* MyTicket: estilos partilhados por loja, painel e entradas. */
:root {
  --paper: #f3f4f8;
  --surface: #ffffff;
  --sunk: #e9ebf2;
  --ink: #151a2b;
  --muted: #5a6178;
  --line: #d9dce7;
  --accent: #2b3bd1;
  --accent-soft: #e6e8fb;
  --accent-ink: #ffffff;
  --stub: #f5c518;
  --ok: #0d7f49;
  --ok-soft: #e1f4ea;
  --bad: #be2b2b;
  --bad-soft: #fbe6e6;
  --warn: #9a5b00;
  --warn-soft: #fbefd9;
  --qr-bg: #ffffff;
  --f-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", Roboto, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e111a; --surface: #161a26; --sunk: #1d2232; --ink: #e8ebf4; --muted: #9ba3ba; --line: #2a3045;
    --accent: #8090ff; --accent-soft: #232a52; --accent-ink: #0e111a; --stub: #f5c518;
    --ok: #3fcf8b; --ok-soft: #12301f; --bad: #ff6f6f; --bad-soft: #3a1717; --warn: #f2b24a; --warn-soft: #3a2a10;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e111a; --surface: #161a26; --sunk: #1d2232; --ink: #e8ebf4; --muted: #9ba3ba; --line: #2a3045;
  --accent: #8090ff; --accent-soft: #232a52; --accent-ink: #0e111a; --stub: #f5c518;
  --ok: #3fcf8b; --ok-soft: #12301f; --bad: #ff6f6f; --bad-soft: #3a1717; --warn: #f2b24a; --warn-soft: #3a2a10;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.15; }
h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }

/* topo */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1240px; margin: 0 auto; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; }
.brand-mark { width: 30px; height: 22px; border-radius: 4px; background: var(--accent); position: relative; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); }
.brand-mark::before { left: -4px; } .brand-mark::after { right: -4px; }
.brand small { font-family: var(--f-mono); font-weight: 500; font-size: 0.7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.tabs { display: flex; gap: 4px; background: var(--sunk); padding: 4px; border-radius: 999px; }
.tab { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; color: var(--muted); }
.tab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.top-spacer { flex: 1; }

.wrap { max-width: 1240px; margin: 0 auto; padding-block: 24px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.note { background: var(--accent-soft); border-radius: var(--r); padding: 10px 14px; font-size: 0.88rem; margin-bottom: 20px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* botões e campos */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 0.85rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .inp { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
.field textarea { resize: vertical; min-height: 70px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 720px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.neutral { background: var(--sunk); color: var(--muted); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunk); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td input { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; background: var(--surface); width: 100%; min-width: 90px; }
.bar { height: 6px; background: var(--sunk); border-radius: 999px; overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* promotor */
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
.evlist { display: flex; flex-direction: column; gap: 6px; }
.evbtn { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.evbtn:hover { background: var(--surface); border-color: var(--line); }
.evbtn[aria-current="true"] { background: var(--surface); border-color: var(--accent); }
.evbtn strong { font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi b { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tipo-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.tipo-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* loja */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.evcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; }
.evcard:hover { border-color: var(--accent); }
.evcard-art { height: 120px; position: relative; overflow: hidden; }
.evcard-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.evcard-art span { position: absolute; z-index: 1; left: 16px; bottom: 12px; font-family: var(--f-display); font-weight: 700; font-size: 2.6rem; line-height: 1; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.evcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.hero { border-radius: var(--r); padding: 28px 24px; color: #fff; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.hero > * { position: relative; z-index: 1; }
.hero.has-banner { min-height: 260px; justify-content: flex-end; }
.hero .hero-banner { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.has-banner::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.7) 100%); }
.hero.has-banner > :not(.hero-banner) { z-index: 2; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); max-width: 22ch; }
.hero .back { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.18); color: #fff; border: 0; }
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 20px; }
@media (max-width: 900px) { .shop { grid-template-columns: minmax(0, 1fr); } }
.sessions { display: flex; gap: 8px; flex-wrap: wrap; }
.sesbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; text-align: left; display: flex; flex-direction: column; }
.sesbtn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.sesbtn b { font-family: var(--f-display); }
.ttype { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.ttype:last-child { border-bottom: 0; }
.ttype-price { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { border: 0; background: var(--sunk); width: 34px; height: 34px; cursor: pointer; font-size: 1.1rem; }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper span { width: 38px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.summary { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); }
.sumline { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; }
.sumtotal { display: flex; justify-content: space-between; font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; border-top: 1px solid var(--line); padding-top: 10px; }
.pay { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.pay label { border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; text-align: center; font-size: 0.82rem; font-weight: 500; cursor: pointer; }
.pay input { position: absolute; opacity: 0; pointer-events: none; }
.pay label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.err { color: var(--bad); font-size: 0.85rem; }

.browser { display: flex; align-items: center; gap: 10px; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px 6px 12px; margin-bottom: 20px; flex-wrap: wrap; }
.browser .dots { display: flex; gap: 5px; }
.browser .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.browser .url { flex: 1; min-width: 0; background: var(--surface); border-radius: 6px; padding: 5px 10px; font-size: 0.85rem; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; }
.lock { width: 9px; height: 7px; background: var(--ok); border-radius: 1px; position: relative; margin-top: 4px; flex: 0 0 auto; }
.lock::before { content: ""; position: absolute; left: 1px; top: -5px; width: 7px; height: 7px; border: 1.5px solid var(--ok); border-bottom: 0; border-radius: 4px 4px 0 0; box-sizing: border-box; }
.brandhead { display: flex; gap: 18px; align-items: center; padding: 22px; border-radius: var(--r); background: var(--brand); color: #fff; margin-bottom: 22px; }
.brandhead p { opacity: .9; }
.brandmark.logo { object-fit: contain; background: #fff; padding: 6px; }
.brandmark { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; letter-spacing: .04em; }

/* bilhete */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.ticket-main { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; border-right: 2px dashed var(--line); }
.ticket-stub { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ticket::before, .ticket::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); right: calc(var(--stubw, 160px) - 9px); }
.ticket::before { top: -10px; clip-path: inset(50% 0 0 0); }
.ticket::after { bottom: -10px; clip-path: inset(0 0 50% 0); }
.qr { background: var(--qr-bg); padding: 8px; border-radius: 6px; width: 132px; height: 132px; display: grid; place-items: center; }
.qr img, .qr canvas { width: 116px !important; height: 116px !important; }
.ticket-code { font-family: var(--f-mono); font-weight: 600; font-size: 0.85rem; letter-spacing: .04em; }
.ticket .tname { font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; }
.tag-type { align-self: flex-start; background: var(--stub); color: #1d1600; font-weight: 700; font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 460px) {
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .ticket-main { border-right: 0; border-bottom: 2px dashed var(--line); }
  .ticket::before, .ticket::after { display: none; }
}

/* entradas */
.gate { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .gate { grid-template-columns: minmax(0, 1fr); } }
.scan { display: flex; gap: 8px; }
.scan input { flex: 1; font-family: var(--f-mono); font-size: 1.15rem; letter-spacing: .05em; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 0; text-transform: uppercase; }
.scan input:focus { border-color: var(--accent); outline: none; }
.result { border-radius: 14px; padding: 26px 22px; display: flex; gap: 18px; align-items: center; min-height: 150px; border: 2px solid transparent; }
.result .glyph { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; font-weight: 700; color: var(--surface); }
.result h2 { font-size: 1.8rem; font-weight: 700; }
.result.idle { background: var(--sunk); border-color: var(--line); border-style: dashed; }
.result.idle .glyph { background: var(--line); color: var(--muted); }
.result.ok { background: var(--ok-soft); border-color: var(--ok); }
.result.ok .glyph { background: var(--ok); }
.result.ok h2 { color: var(--ok); }
.result.bad { background: var(--bad-soft); border-color: var(--bad); }
.result.bad .glyph { background: var(--bad); }
.result.bad h2 { color: var(--bad); }
.result.warn { background: var(--warn-soft); border-color: var(--warn); }
.result.warn .glyph { background: var(--warn); }
.result.warn h2 { color: var(--warn); }
@media (prefers-reduced-motion: no-preference) { .result.flash { animation: pop .28s ease-out; } }
@keyframes pop { from { transform: scale(.97); } to { transform: scale(1); } }
.big-count { font-family: var(--f-display); font-weight: 700; font-size: 2.4rem; font-variant-numeric: tabular-nums; line-height: 1; }
.log { display: flex; flex-direction: column; }
.log-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 0.88rem; }
.log-item:last-child { border-bottom: 0; }
.testlist { display: flex; flex-wrap: wrap; gap: 6px; }
.testlist button { font-family: var(--f-mono); font-size: 0.78rem; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: 0.9rem; z-index: 20; max-width: calc(100% - 32px); }

/* plataforma */
a { color: var(--accent); }
.top a.brand { color: var(--ink); text-decoration: none; }
.navlinks { display: flex; gap: 4px; flex-wrap: wrap; }
.navlinks a { padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
.navlinks a[aria-current="page"] { background: var(--sunk); color: var(--ink); }
.flash { border-radius: var(--r); padding: 10px 14px; margin-bottom: 18px; font-size: 0.92rem; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.bad { background: var(--bad-soft); color: var(--bad); }
.flash ul { margin: 0; padding-left: 18px; }
.inline { display: inline; }
.store-top { background: var(--brand, var(--surface)); color: #fff; }
.store-top .top-in { padding-block: 14px; }
.store-top .store-name { display: inline-flex; align-items: center; gap: 10px; }
.store-top .store-name img { width: 32px; height: 32px; border-radius: 50%; object-fit: contain; background: #fff; padding: 2px; }
.store-top a { color: #fff; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; }
.imgfield-preview { max-width: 100%; max-height: 160px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; align-self: flex-start; }
.imgfield-preview.logo { width: 96px; height: 96px; object-fit: contain; background: #fff; }
.footer { color: var(--muted); font-size: 0.82rem; padding-block: 24px; text-align: center; }
.auth { max-width: 400px; margin: 8vh auto 0; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.ttype select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); font-variant-numeric: tabular-nums; }
.cam { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam::after { content: ""; position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.stat-list { display: grid; gap: 6px; }
.evrow { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.evrow:last-child { border-bottom: 0; }
@media (max-width: 720px) { .evrow { grid-template-columns: minmax(0, 1fr) auto; } .evrow .hide-sm { display: none; } }
.code-block { font-family: var(--f-mono); background: var(--sunk); border-radius: 8px; padding: 10px 12px; font-size: 0.85rem; overflow-x: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.qr svg { width: 116px; height: 116px; display: block; }
