/* Vende by Vorka · sistema visual v2
   Base Vorka v3: tinta #141114, morado #6B2A85 y el ángulo del logo (-28°) como único adorno.
   Mayormente blanco, letra grande, botones grandes con texto, contraste AA. Claro u oscuro según el teléfono.
   --p lo puede cambiar el programa (color del patrocinador); todo lo demás se deriva de él. */
:root {
  color-scheme: light dark;
  --p: #6B2A85;
  --acc: var(--p);
  --acc-tx: #fff;
  --tinte: #F4EEF7;
  --bg: #FFFFFF; --bg-2: #F7F6F4; --card: #FFFFFF;
  --tx: #141114; --mu: #5E5A60; --mu-2: #8D898F;
  --bd: #ECEAEC; --bd-2: #D9D6D9; --campo: #B9B5BA;
  --ok: #1F7A47; --okb: #E8F4ED; --wa: #855600; --wab: #FFF5DC; --er: #B3261E; --erb: #FCEBE9; --az: #1D4E89; --azb: #E8F0FA;
  --wabtn: #1F7A47; --toast: #141114; --toast-tx: #fff; --velo: rgba(20, 17, 20, .38);
  --r: 20px; --r-s: 14px;
  --sombra: 0 1px 2px rgba(20, 17, 20, .04), 0 6px 20px rgba(20, 17, 20, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --skew: -28deg;
}
@supports (color: color-mix(in srgb, red 50%, white)) {
  :root { --tinte: color-mix(in srgb, var(--p) 8%, #fff); }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F0D10; --bg-2: #171519; --card: #1A181C;
    --tx: #F4F2F5; --mu: #B7B2B9; --mu-2: #8F8A92;
    --bd: #2A272D; --bd-2: #3A363D; --campo: #57525A;
    --ok: #7FD3A1; --okb: #15291E; --wa: #F2C56B; --wab: #2B2210; --er: #FF9C92; --erb: #33171A; --az: #9CC2F2; --azb: #15212F;
    --wabtn: #1F7A47; --toast: #F4F2F5; --toast-tx: #141114; --velo: rgba(0, 0, 0, .6);
    --sombra: none;
    --acc: #C9A3D9; --acc-tx: #141114; --tinte: #251C29;
  }
  @supports (color: color-mix(in srgb, red 50%, white)) {
    :root { --acc: color-mix(in oklab, var(--p) 55%, #fff); --tinte: color-mix(in srgb, var(--p) 22%, #1A181C); }
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font: 18px/1.5 var(--font); color: var(--tx); background: var(--bg); padding-bottom: 92px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--acc); }
h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -.03em; margin: .25em 0 .35em; line-height: 1.15; }
h2 { font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em; margin: 1.5em 0 .55em; }
h3 { font-size: 1.05rem; font-weight: 650; margin: .55em 0 .2em; line-height: 1.3; }
p { margin: .4em 0; }
strong, b { font-weight: 650; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; border-radius: 8px; }
main:focus, main:focus-visible { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 50; background: var(--tx); color: var(--bg); padding: 10px 14px; border-radius: 12px; }
.num, .kpi .v, .grande, .der { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* Encabezado: blanco, con la marca y el programa en pequeño */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--bd); }
.top .marca { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--acc); display: grid; place-items: center; }
.top .marca svg { width: 22px; height: 22px; color: var(--acc-tx); }
.top .tit { flex: 1; min-width: 0; }
.top .tit b { display: block; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .tit small { display: block; font-size: .8rem; color: var(--mu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top button { background: var(--bg-2); border: 0; border-radius: 999px; color: var(--tx); min-width: 44px; min-height: 44px; font: inherit; }
.estado-red { background: var(--wab); color: var(--wa); text-align: center; font-size: .92rem; font-weight: 600; padding: 8px 12px; display: none; }
.estado-red.on { display: block; }

main { max-width: 680px; margin: 0 auto; padding: 14px 16px 28px; }

/* Navegación inferior: ícono + texto, la sección actual con fondo */
.nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--bg); border-top: 1px solid var(--bd); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--mu); font-size: .78rem; font-weight: 600; min-height: 60px; justify-content: center; position: relative; }
.nav a svg { width: 26px; height: 26px; padding: 3px 14px; box-sizing: content-box; border-radius: 999px; }
.nav a.on { color: var(--tx); }
.nav a.on svg { background: var(--tinte); color: var(--acc); }
.nav a .punto { position: absolute; top: 2px; right: 18%; background: var(--er); color: #fff; font-size: .7rem; border-radius: 10px; padding: 0 6px; font-weight: 700; }

/* Tarjetas y listas */
.card { background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); padding: 16px 18px; margin: 12px 0; box-shadow: var(--sombra); }
.card.destacada { border-color: transparent; background: var(--tinte); box-shadow: none; }
.lista { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--bd); border-radius: var(--r); padding: 14px 16px; margin: 10px 0; text-decoration: none; color: inherit; min-height: 64px; }
a.item:active { background: var(--bg-2); }
.item .cuerpo { flex: 1; min-width: 0; }
.item .t { font-weight: 650; }
.item .s, .s { color: var(--mu); font-size: .92rem; }
.item .der { text-align: right; white-space: nowrap; }
.item > span[aria-hidden="true"]:last-child { color: var(--mu-2); font-size: 1.4rem; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--tinte); color: var(--acc); display: grid; place-items: center; font-weight: 700; font-size: .9rem; letter-spacing: .02em; }
.fila { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.fila.envuelve { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid2 > *, .grid3 > * { min-width: 0; }
.kpi { background: var(--bg-2); border-radius: var(--r-s); padding: 12px 14px; }
.kpi .v { font-size: clamp(1rem, 4.4vw, 1.3rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; }
.kpi .l { font-size: .84rem; color: var(--mu); line-height: 1.3; }
.grande { font-size: 2rem; font-weight: 750; letter-spacing: -.03em; }
.vacio { text-align: center; color: var(--mu); padding: 32px 12px; }

/* Etiqueta de sección con el ángulo Vorka */
.etiqueta { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 650; color: var(--mu); }
.etiqueta::before { content: ""; width: 4px; height: 15px; border-radius: 1px; background: var(--acc); transform: skewX(var(--skew)); }

/* Botones: grandes, redondos, siempre con texto */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 22px; border-radius: 999px; border: 0; background: var(--acc); color: var(--acc-tx); font: inherit; font-weight: 650; letter-spacing: -.005em; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.25; transition: transform .15s, filter .15s; }
.btn:active { transform: scale(.98); filter: brightness(.95); }
.btn.sec { background: var(--tinte); color: var(--acc); }
.btn.peq { min-height: 44px; padding: 6px 16px; font-size: .95rem; }
.btn.ancho { width: 100%; }
.btn.wa { background: var(--okb); color: var(--ok); }
.btn.peligro { background: transparent; color: var(--er); box-shadow: inset 0 0 0 2px var(--er); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 22px; height: 22px; flex: none; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.fab { position: fixed; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 9; box-shadow: 0 6px 20px rgba(20, 17, 20, .22); padding: 10px 24px; }
.enlace { background: none; border: 0; color: var(--acc); font: inherit; font-weight: 600; text-decoration: none; padding: 8px 2px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.enlace.gris { color: var(--mu); }

/* Formularios */
label { display: block; font-weight: 650; margin: 14px 0 6px; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
label.check input { width: 26px; height: 26px; min-height: 0; flex: none; margin-top: 1px; accent-color: var(--acc); }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; font: inherit; padding: 12px 14px; min-height: 52px; border: 1.5px solid var(--campo); border-radius: var(--r-s); background: var(--card); color: var(--tx); }
input[type="date"], input[type="datetime-local"], input[type="time"] { -webkit-appearance: none; appearance: none; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: var(--mu-2); }
textarea { min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 4px var(--tinte); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--acc); }
fieldset { min-width: 0; }
summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--acc); }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--tinte); font-weight: 700; flex: none; }
details[open] > summary::before { content: "−"; }
.card > summary, details.card > summary { color: var(--tx); }
.ayuda { font-size: .88rem; color: var(--mu); margin-top: 4px; }
/* Opciones (antes "segmentos"): botones-píldora que se acomodan solos, sin cortarse */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { flex: 1 0 auto; padding: 0 16px; min-height: 46px; border: 1.5px solid var(--bd-2); border-radius: 999px; background: var(--card); color: var(--tx); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--tx); border-color: var(--tx); color: var(--bg); }

/* Etiquetas de estado: siempre con texto, nunca solo color */
.chip { display: inline-block; font-size: .82rem; font-weight: 650; padding: 3px 11px; border-radius: 999px; background: var(--bg-2); color: var(--mu); white-space: nowrap; vertical-align: middle; }
.chip.verde, .chip.ok { background: var(--okb); color: var(--ok); }
.chip.amarillo, .chip.aviso { background: var(--wab); color: var(--wa); }
.chip.rojo, .chip.error { background: var(--erb); color: var(--er); }
.chip.marca { background: var(--tinte); color: var(--acc); }
.chip.azul { background: var(--azb); color: var(--az); }

/* Hoy */
.saludo { margin: 8px 0 18px; }
.saludo h1 { margin-bottom: 2px; }
.resumen-hoy { display: flex; align-items: center; gap: 14px; background: var(--bg-2); border-radius: var(--r); padding: 16px 18px; margin: 14px 0 4px; }
.resumen-hoy .n { font-size: 2.2rem; font-weight: 750; letter-spacing: -.04em; line-height: 1; color: var(--acc); }
.accion { padding: 18px; }
.accion .tipo { display: flex; align-items: center; gap: 10px; font-size: .9rem; font-weight: 650; color: var(--mu); }
.accion .tipo i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 1.05rem; background: var(--tinte); }
.accion.cobro .tipo i { background: var(--erb); }
.accion.entrega .tipo i { background: var(--azb); }
.accion.cumple .tipo i { background: var(--wab); }
.accion.recompra .tipo i { background: var(--okb); }
.accion h3 { font-size: 1.15rem; margin: 10px 0 2px; }
.accion .acciones .btn { flex: 1 1 100%; }
.accion .mini { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; border-top: 1px solid var(--bd); padding-top: 4px; }
.hecho { background: var(--okb); color: var(--ok); border-radius: var(--r); padding: 14px 18px; margin: 10px 0; font-weight: 650; }
.hecho .enlace { color: inherit; text-decoration: underline; margin-left: 6px; }
.atajos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.atajo { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 104px; padding: 16px; border-radius: var(--r); border: 1px solid var(--bd); background: var(--card); color: var(--tx); text-decoration: none; font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.atajo i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-style: normal; background: var(--tinte); color: var(--acc); font-size: 1.3rem; font-weight: 700; }
.atajo.prim { background: var(--acc); color: var(--acc-tx); border-color: transparent; }
.atajo.prim i { background: rgba(255, 255, 255, .2); color: inherit; }

/* Barras */
.barra { height: 12px; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--acc); border-radius: 8px; }
.barras { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin-top: 10px; }
.barras div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.barras i { width: 100%; background: var(--acc); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.barras small { font-size: .72rem; color: var(--mu); }

/* Hoja que sube desde abajo */
.velo { position: fixed; inset: 0; background: var(--velo); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.hoja { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 26px 26px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom)); }
.hoja::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--bd-2); margin: 0 auto 10px; }
.hoja .cerrar { float: right; background: var(--bg-2); color: var(--tx); }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--toast); color: var(--toast-tx); padding: 14px 20px; border-radius: 18px; z-index: 30; width: max-content; max-width: calc(100vw - 32px); font-size: 1rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast a { color: inherit !important; }
.aviso-registro { font-size: .86rem; color: var(--mu); background: transparent; border-top: 1px solid var(--bd); padding: 14px 2px 0; margin: 26px 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 10px 6px; border-bottom: 1px solid var(--bd); text-align: left; vertical-align: top; }
th { color: var(--mu); font-weight: 600; font-size: .86rem; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla-scroll { overflow-x: auto; }
.buscar { position: sticky; top: 60px; z-index: 5; background: var(--bg); padding: 8px 0; }
input[type="search"] { padding-left: 46px; background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238D898F' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center / 20px; border-color: transparent; }
.semaforo { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.semaforo.verde { background: #1b8a4a; } .semaforo.amarillo { background: #e0a400; } .semaforo.rojo { background: #c62828; }
.pasos li { margin: 8px 0; }
.total { background: var(--bg-2); border-radius: var(--r); padding: 16px 18px; margin: 14px 0; }

/* Entrar */
.bienvenida { text-align: center; padding: 28px 4px 10px; }
.bienvenida .logo { width: 72px; height: 72px; border-radius: 22px; background: var(--acc); display: grid; place-items: center; margin: 0 auto 18px; }
.bienvenida .logo svg { width: 44px; height: 44px; color: var(--acc-tx); }
.bienvenida h1 { font-size: 2.1rem; }
.bienvenida .lead { color: var(--mu); font-size: 1.05rem; max-width: 30ch; margin: 6px auto 0; }
.beneficios { list-style: none; padding: 0; margin: 22px 0 8px; display: grid; gap: 10px; }
.beneficios li { display: flex; gap: 12px; align-items: center; font-weight: 550; }
.beneficios li i { width: 36px; height: 36px; border-radius: 50%; background: var(--tinte); display: grid; place-items: center; font-style: normal; flex: none; }

@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 60px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--bd); justify-content: center; gap: 8px; }
  .nav a { flex: 0 1 120px; }
  .fab { bottom: 28px; }
  .toast { bottom: 32px; }
}
@media (prefers-reduced-motion: no-preference) { .hoja { animation: sube .2s ease-out; } @keyframes sube { from { transform: translateY(30px); opacity: .5; } } }
