/* App dos encarregados — ADB. Uma folha só, sem dependências. Mobile primeiro; num ecrã largo fica ao centro. */
:root {
  --ink: #0E1116; --muted: #5B6170; --line: #E6E8EE; --ground: #F4F5F8; --card: #fff;
  --blue: #004AAD; --blue-d: #002E6E; --yellow: #F9E739;
  --ok: #0A7A3C; --ok-bg: #E3F3EA; --warn-bg: #FFF6C2; --warn: #5C4A00; --err: #B42318; --err-bg: #FDE8E7;
  --jogo: #E8A400; --treino: #4D8FF0;
  --r: 18px; --tab: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --narrow: 'Archivo Narrow', 'Archivo', 'Arial Narrow', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); }
body { font: 400 16px/1.4 'Archivo', system-ui, -apple-system, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; padding-bottom: calc(var(--tab) + var(--safe-b) + 24px); }
.arranque { min-height: 100vh; display: grid; place-items: center; }
.arranque img { animation: pulsa 1.2s ease-in-out infinite alternate; }
@keyframes pulsa { from { opacity: .35 } to { opacity: 1 } }

/* Cabeçalho */
.hd { display: flex; align-items: center; gap: 12px; padding: calc(14px + var(--safe-t)) 16px 6px; }
.hd .logo { width: 30px; height: 44px; flex: none; }
.hd .tt { flex: 1; min-width: 0; }
.hd .sub { font-size: 14px; color: var(--muted); font-weight: 600; }
.h1 { margin: 0; font: 700 30px/1.02 var(--narrow); text-transform: uppercase; letter-spacing: -.01em; }
.ibtn { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.ibtn.claro { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }

/* Seletor de atleta */
.sel { display: flex; gap: 8px; padding: 8px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.sel::-webkit-scrollbar { display: none; }
.pp { flex: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 14px 5px 5px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; }
.pp[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 800 13px 'Archivo'; color: #fff; flex: none; overflow: hidden; background: var(--muted); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.g { width: 52px; height: 52px; font-size: 17px; }
.avs { display: flex; }
.avs .av { width: 28px; height: 28px; font-size: 11px; border: 2px solid #fff; }
.avs .av + .av { margin-left: -10px; }

/* Blocos */
.sec { padding: 14px 16px 4px; }
.sec-t { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.sec-t h2 { margin: 0; font: 700 20px/1.1 var(--narrow); text-transform: uppercase; letter-spacing: .01em; }
.sec-t .ln { font-weight: 700; font-size: 15px; background: none; border: 0; color: var(--blue); padding: 8px 0; }
.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: 0 1px 0 rgba(14,17,22,.04); border: 1px solid var(--line); }
.stack > * + * { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.vazio { text-align: center; padding: 26px 18px; color: var(--muted); }
.vazio b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* Herói do próximo jogo */
.hero { background: var(--blue); color: #fff; border-radius: 22px; padding: 18px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -58px; top: -30px; width: 96px; height: 280px; background: var(--yellow); transform: skewX(-16deg); }
.hero > * { position: relative; z-index: 1; }
.hero .quando { font: 700 42px/.95 var(--narrow); text-transform: uppercase; margin: 10px 0 2px; max-width: 82%; }
.hero .contra { font-weight: 800; font-size: 19px; max-width: 82%; }
.hero .onde { font-size: 15px; opacity: .9; margin-top: 4px; max-width: 82%; }
.hero .pergunta { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.25); }
.hero .pergunta b { display: block; font-size: 17px; margin-bottom: 10px; }
.hero .linha { display: flex; gap: 10px; }
.hero.treino { background: var(--ink); }
.hero.treino::after { background: var(--treino); opacity: .5; }

/* Etiquetas */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font: 700 12.5px/1 'Archivo'; letter-spacing: .02em; text-transform: uppercase; background: var(--ground); color: var(--ink); white-space: nowrap; }
.chip.amarelo { background: var(--yellow); color: var(--ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.aviso { background: var(--warn-bg); color: var(--warn); }
.chip.erro { background: var(--err-bg); color: var(--err); }
.chip.jogo { background: #FFF1CC; color: #6B4A00; }
.chip.treino { background: #E4EEFF; color: #12408F; }
.chip.branco { background: rgba(255,255,255,.18); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Botões */
.btn { min-height: 52px; border-radius: 14px; border: 0; padding: 0 18px; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.b { width: 100%; }
.btn.f { flex: 1; }
.btn.pri { background: var(--yellow); color: var(--ink); }
.btn.azul { background: var(--blue); color: #fff; }
.btn.esc { background: var(--ink); color: #fff; }
.btn.sec { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.vidro { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.btn.peq { min-height: 44px; font-size: 15px; padding: 0 14px; border-radius: 12px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg) } }

/* Para resolver */
.todo { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); width: 100%; text-align: left; }
.todo .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--warn-bg); color: var(--warn); }
.todo .ic.err { background: var(--err-bg); color: var(--err); }
.todo .ic.az { background: #E4EEFF; color: var(--blue); }
.todo .tx { flex: 1; min-width: 0; }
.todo .tx b { display: block; font-size: 16px; }
.todo .tx span { font-size: 14px; color: var(--muted); }
.todo .go { font-weight: 800; color: var(--blue); font-size: 15px; white-space: nowrap; }

/* Semana */
.semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dia { border-radius: 14px; padding: 8px 0 9px; text-align: center; background: #fff; border: 1px solid var(--line); }
.dia .ds { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.dia .dn { font: 700 22px/1.1 var(--narrow); }
.dia.hoje { background: var(--ink); color: #fff; border-color: var(--ink); }
.dia.hoje .ds { color: #C9CDD6; }
.dia .pts { display: flex; justify-content: center; gap: 3px; height: 8px; margin-top: 3px; }
.pt { width: 8px; height: 8px; border-radius: 50%; }
.pt.j { background: var(--jogo); } .pt.t { background: var(--treino); }

/* Eventos */
.dia-t { font: 700 15px/1 'Archivo'; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.dia-t:first-child { margin-top: 4px; }
.ev { display: flex; gap: 12px; }
.ev .hr { width: 52px; flex: none; font: 700 20px/1 var(--narrow); padding-top: 2px; }
.ev .hr small { display: block; font: 600 12px 'Archivo'; color: var(--muted); margin-top: 3px; }
.ev .bd { flex: 1; min-width: 0; }
.ev .bd b { display: block; font-size: 16.5px; line-height: 1.25; }
.ev .acoes { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ev.cancelado .bd b, .ev.cancelado .hr { text-decoration: line-through; color: var(--muted); }
.barra { border-left: 4px solid var(--treino); padding-left: 12px; }
.barra.j { border-color: var(--jogo); }

/* Resultados */
.res { display: flex; align-items: center; gap: 12px; }
.res .pl { font: 700 34px/1 var(--narrow); min-width: 78px; text-align: center; padding: 8px 6px; border-radius: 12px; background: var(--ground); }
.res .pl.W { background: var(--ok-bg); color: var(--ok); }
.res .pl.L { background: var(--err-bg); color: var(--err); }

/* Segmentos */
.seg { display: flex; gap: 4px; margin: 6px 16px 0; padding: 4px; background: #E9EBF1; border-radius: 14px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 11px; background: transparent; font-weight: 700; font-size: 15px; color: var(--muted); }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(14,17,22,.12); }

/* Presenças */
.pct { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pct > div { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.pct b { display: block; font: 700 30px/1 var(--narrow); }
.pct span { font-size: 13px; color: var(--muted); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .c { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.cal .c.vz { background: transparent; border: 0; }
.cal .c.treinou { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.cal .c.jogou { background: var(--jogo); color: #fff; border-color: transparent; }
.cal .c.faltou { background: var(--err-bg); color: var(--err); border-color: transparent; }
.cal .c.hoje { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.cal .cab { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; text-transform: uppercase; }
.leg { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.leg i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

/* Pagar */
.divida { background: var(--ink); color: #fff; border-radius: 22px; padding: 18px; }
.divida .tot { font: 700 46px/1 var(--narrow); margin: 6px 0 2px; }
.lin { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.14); }
.lin:first-of-type { border-top: 0; }
.lin .tx { flex: 1; min-width: 0; }
.lin .tx span { display: block; font-size: 13.5px; opacity: .75; }
.lin .vl { font-weight: 800; white-space: nowrap; }
.chk { width: 28px; height: 28px; border-radius: 8px; border: 2px solid rgba(255,255,255,.6); display: grid; place-items: center; flex: none; background: transparent; color: var(--ink); padding: 0; }
.chk[aria-checked="true"] { background: var(--yellow); border-color: var(--yellow); }
.pago { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pago:first-child { border-top: 0; }
.pago .tx { flex: 1; min-width: 0; }
.ref { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 14px; align-items: center; font-size: 15px; }
.ref b { font: 700 24px/1 var(--narrow); letter-spacing: .02em; }
.copiar { border: 0; background: var(--ground); border-radius: 10px; min-height: 40px; padding: 0 12px; font-weight: 700; font-size: 14px; }

/* Folha (sheet) */
.veu { position: fixed; inset: 0; background: rgba(14,17,22,.5); z-index: 40; animation: aparece .15s ease-out; }
.folha { position: fixed; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto; background: #fff; border-radius: 24px 24px 0 0; z-index: 41; padding: 10px 18px calc(20px + var(--safe-b)); max-height: 92vh; overflow-y: auto; animation: sobe .22s cubic-bezier(.2,.9,.3,1); }
.folha .pega { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.folha h3 { margin: 0 0 4px; font: 700 26px/1.05 var(--narrow); text-transform: uppercase; }
.folha .x { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border: 0; background: var(--ground); border-radius: 12px; display: grid; place-items: center; }
@keyframes sobe { from { transform: translateY(40%); opacity: 0 } }
@keyframes aparece { from { opacity: 0 } }
.opc { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; text-align: left; min-height: 64px; }
.opc[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opc .ic, .pago .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--ground); display: grid; place-items: center; flex: none; text-align: center; line-height: 1; }
.opc .tx { flex: 1; }
.opc .tx b { display: block; }
.opc .tx span { font-size: 14px; color: var(--muted); }
.campo { display: block; margin-top: 12px; }
.campo span { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.campo input, .campo textarea { width: 100%; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); padding: 12px 14px; font-size: 17px; background: #fff; }
.campo textarea { min-height: 96px; resize: vertical; }
.campo input:focus, .campo textarea:focus { border-color: var(--blue); outline: none; }
.motivos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.motivos button { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 15px; }
.motivos button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.erro-c { color: var(--err); font-weight: 600; font-size: 14px; margin-top: 8px; }
.grande-ok { width: 76px; height: 76px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 10px auto 12px; }
.espera { width: 76px; height: 76px; border-radius: 50%; border: 6px solid var(--ground); border-top-color: var(--blue); margin: 10px auto 12px; animation: gira 1s linear infinite; }
.centro { text-align: center; }

/* Cartões (ecrã inteiro) */
.cartoes { position: fixed; inset: 0; background: var(--ink); color: #fff; z-index: 50; overflow-y: auto; padding-bottom: calc(24px + var(--safe-b)); animation: aparece .15s; }
.cartoes .in { max-width: 520px; margin: 0 auto; }
.cartoes .hd .ibtn { background: rgba(255,255,255,.12); }
.cartoes .pp { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.cartoes .pp[aria-pressed="true"] { background: #fff; color: var(--ink); border-color: #fff; }
.cc { margin: 12px 16px 0; border-radius: 22px; padding: 18px; min-height: 200px; display: flex; flex-direction: column; position: relative; overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.cc.at { background: var(--blue); }
.cc.at::after { content: ''; position: absolute; right: -50px; top: -40px; width: 120px; height: 300px; background: var(--yellow); transform: skewX(-18deg); }
.cc.so { background: var(--yellow); color: var(--ink); }
.cc > * { position: relative; z-index: 1; }
.cc .top { display: flex; align-items: center; gap: 10px; font: 700 13px var(--narrow); letter-spacing: .14em; text-transform: uppercase; }
.cc .top img { width: 28px; height: 42px; }
.cc .nome { font: 700 32px/.95 var(--narrow); text-transform: uppercase; margin-top: auto; padding-top: 22px; max-width: 75%; }
.cc .num { font-weight: 800; color: var(--yellow); margin-top: 4px; }
.cc.so .num { color: var(--blue-d); }
.qr { background: #fff; border-radius: 22px; margin: 16px 16px 0; padding: 14px; color: var(--ink); text-align: center; }
.qr svg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.qr p { margin: 6px 0 0; font-weight: 600; font-size: 14px; }

/* Barra de baixo */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs .in { max-width: 520px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.tabs button { height: var(--tab); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; font-weight: 700; color: var(--muted); position: relative; }
.tabs button[aria-current="page"] { color: var(--blue); }
.tabs button[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.tabs .bd { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 19px; height: 19px; border-radius: 10px; background: var(--err); color: #fff; font-size: 11.5px; display: grid; place-items: center; padding: 0 5px; }

/* Avisos */
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab) + var(--safe-b) + 12px); max-width: 488px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; font-weight: 600; z-index: 60; animation: sobe .2s; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.erro { background: var(--err); }
.offline { margin: 8px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); font-size: 14px; font-weight: 600; }

/* Atleta */
.perfil { display: flex; align-items: center; gap: 14px; }
.perfil .av { width: 64px; height: 64px; font-size: 20px; }
.perfil b { font: 700 24px/1.05 var(--narrow); text-transform: uppercase; display: block; }
.doc { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.doc:first-child { border-top: 0; }
.doc .tx { flex: 1; min-width: 0; }
.doc .tx b { display: block; font-size: 15.5px; }
.pessoa { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pessoa:first-child { border-top: 0; }
.dados { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dados span { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.dados b { font-size: 16px; }
.lista-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 4px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-weight: 700; text-decoration: none; color: var(--ink); }
.lista-btn:first-child { border-top: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 560px) { .app { box-shadow: 0 0 0 1px var(--line); background: var(--ground); } }
