/* Painel admin + cartão do cliente — reaproveita tokens e componentes de /css/site.css (Melt) */
.admin { min-height: 100svh; }
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 10.5px; }
.btn-sm svg { width: 16px; height: 16px; }

/* campos */
.field { display: grid; gap: 6px; text-align: left; }
.field span { font-size: 10.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--text-muted); }
.field input {
  min-height: 48px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--bg);
  font-family: var(--sans); font-size: 16px; color: var(--off); transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: color-mix(in srgb, var(--creme) 35%, transparent); }
.field input:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bronze) 22%, transparent); }
.form-erro { font-size: 13px; color: #e8a08c; min-height: 1em; }
.form-erro:empty { display: none; }

/* acesso */
.auth { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 16px; text-align: center; background: var(--surface); border: 1px solid var(--line); padding: 32px 24px; border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.auth-card img { width: 200px; margin: 0 auto 4px; }
.auth-card h1 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 38px; line-height: 1; color: var(--off); }

/* topo */
.adm-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
           padding: 10px var(--gutter); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.adm-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.adm-brand img { height: 34px; width: auto; }
.adm-brand span { font-size: 10.5px; font-weight: 500; letter-spacing: .3em; text-transform: uppercase; color: var(--bronze); padding-left: 14px; border-left: 1px solid var(--line-strong); }

/* números */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 16px var(--gutter) 0; max-width: 1280px; margin: 0 auto; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: grid; gap: 2px; }
.stat span { font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); }
.stat b { font-family: var(--display); font-weight: 500; font-size: 32px; line-height: 1.15; color: var(--off); font-variant-numeric: lining-nums tabular-nums; }
.stat-hl { background: var(--bronze); border-color: var(--bronze); }
.stat-hl span { color: color-mix(in srgb, var(--choc-900) 75%, var(--bronze)); }
.stat-hl b { color: var(--choc-900); }

/* painéis */
.panes { display: grid; gap: 16px; padding: 16px var(--gutter) 40px; max-width: 1280px; margin: 0 auto; }
@media (min-width: 960px) { .panes { grid-template-columns: 380px 1fr; align-items: start; } }

.list-pane { display: grid; gap: 12px; }
.list-tools { display: flex; gap: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 44px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--line); color: var(--text-muted); }
.search:focus-within { border-color: var(--bronze); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; border: 0; background: none; font-family: var(--sans); font-size: 15px; color: var(--off); min-width: 0; }
.search input::placeholder { color: color-mix(in srgb, var(--creme) 40%, transparent); }
.search input:focus { outline: none; }

.clientes { list-style: none; display: grid; gap: 8px; }
@media (min-width: 960px) { .clientes { max-height: calc(100svh - 270px); overflow-y: auto; padding: 2px; } }
.cli {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; text-align: left;
  padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line);
  transition: transform .2s var(--ease-out), border-color .2s;
}
.cli:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.cli[aria-current="true"] { border-color: var(--bronze); }
.cli-nome { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--off); line-height: 1.2; }
.cli-tel { font-size: 12px; color: var(--text-muted); }
.cli-prog { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: var(--bronze); border-radius: inherit; transform-origin: left; transition: transform .5s var(--ease-out); }
.cli-prog small { font-size: 11px; color: var(--text-muted); font-variant-numeric: lining-nums tabular-nums; }
.pill-premio { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
               background: var(--bronze); color: var(--choc-900); padding: 5px 9px; border-radius: var(--radius-full); white-space: nowrap; }
.pill-premio svg { width: 13px; height: 13px; }
.lista-vazia { text-align: center; padding: 32px 12px; color: var(--text-muted); font-size: 15px; }

/* detalhe */
.detail-pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); min-height: 420px; }
.empty-detail { display: grid; place-items: center; align-content: center; gap: 16px; min-height: 420px; text-align: center; color: var(--text-muted); font-size: 15px; padding: 24px; }
.empty-detail img { width: 150px; opacity: .45; }
@media (max-width: 959px) {
  .detail-pane:not(.open) { display: none; }
  .detail-pane.open { position: fixed; inset: 0; z-index: 40; border-radius: 0; border: 0; overflow-y: auto; animation: slide-in .4s var(--ease-drawer); }
  .detail-pane .empty-detail { display: none; }
}
@keyframes slide-in { from { transform: translateX(100%); } }
.det { padding: 20px; display: grid; gap: 22px; }
@media (min-width: 960px) { .det { padding: 28px; } }
.det-head { display: flex; align-items: flex-start; gap: 12px; }
.det-head .voltar { display: none; }
@media (max-width: 959px) { .det-head .voltar { display: grid; } }
.det-head h2 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 5vw, 42px); line-height: 1.1; color: var(--off); }
.det-head .tel { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.det-head .acoes { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* cartão de carimbos: cartão creme + impressão cacau (identidade das embalagens) */
.cartao {
  position: relative; border-radius: var(--radius-xl); padding: 20px; color: var(--ink); overflow: hidden;
  background: var(--creme); box-shadow: var(--shadow);
}
.cartao::after { content: ""; position: absolute; width: 240px; height: 240px; right: -100px; top: -120px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--cobre) 45%, transparent); }
.cartao-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cartao-top .eyebrow { color: var(--cobre); }
.cartao-top b { font-family: var(--display); font-weight: 500; font-size: 22px; font-variant-numeric: lining-nums tabular-nums; }
.selos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 16px 0 12px; max-width: 400px; }
.selo {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed color-mix(in srgb, var(--ink) 40%, transparent);
  font-size: 12px; font-weight: 500; color: color-mix(in srgb, var(--ink) 50%, transparent);
}
.selo.on { border-style: solid; border-color: var(--ink); background: var(--ink); color: var(--bronze); }
.selo svg { width: 44%; height: 44%; }
.selo.pop { animation: stamp .55s var(--ease-spring) both; animation-delay: var(--d, 0ms); }
@keyframes stamp { 0% { transform: scale(1.8) rotate(-14deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.cartao-msg { font-size: 15px; }
.cartao-msg b { font-weight: 600; }
.premio-box { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
              padding: 12px 14px; border-radius: var(--radius-lg); background: var(--ink); color: var(--creme); }
.premio-box p { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.premio-box svg { width: 20px; height: 20px; color: var(--bronze); }
.premio-box .btn { background: var(--bronze); color: var(--choc-900); }
.premio-box .btn:hover { background: var(--creme); }

/* compra */
.bloco { display: grid; gap: 12px; }
.bloco h3 { font-size: 10.5px; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--bronze); }
.prods { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.prod { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: var(--radius-md); background: var(--bg); border: 1px solid var(--line); transition: border-color .2s; }
.prod.sel { border-color: var(--bronze); }
.prod img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); }
.prod .pn { font-size: 13.5px; font-weight: 400; color: var(--creme); line-height: 1.25; }
.prod .stepper button { width: 34px; height: 36px; font-size: 18px; }
.prod .stepper output { min-width: 20px; }
.prod-avulso img { display: none; }
.prod-avulso { grid-template-columns: 1fr auto; }
.compra-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.compra-foot p { font-size: 14.5px; color: var(--text-muted); }
.compra-foot p b { color: var(--off); font-weight: 500; }

/* histórico */
.hist { list-style: none; display: grid; gap: 8px; }
.hist li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-md); background: var(--bg); border: 1px solid var(--line); }
.hist .h1 { font-family: var(--display); font-weight: 500; color: var(--off); font-size: 16px; }
.hist .h2 { font-size: 13px; color: var(--text-muted); }
.hist li.cancel { opacity: .5; }
.hist li.cancel .h1 { text-decoration: line-through; }
.hist .tipo-premio .h1 { color: var(--bronze); }
.link-btn { font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze); padding: 8px; border-radius: var(--radius-sm); }
.link-btn:hover { background: color-mix(in srgb, var(--bronze) 10%, transparent); }

/* modal */
.modal {
  position: fixed; z-index: 50; left: 50%; top: 50%; width: min(420px, calc(100vw - 32px)); translate: -50% -50%;
  display: grid; gap: 14px; padding: 22px; border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: modal-in .3s var(--ease-out);
}
@keyframes modal-in { from { opacity: 0; transform: scale(.96); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 30px; color: var(--off); }

/* no celular o botão de registrar fica sempre à mão */
@media (max-width: 959px) {
  .compra-foot { position: sticky; bottom: 0; z-index: 2; margin: 0 -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
                 background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -10px 20px -16px #000; }
}

@media (prefers-reduced-motion: reduce) {
  .selo.pop, .detail-pane.open, .modal { animation: none; }
}
