/* ============================================================
   App do barbeiro (PWA) — pensado para celular, uso com uma mão.
   Cores de situação sempre acompanhadas de texto.
   ============================================================ */
:root {
  --ink: #0b0b0b;
  --s1: #141414;
  --s2: #1d1d1d;
  --s3: #2a2a2a;
  --linha: rgba(255, 255, 255, .09);
  --bone: #f6f3ec;
  --t2: #bdb9b1;
  --t3: #85827b;
  --brass: #c9a227;
  --brass-2: #e3c35a;
  --pendente: #f0a03c;
  --confirmado: #6aa6f5;
  --concluido: #46bf82;
  --faltou: #ef5d52;
  --cancelado: #6f6c66;
  --wa: #25d366;
  --raio: 16px;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --corpo: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --abas-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--bone); font-family: var(--corpo); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { min-height: 100svh; overscroll-behavior-y: contain; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass-2); outline-offset: 2px; }

/* ---------- botões ---------- */
.bt { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--linha); background: var(--s2); font-weight: 800; font-size: 15px; text-decoration: none; transition: transform .1s, background .15s; }
.bt:active { transform: scale(.97); }
.bt:disabled { opacity: .45; }
.bt--claro { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.bt--ok { background: rgba(70,191,130,.15); color: var(--concluido); border-color: rgba(70,191,130,.4); }
.bt--falta { color: var(--faltou); }
.bt--wa { background: rgba(37,211,102,.12); color: #3fdc7d; border-color: rgba(37,211,102,.4); }
.bt--latao { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.bt--grande { width: 100%; min-height: 52px; font-size: 16px; }
.bt--linha { background: transparent; }

/* ---------- login / convite ---------- */
.tela--centro { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(60% 40% at 50% 20%, rgba(201,162,39,.16), transparent 70%); }
.cartao-login { width: min(400px, 100%); display: grid; gap: 14px; text-align: center; }
.cartao-login img { margin: 0 auto; border-radius: 24px; }
.cartao-login h1 { margin: 0 0 8px; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 38px; line-height: 1; display: grid; gap: 6px; }
.cartao-login h1 small { font-family: var(--corpo); font-size: 13px; letter-spacing: .2em; color: var(--brass-2); font-weight: 800; }
.campo { display: grid; gap: 6px; text-align: left; }
.campo > span { font-size: 13px; font-weight: 700; color: var(--t2); }
.campo input, .campo select, .campo textarea { width: 100%; min-height: 50px; background: var(--s1); border: 1px solid var(--s3); border-radius: 12px; padding: 12px 14px; font-size: 16px; color-scheme: dark; }
.campo textarea { min-height: 96px; resize: vertical; }
.campo input:focus, .campo textarea:focus, .campo select:focus { outline: none; border-color: var(--brass); }
.erro { margin: 0; min-height: 1.2em; color: #ff8f86; font-weight: 700; font-size: 14px; }
.nota { margin: 0; color: var(--t3); font-size: 13px; }

/* ---------- estrutura ---------- */
.topo { position: sticky; top: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 16px 12px; background: rgba(11,11,11,.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--linha); }
.topo__ola { margin: 0; color: var(--t3); font-size: 13px; font-weight: 700; }
.topo__titulo { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 32px; line-height: 1.05; }
.topo__atualizar { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--linha); background: var(--s1); font-size: 20px; }
.topo__atualizar.gira { animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.conteudo { padding: 16px 16px calc(var(--abas-h) + 28px + env(safe-area-inset-bottom)); outline: none; max-width: 720px; margin: 0 auto; }
.abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--abas-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(16,16,16,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--linha); }
.abas a { display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--t3); font-size: 12px; font-weight: 800; }
.abas a i { font-style: normal; font-size: 20px; line-height: 1; }
.abas a[aria-current="page"] { color: var(--bone); }
.abas a[aria-current="page"] i { color: var(--brass-2); }

/* ---------- blocos ---------- */
.titulo-secao { margin: 22px 0 10px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--t3); display: flex; justify-content: space-between; align-items: center; }
.vazio { text-align: center; color: var(--t3); padding: 32px 12px; background: var(--s1); border-radius: var(--raio); border: 1px dashed var(--linha); }
.vazio strong { display: block; color: var(--bone); font-size: 17px; margin-bottom: 6px; }
.alerta { background: rgba(240,160,60,.1); color: var(--pendente); border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 14px; }

/* próximo cliente em destaque */
.proximo { background: linear-gradient(160deg, #2a2412, var(--s1) 60%); border: 1px solid rgba(201,162,39,.35); border-radius: 20px; padding: 18px; display: grid; gap: 12px; }
.proximo__rotulo { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-2); }
.proximo__hora { font-family: var(--display); font-size: 54px; line-height: .95; }
.proximo__nome { margin: 0; font-size: 22px; font-weight: 800; }
.proximo__serv { margin: 0; color: var(--t2); }
.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acoes--3 { grid-template-columns: repeat(3, 1fr); }

/* lista de horários */
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center; background: var(--s1); border: 1px solid var(--linha); border-radius: 14px; padding: 12px; position: relative; overflow: hidden; }
.item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--t3)); }
.item__hora { font-family: var(--display); font-size: 24px; line-height: 1; padding-left: 4px; }
.item__hora small { display: block; font-family: var(--corpo); font-size: 11px; color: var(--t3); font-weight: 700; margin-top: 4px; }
.item__info { min-width: 0; }
.item__info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__info span { display: block; color: var(--t3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__acao { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--linha); background: var(--s2); font-size: 18px; }
.item--feito { opacity: .6; }
.item--bloq { --c: var(--t3); background: repeating-linear-gradient(-45deg, var(--s1) 0 10px, #181818 10px 11px); }
.item--livre { --c: transparent; background: transparent; border-style: dashed; color: var(--t3); grid-template-columns: 62px 1fr; }
.st-pendente { --c: var(--pendente); } .st-confirmado { --c: var(--confirmado); } .st-concluido { --c: var(--concluido); }
.st-faltou { --c: var(--faltou); } .st-cancelado { --c: var(--cancelado); }
.selo { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--c); }
.selo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

/* dias */
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.dia { flex: none; width: 60px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--linha); background: var(--s1); display: grid; justify-items: center; gap: 2px; scroll-snap-align: start; }
.dia small { font-size: 11px; font-weight: 800; color: var(--t3); text-transform: uppercase; }
.dia strong { font-family: var(--display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.dia b { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }
.dia b.zero { background: transparent; }
.dia[aria-pressed="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.dia[aria-pressed="true"] small { color: var(--ink); }

.alternar { display: grid; grid-template-columns: 1fr 1fr; background: var(--s1); border: 1px solid var(--linha); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.alternar button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--t2); font-weight: 800; }
.alternar button[aria-pressed="true"] { background: var(--s3); color: var(--bone); }

/* agenda da equipe */
.equipe { display: grid; gap: 12px; }
.colega { background: var(--s1); border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px; }
.colega h3 { margin: 0 0 4px; font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.colega h3 small { color: var(--t3); font-weight: 700; font-size: 12px; }
.colega--eu { border-color: rgba(201,162,39,.4); }
.faixas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.faixa { font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--s2); border-left: 3px solid var(--c, var(--t3)); }
.faixa--livre { background: rgba(70,191,130,.1); color: var(--concluido); border-left-color: var(--concluido); font-weight: 700; }
.faixa--bloq { color: var(--t3); }

/* números */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: var(--s1); border: 1px solid var(--linha); border-radius: var(--raio); padding: 14px; }
.card--largo { grid-column: 1 / -1; }
.card p { margin: 0; }
.card__rot { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--t3); }
.card__val { font-family: var(--display); font-size: 34px; line-height: 1.05; margin-top: 6px !important; font-variant-numeric: tabular-nums; }
.card__pe { color: var(--t2); font-size: 13px; margin-top: 2px !important; }

/* mais */
.opcoes { list-style: none; margin: 0; padding: 0; background: var(--s1); border: 1px solid var(--linha); border-radius: var(--raio); overflow: hidden; }
.opcoes li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--linha); min-height: 60px; }
.opcoes li:first-child { border-top: 0; }
.opcoes li div { min-width: 0; }
.opcoes strong { display: block; }
.opcoes span { display: block; color: var(--t3); font-size: 13px; }
.chave { position: relative; width: 50px; height: 30px; flex: none; }
.chave input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.chave span { position: absolute; inset: 0; border-radius: 99px; background: var(--s3); transition: background .2s; }
.chave span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--bone); transition: transform .2s; }
.chave input:checked + span { background: var(--wa); }
.chave input:checked + span::after { transform: translateX(20px); }

/* folha (bottom sheet) */
.folha { padding: 0; border: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92svh; background: transparent; color: var(--bone); }
.folha::backdrop { background: rgba(0,0,0,.6); }
.folha__caixa { position: relative; background: var(--s1); border-radius: 22px 22px 0 0; border-top: 1px solid var(--linha); padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92svh; overflow-y: auto; max-width: 720px; margin: 0 auto; animation: sobe .25s ease-out; }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.folha__alca { width: 44px; height: 5px; border-radius: 99px; background: var(--s3); margin: 0 auto 12px; }
.folha__x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--s2); }
.folha h2 { margin: 6px 48px 4px 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 28px; line-height: 1.05; }
.folha .pilha { display: grid; gap: 12px; margin-top: 12px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini div { background: var(--s2); border-radius: 12px; padding: 10px; text-align: center; }
.mini strong { display: block; font-family: var(--display); font-size: 24px; font-weight: 400; }
.mini span { font-size: 12px; color: var(--t3); }
.historico { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.historico li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 10px 12px; background: var(--s2); border-radius: 10px; }
.historico li span { color: var(--t3); }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* aviso (toast) */
.aviso { position: fixed; left: 50%; bottom: calc(var(--abas-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: var(--bone); color: var(--ink); font-weight: 800; padding: 12px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.aviso.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.nota--espaco { margin-top: 14px; }
.nota--centro { text-align: center; margin-top: 18px; }
.lista--passados { margin: 10px 0 18px; }
/* WhatsApp da barbearia desconectado */
.faixa-erro { display: grid; gap: 6px; background: rgba(239,93,82,.14); border: 1px solid rgba(239,93,82,.5); color: #ffc1bc; border-radius: var(--raio); padding: 14px; margin-bottom: 16px; }
.faixa-erro strong { color: #ffd6d2; font-size: 16px; }
.faixa-erro .bt { margin-top: 6px; }
.faixa-erro--info { background: rgba(201,162,39,.12); border-color: rgba(201,162,39,.45); color: var(--t2); }
.faixa-erro--info strong { color: var(--brass-2); }
.codigo { display: grid; gap: 4px; text-align: center; background: var(--s2); border-radius: 14px; padding: 16px; }
.codigo span { color: var(--t3); font-size: 13px; font-weight: 700; }
.codigo strong { font-family: var(--display); font-weight: 400; font-size: 44px; letter-spacing: .16em; color: var(--brass-2); }
.passos { margin: 0; padding-left: 20px; color: var(--t2); display: grid; gap: 6px; font-size: 14px; }
.qr-app summary { color: var(--t3); font-weight: 700; cursor: pointer; }
.qr-app img { display: block; margin: 12px auto 0; background: #fff; padding: 8px; border-radius: 12px; width: min(240px, 100%); height: auto; }

/* sino e central de notificações */
.topo__acoes { display: flex; gap: 8px; }
.topo__sino { position: relative; font-size: 18px; }
.topo__sino b { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--faltou); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--ink); }
.notif { width: 100%; display: grid; grid-template-columns: 46px 1fr; gap: 10px; text-align: left; background: var(--s1); border: 1px solid var(--linha); border-radius: 14px; padding: 12px; color: var(--t2); }
.notif--nova { border-color: rgba(201,162,39,.45); background: linear-gradient(160deg, #221d10, var(--s1) 70%); color: var(--bone); }
.notif__hora { font-size: 12px; font-weight: 800; color: var(--t3); padding-top: 2px; }
.notif__corpo { display: grid; gap: 2px; min-width: 0; }
.notif__corpo strong { font-size: 15px; }
.notif__corpo span { font-size: 13px; color: var(--t3); }

/* ajuda */
.topo__ajuda { font-family: var(--display); font-size: 22px; color: var(--brass-2); }
.ajuda { display: grid; gap: 8px; margin-top: 8px; }
.ajuda__resumo { margin: 0; font-size: 16px; font-weight: 700; color: var(--bone); }
.ajuda__sub { margin: 12px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--t3); }
.ajuda__passos, .ajuda__dicas { margin: 0; padding-left: 22px; display: grid; gap: 10px; color: var(--t2); line-height: 1.5; }
.ajuda__dicas li::marker { content: "💡 "; }
.ajuda__chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* meu almoço */
.acoes-dia { display: flex; gap: 6px; }
.acoes-dia .bt { min-height: 36px; padding: 0 10px; font-size: 13px; }
.chips-dias { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-dias button { min-width: 46px; min-height: 40px; border-radius: 10px; border: 1px solid var(--linha); background: var(--s2); color: var(--t2); font-weight: 800; }
.chips-dias button[aria-pressed="true"] { background: var(--bone); color: var(--ink); border-color: var(--bone); }
