:root {
  --bg: #0b1030;
  --surface: #141a44;
  --surface-2: #1c2458;
  --line: rgba(140, 160, 255, .16);
  --text: #eef1ff;
  --muted: #98a2d4;
  --accent: #5b8cff;
  --green: #2fd07a;
  --red: #ff5a6a;
  --gold: #ffc83d;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 16px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, #202a73, var(--bg) 60%); }
.login-box { width: min(340px, 100%); text-align: center; }
.login-logo { font-size: 54px; }
.login h1 { margin: 8px 0 4px; font-size: 26px; font-weight: 800; }
.login p { margin: 0; color: var(--muted); }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 26px 0; height: 16px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.pin-dots.err { animation: shake .4s; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-pad button { height: 64px; border-radius: 18px; background: var(--surface-2); font-size: 24px; font-weight: 600; transition: background .1s, transform .1s; }
.pin-pad button:active { background: var(--accent); transform: scale(.96); }
.pin-pad .ghost { background: transparent; font-size: 18px; color: var(--muted); }
.login-err { color: var(--red) !important; min-height: 22px; margin-top: 14px !important; font-weight: 600; }

/* shell */
.shell { min-height: 100vh; padding-bottom: calc(76px + var(--safe-b)); }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: rgba(11, 16, 48, .9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.kid { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kid-avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, #3d5bff, #b14cff); }
.kid-name { font-weight: 700; font-size: 17px; }
.kid-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kid-rings { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 30px; background: rgba(255, 200, 61, .12); color: var(--gold); font-weight: 800; font-size: 18px; }

.main { padding: 18px 16px; max-width: 720px; margin: 0 auto; }
.h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.h h2 { margin: 0; font-size: 20px; font-weight: 800; }
.h-sub { color: var(--muted); font-size: 14px; margin: -6px 0 14px; }
.section-gap { height: 22px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list { display: flex; flex-direction: column; gap: 10px; }

/* pendientes */
.req { padding: 14px; display: flex; flex-direction: column; gap: 12px; animation: in .25s ease-out; }
.req-top { display: flex; align-items: center; gap: 12px; }
.req-icon { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; font-size: 26px; background: var(--surface-2); }
.req-name { font-weight: 700; line-height: 1.25; }
.req-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.req-rings { margin-left: auto; font-weight: 800; color: var(--gold); white-space: nowrap; }
.req-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.b { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 13px; font-weight: 700; transition: transform .1s, filter .1s; }
.b:active { transform: scale(.97); filter: brightness(1.1); }
.b-ok { background: var(--green); color: #04361a; }
.b-no { background: rgba(255, 90, 106, .14); color: var(--red); }
.b-accent { background: var(--accent); color: #fff; }
.b-soft { background: var(--surface-2); }
.b-sm { height: 38px; font-size: 14px; border-radius: 11px; padding: 0 12px; }
.b-block { width: 100%; }
.b:disabled { opacity: .45; pointer-events: none; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .e { font-size: 44px; margin-bottom: 8px; }

.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.row + .row { border-top: 1px solid var(--line); }
.row-icon { font-size: 22px; width: 32px; text-align: center; flex: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.pill-ok { background: rgba(47, 208, 122, .15); color: var(--green); }
.pill-no { background: rgba(255, 90, 106, .15); color: var(--red); }
.pill-wait { background: rgba(255, 200, 61, .15); color: var(--gold); }

/* vales */
.voucher { padding: 14px; display: flex; flex-direction: column; gap: 12px; border-style: dashed; border-color: rgba(255, 200, 61, .4); }
.voucher .req-actions { grid-template-columns: 1fr 2fr; }

/* premiar */
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.amounts button { height: 58px; border-radius: 14px; background: var(--surface-2); font-weight: 800; font-size: 20px; border: 2px solid transparent; }
.amounts button.on { border-color: var(--gold); background: rgba(255, 200, 61, .14); color: var(--gold); }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); outline: none; font-size: 16px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 140, 255, .25); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips button { padding: 8px 12px; border-radius: 20px; background: var(--surface-2); font-size: 14px; font-weight: 500; }
.toggle-neg { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.toggle-neg input { width: 20px; height: 20px; accent-color: var(--red); }
.pad { padding: 16px; }

/* ajustes */
.seg { display: flex; padding: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 16px; }
.seg button { flex: 1; height: 40px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.group-title { font-size: 12px; letter-spacing: 1.2px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin: 18px 4px 8px; }
.edit-row { cursor: pointer; }
.edit-row.off .row-title { color: var(--muted); text-decoration: line-through; }
.edit-form { padding: 14px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .18); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edit-form .field { margin: 0; }
.edit-form .full { grid-column: 1 / -1; }
.edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: space-between; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; height: 48px; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }
.savebar {
  position: sticky; bottom: calc(80px + var(--safe-b)); margin-top: 16px; padding: 12px; border-radius: 16px; display: flex; gap: 10px; align-items: center;
  background: rgba(28, 36, 88, .96); border: 1px solid rgba(91, 140, 255, .5); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); animation: in .25s;
}
.savebar span { flex: 1; font-size: 14px; font-weight: 600; }
.info { font-size: 14px; color: var(--muted); line-height: 1.5; }
.info code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }

/* nav inferior */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; padding: 8px 8px calc(8px + var(--safe-b));
  background: rgba(11, 16, 48, .95); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.bottom button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border-radius: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bottom button span { font-size: 22px; filter: grayscale(.6); }
.bottom button.on { color: var(--text); background: var(--surface); }
.bottom button.on span { filter: none; }
.nb { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-style: normal; font-weight: 800; display: none; align-items: center; justify-content: center; }
.nb.on { display: flex; }

.snack {
  position: fixed; left: 50%; bottom: calc(92px + var(--safe-b)); z-index: 30; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; background: #eef1ff; color: #0b1030; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.snack.on { opacity: 1; transform: translate(-50%, 0); }
.snack.err { background: var(--red); color: #fff; }

.sheet-back { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + var(--safe-b)); background: rgba(3, 5, 18, .6); animation: fade .2s; }
.sheet { width: min(420px, 100%); padding: 20px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); animation: up .25s cubic-bezier(.3, 1.3, .5, 1); }
.sheet p { margin: 0 0 18px; font-weight: 600; font-size: 17px; line-height: 1.4; text-align: center; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b-danger { background: var(--red); color: #fff; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 760px) { .sheet-back { align-items: center; } }

.leaving { animation: out .25s forwards; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
@keyframes out { to { opacity: 0; transform: translateX(40px); height: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

@media (min-width: 760px) {
  .main { padding-top: 26px; }
  .bottom { left: 50%; right: auto; transform: translateX(-50%); width: 520px; bottom: 14px; border-radius: 20px; border: 1px solid var(--line); padding-bottom: 8px; }
  .shell { padding-bottom: 110px; }
  .savebar { bottom: 100px; }
}
