/* PediGo Card · tarjeta del cliente y panel del local.
   Se apoya en compartido/css/plataforma.css (Azul PediGo + Crema, DejaVu Sans, radios de 12 px).
   --color es el color de cada local: pinta su tarjeta y sus botones. */
:root { --color: #304D70; }
body { min-height: 100svh; }
.oculto { display: none !important; }
.btn--color { background: var(--color); color: #fff; }
.btn--lg { height: 50px; font-size: 1rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .82rem; color: var(--muted); margin: 2px 0 18px; }
.check input { margin-top: 3px; accent-color: var(--navy); }

/* ===== tarjeta del cliente ===== */
.app { width: min(460px, 100%); margin: 0 auto; padding: 18px 16px 32px; }
.cab { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cab__logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--color); color: #fff; font-weight: 700; font-size: 1.15rem; flex: none; }
.cab b { display: block; font-size: 1.05rem; color: var(--navy-ink); }
.cab small { color: var(--muted); }
.caja { background: var(--card); border-radius: 16px; padding: 24px 20px; box-shadow: inset 0 0 0 1.5px var(--line); }
.caja h2 { font-size: 1.35rem; color: var(--navy); margin-bottom: 6px; }
.caja > p { margin: 0 0 18px; color: var(--muted); font-size: .92rem; }

.tarjeta { position: relative; border-radius: 18px; padding: 20px; color: #fff; background: var(--color); overflow: hidden; }
.tarjeta::before { content: ""; position: absolute; inset: 0; background: radial-gradient(110% 70% at 100% 0%, rgba(255, 255, 255, .16), transparent 60%); pointer-events: none; }
.tarjeta > * { position: relative; }
.tarjeta__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tarjeta__tipo { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.tarjeta__local { font-weight: 700; font-size: 1.15rem; }
.tarjeta__nombre { font-size: .88rem; opacity: .9; }
.sellos { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 10px; margin: 20px 0 16px; }
.sello { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, .45); display: grid; place-items: center; }
.sello svg { width: 55%; height: 55%; stroke: var(--color); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.sello.is-lleno { background: var(--crema); border: 2px solid var(--crema); }
.sello.is-lleno svg { opacity: 1; transform: none; }
.sello.is-nuevo { animation: golpe .5s ease; }
/* sellos con premio: regalo mientras no se llega */
.sello.is-premio { border-style: solid; border-color: var(--crema); }
.sello .regalo { stroke: var(--crema); stroke-width: 1.8; opacity: 1; transform: none; }
.sello.is-premio.is-lleno { box-shadow: 0 0 0 3px rgba(245, 231, 206, .35); }

/* lista de premios */
.premios { list-style: none; padding: 0; margin: 12px 0 0; background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--line); }
.premios li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.premios li:last-child { border-bottom: 0; }
.premios__n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; font-size: .85rem; background: var(--bg); color: var(--navy); }
.premios li div { flex: 1; min-width: 0; }
.premios b { display: block; color: var(--navy-ink); font-size: .92rem; }
.premios small { color: var(--muted); font-size: .76rem; }
.premios em { font-style: normal; font-weight: 700; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.premios .is-listo .premios__n { background: var(--ok); color: #fff; }
.premios .is-listo em { color: var(--ok); }
.premios .is-canjeado { opacity: .55; }
.premios .is-canjeado b { text-decoration: line-through; }
@keyframes golpe { 0% { transform: scale(1.35); } 100% { transform: none; } }
.tarjeta__estado { font-weight: 700; }
.tarjeta__premio { font-size: .84rem; opacity: .85; }
.tarjeta__marca { display: flex; justify-content: flex-end; margin-top: 14px; }
.tarjeta__marca img { height: 22px; width: auto; opacity: .85; }

.qr { margin-top: 12px; display: flex; align-items: center; gap: 16px; background: var(--card); border-radius: 16px; padding: 14px; box-shadow: inset 0 0 0 1.5px var(--line); }
.qr__img { width: 108px; height: 108px; flex: none; padding: 4px; background: #fff; }
.qr__img img, .qr__img canvas { width: 100% !important; height: 100% !important; display: block; }
.qr b { display: block; font-size: 1.5rem; letter-spacing: .14em; color: var(--navy); }
.qr small { color: var(--muted); display: block; font-size: .8rem; }
.acciones { display: grid; gap: 10px; margin-top: 14px; }
.aviso { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-size: .86rem; color: var(--muted); }
.aviso b { color: var(--navy); }
.aviso ol { margin: 8px 0 0; padding-left: 20px; }
.pie-card { margin-top: 26px; display: grid; justify-items: center; gap: 6px; text-align: center; font-size: .76rem; color: var(--muted); }
.pie-card img { height: 30px; width: auto; }
.pie-card a { color: inherit; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, calc(100% + 40px)); background: var(--navy-ink); color: var(--crema); padding: 13px 18px; border-radius: 12px; font-weight: 700; font-size: .9rem; transition: transform .35s cubic-bezier(.2, .8, .2, 1); z-index: 50; width: max-content; max-width: calc(100% - 32px); }
.toast.is-on { transform: translate(-50%, 0); }

/* ===== panel del local (misma estructura que el panel de PediGo) ===== */
.app-panel { display: grid; grid-template-columns: 230px 1fr; min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; background: var(--navy-deep); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; gap: 22px; }
.side__logo { display: flex; align-items: center; gap: 8px; margin: 0 8px; }
.side__logo img { width: 128px; height: auto; display: block; }
.side__logo span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--crema); color: var(--navy); }
.side__comercio { margin: -8px 10px 0; padding: 10px 12px; border-radius: 12px; background: rgba(245, 231, 206, .08); display: grid; gap: 2px; }
.side__comercio b { font-size: .92rem; color: var(--crema); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__comercio span { font-size: .72rem; color: rgba(245, 231, 206, .7); }
.nav { display: grid; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; font-weight: 600; color: rgba(255, 255, 255, .72); text-align: left; }
.nav button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.is-on { background: var(--crema); color: var(--navy); }
.side__foot { margin-top: auto; display: grid; gap: 6px; }
.side__link { padding: 10px 12px; border-radius: 10px; color: rgba(255, 255, 255, .7); font-size: .85rem; font-weight: 600; text-decoration: none; }
.side__link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.main { min-width: 0; padding: 0 28px 60px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 22px 0 16px; }
.top h1 { font-size: 1.8rem; font-weight: 900; color: var(--navy); }
.banner--alerta { background: #FDE7E7 !important; color: #8A1F1F !important; }
.banner a { color: inherit; font-weight: 700; }
.banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: #FFF4DA; color: #6B4A00; font-size: .86rem; font-weight: 600; }
.grid-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.camara { position: relative; aspect-ratio: 1; width: min(100%, 340px); margin: 0 auto; border-radius: 14px; overflow: hidden; background: var(--navy-ink); display: grid; place-items: center; color: rgba(245, 231, 206, .7); text-align: center; padding: 20px; }
.camara video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camara::after { content: ""; position: absolute; inset: 18%; border: 3px solid var(--crema); border-radius: 14px; pointer-events: none; }
.fila { display: flex; gap: 8px; margin-top: 12px; }
.fila .in { flex: 1; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.ficha h3 { font-size: 1.3rem; color: var(--navy); }
.ficha .sellos { --cols: 8; gap: 6px; margin: 14px 0; }
.ficha .sello { border-color: var(--line); }
.ficha .sello.is-lleno { background: var(--color); border-color: var(--color); }
.ficha .sello svg { stroke: #fff; }
.ficha .sello.is-premio { border-color: var(--color); }
.ficha .sello .regalo { stroke: var(--color); }
.ficha .premios { margin-top: 14px; }
.ficha .premios .btn { flex: none; }
/* editor de premios (ajustes) */
.premios-ed { display: grid; gap: 8px; margin: 4px 0 8px; font-weight: 400; }
.premios-ed__fila { display: grid; grid-template-columns: 150px 1fr 42px; gap: 8px; align-items: center; }
.premios-ed__fijo { height: 46px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--r); background: var(--crema); color: var(--navy); font-weight: 700; font-size: .85rem; }
.premios-ed__fila .btn { height: 46px; padding: 0; }
@media (max-width: 480px) { .premios-ed__fila { grid-template-columns: 1fr 42px; } .premios-ed__fila .in[data-k=premio] { grid-column: 1; grid-row: 2; } .premios-ed__fila > :first-child { grid-column: 1; } }
.ficha .acciones { grid-template-columns: 1fr 1fr; }
.lista { list-style: none; padding: 0; margin: 0; }
.lista li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.lista li:last-child { border-bottom: 0; }
.lista b { color: var(--navy-ink); }
.lista small { color: var(--muted); }
.pill { display: inline-block; background: var(--bg); color: var(--navy); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.pill--ok { background: var(--ok); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stats div { background: var(--card); border-radius: 14px; padding: 16px; box-shadow: inset 0 0 0 1.5px var(--line); }
.stats b { display: block; font-size: 1.6rem; color: var(--navy); }
.stats small { color: var(--muted); }
.cartel { text-align: center; }
.cartel__hoja { border: 2px dashed var(--line); border-radius: 16px; padding: 28px 20px; }
.cartel__hoja h3 { font-size: 1.5rem; color: var(--navy); margin: 12px 0 6px; }
.cartel__qr { width: 200px; height: 200px; margin: 18px auto; }
.cartel__qr img, .cartel__qr canvas { width: 100% !important; height: 100% !important; display: block; }
.cartel__marca { height: 34px; width: auto; margin-top: 8px; }
.color-fila { display: flex; gap: 8px; flex-wrap: wrap; }
.color-fila button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.color-fila button.is-on { box-shadow: 0 0 0 2.5px var(--navy); }

/* acceso al panel (como el ingreso del panel de PediGo) */
.acceso { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy); }
.acceso__caja { width: min(100%, 420px); background: var(--navy-deep); border-radius: 16px; padding: 30px 26px; color: var(--crema); }
.acceso__logo { justify-content: center; margin: 0 0 18px; }
.acceso__logo img { width: 170px; }
.acceso h1 { font-size: 1.45rem; text-align: center; margin-bottom: 6px; }
.acceso form > p { margin: 0 0 16px; text-align: center; font-size: .9rem; color: rgba(245, 231, 206, .78); }
.acceso a { color: var(--crema); font-weight: 700; }
.acceso .field { color: var(--crema); }
.acceso .field small { color: rgba(245, 231, 206, .7); }
.acceso .field input, .acceso .field select { color: var(--ink); }
.acceso__btn { background: var(--crema); color: var(--navy); margin-top: 4px; }
.acceso .acceso__alt { margin: 14px 0 0; font-size: .85rem; }
.side__cuenta { font-weight: 400; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 860px) {
  .app-panel { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; gap: 10px; }
  .side__comercio, .side__foot { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; width: 100%; }
  .nav button { padding: 9px 12px; font-size: .88rem; }
  .main { padding: 0 16px 50px; }
  .top h1 { font-size: 1.45rem; }
  .grid-panel { grid-template-columns: 1fr; }
}
@media print { body * { visibility: hidden; } .cartel__hoja, .cartel__hoja * { visibility: visible; } .cartel__hoja { position: fixed; inset: 0; border: 0; } }
