/* Ajustes de layout aplicados por cima do build (levar para client/src quando o código-fonte estiver disponível) */

/* Catálogo no celular: nome do serviço em destaque na 1ª linha; preço e botões na 2ª */
@media (max-width: 640px) {
  div.flex.items-center.gap-3:has(> button[aria-label="Editar"]):has(> p.text-right) {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }
  div.flex.items-center.gap-3:has(> button[aria-label="Editar"]):has(> p.text-right) > div.min-w-0.flex-1 {
    flex: 1 1 calc(100% - 2.75rem);
  }
  div.flex.items-center.gap-3:has(> button[aria-label="Editar"]):has(> p.text-right) > div.min-w-0.flex-1 > p.truncate.font-semibold {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.3;
  }
  div.flex.items-center.gap-3:has(> button[aria-label="Editar"]):has(> p.text-right) > p.text-right {
    margin-left: 2.75rem;
    margin-right: auto;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
  }
  div.flex.items-center.gap-3:has(> button[aria-label="Editar"]):has(> p.text-right) > p.text-right > span.block {
    display: inline;
  }
}

/* Escolha do WhatsApp (ajustes.js) */
.aj-fundo { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgb(15 23 42 / 0.5); padding: 1rem; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem); }
.aj-folha { width: 100%; max-width: 28rem; display: flex; flex-direction: column; gap: 0.5rem; border-radius: 1.5rem; background: #fff; padding: 1.25rem; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35); font-family: Inter, system-ui, sans-serif; }
.aj-titulo { margin: 0 0 0.25rem; text-align: center; font-weight: 700; font-size: 1rem; color: #0f172a; }
.aj-botao { border: 0; border-radius: 0.9rem; padding: 0.85rem 1rem; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.aj-principal { background: #25D366; color: #fff; }
.aj-secundario { background: #e7f8ee; color: #128C7E; }
.aj-cancelar { border: 0; background: none; padding: 0.6rem; color: #64748b; font-weight: 600; cursor: pointer; }
.dark .aj-folha { background: #1e2330; }
.dark .aj-titulo { color: #f1f5f9; }
.dark .aj-secundario { background: rgb(37 211 102 / 0.12); color: #4ade80; }

/* Aviso "Atualizar" e dica do iPhone (ajustes.js) */
.aj-aviso { position: fixed; inset-inline: 0; bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); z-index: 55; display: flex; justify-content: center; padding: 0 1rem; pointer-events: none; }
.aj-aviso-caixa { pointer-events: auto; display: flex; max-width: 28rem; align-items: center; gap: 0.75rem; border-radius: 1rem; background: #1b1f2a; padding: 0.75rem 1rem; color: #fff; font-size: 0.875rem; box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.35); font-family: Inter, system-ui, sans-serif; }
.aj-aviso-caixa span { flex: 1; }
.aj-aviso-botao { border: 0; border-radius: 0.75rem; background: #1d338e; color: #fff; padding: 0.5rem 0.9rem; font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.dark .aj-aviso-caixa { background: #fff; color: #1b1f2a; }
.aj-dica { position: fixed; inset-inline: 1rem; top: calc(env(safe-area-inset-top, 0px) + 0.75rem); z-index: 55; margin: 0 auto; max-width: 28rem; border-radius: 1rem; background: #fff; padding: 1rem; box-shadow: 0 20px 40px -12px rgb(0 0 0 / 0.3); font-family: Inter, system-ui, sans-serif; color: #0f172a; }
.aj-dica-titulo { margin: 0 0 0.35rem; font-weight: 700; }
.aj-dica-texto { margin: 0 0 0.75rem; font-size: 0.85rem; color: #475569; line-height: 1.4; }
.dark .aj-dica { background: #1e2330; color: #f1f5f9; }
.dark .aj-dica-texto { color: #cbd5e1; }

/* Painel: "Hoje e amanhã" e o gráfico não podem passar da largura da tela */
@media (max-width: 1023px) {
  div.mt-5.grid.gap-5 { grid-template-columns: minmax(0, 1fr); }
  div.mt-5.grid.gap-5 > * { min-width: 0; }
}
/* endereço do serviço quebra em linhas em vez de esticar o cartão */
li > a .min-w-0.flex-1 > p.mt-0\.5.flex.items-center.gap-1.truncate {
  white-space: normal;
  align-items: flex-start;
  overflow-wrap: anywhere;
}
li > a .min-w-0.flex-1 > p.mt-0\.5.flex.items-center.gap-1.truncate > svg { margin-top: 0.1rem; }

@media (max-width: 640px) {
  /* valores dos cartões (lucro, a receber, saldo...) diminuem um pouco para caber valores grandes */
  .card.animate-entrar > div.mt-2.text-xl.font-extrabold.tabular-nums {
    font-size: clamp(1rem, 4.6vw, 1.25rem);
    white-space: nowrap;
  }
  /* atalhos "aguardando / para agendar / a receber" lado a lado, em 3 colunas */
  div.mt-3.grid.grid-cols-1.gap-3:has(> a.card) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }
  div.mt-3.grid.grid-cols-1.gap-3:has(> a.card) > a.card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem !important;
  }
  div.mt-3.grid.grid-cols-1.gap-3:has(> a.card) > a.card > span { padding: 0.45rem; }
  div.mt-3.grid.grid-cols-1.gap-3:has(> a.card) > a.card p.truncate {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  div.mt-3.grid.grid-cols-1.gap-3:has(> a.card) > a.card p.text-sm { font-size: 0.78rem; line-height: 1.2; }
  div.mt-3.grid.grid-cols-1.gap-3:has(> a.card) > a.card p.text-xs { font-size: 0.7rem; margin-top: 0.15rem; }
}

/* A página nunca rola para o lado: assim cabeçalho e barra inferior ficam sempre do tamanho da tela.
   "clip" (e não "hidden") para não quebrar o cabeçalho fixo (position: sticky) */
html, body { overflow-x: hidden; }
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; }
}
