/* Brother's Rider — tema asfalto + seta laranja */
:root {
  --bg: #121214;
  --bg-2: #1a1a1e;
  --card: #1f1f24;
  --card-2: #26262c;
  --line: #2f2f37;
  --txt: #f1f1f3;
  --txt-2: #a3a3ad;
  --txt-3: #6e6e78;
  --acc: #ff6b1a;
  --acc-2: #ff8a45;
  --acc-ink: #1a0d04;
  --ok: #34c77b;
  --warn: #f5b83d;
  --bad: #ff4d5e;
  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-d: "Barlow Condensed", "Inter", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 15px/1.5 var(--font);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  -webkit-tap-highlight-color: transparent;
}
body.sem-nav { padding-bottom: 24px; }
a { color: var(--acc-2); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 700; letter-spacing: .3px; line-height: 1.15; margin: 0; }
h1 { font-size: 30px; text-transform: uppercase; }
h2 { font-size: 21px; text-transform: uppercase; }
h3 { font-size: 18px; }
p { margin: 0 0 10px; }
small, .muted { color: var(--txt-2); }
.dim { color: var(--txt-3); }

/* ----- topo ----- */
.topo {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  background: rgba(18,18,20,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 8px; color: var(--txt); font-family: var(--font-d); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: 1px; }
.marca svg { width: 26px; height: 26px; }
.topo .esp { flex: 1; }
.topo .voltar { color: var(--txt); display: flex; align-items: center; margin-left: -6px; padding: 4px; }
.topo .titulo-pg { font-family: var(--font-d); font-size: 20px; font-weight: 700; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--acc), #c2410c);
  color: var(--acc-ink); font-weight: 800; font-size: 13px; letter-spacing: .5px;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ----- layout ----- */
main { max-width: 680px; margin: 0 auto; padding: 16px; }
.secao { margin: 26px 0 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.secao:first-child { margin-top: 4px; }
.secao a { font-size: 13px; font-weight: 600; }
.pilha > * + * { margin-top: 10px; }
.linha { display: flex; align-items: center; gap: 10px; }
.linha.wrap { flex-wrap: wrap; }
.entre { justify-content: space-between; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grade-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* ----- cards ----- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: block; color: var(--txt);
}
a.card:active { background: var(--card-2); }
.card.flat { background: var(--bg-2); }
.card + .card { margin-top: 10px; }
.vazio { text-align: center; padding: 28px 18px; color: var(--txt-2); border: 1px dashed var(--line); border-radius: var(--radius); }
.vazio .ico { font-size: 34px; margin-bottom: 6px; }

/* card de rolê */
.role-card { position: relative; padding-left: 74px; min-height: 82px; }
.role-card .data-chip {
  position: absolute; left: 14px; top: 14px; width: 48px; text-align: center;
  border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); padding: 4px 0 5px;
}
.data-chip .d { font-family: var(--font-d); font-size: 24px; font-weight: 800; line-height: 1; }
.data-chip .m { font-size: 11px; text-transform: uppercase; color: var(--acc-2); font-weight: 700; letter-spacing: .6px; }
.role-card h3 { margin-bottom: 2px; }
.role-card .meta { font-size: 13px; color: var(--txt-2); }
.role-card.passado { opacity: .72; }
.role-card.destaque { border-color: rgba(255,107,26,.55); background: linear-gradient(160deg, rgba(255,107,26,.13), var(--card) 55%); }

/* chips e badges */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--card-2); color: var(--txt-2); border: 1px solid var(--line); }
.chip.acc { background: rgba(255,107,26,.15); color: var(--acc-2); border-color: rgba(255,107,26,.35); }
.chip.ok { background: rgba(52,199,123,.14); color: var(--ok); border-color: rgba(52,199,123,.35); }
.chip.warn { background: rgba(245,184,61,.14); color: var(--warn); border-color: rgba(245,184,61,.35); }
.chip.bad { background: rgba(255,77,94,.14); color: var(--bad); border-color: rgba(255,77,94,.35); }

/* stats */
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.stat .v { font-family: var(--font-d); font-size: 26px; font-weight: 800; line-height: 1.05; }
.stat .l { font-size: 11px; color: var(--txt-2); text-transform: uppercase; letter-spacing: .6px; }

/* ----- botões ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card-2); color: var(--txt); font: 600 15px var(--font); cursor: pointer;
  text-align: center; white-space: nowrap; transition: transform .08s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); font-weight: 700; }
.btn.pri:active { background: var(--acc-2); }
.btn.ghost { background: transparent; }
.btn.bad { background: transparent; color: var(--bad); border-color: rgba(255,77,94,.4); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.bloco { display: flex; width: 100%; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.btn svg { width: 18px; height: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--txt-3); font: inherit; font-size: 13px; cursor: pointer; }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25;
  width: 56px; height: 56px; border-radius: 18px; background: var(--acc); color: var(--acc-ink);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(255,107,26,.35);
}
.fab svg { width: 26px; height: 26px; }

/* presença segmentada */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); color: var(--txt); font: 700 14px var(--font); cursor: pointer; }
.seg button.on.vou { background: var(--ok); border-color: var(--ok); color: #04150c; }
.seg button.on.talvez { background: var(--warn); border-color: var(--warn); color: #1d1402; }
.seg button.on.nao { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ----- forms ----- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--txt-2); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--txt);
  font: 16px var(--font); outline: none; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--txt-2) 50%), linear-gradient(135deg, var(--txt-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; border-radius: 6px; flex: none; position: relative; }
input[type="checkbox"]:checked { background: var(--acc); border-color: var(--acc); }
input[type="checkbox"]:checked::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid var(--acc-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--txt); font-weight: 500; margin-top: 14px; }
.ajuda { font-size: 12px; color: var(--txt-3); margin-top: 5px; }
.acoes { display: flex; gap: 10px; margin-top: 20px; }
.acoes .btn { flex: 1; }
input[type="file"] { padding: 9px; font-size: 14px; }
details.form-sanfona { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
details.form-sanfona > summary { list-style: none; padding: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
details.form-sanfona > summary::-webkit-details-marker { display: none; }
details.form-sanfona > summary::after { content: "+"; font-size: 22px; color: var(--acc); line-height: 1; }
details.form-sanfona[open] > summary::after { content: "−"; }
details.form-sanfona > .corpo { padding: 0 14px 14px; }

/* ----- flash ----- */
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 14px; border: 1px solid; }
.flash.ok { background: rgba(52,199,123,.1); border-color: rgba(52,199,123,.35); color: #8de8b6; }
.flash.erro { background: rgba(255,77,94,.1); border-color: rgba(255,77,94,.35); color: #ffa0aa; }

/* ----- nav inferior ----- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(22,22,25,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--txt-3); font-size: 11px; font-weight: 600; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--acc); }

/* ----- mapa ----- */
.mapa { height: 260px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); z-index: 1; }
.mapa.alto { height: 340px; }
.leaflet-container { background: #1b1b1f !important; font: 13px var(--font) !important; }
.leaflet-tile-pane { filter: brightness(.82) contrast(1.08) saturate(.7); }
.leaflet-control-attribution { background: rgba(18,18,20,.75) !important; color: var(--txt-3) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--txt-2) !important; }
.leaflet-bar a { background: var(--card) !important; color: var(--txt) !important; border-color: var(--line) !important; }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.pin span { transform: rotate(45deg); font-size: 13px; font-weight: 800; color: #fff; }
.pin.a { background: var(--ok); }
.pin.b { background: var(--acc); }
.modo-mapa { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.modo-mapa button { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-2); color: var(--txt-2); font: 600 13px var(--font); cursor: pointer; }
.modo-mapa button.on[data-modo="a"] { border-color: var(--ok); color: var(--ok); background: rgba(52,199,123,.1); }
.modo-mapa button.on[data-modo="b"] { border-color: var(--acc); color: var(--acc-2); background: rgba(255,107,26,.1); }
.busca { display: flex; gap: 8px; margin-bottom: 8px; }
.busca input { flex: 1; }
.resultados { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.resultados button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--txt); font: 13px var(--font); cursor: pointer; }
.resultados button:last-child { border-bottom: 0; }
.rota-info { font-size: 13px; color: var(--txt-2); margin-top: 6px; min-height: 20px; }

/* ----- pessoas ----- */
.pessoa { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--txt); }
.pessoa:last-child { border-bottom: 0; }
.pessoa .nome { font-weight: 600; }
.pessoa .sub { font-size: 12px; color: var(--txt-2); }
.pessoa .fim { margin-left: auto; }
.avatares { display: flex; }
.avatares .avatar { border: 2px solid var(--card); margin-left: -8px; }
.avatares .avatar:first-child { margin-left: 0; }

/* ----- garagem ----- */
.moto-card { padding: 0; overflow: hidden; }
.moto-card .foto { aspect-ratio: 16/9; background: var(--bg-2) center/cover no-repeat; position: relative; display: grid; place-items: center; color: var(--txt-3); }
.moto-card .foto svg { width: 64px; height: 64px; opacity: .5; }
.moto-card .foto .chip { position: absolute; top: 10px; right: 10px; }
.moto-card .corpo { padding: 14px; }
.moto-card h3 { font-size: 22px; text-transform: uppercase; }
.hodometro {
  font-family: var(--font-d); font-weight: 800; font-size: 34px; letter-spacing: 2px; line-height: 1;
  background: #0b0b0c; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: inline-block;
  color: var(--acc-2); font-variant-numeric: tabular-nums;
}
.hodometro small { font-size: 14px; color: var(--txt-3); letter-spacing: 1px; margin-left: 4px; }
.lem { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lem:last-child { border-bottom: 0; }
.lem .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lem .dot.ok { background: var(--ok); }
.lem .dot.em_breve { background: var(--warn); box-shadow: 0 0 0 4px rgba(245,184,61,.18); }
.lem .dot.vencido { background: var(--bad); box-shadow: 0 0 0 4px rgba(255,77,94,.2); }
.lem .info { flex: 1; min-width: 0; }
.lem .tipo { font-weight: 600; }
.lem .quando { font-size: 12px; color: var(--txt-2); }
.lem .barra { height: 4px; border-radius: 4px; background: var(--card-2); margin-top: 6px; overflow: hidden; }
.lem .barra i { display: block; height: 100%; background: var(--ok); }
.lem .barra i.em_breve { background: var(--warn); }
.lem .barra i.vencido { background: var(--bad); }
.servico { padding: 12px 0; border-bottom: 1px solid var(--line); }
.servico:last-child { border-bottom: 0; }
.servico .cab { display: flex; justify-content: space-between; gap: 10px; }
.servico .tipo { font-weight: 600; }
.servico .det { font-size: 13px; color: var(--txt-2); }
.alerta-manut { display: flex; align-items: center; gap: 12px; color: var(--txt); }
.alerta-manut .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex: none; }
.alerta-manut .ico.vencido { background: rgba(255,77,94,.15); }
.alerta-manut .ico.em_breve { background: rgba(245,184,61,.15); }

/* ----- mural ----- */
.post { padding: 0; overflow: hidden; }
.post .cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post .cab .quem { font-weight: 600; font-size: 14px; color: var(--txt); }
.post .cab .quando { font-size: 12px; color: var(--txt-3); }
.post .foto { background: #000; }
.post .foto img { width: 100%; max-height: 520px; object-fit: contain; margin: 0 auto; }
.post .texto { padding: 12px 14px 0; white-space: pre-wrap; word-wrap: break-word; }
.post .acoes-post { display: flex; align-items: center; gap: 16px; padding: 10px 14px; }
.post .acoes-post button { background: none; border: 0; color: var(--txt-2); display: flex; align-items: center; gap: 6px; font: 600 14px var(--font); cursor: pointer; padding: 4px 0; }
.post .acoes-post button.curti { color: var(--acc); }
.post .acoes-post svg { width: 22px; height: 22px; }
.post .coms { padding: 0 14px 12px; font-size: 14px; }
.post .coms .c { margin-bottom: 4px; }
.post .coms .c b { margin-right: 4px; }
.post .com-form { display: flex; gap: 8px; padding: 0 14px 14px; }
.post .com-form input { min-height: 38px; padding: 8px 12px; font-size: 14px; }
.post .com-form button { min-height: 38px; }
.tag-role { display: inline-flex; gap: 4px; margin: 0 14px; font-size: 12px; }
.compor textarea { min-height: 70px; }
.compor .linha-ferr { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.foto-btn { position: relative; overflow: hidden; }
.foto-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.preview-foto { margin-top: 10px; border-radius: 12px; max-height: 220px; object-fit: cover; width: 100%; display: none; }

/* ----- ranking ----- */
.podio { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 8px; align-items: end; margin: 8px 0 18px; }
.podio .lugar { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 6px 12px; }
.podio .lugar.p1 { border-color: rgba(255,107,26,.6); background: linear-gradient(180deg, rgba(255,107,26,.2), var(--card)); padding-top: 22px; }
.podio .med { font-size: 26px; }
.podio .avatar { margin: 6px auto; }
.podio .nm { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podio .km { font-family: var(--font-d); font-size: 20px; font-weight: 800; color: var(--acc-2); }
.rank-linha { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--txt); }
.rank-linha .pos { width: 26px; font-family: var(--font-d); font-weight: 800; font-size: 20px; color: var(--txt-3); text-align: center; }
.rank-linha .info { flex: 1; min-width: 0; }
.rank-linha .km { font-family: var(--font-d); font-weight: 800; font-size: 20px; text-align: right; }
.rank-linha .km small { display: block; font-family: var(--font); font-weight: 500; font-size: 11px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.tabs a { text-align: center; padding: 8px 0; border-radius: 9px; color: var(--txt-2); font-weight: 600; font-size: 13px; }
.tabs a.on { background: var(--card-2); color: var(--txt); }

/* ----- auth ----- */
.auth { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: 32px 20px; }
.auth .hero { text-align: center; margin-bottom: 28px; }
.auth .hero svg { width: 64px; height: 64px; margin: 0 auto 10px; display: block; }
.auth .hero h1 { font-size: 40px; letter-spacing: 2px; }
.auth .hero p { color: var(--txt-2); }
.faixa { height: 4px; background: repeating-linear-gradient(90deg, var(--acc) 0 26px, transparent 26px 44px); border-radius: 2px; margin: 0 auto 22px; width: 160px; opacity: .8; }

.convite-box { font-family: var(--font-d); font-size: 26px; font-weight: 800; letter-spacing: 3px; text-align: center; padding: 12px; border: 1px dashed var(--acc); border-radius: 12px; color: var(--acc-2); }

@media (min-width: 720px) {
  .nav { left: 50%; transform: translateX(-50%); max-width: 680px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 18px 18px 0 0; }
  .fab { right: calc(50% - 322px); }
}

.ico22 { width: 22px; height: 22px; flex: none; color: var(--acc); display: inline-flex; }
.ico22 svg { width: 22px; height: 22px; }
.km-linha { flex-wrap: wrap; gap: 10px; }
.km-linha form { flex: 1; min-width: 170px; justify-content: flex-end; }
.km-linha form input { flex: 1; min-width: 0; }

/* convidados e reset de senha */
.check.convidado { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check.convidado:last-of-type { border-bottom: 0; }
details.reset { position: relative; }
details.reset > summary { list-style: none; color: var(--txt-2); }
details.reset > summary::-webkit-details-marker { display: none; }
details.reset[open] > summary { color: var(--acc); border-color: var(--acc); }
.reset-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 230px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
