@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  --bg: #efe7dd;
  --paper: #fbf7f2;
  --ink: #4a3829;
  --ink-2: #6d5f53;
  --gold: #ad8a5f;
  --gold-2: #c3a985;
  --line: #d6ccc1;
  --ok: #3f7d4f;
  --bad: #a3402e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Quicksand', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; margin: 0 0 .4em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
.wrap { max-width: 520px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.wide { max-width: 960px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand img { height: 56px; }
.brand .t1 { font-family: 'DM Serif Display', serif; font-size: 1.6rem; line-height: 1; }
.brand .t2 { color: var(--ink-2); font-size: .9rem; letter-spacing: .15em; text-transform: uppercase; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(74, 56, 41, .06);
}
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .95rem; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-2); border-color: var(--gold); }
textarea { min-height: 110px; resize: vertical; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700;
  padding: 13px 18px;
  border-radius: 14px;
  border: 0;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
button:disabled { opacity: .5; cursor: default; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-big { font-size: 1.2rem; padding: 18px; }
.btn-light { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-gold { background: var(--gold); }
.btn-ok { background: var(--ok); }
.btn-small { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.muted { color: var(--ink-2); font-size: .92rem; }
.error { color: var(--bad); font-weight: 600; margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.hidden { display: none !important; }
.center { text-align: center; }

/* Sellos */
.stamps { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin: 16px 0 8px; }
.stamp { min-width: 0; overflow: visible;
  aspect-ratio: 1; border-radius: 50%;
  border: 2px dashed var(--gold-2);
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-weight: 700; color: var(--gold-2); font-size: .95rem; position: relative; background: #fff;
}
.stamp.on { border: 2px solid var(--ink); background: var(--ink); color: #fff; }
.stamp.on img { filter: brightness(0) invert(1); }
.stamp img { height: 58%; opacity: .95; }
.stamp.reward { border-color: var(--gold); border-style: solid; background: #f6eadb; color: var(--gold); }
.stamp.reward.on { background: var(--gold); color: #fff; border-color: var(--gold); }
.stamp.next { box-shadow: 0 0 0 4px rgba(173, 138, 95, .35); }
.stamp .tag { position: absolute; bottom: -4px; font-size: .6rem; background: var(--gold); color: #fff; padding: 1px 6px; border-radius: 8px; white-space: nowrap; }
.legend { list-style: none; padding: 0; margin: 10px 0 0; }
.legend li { padding: 6px 0; border-top: 1px dashed var(--line); display: flex; gap: 10px; }
.legend li b { min-width: 74px; color: var(--gold); }

.callout { background: var(--gold); color: #fff; border-radius: 14px; padding: 14px 16px; font-weight: 700; font-size: 1.15rem; margin: 12px 0; }
.callout small { display: block; font-weight: 500; font-size: .9rem; opacity: .9; }
.callout.soft { background: #f6eadb; color: var(--ink); }

.qr { display: flex; justify-content: center; padding: 10px; background: #fff; border-radius: 14px; }
.qr svg, .qr img { width: 220px; height: 220px; }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 4px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.list li:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 600;
  max-width: 92vw; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); z-index: 50;
}
.toast.ok { background: var(--ok); }
.toast.bad { background: var(--bad); }

video#cam { width: 100%; border-radius: 14px; background: #000; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpi .v { font-family: 'DM Serif Display', serif; font-size: 1.8rem; }
.kpi .l { color: var(--ink-2); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td input, td select { padding: 8px 10px; }
