/* Diseño: mercado fresco hecho videojuego. Verde hoja + mango; tipografía redondeada para títulos. */
:root {
  --bg: #EEF5EA; --surface: #FFFFFF; --ink: #15301F; --muted: #5A7263; --line: #D9E5D3; --soft: #E3EFDD;
  --brand: #1B8A4B; --brand-ink: #FFFFFF; --sun: #FFB020; --berry: #E5415C; --good: #1B8A4B; --bad: #C8283F;
  --shadow: 0 1px 0 rgba(21,48,31,.06), 0 8px 22px -12px rgba(21,48,31,.28);
  --f-disp: 'Fredoka', 'Nunito', system-ui, sans-serif; --f-body: 'Nunito', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E1B14; --surface: #16291F; --ink: #E7F3EA; --muted: #9DB6A6; --line: #264036; --soft: #1D3528;
  --brand: #3FD07C; --brand-ink: #06210F; --good: #3FD07C; --bad: #FF7A8E; --shadow: 0 8px 22px -12px rgba(0,0,0,.6); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0E1B14; --surface: #16291F; --ink: #E7F3EA; --muted: #9DB6A6; --line: #264036; --soft: #1D3528;
  --brand: #3FD07C; --brand-ink: #06210F; --good: #3FD07C; --bad: #FF7A8E; --shadow: 0 8px 22px -12px rgba(0,0,0,.6); color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px 24px; }
h1, h2, h3, h4 { font-family: var(--f-disp); margin: 0; font-weight: 600; text-wrap: balance; }
h4 { font-size: 16px; margin-bottom: 8px; }
p { margin: 0 0 8px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.ico { vertical-align: -4px; }
.muted { color: var(--muted); } .sm { font-size: 13px; } .pad { padding: 0 4px; } .center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.center { justify-content: center; margin-top: 10px; }
.pos { color: var(--good); font-weight: 800; } .neg { color: var(--bad); font-weight: 800; }
.card { background: var(--surface); border-radius: 18px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); min-width: 0; }
.card.slim { padding: 10px; } .card.center .bigpts { margin: 2px 0 6px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 10px 0 4px; }
input, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-width: 0; }
input[type=checkbox] { width: auto; }
.chk { display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 18px; font-weight: 800; transition: transform .1s; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.danger { color: var(--bad); border-color: var(--bad); } .btn.tiny { padding: 6px 12px; font-size: 13px; } .btn.big { width: 100%; padding: 14px; font-size: 16px; margin-top: 14px; } .btn.wide { width: 100%; margin: 6px 0 20px; }
.link { background: none; border: 0; color: var(--brand); font-weight: 800; padding: 6px 0; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--ink); }
.tag.mayorista { background: #FFE8B0; color: #5c3b00; }
.err { color: var(--bad); font-weight: 700; } .hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.seg { display: flex; gap: 4px; background: var(--soft); padding: 4px; border-radius: 999px; margin-bottom: 12px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 12px; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); }

/* acceso */
.login { max-width: 420px; margin: 0 auto; padding-top: 16px; }
.brand { text-align: center; margin-bottom: 14px; } .brand h1 { font-size: 34px; } .brand h1 span { color: var(--brand); } .brand p { color: var(--muted); }
.logo { display: inline-block; } .demo { background: var(--soft); border-radius: 16px; padding: 12px 14px; font-size: 13px; } .demo p { margin: 4px 0 8px; }

/* cliente */
.phone { max-width: 440px; margin: 0 auto; padding-bottom: 86px; } .screen { display: block; }
.hdr { display: flex; align-items: center; gap: 12px; padding: 4px 0 12px; } .hdr > div { flex: 1; } .hdr h2 { font-size: 24px; } .hdr small { color: var(--muted); }
.avbtn { border: 0; background: var(--surface); border-radius: 50%; width: 56px; height: 56px; display: grid; place-items: center; box-shadow: var(--shadow); overflow: hidden; padding: 0; }
.avbtn svg { margin-top: 6px; }
.bell { position: relative; border: 0; background: var(--surface); border-radius: 50%; width: 44px; height: 44px; box-shadow: var(--shadow); }
.bell i { position: absolute; top: -2px; right: -2px; background: var(--berry); color: #fff; border-radius: 99px; font-size: 11px; font-style: normal; padding: 1px 6px; font-weight: 800; }
.hero, .tcard { position: relative; overflow: hidden; border-radius: 22px; padding: 18px; margin-bottom: 14px; color: #fff; box-shadow: var(--shadow); }
.tier-bronce { background: linear-gradient(135deg, #E8A877, #8E5128); }
.tier-plata { background: linear-gradient(135deg, #F4F7FA, #8E9CAB); color: #1b2430; }
.tier-oro { background: linear-gradient(135deg, #FFE785, #C88A0A); color: #2e1f00; }
.tier-platino { background: linear-gradient(135deg, #B8C4FF, #5B63D6 55%, #8F5AD6); }
.tshine { position: absolute; inset: -40% -20% auto auto; width: 80%; height: 120%; background: radial-gradient(closest-side, rgba(255,255,255,.45), transparent); pointer-events: none; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: end; } .hero > .bar, .hero > .goal { grid-column: 1 / -1; }
.hl small, .hero small { opacity: .85; font-weight: 700; } .hl h3 { font-size: 34px; line-height: 1; }
.pointsbtn { border: 0; background: rgba(255,255,255,.28); border-radius: 16px; padding: 8px 14px; text-align: right; color: inherit; } .pointsbtn b { display: block; font-family: var(--f-disp); font-size: 30px; line-height: 1; }
.bar { height: 12px; background: rgba(0,0,0,.18); border-radius: 99px; overflow: hidden; } .bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }
.goal { margin: 4px 0 0; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.tile { border: 0; background: var(--surface); border-radius: 18px; padding: 14px; text-align: left; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; min-height: 96px; }
.tile .big { font-family: var(--f-disp); font-size: 28px; font-weight: 600; } .tile small { color: var(--muted); font-weight: 700; } .tile em { font-style: normal; font-size: 12px; color: var(--brand); font-weight: 800; }
.qrtile { background: var(--brand); color: var(--brand-ink); } .qrtile small, .qrtile em { color: inherit; opacity: .9; }
.mov { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); } .mov:last-child { border-bottom: 0; } .mov small { display: block; color: var(--muted); }
.sub { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; } .sub h2 { font-size: 24px; }
.back { border: 0; background: var(--surface); width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1; box-shadow: var(--shadow); }
.bigpts { font-family: var(--f-disp); font-size: 54px; line-height: 1; color: var(--brand); } .bigpts.sm { font-size: 28px; }
.stack { padding: 0 2px; } .tcard { min-height: 150px; } .trow { display: flex; justify-content: space-between; gap: 10px; } .trow small { opacity: .85; font-weight: 700; } .trow h3 { font-size: 22px; margin: 2px 0 6px; }
.tav { width: 72px; height: 72px; display: grid; place-items: center; background: rgba(255,255,255,.35); border-radius: 50%; overflow: hidden; } .tav svg { margin-top: 8px; }
.tfoot { display: flex; justify-content: space-between; margin-top: 18px; font-size: 14px; }
.qrbox { background: #fff; border-radius: 16px; padding: 12px; width: min(100%, 240px); margin: 14px auto 6px; } .qrbox svg { display: block; width: 100%; height: auto; } .qrbox.big { width: min(100%, 280px); }
.qrnote { text-align: center; font-size: 12.5px; margin: 6px 0 0; opacity: .9; }
.ladder { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; } .ladder.cur { background: var(--soft); } .ladder small { color: var(--muted); flex: 1; } .ladder em { font-style: normal; font-weight: 800; color: var(--brand); }
.dot { width: 18px; height: 18px; border-radius: 50%; display: inline-block; }
.flame { color: var(--sun); } .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 14px 0 6px; }
.cd { display: grid; place-items: center; height: 34px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 800; } .cd.ok { background: var(--brand); color: var(--brand-ink); } .cd.closed { opacity: .45; background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 4px, var(--line) 4px, var(--line) 8px); } .cd.now { outline: 2px solid var(--sun); }
.mile { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: var(--muted); } .mile b { flex: 1; } .mile em { font-style: normal; font-weight: 800; } .mile.done { color: var(--ink); } .mile.done span { color: var(--good); }
.mini { text-align: center; width: 72px; } .mini small { display: block; color: var(--muted); font-weight: 700; }
.troph { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .tro { background: var(--surface); border-radius: 18px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; } .tro small { color: var(--muted); } .tro:last-child { grid-column: 1 / -1; } .lock { font-size: 12px; font-weight: 800; color: var(--muted); }
.avgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .avc { border: 2px solid transparent; background: var(--surface); border-radius: 18px; padding: 8px 4px 10px; display: flex; flex-direction: column; align-items: center; box-shadow: var(--shadow); min-width: 0; } .avc.sel { border-color: var(--brand); } .avc.locked svg { filter: grayscale(1) opacity(.5); } .avc small { color: var(--muted); font-weight: 700; font-size: 12px; }
.stage { display: grid; place-items: center; padding: 6px 0; } .skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .skin { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: var(--bg); min-width: 0; } .skin.sel { outline: 2px solid var(--brand); } .skin small { color: var(--muted); font-size: 11.5px; } .lockd { display: block; }
.rw { display: flex; gap: 12px; background: var(--surface); border-radius: 18px; padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); } .rw > div { min-width: 0; flex: 1; } .rw svg { flex: none; border-radius: 16px; } .rw.out svg { filter: grayscale(.8); } .rw h4 { margin-bottom: 2px; }
.cost { font-family: var(--f-disp); font-size: 18px; color: var(--brand); } .st { font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: var(--soft); } .st.good { color: var(--good); } .st.bad { color: var(--bad); } .ej { display: block; color: var(--muted); margin: 4px 0; } .rw .btn { margin-top: 6px; }
.note h4 { margin-bottom: 4px; } .note.warn { border-left: 5px solid var(--sun); } .note small { color: var(--muted); }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 440px); display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 5; }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; font-weight: 800; color: var(--muted); padding: 6px 0; } .tabbar button.on { color: var(--brand); }
.demo2 summary { font-weight: 800; cursor: pointer; }

/* panel */
.admin { max-width: 1100px; margin: 0 auto; } .atop { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 0 10px; } .atop > div { flex: 1; min-width: 160px; } .atop b { font-family: var(--f-disp); font-size: 20px; } .atop small { display: block; color: var(--muted); } .clock { font-size: 13px; color: var(--muted); font-weight: 700; }
.snav { display: flex; gap: 4px; overflow-x: auto; background: var(--soft); border-radius: 999px; padding: 4px; margin-bottom: 14px; } .snav button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; font-weight: 800; white-space: nowrap; } .snav button.on { background: var(--surface); box-shadow: var(--shadow); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
.reslist { display: grid; gap: 6px; margin-top: 8px; } .res { text-align: left; border: 1.5px solid var(--line); background: var(--bg); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; } .res small { color: var(--muted); }
.cp { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; } .cav { width: 64px; height: 64px; border-radius: 50%; background: var(--soft); overflow: hidden; display: grid; place-items: center; flex: none; } .cav svg { margin-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 8px 0; } .kpis > div { background: var(--bg); border-radius: 12px; padding: 8px 10px; } .kpis small { display: block; color: var(--muted); font-weight: 700; } .kpis b { font-family: var(--f-disp); font-size: 20px; }
.f { flex: 1; min-width: 0; } .pur { border-top: 1px dashed var(--line); padding: 10px 0; display: grid; gap: 6px; } .pur.anulada { opacity: .55; } .ph { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .ph small { color: var(--muted); flex: 1; }
.tbl { overflow-x: auto; margin-top: 10px; } table { width: 100%; border-collapse: collapse; font-size: 13.5px; } th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; } th, td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } td select { padding: 6px 8px; }
.rwf { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); align-items: start; } .rwf label { margin: 0; font-size: 12px; flex: 1; min-width: 100px; } .rwf .col { display: grid; gap: 6px; } .f2 { display: grid; gap: 8px; min-width: 0; } .rwf .row { flex-wrap: wrap; align-items: end; }
.urow { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; } .urow b { flex: 1 1 160px; font-size: 13.5px; } .urow select, .urow input { width: auto; flex: 1 1 110px; padding: 7px 10px; } .uf { width: 40px; flex: none; }
.rules { padding-left: 18px; margin: 8px 0 0; } .rules li { margin-bottom: 4px; } .empty { text-align: center; padding: 40px 16px; }
.mback { position: fixed; inset: 0; background: rgba(8,20,13,.6); display: grid; place-items: center; z-index: 20; padding: 16px; } .modal { background: var(--surface); border-radius: 22px; padding: 20px; text-align: center; max-width: 340px; width: 100%; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 800; z-index: 30; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow); } .toast.bad { background: var(--bad); color: #fff; }
@media (max-width: 760px) { .cols { grid-template-columns: minmax(0, 1fr); } .rwf { grid-template-columns: auto 1fr; } .rwf .col { grid-column: 1 / -1; grid-auto-flow: column; } .admin .toast { bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.scanvid { width: 100%; max-height: 50vh; border-radius: 14px; background: #000; margin: 10px 0; object-fit: cover; }
.pinbig { font-family: var(--f-disp); font-size: 56px; letter-spacing: .25em; padding: 12px 0 12px .25em; color: var(--brand); text-align: center; }
.modal .row { justify-content: center; margin-top: 12px; }
