:root {
  --fondo: #F2F8F7; --tarjeta: #fff; --texto: #1B2A30; --suave: #5E6E74; --linea: #DDE3E6;
  --prim: #005B58; --prim-2: #006A67; --claro: #E3F1EF; --ambar: #B57502; --verde: #2E7D4F; --rojo: #C32D33;
  --radio: 14px; --sombra: 0 1px 3px rgba(0,0,0,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fondo); color: var(--texto); font-size: 16px; line-height: 1.4; }
h1, h2, h3 { margin: 0 0 .6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
a { color: var(--prim-2); }
small { color: var(--suave); }
[hidden] { display: none !important; }
.cargando { padding: 3rem 1rem; text-align: center; color: var(--suave); }

.barra { background: var(--prim); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: .5rem 1rem; padding-top: max(.5rem, env(safe-area-inset-top)); position: sticky; top: 0; z-index: 10; }
.marca-mini { display: flex; align-items: center; gap: .55rem; }
.marca-mini img { width: 38px; height: 38px; background: #fff; border-radius: 10px; padding: 2px; }
.marca-mini small { display: block; color: #CFE7E4; font-size: .8rem; }
.btn.link.blanco { color: #fff; }

main { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.tarjeta { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem; margin-bottom: 1rem; }

/* Portada */
.portada { text-align: center; padding: 1.5rem 0 .5rem; }
.portada img { width: 150px; height: 150px; }
.portada h1 { color: var(--prim); font-size: 1.6rem; margin: .2rem 0 0; }
.portada .sub { color: var(--rojo); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; font-size: 1.05rem; margin: .2rem 0 0; }
.acceso { max-width: 420px; margin: 0 auto; }

label { display: block; font-weight: 600; font-size: .92rem; margin: .8rem 0 .25rem; }
input, select, textarea { width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid var(--linea); border-radius: 10px; background: #fff; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--prim-2); border-color: transparent; }
textarea { min-height: 70px; resize: vertical; }
.ayuda { color: var(--suave); font-size: .86rem; margin: .3rem 0; }
.error { background: #FDECEC; color: var(--rojo); border-radius: 10px; padding: .6rem .8rem; margin-top: .8rem; font-weight: 600; }
.ok { background: #E7F5EC; color: var(--verde); border-radius: 10px; padding: .6rem .8rem; margin-top: .8rem; font-weight: 600; }

.btn { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; width: 100%; padding: .8rem 1rem; margin-top: 1rem; border: 0; border-radius: 12px; background: var(--prim); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.sec { background: var(--claro); color: var(--prim); }
.btn.rojo { background: var(--rojo); }
.btn.wa { background: #1FA855; }
.btn.chico { width: auto; padding: .45rem .75rem; margin: 0; font-size: .88rem; border-radius: 9px; }
.btn.link { background: none; color: var(--prim-2); width: auto; padding: .3rem .4rem; margin: 0; font-weight: 600; }
.fila { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.fila > * { flex: 1 1 auto; }

/* Tipos de unidad */
.unidades { display: grid; gap: .6rem; margin-top: .4rem; }
.unidad { display: flex; align-items: center; gap: .8rem; border: 2px solid var(--linea); border-radius: 12px; padding: .6rem .8rem; }
.unidad.con { border-color: var(--prim-2); background: var(--claro); }
.unidad .ico { font-size: 1.6rem; width: 2.2rem; text-align: center; }
.unidad .info { flex: 1; }
.unidad .info b { display: block; }
.unidad .info small { font-size: .8rem; }
.contador { display: flex; align-items: center; gap: .3rem; }
.contador button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--prim); color: #fff; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.contador input { width: 52px; text-align: center; padding: .45rem .2rem; font-weight: 700; }

.opciones { display: grid; gap: .5rem; margin-top: .4rem; }
.opcion { display: flex; gap: .6rem; align-items: center; border: 2px solid var(--linea); border-radius: 12px; padding: .65rem .8rem; cursor: pointer; font-weight: 600; margin: 0; }
.opcion input { width: auto; margin: 0; }
.opcion:has(input:checked) { border-color: var(--prim-2); background: var(--claro); }

/* Estado */
.estado { display: flex; gap: .8rem; align-items: center; }
.estado .grande { font-size: 2rem; }
.estado.asignado { background: #E7F5EC; border: 2px solid #9ED3B2; }
.estado.registrado { background: #FFF6E5; border: 2px solid #F0CF8A; }
.etiqueta { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.etiqueta.pendiente { background: #ECEFF1; color: #546E7A; }
.etiqueta.registrado { background: #FFF1D6; color: var(--ambar); }
.etiqueta.asignado { background: #DDF1E4; color: var(--verde); }
.etiqueta.inactivo { background: #FDECEC; color: var(--rojo); }

/* Admin */
.pestanas { display: flex; gap: .3rem; background: #fff; border-radius: 12px; padding: .3rem; box-shadow: var(--sombra); margin-bottom: 1rem; }
.pestanas button { flex: 1; border: 0; background: none; padding: .6rem; border-radius: 9px; font: inherit; font-weight: 600; color: var(--suave); cursor: pointer; }
.pestanas button.activo { background: var(--claro); color: var(--prim); }
.cuentas { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.cuentas button { border: 1px solid var(--linea); background: #fff; border-radius: 999px; padding: .35rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.cuentas button.activo { background: var(--prim); color: #fff; border-color: var(--prim); }
.prov h3 { display: flex; justify-content: space-between; gap: .5rem; align-items: flex-start; margin-bottom: .2rem; }
.datos { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .92rem; margin: .5rem 0; }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; font-weight: 600; }
.acciones { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; border-top: 1px solid var(--linea); padding-top: .6rem; }
.asignar { display: flex; gap: .4rem; margin-top: .5rem; }
.asignar select { flex: 1; }
.credencial { background: var(--claro); border-radius: 12px; padding: .8rem 1rem; font-size: 1.05rem; }
.credencial b { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; }
.est { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--linea); }
.est:last-child { border-bottom: 0; }
.vacio { text-align: center; color: var(--suave); padding: 1.5rem; }

/* Documentos */
h2.sep { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--linea); }
.docs { display: grid; gap: .5rem; }
.doc { display: flex; align-items: center; gap: .6rem; border: 2px dashed var(--linea); border-radius: 12px; padding: .6rem .8rem; }
.doc.listo { border-style: solid; border-color: #9ED3B2; background: #F2FAF5; }
.doc-info { flex: 1; min-width: 0; }
.doc-info b { display: block; font-size: .95rem; }
.doc-info small { display: block; }
.btn.subir { cursor: pointer; white-space: nowrap; }
.opciones.dos { grid-template-columns: 1fr 1fr; }
.estado.rechazado { background: #FDECEC; border: 2px solid #F2B3B5; }
.etiqueta.revision { background: #FFF1D6; color: var(--ambar); }
.etiqueta.aprobado { background: #DDF1E4; color: var(--verde); }
.etiqueta.rechazado { background: #FDECEC; color: var(--rojo); }
.burbuja { background: var(--rojo); color: #fff; border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
.chip-doc { background: var(--claro); color: var(--prim); border-radius: 999px; padding: .25rem .65rem; font-size: .84rem; font-weight: 600; text-decoration: none; }
.chip-doc.falta { background: #FDECEC; color: var(--rojo); }
.aprobar { background: #FFF8EA; border-radius: 12px; padding: .2rem .8rem .8rem; margin-top: .6rem; }
.unidad-reg { border: 1px solid var(--linea); border-radius: 12px; padding: .6rem .8rem; margin-top: .5rem; }
.unidad-reg .fila { margin-top: .3rem; }
.links { font-size: .88rem; margin-top: .3rem; }

/* Rutas y ganancias */
.totales { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.total { background: #fff; border-radius: var(--radio); box-shadow: var(--sombra); padding: .7rem .8rem; }
.total small { display: block; font-size: .78rem; }
.total b { font-size: 1.2rem; }
.total.ambar b { color: var(--ambar); }
.total.verde b { color: var(--verde); }
.renglon { display: flex; justify-content: space-between; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--linea); }
.renglon:last-child { border-bottom: 0; }
.renglon .der { text-align: right; white-space: nowrap; }
.proximamente { text-align: center; }
.proximamente .grande { font-size: 2.5rem; }
.proximamente ul { text-align: left; display: inline-block; margin: .3rem 0 0; padding-left: 1.2rem; }
.proximamente li { margin: .3rem 0; }
.pestanas button { font-size: .9rem; padding: .55rem .3rem; }
@media (max-width: 420px) { .pestanas button { font-size: .8rem; } .fila > div { flex-basis: 100%; } }
