/* Plátano Vendas — mesmo visual do painel: tokens de settings.json (tokens.css), Inter/SF, vidro e "rise". */
@font-face { font-family: "Inter"; src: url(/fonts/inter-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/fonts/inter-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root { --bg: var(--paper); --text: var(--charcoal); --card: var(--white); --line: var(--gray-200); color-scheme: light dark; }
html, body { background: var(--bg); color: var(--text); font: 500 15px/1.47 var(--font-sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 24px); overscroll-behavior-y: contain; }
main { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; animation: view-in var(--slow) var(--ease); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; letter-spacing: var(--tracking-title); }

/* topo */
.top { display: flex; align-items: center; gap: 10px; padding: 4px 2px 6px; }
.logo { width: 36px; height: 36px; border-radius: 10px; animation: banana-idle 4s ease-in-out infinite; }
.brand { flex: 1; display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 19px; font-weight: 700; letter-spacing: var(--tracking-title); }
.live { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2s infinite; }
.live.off i { background: var(--gray-400); animation: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow-sm); }
.icon-btn:active { transform: scale(.92); }

/* cartões */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-md); animation: rise var(--slow) var(--ease) both; }
.card h2 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.hint { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); box-shadow: none; }
.hint b { color: var(--text); font-size: 14px; }
.hint em { font-style: normal; color: var(--text); font-weight: 700; }
.hint.action { border: 0; background: var(--lime); color: var(--ink); cursor: pointer; }
.hint.action b { color: var(--ink); }
.hint.action:active { transform: scale(.98); }

/* período */
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--gray-100); border-radius: 12px; padding: 3px; }
.seg button { position: relative; z-index: 1; padding: 7px 0; font-size: 13px; font-weight: 700; color: var(--muted); transition: color var(--base) var(--ease); }
.seg button[aria-selected="true"] { color: var(--text); }
.seg .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 9px; background: var(--card);
  box-shadow: var(--shadow-sm); transition: transform var(--base) var(--ease); }

/* faturamento */
.hero { position: relative; overflow: hidden; padding: 18px 18px 14px; }
.hero::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--lime) 45%, transparent), transparent); opacity: .5; animation: e17-aurora 9s ease-in-out infinite alternate; pointer-events: none; }
.hero small { font-size: 13px; color: var(--muted); font-weight: 500; }
.hero strong { display: block; font-size: clamp(34px, 11vw, 46px); font-weight: 700; line-height: 1.1; margin: 2px 0; }
.hero .sub { font-size: 13px; color: var(--muted); }
.hero.flash strong { animation: credPulse .9s var(--ease); }
.chart { width: 100%; height: 96px; margin-top: 12px; overflow: visible; }
.chart rect { fill: var(--lime); transform-origin: bottom; transform-box: fill-box; animation: grow var(--slow) var(--ease) both; }
.chart polyline { fill: none; stroke: var(--lavender); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart line { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.dot.lime { background: var(--lime); } .dot.lav { background: var(--lavender); }

/* indicadores */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { padding: 13px 14px; min-height: 78px; display: flex; flex-direction: column; justify-content: space-between; }
.kpi small { font-size: 12px; color: var(--muted); }
.kpi strong { font-size: 21px; font-weight: 700; }
.kpi.good strong { color: var(--success); } .kpi.bad strong { color: var(--danger); }
.kpi.mini strong { font-size: 17px; }
.kpi .none { color: var(--gray-400); }

/* vendas */
.list { list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li.new { animation: sePop .6s var(--ease); }
.coin { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--lime) 85%, transparent); color: var(--ink); font-weight: 700; flex: none; }
.refunded .coin { background: var(--gray-100); color: var(--muted); }
.list .what { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list .what span { font-size: 12px; color: var(--muted); }
.list .val { font-weight: 700; }
.refunded .val { color: var(--muted); text-decoration: line-through; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.foot { text-align: center; font-size: 12px; color: var(--muted); }

/* login */
.login { min-height: 80dvh; justify-content: center; text-align: center; align-items: center; }
.login-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow-lg); animation: banana-idle 4s ease-in-out infinite; }
.login h1 { font-size: 28px; letter-spacing: var(--tracking-title); margin-top: 8px; }
.login p { color: var(--muted); }
.login form { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.login input { font: 700 20px var(--font-sans); text-align: center; letter-spacing: .08em; padding: 14px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--card); color: var(--text); text-transform: uppercase; }
.login input:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.err { color: var(--danger); font-size: 13px; min-height: 1.4em; }
.btn { padding: 13px 16px; border-radius: var(--radius-md); font-weight: 700; background: var(--gray-100); transition: transform var(--fast) var(--ease); }
.btn.primary { background: var(--lime); color: var(--ink); }
.btn:active { transform: scale(.97); }

/* ajustes */
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .35); animation: view-in var(--base) var(--ease); }
.sheet-panel { width: 100%; max-width: 520px; margin: 0 auto; background: var(--card); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px); display: flex; flex-direction: column; gap: 4px; animation: sheet-in var(--slow) var(--ease);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--gray-200); margin: 0 auto 8px; }
.sheet h2 { font-size: 17px; margin-bottom: 6px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.row span { color: var(--muted); font-size: 14px; }
.row.danger { color: var(--danger); border: 0; }
.sheet .btn { margin-top: 8px; }

/* aviso de venda na tela */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 10px); z-index: 20; transform: translate(-50%, -150%);
  background: var(--lime); color: var(--ink); font-weight: 700; padding: 12px 18px; border-radius: 999px; box-shadow: var(--shadow-lg);
  transition: transform var(--slow) var(--ease); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }

/* esqueleto enquanto carrega */
.loading .num, .loading .kpi strong { color: transparent; border-radius: 6px; background: linear-gradient(90deg, var(--gray-100), var(--gray-200), var(--gray-100)) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }

@keyframes view-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
@keyframes sePop { from { transform: scale(.94); opacity: .3; background: color-mix(in srgb, var(--lime) 25%, transparent); } }
@keyframes credPulse { 40% { color: var(--success); transform: scale(1.04); } }
@keyframes banana-idle { 50% { transform: rotate(-6deg) translateY(-2px); } }
@keyframes e17-aurora { 100% { transform: translate(-8%, 6%) scale(1.15); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
