:root {
  --bg: #101614;
  --bg-2: #0c100e;
  --card: #1a2320;
  --card-2: #222c28;
  --line: rgba(255,255,255,.08);
  --text: #f3f7f4;
  --muted: #93a29a;
  --green: #22e56a;
  --green-2: #14c85a;
  --green-ink: #062214;
  --blue: #2f80ff;
  --gold: #e2b34a;
  --purple: #8b6adf;
  --red: #ff4d4f;
  --warn: #f5b942;
  --shadow: 0 16px 40px rgba(0,0,0,.35);
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg-2); color: var(--text); min-height: 100%; max-width: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg, video { max-width: 100%; }
.app {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(34,229,106,.16), transparent 55%),
    var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
body[data-app="logistica"] .app { padding-bottom: 24px; max-width: 1180px; }
@media (min-width: 860px) {
  body[data-app="motoboy"] { background: #070b09; }
  body[data-app="motoboy"] .app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100dvh;
    box-shadow: 0 0 0 1px rgba(255,255,255,.06);
  }
}
.pad { padding: 16px 16px 8px; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-row img { width: 36px; height: 36px; object-fit: contain; }
.logo-row strong { display: block; letter-spacing: .04em; font-size: 13px; line-height: 1.1; }
.logo-row span { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.hero {
  margin-top: 18px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16,22,20,.1), rgba(16,22,20,.72)),
    radial-gradient(circle at 70% 30%, rgba(34,229,106,.35), transparent 42%),
    #121a17;
  min-height: 210px;
  position: relative;
}
.hero svg { display: block; width: 100%; height: 220px; }
h1 { font-size: 34px; line-height: .95; margin: 18px 0 6px; letter-spacing: -.03em; }
.sub { color: var(--muted); margin: 0 0 16px; }
.field {
  display: flex; align-items: center; gap: 10px;
  background: #0e1412; border: 1px solid var(--line); border-radius: 16px;
  padding: 0 14px; margin-bottom: 12px; min-height: 56px;
}
.field input {
  flex: 1; background: transparent; border: 0; outline: 0; font-size: 16px; min-width: 0; height: 54px;
}
.field input::placeholder { color: #7e8d86; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; border: 0; border-radius: 16px;
  background: linear-gradient(180deg, var(--green), var(--green-2));
  color: var(--green-ink); font-weight: 800; font-size: 17px;
  box-shadow: 0 10px 24px rgba(20,200,90,.25);
}
.btn.blue { background: linear-gradient(180deg, #4aa2ff, var(--blue)); color: white; box-shadow: none; }
.btn.red { background: linear-gradient(180deg, #ff5d5f, #e23b3d); color: white; box-shadow: none; }
.btn.ghost { background: #24302b; color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn:disabled { opacity: .45; }
.linkish { background: none; border: 0; color: var(--muted); width: 100%; padding: 14px; font-weight: 700; }
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 0;
}
.top h2 { flex: 1; margin: 0; font-size: 18px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line);
  background: #18211e; color: var(--text); display: grid; place-items: center;
}
.who { display: flex; gap: 12px; align-items: center; padding: 8px 16px 4px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: #24362c; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; border: 3px solid var(--green); flex: 0 0 auto;
}
.avatar.photo { padding: 0; overflow: hidden; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nick { color: var(--muted); margin: 2px 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #123222; color: var(--green); border-radius: 999px;
  padding: 4px 10px; font-size: 13px; font-weight: 800;
}
.pill.off { background: #2a2420; color: var(--warn); }
.pill.blue { background: #163056; color: #9cc4ff; }
.pill.red { background: #3a1618; color: #ffb4b4; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px; }
.stat {
  background: var(--card); border-radius: 18px; padding: 14px; min-height: 92px;
  border: 1px solid var(--line);
}
.stat b { display: block; font-size: 26px; margin-top: 8px; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat i { font-style: normal; font-size: 18px; }
.stat.g { background: linear-gradient(180deg, #143628, #1a2420); }
.stat.y { background: linear-gradient(180deg, #3a3014, #241f14); }
.stat.b { background: linear-gradient(180deg, #163056, #151c28); }
.stat.p { background: linear-gradient(180deg, #2c2454, #1b1828); }
.stat.g i { color: var(--green); }
.stat.y i { color: var(--gold); }
.stat.b i { color: #7eb6ff; }
.stat.p i { color: #b9a6ff; }
.card {
  margin: 0 16px 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; padding: 14px; box-shadow: var(--shadow);
}
.card h4 { margin: 0 0 8px; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.meta { color: var(--muted); font-size: 14px; margin: 4px 0; }
.actions { display: grid; gap: 8px; margin-top: 12px; }
.actions.two { grid-template-columns: 1fr 1fr; }
.steps { display: flex; gap: 4px; margin: 10px 0 4px; }
.steps span {
  flex: 1; text-align: center; font-size: 10px; font-weight: 800; color: #66756e;
  position: relative; padding-top: 12px; line-height: 1.15;
}
.steps span::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 0; height: 4px; border-radius: 99px; background: #2c3833;
}
.steps span.on { color: var(--green); }
.steps span.on::before, .steps span.done::before { background: var(--green); }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: #121916ee; backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
@media (min-width: 860px) {
  body[data-app="motoboy"] .tabs { max-width: 430px; margin: 0 auto; }
}
.tabs button {
  background: none; border: 0; color: var(--muted); font-size: 11px; font-weight: 800;
  display: grid; justify-items: center; gap: 3px; min-height: 48px; min-width: 0;
}
.tabs button.on { color: var(--green); }
.tabs .qr {
  width: 68px; height: 68px; border-radius: 50%; margin-top: -34px;
  background: var(--green); color: var(--green-ink); border: 4px solid #101614;
  display: grid; place-items: center; box-shadow: 0 10px 24px rgba(34,229,106,.35);
}
.modal {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.62);
  display: grid; place-items: end center; padding: 16px;
}
.sheet {
  width: min(430px, 100%); background: #1a120f; border-radius: 28px 28px 22px 22px;
  padding: 22px 18px 18px; border: 1px solid rgba(255,80,60,.35);
  box-shadow: 0 0 80px rgba(255,40,20,.25);
}
.sheet.warn { background: #24180c; border-color: rgba(245,185,66,.4); }
.sheet h3 { margin: 8px 0; font-size: 28px; letter-spacing: -.03em; }
.finder {
  margin: 12px auto; width: min(68vw, 260px); aspect-ratio: 1;
  border-radius: 18px; position: relative; overflow: hidden; background: #000;
}
.finder video { width: 100%; height: 100%; object-fit: cover; }
.finder i { position: absolute; width: 28px; height: 28px; border: 4px solid var(--green); }
.finder i:nth-child(2) { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.finder i:nth-child(3) { right: 10px; top: 10px; border-left: 0; border-bottom: 0; }
.finder i:nth-child(4) { left: 10px; bottom: 10px; border-right: 0; border-top: 0; }
.finder i:nth-child(5) { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }
.list { display: grid; gap: 8px; padding: 0 16px 16px; }
.item {
  background: var(--card); border-radius: 16px; padding: 12px 14px; border: 1px solid var(--line);
  display: grid; gap: 2px;
}
.filters { display: flex; gap: 8px; padding: 8px 16px 12px; }
.filters button { flex: 1; border-radius: 999px; border: 0; min-height: 40px; background: #24302b; color: var(--muted); font-weight: 800; }
.filters button.on { background: var(--green); color: var(--green-ink); }
.mapbox { height: min(62dvh, 560px); margin: 0 16px 12px; border-radius: 22px; overflow: hidden; background: #0d1411; border: 1px solid var(--line); }
.leaflet-container { background: #0d1411; font: inherit; }
.note { color: var(--warn); font-size: 13px; font-weight: 700; }
.err { color: #ffb4b4; font-size: 14px; min-height: 1.2em; }
.pin {
  letter-spacing: .4em; font-size: 28px; text-align: center; font-weight: 800;
}
.banner {
  margin: 8px 16px; padding: 12px 14px; border-radius: 16px;
  background: #14261c; border: 1px solid rgba(34,229,106,.3); font-weight: 700;
}
@media (max-width: 359px) {
  h1 { font-size: 28px; }
  .stat b { font-size: 22px; }
  .actions.two { grid-template-columns: 1fr; }
  .tabs .qr { width: 52px; height: 52px; margin-top: -22px; border-width: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
body.embed { background: #101614; }
body.embed .app { max-width: none; box-shadow: none; padding-bottom: 12px; }
