/* ==========================================================
   listaVip — réplica fiel do visual do app Streamlit original
   (tema segue o sistema: claro/escuro, igual ao Streamlit)
   ========================================================== */
@font-face { font-family: "Source Sans"; font-weight: 100 900; font-style: normal; font-display: swap; src: url(fonts/SourceSans-Upright.woff2) format("woff2"); }
@font-face { font-family: "Source Sans"; font-weight: 100 900; font-style: italic; font-display: swap; src: url(fonts/SourceSans-Italic.woff2) format("woff2"); }
@font-face { font-family: "Source Code Pro"; font-weight: 100 900; font-style: normal; font-display: swap; src: url(fonts/SourceCode-Upright.woff2) format("woff2"); }

:root {
  --bg: #ffffff;
  --text: #31333f;
  --fade: rgba(49, 51, 63, 0.6);
  --sec: #f0f2f6;
  --sb-bg: #f0f2f6;
  --sb-input: #ffffff;
  --btn-bg: #ffffff;
  --border: rgba(49, 51, 63, 0.2);
  --border-soft: rgba(49, 51, 63, 0.1);
  --hr: rgba(49, 51, 63, 0.2);
  --code-bg: #f8f9fb;
  --df-head: #f8f9fb;
  --primary: #ff4b4b;
  --ok-bg: rgba(33, 195, 84, 0.1);   --ok-c: #158237;
  --warn-bg: rgba(255, 255, 18, 0.1); --warn-c: #926c05;
  --err-bg: rgba(255, 43, 43, 0.1);  --err-c: #bd4043;
  --info-bg: rgba(28, 131, 255, 0.1); --info-c: #0054a3;
  --overlay: rgba(49, 51, 63, 0.5);
  --chart1: #0068c9; --chart2: #83c9ff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117;
    --text: #fafafa;
    --fade: rgba(250, 250, 250, 0.6);
    --sec: #262730;
    --sb-bg: #262730;
    --sb-input: #0e1117;
    --btn-bg: #131720;
    --border: rgba(250, 250, 250, 0.2);
    --border-soft: rgba(250, 250, 250, 0.1);
    --hr: rgba(250, 250, 250, 0.2);
    --code-bg: #1a1c24;
    --df-head: #1a1c24;
    --ok-bg: rgba(61, 213, 109, 0.2);  --ok-c: #5ce488;
    --warn-bg: rgba(255, 255, 18, 0.2); --warn-c: #ffffc2;
    --err-bg: rgba(255, 108, 108, 0.2); --err-c: #ff6c6c;
    --info-bg: rgba(61, 157, 243, 0.2); --info-c: #3d9df3;
    --overlay: rgba(49, 51, 63, 0.6);
    --chart1: #83c9ff; --chart2: #0068c9;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Source Sans", sans-serif;
  font-size: 16px; line-height: 1.6; font-weight: 400;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: auto;
  overflow: hidden;
}
button, input, textarea, select { font-family: inherit; }
p { margin: 0; }
a { color: inherit; }

/* ---------------- estrutura ---------------- */
#app { display: flex; height: 100vh; height: 100dvh; width: 100%; }
#sidebar {
  flex: 0 0 300px; width: 300px; height: 100%;
  background: var(--sb-bg); position: relative; z-index: 999991;
  overflow-y: auto; overflow-x: hidden;
  padding: 0 20px;
}
#sidebar.collapsed { display: none; }
.sb-header { height: 60px; display: flex; justify-content: flex-end; align-items: flex-start; padding: 16px 10px 0 10px; }
.sb-user { padding: 16px 10px 96px 10px; display: flex; flex-direction: column; gap: 16px; }
#main {
  flex: 1 1 auto; height: 100%; overflow-y: auto; position: relative;
  background: var(--bg);
}
#main.festa {
  background-color: #06080e;
  background-size: contain; background-position: center center;
  background-repeat: no-repeat; background-attachment: fixed;
}
.block { padding: 96px 80px 160px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 735.98px) { .block { padding: 96px 16px 160px; } }
@media (max-width: 640px) {
  #main.festa { background-attachment: scroll; }
  #sidebar { position: fixed; left: 0; top: 0; bottom: 0; box-shadow: rgba(0,0,0,0.4) -32px 0 32px 32px; }
}
.header { position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 999990; pointer-events: none; }
.icon-btn {
  pointer-events: auto; width: 28px; height: 28px; border: 0; border-radius: 8px; padding: 0; margin: 0 2px;
  background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
#expandBtn { position: fixed; top: 16px; left: 16px; background-color: #ffffff !important; z-index: 999990; }
#collapseBtn { color: var(--fade); }
#collapseBtn:hover { background: rgba(151,166,195,0.15); color: var(--text); }
.spacer-48 { height: 32px; } /* 48 - gap(16) */
.spacer-64 { height: 49px; } /* 65 - gap(16) */

/* ---------------- tipografia ---------------- */
.st-title { font-size: 44px; font-weight: 700; line-height: 1.2; padding: 20px 0 16px; margin: 0 0 -16px; letter-spacing: -0.005em; }
.st-sb-title { font-size: 26px; font-weight: 600; line-height: 1.2; padding: 20px 0 16px; margin: 0 0 -16px; }
.st-sub { font-size: 28px; font-weight: 600; line-height: 1.2; padding: 12px 0 16px; margin: 0 0 -16px; }
.caption { font-size: 14px; color: var(--fade); line-height: 1.6; }
.md p { line-height: 1.6; }
.md strong { font-weight: 600; }
.hr { padding: 32px 0 16px; }
.hr hr { margin: 0; border: 0; border-bottom: 1px solid var(--hr); height: 0; }
.label { font-size: 14px; line-height: 1.6; margin-bottom: 4px; min-height: 22px; display: flex; justify-content: space-between; align-items: center; }
#sidebar .label { font-size: 16px; }

/* ---------------- botões ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 4px 12px; border-radius: 8px;
  font-size: 16px; line-height: 1.6; font-weight: 400; cursor: pointer;
  background: var(--btn-bg); color: var(--text); border: 1px solid var(--border);
  user-select: none; width: auto; max-width: 100%;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #ff3333; border-color: #ff3333; color: #fff; }
.btn.full { width: 100%; }
.btn p { font-size: 14px; margin: 0; }
.btn[disabled] { background: transparent; color: rgba(128,128,128,0.6); cursor: not-allowed; border-color: var(--border); }
@media (prefers-color-scheme: dark) { .btn[disabled] { color: rgba(250,250,250,0.4); } }
@media (prefers-color-scheme: light) { .btn[disabled] { color: rgba(49,51,63,0.4); } }
.btn[disabled]:hover { color: inherit; border-color: var(--border); }

/* botão "Copiar Lista completa!" (igual ao componente em iframe) */
.copy-wrap { height: 60px; }
.copy-btn {
  width: 100%; padding: 0.5rem 1rem; background: transparent; border-radius: 0.5rem;
  font-size: 1rem; line-height: 1.6; cursor: pointer;
  font-family: "Source Sans Pro", sans-serif;
  transition: border-color .2s, color .2s, opacity .2s;
  color: var(--text); border: 1px solid var(--text); opacity: .7;
}
.copy-btn:hover { border-color: #ff4b4b; color: #ff4b4b; opacity: 1; }

/* ---------------- inputs ---------------- */
.input-wrap {
  display: flex; align-items: center; background: var(--sec); border: 1px solid var(--sec);
  border-radius: 8px; height: 40px; overflow: hidden;
}
.input-wrap:focus-within { border-color: var(--primary); }
.input-wrap input {
  flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; color: var(--text);
  font-size: 14px; line-height: 1.4; padding: 8px 8px 8px 12px;
}
#sidebar .input-wrap { background: var(--sb-input); border-color: var(--sb-input); }
#sidebar .input-wrap:focus-within { border-color: var(--primary); }
#sidebar .input-wrap input { font-size: 16px; }
.input-wrap input::placeholder, textarea::placeholder { color: var(--fade); opacity: 1; }
.eye { background: transparent; border: 0; color: var(--text); width: 32px; height: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.eye svg { width: 16px; height: 16px; fill: currentColor; }
.ta-wrap { background: var(--sec); border: 1px solid var(--sec); border-radius: 8px; display: flex; }
.ta-wrap:focus-within { border-color: var(--primary); }
.ta-wrap textarea {
  width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); resize: vertical;
  font-size: 14px; line-height: 1.4; padding: 12px; height: 92px; min-height: 92px; display: block;
}

/* ---------------- alertas ---------------- */
.alert { border-radius: 8px; padding: 16px; font-size: 16px; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.alert .ic { width: 16px; flex: 0 0 16px; font-size: 14px; line-height: 24px; text-align: center; margin: 0 0 0 2px; }
.alert .tx { flex: 1; min-width: 0; padding-left: 0; }
.alert.success { background: var(--ok-bg); color: var(--ok-c); }
.alert.warning { background: var(--warn-bg); color: var(--warn-c); }
.alert.error { background: var(--err-bg); color: var(--err-c); }
.alert.info { background: var(--info-bg); color: var(--info-c); }
.alert strong { font-weight: 600; }

/* ---------------- colunas ---------------- */
.cols { display: flex; gap: 16px; width: 100%; align-items: flex-start; }
.cols > .col { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 640px) {
  .cols { flex-direction: column; align-items: stretch; }
  .cols > .col { width: 100% !important; flex: none !important; }
}

/* ---------------- métricas / progresso ---------------- */
.metric .m-label { font-size: 14px; line-height: 1.6; min-height: 24px; display: flex; align-items: center; }
.metric .m-value { font-size: 36px; line-height: normal; padding-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .m-delta {
  display: inline-flex; align-items: center; gap: 2px; font-size: 14px; border-radius: 9999px; padding: 2px 6px 2px 4px;
  background: var(--ok-bg); color: var(--ok-c); width: fit-content;
}
.metric .m-delta svg { width: 14px; height: 14px; fill: currentColor; }
.progress p { font-size: 14px; line-height: normal; margin-bottom: 8px; }
.progress .track { height: 8px; background: var(--sec); border-radius: 0; overflow: hidden; }
.progress .fill { height: 100%; background: rgb(28,131,225); }

/* ---------------- checkbox / radio ---------------- */
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 14px; line-height: 21px; user-select: none; width: fit-content; }
.check .box { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2.5px; border-radius: 4px; border: 1px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; }
.check .box svg { width: 12px; height: 12px; fill: #fff; display: none; }
.check.on .box { background: var(--primary); border-color: var(--primary); }
.check.on .box svg { display: block; }
.check.dis { cursor: not-allowed; }
.check-list { display: flex; flex-direction: column; gap: 19px; }
.radio-group { display: flex; flex-direction: column; }
.radio { display: flex; align-items: center; gap: 8px; cursor: pointer; line-height: 1.6; min-height: 25.6px; width: fit-content; user-select: none; }
.radio .dot { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg); display: flex; align-items: center; justify-content: center; }
#sidebar .radio .dot { background: var(--sb-bg); }
.radio.on .dot { background: var(--primary) !important; border-color: var(--primary); }
.radio.on .dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.radio-label { font-size: 14px; line-height: 1.6; margin-bottom: 4px; }
#sidebar .radio-label { font-size: 16px; }
.config-radio .radio { font-size: 14px; min-height: 22px; }

/* ---------------- dataframe ---------------- */
.df { border: 1px solid var(--border-soft); border-radius: 8px; overflow: auto; font-size: 14px; }
.df table { border-collapse: collapse; width: 100%; }
.df th, .df td { height: 35px; padding: 0 8px; text-align: left; white-space: nowrap; border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); font-weight: 400; }
.df th:last-child, .df td:last-child { border-right: 0; }
.df tr:last-child td { border-bottom: 0; }
.df th { color: var(--fade); background: var(--df-head); }
.df td.num { text-align: right; }

/* ---------------- expander / tabs ---------------- */
.expander { border: 1px solid var(--border); border-radius: 8px; }
.expander summary { list-style: none; padding: 4px 12px; min-height: 38px; display: flex; align-items: center; gap: 8px; cursor: pointer; border-radius: 8px; font-size: 14px; }
.expander summary::-webkit-details-marker { display: none; }
.expander summary svg { width: 16px; height: 16px; fill: currentColor; transition: transform .2s; transform: rotate(-90deg); }
.expander[open] summary svg { transform: rotate(0deg); }
.expander[open] summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.expander summary:hover { color: var(--primary); }
.expander .exp-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 16px; }
.tabs { display: flex; gap: 16px; border-bottom: 1px solid var(--hr); position: relative; }
.tab { background: transparent; border: 0; color: var(--text); font-size: 14px; line-height: 1.6; height: 40px; padding: 0; cursor: pointer; position: relative; }
.tab.on, .tab:hover { color: var(--primary); }
.tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); }
.tab-body { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.form-box { border: 1px solid var(--border); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* ---------------- slider ---------------- */
.slider { position: relative; height: 34px; padding: 0 6px; }
.slider .val { position: absolute; top: 0; font-size: 14px; color: var(--primary); transform: translateX(-50%); line-height: 1.6; }
.slider .rail { position: absolute; left: 6px; right: 6px; top: 24px; height: 4px; background: var(--sec); border-radius: 4px; }
.slider .rail .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 4px; }
.slider .thumb { position: absolute; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); transform: translateX(-50%); }
.slider input[type=range] { position: absolute; left: 0; right: 0; top: 12px; width: 100%; height: 28px; opacity: 0; cursor: pointer; margin: 0; }

/* ---------------- upload / câmera ---------------- */
.drop { background: var(--sec); border-radius: 8px; padding: 12px; display: flex; align-items: center; gap: 16px; }
.drop .btn { padding: 6px 12px; gap: 8px; font-size: 14px; }
.drop .btn svg { width: 16px; height: 16px; fill: currentColor; }
.drop small { font-size: 14px; color: var(--fade); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 4px 8px; font-size: 14px; }
.file-row .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fsize { color: var(--fade); }
.help { color: var(--fade); display: inline-flex; }
.help svg { width: 16px; height: 16px; fill: currentColor; }
.img-full { width: 100%; display: block; border-radius: 8px; }
.cam { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cam .view { background: var(--sec); aspect-ratio: 1.687; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; text-align: center; font-size: 16px; position: relative; }
.cam .view video, .cam .view img { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.cam .view svg { width: 32px; height: 32px; fill: var(--fade); }
.cam .view a { color: #3d9df3; font-size: 16px; }
.cam .shoot { width: 100%; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--text); height: 40px; font-size: 16px; cursor: pointer; }
.cam .shoot:hover { color: var(--primary); }
.cam .shoot[disabled] { color: var(--fade); cursor: not-allowed; }

/* resultados da leitura do QR (CSS original do app) */
.scan-result-ok { background: rgba(74,222,128,.15); border: 1px solid #4ade80; color: #4ade80; padding: 14px; border-radius: 10px; font-weight: 700; text-align: center; margin: 10px 0; }
.scan-result-warn { background: rgba(251,191,36,.15); border: 1px solid #f59e0b; color: #fef08a; padding: 14px; border-radius: 10px; font-weight: 700; text-align: center; margin: 10px 0; }
.scan-result-error { background: rgba(248,113,113,.15); border: 1px solid #f87171; color: #f87171; padding: 14px; border-radius: 10px; font-weight: 700; text-align: center; margin: 10px 0; }
.scan-result-ok strong, .scan-result-warn strong { font-weight: 700; }

/* ---------------- gráfico ---------------- */
.chart { position: relative; height: 330px; width: 100%; }

/* ---------------- código (st.code) ---------------- */
.code { position: relative; background: var(--code-bg); border-radius: 8px; }
.code pre { margin: 0; padding: 16px 0 16px 16px; overflow-x: auto; font-family: "Source Code Pro", monospace; font-size: 12px; line-height: 1.6; }
.code code { font-family: inherit; display: block; padding-right: 16px; font-size: 14px; line-height: 1.6; white-space: pre; }
.code code span { font-size: 16px; line-height: 1.6; }
.code .cp { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--fade); cursor: pointer; opacity: 0; display: flex; align-items: center; justify-content: center; }
.code:hover .cp, .code .cp.done, .code .cp:focus-visible { opacity: 1; }
.code .cp.done { color: #21c354; }
@media (hover: none) { .code .cp { opacity: 1; } }
.code .cp svg { width: 16px; height: 16px; fill: currentColor; }

/* ---------------- diálogo / toast / balões ---------------- */
.dialog-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 1000050; display: flex; justify-content: center; align-items: flex-start; padding: 48px 16px; overflow-y: auto; }
.dialog { width: 500px; max-width: 100%; background: var(--bg); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.2); position: relative; }
.dialog h2 { font-size: 24px; font-weight: 600; line-height: 1.2; margin: 0 0 8px; padding: 6px 0 0; }
.dialog .x { position: absolute; top: 20px; right: 20px; background: transparent; border: 0; color: var(--text); cursor: pointer; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.dialog .x svg { width: 20px; height: 20px; fill: currentColor; }
.dialog .row { display: flex; gap: 16px; align-items: flex-start; }
.dialog .row > div { min-width: 0; }
.toast-area { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000100; }
.toast { background: var(--sec); color: var(--text); padding: 16px; border-radius: 8px; box-shadow: rgba(0,0,0,.16) 0 4px 16px; font-size: 14px; display: flex; gap: 12px; align-items: center; min-width: 280px; max-width: 360px; animation: tin .3s ease; }
@keyframes tin { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.balloon { position: fixed; bottom: -160px; z-index: 1000200; pointer-events: none; animation: bup linear forwards; }
@keyframes bup { to { transform: translateY(calc(-100vh - 320px)); } }

/* ===========================================================
   CSS do app original (st.markdown <style>) — mantido igual
   =========================================================== */
.ticket-card{background:linear-gradient(135deg,#1e293b 0%,#0f172a 100%);border:2px dashed #3b82f6;border-radius:16px;padding:24px;color:#f8fafc;margin:20px 0;box-shadow:0 10px 25px -5px rgba(0,0,0,.3)}
.checkin-badge-ok{background:rgba(74,222,128,.15);border:1px solid #4ade80;color:#4ade80;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700}
.checkin-badge-pending{background:rgba(148,163,184,.15);border:1px solid #64748b;color:#94a3b8;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700}

/* Cartão 3D que "flutua" sobre o fundo da festa */
.guest_page_card {
  background: rgba(30, 41, 59, 0.275);
  backdrop-filter: blur(1px); -webkit-backdrop-filter: blur(1px);
  border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 28px 24px 20px 24px; margin: 14px auto 40px auto;
  width: 100%; max-width: 640px;
  transform: perspective(1400px) rotateX(1.2deg);
  box-shadow: 0 30px 60px -15px rgba(0,0,0,.65), 0 10px 25px -8px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04) inset;
  transition: transform .25s ease;
  display: flex; flex-direction: column; gap: 16px;
}
.guest_page_card:hover { transform: perspective(1400px) rotateX(0deg) translateY(-2px); }
.guest_page_card h1, .guest_page_card h2, .guest_page_card h3, .guest_page_card p,
.guest_page_card span, .guest_page_card label, .guest_page_card .md { color: #f8fafc !important; }
.guest_page_card .label p { color: #f8fafc !important; font-weight: 600; }
.guest_page_card .label { font-size: 16px; }
.guest_page_card .g-title { text-align: center; font-weight: 700; line-height: 1.2; padding: 20px 0 16px; margin: 0 0 -16px; }
.guest_page_card .g-sub { text-align: center; font-weight: bold; }
.guest_page_card .st-sub { line-height: 1.2; }
.guest_page_card ul { margin: 0; padding-left: 24px; }
.guest_page_card li { color: #f8fafc; }
/* Caixas claras dentro do cartão (código e botões): texto segue o tema, não fica branco sobre branco */
.guest_page_card .code span, .guest_page_card .btn p, .guest_page_card .btn span { color: var(--text) !important; }
.guest_page_card .btn.primary p, .guest_page_card .btn.primary span { color: #fff !important; }
@media (max-width: 640px) {
  .guest_page_card { transform: none; border-radius: 18px; padding: 20px 16px 14px 16px; }
  .guest_page_card:hover { transform: none; }
}
