:root {
    --fundo: #faf7f8;
    --cartao: #ffffff;
    --texto: #2b2329;
    --suave: #75686f;
    --borda: #e6dde1;
    --marca: #8f3f6b;
    --marca-texto: #ffffff;
    --ok-fundo: #e6f4ea;
    --ok-texto: #1d5c32;
    --erro-fundo: #fbe9e9;
    --erro-texto: #8c1d1d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--fundo);
    color: var(--texto);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--marca); }
h1 { font-size: 1.4rem; margin: 0 0 .75rem; }

.topo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .25rem 1rem;
    padding: .6rem 1rem;
    background: var(--cartao);
    border-bottom: 1px solid var(--borda);
}
.marca { font-weight: 700; text-decoration: none; }
.menu { order: 3; flex-basis: 100%; display: flex; gap: 1rem; overflow-x: auto; }
.menu a { padding: .35rem 0; white-space: nowrap; text-decoration: none; }
.topo form { margin-left: auto; }

.conteudo { max-width: 960px; margin: 0 auto; padding: 1rem; }
.cabecalho { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.cabecalho h1 { margin: 0; }
.suave { color: var(--suave); }
.alerta { color: var(--erro-texto); font-weight: 700; }

.aviso { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; }
.aviso-ok { background: var(--ok-fundo); color: var(--ok-texto); }
.aviso-erro { background: var(--erro-fundo); color: var(--erro-texto); }

.cartao {
    display: grid;
    gap: .9rem;
    padding: 1rem;
    background: var(--cartao);
    border: 1px solid var(--borda);
    border-radius: 10px;
}
.entrar { max-width: 360px; margin: 3rem auto; }

label { display: grid; gap: .25rem; font-weight: 600; }
label.marcar { display: flex; align-items: center; gap: .5rem; font-weight: 400; min-height: 2rem; }
label.linha { display: grid; grid-template-columns: 1fr 5.5rem auto; align-items: center; gap: .5rem; font-weight: 400; }
fieldset { border: 1px solid var(--borda); border-radius: 8px; margin: 0; }
legend { font-weight: 600; }

input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: .5rem .6rem;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1px solid var(--borda);
    border-radius: 8px;
}
input[type="checkbox"] { width: 1.2rem; min-height: 1.2rem; }
input[type="color"] { padding: .2rem; }
input.percentual { text-align: right; }

.botao {
    display: inline-block;
    min-height: 44px;
    padding: .55rem 1rem;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    color: var(--marca-texto);
    background: var(--marca);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.botao-leve { color: var(--marca); background: transparent; border: 1px solid var(--marca); }
.link { padding: 0; font: inherit; color: var(--marca); text-decoration: underline; background: none; border: 0; cursor: pointer; }

.busca { display: flex; gap: .5rem; margin-bottom: .75rem; }

.tabela { overflow-x: auto; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--borda); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { font-size: .85rem; color: var(--suave); }
tr.inativo td { color: var(--suave); }
.acoes { display: flex; gap: .75rem; justify-content: flex-end; }
.cor { display: inline-block; width: .8rem; height: .8rem; margin-right: .4rem; border-radius: 50%; }
code { font-size: .8rem; }

.paginacao { display: flex; justify-content: space-between; margin-top: .75rem; }

@media (min-width: 768px) {
    .menu { order: 0; flex-basis: auto; }
}

h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.aviso-atencao { background: #fff4d6; color: #6b4e00; }

.filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin-bottom: .75rem; }
.filtros label { flex: 1 1 8rem; }

.conteudo:has(.grade) { max-width: none; }
.grade { display: flex; overflow-x: auto; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; }
.horas { flex: 0 0 3.2rem; position: sticky; left: 0; z-index: 3; background: var(--cartao); border-right: 1px solid var(--borda); }
.coluna { flex: 1 0 9.5rem; min-width: 0; border-right: 1px solid var(--borda); }
.coluna:last-child { border-right: 0; }
.titulo-coluna { height: 2.6rem; padding: .4rem; overflow: hidden; font-weight: 600; font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; border-bottom: 1px solid var(--borda); }
.titulo-coluna a { text-decoration: none; }
.grade { --passo: 40px; }
.trilho { position: relative; height: calc(var(--minutos) / var(--intervalo) * var(--passo)); background-image: repeating-linear-gradient(to bottom, var(--borda) 0 1px, transparent 1px var(--passo)); }
.hora { position: absolute; left: .3rem; font-size: .72rem; color: var(--suave); }
.hora-cheia { font-weight: 700; color: var(--texto); }
.slot { position: absolute; left: 0; right: 0; }
.slot:hover, .slot:focus-visible { background: color-mix(in srgb, var(--marca) 14%, transparent); outline: none; }
.bloco { position: absolute; z-index: 1; overflow: hidden; padding: .1rem .3rem; font-size: .75rem; line-height: 1.2; text-decoration: none; border: 1px solid #fff; border-radius: 6px; }
.bloco small { display: block; }
.bloco-bloqueio { color: #f3eef1; background: #3a3237; }

.entrada-fila { margin-bottom: .75rem; }
.entrada-fila .botao-leve { width: 100%; margin-top: .25rem; }

.abas { display: flex; gap: .25rem; margin-bottom: .5rem; overflow-x: auto; }
.abas a { padding: .45rem .8rem; white-space: nowrap; text-decoration: none; border: 1px solid var(--borda); border-radius: 999px; }
.abas a.ativa { color: var(--marca-texto); background: var(--marca); border-color: var(--marca); }
.links-estoque { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .25rem 0 .75rem; }

.item-comanda { margin-bottom: .75rem; gap: .5rem; }
.linha-item { display: grid; grid-template-columns: 1fr 6rem auto; gap: .4rem; }
.total-comanda { font-size: 1.15rem; }

.linha-pacote { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .4rem; }
.quebra { white-space: normal; min-width: 18rem; }
details summary { cursor: pointer; color: var(--marca); }

.conteudo:has(.indicadores) { max-width: 1100px; }
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.indicador { display: grid; gap: .1rem; padding: .75rem; color: inherit; text-decoration: none; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; }
.indicador strong { font-size: 1.25rem; }
.indicador small { color: var(--suave); }
.atalhos { display: flex; flex-wrap: wrap; gap: .5rem; }
.linha-hoje { grid-template-columns: auto 1fr; margin-bottom: .5rem; color: inherit; text-decoration: none; }
.meta { display: grid; gap: .2rem; }
.meta-titulo { display: flex; justify-content: space-between; }
.barra { height: 8px; overflow: hidden; background: var(--borda); border-radius: 999px; }
.barra span { display: block; height: 100%; background: var(--marca); border-radius: 999px; }
.grafico { margin: 0; padding: .75rem; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; }
.grafico svg { display: block; width: 100%; height: auto; }
.grafico .eixo { stroke: var(--borda); }
.grafico .barra-mes { fill: var(--marca); }
.grafico g:hover .barra-mes { opacity: .8; }
.grafico text { font: 13px system-ui, sans-serif; }
.grafico .valor { fill: var(--texto); font-weight: 600; }
.grafico .rotulo { fill: var(--suave); }
.mapa td, .mapa th { padding: .3rem; text-align: center; }
.mapa td { min-width: 2.2rem; font-size: .8rem; background: color-mix(in srgb, var(--marca) var(--forca), transparent); }

.linha-unificar { display: grid; grid-template-columns: auto auto 1fr; gap: .5rem; align-items: center; }

.janela { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 10px; }
.janela::backdrop { background: rgb(0 0 0 / .45); }
.janela h2 { margin: 0; }
.acoes-janela { display: flex; justify-content: space-between; gap: .5rem; }
.cliente-nova { display: grid; gap: .6rem; margin-top: .5rem; }
[data-servicos] { display: grid; gap: .6rem; }
.status-atendimento { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.dias-semana { display: flex; flex-wrap: wrap; gap: .25rem .75rem; margin-bottom: .5rem; }
.bloco .selo { font-weight: 700; }
.bloco-faltou { opacity: .55; text-decoration: line-through; }
.bloco-atendido { opacity: .8; }
.foto { width: 1.5rem; height: 1.5rem; margin-right: .25rem; vertical-align: middle; object-fit: cover; border-radius: 50%; }
.arrastando .bloco { pointer-events: none; }
.slot.alvo { background: color-mix(in srgb, var(--marca) 30%, transparent); }

.lista-ordem { display: grid; gap: .4rem; padding: 0; list-style-position: inside; }
.lista-ordem li { padding: .5rem .75rem; background: var(--cartao); border: 1px solid var(--borda); border-radius: 10px; }
.lista-ordem span { font-weight: 600; }
.lista-ordem form { display: flex; gap: .3rem; margin-top: .35rem; }
.lista-ordem .botao { min-width: 44px; padding: .3rem .6rem; }
.lista-ordem .botao:disabled { opacity: .35; cursor: default; }

.janela { width: min(58rem, calc(100vw - 2rem)); }
.agendamento-grade { display: grid; gap: .9rem; }
.agendamento-campos { display: grid; gap: .9rem; min-width: 0; }
[data-itens] { display: grid; gap: .6rem; }
.item-agendamento { position: relative; display: grid; gap: .6rem; }
.item-ativo { border-color: var(--marca); }
.remover-item { position: absolute; top: -.2rem; right: .6rem; }
.painel-horarios { display: grid; gap: .4rem; align-content: start; padding: .6rem; background: var(--fundo); border: 1px solid var(--borda); border-radius: 8px; }
.painel-horarios p { margin: 0; font-size: .8rem; }
.horarios-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr)); gap: .3rem; }
.horario { min-height: 40px; padding: .2rem; font: inherit; font-size: .85rem; color: var(--marca); cursor: pointer; background: var(--cartao); border: 1px solid var(--marca); border-radius: 6px; }
.horario.ocupado { color: var(--suave); text-decoration: line-through; background: var(--borda); border-color: var(--borda); }
.horario.nao-cabe { color: var(--suave); border-style: dashed; border-color: var(--suave); }
.horario.escolhido { color: var(--marca-texto); text-decoration: none; background: var(--marca); border-color: var(--marca); }

@media (min-width: 800px) {
    .agendamento-grade { grid-template-columns: minmax(0, 1fr) 16rem; }
    .painel-horarios { position: sticky; top: 0; max-height: 70vh; overflow-y: auto; }
}

@media (min-width: 560px) {
    .item-agendamento { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 7rem; align-items: end; }
    .item-agendamento .painel-horarios { grid-column: 1 / -1; }
}

.horario.escolhido.ocupado { color: var(--erro-texto); text-decoration: line-through; background: var(--erro-fundo); border: 2px solid var(--erro-texto); }

.camada-blocos { position: absolute; inset: 0; pointer-events: none; }
.camada-blocos.com-faixa { right: 1.75rem; }
.camada-blocos .bloco { pointer-events: auto; }
.arrastando .camada-blocos .bloco { pointer-events: none; }
.slot:hover::after, .slot:focus-visible::after { content: '+'; position: absolute; top: 50%; right: .55rem; font-weight: 700; color: var(--marca); transform: translateY(-50%); }
.painel-horarios .aviso { margin: 0; padding: .4rem .5rem; font-size: .85rem; }

.categoria { padding: .25rem 0; border-top: 1px solid var(--borda); }
.categoria summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.categoria > .marcar { padding-left: 1.5rem; }

.linha-vale { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.resumo-pagamento { display: grid; gap: .2rem; padding: .6rem; background: var(--fundo); border-radius: 8px; }
.resumo-pagamento div { display: flex; justify-content: space-between; gap: 1rem; }
.resumo-pagamento .liquido { font-size: 1.15rem; }
.receber { margin-bottom: 1rem; }
.receber summary { cursor: pointer; list-style: none; margin-bottom: .6rem; }

.adicionar { margin-bottom: .5rem; padding: .7rem .9rem; background: var(--cartao); border: 1px solid var(--borda); border-radius: 12px; }
.adicionar .cartao { margin: .6rem 0 0; padding: 0; border: 0; box-shadow: none; }
.item-comanda details { font-size: .95rem; }

/* Estoque: mesma tela do sistema antigo. */
.conteudo:has(.est) { max-width: 1240px; }
.est [hidden] { display: none !important; }
.est-totais { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.2rem; }
.est-totais > div { padding: .9rem 1.1rem; background: var(--cartao); border: 1px solid var(--borda); border-radius: 14px; }
.est-totais b { display: block; font-size: 1.6rem; line-height: 1.1; }
.est-totais small { display: block; margin-top: .3rem; color: var(--suave); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.est-totais .alerta b { color: #c62828; }
.est-busca { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; }
.est-campo { flex: 1; min-width: 240px; }
.est-campo input { width: 100%; padding: .9rem 1rem; font-size: 1.05rem; font-weight: 600; border: 2px solid var(--borda); border-radius: 14px; }
.est-repor { padding: .6rem 1.1rem; font: inherit; font-size: .9rem; font-weight: 700; color: var(--texto); background: var(--cartao); border: 2px solid var(--borda); border-radius: 14px; cursor: pointer; }
.est-repor span { margin-left: .45rem; padding: .1rem .5rem; font-size: .75rem; color: #fff; background: #c62828; border-radius: 999px; }
.est-repor.ligado { color: #fff; background: #c62828; border-color: #c62828; }
.est-repor.ligado span { background: rgba(255, 255, 255, .25); }
.est-marcas, .est-linhas { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .6rem; }
.est-chip { display: flex; align-items: center; gap: .45rem; padding: .5rem .95rem; font: inherit; font-size: .9rem; font-weight: 700; color: var(--texto); background: var(--cartao); border: 2px solid var(--borda); border-radius: 999px; cursor: pointer; }
.est-chip .ponto { width: 10px; height: 10px; background: var(--cor); border-radius: 50%; }
.est-chip small { color: var(--suave); font-weight: 600; }
.est-chip.ligado { color: var(--cartao); background: var(--cor); border-color: var(--cor); }
.est-chip.ligado small { color: inherit; opacity: .8; }
.est-chip.ligado .ponto { background: var(--cartao); }
.est-linha { padding: .35rem .8rem; font: inherit; font-size: .82rem; font-weight: 600; color: var(--suave); background: var(--cartao); border: 1px solid var(--borda); border-radius: 999px; cursor: pointer; }
.est-linha.ligado { color: var(--cartao); background: var(--texto); border-color: var(--texto); }
.est-grupo { display: flex; align-items: center; gap: .6rem; margin: 1.5rem 0 .75rem; font-size: .82rem; font-weight: 800; color: var(--cor); text-transform: uppercase; letter-spacing: .06em; }
.est-grupo span { width: 4px; height: 17px; background: var(--cor); border-radius: 2px; }
.est-grupo small { color: var(--suave); font-weight: 600; letter-spacing: 0; }
.est-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.est-cartao { display: flex; flex-direction: column; min-width: 0; padding: .85rem .95rem .8rem; background: var(--cartao); border: 1px solid var(--borda); border-left: 5px solid var(--cor); border-radius: 14px; }
.est-cartao.baixo { background: var(--erro-fundo); border-color: #f3c9c9; border-left-color: #c62828; }
.est-topo { display: flex; justify-content: space-between; gap: .5rem; }
.est-topo small { font-size: .63rem; font-weight: 800; color: var(--cor); text-transform: uppercase; letter-spacing: .07em; }
.est-topo em { padding: .15rem .4rem; font-size: .63rem; font-style: normal; font-weight: 800; color: #fff; text-transform: uppercase; background: #c62828; border-radius: 5px; }
.est-codigo { margin: .15rem 0 .6rem; font-size: 1.85rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; color: var(--cor); text-decoration: none; overflow-wrap: anywhere; }
.est-qtd { font-size: .8rem; font-weight: 700; color: var(--suave); }
.est-qtd strong { font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: #1b7a3d; }
.est-cartao.baixo .est-qtd strong { color: #c62828; }
.est-qtd strong.zero { color: var(--suave); }
.est-minimo { margin-bottom: .7rem; font-size: .75rem; font-weight: 600; color: var(--suave); }
.est-barra { height: 5px; margin-bottom: .75rem; overflow: hidden; background: var(--borda); border-radius: 99px; }
.est-barra div { height: 100%; background: var(--cor); border-radius: 99px; }
.est-cartao.baixo .est-barra div { background: #c62828; }
.est-acoes { display: flex; gap: .35rem; margin-top: auto; }
.est-acoes input { width: 52px; padding: .5rem .1rem; font-weight: 700; text-align: center; border: 2px solid var(--borda); border-radius: 10px; }
.est-acoes button { flex: 1; padding: .6rem .2rem; font: inherit; font-size: .88rem; font-weight: 800; border: 0; border-radius: 10px; cursor: pointer; }
.est-acoes button:disabled { opacity: .45; cursor: default; }
.est-acoes .sai { color: #c62828; background: #fce9e9; }
.est-acoes .entra { color: #1b7a3d; background: #e4f3e7; }
.est-vazio { padding: 3.5rem 1.2rem; font-weight: 600; color: var(--suave); text-align: center; }
.est-aviso { position: fixed; left: 50%; bottom: 24px; z-index: 200; padding: .8rem 1.5rem; font-weight: 700; color: #fff; background: #1b1b1f; border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); transform: translateX(-50%); }
.est-aviso.erro { background: #c62828; }
.est-modal-fundo { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.1rem; background: rgba(15, 15, 20, .55); }
.est-modal { display: grid; gap: .7rem; width: 100%; max-width: 400px; padding: 1.5rem; background: var(--cartao); border-radius: 16px; }
.est-modal h3, .est-modal p { margin: 0; }
.est-modal label { display: grid; gap: .3rem; }
.est-modal-botoes { display: flex; gap: .5rem; }
.est-modal-botoes .botao { flex: 1; }
@media (max-width: 640px) {
    .est-grade { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
    .est-codigo { font-size: 1.55rem; }
    .est-qtd strong { font-size: 1.8rem; }
    .est-cartao { padding: .75rem; }
    .est-acoes { display: grid; grid-template-columns: 1fr 1fr; }
    .est-acoes input { grid-column: 1 / -1; width: 100%; }
    .est-acoes button { min-width: 0; font-size: .78rem; white-space: nowrap; }
    .est-totais { grid-template-columns: 1fr 1fr; gap: .6rem; }
}

/* Afastamento da agenda e barra de deslize em cima da grade. */
.visao-agenda { display: inline-flex; margin-bottom: .75rem; overflow: hidden; border: 1px solid var(--borda); border-radius: 8px; }
.visao-agenda button { padding: .4rem .8rem; font: inherit; font-size: .88rem; color: var(--texto); background: var(--cartao); border: 0; border-right: 1px solid var(--borda); cursor: pointer; }
.visao-agenda button:last-child { border-right: 0; }
.visao-agenda button[aria-pressed="true"] { color: var(--marca-texto); background: var(--marca); }
.barra-agenda { position: sticky; top: 0; z-index: 4; overflow-x: auto; overflow-y: hidden; }
.barra-agenda div { height: 1px; }
.grade[data-visao="afastada"] { --passo: 26px; }
.grade[data-visao="afastada"] .coluna { flex-basis: 6rem; }
.grade[data-visao="afastada"] .horas { flex-basis: 2.6rem; }
.grade[data-visao="afastada"] .bloco, .grade[data-visao="dia-inteiro"] .bloco { padding: 0 .15rem; font-size: .66rem; line-height: 1.15; }
.grade[data-visao="afastada"] .titulo-coluna, .grade[data-visao="dia-inteiro"] .titulo-coluna { height: 2rem; padding: .3rem .25rem; font-size: .78rem; }
.grade[data-visao="afastada"] .foto, .grade[data-visao="dia-inteiro"] .foto { display: none; }
.grade[data-visao="afastada"] .camada-blocos.com-faixa, .grade[data-visao="dia-inteiro"] .camada-blocos.com-faixa { right: .5rem; }
.grade[data-visao="afastada"] .slot::after, .grade[data-visao="dia-inteiro"] .slot::after { display: none; }
.grade[data-visao="dia-inteiro"] .coluna { flex: 1 1 3.5rem; }
.grade[data-visao="dia-inteiro"] .horas { flex-basis: 2.4rem; }
.grade[data-visao="dia-inteiro"] .hora { left: .15rem; font-size: .62rem; }
.grade[data-visao="dia-inteiro"] .hora:not(.hora-cheia) { display: none; }
.grade[data-visao="dia-inteiro"] .bloco small, .grade[data-visao="dia-inteiro"] .bloco strong { display: none; }
