/* Barbearia Manu's — estilo «true-black-flat» (taste skill, seed 1785787752) com a cara da casa:
   fundo quase preto quente (couro da cadeira), um só tom latão e só nos dados (horas livres, horas ocupadas).
   Profundidade só por degraus de luz, sem sombras em repouso. O botão principal é branco (inversão).
   Letra maior que o estudo (17px) porque muitos clientes são mais velhos; alvos de toque ≥ 52px. */
:root {
  --ground: #0e0d0c; --surface: #181716; --raised: #252321; --rule: #262422; --control: #4a4744;
  --text: #ffffff; --muted: #bdb8b1; --faint: #9c968f;
  --accent: #d9ab5c;                         /* latão: só em dados */
  --accent-bg: #2a2214; --accent-ink: #e6bd72;
  --negative: #f0686c; --neutral-bg: #2c2a27;
  --radius-card: 20px; --radius-control: 999px; --radius-field: 14px;
  --font: "Inter", system-ui, sans-serif; --marca: "DM Serif Display", Georgia, serif;
  --gap: 14px; --pad: 20px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--text); font: 400 17px/1.5 var(--font);
  padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* Barra de topo: marca à esquerda, nota à direita, na mesma coluna do conteúdo */
.barra {
  max-width: 560px; margin: 0 auto; height: 56px; padding: env(safe-area-inset-top) 20px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.marca { font: 400 26px/1 var(--marca); letter-spacing: -0.01em; }
.barra-nota { color: var(--faint); font-size: 14px; }
.barra-direita { display: flex; align-items: center; gap: 14px; }
.barra-direita .voltar-hoje { font-size: 14px; min-height: 44px; }
main { max-width: 560px; margin: 0 auto; padding: 8px 20px 0; }
h1 { margin: 16px 0 4px; font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; }
.sub { margin: 0 0 20px; color: var(--muted); font-size: 16px; }

/* Blocos: cartões um degrau acima do fundo */
.bloco { background: var(--surface); border-radius: var(--radius-card); padding: var(--pad); margin-bottom: var(--gap); }
.bloco h2 { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.grupo { margin: 0 0 8px; color: var(--muted); font-size: 15px; }
.grupo:not(:first-child) { margin-top: 16px; }

/* Opções (barbeiro, dia, hora): escolhida = branco com texto preto */
.opcoes { display: flex; gap: 8px; }
.opcao {
  min-height: 52px; padding: 0 16px; border: 0; border-radius: var(--radius-control);
  background: var(--raised); color: var(--text); font-weight: 500; transition: background .15s, transform .1s;
}
.opcao:active { transform: scale(.97); }
.opcao[aria-pressed="true"] { background: var(--text); color: #000; }
.barbeiros { display: grid; grid-template-columns: 1fr 1fr; }
.barbeiros .opcao:last-child { grid-column: 1 / -1; }
.dias { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 4px; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dia {
  flex: 0 0 72px; min-height: 92px; padding: 10px 0; border-radius: 18px;
  display: grid; justify-items: center; align-content: center; gap: 2px; line-height: 1.15;
}
.dia .semana { font-size: 14px; color: var(--muted); }
.dia .numero { font-size: 22px; font-weight: 600; }
.dia .livres { font-size: 13px; color: var(--accent); font-weight: 500; }
.dia[aria-pressed="true"] .semana, .dia[aria-pressed="true"] .livres { color: #000; }
.dia:disabled { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); cursor: default; }
.dia:disabled .numero, .dia:disabled .livres { color: var(--faint); }
.horas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.horas .opcao { font-size: 18px; font-weight: 600; padding: 0; }
.aviso { color: var(--muted); margin: 4px 0 0; }

/* Campos */
label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 15px; font-weight: 500; }
input + label { margin-top: 16px; }
input, select {
  width: 100%; min-height: 56px; padding: 0 16px; border: 1px solid var(--control); border-radius: var(--radius-field);
  background: var(--ground); font-size: 18px;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--text); }

.resumo-escolha { margin: 20px 0 0; font-size: 17px; }
.botao {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; margin-top: 16px;
  border: 0; border-radius: var(--radius-control); background: var(--text); color: #000; font-size: 18px; font-weight: 600;
  text-decoration: none; transition: transform .1s, opacity .15s;
}
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .6; }
.botao.secundario { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--control); }
.erro { color: var(--negative); font-weight: 500; min-height: 1.5em; margin: 10px 0 0; }

/* Confirmação: o «talão» da marcação */
.talao h2 { font-size: 24px; margin: 0 0 18px; }
.talao .hora-grande { margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.talao .quando { margin: 8px 0 0; font-size: 18px; }
.talao .quem { margin: 2px 0 0; color: var(--muted); }
.rodape { max-width: 560px; margin: 8px auto 0; padding: 0 20px; color: var(--muted); font-size: 15px; }

/* ——— Agenda do barbeiro ——— */
.titulo-dia { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 16px 0 14px; }
.titulo-dia h1 { margin: 0; font-size: 24px; }
.titulo-dia .sub { margin: 2px 0 0; }
.voltar-hoje { border: 0; background: none; padding: 0; color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.navegar { display: flex; gap: 6px; flex: none; }
.seta { min-width: 44px; height: 44px; border: 0; border-radius: var(--radius-control); background: var(--raised); font-size: 15px; font-weight: 500; padding: 0 14px; }

/* Contadores por barbeiro (filtram a lista) com a faixa das 9 horas do dia */
.contadores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: var(--gap); }
.contador {
  text-align: left; border: 0; border-radius: 16px; padding: 12px 14px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s, background .15s;
}
.contador[aria-pressed="true"] { background: var(--accent-bg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.contador .quem { display: block; color: var(--muted); font-size: 14px; }
.contador .valor { display: block; font-size: 20px; font-weight: 600; margin-top: 2px; }
.contador .valor small { font-size: 14px; font-weight: 400; color: var(--muted); }
.faixa { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin-top: 10px; }
.faixa span { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.faixa span.ocupada { background: var(--accent); }

.lista { list-style: none; margin: 0; padding: 0 var(--pad); background: var(--surface); border-radius: var(--radius-card); }
.linha { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; min-height: 64px; padding: 12px 0; }
.linha + .linha { border-top: 1px solid var(--rule); }
.linha .hora { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.linha.livre .hora, .linha.livre .cliente-nome { color: var(--faint); font-weight: 400; }
.cliente-nome { font-weight: 600; }
.detalhe { color: var(--muted); font-size: 14px; margin-top: 2px; }
.lembrete { font-size: 14px; margin-top: 2px; color: var(--muted); }
.lembrete.enviado { color: var(--accent-ink); }
.lembrete.sem { color: var(--faint); }
.pilula { display: inline-block; font-size: 12px; font-weight: 500; border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 2px; }
.pilula.qr { background: var(--accent-bg); color: var(--accent-ink); }
.pilula.fora { background: var(--neutral-bg); color: var(--text); }
.acoes { display: flex; gap: 18px; margin-top: 6px; }
.acao {
  border: 0; background: none; padding: 6px 0; min-height: 36px; font-size: 15px; font-weight: 600;
  color: var(--text); text-decoration: none; display: inline-flex; align-items: center;
}
.acao.discreta { color: var(--muted); font-weight: 500; }
.acao.confirmar { color: var(--negative); }
.marcar-livre { border: 0; background: var(--raised); border-radius: var(--radius-control); min-height: 40px; padding: 0 16px; font-size: 15px; font-weight: 500; }
.nova { animation: nova 3s ease-out; }
@keyframes nova { from { background: var(--accent-bg); } to { background: transparent; } }
.carimbo { color: var(--faint); font-size: 14px; font-variant-numeric: tabular-nums; }

.flutuante {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 18px);
  width: auto; padding: 0 28px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.flutuante:active { transform: translateX(-50%) scale(.97); }
#agenda { padding-bottom: 96px; } /* a última linha não fica tapada pelo botão + Marcar */
dialog {
  border: 0; border-radius: var(--radius-card); padding: 22px; width: min(92vw, 460px);
  background: var(--surface); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog h2 { margin: 0 0 18px; font-size: 22px; font-weight: 600; }
.dados { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0 0 8px; font-size: 18px; }
.dados dt { color: var(--muted); font-size: 15px; padding-top: 2px; }
.dados dd { margin: 0; font-weight: 600; }
.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
